83 lines
1.5 KiB
Plaintext
83 lines
1.5 KiB
Plaintext
// Zacetek / konec
|
|
|
|
s.boot;
|
|
s.stop;
|
|
|
|
// Server -> Boot /// Ctrl+B
|
|
|
|
// HELP: shift+ctrl+D
|
|
// recimo ugen
|
|
|
|
NetAddr.langPort;
|
|
|
|
|
|
(
|
|
|
|
SynthDef.new(\slOSC, {
|
|
// Najprej argumenti, potem variable
|
|
arg f=220, ampOsc=200, ch=0, off=0;
|
|
var so;
|
|
so = SinOsc.ar(f, off, SinOsc.kr(ampOsc));
|
|
Out.ar(ch, so);
|
|
}).add;
|
|
|
|
//s = Synth.new(\slOSC);
|
|
z = Synth.new(\slOSC);
|
|
//v = Synth.new(\slOSC);
|
|
u = Synth.new(\slOSC);
|
|
|
|
OSCFunc({
|
|
arg msg, time, addr, recvPort;
|
|
[msg, time, addr, recvPort].postln;
|
|
~gdX = msg[1];
|
|
~gdY = msg[2];
|
|
~gdZ = msg[3];
|
|
}, '/eulerDiff', n);
|
|
|
|
OSCFunc({
|
|
arg msg, time, addr, recvPort;
|
|
[msg, time, addr, recvPort].postln;
|
|
~gX = msg[1];
|
|
~gY = msg[2];
|
|
~gZ = msg[3];
|
|
}, '/euler', n);
|
|
|
|
OSCFunc({
|
|
arg msg, time, addr, recvPort;
|
|
[msg, time, addr, recvPort].postln;
|
|
~aX = msg[1];
|
|
~aY = msg[2];
|
|
~aZ = msg[3];
|
|
}, '/accel', n);
|
|
|
|
OSCFunc({
|
|
arg msg, time, addr, recvPort;
|
|
//msg.postln;
|
|
}, '/euler', n);
|
|
|
|
~polje = [];
|
|
|
|
OSCFunc({
|
|
arg msg, time, addr, recvPort;
|
|
//[msg, time, addr, recvPort].postln;
|
|
|
|
//s.get(\f, {arg f; s.set(\f, f + ~gX)});
|
|
//s.get(\f, {arg f; s.set(\f, f - (~aX / 100))});
|
|
z.get(\f, {arg f; s.set(\f, f + (~aY * 100))});
|
|
u.get(\f, {arg f; s.set(\f, f + (~aX / 10))});
|
|
|
|
//s.get(\f, {arg f; ~polje.add(f); s.set(\f, f + (~gdX * 100))});
|
|
//v.get(\f, {arg f; ~polje.add(f); s.set(\f, f + (~gdZ * 100))});
|
|
|
|
//z.get(\f, {arg f; s.set(\f, ~aY/ 10)});
|
|
|
|
//s.get(\ampOsc, {arg f; s.set(\ampOsc, f + (~gX))});
|
|
}, '/keys', n);
|
|
)
|
|
|
|
~polje;
|
|
|
|
[1, 5, 8, 7, 2, 19].plot;
|
|
|
|
[].add(123);
|