Controlling analog synths with computers (fwd)
Magnus Danielson
e93_mda at drum.it.kth.se
Fri Nov 22 05:14:30 CET 1996
> Amen to Gene's comments: MIDI parsing thing is not as simple as it first
> appears. At least for a full featured implementation. I think there are many
> nuances and even some common misinterpretations of the MIDI spec that makes it
> even trickier.
So, what are those common misinterpretations?
I have an old piece of MIDI parser somewhere in my archive...
> I wrote such a MIDI parser in C for a MIDI-to-Prophet controller for my
> el-cheapo 16 Mhz 286 machine which has no problem keeping up. But the code
> quickly turned into something I wasn't very proud of (spaghetti code but it
> worked!). In hindsight, I would have put alot more effort up front into a real
> sleek event dispatcher (kinda like a Windows 3.1 style thing). Then the actual
> parsing code would have been alot simpler. Better yet, a multitasking kernel
> would be best. Instead I chose a dumb loop that waits for a byte then enters
> this big huge switch statement. It was all downhill from there. Enuf said!
Multitasking kernel, well, there is Linux which you may stripp down if you want
to do it on a 386 or something.
Otherwise can you make a ligthweigth Real Time kernel in not too many bytes
really... depends on what you want it to do.
My MIDI parser was based upon the MPU-401 card (useing the more intelligent
interface than UART mode provides, and save some headache with it).
Ah, now I found the code on some old disc, haven't touched it since 93 is
seems,
but most of it seems to date back to December 90... time flies...
Anyway, I made range checks, so that common classes of commands had their own
tailourmade switch/if clauses and then fired the function calls of as needed.
The tricky thing was to figure out on how to make a flexible interface to a
dynamic set of sys-ex modules, which eventually turned out to become another
generic class in my library of classes.
Like most of those projects it never left the ground, but it resulted in a
bunch
of neat ideas which other things benifited from.
My intensions was to get a PC based control over my S1000 (I still got the
sys-ex for it as well as the box itself) and be able to move samples back and
forth.
If someone want's to peek into the code, let me know... even if it is out of
date with my current codeing principles.
This code will however not show all subtle things of a MIDI implementation
since
it really relies on the MIDI implementation in the MPU-401 card.
Cheers,
Magnus
More information about the Synth-diy
mailing list