Skip to content

Commit 24824a5

Browse files
author
ladyada
committed
simple demo
1 parent 5c1933a commit 24824a5

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

examples/midi_simpletest.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import time
2+
import random
3+
from Adafruit_CircuitPython_MIDI.adafruit_midi import MIDI
4+
import usb_midi
5+
6+
midi = MIDI(out_channel=0)
7+
8+
print("Midi test")
9+
10+
print("Default output channel:", midi.out_channel)
11+
print("Listening on input channel:", midi.in_channel)
12+
13+
while True:
14+
midi.note_on(44, 120)
15+
midi.note_off(44, 120)
16+
midi.control_change(3, 44)
17+
midi.pitch_bend(random.randint(0,16383))
18+
time.sleep(1)

0 commit comments

Comments
 (0)