Is there any script/software/algorithm which allows to convert a MIDI (or WAV) file to a list of <frequency, duration>
so that we can replay an 'image' of this sound file, for example, through the System.Console.Beep(frequency, duration)
function in C#?
Key Difference: WAV is an audio format. It stands for Waveform Audio File Format, and was developed by Microsoft and IBM for PCs. On the other hand, MIDI stands for Musical Instrument Digital Interface. A MIDI is a file that records music and controls the notes of each instrument, what note of the scale is, etc.
Find a WAV file's sample rate in Windows by right-clicking the file, then clicking "Properties." In the window that appears, look under "Audio Format" for a set of details including a number expressed in kilohertz (kHz): This is the sample rate.
MIDI Files contain one or more MIDI streams, with time information for each event. Song, sequence, and track structures, tempo and time signature information, are all supported. Track names and other descriptive information may be stored with the MIDI data.
You need to convert the MIDI, WAV or other sound file to raw audio samples. Then for successive blocks of samples (typically overlapping each block by 50%), apply a window function (e.g. Hanning), then an FFT, then take the magnitude of the FFT output bins, then for audio you would usually take 20*log10 of this magnitude to get a dB value.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With