[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sc-users] Pbind, Event and osc messages
Thanks ! that's exactly what I needed !
On Wed, Jul 22, 2009 at 09:07:37AM -0400, James Harkins wrote:
> You're on the right track here, but 'play' functions in an event don't receive
> their parameters as function arguments. Instead, they read environment
> variables from the event.
>
> This works:
>
> d = NetAddr("127.0.0.1", NetAddr.langPort);
>
> o = OSCresponderNode(d, '/foo', { |t, r, m| m.postln }).add;
>
> Pbind(
> \play, { ~dest.sendBundle(~latency, ~msg) },
> \dur, 1,
> \dest, d,
> \msg, Pseq(#[["/foo",42],["/foo",23]])
> ).play;
>
>
> You can also add a custom event type and then use it just like any other type.
>
> Event.addEventType(\osc, { ~dest.sendBundle(~latency, ~msg) });
>
> Pbind(
> \type, \osc,
> \dur, 1,
> \dest, d,
> \msg, Pseq(#[["/foo",42],["/foo",23]])
> ).play;
>
> hjh
_______________________________________________
sc-users mailing list
info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/