wavey-wind/sc/scosc.scd

28 lines
480 B
Plaintext

s.boot();
~gX = 0;
(
SynthDef.new(\gen, {
var signal, env;
env=EnvGen.ar(
Env([0,1,0],[0.001,0.2],-1),
Dust.kr([0.75,1])
);
signal=SinOsc.ar(300 * ~gX,0,*0.6*env);
Out.ar(0,signal);
}).add;
)
Synth.new(\gen);
// Receiver function
(
o = OSCFunc({
arg msg, time, addr, recvPort;
//[msg, time, addr, recvPort].postln;
~gX = msg[1];
~gX.postln;
}, '/quaternion/', n);
)
o.free
// Get port
NetAddr.langPort;