DIN MIDI access

I’m using the Zynth hardware for another project - how do I get access to the DIN ports via Python? They seem to be I2C, but what’s the chip?

Gonzo

Hi @gonzoB

The MIDI 5-pin DIN sockets are connected via some interface circuitry to one of the Raspberry Pi’s UARTs. A user-space module called ttymidi converts the serial port to a MIDI device. IIRC we use a patched version of ttymidi. it is launched by systemd using the unit mod-ttymidi which runs /usr/local/bin/ttymidi -s /dev/ttyAMA0 -b 38400. This does not present an ALSA MIDI port. It creates input and output jack MIDI ports.

Upstream ttymidi creates a ALSA ports. We use a version that creates jack ports. You may wish to use the one that best suits your project.

Note that ttyMIDI has some limitations - read the upstream docs.

1 Like

Thanks @riban

Of course I didn’t actually answer the question! Once you have configured the device to recognise UART as an ALSA or JACK MIDI port you need to use an appropriate Python module to access the MIDI events. It depends whether you are using ALSA or JACK as to which module to use - obv!