96 kHz.org
Advanced Audio Recording

Conversion of Audio to MIDI Data with a DSP

This idea shows a concept how to convert audio data into MIDI data using modern signal processing methods. It can transform one channel real time audio data into tone information similar to MIDI by ay analyzing the incoming audio stream with a small algorithm.

Using a continuous multichannel multiplication of the input data with predefined sine waves, a kind of discrete Fourier transformation (DFT) is performed resulting in a spectral view of the data. By searching the spectrum for the dominant frequency, harmonics of the sound signal are ignored and thus the base frequency of the tone is found.

 

Converting Audio to MIDI with a Digital Signal Processor

To prepare the analog data stream the microphone is amplified that way, that the subsequent AD-Converter is not overloaded and appropriately fed though using an automatic gain control circuit. Hum and noise is rejected by an analog filter with 20Hz ... 5kHz characteristics. The microphone is of an electret condenser type with external phantom power.

Once, the fundamental frequency is found, the corresponding MIDI tone number is taken from the subsequently shown frequency conversion table.

 

Converting Audio to MIDI with a Digital Signal Processor

 

 This design is realized for a TMD320-DSP-System.

 

The practical tests have shown that conversion rate is an issue. Apart from the note analysis a special kind of audio clock reconstruction has to be done in order to create or synchronize to the MIDI clock. Due to the limited MIDI capabilities it is not possible to scan the audio data with a frequency just being high enough but a dynamic quantization must be applied which is not easy at all because of the dynamic tempo in most audio tracks. With synthetic tracks formerly created from MIDI sources, it works quite well.

An idea is to oversample the MIDI data and store it in a format with higher density / time resolution and possibly reprocess it afterwards. Regarding the precision of the frequency later representation a modulator based tuning can be applied which shapes the static midi frequency. But this requires a high resolution timing which hardly can be represented with standard MIDI. See the limitations of MIDI article for more information about that.

 

Read more about DSP-Systems for Audio Processing

 

© 2000 - Jürgen Schuhmacher