Skip to content

Commit

Permalink
FIX: ignore the 3rd MIDI message byte in the MIDI test (it can have v…
Browse files Browse the repository at this point in the history
…alue on macOS)
  • Loading branch information
Oldes committed Jun 6, 2023
1 parent 67e519a commit 952d76f
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions src/tests/test-midi.r3
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,18 @@ process-midi: function [data [binary!]][
channel: UB 4
byte-1: SI8
byte-2: SI8
byte-3: SI8
byte-3: SI8 ;???
time: UI32LE
]
either all [
byte-3 = 0
op: *MIDI_message_short/name status
prin ajoin [time #" " op " ch=" channel #" "]
print ajoin switch/default op [
Par [["c=" byte-1 " v=" byte-2]]
Pb ChPr [reduce ["v=" byte-1 + (byte-2 << 7)]]
PrCh [["p=" byte-1]]
][
op: *MIDI_message_short/name status
prin ajoin [time #" " op " ch=" channel #" "]
print ajoin switch/default op [
Par [["c=" byte-1 " v=" byte-2]]
Pb ChPr [reduce ["v=" byte-1 + (byte-2 << 7)]]
PrCh [["p=" byte-1]]
][
["n=" byte-1 " v=" byte-2]
]
][ print "should not happen!" ]
["n=" byte-1 " v=" byte-2]
]
]
]

Expand All @@ -83,6 +79,9 @@ midi-inp/awake: function [event [event!]][
true
]

wait 10
close-midi
halt
;; Play some random modern piano music ;-)
;; MIDI input should be printed in the console.
loop 50 [
Expand Down

0 comments on commit 952d76f

Please sign in to comment.