2021-08-22 01:12:47 +02:00
|
|
|
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;
|
2022-03-03 23:06:33 +01:00
|
|
|
}, '/quaternion/', n);
|
2021-08-22 01:12:47 +02:00
|
|
|
)
|
|
|
|
o.free
|
|
|
|
// Get port
|
|
|
|
NetAddr.langPort;
|