[linux-audio-user] alsa midi processor again

Peter Brinkmann brinkman at math.TU-Berlin.DE
Tue Jul 19 06:51:07 EDT 2005



> One potential advantage to doing it in csound is that it is also very 
> easy to adjust for different latencies between various synths. What we 
> did was store different delay latencies in a table, then the midi parser 
> instrument looks up the appropriate delay, and delays ouput accordingly. 
> As far as I know, doing real time timing in python is not very accurate. 
That's a problem I contemplated before I started working on the ALSA
bindings, and I work around it by not doing any actual timing in Python.

The little MIDI splitter I posted yesterday will spend most of its time
in a C subroutine that waits for incoming events, and when an event
arrives, it calls a very short Python method that handles the event
right away. I doubt you'll hear any timing inaccuracies from this method.

For the purpose of scheduling events at a later time (e.g., when playing
MIDI files), the bindings give access to ALSA sequencer queues. In other
words, Python only posts events to queues and leaves the actual timing
to ALSA, so that once again any potential timing inaccuracies of Python
don't matter.

I'm not, however, accomodating for different latencies between different
synths. If that's desired, then csound may indeed be the way to go.
    Peter




More information about the linux-audio-user mailing list