iPhone => ChucK
A project to natively read in data sent over OSC from the iPhone app OSCemote in ChucK.
This project began when I realized there was a bunch of iPhone apps in the App Store that could send Open Sound Control (OSC) messages to a computer. Many of these apps had patches/programs that connected to music-producing software like Max/MSP, PureData, and Ableton, but nothing for ChucK, so I set out to make one of the many iPhone-OSC apps talk to ChucK natively. If we could get one of these apps to talk to ChucK we could potentially compose a PLOrk piece with iPhones as the main human interface device! I ended up going with the OSCemote app ($4.99): http://lux.vu/blog/oscemote/
All of the code for this project can be found here
The code includes a bunch of files. Here is an explanation of what each file does:
OSCemote.ck - The class file that is used to create OSCemote objects. OSCemote objects read in data from the four standard dashboards that come with OSCemote and store it in global variables that can be accessed directly.
The following files need to be run alongside OSCemote. Example: chuck OSCemote.ck OSCEmote-fileName.ck
OSCemote-tester.ck - This is a simple tester/debugger for OSCemote. It creates an OSCemote object and then prints out all the data that OSCemote can read. Try running this one first to make sure your iPhone is connecting to your computer.
OSCemote-ocarina.ck - This program uses the Buttons dashboard of OSCemote. It maps a different pitch on a PercFlute STK object to each of the 15 buttons on the screen. When you press a button a note is played. You can play multiple notes by holding down multiple buttons simultaneously. OSCemote-drum.ck - This program uses the Sliders dashboard of OSCemote. I adapted my Drum Machine to make use of this dashboard - there are six STKs playing different beats. Each slider is mapped to the gain of an STK so you can turn off a particular instrument or bring it out above all others. The letters buttons lets you change which instrument is playing which beat. The switches on the bottom print out their status to the console (not musical, but it works).
OSCemote-touch.ck - This program uses the Multi-Touch dashboard of OSCemote. You can create up to three sine waves by placing three fingers on the iPhone. Gain and frequency are manipulated by moving across the x and y axes respectively. You will notice that if you remove your fingers while a sine wave is audible, that the wave will continue to play. This is because of the way OSCemote is designed - it stores the last data point received. Future implementations will reset the global variables if no data is being read in or have an option to enable this resetting.
OSCemote-manipulator.ck - This program uses the Accelerometer dashboard of OSCemote. There are three standard UGens: SinOsc, PulseOsc, and a Phasor; each of their gains is mapped to an axis on the iPhone's accelerometer. Tilt the iPhone around to change the relative gains of each unit generator.
What to include on your project page
- A sound or video recording of your piece. Going lo-fi and using built-in webcam from another laptop (e.g. PLOrk machine in studio B) is fine. But for audio, if you're using chuck, best to use rec.ck for writing chuck's output directly to a file.
- See directions above on putting it on your network drive and linking to it