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

[sc-users] Pbind, Event and osc messages



hi list

I am trying to build a pattern of arbitrary osc messages. Let's write a small
function to send a message passed as an array of values.

~send = {arg dest, msg;
	dest.sendMsg(*msg);
}

d = NetAddr.new("127.0.0.1",7770);
~send(d,["/foo",42]);

knowing how to send a message, I would like to create a pattern containing a
sequence of parameters for my ~send function

p = Pbind(
	\dur, Pseq(#[1,1]),
	\msg, Pseq(#[["/foo",42],["/bar",23]])
);

I read in the documentation that an event calls the .play function of a synth,
passing the arguments defined in the Pbind, which sounds like what I want to
do. So I tried something like this :

p = Pbind(
	\dur, Pseq(#[1,1]),
	\dest, d,
	\msg, Pseq(#[["/foo",42],["/bar",23]]),
	\instrument, \bla
);


SynthDef(\bla,{var dest, msg;
	dest.sendMsg(*msg);}
).send(s);

but I'm not allowed to define such a synth, right ?

I also tried to directly replace the \play function inside Pbind, but it
doesn't seems to pass the arguments as it does to an instrument.


Messing around, I found the Pfunc class, which would allow me to make a
sequence of function calls. But I can't pass arguments to the function calls
...


Finally, I found the example on generating a sequence of Midi events, which is
promising, but Midi specific.

Anyone can point me out what I'm doing wrong, and what I should use ?

cheers

Tom




_______________________________________________
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/