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