Skip to content

Commit b12f924

Browse files
author
Kevin J Walters
committed
Missed update of midi_inoutdemo.py to new MIDI.receive() return value and channel extraction from messages. #3 #9
1 parent a764c70 commit b12f924

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

examples/midi_inoutdemo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@
3535
major_chord = [0, 4, 7]
3636
while True:
3737
while True:
38-
(msg_in, channel_in) = midi.receive() # non-blocking read
38+
msg_in = midi.receive() # non-blocking read
3939
# For a Note On or Note Off play a major chord
4040
# For any other known event just forward it
4141
if isinstance(msg_in, NoteOn) and msg_in.velocity != 0:
4242
print("Playing major chord with root", msg_in.note,
43-
"from channel", channel_in + 1)
43+
"from channel", msg.channel + 1)
4444
for offset in major_chord:
4545
new_note = msg_in.note + offset
4646
if 0 <= new_note <= 127:

0 commit comments

Comments
 (0)