Skip to content

Commit 278f7ef

Browse files
committed
added comments
1 parent b0ed165 commit 278f7ef

2 files changed

Lines changed: 39 additions & 0 deletions

File tree

src/rtpMIDI_Parser.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ class rtpMIDIParser
116116
if (buffer.size() < minimumLen)
117117
return parserReturn::NotSureGiveMeMoreData;
118118

119+
// 2.2. MIDI Payload (https://www.ietf.org/rfc/rfc4695.html#section-2.2)
119120
// The payload MUST begin with the MIDI command section. The
120121
// MIDI command section codes a (possibly empty) list of timestamped
121122
// MIDI commands and provides the essential service of the payload

src/rtpMIDI_Parser_MidiCommandSection.hpp

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,45 @@
1+
// https://www.ietf.org/rfc/rfc4695.html#section-3
2+
13
parserReturn decodeMidiSection(RtpBuffer_t &buffer)
24
{
35
int cmdCount = 0;
46

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+
543
uint8_t runningstatus = 0;
644

745
/* Multiple MIDI-commands might follow - the exact number can only be discovered by really decoding the commands! */

0 commit comments

Comments
 (0)