Dodani supercollider patchi

main
Jurij Podgoršek 2022-05-05 19:39:06 +02:00
parent efe7e680c5
commit 4e7de21a52
5 changed files with 261 additions and 0 deletions

134
sc/ww1.scd 100644
View File

@ -0,0 +1,134 @@
// Zacetek / konec
Server.local.boot;
Server.local.quit;
s.boot;
s.stop;
// Server -> Boot /// Ctrl+B
{SinOsc.ar}.play; // Shift+Enter evalvira
// Ctrl + . ustavi zvok!
// Start/stop prek spremenljivke
x = {SinOsc.ar}.play;
x.free;
// HELP: shift+ctrl+D
// recimo ugen
{SinOsc.ar(SinOsc.kr(1, 0, 1, 1), 0, 1, 0)}.play
{SinOsc.ar(520, 0, SinOsc.ar(3, 0.75, add: 1, phase: 0))}.play;
{VarSaw.ar(42, 0, SinOsc.ar(2, 0.75, add: 1, phase: 0))}.play;
{SinOsc.ar(32, 0, VarSaw.kr(3, 0.75, add: 1, phase: 0))}.play;
{SinOsc.ar(100, )}.play
// Kurzor na keyword in Ctrl+d odpre help zanj
(
{SinOsc.ar(100,)}.play;
{SinOsc.ar(100, 3.14)}.play;
)
()
(
SynthDef.new(\kFaza, {
var a = SinOsc.ar(100);
var b = SinOsc.ar(100, 3.14);
Out.ar(0, a);
Out.ar(1, b);
}).add;
)
(
SynthDef.new(\faza, {
var a = SinOsc.ar(100);
var b = SinOsc.ar(100);
Out.ar(0, a);
Out.ar(1, b);
}).add;
)
s = Synth.new(\kFaza);
v = Synth.new(\faza);
z.set(\f, 80);
z.set(\f, 200, \amp, 0.5);
NetAddr.langPort;
a= 0;
b= 0;
c= 0;
d= 0;
// WW
// Receiver function
(
SynthDef.new(\slOSC, {
// Najprej argumenti, potem variable
arg f=0, ampOsc=0, ch=0, off=0;
var so;
so = SinOsc.ar(f, off, SinOsc.kr(ampOsc));
Out.ar(ch, so);
}).add;
a = Synth.new(\slOSC);
b = Synth.new(\slOSC);
c = Synth.new(\slOSC);
d = Synth.new(\slOSC);
s = [a, b, c, d];
OSCFunc({
arg msg, time, addr, recvPort;
//[msg, time, addr, recvPort].postln;
~gX = msg[1] * 100;
~gY = msg[2] / 3;
}, '/euler', n);
OSCFunc({
arg msg, time, addr, recvPort;
//[msg, time, addr, recvPort].postln;
4.do({
arg i;
if (msg[i + 1] == 1.0) {
s[i].set(\f, ~gX);
s[i].set(\ampOsc, ~gY);
s[i].set(\off, ~gZ);
}
});
}, '/keys', n);
)
// ENDWW
(
w = {
arg noiseHz = 2.5;
var f, sig, amp;
// Med 200 in 1000 Hz
//f = LFNoise0.kr(8, 400, 600);
// f = LFNoise0.kr(8).range(200, 1000)
f = LFNoise0.kr(noiseHz).exprange(300, 600);
amp = LFNoise1.kr(9).exprange(0.2, 1);
sig = SinOsc.ar(f) * amp;
}.play;
)
w.set(\noiseHz, 48);
w.set(\noiseHz, exprand(260, 400));
w.free;

57
sc/ww2.scd 100644
View File

@ -0,0 +1,57 @@
// 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=440, ampOsc=0, ch=0, off=0;
var so;
so = SinOsc.ar(f, off, SinOsc.kr(ampOsc));
Out.ar(ch, so);
}).add;
s = [
Synth.new(\slOSC),
Synth.new(\slOSC),
Synth.new(\slOSC),
Synth.new(\slOSC)
];
OSCFunc({
arg msg, time, addr, recvPort;
//[msg, time, addr, recvPort].postln;
~gX = msg[1] * 100;
~gY = msg[2] / 3;
~gZ = msg[3] / 5;
}, '/eulerDiff', n);
OSCFunc({
arg msg, time, addr, recvPort;
msg.postln;
}, '/euler', n);
OSCFunc({
arg msg, time, addr, recvPort;
//[msg, time, addr, recvPort].postln;
4.do({
arg i;
if (msg[i + 1] == 1.0) {
s[i].get(\f, {arg f; s[i].set(\f, f + ~gX)});
s[i].get(\ampOsc, {arg ao; s[i].set(\ampOsc, ao + ~gY)});
s[i].get(\off, {arg o; s[i].set(\off, o + ~gZ)});
}
});
}, '/keys', n);
)

70
sc/ww3.scd 100644
View File

@ -0,0 +1,70 @@
// 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=120, ampOsc=1, ch=0, off=1;
var so;
so = SinOsc.ar(f, off, SinOsc.kr(ampOsc));
Out.ar(ch, so);
}).add);
s = [
Synth.new(\slOSC),
Synth.new(\slOSC, [\ampOsc, 1.5]),
Synth.new(\slOSC, [\ampOsc, 3]),
Synth.new(\slOSC, [\ampOsc, 4])
];
OSCFunc({
arg msg, time, addr, recvPort;
//[msg, time, addr, recvPort].postln;
~gX = msg[1];
~gY = msg[2];
~gZ = msg[3];
}, '/eulerDiff', n);
OSCFunc({
arg msg, time, addr, recvPort;
msg.postln;
}, '/euler', n);
OSCFunc({
arg msg, time, addr, recvPort;
//[msg, time, addr, recvPort].postln;
/*
if (msg[0]+msg[1]+msg[2]+msg[3] == 4.0) {
4.do({
arg i;
if (msg[i + 1] == 1.0) {
s[i].set(\f, 100);
s[i].set(\ampOsc, 1);
s[i].set(\off, 1);
}
});
} else {*/
4.do({
arg i;
if (msg[i + 1] == 1.0) {
s[i].get(\f, {arg f; s[i].set(\f, f * (1 + ~gX))});
s[i].get(\ampOsc, {arg ao; s[i].set(\ampOsc, ao * (1 + ~gY))});
s[i].get(\off, {arg o; s[i].set(\off, o * (1 + ~gZ))});
}
});
//}
}, '/keys', n);
)