这是indexloc提供的服务,不要输入任何密码
Skip to content

Commit c7ca48d

Browse files
Merge pull request #269 from mjwilson-google/valid-midi-message
Add non-normative definition of a valid MIDI message
2 parents 3c36dcb + 332d469 commit c7ca48d

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

index.html

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,32 @@ <h2>
169169
<dfn>MIDI message</dfn>, <dfn>System Real Time</dfn> and
170170
<dfn>System Exclusive</dfn> are defined in [[MIDI]].
171171
</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>
172198
</section>
173199
<section>
174200
<h2>
@@ -1029,13 +1055,13 @@ <h3 id="MIDIOutput">
10291055
);</code>
10301056
</p>
10311057
<p>
1032-
The data contains one or more valid, complete [=MIDI messages=].
1058+
The data contains one or more complete, [=valid MIDI messages=].
10331059
Running status is not allowed in the data, as underlying systems
10341060
may not support it.
10351061
</p>
10361062
<p>
10371063
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.
10391065
</p>
10401066
<p>
10411067
If <var>data</var> is a [=System Exclusive=] message, and the

0 commit comments

Comments
 (0)