Skip to content

Commit cda65d3

Browse files
committed
fix one arg error; add delay to startup in example
1 parent c60e598 commit cda65d3

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

adafruit_ble_midi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def write(self, buf, length):
169169
if self._message_target_length:
170170
self._pending_realtime = b
171171
else:
172-
self._raw.write(b, self._header)
172+
self._raw.write(b, header=self._header)
173173
else:
174174
if (
175175
0x80 <= data <= 0xBF or 0xE0 <= data <= 0xEF or data == 0xF2

examples/ble_midi_simpletest.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@
3333
while not ble.connected:
3434
pass
3535
print("Connected")
36+
# Sleep briefly so client can get ready and send setup
37+
# writes to the MIDIService. 0.5secs was insufficient.
38+
time.sleep(1.0)
39+
# Send one unique NoteOn/Off at the beginning to check that the
40+
# delay is sufficient.
41+
midi.send(NoteOn(20, 99))
42+
midi.send(NoteOff(20, 99))
3643
while ble.connected:
3744
midi.send(NoteOn(44, 120)) # G sharp 2nd octave
3845
time.sleep(0.25)

0 commit comments

Comments
 (0)