[LAD] successive note on midi events

James Morris james at jwm-art.net
Mon Apr 12 11:47:48 UTC 2010

On Mon, April 12, 2010 07:35, Ralf Mardorf wrote:
> James Morris wrote:
>> On Mon, April 12, 2010 00:38, James Morris wrote:
>>> Hi,
>>> I'm pretty sure I've seen this dealt with on the list before, but can't
>>> find it.
>>> With the program I'm fumbling around trying to create, it will be
>>> possible
>>> for successive note on events for the same pitch to occur without note
>>> off
>>> events intervening.
>>> Does the MIDI spec allow such things?
>> Sorry to answer myself so soon...
>> I guess it is allowed. The simplest case being a sequencer outputting to
>> the same channel and port as a keyboard player. Nothing can prevent this
>> -
>> right?
> Btw. how do you handle running status? I guess you are talking about
> connections made by JACK or ALSA MIDI, so you don't need a MIDI merge
> box and you don't have to take care because of the running status? Note
> that the MIDI spec was made to connect hardware devices too. I'm not
> sure if you need to take care of the MIDI spec, maybe JACK and ALSA will
> smooth away difficulties for you. I don't program for Linux, but did it
> for hardware devices.

The program is going use JACK MIDI, and all events must be sent in full

I have a substantial lack of studio/MIDI hardware here, so I'm used to
thinking in terms of software implementations, plus, I've only ever used
the basics in sequencers so am not in a strong position for implementing a
MIDI program.

Maybe it's a major flaw in the overall concept of the program:

given a rhythmic pattern, sequence it, and determine the pitch/velocity
data for each event in the pattern by placing a box into a 127x127 grid
where it will fit without overlapping any other.

((the boxes will have width and height, and can hang around after note off))

Basically, it leaves me with three options, none of which I like:

given a single channel, and the possibility that successive note-on events
occur with missing note-off events:

1) once note on, prevent further note on events until note off for that
pitch has occurred..

2) when a missing note-off detected, delay the note-on by the smallest
amount of time possible, and insert the note-off in place of it.

3) disallow the pattern to have note durations which overlap the next note

4) do it anyway and warn the user it may cause problems.

5) let the user choose from above.

Anyway, it's all far from becoming a working program yet, but this
specific problem needs dealing with at this stage.


More information about the Linux-audio-dev mailing list