[sdiy] MIDI bytestream parser

David Brown davebr at earthlink.net
Wed Nov 17 04:09:19 CET 2010


I've been following this thread so I thought I would share my 
experiences with MIDI processing.

I've implemented a midi parser in both assembly and basic.  I'm not 
sure of the end project in mind for this thread, but my work started 
out as programs for my ComputerVoltageSource 
http://modularsynthesis.com/cvs/cvs.htm

A lot of what I did was convert various MIDI messages to CV, or 
process the MIDI stream to change controllers, messages, or transpose 
keys or channels.  Some of the more fun programs are to reverse the 
keyboard from end to end. http://modularsynthesis.com/programs/programs.htm

I integrated that MIDI code into my bass pedals so I can scan the 
pedals, convert to MIDI notes or arpeggiation sequences, and merge 
the bass MIDI with an incoming MIDI stream from another synth.  To do 
that, I need to expand the running status so I can merge the messages 
correctly with their own MIDI channel. 
http://modularsynthesis.com/basspedals/basspedals.htm  All of my 
basic source code is found on the various project pages.

I've also implemented this code structure in AVR assembly using an 
ATTINY2313.  I've used it for a variety or projects including a sysex 
display driver (e.g. send messages to a LCD display as a sysex 
message) http://modularsynthesis.com/cvs/cvs2.htm, a MIDI keyboard 
split http://modularsynthesis.com/custom/custom.htm, a MIDI note 
transpose for my keyboard 
http://modularsynthesis.com/kurzweil/kurzweil.htm, and a MIDI-powered 
MIDI processor http://modularsynthesis.com/processor/processor.htm.

The latter is what I used for my MIDI keyboard split and I've done 
some custom versions for people.  One useful implementation was to 
remap MIDI volume and expression messages.  Roland tends to use 
expression messages and many other synths use volume messages.  If 
you are driving both kinds of synths from a single controller, the 
volume pedal won't interoperate with Roland.  That's an easy 
on-the-fly message transpose.  My AVR assembly source is on my MIDI 
processor page.

It would be interesting to benchmark the performance differences 
between my assembly and basic implementations.  I've never had an 
issue with being able to keep up with incoming MIDI messages, but my 
controllers tend to not use a lot of real-time messages.

Dave 




More information about the Synth-diy mailing list