Re: [linux-audio-dev] Midi Mapper???

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] Midi Mapper???
From: Paul Davis (pbd_AT_Op.Net)
Date: Fri Jan 04 2002 - 21:17:59 EET


>My idea was that the Midi Mapper was actually a userspace daemon. User
>space process connect to the daemon with a library.

Takashi has made some promising rumbles about moving most of the ALSA
sequencer into user space at some point.

Don't underestimate the difficulties of writing real-time daemons :)

>Yes, but open() will not allow more than one program to open a device. That

this has nothing to do with open(2), but with the way a device driver
is written. there is nothing to stop a MIDI device driver from
supporting multi-open if its author wanted to. most don't seem to want
to, unfortunately.

>> moreover, there are several single byte MIDI "real time"
>> messages that can arrive at any time, even in the middle of a non-real
>> time MIDI message.
>
>Sorry, I'm not aware of these. Any more info? I do know of running status
>bytes but they seem to be filtered by the device driver.

i can't find my copy of the MIDI spec right now, but MIDI clock (0xF7)
is the most obvious example. There are several others relating to the
song position pointer that are all single byte, plus MIDI time code as
well, plus active sense. in addition, though i don't swear by this, i
think that you need to be able to handle a sysex message at any point
as well (ie. sysex can interrupt a regular message; in a MIDI Machine
Control system, there will be a *lot* of sysex messages running around
some of the time, since MMC is all implemented using sysex).

>> it can be seen that there are no short circuits around the "wire" level
>> of the MIDI protocol.
>
>I'm still not totally convinced. By imposing certain small restrictions
>on what is allowed, this should still be possible.

the midi mapper you describe is quite possible. but it relies on a
proper, full featured MIDI parser. the OSS code is not a proper full
featured MIDI parser (probably because it was written without access
to the MIDI spec). if you want to see a full fledged version, KeyKit
has the simplest one i know of; i used it as the basis for the code in
libmidi++ (though i cleaned up a few issues it had with things like
active sense bytes).

but the midi mapper you're describing (other than the support for USB
MIDI devices) is also extremely similar to the user space part of the
ALSA sequencer. i would suggest a conservative approach to any energy
you put into a duplication of its functionality :)

--p


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Fri Jan 04 2002 - 21:13:42 EET