Posted by: rubberhawk | February 17, 2009

Connecting Quartz Composer with Pure Data and other applications using OSC

The following are instructions on how to use OSC (Open Sound Control), the successor to MIDI, for sending data from Pure Data(extended edition) and Quartz Composer.

Start up Quartz Composer and open your composition.

For this I’m using a basic music visualiser. Anyone will do. To receive OSC data you need the use the OSC Receiver patch so select it from the the patch creator and drag it onto the canvas and you should have an object similar to this: Fig. 1

The one above is different to what you just inserted. The First output Received Signal is standard and outputs a boolean True when any signal is being received into QC. This is useful for testing. The rest I created in the settings of the inspector as shown in Fig. 2.shot21 Some things to note. First is the port number, 21678. This can be anything that isn’t already used in the system. If the port is taken a window that doesn’t really explain this will pop up. I use this number because it is used by many games and so is a safe bet unless i start up Counter-Strike. Second is the arguments. All should be floats as this is the easiest to work with from PD. Other programs may differ, feel free to experiment. Also every key starts with a “/”. In this example, I’m using /asdf and /qwerty. /test I’ve left for clarity.

Next we move on to PD:

Create the patch in Fig. 3 in whichever pd patch you want to send data from.shot3 The first thing you must do is load the oscx library. Do this by creating the import oscx object and linking a bang into it as shown. Activate the bang to load the library, then create the rest of the patch. If you’re saving the patch for later use it might be useful to use a loadbang instead of a standard one. The two lines from above link to the rest of my patch and feeds two floating numbers into this area. The objects on the right are how PD receives OSC data. If you completed the QC part you will see where the corresponding port number and key names have been entered. When your ready to start sending data to QC activate the connect message box and you’re done.If all has gone to plan you should have data now flowing from PD to Quartz Composer. To stop the connection, simply activate the disconnect message.

If you would like full information on OSC in PD simply create either a sendOSC or dumpOSC object and right click on it and select help to load the inbuilt PD help patch.



  1. […]… […]

  2. That’s a nice addition for Leopard. Good post.

  3. nice work! just what i needed!

  4. […] of all, i wanted to use osc protocol with qc. after some search, i found a excellent post about the theme at rubberhawk’s blog, that in fact really works. it made me think that things […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s


%d bloggers like this: