OSC / UDP...

55 views
Skip to first unread message

itemState

unread,
Aug 20, 2010, 2:51:08 PM8/20/10
to supercollider-android-developers
hey,

i would like to get started with sc on android...

i just happily wrote my first little android app which is an OSC
client over WIFI. i would next like to try out to communicate within
the same phone to scsynth. i see that your OSCMessage implementation
is seemingly doing something else (parcelable). so the question is...
can i connect to sc on android normally through OSC via UDP?

best, -sciss-

Dan Stowell

unread,
Aug 21, 2010, 5:19:08 AM8/21/10
to supercollider-an...@googlegroups.com
Hi Sciss,

At present, no you can't. We decided to do it "the android way" by
making scsynth into a Service with which you communicate by sending
Intents - it's still OSC but carried on a different transport.

Actually just a couple of days ago me and Alex realised it appears
possible to get the service listening on a network port, which would
make it behave a lot more like "traditional" scsynth. People could
then communicate from desktop sclang, or from whichever other OSC
network clients, so it would open up a lot more possibility... so it
seems we should do it. I think Alex is looking at it.

If you're keen on Android then you might think about communicating
"the android way" by taking the AIDL interface and using it to pass
intents. (Check ISuperCollider.aidl and OscMessage.java.) But if we
can enable the traditional way of communicating then I suspect that
would be the biggest benefit for all.

BTW for those who aren't on the sc-users list here's the video Sciss
just posted of what he's working on :)
http://www.youtube.com/watch?v=hx4ROHHT7k0

Dan


2010/8/20 itemState <annabl...@yahoo.de>:

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

itemState

unread,
Aug 21, 2010, 6:39:37 AM8/21/10
to supercollider-android-developers
ok, i understand. i will need to work mostly on my installation
project for berlin over the next three weeks now. but once i have
time, it should be hopefully easy to add AIDL as an OSC protocol to
scalaOSC in some way. thing is i don't know much about the android API
and framework, so lot's of learning here :)

best, -sciss-


On 21 Aug., 10:19, Dan Stowell <danstow...@gmail.com> wrote:
> Hi Sciss,
>
> At present, no you can't. We decided to do it "the android way" by
> making scsynth into a Service with which you communicate by sending
> Intents - it's still OSC but carried on a different transport.
>
> Actually just a couple of days ago me and Alex realised it appears
> possible to get the service listening on a network port, which would
> make it behave a lot more like "traditional" scsynth. People could
> then communicate from desktop sclang, or from whichever other OSC
> network clients, so it would open up a lot more possibility... so it
> seems we should do it. I think Alex is looking at it.
>
> If you're keen on Android then you might think about communicating
> "the android way" by taking the AIDL interface and using it to pass
> intents. (Check ISuperCollider.aidl and OscMessage.java.) But if we
> can enable the traditional way of communicating then I suspect that
> would be the biggest benefit for all.
>
> BTW for those who aren't on the sc-users list here's the video Sciss
> just posted of what he's working on :)http://www.youtube.com/watch?v=hx4ROHHT7k0
>
> Dan
>
> 2010/8/20 itemState <annablume1...@yahoo.de>:

Alex Shaw

unread,
Aug 22, 2010, 9:47:52 AM8/22/10
to supercollider-an...@googlegroups.com
Hi there,

I've just checked in a little enhancement to allow UDP to work.  If you get and rebuild the native and Java bits of SuperCollider-Android, there is now an ISuperCollider method called openUDP(int port).  That does what you want, I've been firing sclang at it from my laptop and it's been making the right noises.  (The default SuperColliderActivity now opens a UDP channel on port 4040).

Sorry for my terseness, I was supposed to leave the house 15 minutes ago but wanted to push this fix first!  Please ask me questions if anything's not clear.  Scala is a lovely language and I look forward to the fruits of your labour.

Alex

Dan Stowell

unread,
Aug 24, 2010, 3:32:07 AM8/24/10
to supercollider-an...@googlegroups.com
Hi -

Great! This is fab. Now I can use sc-android like any remote server
from my laptop (some simple code below).

I've taken the liberty of changing the port for the default activity
to 57110 (that's the conventional port index used by scsynth on
desktops - I'm assuming that 4040 was an arbitrary choice).


~addr = NetAddr("192.168.254.20", 57110); // ip addr for my phone
Server.default = s = Server(\phone, ~addr);
s.startAliveThread;
s.notify;

s.queryAllNodes

// The activity creates a default synth:
s.sendMsg(\n_set, 1000, \freq, 1550.rand, \amp, 0.1)
s.sendMsg(\n_free, 1000) // Get rid so we can do other stuff...

s.queryAllNodes

x = {PinkNoise.ar * SinOsc.ar(0.1).range(0,1)}.play(s)
x.free
z = {BrownNoise.ar * SinOsc.ar(0.0831).range(0,0.4)}.play(s)
z.free

s.quit // The sc activity gracefully exits - nice


Dan


2010/8/22 Alex Shaw <glasto...@googlemail.com>:

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

Reply all
Reply to author
Forward
0 new messages