|
| 1 | +// https://www.ietf.org/rfc/rfc4695.html#section-3 |
| 2 | + |
1 | 3 | parserReturn decodeMidiSection(RtpBuffer_t &buffer) |
2 | 4 | { |
3 | 5 | int cmdCount = 0; |
4 | 6 |
|
| 7 | + // https://www.ietf.org/rfc/rfc4695.html#section-3.2 |
| 8 | + // |
| 9 | + // The first MIDI channel command in the MIDI list MUST include a status |
| 10 | + // octet.Running status coding, as defined in[MIDI], MAY be used for |
| 11 | + // all subsequent MIDI channel commands in the list.As in[MIDI], |
| 12 | + // System Commonand System Exclusive messages(0xF0 ... 0xF7) cancel |
| 13 | + // the running status state, but System Real - time messages(0xF8 ... |
| 14 | + // 0xFF) do not affect the running status state. All System commands in |
| 15 | + // the MIDI list MUST include a status octet. |
| 16 | + |
| 17 | + // As we note above, the first channel command in the MIDI list MUST |
| 18 | + // include a status octet.However, the corresponding command in the |
| 19 | + // original MIDI source data stream might not have a status octet(in |
| 20 | + // this case, the source would be coding the command using running |
| 21 | + // status). If the status octet of the first channel command in the |
| 22 | + // MIDI list does not appear in the source data stream, the P(phantom) |
| 23 | + // header bit MUST be set to 1. In all other cases, the P bit MUST be |
| 24 | + // set to 0. |
| 25 | + // |
| 26 | + // Note that the P bit describes the MIDI source data stream, not the |
| 27 | + // MIDI list encoding; regardless of the state of the P bit, the MIDI |
| 28 | + // list MUST include the status octet. |
| 29 | + // |
| 30 | + // As receivers MUST be able to decode running status, sender |
| 31 | + // implementors should feel free to use running status to improve |
| 32 | + // bandwidth efficiency. However, senders SHOULD NOT introduce timing |
| 33 | + // jitter into an existing MIDI command stream through an inappropriate |
| 34 | + // use or removal of running status coding. This warning primarily |
| 35 | + // applies to senders whose RTP MIDI streams may be transcoded onto a |
| 36 | + // MIDI 1.0 DIN cable[MIDI] by the receiver : both the timestamps and |
| 37 | + // the command coding (running status or not) must comply with the |
| 38 | + // physical restrictions of implicit time coding over a slow serial |
| 39 | + // line. |
| 40 | + |
| 41 | + // (lathoub: RTP_MIDI_CS_FLAG_P((phantom) not implemented |
| 42 | + |
5 | 43 | uint8_t runningstatus = 0; |
6 | 44 |
|
7 | 45 | /* Multiple MIDI-commands might follow - the exact number can only be discovered by really decoding the commands! */ |
|
0 commit comments