@@ -169,6 +169,32 @@ <h2>
169
169
< dfn > MIDI message</ dfn > , < dfn > System Real Time</ dfn > and
170
170
< dfn > System Exclusive</ dfn > are defined in [[MIDI]].
171
171
</ p >
172
+ < div class ="note ">
173
+ < dfn > Valid MIDI message</ dfn > is defined in [[MIDI]]. The
174
+ following may be used as a non-normative guide:
175
+ < ul >
176
+ < li > The first byte (the status byte) should have the high bit
177
+ set, any following bytes should not unless they are part of a
178
+ [=System Exclusive=] message</ li >
179
+ < li > If the high nibble of the status byte in hex is `8`, `9`,
180
+ `A`, `B`, or `E` then the total message length should be 3
181
+ bytes
182
+ < li > If the high nibble of the status byte is `C` or `D` then
183
+ the total message length should be 2 bytes</ li >
184
+ < li > If the status byte is `F1` or `F3` then the total message
185
+ length should be 2 bytes</ li >
186
+ < li > If the status byte is `F2` then the total message length
187
+ should be 3 bytes</ li >
188
+ < li > If the status byte is `F6`, `F8`, `FA`, `FB`, `FC`, `FE`,
189
+ or `FF` then the total message length should be 1 byte (only
190
+ the status byte)</ li >
191
+ < li > If the status byte is `F0` then this is a [=System
192
+ Exclusive=] message with no length restriction, and the last
193
+ byte should be `F7`</ li >
194
+ < li > If the status byte is `F4`, `F5`, `F7`, `F9`, or `FD` then
195
+ the message is not valid</ li >
196
+ </ ul >
197
+ </ div >
172
198
</ section >
173
199
< section >
174
200
< h2 >
@@ -1029,13 +1055,13 @@ <h3 id="MIDIOutput">
1029
1055
);</ code >
1030
1056
</ p >
1031
1057
< p >
1032
- The data contains one or more valid, complete [= MIDI messages=].
1058
+ The data contains one or more complete, [=valid MIDI messages=].
1033
1059
Running status is not allowed in the data, as underlying systems
1034
1060
may not support it.
1035
1061
</ p >
1036
1062
< p >
1037
1063
If < var > data</ var > is not a valid sequence or does not contain
1038
- a valid [= MIDI message=], throw a < code > TypeError</ code > exception.
1064
+ a [=valid MIDI message=], throw a < code > TypeError</ code > exception.
1039
1065
</ p >
1040
1066
< p >
1041
1067
If < var > data</ var > is a [=System Exclusive=] message, and the
0 commit comments