How to install rtpMIDI on RaspberryPi or other Linux SBC

Here are the steps to install rtpMIDI on companion-pi (or any Linux SBC)

  1. Install Companion Pi (or your favourite SBC distro) and get to a terminal window.

  2. At the prompt, enter:
    wget https://github.com/davidmoreno/rtpmidid/releases/download/v23.12/rtpmidid_23.12_arm64.deb

  3. Next:
    sudo dpkg -i rtpmidid_23.12_arm64.deb

  4. Then enter:
    sudo apt -f install

After that, you should see rtpMIDI devices in the MIDI choices.
Note that the rtpMIDI devices are called rtpmidid, NOT RtMidi (which is the companion MIDI library)

3 Likes

Here’s my walkthrough with a fresh install of CompanionPi on an RPI3.

I just wiped and did a fresh install on my CompanionPi (with a backup). I ran your commands and so far they look like they are working! So somehow my install was messed up. It’s working!

1 Like

Excellent! Was that the beta version of CompanionPI or the stable version?

Stable.

Also, if I have two CompanionPi’s on the same network doing different things and want them both to have this feature, is there a way to change their advertised name that appears in Mac Audio MIDI setup? I’m concerned right now that I only see one CompanionPi listed and there are two running. I don’t want them both getting all Network MIDI commands if that makes sense.

I think the best way would be to change the hostname of the RPI’s. That way you’ll be able to identify them for ssh and also rtpMIDI. I also don’t know if you can have 2 devices with the same hostname, it MIGHT automatically rename one of them, so better to control that yourself.

Use sudo raspi-config and under “system options”, choose “change hostname”


I renamed mine to companionpi-1 and it shows up like this:

This is so helpful. Thank you!

I sent MIDI over the network directly to the Pi today. It was amazing and will really be interesting now that I can explore this option.

You should get your work baked into the next release of Companion! Would be great if MIDI was available robustly out of the box. And would let you use say a single note with different velocities to trigger buttons on a page. So assign a note per page and then use the velocity.

My two cents! Would be easier than setting up triggers for every button you want to press via MIDI.

1 Like

I disagree. It’s already as easy as adding the generic-midi module to your config.
Personally, I’d prefer to have a lot of the “extra” stuff that’s in companion put into modules so you can have what you want and keep the base companion simpler. I don’t need X-Keys or ARTnet support, for example.

You can do that already.

How do I do this?

Is there a way to make the RTP MIDI on RaspberryPi / Companion use the same port number every time so I can have another device initiate the connection when it wakes up? Right now, I have a device that is powered off regularly and every time I power it back on, the Companion connection is broken and has to be set up all over again from the menu (selecting the input port).

You should be able to edit /etc/rtpmidid/default.ini to set the port #.

See: rtpmidid/README.md at master · davidmoreno/rtpmidid · GitHub

Can you tell me how to edit that file from the command line?

The way I edit stuff on a headless SBC is a bit involved, I think you’d do better by googling how to edit a file on an RPI.

In communicating with David Moreno (author of the RTPmidi for debian), he responded and gave me these instructions. I don’t know how to go from what I have installed (your instructions above) to this. Can you help?

From David…

" This will work for debian based distros. Other are similar:

  1. Check at rtpmidid/debian/control at master · davidmoreno/rtpmidid · GitHub and install all the build-depends
  2. You will also need the packages fakeroot and dh-make… maybe someother if anything complains on next step
  3. execute make deb at the project root.
  4. At the end several .deb packages are generated, install the rtpmidid_[someversion].deb file.

Alternative you can try make run and it will compile and run at port 1000.

There will be a new release soon, I hope, but there are still some bugs to fix.

Huh? Sounds like an awfully convoluted way.

Did that not work?

What bugs?

That was part of David’s comments to me about the update he’s working on to get a consistent port working. That’s still my biggest issue and the current version you walked me through installing doesn’t support it.

Every time I restart my RTP device or companion running RTP MIDI the way we set it up, the connection breaks and has to be reconfigured. Not ideal. This is because from what I can tell the Debian RTP connection wants to make some new virtual port every time.

If you can find a way around this or help me translate David’s instructions into something I can follow as a total command line newby, that would be amazing!