explained Tempo Change event

explained AllNotesOff function


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2930 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
mahlzeit 2003-03-17 22:21:10 +00:00
parent c95f5fce40
commit fc89f8b55a

View File

@ -483,33 +483,27 @@ implementation, which all always strips the last byte even when it is not 0xF7.
According to the MIDI spec, 0xF7 is not really required; any non-realtime
status byte ends a sysex message.</P></LI>
<LI><P>SprayTempoChange() does nothing and TempoChange() is never called, just
like with the BeOS R5 Midi Kit. The Midi2Defs.h header defines the symbol
B_TEMPO_CHANGE, which is equal to "general purpose controller 6". In theory,
SprayTempoChange() would send a Control Change event for the B_TEMPO_CHANGE
controller, and TempoChange() would be invoked in response of such an event.
But the R5 Midi Kit doesn't do this, and neither do we.</P></LI>
<LI><P>SprayTempoChange() sends 0xFF5103tttttt, where tttttt is 60,000,000/bpm.
This feature is not really part of the MIDI spec, but an extension from the SMF
(Standard MIDI File) format. Of course, the TempoChange() hook is called in
response to this message.</P></LI>
<LI><P>The MIDI spec allows for a number of shortcuts. A Note On event with
velocity 0 is to interpreted as a Note Off, for example. The Midi Kit does not
concern itself with these shortcuts. In this case, it still calls the NoteOn()
hook with a velocity parameter of 0.</P></LI>
velocity 0 is supposed to be interpreted as a Note Off, for example. The Midi
Kit does not concern itself with these shortcuts. In this case, it still calls
the NoteOn() hook with a velocity parameter of 0.</P></LI>
<LI><P>The purpose of BMidiLocalConsumer's AllNotesOff() function is not
entirely clear. All Notes Off is a so-called "channel mode message" and is
generated by doing a SprayControlChange(channel, B_ALL_NOTES_OFF, 0). One would
assume that the AllNotesOff() hook is called in response to the receipt of such
an event, but no, it is not. What's odd is that the documentation for the midi1
kit's BMidi class does not describe this AllNotesOff() as a hook at all, but as
a spray function that sends an All Notes Off event to all 16 channels, and
optionally sends Note Off events for all notes too. Even stranger, BMidi's
AllNotesOff() is declared "virtual", just like all other hooks, and unlike any
of the other spray functions. Since AllNotesOff() is also part of
BMidiLocalConsumer, it really seems to be a hook function. The disassembly for
Be's libmidi2.so shows that AllNotesOff() is empty, which only supports this
hypothesis. Somebody at Be must have been very confused when they designed the
midi2 kit. To cut a long story short, AllNotesOff(), like TempoChange() does
nothing and is never invoked in our implementation.</P></LI>
generated by doing a SprayControlChange(channel, B_ALL_NOTES_OFF, 0). BMidi has
an AllNotesOff() function that sends an All Notes Off event to all channels,
and possible Note Off events to all keys on all channels as well. I suspect
someone at Be was confused by AllNotesOff() being declared "virtual", and
thought it was a hook function. Only that would explain it being in
BMidiLocalConsumer as opposed to BMidiLocalProducer, where it would have made
sense. The disassembly for Be's libmidi2.so shows that AllNotesOff() is empty,
so to cut a long story short, our AllNotesOff() simply does nothing and is
never invoked either.</P></LI>
<LI><P>There are several types of System Common events, each of which takes a
different number of data bytes (0, 1, or 2). But SpraySystemCommon() and the