Open Sound Control in PD under OS X

This document contains a short tutorial and a link to required software that will get your OSC project up and running in PD under OS X. For CCRMA-lites (or anyone else) sending OSC over a serial port- have no fear, for there exists a 'dumpOSCSerial' extern compiled for OS X (written by R. Scott Wilson, as far as I know). It is contained in the tarball below.

Step-by-step tutorial by Jesse Fox, April 23, 2005.

Step One

Download the OSC externs for PD, compiled especially for you:

This is a compressed file that, once downloaded to your hard drive, can be un-compressed (if not done automatically) with a simple double-click. Once un-compressed, you'll see a folder called "OSC_PD_OSX", and inside that folder you'll see five files with "...OSC..." somewhere in their names. Also, all the files have a suffix of: ".pd_darwin".

Step Two

If you have not done so already, find one of the more current builds of PD for OS X. I have found more recent builds at the following links, some having been assembled into stand-alone applications:

Step Three

Once you have PD downloaded, built, and run as a stand-alone application, you can put the OSC externs in their proper place. First, find your personal build of PD on your hard drive. Then, [ctl]-click the PD icon, and select "Show Package Contents". Then, navigate to Contents>Resources>Extra. This is where you need to drag-and-drop all the "*.pd_darwin" files you just downloaded. (Note: some builds of the PD stand-alone already contain all the "standard" OSC externs. If this is your situation, all you need to drag over is the "dumpOSCSerial.pd_darwin" file.)

Now that you have all the OSC externs in their proper places, you are ready to use OSC. If you are trying to get [dumpOSCSerial] working with your project (for example, if you are doing a project that involves one of the AVRmini proto-boards sending OSC via serial port to PD), then continue on to the next section.

Special section on getting [dumpOSCSerial] to work with OS X

Step 2.1

In order to use the [dumpOSCSerial] object, you need a serial port (tricky, I know). Keyspan USB-Serial adapters are known to work, though I am guessing that one can use any adapter, as long as you have OS X-specific drivers for the device. Mine is just a cheap generic unit, and it works fine.

Step 2.2

Install the drivers and connect your serial device to your computer. Open a terminal window, and type:

ls /dev/tty.*

This should give you a list of a bunch of ports that your computer recognizes. From their names, you should be able to tell what they are, and with any luck, one should clearly represent your usb->serial port. For example, on my computer, my list looks like this:

/dev/tty.Bluetooth-Modem     /dev/tty.righty
/dev/tty.modem /dev/tty.usbserial0

Find your usb-serial port's address and write it down (or copy it to the clipboard, but be aware that not all PD builds support copying to and pasting from the clipboard).

Step 2.3

Now, you can go back into PD. Create yourself a new [dumpOSCSerial] object, and the two arguments for this are the port of your serial device and the baud rate at which you are communicating. For the first arg, enter in the address you just copied. For the baud rate, enter the baud rate you are using for your project.
If you aren't sure what baud rate you are using (and you're running a project on one of the AVRmini proto-boards), you can look into your c code that's running on the AVR microcontroller in order to find it. Somewhere in your c program, you'll find a line that looks like this:


In this specific example, the baud rate is defined as 38400. This is the number to enter in [dumpOSCSerial] as the second arg.

That's all there is to it. Please let me know if you can suggest any changes or have any questions.
Thanks go out to Matt Wright.

Important links:

Jesse Fox - jrobfox[at]ccrma[dot]stanford[dot]edu - April 23, 2005