Skip to content

Commit 952d76f

Browse files
committed
FIX: ignore the 3rd MIDI message byte in the MIDI test (it can have value on macOS)
1 parent 67e519a commit 952d76f

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

src/tests/test-midi.r3

+12-13
Original file line numberDiff line numberDiff line change
@@ -45,22 +45,18 @@ process-midi: function [data [binary!]][
4545
channel: UB 4
4646
byte-1: SI8
4747
byte-2: SI8
48-
byte-3: SI8
48+
byte-3: SI8 ;???
4949
time: UI32LE
5050
]
51-
either all [
52-
byte-3 = 0
51+
op: *MIDI_message_short/name status
52+
prin ajoin [time #" " op " ch=" channel #" "]
53+
print ajoin switch/default op [
54+
Par [["c=" byte-1 " v=" byte-2]]
55+
Pb ChPr [reduce ["v=" byte-1 + (byte-2 << 7)]]
56+
PrCh [["p=" byte-1]]
5357
][
54-
op: *MIDI_message_short/name status
55-
prin ajoin [time #" " op " ch=" channel #" "]
56-
print ajoin switch/default op [
57-
Par [["c=" byte-1 " v=" byte-2]]
58-
Pb ChPr [reduce ["v=" byte-1 + (byte-2 << 7)]]
59-
PrCh [["p=" byte-1]]
60-
][
61-
["n=" byte-1 " v=" byte-2]
62-
]
63-
][ print "should not happen!" ]
58+
["n=" byte-1 " v=" byte-2]
59+
]
6460
]
6561
]
6662

@@ -83,6 +79,9 @@ midi-inp/awake: function [event [event!]][
8379
true
8480
]
8581

82+
wait 10
83+
close-midi
84+
halt
8685
;; Play some random modern piano music ;-)
8786
;; MIDI input should be printed in the console.
8887
loop 50 [

0 commit comments

Comments
 (0)