TouchOSC and Pisound - Setup Question

Dear all!
I’ve tried to set up TouchOSC on my iPhone to send data to Pd on the Pisound with no success.
I read all the posts related to this topic before posting, and my hope is to compile my findings in a step-by-step guide for new Pisound users.

So I checked the following:

  • entering touchousc2midi --version provides me with the version number 0.0.10 (so I assume it’s installed)
  • opening the aconnectgui shows the TouchOSC Bridge entry connected to pisound-ctl (so I assume it’s working)
  • the hotspot “Patchbox” is running
  • the IP of the hotspot is 172.24.1.1
  • I’ve connected my iPhone to to “Patchbox”
  • I’m running TouchOSC on the iPhone
  • Inside the TouchOSC settings menu there are three entries related to connections: “MIDI”, “OSC” and “Bridge”
  • according to the information on hexler.net I need to select the “OSC” option
  • this provides three entries, “UDP”, “TCP Client”, and “TCP Server”. Browsing the UDP and TCP Client doesn’t find anything on the network
  • Entering 172.24.1.1 in the “Host” field and “12101” in the “Send Port” field and picking a preset such as “Touch Keys” doesn’t generate any Midi data within Pd on the Pisound, both using the “midiin” object and the “Test Audio and Midi” option

Am I overlooking anything in the above? Your help is much appreciated!

Use ‘TouchOSC Bridge’ option.

You may try running touchosc2midi as a command yourself to see its output:

/usr/bin/touchosc2midi -v

You may first want to disable any Patchbox modules so they don’t interfere.

When I enter the command I receive the following error, any idea what might be going wrong here?

patch@patchbox:~ $ /usr/bin/touchosc2midi -v
Options from cmdline are {‘–help’: False,
‘–ip’: None,
‘–midi-in’: None,
‘–midi-out’: None,
‘–verbose’: True,
‘backends’: False,
‘list’: False,
‘ports’: False}
MIDO_BACKEND from env: None
Using backend <backend mido.backends.rtmidi/LINUX_ALSA (loaded)>.
Backend for midi is <backend mido.backends.rtmidi/LINUX_ALSA (loaded)>.
Inport is <open input ‘TouchOSC Bridge’ (RtMidi/LINUX_ALSA)>
Outport is <open output ‘RtMidiIn Client:TouchOSC Bridge 131:0’ (RtMidi/LINUX_ALSA)>
found ‘wlan0:172.24.1.1’ as default route.
Registered patchbox._touchoscbridge._udp.local. on 172.24.1.1:12101
Waiting for first package from touchOSC in order to setup target address…
Traceback (most recent call last):
File “/usr/bin/touchosc2midi”, line 11, in
load_entry_point(‘touchosc2midi==0.0.10’, ‘console_scripts’, ‘touchosc2midi’)()
File “/usr/lib/python3/dist-packages/touchosc2midi/touchosc2midi.py”, line 165, in main
target_address = wait_for_target_address(psa.ip)
File “/usr/lib/python3/dist-packages/touchosc2midi/touchosc2midi.py”, line 135, in wait_for_target_address
s.bind((‘’, PORT)) # ‘’ represents INADDR_ANY
OSError: [Errno 98] Address already in use

touchosc2midi is already running, or something else is already listening on port 12101. First turn off any other touchosc2midi instances or software using 12101.

1 Like

Great success, many thanks for providing this clue. I will update my first post with the correct settings in TouchOSC for anybody else running into a similar issue

1 Like

Here is the complete process that worked for me in case this is helpful for anybody in the future:

  • check that touchosc2midi is installed by entering touchousc2midi --version in terminal (current version number is 0.0.10)
  • open aconnectgui and check that the TouchOSC Bridge entry connected to pisound-ctl
  • make sure that the hotspot “Patchbox” is running (if not start it by entering sudo pisound-config or patchbox in terminal)
  • connect the device running TouchOSC to to the “Patchbox” Wifi network
  • launch TouchOSC
  • within the TouchOSC settings menu, access the option Bridge, browse for Pisound and activate “Connection 1”
  • within the TouchOSC settings menu, access the option “Midi”, set “Send Port” and “Receive Port” to “Bridge1” and activate “Connection 1”

In order to receive the midi data within Pd it’s important to make sure that the number of Midi input devices is matching the Midi input devices visible within aconnectgui. Otherwise you won’t be receiving anything, also within the Audio and Midi test page.

1 Like

As the buttons are remappable, single click may be doing something else for other users, the hotspot can be controlled through sudo pisound-config or patchbox utilities.

1 Like

Thank you for the comment, I edited my post accordingly

1 Like

Thank you, this was really useful. I had the same problem but had to solve it from the Terminal. This was my process:

  • Run aconnect -l in the Terminal to list the MIDI inputs and outputs
  • Connect the TouchOSC Bridge to the Pure Data Midi-In (I’m using Orac 2.0) - in my case I used the command aconnect 133:0, 130:0
  • The rest of the TouchOSC software procedure as above in iamkabuki’s post

As soon as I fixed this everything started working.

1 Like