[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] Proxyspace: how to copy OSC values into variables



On 2016-12-26 09:04, chanof wrote:
Hi there, i just tried to crate a small TouchOSC controller for my Proxyspace live coding, it work only outside Proxyspace, someone can help me about?
Thanks a lot!

(
s.quit;
s=Server.local;
s.options.blockSize=512;
s.boot;
p=ProxySpace.push(s);
)

(
(OSCdef.new(\ctrl1,{arg msg, time, addr, port;~ctrl1 =
(msg[1]);},'/1/fader1'));
(OSCdef.new(\ctrl2,{arg msg, time, addr, port;~ctrl2 =
(msg[1]);},'/1/fader2'));
(OSCdef.new(\ctrl3,{arg msg, time, addr, port;~ctrl3 =
(msg[1]);},'/1/fader3'));
(OSCdef.new(\ctrl4,{arg msg, time, addr, port;~ctrl4 =
(msg[1]);},'/1/fader4'));
(OSCdef.new(\ctrlx,{arg msg, time, addr, port;~ctrlx =
(msg[2]);},'/1/xy1'));
(OSCdef.new(\ctrly,{arg msg, time, addr, port;~ctrly =
(msg[1]);},'/1/xy1'));
);

Hi chanof,

Try wrapping the OSCdef callbacks in the "inEnvir" method:

OSCdef.new(\foo, inEnvir { ... });

The reason is explained here: http://doc.sccode.org/Classes/Environment.html#Environments%20and%20asynchronous%20functions

If you have the ddwProto quark, you can also use the shorthand "e".


Nathan

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/