Hi ebai101 , is your latest post the best way you have found to get midi input on Bela? Do you think this is still low latency?

    a year later

    Just to confirm it works perfectly with SuperCollider. I use ttyMIDI from ebai101 with a small modification. I changed line 151 in ttymidi.c to:
    if ((status = snd_rawmidi_open(NULL, & midiout, "virtual", 0)) < 0) {

    I've tested the snd-serial midi kernel module, but unfortunately the midi packets got scrambled. I know it would be elegant to have the same solution for C++, Pd and SuperCollider, but I think it's better to use two solutions.
    C++: Don't use ALSA at all. Use BelaSerialMIDI from ebai101 or make a SerialMIDI subclass from the Bela Serial class and implement some basic midi parsing for the callback functions.
    PD, Supercollider: Use the Virtual RawMidi interface from ALSA with ttyMIDI and maybe implement it as a kernel module.

    thanks for the feedback. I guess one could have a C++ daemon reading from serial and writing to virmidi ...

    a year later

    Hey everyone, this is exactly the thread I've been looking for!
    I'd greatly appreciate your help in making this work for me:
    I tried to set up UART4 as described here,
    but it doesn't seem to work by just adding the line (_addr4=/...) in uEnv.

    So right now my uEnv.txt looks like this:

    [...]
    
    uboot_overlay_addr2=/lib/firmware/BB-BELA-00A1.dtbo
    uboot_overlay_addr3=/lib/firmware/BB-BELA-CTAG-SPI-00A0.dtbo
    uboot_overlay_addr4=/lib/firmware/BB-UART4-00A0.dtbo
    
    console=ttyS0,115200n8
    uname_r=4.14.108-ti-xenomai-r143
    mmcid=0 

    So I tried to configure UART with config-pin but couldn't load the cape-unversala -overlay without rendering the Board unbootable..
    Now config-pin -q p9.11and config-pin -q p9.13 each outputs:

    P9_11 pinmux file not found! # P9_13 respecitvely
    Pin has no cape: P9_11

    Thanks in advance, also for the great work on ttymidi for Bela 🙂

    The use of the BB-UART4 overlay is alternative to the use of cape universala. This should mean that with this overlay loaded the relevant pins of UART4 should already be enabled without need to use config-pin. Try using the UART4 peripheral to verify that

    OMG yes! Thank you so much 🙂
    I was looking in all the wrong places, but your answer helped me shift my focus to the actual problem:
    It wasn't really a problem with the serial connection as I had assumed but with the ttymidi.service..
    I had used @ebai101 's build.sh script before. Compiling manually did the Trick!