adafruit_ble_midi

BLE MIDI service for CircuitPython

class adafruit_ble_midi.MIDIService(**kwargs)

BLE MIDI service. It acts just like a USB MIDI PortIn and PortOut and can be used as a drop in replacement.

BLE MIDI’s protocol includes timestamps for MIDI messages. This class automatically adds them to MIDI data written out and strips them from MIDI data read in.

read(length: int) bytearray

Reads up to length bytes and returns them.

readinto(buf: array | bytearray | memoryview | rgbmatrix.RGBMatrix | ulab.numpy.ndarray, length: int) int

Reads up to length bytes into buf starting at index 0.

Returns the number of bytes written into buf.

write(buf: array | bytearray | bytes | memoryview | rgbmatrix.RGBMatrix | ulab.numpy.ndarray, length: int) None

Writes length bytes out.