@ -0,0 +1,47 @@ | |||
// developement of 8-speaker output - notes, sketches... | |||
// use it in a synth def | |||
SynthDef(\testOcto, { | |||
arg x= 0, y = 0, fact; | |||
var son = WhiteNoise.ar(1) ; | |||
y = SinOsc.kr(0.1).range(0,1); | |||
//x = SinOsc.kr(0.4).range(0,1); | |||
Out.ar(0,~octoPanOut.value(son, x, y, fact)); | |||
//Out.ar(1,son); | |||
}).add; | |||
) | |||
x = Synth(\testOcto, [\fact, 100]); | |||
x.free | |||
////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
// pseudo-UGen proposition by 'elgiano' | |||
// https://scsynth.org/t/simple-spatialisation-function-synthdef-pseudo-ugen-or-ugen/1783/5 | |||
OctoPan : MultiOutUGen { | |||
classvar <>speakers = #[ | |||
[0,0],[0,360],[0,720],[0,1080],[650,1260],[650,900],[650,540],[650,180] | |||
]; | |||
*ar { arg in,x=0,y=0,speakers; | |||
^this.multiNew('audio', in,x,y); | |||
} | |||
*new1 { arg rate,in,x,y; | |||
var amps = this.speakers.collect{|coords| | |||
var dist = coords - [x,y]; | |||
1/(1+dist[0].hypot(dist[1])) | |||
}; | |||
^in*amps; | |||
} | |||
} | |||
@ -0,0 +1,111 @@ | |||
( | |||
// a function to position sound in space | |||
~octoPanOut = { | |||
arg in, in_x, in_y, fact; | |||
var s1_x=0, s1_y=0, s1_amp, | |||
s2_x=0, s2_y=360, s2_amp, | |||
s3_x=0, s3_y=720, s3_amp, | |||
s4_x=0, s4_y=1080, s4_amp, | |||
s5_x=650, s5_y=1260, s5_amp, | |||
s6_x=650, s6_y=900, s6_amp, | |||
s7_x=650, s7_y=540, s7_amp, | |||
s8_x=650, s8_y=180, s8_amp ; | |||
var factor = (1 / (5000000 * fact)); | |||
var distance = {|x1,y1,x2,y2| (x2-x1) hypot: (y2-y1) }; // hypothenuse | |||
var amp = 1 / (1 + (distance.cubed * factor)); | |||
// x,y are expected in rage 0-1 | |||
in_x = in_x * 650; | |||
in_y = in_y * 1260; | |||
s1_amp = amp.value(in_x,in_y,s1_x,s1_y); | |||
s2_amp = amp.value(in_x,in_y,s2_x,s2_y); | |||
s3_amp = amp.value(in_x,in_y,s3_x,s3_y); | |||
s4_amp = amp.value(in_x,in_y,s4_x,s4_y); | |||
s5_amp = amp.value(in_x,in_y,s5_x,s5_y); | |||
s6_amp = amp.value(in_x,in_y,s6_x,s6_y); | |||
s7_amp = amp.value(in_x,in_y,s7_x,s7_y); | |||
s8_amp = amp.value(in_x,in_y,s8_x,s8_y); | |||
[in * s1_amp, in * s2_amp, in * s3_amp, in * s4_amp, in * s5_amp, in * s6_amp, in * s7_amp, in * s8_amp] | |||
}; | |||
SynthDef("octoPanner", { | |||
arg inBus, x=0, y=0, radius=1; | |||
var snd = In.ar(inBus,1); | |||
y = SinOsc.kr(0.1,phase:1.5pi).range(0,1); | |||
x = SinOsc.kr(0.1,phase:1pi,mul:5).clip2.range(0,1); | |||
snd = ~octoPanOut.value(snd, x, y, radius); | |||
Out.ar(0, snd); | |||
}).add; | |||
SynthDef(\testOcto, { | |||
arg out; | |||
var son = WhiteNoise.ar(1) ; | |||
Out.ar(out,son); | |||
//Out.ar(1,son); | |||
}).add; | |||
) | |||
( // init busses for octoPanners | |||
~octoBus1.free; | |||
~octoBus2.free; | |||
~octoBus3.free; | |||
~octoBus4.free; | |||
~octoBus1 = Bus.audio(s,1); | |||
~octoBus2 = Bus.audio(s,1); | |||
~octoBus3 = Bus.audio(s,1); | |||
~octoBus4 = Bus.audio(s,1); | |||
// work with groups? | |||
~grp1 = Group.new; | |||
~grp2 = Group.new; | |||
) | |||
( // init octoPanners | |||
// if using groups | |||
~octoPanner1 = Synth("octoPanner", [\inBus, ~octoBus1], ~grp1, \addToTail); | |||
~octoPanner2 = Synth("octoPanner", [\inBus, ~octoBus2], ~grp2, \addToTail); | |||
// if using just one group, but control order of execution with \addBefore | |||
~octoPanner3 = Synth("octoPanner", [\inBus, ~octoBus3]); | |||
~octoPanner4 = Synth("octoPanner", [\inBus, ~octoBus4]); | |||
//~octoPanner4.free | |||
) | |||
// groups | |||
~whiteNoise = Synth(\testOcto, [\out, ~octoBus1], ~grp1); | |||
~whiteNoise2 = Synth(\testOcto, [\out, ~octoBus2], ~grp2); | |||
// without groups | |||
~whiteNoise3 = Synth(\testOcto, [\out, ~octoBus3], ~octoPanner3, \addBefore); | |||
~whiteNoise4 = Synth(\testOcto, [\out, ~octoBus4], ~octoPanner4, \addBefore); | |||
~whiteNoise4.free | |||
~octoPanner1.set(\radius, 0.01); // can control through | |||
~octoPanner2.set(\radius, 0.01); // can control through | |||
~octoPanner3.set(\radius, 0.01); // can control through | |||
~octoPanner4.set(\radius, 0.01); // can control through | |||
~grp1.free; | |||
~grp2.free |
@ -0,0 +1 @@ | |||
random@lallafa.2500:1583851107 |
@ -0,0 +1,101 @@ | |||
( | |||
// a function to position sound in space | |||
~octoPanOut = { | |||
arg in, in_x, in_y, fact; | |||
var s1_x=0, s1_y=0, s1_amp, | |||
s2_x=0, s2_y=360, s2_amp, | |||
s3_x=0, s3_y=720, s3_amp, | |||
s4_x=0, s4_y=1080, s4_amp, | |||
s5_x=650, s5_y=1260, s5_amp, | |||
s6_x=650, s6_y=900, s6_amp, | |||
s7_x=650, s7_y=540, s7_amp, | |||
s8_x=650, s8_y=180, s8_amp ; | |||
var factor = (1 / (5000000 * fact)); // exponential curve of amplification calculated from distance? log???? | |||
//var distance = {|x1,y1,x2,y2| ((x2-x1).squared + (y2-y1).squared).sqrt}; | |||
var distance = {|x1,y1,x2,y2| (x2-x1) hypot: (y2-y1) }; // hypothenuse | |||
var amp = 1 / (1 + (distance.cubed * factor)); | |||
//in_x = (in_x + 1) * 0.5 * 650; | |||
in_x = in_x * 650; | |||
//in_y = (in_y + 1) * 0.5 * 1260; | |||
in_y = in_y * 1260; | |||
s1_amp = amp.value(in_x,in_y,s1_x,s1_y); | |||
s2_amp = amp.value(in_x,in_y,s2_x,s2_y); | |||
s3_amp = amp.value(in_x,in_y,s3_x,s3_y); | |||
s4_amp = amp.value(in_x,in_y,s4_x,s4_y); | |||
s5_amp = amp.value(in_x,in_y,s5_x,s5_y); | |||
s6_amp = amp.value(in_x,in_y,s6_x,s6_y); | |||
s7_amp = amp.value(in_x,in_y,s7_x,s7_y); | |||
s8_amp = amp.value(in_x,in_y,s8_x,s8_y); | |||
[in * s1_amp, in * s2_amp, in * s3_amp, in * s4_amp, in * s5_amp, in * s6_amp, in * s7_amp, in * s8_amp] | |||
}; | |||
SynthDef("octoPanner", { | |||
arg inBus, x=0, y=0.14, radius=1; | |||
var snd = In.ar(inBus,1); | |||
snd = ~octoPanOut.value(snd, x, y, radius); | |||
Out.ar(0, snd); | |||
}).add; | |||
) | |||
////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
// pseudo-UGen proposition by 'elgiano' | |||
// https://scsynth.org/t/simple-spatialisation-function-synthdef-pseudo-ugen-or-ugen/1783/5 | |||
/* | |||
OctoPan : MultiOutUGen { | |||
classvar <>speakers = #[ | |||
[0,0],[0,360],[0,720],[0,1080],[650,1260],[650,900],[650,540],[650,180] | |||
]; | |||
*ar { arg in,x=0,y=0,speakers; | |||
^this.multiNew('audio', in,x,y); | |||
} | |||
*new1 { arg rate,in,x,y; | |||
var amps = this.speakers.collect{|coords| | |||
var dist = coords - [x,y]; | |||
1/(1+dist[0].hypot(dist[1])) | |||
}; | |||
^in*amps; | |||
} | |||
} | |||
*/ |
@ -0,0 +1,4 @@ | |||
( | |||
~forestSoilBuf = Buffer.read(s, | |||
PathName(thisProcess.nowExecutingPath).pathOnly +/+ "smp/403312__marco-luzi__forest-soil_norm-mono.wav" ); | |||
); |
@ -0,0 +1,22 @@ | |||
( // synthdef ///////// | |||
SynthDef(\fm_grainer, { | |||
arg out = 0, modfreq = rrand(10,1000), carfreq = 100 ; | |||
var signal; | |||
signal = GrainFM.ar( | |||
numChannels:2, | |||
trigger: Impulse.kr(LFTri.kr(0.1, -1)+1*10), | |||
dur: 0.05, | |||
carfreq: carfreq, | |||
modfreq: modfreq, | |||
// index: LFNoise1.kr.range(1, 90), | |||
index: SinOsc.kr(0.05)*0.2,// LFNoise1.kr.range(1, 90), | |||
pan: LFNoise1.kr.range(-1,1), | |||
envbufnum: -1 | |||
) * 0.2; | |||
signal = signal * EnvGen.kr(Env.linen(1,60,10,0.4,\lin),doneAction:Done.freeSelf); | |||
Out.ar(out, Splay.ar(signal)); | |||
}).add; | |||
); |
@ -0,0 +1,36 @@ | |||
( | |||
SynthDef(\granSoil, { | |||
arg out=0, gate = 1, amp = 0.5, sndbuf, envbuf = -1, fadeTime=1, rate=0.8, dur=0.01; | |||
var snd, env, freqdev; | |||
// use mouse x to control panning | |||
//pan = MouseX.kr(-1, 1); | |||
env = EnvGen.kr( | |||
Env([0, 1, 0], [fadeTime, fadeTime], \sin, 1), | |||
gate, | |||
//levelScale: amp, | |||
doneAction: Done.freeSelf); | |||
snd = GrainBuf.ar( | |||
numChannels: 1, | |||
trigger: Impulse.kr(200 * LFNoise2.kr(0.1).range(0.9,1.1)), | |||
//dur: MouseY.kr.range(0.001,1), | |||
//dur: SinOsc.kr(0.1).range(0.001,0.1), | |||
dur: dur, | |||
sndbuf: sndbuf, | |||
rate: rate, // the playback rate of the sampled sound | |||
//pos: MouseX.kr.range(0, 25) * LFNoise2.kr(20).range(0.999,1.001), | |||
pos: LFNoise2.kr(0.001).range(0, 25) * LFNoise2.kr(20).range(0.999,1.001), | |||
interp: 4, // 2: liner, 4: cubic | |||
pan: 0, | |||
envbufnum: envbuf, | |||
maxGrains: 1024); | |||
snd = snd * env * amp; | |||
Out.ar(out, snd); | |||
}).add; | |||
) |
@ -0,0 +1,132 @@ | |||
( | |||
SynthDef(\henonSynth1, { | |||
arg out=0; | |||
var sig, freq; | |||
freq = HenonN.ar( | |||
freq: 5000, | |||
a: LFNoise2.kr(1, 0.2, 1.2), | |||
b: LFNoise2.kr(1, 0.15, 0.15), | |||
mul: 0.6 | |||
); | |||
// used as frequency modulator | |||
sig = Pulse.ar( | |||
freq: freq.range(40, LFNoise2.kr(0.1).range(1000,10000)), | |||
mul: 0.2); | |||
sig = sig.ring3(0.5); | |||
sig = sig.clip2(0.8); | |||
sig = LeakDC.ar(sig); | |||
// if you don't have sc3_plugins, comment out the following line | |||
//sig = sig + (Greyhole.ar(in:sig, feedback:0.2, diff: 1, delayTime: 0.6) * 0.7); | |||
//y = SinOsc.kr(0.1,phase:1.5pi).range(0,1); | |||
//x = SinOsc.kr(0.1,phase:1.5pi).range(0,1); | |||
//x = SinOsc.kr(0.1,phase:1pi,mul:5).clip2.range(0,1); | |||
//Out.ar(out, sig); | |||
//sig = ~octoPanOut.value(sig, x, y, fact); | |||
Out.ar(out,sig); | |||
}).add; | |||
); | |||
( // henonN + henonC controlling filter * volume | |||
SynthDef(\henonLsynth1, { | |||
arg out=0, hpfreqmin=100; | |||
var snd; | |||
snd = (BrownNoise.ar() + Mix(SinOsc.ar(HenonN.ar(4,a:[1.4,1.1] ).range(200,400)))) * HenonN.ar(freq:1).range(0,0.5); | |||
snd = RHPF.ar(snd, HenonC.ar(freq:1).fold(0,1).exprange(hpfreqmin,7000), rq:1); | |||
snd = snd * HenonC.ar(0.5).range(0.6,1); | |||
Out.ar(out, snd); | |||
}).add; | |||
); | |||
( | |||
// henonLsynth = dark brooding melodic drone-noise | |||
SynthDef(\henonLsynth2, { | |||
arg out; | |||
var sig, sinfreq, env; | |||
env = EnvGen.kr(Env(levels: [0,1,1,0], times: [40, 170, 40], curve: \sin), doneAction: 2); | |||
sinfreq = LFPulse.kr( freq: 0.9, width:0.1); | |||
sinfreq = sinfreq.range( | |||
LFPulse.kr(0.073).range(37).midicps, | |||
[44.midicps,53.3.midicps] | |||
); | |||
sinfreq = sinfreq * SinOsc.kr(1).range(1,1.02); | |||
sig = SinOsc.ar(sinfreq); | |||
sig = sig + (BrownNoise.ar(0.4) * SinOsc.kr(0.1).range(0,1)); | |||
sig = sig * HenonN.ar(20).range(0,1).clip(0,1); | |||
sig = RLPF.ar(sig, HenonC.ar(1).fold(0,1).exprange(40,1000), rq:0.4); | |||
sig = sig.clip2(0.5); | |||
sig = sig * HenonC.ar(0.5).range(0,0.5); | |||
// sig = RHPF.ar(sig,5000); | |||
sig = sig + Greyhole.ar(sig * 0.6, feedback: 0.8, diff: 0.7, delayTime: 0.78123); | |||
sig = sig * env; | |||
//sig = Mix.new(sig); | |||
Out.ar(out, sig); | |||
}).add; | |||
); | |||
( // henonSquare being thrown around | |||
SynthDef(\henonSquare, { | |||
arg out=0, gate=1, amp=0.5; | |||
var env = EnvGen.kr(Env([0, 1, 0], [1, 4], \sin, 1), gate); | |||
var trig = HenonTrig.kr(); | |||
// wandering attractor into variable 'freq': | |||
var freq = HenonN.ar( | |||
TRand.kr(trig:trig).exprange(1,20), | |||
// parameters: | |||
//a: LFNoise2.kr(0.5).range(0.3,1.6), | |||
//b: LFNoise2.kr(0.5).range(0,0.6) | |||
//a: 1.4, | |||
a: LFTri.kr(0.01,3).range(1,1.5), // ramp up and down, slowly | |||
b: 0.3 | |||
).exprange(40,1000); | |||
// wandering attractor applied as frequency to squarewave: | |||
var sig = Pulse.ar([freq,freq]); | |||
// adding sinwave for more clean deep/soft sound | |||
sig = sig + SinOsc.ar([freq,freq*0.995]); | |||
// back to mono: | |||
sig = Mix(sig); | |||
// fold distortion | |||
sig = sig.fold2(0.5) * 2; | |||
// low pass filter to give sense of closing and opening | |||
sig = LPF.ar(sig, LFNoise2.kr(0.2).exprange(100,20000)); | |||
sig = sig * env; | |||
// add space. lots of space | |||
//sig = (sig * 0.5) + Greyhole.ar(sig * 0.5, delayTime:0.6, damp: 0.8, diff: 0, feedback:0.6,); | |||
DetectSilence.ar(sig, doneAction: Done.freeSelf); | |||
sig = sig * amp; | |||
Out.ar(out,sig); | |||
}).add; | |||
); |
@ -0,0 +1,149 @@ | |||
( // latoocarfian trig and 2DC ... | |||
SynthDef(\latooTriggers, { |out, trigA=1.1| | |||
var trig, sig; | |||
trig = LatoocarfianTrig.kr( | |||
minfreq: 4, | |||
maxfreq: 12, | |||
//a: [1.1,1.9] // or 1.9? | |||
a: trigA | |||
); | |||
sig = Latoocarfian2DC.ar( | |||
minfreq: 420, | |||
maxfreq: 8200, | |||
a: Lag.kr(TRand.kr(0.4, 0.8, trig), 0.1), | |||
b: Lag.kr(TRand.kr(2.0, 3.0, trig), 0.1), | |||
//d:[1.0, 1.1] | |||
d:1.1 | |||
); | |||
sig = (sig.cubed * 2).tanh; | |||
sig = sig + (BrownNoise.ar() * 0.1); | |||
sig = Ringz.ar(in:sig, freq: LFNoise2.kr(2).exprange(50,15000), decaytime: 0.02)*0.1; | |||
sig = (sig*0.4).fold2(0.9) + sig.excess(0.5).clip2(0.9); //!! | |||
sig = sig * Latch.kr(trig, trig); | |||
/* sig = sig + JPverb.ar( | |||
in: sig * 0.2, | |||
t60: LFNoise2.ar(0.4).range(0.2,3), | |||
damp:0.8, | |||
modDepth:0.3, | |||
modFreq:10); */ | |||
sig = LeakDC.ar(sig * 0.6); | |||
Out.ar(out,sig); | |||
}).add; | |||
); | |||
( // LatoocarfianC being thrown around | |||
SynthDef(\latooThroBass, { | |||
arg out, amp=0.5; | |||
// wandering latoocarfian into variable 'freq': | |||
var freq = LatoocarfianC.ar( | |||
30, | |||
// randomize parameters: | |||
LFNoise2.kr(0.1,1.5,1.5), | |||
LFNoise2.kr(0.4,1.5,1.5), | |||
LFNoise2.kr(0.3,0.5,1.5), | |||
LFNoise2.kr(0.2,0.5,1.5) | |||
).range(40,130); | |||
// wandering latoocarfian applied as frequency to squarewave: | |||
var sig = Mix(Pulse.ar([freq,freq*0.99])); | |||
// adding sinwave for more clean deep sound | |||
sig = sig + Mix(SinOsc.ar([freq*0.998,freq*0.995])); | |||
// pinch of simple fold distortion | |||
sig = sig.fold(-1,1); | |||
// low pass filter to give sense of closing and opening | |||
sig = LPF.ar(sig, LFNoise2.kr(1).exprange(50,15000)); | |||
// add space. lots of space | |||
//sig = sig * 0.4 + Greyhole.ar(sig * 0.4, delayTime:0.4, damp: 0.3, diff: 0.6, feedback:0.5,); | |||
sig = sig * amp; | |||
Out.ar(out,sig); | |||
}).add; | |||
); | |||
( // LatoocarfianC being thrown around | |||
SynthDef(\latooWanderings, { | |||
arg out = 0, gate = 1, fadeTime = 1, amp = 0.9; | |||
// a fade-in/out envelope | |||
var env = EnvGen.kr( Env([0, 1, 0], [fadeTime, fadeTime], \sin, 1), | |||
gate, levelScale: amp, doneAction: Done.freeSelf ); | |||
// wandering latoocarfian into variable 'freq': | |||
var freq = LatoocarfianC.ar( | |||
freq: 30, | |||
// randomize parameters: | |||
a: LFNoise2.kr(0.1,1.5,1.5), | |||
b: LFNoise2.kr(0.4,1.5,1.5), | |||
c: LFNoise2.kr(0.3,0.5,1.5), | |||
d: LFNoise2.kr(0.2,0.5,1.5) | |||
).range(40,130); | |||
// wandering latoocarfian applied as frequency to squarewave: | |||
var sig = Pulse.ar(freq * LFNoise2.kr(0.1).range(0.99,1.01)); | |||
// adding sinwave for more clean deep sound | |||
//sig = sig + SinOsc.ar([freq*0.998,freq*0.995]); | |||
sig = sig + SinOsc.ar(freq * LFNoise2.kr(0.1).range(0.99,1.01)); | |||
// pinch of simple fold distortion | |||
sig = sig.fold2(0.9); | |||
// low pass filter to give sense of closing and opening | |||
sig = LPF.ar(sig, LFNoise2.kr(1).exprange(50,15000)); | |||
// add space. lots of space | |||
// sig = sig * 0.4 + Greyhole.ar(sig * 0.4, delayTime:0.4, damp: 0.3, diff: 0.6, feedback:0.5,); | |||
sig = sig * env; | |||
Out.ar(out, sig); | |||
}).add; | |||
); | |||
@ -0,0 +1,15 @@ | |||
( | |||
SynthDef(\markovS1, { | |||
arg out, freq, tsize, amp, clip=1; | |||
var snd; | |||
snd = MarkovSynth.ar(SinOsc.ar(freq), 1, 0, tsize); | |||
snd = snd.clip2(clip); | |||
snd = snd * amp; | |||
Out.ar(out,snd); | |||
}).add; | |||
) |
@ -0,0 +1,50 @@ | |||
( | |||
SynthDef(\noiseCrackle, { // play // | |||
/* A noise generator based on a chaotic function. | |||
Class Methods | |||
Crackle.ar(chaosParam: 1.5, mul: 1.0, add: 0.0) | |||
Crackle.kr(chaosParam: 1.5, mul: 1.0, add: 0.0) | |||
Arguments: | |||
chaosParam - A parameter of the chaotic function with useful values | |||
from just below 1.0 to just above 2.0. Towards 2.0 the sound crackles. | |||
mul - Output will be multiplied by this value. | |||
add - This value will be added to the output. *********************/ | |||
// TODO: | |||
// expand on more arguments? | |||
arg out = 0, amp = 0.9, gate = 1, lpfa=1, hpfa=1, fadeTime=1; | |||
var sig, par, lpf, hpf, env; | |||
par = LFNoise1.kr(0.09).range(1.9,2.02); | |||
sig = Crackle.ar(par); | |||
lpf = RLPF.ar( | |||
in: sig, | |||
freq: Lag3.kr(LFNoise0.kr(0.08).exprange(50,10000),10), | |||
rq:0.8, | |||
mul: lpfa); | |||
hpf = RHPF.ar( | |||
in: sig, | |||
freq: Lag3.kr(LFNoise0.kr(0.065).exprange(50,10000),10), | |||
rq: 0.8, | |||
mul: hpfa); | |||
hpf = DelayN.ar(in:hpf, delaytime:0.11); | |||
sig = lpf + hpf; | |||
// a fade-in/out envelope | |||
env = EnvGen.kr( Env([0, 1, 0], [fadeTime, fadeTime], \sin, 1), | |||
gate, levelScale: amp, doneAction: Done.freeSelf); | |||
sig = sig * env; | |||
Out.ar(out, sig); | |||
}).add; | |||
); |
@ -0,0 +1,11 @@ | |||
SynthDef(\testOcto, { | |||
arg x= 0, y = 0, fact; | |||
var son = WhiteNoise.ar(1) ; | |||
y = SinOsc.kr(0.1).range(0,1); | |||
//x = SinOsc.kr(0.4).range(0,1); | |||
Out.ar(0,~octoPanOut.value(son, x, y, fact)); | |||
//Out.ar(1,son); | |||
}).add; |
@ -0,0 +1,88 @@ | |||
( | |||
SynthDef(\stndTrigRing, { | |||
arg out=0, freq=1000, min=1, max=10, decay=0.1, ffreq=1000, amp=1; | |||
var snd, in; | |||
in = StandardTrig.ar(min,max); | |||
snd = Ringz.ar(in, freq, decay); | |||
snd = LPF.ar(snd, ffreq); | |||
snd = snd * amp; | |||
Out.ar(out,snd) | |||
}).add; | |||
); | |||
( | |||
SynthDef(\henoTrigRing, { | |||
arg out=0, freq=1000, min=1, max=10, decay=0.1, ffreq=1000, amp=1; | |||
var snd, in; | |||
in = HenonTrig.ar(min,max); | |||
snd = Ringz.ar(in, freq, decay); | |||
snd = LPF.ar(snd, ffreq); | |||
snd = snd * amp; | |||
Out.ar(out,snd) | |||
}).add; | |||
); | |||
( | |||
SynthDef(\gbmanTrigRing, { | |||
arg out=0, freq=1000, min=1, max=10, decay=0.1, ffreq=1000, amp=1; | |||
var snd, in; | |||
in = GbmanTrig.ar(min,max); | |||
snd = Ringz.ar(in, freq, decay); | |||
snd = LPF.ar(snd, ffreq); | |||
snd = snd * amp; | |||
Out.ar(out,snd) | |||
}).add; | |||
); | |||
( | |||
SynthDef(\latooTrigRing, { | |||
arg out=0, freq=1000, min=1, max=10, decay=0.1, ffreq=1000, amp=1; | |||
var snd, in; | |||
in = LatoocarfianTrig.ar(min,max); | |||
snd = Ringz.ar(in, freq, decay); | |||
snd = LPF.ar(snd, ffreq); | |||
snd = snd * amp; | |||
Out.ar(out,snd) | |||
}).add; | |||
); | |||
( | |||
SynthDef(\lorenzTrigRing, { | |||
arg out=0, freq=1000, min=1, max=10, decay=0.1, ffreq=1000, amp=1; | |||
var snd, in; | |||
in = LorenzTrig.ar(min,max); | |||
snd = Ringz.ar(in, freq, decay); | |||
snd = LPF.ar(snd, ffreq); | |||
snd = snd * amp; | |||
Out.ar(out,snd) | |||
}).add; | |||
); | |||
( | |||
SynthDef(\fhnTrigRing, { | |||
arg out=0, freq=1000, min=1, max=10, decay=0.1, ffreq=1000, amp=1; | |||
var snd, in; | |||
in = FhnTrig.ar(min,max); | |||
snd = Ringz.ar(in, freq, decay); | |||
snd = LPF.ar(snd, ffreq); | |||
snd = snd * amp; | |||
Out.ar(out,snd) | |||
}).add; | |||
); | |||
@ -0,0 +1,455 @@ | |||
(/* | |||
Copyright (c) 2020 Luka Prinčič, All rights reserved. | |||
This program is free software distributed under | |||
GNU General Public Licence. See COPYING for more info. | |||
- - - - - - - - - - - - - - - - - - - - - - - - - - - - | |||
*/ | |||
// RHIZOSPHERE - STEKLENIK 2020 - CONA ////////////////////////////////////////////// | |||
postln(" | |||
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -"); | |||
/* | |||
>>> Hello. Starting RHIZOSPHERE <<<<< | |||
██████╗ ██╗ ██╗██╗███████╗ ██████╗ ███████╗██████╗ ██╗ ██╗███████╗██████╗ ███████╗ | |||
██╔══██╗██║ ██║██║╚══███╔╝██╔═══██╗██╔════╝██╔══██╗██║ ██║██╔════╝██╔══██╗██╔════╝ | |||
██████╔╝███████║██║ ███╔╝ ██║ ██║███████╗██████╔╝███████║█████╗ ██████╔╝█████╗ | |||
██╔══██╗██╔══██║██║ ███╔╝ ██║ ██║╚════██║██╔═══╝ ██╔══██║██╔══╝ ██╔══██╗██╔══╝ | |||
██║ ██║██║ ██║██║███████╗╚██████╔╝███████║██║ ██║ ██║███████╗██║ ██║███████╗ | |||
╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚══════╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚══════╝ | |||
"); | |||
*/ | |||
Server.default.waitForBoot { | |||
// library path | |||
var libPath = PathName(thisProcess.nowExecutingPath.dirname +/+ "lib"); | |||
// for each files in that lib folder | |||
libPath.filesDo({|afile| | |||
// tell me what you're executing: | |||
postln(" ." + afile.fileName); | |||
// execute it: | |||
this.executeFile(afile.fullPath); | |||
}); | |||
// important for patterns | |||
s.latency = 0.05; // default server's is 0.2 | |||
}); | |||
// octoPan busses ////////////// | |||
( | |||
// free busses and panners when re-trying things? | |||
~octoBus1.free; ~octoBus2.free; ~octoBus3.free; ~octoBus4.free; | |||
~panBus1x.free; ~panBus1y.free; ~panBus1r.free; | |||
~panBus2x.free; ~panBus2y.free; ~panBus2r.free; | |||
~panBus3x.free; ~panBus3y.free; ~panBus3r.free; | |||
~panBus4x.free; ~panBus4y.free; ~panBus4r.free; | |||
// octoBus1 + panners and control busses: | |||
~octoBus1 = Bus.audio(s,1); | |||
~panBus1x = Bus.control(s,1); | |||
~panBus1y = Bus.control(s,1); | |||
~panBus1r = Bus.control(s,1); | |||
~panBus1y.value = 0.14; // set a fixed value to a bus | |||
~panBus1x.value = 0; | |||
~panBus1r.value = 1; | |||
// octoBus2 + panners and control busses: | |||
~octoBus2 = Bus.audio(s,1); | |||
~panBus2x = Bus.control(s,1); | |||
~panBus2y = Bus.control(s,1); | |||
~panBus2r = Bus.control(s,1); | |||
~panBus2y.value = 0; // set a fixed value to a bus | |||
~panBus2x.value = 0; | |||
~panBus2r.value = 0.1; | |||
// octoBus3 + panners and control busses: | |||
~octoBus3 = Bus.audio(s,1); | |||
~panBus3x = Bus.control(s,1); | |||
~panBus3y = Bus.control(s,1); | |||
~panBus3r = Bus.control(s,1); | |||
~panBus3y.value = 0.29; // set a fixed value to a bus | |||
~panBus3x.value = 0; | |||
~panBus3r.value = 0.1; | |||
// octoBus4 + panners and control busses: | |||
~octoBus4 = Bus.audio(s,1); | |||
~panBus4x = Bus.control(s,1); | |||
~panBus4y = Bus.control(s,1); | |||
~panBus4r = Bus.control(s,1); | |||
~panBus4y.value = 0.29; // set a fixed value to a bus | |||
~panBus4x.value = 0; | |||
~panBus4r.value = 0.1; | |||
); | |||
( | |||
var timeLine, r; | |||
// CmdPeriod frees these, but not the busses, so only these need to be re-inst. | |||
~octoPanner1.free; ~octoPanner2.free; ~octoPanner3.free; ~octoPanner4.free; | |||
~octoPanner1 = Synth("octoPanner", [\inBus, ~octoBus1], addAction: \addToTail); | |||
~octoPanner1.map(\x, ~panBus1x); | |||
~octoPanner1.map(\y, ~panBus1y); | |||
~octoPanner1.map(\radius, ~panBus1r); | |||
~octoPanner2 = Synth("octoPanner", [\inBus, ~octoBus2], addAction: \addToTail); | |||
~octoPanner2.map(\x, ~panBus2x); | |||
~octoPanner2.map(\y, ~panBus2y); | |||
~octoPanner2.map(\radius, ~panBus2r); | |||
~octoPanner3 = Synth("octoPanner", [\inBus, ~octoBus3], addAction: \addToTail); | |||
~octoPanner3.map(\x, ~panBus3x); | |||
~octoPanner3.map(\y, ~panBus3y); | |||
~octoPanner3.map(\radius, ~panBus3r); | |||
~octoPanner4 = Synth("octoPanner", [\inBus, ~octoBus4], addAction: \addToTail); | |||
~octoPanner4.map(\x, ~panBus4x); | |||
~octoPanner4.map(\y, ~panBus4y); | |||
~octoPanner4.map(\radius, ~panBus4r); | |||
timeLine = Routine { | |||
"--- starting main routine ...".postln; | |||
1.wait; | |||
/* ***** ************************ | |||
">>> markov1 ...".postln; | |||
~markov1 = Synth(\markovS1, [ \out, ~octoBus1, | |||
\freq, 440, \tsize, 3, \amp, 0.9, \clip, 0.69, \fadeTime, 0.01 ]); | |||
wait(50); | |||
~markov1.set(\gate, 0, \fadeTime, 0.01); | |||
wait(10); | |||
~markov2 = Synth(\markovS1, [ \out, ~octoBus1, | |||
\freq, 440, \tsize, 3, \amp, 0.9, \clip, 0.69, \fadeTime, 0.01 ]); | |||
wait(8); | |||
~markov2.set(\gate, 0, \fadeTime, 0.1); | |||
wait(4); | |||
~markov3 = Synth(\markovS1, [ \out, 1, | |||
\freq, 440, \tsize, 3, \amp, 0.9, \clip, 0.69, \fadeTime, 1 ]); | |||
wait(8); | |||
~markov3.set(\gate, 0, \fadeTime, 0.1); | |||
~markov4 = Synth(\markovS1, [ \out, 0, | |||
\freq, 1441, \tsize, 3, \amp, 0.2, \clip, 0.69, \fadeTime, 1 ]); | |||
wait(8); | |||
~markov5 = Synth(\markovS1, [ \out, 1, | |||
\freq, 2440, \tsize, 3, \amp, 0.05, \clip, 0.69, \fadeTime, 1 ]); | |||
wait(15); | |||
~markov4.set(\gate,0, \fadeTime, 10); | |||
~markov6 = Synth(\markovS1, [ \out, 0, | |||
\freq, 842, \tsize, 10, \amp, 0.1, \clip, 0.69, \fadeTime, 1 ]); | |||
wait(20); | |||
~markov5.set(\gate,0, \fadeTime, 10); | |||
~markov2 = Synth(\markovS1, [ \out, ~octoBus1, | |||
\freq, 440, \tsize, 3, \amp, 0.9, \clip, 0.69, \fadeTime, 20 ]); | |||
wait(10); | |||
~markov6.set(\gate,0, \fadeTime, 10); | |||
wait(20); | |||
~markov2.set(\gate, 0, \fadeTime, 0.1); | |||
wait(10); | |||
~markov7 = Synth(\markovS1, [ \out, ~octoBus1, | |||
\freq, 740, \tsize, 3, \amp, 0.5, \clip, 0.9, \fadeTime, 0.01 ]); | |||
~markov8 = Synth(\markovS1, [ \out, ~octoBus1, | |||
\freq, 1140, \tsize, 3, \amp, 0.5, \clip, 0.9, \fadeTime, 0.01 ]); | |||
~markov9 = Synth(\markovS1, [ \out, ~octoBus1, | |||
\freq, 1940, \tsize, 3, \amp, 0.5, \clip, 0.9, \fadeTime, 0.01 ]); | |||
wait(20); | |||
~markov7.set(\gate, 0); | |||
~markov8.set(\gate, 0); | |||
~markov9.set(\gate, 0); | |||
wait(1); | |||
**********/ | |||
~markov7 = Synth(\markovS1, [ \out, ~octoBus1, | |||
\freq, 141, \tsize, 3, \amp, 0.5, \clip, 0.9, \fadeTime, 0.01 ]); | |||
~markov8 = Synth(\markovS1, [ \out, ~octoBus1, | |||
\freq, 830, \tsize, 9, \amp, 0.5, \clip, 0.9, \fadeTime, 0.01 ]); | |||
~markov9 = Synth(\markovS1, [ \out, ~octoBus1, | |||
\freq, 2941, \tsize, 10, \amp, 0.5, \clip, 0.9, \fadeTime, 0.01 ]); | |||
wait(10); | |||
~markov5 = Synth(\markovS1, [ \out, 1, | |||
\freq, 2440, \tsize, 3, \amp, 0.09, \clip, 0.69, \fadeTime, 1 ]); | |||
wait(10); | |||
~markov6 = Synth(\markovS1, [ \out, 0, | |||
\freq, 4440, \tsize, 3, \amp, 0.1, \clip, 0.69, \fadeTime, 1 ]); | |||
wait(5); | |||
~markov7.set(\gate, 0); | |||
~markov8.set(\gate, 0); | |||
~markov9.set(\gate, 0); | |||
wait(1); | |||
~markov7 = Synth(\markovS1, [ \out, ~octoBus1, | |||
\freq, 900, \tsize, 3, \amp, 0.1, \clip, 0.9, \fadeTime, 10 ]); | |||
~markov8 = Synth(\markovS1, [ \out, ~octoBus1, | |||
\freq, 1800, \tsize, 3, \amp, 0.1, \clip, 0.9, \fadeTime, 10 ]); | |||
~markov9 = Synth(\markovS1, [ \out, ~octoBus1, | |||
\freq, 5000, \tsize, 3, \amp, 0.1, \clip, 0.9, \fadeTime, 10 ]); | |||
wait(30); | |||
~markov10 = Synth(\markovS1, [ \out, ~octoBus1, | |||
\freq, 501, \tsize, 3, \amp, 0.1, \clip, 0.9, \fadeTime, 10 ]); | |||
~markov11 = Synth(\markovS1, [ \out, ~octoBus1, | |||
\freq, 1101, \tsize, 3, \amp, 0.1, \clip, 0.9, \fadeTime, 10 ]); | |||
~markov12 = Synth(\markovS1, [ \out, ~octoBus1, | |||
\freq, 3001, \tsize, 3, \amp, 0.1, \clip, 0.9, \fadeTime, 10 ]); | |||
~markov5.set(\gate, 0); | |||
~markov6.set(\gate, 0); | |||
wait(30); | |||
~markov7.set(\gate, 0, \fadeTime, 40); | |||
~markov8.set(\gate, 0, \fadeTime, 40); | |||
~markov9.set(\gate, 0, \fadeTime, 40); | |||
wait(60); | |||
~markov10.set(\gate, 0, \fadeTime, 40); | |||
~markov11.set(\gate, 0, \fadeTime, 40); | |||
~markov12.set(\gate, 0, \fadeTime, 40); | |||
wait(20); | |||
~noiseCr1 = Synth(\noiseCrackle, [\out, ~octoBus1, \fadeTime, 10 ]); | |||
wait(30); | |||
~noiseCr1.set(\lpfa,1,\hpfa,0); | |||
wait(10); | |||
~noiseCr1.set(\lpfa,0,\hpfa,1); | |||
wait(5); | |||
~noiseCr1.set(\lpfa,1,\hpfa,1); | |||
wait(30); | |||
~noiseCr1.set(\fadeTime, 20, \gate,0); | |||
/* | |||
~latooWan1 = Synth(\latooWanderings, [\out, ~octoBus4, \fadeTime, 10]); | |||
30.wait; | |||
~latooWan1.set(\gate, 0, \fadeTime, 5); | |||
10.wait; | |||
"done".postln; | |||
*/ | |||
//Pbind(\freq, Prand([300, 500, 231.2, 399.2], 80), \dur, 0.1).play; | |||
//20.wait; | |||
/* | |||
( // with routine synth*env can be 'run' multiple times in succession!! | |||
r = Routine { 200.do({ | |||
x = Synth(\fm_grainer, [ "modfreq", rrand(10,1000), "carfreq", rrand(40,100), | |||
\out, ~octoBus1 ]); // should we go through panning? | |||
1.wait; }); | |||
"done".postln; | |||
}.play; | |||
); | |||
*/ | |||
"--- end of the TIMELINE ---".postln | |||
}; | |||
timeLine.play; | |||
); | |||
// 'set' values - disconnects mapping! | |||
~octoPanner1.set(\x, 0, \y, 0.14, \radius, 0.1); | |||
( // send oscilations to control bus | |||
~panner1y.free; | |||
~panner1y = {Out.kr(~panBus1y, LFNoise0.kr(9).range(0,0.28))}.play; | |||
~panner1y = SynthDef(\randomPanY, { Out.kr(~panBus1y, LFNoise0.kr(9).range(0,0.28))}).play; | |||
// convert to SynthDef + Synth for common oscilations? | |||
) | |||
( // metering/analysis | |||
s.meter; | |||
s.scope; | |||
s.plotTree; | |||
FreqScope.new(400, 200, 0, server: s); | |||
) ///////////////////////////////////// | |||
// synths | |||
~henonS1 = Synth(\henonSynth1, [\out, ~octoBus1], ~octoPanner1, \addBefore); | |||
~henonS1 = Synth(\henonSynth1, [\out, ~octoBus1], addAction:\addToHead);// addToHead is default action | |||
~henonS1 = Synth(\henonSynth1, [\out, ~octoBus1]); | |||
~henonS1.free; | |||
~darkHenon = Synth(\henonLsynth2, [\out, ~octoBus2], ~octoPanner2, \addBefore); | |||
~darkHenon = Synth(\henonLsynth2, [\out, ~octoBus2]); | |||
~darkHenon.free; | |||
~hpfHenon = Synth(\henonLsynth1, [\out, ~octoBus3, \hpfreqmin, 100]); | |||
~hpfHenon.free; | |||
~distbleeps = Synth(\latooTriggers, [\out, ~octoBus1, \trigA, 1.1], ~octoPanner1, \addBefore); | |||
~distbleeps = Synth(\latooTriggers, [\out, ~octoBus4, \trigA, 1.1]); | |||
~distbleeps.free | |||
~bassLatoo = Synth(\latooThroBass, [\out, ~octoBus1, \amp, 0.2]); | |||
~bassLatoo.free; | |||
~henonSquare = Synth(\henonSquare, [\out, ~octoBus1, \amp, 0.2]); | |||
~henonSquare.set(\gate,0); | |||
~latooWan1 = Synth(\latooWanderings, [\out, ~octoBus4, \fadeTime, 0.1]); | |||
~latooWan1.set(\gate, 0, \fadeTime, 10); | |||
~latooWan1.free; | |||
(~markov1 = Synth(\markovS1, [\out, ~octoBus1, \freq, 400, \tsize, 3, \amp, 0.7, \clip, 0.99]);) | |||
~markov1.free; | |||
~markov2 = Synth(\markovS1, [\out, ~octoBus1, \freq, 1801, \tsize, 3, \amp, 0.7, \clip, 0.99], ~octoPanner1, \addBefore); | |||
~markov2.free; | |||
~markov3 = Synth(\markovS1, [\out, ~octoBus1, \freq, 799, \tsize, 3, \amp, 1, \clip, 0.98]); | |||
~markov3.free; | |||
~markov4 = Synth(\markovS1, [\out, ~octoBus1, \freq, 1600, \tsize, 9, \amp, 1, \clip, 0.98]); | |||
~markov4.free; | |||
~noiseCr1 = Synth(\noiseCrackle, [\out, ~octoBus1, \fadeTime, 5 ]); | |||
~noiseCr1.set(\lpfa,1,\hpfa,0); | |||
~noiseCr1.set(\amp,0.3); | |||
~noiseCr1.set(\fadeTime, 20, \gate,0); | |||
~noiseCr1.free; | |||
////// ring resonator ringing the clicks from triggers | |||
~stdTrig1 = Synth(\stndTrigRing, [\out, ~octoBus1, \freq,1900]); | |||
~stdTrig1.free | |||
(~stdTrig2 = Synth(\stndTrigRing, [\freq, 70, \min, 0, \max, 2, \decay, 2, \ffreq, 200, \amp, 0.9, | |||
\out, ~octoBus1]) ) | |||
~stdTrig2.free | |||
~henoTrig1 = Synth(\henoTrigRing, [\out, ~octoBus1, \freq, 700, \amp, 0.5], ~octoPanner1, \addBefore); | |||
~henoTrig1.free; | |||
~gbmanTrig1 = Synth(\gbmanTrigRing, [\out, ~octoBus1, \freq, 900, \amp, 0.5], ~octoPanner1, \addBefore); | |||
~gbmanTrig1.free; | |||
~latooTrig1 = Synth(\latooTrigRing, [\out, ~octoBus1, \freq, 300], ~octoPanner1, \addBefore); | |||
~latooTrig1.free; | |||
~lorenzTrig1 = Synth(\lorenzTrigRing, [\out, ~octoBus1, \freq, 1400, \amp, 0.5], ~octoPanner1, \addBefore); | |||
~lorenzTrig1.free; | |||
~fhnTrig1 = Synth(\fhnTrigRing, [\out, ~octoBus1, \freq, 2100, \amp, 0.5], ~octoPanner1, \addBefore); | |||
~fhnTrig1.free; | |||
// forestSoil granulation | |||
~soil1 = Synth(\granSoil, [\out, ~octoBus1, \sndbuf, ~forestSoilBuf]); | |||
~soil1.set(\rate, 0.2); | |||
~soil1.set(\out, 1); | |||
~soil1.set(\dur, 0.01); | |||
~soil1.set(\amp, 3); | |||
~soil1.set(\envbuf, ~planotaBuf); | |||
// send SinOscilation to a argument via bus | |||
~foreskrBus = Bus.control(s, 1); | |||
~soil1.map(\dur, ~foreskrBus); | |||
~durOsc = {Out.kr(~foreskrBus, SinOsc.kr(0.1).range(0.007,0.1))}.play; | |||
~durOsc.free; | |||
// another granulator | |||
~soil2 = Synth(\granSoil, [\out, ~octoBus2, \sndbuf, ~forestSoilBuf]); | |||
~soil2.map(\dur, ~foreskrBus); | |||
~soil1.set(\gate, 0, \fadeTime, 2); // use envelope to fade out | |||
~soil2.set(\gate, 0, \fadeTime, 2); // use envelope to fade out | |||
// stop:free | |||
~soil1.free // stop. | |||
~soil2.free // stop. | |||
// a different approach with routine | |||
// FM grainers all over the place? | |||
( // with routine synth*env can be 'run' multiple times in succession!! | |||
var r; | |||
r = Routine { 200.do({ | |||
x = Synth(\fm_grainer, [ "modfreq", rrand(10,1000), "carfreq", rrand(40,100), | |||
\out, 0 ]); // should we go through panning? | |||
1.wait; }); | |||
"done".postln; | |||
}.play; | |||
) | |||
r = Recorder(s); | |||
r.recHeaderFormat = "wav"; | |||
{ GVerb.ar(Dust.ar(4)) }.play; // play on bus 64 | |||
r.record(numChannels:2); | |||
r.stopRecording; | |||
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | |||
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | |||
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | |||
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | |||
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | |||
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | |||
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |