Thursday, October 13, 2011

MIDI synthesizer on mbed

Finally my long term desire to make a MIDI synthesizer using touchpad was satisfied. When I first thought of making a MIDI synthesizer two years ago, I was planning to do it using an AVR microcontroller but the implementation of it was procrastinated till now.

This MIDI synthesizer is implemented on mbed by using two touchpads. Each touchpad has 12 pads which correspond to 12 different notes in a single octave. So with two touchpads, we have 2 octaves that can be used to compose the song simultaneously. More touchpads can be interfaced to increase the number of octaves available simultaneously.

The basic idea is that mbed captures touch events (pad press and release events) from both the touchpads, notes the difference between the times of different events by using timer and sends a command to the PC via virtual serial port. We have written a C# windows forms application which captures the commands sent by the mbed via virtual serial port and then calculates MIDI delta time, creates the MIDI event and writes it to a file. The application also playbacks the notes when the corresponding pad on the touchpad is hit.

We have also put an LCD which shows the octave number of the touchpads. LCD also displays the FFT of the notes being played. We have provided four pushbuttons to increase or decrease the octave numbers of the touchpads.

Here is a video of our project.

Here is the mbed notebook of this project. Visit it for more information, project code and C# Windows forms application.

Scope for improvement
  •  Due to the non-availability of the sample note files of different instruments, the current playback in our project is just a sine wave of the given note frequencies. If anyone gets the sample files they can implement real playback feature.
  • More touchpads can be interfaced to give the user flexibility of composing with notes at different octaves without using pushbuttons.
  • By using MIDI waveform generation techniques, the playback can be implemented on the mbed itself.

Share your ideas for improvement. If anyone has sample note files of different instruments please share it with me. Thank you.

No comments: