Re: [linux-audio-dev] Basic MIDI question

From: Nicolas Pouillon <nipo@email-addr-hidden>
Date: Tue Jul 25 2006 - 03:23:39 EEST

[Mon, 24 Jul 2006 17:55:17 -0400]
Lee Revell <rlrevell@email-addr-hidden-job.com> eut le bonheur d'_crire:

> 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?

Bytes you read, when decoding smf-like stream (which is to say with
delta times in between) must be decoded differently whether you are
reading an event or a delta time, yes

> 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?

I believe so. You also may have to care about other midi specific
things to parse like
-Running command: Command byte (the one with 1 on bit 7) may be ommited
if it is the same as last one
-"Note on" with velocity 0 is considered as "note off" (most of the
time)

91 42 7f
81 30
91 41 3e
88 37
81 42 00
30
81 41 00

may be optimized as
(-- is an ommited repeated "running" command byte)

91 42 7f
81 30
-- 41 3e
88 37
81 42 00
30
-- 41 00

or even

91 42 7f
81 30
-- 41 3e
88 37
-- 42 00
30
-- 41 00

-- 
Nipo <nipo@email-addr-hidden>

Received on Tue Jul 25 04:15:03 2006

This archive was generated by hypermail 2.1.8 : Tue Jul 25 2006 - 04:15:03 EEST