Create An Ad-Hoc Network For TouchOSC On Your Mac

After coding for iPhone for the last month and a half, I figured it was time I finally got one of the coveted devices for myself. This week I have been having fun setting it up, checking my email, and browsing the app store. They really are a marvel of technology and raise my expectaions in terms of elegance and functionality for all devices.

iPhone running TouchOSC

iPhone running TouchOSC

Today, in addition to working hard on my upcoming app release (which I am very excited about) I have been playing with the TouchOSC app from hexler.net. TouchOSC, available from the Apple App Store, provides several touchable interfaces including virtual faders, cross-faders, knobs, pads, keys, buttons, grids and x-y pads; all of which send OSC data over Wi-Fi using UDP. It is kind of  like a mini JazzMutant Lemur in your pocket.

The OSC data from TouchOSC can be used in software capable of receiving OSC messages, such as MaxMSP or Processing, or you can parse the OSC data to MIDI and then on to any MIDI controllable software such as Ableton Live. To translate the OSC to MIDI on a Mac I highly recommend you check out OSCulator. If you own Max you could build yourself a maxpat to do the same thing but OSCulator is prebuilt and there are some excellent presets available on the hexler.net website. Mac users will find instructions on using TouchOSC with Osculator and Ableton Live here. Windows users will find instructions to do something similar using a combination of Pure Data and MIDI Yoke here.

Setting up TouchOSC on your home wi-fi network is a piece of cake. All you have to do is open the TouchOSC Network settings and set the host and the  outgoing and incoming ports. The ports can be whatever you want to use; I use 8000 for outgoing and 9000 for the incoming port. The host should just be YOURCOMPUTENAME.local. This worked flawlessly for me the first time I tried it.

If however you are not at home, or are somewhere without wi-fi, and you want to use TouchOSC with your MacBook or MacBookPro, you need to create an ad-hoc wireless network. All an ad-hoc network is is a wireless network where the communciation between devices is direct, rather than through an access point or a router. Here are the steps to create an ad-hoc network and set up TouchOSC to communicate with your Mac:

1. Open up System Preferences->Network.

2. Click on the Network Name drop down and select  Create Network.

3. Give your network a name. A password is optional though probably a good idea.

4. Click on Advanced.

5. Click on the TCP/IP tab.

6. Click the Configure IPv4 drop down and select Manual.

7. Enter an IP and NetMask for your computer. I use 192.168.2.1 and 255.255.255.0.

8. Click OK and then Apply and close System Preferences.

9. On your iPhone open Settings->Wi-Fi and select the network you just created.

10. Click the arrow to the right of the network name.

11. Select Static for your IP type and enter your IP and NetMask for the iPhone. I use 192.168.2.2 for the IP. The NetMask must be the same as for the network which is 255.255.255.0.

12. Exit your iPhone settings and open TouchOSC.

13. Touch the field under the heading Network.

14. Enter the IP address you created for your Mac. In my case this is 192.168.2.1.

15. Make sure your ports are as you want them. Remember, the ports can be whatever you want to use, just make sure that they agree with whatever you are communicating with, ie OSCulator, MaxMSP, Processing etc. I use 8000 for the outgoing port and 9000 for the incoming port.

16. Touch the done button and then once you are at the mainscreen of TouchOSC, select your Layout and touch done again.

It sometimes takes a few seconds to connect to the network and open the TouchOSC Layout but once it opens you should be able to communicate with your Mac over the ad-hoc wireless network. To test out the ad-hoc network try using OSCulator or one of the Max patches provided on hexler.net. This is what worked for me; hopefully you will find that these instructions get you up and running TouchOSC over an ad-hoc network too. If you have any problems please leave a comment and I will do my best to help you.

  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Technorati
  • LinkedIn
  • RSS
  • Slashdot
  • Twitter

About Jason Job

I am a technologist, music producer and an obsessive student of the Internet. I create sound, write code and make things with electronics and microcontrollers. I work as a software developer and consultant and am currently focused primarily on mobile applications for iPhone, iPad and iPod Touch.
This entry was posted in MIDI, OSC, OSX, iPhone. Bookmark the permalink.

6 Responses to Create An Ad-Hoc Network For TouchOSC On Your Mac

  1. Jamie says:

    Hey there this is a great tutorial, really clear much appreciated.

    I do have a problem that you may or may not be able to help me with. I have TouchOSC and I am trying to get it to control MAX/MSP. I have all the patches from Hexler and they run fine in Max. The problem I am facing is that my iPod (touch 2nd gen) won’t send messages to Max, I can control the faders and knobs from Max on the iPod but not from the iPod to Max. I followed everything you have here as a last chance, but still no luck. I’ve tried on a few wireless networks and the ad hoc one but the same issue constantly.

    Any advice?

  2. Jason Job says:

    Jamie, I experienced similar problems when I first tried to use TouchOSC but it eventually worked for me. I don’t think there is any problem with TouchOSC. My whole life I have found networking things to be somewhat ephemeral even though I understand it intimately. My advice, keep trying, keep Googling. Sorry I don’t have a better answer for you. Good luck!

  3. Jamie says:

    Well it’s good to know I’m not the only one. Thanks for your response.

    Cheers

  4. Iman says:

    hey thanks for this step by step guide! I found it very useful today.

  5. Jason Job says:

    Great. Glad to have helped!

  6. Emilio says:

    I have a problem:
    I am able to crate an ad-hoc network in windows xp and then to connect my pc to the ipod.
    In touch osc, i select the ip of my pc and the 8000 out and 9000 in ports.
    I open pure data and open the simple-midi.pd and then in touch osc i select the simple layout and selct “done”.

    When i move a fader, in windows network monitor i can see incoming bytes to my computer, every time i move a fader,the recieved packages on the network monitor go up.

    But when i open pure data, im unable to recieve any signal. the first OSC 8000 letters in the diagram appear red :S

    whats going on? i disabled my firewall already and tried to manually open ports but still no luck :(

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>