When you use our rtpmidi tool to connect two devices you have created a “session.” The session has an “initiator” side that started the connection, and “listener” side that accepted the invitation. Some devices, however, do not make good “initiators” and iPhones are a great example. An iPhone cannot initiate a network MIDI session.
But sometimes you want an iPhone to join the MIDI network of a stationary computer … without going back to the computer screen. McLaren Labs’ “favorite” option was created to handle this case.
A “favorite” is the name of a device that that rtpmidi automatically initiates a session with whenever the favorite appears on the network. This new feature takes advantage of the properties of Bonjour (Avahi). A Listener advertises its availability using Bonjour. When rtpmidi detects a Bonjour name matching a favorite, it automatically initiates a session with that name.
Use the “favorite” option from the command line like this.
$ rtpmidi gui -F 'myiPhone' -t Organ-Synth:0
Now, whenever rtpmidi sees the iPhone named “myiPhone” it will automatically call it and route MIDI information to “Organ-Synth”.
A Demonstration
The video below shows how this works.
Initially, the iPhone is not running a MIDI application. McLaren Labs’ rtpmidi has been launched with the “favorite” option and the name of the iPhone.
- When the MidiKeys iPhone app is launched, the iPhone announces the session via Bonjour (Avahi) … and it appears in the “Directory” panel of rtpmidi.
- rtpmidi notices the arrival of the device in the Directory and recognizes it as a favorite.
- It then initiates a connection to the iPhone.
- After the devices synchronize, the MidiKeys app can be used to send MIDI notes to the Raspberry Pi4.
When the MidiKeys app is closed, or the iPhone goes to sleep, the MIDI session will be terminated.
Availability
The “favorite” option will appear in rtpmidi version 0.5.5.
How this video was made
The screen capture of the Raspberry Pi 4 and the iPhone was made using the following tools
- VNC Connect (Raspberry Pi Edition) to cast the Raspberry Pi screen onto a Mac
- The excellent Reflector3 from Squirrels to cast the iPhone screen onto a Mac
- QuickTime Player on the Mac to capture the screen and audio input
- iMovie to add the voiceover