From fc89f8b55aa925a99c15b241578bfc8c86c959b6 Mon Sep 17 00:00:00 2001 From: mahlzeit Date: Mon, 17 Mar 2003 22:21:10 +0000 Subject: [PATCH] explained Tempo Change event explained AllNotesOff function git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2930 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- docs/develop/midi/design.html | 38 +++++++++++++++-------------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/docs/develop/midi/design.html b/docs/develop/midi/design.html index 92f31f9ccd..a31f1afe9b 100644 --- a/docs/develop/midi/design.html +++ b/docs/develop/midi/design.html @@ -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.

-
  • 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.

  • +
  • 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.

  • 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.

  • +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.

  • 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.

  • +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.

  • 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