scosc fix, add another SC example

rob
Jurij Podgoršek 2022-03-03 23:06:33 +01:00
parent 1ea764f3f2
commit e0db3d674b
2 changed files with 40 additions and 1 deletions

View File

@ -21,7 +21,7 @@ o = OSCFunc({
//[msg, time, addr, recvPort].postln; //[msg, time, addr, recvPort].postln;
~gX = msg[1]; ~gX = msg[1];
~gX.postln; ~gX.postln;
}, '/gyro/', n); }, '/quaternion/', n);
) )
o.free o.free
// Get port // Get port

39
scosc2.scd 100644
View File

@ -0,0 +1,39 @@
s.boot();
~gW = 0;
~gX = 0;
~gY = 0;
~gZ = 0;
(
z = {
arg f=440, amp=1, phase=0;
var so;
so = SinOsc.ar(f, phase) * amp;
}.play;
)
(
y = {
arg f=440, amp=1, phase=0;
var so;
so = SinOsc.ar(f, phase) * amp;
}.play;
)
// WW
// Receiver function
(
o = OSCFunc({
arg msg, time, addr, recvPort;
//[msg, time, addr, recvPort].postln;
~gX = msg[1];
~gY = msg[2];
~gZ = msg[3];
~gW = msg[0];
z.set(\f, ~gX * 800);
y.set(\f, ~gY * 800);
y.set(\phase, ~gZ);
}, '/quaternion/', n);
)
// ENDWW