File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# midi_inoutdemo - demonstrates receiving and sending MIDI events
22
3- import time
4- import random
5-
63import adafruit_midi
74
85# TimingClock is worth importing first if present as it
96# will make parsing more efficient for this high frequency event
107# Only importing what is used will save a little bit of memory
8+
9+ # pylint: disable=unused-import
1110from adafruit_midi .timing_clock import TimingClock
1211from adafruit_midi .channel_pressure import ChannelPressure
1312from adafruit_midi .control_change import ControlChange
2221
2322from adafruit_midi .midi_message import MIDIUnknownEvent
2423
25- midi = adafruit_midi .MIDI (in_channel = (1 ,2 , 3 ), out_channel = 0 )
24+ midi = adafruit_midi .MIDI (in_channel = (1 , 2 , 3 ), out_channel = 0 )
2625
2726print ("Midi Demo in and out" )
2827
4443 if 0 <= new_note <= 127 :
4544 midi .send (NoteOn (new_note , msg_in .velocity ))
4645
47- elif (isinstance (msg_in , NoteOff ) or
48- isinstance (msg_in , NoteOn ) and msg_in .velocity == 0 ):
46+ elif (isinstance (msg_in , NoteOff )
47+ or isinstance (msg_in , NoteOn ) and msg_in .velocity == 0 ):
4948 for offset in major_chord :
5049 new_note = msg_in .note + offset
5150 if 0 <= new_note <= 127 :
You can’t perform that action at this time.
0 commit comments