Subject: /dev/music weirdness
To: <tech-kern@netbsd.org>
From: Gavan Fantom <gavan@coolfactor.org>
List: tech-kern
Date: 01/26/2001 01:33:02
I'm playing about with /dev/music to do (eventually) some pretty heavy
MIDI I/O.

Firstly, a small gripe. /dev/music seems to be rather lacking in
documentation. I've been relying so far on <sys/midiio.h> and the source
for midiplay. Have I missed something blatantly obvious?

Now, the problem: When I write data to /dev/music (having practially
cut+pasted code out of midiplay), the last MIDI event seems to get lost.

My simple test case is:

Send MIDI reset
Send 2 second delay
Send Note On event
Send 1 second delay
Send Note Off event
Send 1 second delay
Send Note On event
Send 1 second delay

The MIDI reset, Note On and Note Off events arrive at the synthesizer, but
the second Note On never arrives.

If I stop at any point in that sequence, the last Note On or Note Off
event never arrives.

After opening /dev/music for read/write, I'm querying SEQUENCER_NRMIDIS,
setting SEQUENCER_TMR_TIMEBASE and SEQUENCER_TMR_TEMPO, and calling
SEQUENCER_TMR_START.

Before I close the device I'm calling SEQUENCER_SYNC.

Am I doing anything wrong, or is this a bug?

-- 
Gillette - the best a man can forget