I’ve gotten the Terminal connected to a (serial) MIDI breakout board via the TX/RX pins on the RPi bus on the back of the device. I can read bytes from a connected MIDI keyboard. The problem is, they’re garbage.
I have a MIDI reference and the bytes I’m getting look nothing like valid MIDI messages — when I press and release a key I get an unpredictable assortment of FF, 00 and other bytes, not 81 xx xx and 91 xx xx.
I think the problem is the serial protocol. I’m using CircuitPython and configuring the UART as busio.UART(board.TX, board.RX, baudrate=31250)
. The MIDI tutorial I’m reading says:
MIDI uses a clock rate of 31,250 bits per second. To send an 8-bit byte, it needs to be bookended with start and stop bits, making ten bits total
Does that match the CircuitPython’s UART class’s behavior? In particular, the class constructor doesn’t have a parameter for start bits; does it always assume one?