Commission Music

Commission Music
Bespoke Noise!!

Saturday, 25 September 2010

Dan Stowell and Alex Shaw: SuperCollider and Android

Still live blogging the Sc symposium

their subtitle: "kickass sound, open platform."

Android is an open platform for phones, curated by google. Linux w java. it's not normal linux, though. it's NOT APPLE.

phones are computers these days. they're well-connected and have a million sensors, w microphones and speakers. Andriods multitask, it's more open, libraries and APKs are sharable.

Downsides is that it's less mature and has some performance issues w audio.

sccynth on android. The audio engine can be put in all kinds of places. So the server has been ported. The lang has not yet been ported. So to use it, you could write a java app and use it as an audio engine. Can control remotely, or control it from another android app. ScalaCollider, for example.

Alex is an android developer. Every android app has an "activity" which is an app thingee on the desktop. Also has services, which is like a daemon, which is deployed as part of an app and persists in the background. An intent is a loosely-coupled message. AIDL is Android Interface Definition Language, in which a service says what kinds of messages it understands. The OS will handle the binding

things you can do w supercollider on android: write cool apps that do audio. making instruments, for example. He's playing a demo of an app that says "satan" and is apparently addictive. You can write reactive music players (yay). Since you can multitask, you can keep running this as you text people or whatever.

what languages to use? sclang to pre-prepare synthdefs, OSC and java for the UI.

A quick demo! Create an activity in Eclipse!

Create a new project. Pick a target w/ a lower number for increased interoperability. Music create an activity to have a UI. SDK version 4.

Associate project w/ supercollider, by telling it to use it as a library. There are some icon collisions, so we'll use the SC ones. Now open the automatically generated file. Add SCAudio object. When the activity is created, initialise the object.

 
public void onCreate 
 . . .
superCollider = new SCAudio("/data/data/com.hello.world/lib");
superCollider.start;
superCollider.sendMEssage(OscMEssage.createSynthMessage("default", 1000, 1, 0); // default synth
…
}

 . . .

@Override
public void onPause(){
 super.onPause();
supercollider.sendQuit();
}

Send it to the phone and holy crap that worked.

Beware of audio latency, 50 milliseconds. multitasking also.

Ron Kuivila wants to know if there are provisions for other kinds of hardware IO, kind of like the arduino. Something called bluesmurf is a possible client

Getting to the add store, just upload some stuff, fill out a form and it's there. No curation.

2 comments:

Anonymous said...

Is it possible to give a more detailed tutorial for a beginner.

I have never used supercollider before and have only started looking at android development using eclipse.

Alot of that seems very vague to me especially creating the SCAudio object.

Thanks

Charles Céleste Hutchins said...

You might want to ask those two directly, or try asking on the sc-users email list. I've never done any of this, I was just taking notes during the symposium.