[linux-audio-dev] Basic MIDI question

Lee Revell rlrevell at joe-job.com
Mon Jul 24 23:38:47 UTC 2006


On Tue, 2006-07-25 at 01:33 +0200, Jens M Andreasen wrote:
> On Mon, 2006-07-24 at 19:28 -0400, Lee Revell wrote:
> > On Tue, 2006-07-25 at 01:19 +0200, Jens M Andreasen wrote:
> > > On Mon, 2006-07-24 at 17:55 -0400, Lee Revell wrote:
> > > 
> > > > Ugh.  All I need to do is snoop note on, note off, and the note number.
> > > > But you're saying that 0x81 is sometimes part of a timestamp, and other
> > > > times it means note off on channel 1?
> > > > 
> > > > So you are saying my driver needs to have full knowledge of the MIDI
> > > > state machine in order to snoop note on and note off?
> > > > 
> > > Driver? This is a driver for a midi-port on a sound-card or a some kind
> > > of midi-file player?
> > 
> > It's similar to a driver for a MIDI port on a sound card, except the
> > driver additionally has to respond to note on and note off by twiddling
> > some other bits in the hardware.  It's equivalent to having to flash an
> > LED for note on and another for note off.
> > 
> > I wrote the driver as an ALSA rawmidi device, which was probably not the
> > best idea - I did not realize at the time that I would have to interpret
> > the MIDI stream.  An ALSA kernel sequencer client would have been more
> > appropriate.
> 
> Confused again here. There are no delta-times in the midi-stream. You
> mean: " ...  have to interpret the midi *file*"
> 

I think it's me that's confused - as you can see I'm certainly not a
MIDI expert.

When playing a MIDI file to a rawmidi port with aplaymidi, it was not
clear to me that it just passes the file through - I was under the
impression that the driver would only see the actual events, not the
timestamps and other metadata.

Lee




More information about the Linux-audio-dev mailing list