Mats wrote:
>> Which version of lilypond do you use? With recent versions
>> up to 1.2.0, midi output is really unusable for me, because
>> very many notes 'get stuck', i.e. aren't turned off when they
>> should (it's a bit like on a piano with the pedal never
>> lifted...)
>
>I've experienced this problem once or twice with an old version
>of Lilypond, but only when I tried to play it using the
>Microsoft Media player. I've never had any problem with
>the Midi sequencers in Linux. Are you sure that the
>problem has appeared in the recent versions?
>
>Is someone on the list more familiar to the details of
>MIDI to be able to trace what goes wrong?
There are two related aspects coming into my mind that may cause
trouble:
1. Originally, MIDI notes used to be turned on with the "Note On"
event message (1001cccc 0kkkkkkk 0vvvvvvv with cccc=channel (0..15),
kkkkkkk=key number (0..127), vvvvvvv=velocity (0..127)),
and turned off with the "Note Off" event message (1000cccc 0kkkkkkk
0vvvvvvv with vvvvvvv=release velocity).
Nowadays, many sequencers do not actually turn off the notes, but
instead send once again a "Note On" message with vvvvvvv=0, which
effectively tells the player to mute the note.
The purpose is a better use of the running status byte, hence
saving a few bytes (and, hence, a few milliseconds transfer time).
Most (but not all?) temporary sequencers support both methods for
turning off notes.
2. Some vendors allowed multiple (stacked) notes with the same key
number on the same channel to be turned on simultaneously. Hence,
the sequence "90 3c 7f 90 3c 6f" would turn on *two* middle C notes
on channel 0 with velocities 7f and 6f. To turn off both, you would
need a sequence like "80 3c 00 80 3c 00". Note that this approach
is not compatible with the approach described under 1.
Perhaps, a solution is to introduce a flag that controls which method
is used in the generated midi files to turn off notes. Furthermore,
multiple notes with the same key number on the same channel should be
avoided (otherwise, their duration may be to short on some players).
Bye,
Juergen