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