I currently checking out patchbox OS since I’m interested in doing audio related stuff. Also I’m thinking about getting that pisound.
And one big question keeps popping up in my mind: why did you choose spi for MIDI when the Pi’s UART could to that job?
That’s a good question. While UART pins on the Pi’s GPIO theoretically could be used for direct communication with MIDI devices, in practice, it’s not that convenient and stable, because:
- 31250 baud rate is not supported out of the box, tweaking the CPU frequency is required
- CPU scaling would have to be disabled, as its clock depends on the current CPU frequency
- New Pi versions may require different tweaks.
- Those said tweaks could interfere with whatever a user may be trying to do with their system
- The tweaks must be done in the config files, so the Hat couldn’t be just mounted and be expected to work.
So a synchronized communication method, which is immune to system clock changes, and a dedicated chip for translating the data to MIDI is the most foolproof way of doing MIDI on Raspberry Pi.
See https://blokas.io/pisound/docs/midi/ for more information on Pisound’s MIDI implementation.