MMD > Archives > September 2002 > 2002.09.02 > 10Prev  Next


Audio-to-MIDI Conversion
By Julie Porter

[ Jeffrey Borinsky wrote in 020829 MMD about the
 [ Discrete Cosine Transform (DCT):

> The set of coefficients generated by a DCT can be transformed back
> exactly to the original, subject only to normal rounding errors.

I intentionally left the details of the DCT out so as to not overwhelm
most of the MMD readers.  The point being that the rounding errors do
change the value a bit and render the compression [by DCT] useless
for text.

Basically I was referring to the class of functions that translate
between space and time.  The functions themselves do not loose the
data -- the data is lost in the translation to sampled elements.
The important thing to understand is phase relation.  Only when the
phase is recorded can the complete signal be re-constructed.

> The rest is rather technical and computer based.

Something that is not often considered is that 16 bits can represent
65536 integers.  When used to store floating point numbers, there are
also only 65536 floating point numbers as well.  In other words, floating
point numbers on a computer are not continuous in the fractions.  Most
computers store 32 bits of data, which is quite a lot of floating point
number.  However there is not an infinite number of fractions between
the whole numbers as there is in the real world.  Only bases [modulo
number systems] such as 12, 24, 60 give quarters and fractions as even
divisions with no remainders.

96 is often used in MIDI tempo calculations as it is derived from the
above base groups.  This allows for many different tempos to be set into
the MIDI file.  The real magic number is 768; I will leave it as an
exercise for the reader to see why it often appears in MIDI headers of
conversions from rolls to playable MIDI files.

Julie Porter

 [ The Fourier Transform has been around for more than 100 years and
 [ it is the inspiration for most computer data compression methods.
 [ JPEG (*.jpg) image compression is a fine example: it reduces a
 [ huge image file to a reasonable file size that is still pleasant
 [ to view.  Another example is MPEG (*.mp3) audio compression.  But
 [ JPEG and MPEG compression are lossy, which means that the full
 [ detail of the original data file cannot be recovered.  Engineers
 [ who develop computer algorithms of this sort are careful to test
 [ the effect of math rounding errors like Jeffrey and Julie mention.
 [ Compression of text files ("zipped files") is by algorithms which
 [ find and encode repeated patterns and reproduce them accurately.
 [ -- Robbie



(Message sent Mon, 2 Sep 2002 00:36:53 -0400 , from time zone -0400.)

Key Words in Subject:  Audio-to-MIDI, Conversion

Related by Subject:
2002.09.02.10 (This article) - Audio-to-MIDI Conversion
2026.02.02.03 - Seek Duo-Art to Audio Emulation in Real Time
from Phil Dayson
2025.07.05.03 - Audio-To-MIDI Transcriptions For Making Piano Rolls
from Piotr Barcz
2024.09.19.01 - MP3 Audio to MIDI Converter Program
from Spencer Chase
2024.09.19.02 - MP3 Audio to MIDI Converter Program
from Jeff Stauffer
2024.09.15.01 - Seek MP3 Audio to MIDI Converter Program
from Ben Roth
2024.01.15.01 - Converting MP3 or WAV Audio to MIDI
from Ben Roth
2023.10.21.01 - Converting Audio to MIDI: Improving the Results
from Spencer Chase
2023.06.18.01 - New Player Piano Videos With Studio Quality Audio
from Piotr Barcz
2023.06.01.02 - Converting Audio to MIDI - Support Program
from Spencer Chase
2023.05.24.01 - Converting Audio to MIDI: Michael Block Mazurkas
from Geoff Ward
2023.05.23.01 - Converting Audio to MIDI: "Francesca da Rimini"
from Jeff Stauffer