Skip to content

Commit afffa93

Browse files
committed
fix up hwtest/code.py a little
1 parent 5883c9e commit afffa93

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

circuitpython/hwtest/code.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
# - adafruit_debouncer
1515
# - adafruit_displayio_ssd1306
1616
# - adafruit_display_text
17+
# - adafruit_midi
1718
# Install them all with:
18-
# circup install asyncio adafruit_debouncer adafruit_displayio_ssd1306 adafruit_display_text
19+
# circup install asyncio adafruit_debouncer adafruit_displayio_ssd1306 adafruit_display_text adafruit_midi
1920
#
2021
#
2122
import asyncio
@@ -136,10 +137,18 @@ def check_touch():
136137
touch.update()
137138
if touch.rose:
138139
print("touch press",i)
139-
note_on(midi_notes[i])
140+
midi_note = midi_notes[i]
141+
note_on(midi_note)
142+
msg = NoteOn(midi_note, velocity=100)
143+
midi_usb.send( msg )
144+
midi_uart.send( msg )
140145
if touch.fell:
141146
print("touch release", i)
142-
note_off(midi_notes[i])
147+
midi_note = midi_notes[i]
148+
note_off(midi_note)
149+
msg = NoteOff(midi_note, velocity=0)
150+
midi_usb.send( msg )
151+
midi_uart.send( msg )
143152

144153
# print to REPL current state of knobs, button, and touchpads
145154
async def debug_printer():

0 commit comments

Comments
 (0)