OSC messages

38 views
Skip to first unread message

Coma

unread,
Jan 25, 2012, 7:07:18 AM1/25/12
to supercollider-android-developers
Hi,

I've recently started to work on this supercollider-android branch and
have been able to get the "helloworld" running (Y axis is volume, X
axis is pitch). The thing is I'm a bit lost due to that I've never
touched SC before. I tried the tutorial on the desktop SC, but I'm
guessing that in java that is where the OSC messaging comes in. I'm
trying to understand this reference:

http://danielnouri.org/docs/SuperColliderHelp/ServerArchitecture/Server-Command-Reference.html

Nevertheless I'm not sure how I can (for example) make two sounds
happen at the same time. Like when you pass your finger over the
screen, you get 2 frequencies (one with an offset from the other).
I'm I looking the correct way, or do I need to write an SC code apart
and load it in the program?

Forgive me for being an absolute tard in SC.

Thank you
,Coma

Dan Stowell

unread,
Jan 25, 2012, 8:50:03 AM1/25/12
to supercollider-an...@googlegroups.com
Hi -

Yes those server commands are the ones you'll need to use. To create
two synths, you'd send two /s_new commands, and you'd give the synths
*different* node IDs (the second argument). So maybe the first is 1001
the second is 1002. You'll need to do the book-keeping for the ID
numbers, if you have lots of them...

Dan


2012/1/25 Coma <guill...@gmail.com>:

--
http://www.mcld.co.uk

Guillem Coma

unread,
Jan 25, 2012, 10:39:47 AM1/25/12
to supercollider-an...@googlegroups.com
Thank you Dan,

Worked fine for me although I'm guessing that for each synth I have to send a seperate OSC messages.

For example:

This is what I'm using right now:

OscMessage noteMessage = new OscMessage( new Object[] {
"/n_set", OscMessage.defaultNodeId, "amp", 0f
});
OscMessage noteMessage2 = new OscMessage( new Object[] {
"/n_set", gameNodeId, "amp", 0f
});

I'm wondering if there is a way to compact them into 1 OscMessage. So it might look something like this:

OscMessage noteMessage = new OscMessage( new Object[] {
"/n_set", OscMessage.defaultNodeId, "amp", 0f,
"/n_set", gameNodeId, "amp", 0f
});

Thank you for helping out!

Coma

Dan Stowell

unread,
Jan 25, 2012, 11:51:16 AM1/25/12
to supercollider-an...@googlegroups.com
Hi -

The best way to do this is using Groups. The things running on the
server can be arranged in a "tree"-like layout (sort of like a
folders-and-files layout). By default, all synths get added as
children of the root node, but what you can do is use /g_new to create
a group (let's say you give it the ID 1234), and then add your two
synths to it. So you end up with a layout like this:

Root
-- Group 1234
-- -- Synth 1001
-- -- Synth 1002

Then you can send your /n_set messages to node 1234, and they
automatically go to all its children. Hooray!

Dan


2012/1/25 Guillem Coma <guill...@gmail.com>:

--
http://www.mcld.co.uk

Guillem Coma

unread,
Jan 25, 2012, 2:44:48 PM1/25/12
to supercollider-an...@googlegroups.com
Great!

I was able to put to it together!
I see you can also modify them individual even if they are inside a group. That's great!

I pat myself on the shoulder.
,Coma
Reply all
Reply to author
Forward
0 new messages