i want to translate OSC Data from Processing into pitch control of an oscillator in SC. But the only way I achieve it, is that for every OSC Data received, a new Synth is triggered.
I tried it like that:
(
OSCdef.new(‘OSClistenerNEW’, {
arg msg;
var x;
msg[1].postln;
x = msg[1];
g = {SinOsc.ar(msg[1],0,0.1)};
}, “/OSC”);
x.postln;
g.play;
)
I get the OSC Data via x.postln out but the pitch of the SinOsc will stay static. If i use a SynthDef it will be triggered for each value in a new instance, which i dont want.
Do you have any idea how to make this happen?