Skip to content

Networking: RTP MIDI (AppleMIDI)

Dale Whinham edited this page Mar 25, 2022 · 1 revision

As of version 0.10.0, mt32-pi supports RTP-MIDI (aka. AppleMIDI) for receiving MIDI via the network.

Software is available for Windows and Linux that can be used with this feature. macOS users can use this feature without any additional software, as RTP-MIDI is built into the operating system.

Limitations

  • Only MIDI reception is supported, not transmission.
  • mDNS/"Bonjour" for zero-configuration is not implemented, so mt32-pi will not be auto-discovered by your RTP-MIDI host software. You must add mt32-pi as a peer manually.
  • Session initiation is not implemented; mt32-pi can only be invited to be a participant in an existing session (you must create a session on a PC or other device that supports it, and invite mt32-pi to the session).
  • mt32-pi can only participate in one RTP-MIDI session at a time.
  • Journalling is not implemented, so it is not possible to recover from packet loss. A reliable network connection is required. If your network suffers from frequent packet loss/disconnections, this feature is probably not going to work well for you.

Setup

Enable Networking in mt32-pi, and ensure that the rtp_midi configuration option is enabled. With networking enabled, mt32-pi will briefly display its IP address on the LCD once it connects successfully. mt32-pi will then be listening for RTP-MIDI connections.

Due to the limitations listed above, mt32-pi won't be auto-discovered, so you'll need to add it to your RTP-MIDI host's Directory manually.

You can use either the hostname or the IP address to refer to mt32-pi when adding it to the Directory, but the port must always be 5004; this is the port that mt32-pi is listening on for RTP-MIDI connections. The port used for the host's session doesn't matter.

Windows

Two pieces of software are required: loopMIDI to create a virtual MIDI device, and rtpMIDI to connect the virtual device to an RTP-MIDI session. Both pieces of software are by Tobias Erichsen.

Follow the rtpMIDI tutorial to get set up. As discussed above, mt32-pi won't automatically show up in the Directory, therefore:

  1. Click the "+" button under the Directory.
  2. Enter anything you like into the "Name" box (e.g. "mt32-pi").
  3. Enter either the hostname (default: mt32-pi) or the IP address followed by :5004 into the "Host / Port" box.
    • For example, mt32-pi:5004 or 192.168.1.100:5004.
  4. Click "OK" and then "Connect" to add mt32-pi as a participant in your session.

Linux

Linux users can use rtpmidid by David Moreno. Compile/install it as per its README, and then run it from your terminal with mt32-pi's hostname or IP address provided as an argument:

# Using the hostname
rtpmidid mt32-pi

# Using the IP address
rtpmidid 192.168.1.100

Issues

Connections are created and closed "on-demand" when a program opens and closes the rtpmidid ALSA MIDI port. This means that if the program begins sending MIDI immediately, before the connection has been established, MIDI data will be lost and problems will occur. Hence, using something like pmidi on the command line to play a MIDI file to mt32-pi will likely fail unless there is a large gap between the start of the song and the first chunk of MIDI data.

A DAW such as REAPER or Rosegarden will keep the port held open for the session, so it may be a more reliable way to test your RTP-MIDI connection than pmidi.

macOS

See the Apple documentation for the basics. Pay close attention to step 6 of the tutorial - this is where you need to manually add mt32-pi as a remote MIDI device:

  1. Click the "+" button under the Directory.
  2. Enter anything you like into the "Name" box (e.g. "mt32-pi").
  3. Enter either the hostname (default: mt32-pi) or the IP address into the "Host" box.
  4. Enter 5004 into the Port box or leave it blank.
  5. Click "OK" and then "Connect" to add mt32-pi as a participant in your session.

Issues

Some macOS MIDI playback software may be unreliable (e.g. MIDIPlayer X). mt32-pi's RTP-MIDI functionality has been tested with ScummVM and REAPER under macOS, so please test those programs before reporting any issues.

Clone this wiki locally