https://blokas.io/patchbox-os/
sudo nano /boot/config.txt
enable_uart=1
dtoverlay=midi-uart0
sudo nano /boot/cmdline.txt
delete:
console=serial0,115200 console=tty1
dtoverlay=disable-bt
sudo systemctl disable hciuart.service
sudo systemctl disable bluealsa.service
sudo systemctl disable bluetooth.service
dtoverlay=pi3-miniuart-bt
sudo apt-get install wiringpi
gpio readall (check tty dev tx rx)
download and install ttymidi to access pi serial http://www.varal.org/ttymidi/
wget http://www.varal.org/ttymidi/ttymidi.tar.gz
tar -zxvf ttymidi.tar.gz
cd ttymidi/
nano Makefike
add -lpthread in "all:"
make
sudo make install
ttymidi -s /dev/ttyAMA0 -b 38400 -v & // It will s&r at 31250 since midi-uart0
ttymidi -s /dev/ttyAMA0 -v -n device_name
Depending on your setup you can manage ttymidi midi port instance after creation with ALSA MIDI or JACK
a2jmidid
aconnect -l aconnect id:0 id2:1
https://www.midi.org/specifications-old/item/midi-din-electrical-specification <-----
Very helpful info, but hardware "midi specs circuitery" link is dead. This is a nice summary of the circuit:
or this:
Also, a helpful video tutorial can be found here