1
0
Fork 0

spatialization improvements

8-channel
Luka Prinčič 2020-06-06 10:38:47 +02:00
parent be828a7173
commit 1eda666022
1 changed files with 131 additions and 27 deletions

View File

@ -29,7 +29,8 @@ Server.default.waitForBoot {
});
});
s.meter; s.plotTree;
s.meter;
s.plotTree;
@ -50,7 +51,7 @@ s.meter; s.plotTree;
~panBus1r = Bus.control(s,1);
~panBus1y.value = 0.14; // set a fixed value to a bus
~panBus1x.value = 0;
~panBus1r.value = 2;
~panBus1r.value = 1;
// octoBus2 + panners and control busses:
~octoBus2 = Bus.audio(s,1);
@ -126,17 +127,15 @@ var timeLine;
// some default oscilations of pan and reverb
~panner1y = SynthDef(\randomPanY1, { Out.kr(~panBus1y, LFNoise1.kr(0.1).range(0,1))}).play;
~panner2y = SynthDef(\randomPanY2, { Out.kr(~panBus2y, LFNoise1.kr(0.1).range(0,1))}).play;
~panner3y = SynthDef(\randomPanY3, { Out.kr(~panBus3y, LFNoise1.kr(0.1).range(0,1))}).play;
~panner4y = SynthDef(\randomPanY4, { Out.kr(~panBus4y, LFNoise1.kr(0.1).range(0,1))}).play;
~panner1x = SynthDef(\randomPanX1, { Out.kr(~panBus1x, LFNoise1.kr(0.1).range(0,1))}).play;
~panner2x = SynthDef(\randomPanX2, { Out.kr(~panBus2x, LFNoise1.kr(0.1).range(0,1))}).play;
~panner3x = SynthDef(\randomPanX3, { Out.kr(~panBus3x, LFNoise1.kr(0.1).range(0,1))}).play;
~panner4x = SynthDef(\randomPanX4, { Out.kr(~panBus4x, LFNoise1.kr(0.1).range(0,1))}).play;
~panner1y.free; ~panner2y.free; ~panner3y.free; ~panner4y.free;
~panner1x.free; ~panner2x.free; ~panner3x.free; ~panner4x.free;
~reverb1wetBus.free; // ~wetOsc.free; // clean up
~reverb2wetBus.free; // ~wetOsc.free; // clean up
~reverb3wetBus.free; // ~wetOsc.free; // clean up
~reverb4wetBus.free; // ~wetOsc.free; // clean up
~reverb1wetBus = Bus.control(s, 1); // create control bus
~reverb.map(\verb1wet, ~reverb1wetBus); // map an argument to control bus
@ -146,10 +145,12 @@ var timeLine;
~reverb.map(\verb3wet, ~reverb3wetBus); // map an argument to control bus
~reverb4wetBus = Bus.control(s, 1); // create control bus
~reverb.map(\verb4wet, ~reverb4wetBus); // map an argument to control bus
~wetOsc = SynthDef(\randomVerb1, {Out.kr(~reverb1wetBus, LFNoise2.kr(1).range(0, 0.8)) }).play;
~wetOsc = SynthDef(\randomVerb2, {Out.kr(~reverb2wetBus, LFNoise2.kr(1).range(0, 0.8)) }).play;
~wetOsc = SynthDef(\randomVerb3, {Out.kr(~reverb3wetBus, LFNoise2.kr(1).range(0, 0.8)) }).play;
~wetOsc = SynthDef(\randomVerb4, {Out.kr(~reverb4wetBus, LFNoise2.kr(1).range(0, 0.8)) }).play;
~wetOsc1.free; ~wetOsc2.free; ~wetOsc3.free; ~wetOsc4.free;
~wetOsc1 = SynthDef(\randomVerb1, {Out.kr(~reverb1wetBus, LFNoise2.kr(1).range(0, 0.8)) }).play;
~wetOsc2 = SynthDef(\randomVerb2, {Out.kr(~reverb2wetBus, LFNoise2.kr(1).range(0, 0.8)) }).play;
~wetOsc3 = SynthDef(\randomVerb3, {Out.kr(~reverb3wetBus, LFNoise2.kr(1).range(0, 0.8)) }).play;
~wetOsc4 = SynthDef(\randomVerb4, {Out.kr(~reverb4wetBus, LFNoise2.kr(1).range(0, 0.8)) }).play;
// ~wetOsc.free;
// ~reverb.set(\verb1wet, 0);
@ -158,18 +159,25 @@ var timeLine;
//);
//(
//var timeLine;
timeLine = Routine {
"--- starting main routine ...".postln;
/// SOIL //////////////////////////////////
// forestSoil granulation
"\n--- PART 1 ---".postln;
"--- starting forestSoil granulation ...".postln;
~soil1 = Synth(\granSoil, [\out, ~octoBus1, \sndbuf, ~forestSoilBuf, \dur, 0.0001 ,\fadeTime, 20, \amp, 0.8]);
~soil1durBus = Bus.control(s,1);
~soil1durBus.value = 0.0001;
~soil1.map(\dur, ~soil1durBus);
"--- starting panner1y sin Oscilation ...".postln;
~panner1y = SynthDef(\sinPanY1, { Out.kr(~panBus1y, SinOsc.kr(0.01).range(0.3,0.5))}).play;
~panBus1x.value = 1;
~panBus1r.value = 1;
wait(80);
"--- starting soil2 ...".postln;
@ -177,24 +185,28 @@ timeLine = Routine {
~soil2durBus = Bus.control(s,1);
~soil2durBus.value = 0.0001;
~soil2.map(\dur, ~soil2durBus);
"--- starting panner2y sin Oscilation ...".postln;
~panner2y = SynthDef(\sinPanY2, { Out.kr(~panBus2y, SinOsc.kr(0.015).range(0.3,0.5))}).play;
~panBus2x.value = 0;
~panBus2r.value = 1;
wait(20);
"--- starting oscilating duration ...".postln;
~soil1DurOsc = SynthDef( \soilDurOsc, {Out.kr(~soil1durBus, SinOsc.kr(0.012,1.5pi).range(0.0001, 0.05))} ).play;
wait(20);
// ~soil1DurOsc.free;
"--- starting oscilating duration 2...".postln;
~soil2DurOsc = SynthDef( \soilDurOsc, {Out.kr(~soil2durBus, SinOsc.kr(0.029,1.5pi).range(0.0001, 0.08))} ).play;
wait(120);
"--- return to static duration, abruptly...".postln;
~panner1y.free; ~panner2y.free;
~panBus1y.value = 0.1;
~soil1.set(\dur, 0.0001);
wait(1);
~soil2.set(\dur, 0.0001);
~panBus2y.value = 0.9;
// this could repeat somewhat?
"--- fade soils...".postln;
~soil1.set(\gate, 0, \fadeTime, 15); // use envelope to fade out
wait(3);
@ -204,31 +216,52 @@ timeLine = Routine {
~soil1DurOsc.free;
~soil2DurOsc.free;
// trigRingz //////////////////////////////////////////////////////////////////////////////////////////////////////
"\n--- PART 2 ---".postln;
"--- starting lorenzTrig1 ...".postln;
~lorenzTrig1 = Synth(\lorenzTrigRing, [\out, ~octoBus1, \freq, 1400, \amp, 0.5, \fadeTime, 5]);
~panBus1y.value = 0; // set a fixed value to a bus
~panBus1x.value = 0;
~panBus1r.value = 0.1;
wait(50);
"--- starting stdTrig1 ...".postln;
~stdTrig1 = Synth(\stndTrigRing, [\out, ~octoBus2, \freq,1900, \amp,0.5,\fadeTime, 10]);
~panBus2y.value = 1; // set a fixed value to a bus
~panBus2x.value = 1;
~panBus2r.value = 0.1;
wait(40);
"--- starting lorenzTrig2 ...".postln;
~lorenzTrig2 = Synth(\lorenzTrigRing, [\out, ~octoBus3, \freq, 400, \amp, 0.3, \fadeTime, 10, \min, 5, \max, 20]);
~panBus3y.value = 0.14; // set a fixed value to a bus
~panBus3x.value = 1;
~panBus3r.value = 0.1;
wait(30);
"--- starting stdTrig2 ...".postln;
~stdTrig2 = Synth(\stndTrigRing, [\freq, 70, \min, 0, \max, 2, \decay, 2, \ffreq, 200, \amp, 0.4, \out, ~octoBus4, \fadeTime, 20]) ;
~panBus4y.value = 0.9; // set a fixed value to a bus
~panBus4x.value = 0;
~panBus4r.value = 1;
wait(20);
"--- starting henoTrig1 ...".postln;
~henoTrig1 = Synth(\henoTrigRing, [\out, ~octoBus2, \freq, 2700, \amp, 1, \min, 0.1, \max, 1, \fadeTime, 20]);
~panBus2y.value = 1; // set a fixed value to a bus
~panBus2x.value = 1;
~panBus2r.value = 1;
wait(10);
"--- starting henoTrig1 ...".postln;
~gbmanTrig1 = Synth(\gbmanTrigRing, [\out, ~octoBus1, \freq, 139, \decay, 2, \min, 0.2, \max, 1, \amp, 0.4, \fadeTime, 2]);
~panBus1y.value = 0; // set a fixed value to a bus
~panBus1x.value = 1;
~panBus3x.value = 0;
~panBus1r.value = 50;
wait(10);
"--- starting latooTrig1 ...".postln;
@ -240,21 +273,38 @@ timeLine = Routine {
wait(10);
"--- starting fhnTrig1 ...".postln;
~fhnTrig1 = Synth(\fhnTrigRing, [\out, ~octoBus1, \freq, 210, \amp, 0.5, \decay, 2, \min, 0.2, \max, 1, \amp, 0.4, \fadeTime, 10]);
~fhnTrig1 = Synth(\fhnTrigRing, [\out, ~octoBus2, \freq, 210, \amp, 0.5, \decay, 2, \min, 0.2, \max, 1, \amp, 0.4, \fadeTime, 10]);
wait(20);
"--- starting fhnTrig3 ...".postln;
~fhnTrig3 = Synth(\fhnTrigRing, [\out, ~octoBus1, \freq, 200, \amp, 0.5, \decay, 2, \min, 0.2, \max, 1, \amp, 0.4, \fadeTime, 10]);
~fhnTrig3 = Synth(\fhnTrigRing, [\out, ~octoBus2, \freq, 200, \amp, 0.5, \decay, 2, \min, 0.2, \max, 1, \amp, 0.4, \fadeTime, 10]);
wait(20);
"--- starting fhnTrig2 ...".postln;
~fhnTrig2 = Synth(\fhnTrigRing, [\out, ~octoBus2, \freq, 2110, \amp, 0.5, \min, 2, \max, 20, \amp, 0.5, \fadeTime, 10]);
~fhnTrig2 = Synth(\fhnTrigRing, [\out, ~octoBus1, \freq, 2110, \amp, 0.5, \min, 2, \max, 20, \amp, 0.5, \fadeTime, 10]);
wait(20);
"--- starting ~fmgrainer ...".postln;
~fmgrainer = Routine { 200.do({ x = Synth(\fm_grainer, [ "modfreq", rrand(10,1000), "carfreq", rrand(40,100), \out, ~octoBus1 ]); 1.wait; }); "--- fmgrains done generating new ones ...".postln; }.play;
// this one will fade out by itself at some point
wait(60);
wait(20);
~panBus1y.value = 0.1; // set a fixed value to a bus
~panBus1x.value = 0.1;
wait(10);
~panBus1y.value = 0.2; // set a fixed value to a bus
~panBus1x.value = 0.2;
wait(10);
~panBus1y.value = 0.3; // set a fixed value to a bus
~panBus1x.value = 0.3;
wait(10);
~panBus1y.value = 0.4; // set a fixed value to a bus
~panBus1x.value = 0.4;
wait(10);
~panBus1y.value = 0.5; // set a fixed value to a bus
~panBus1x.value = 0.5;
wait(20);
"--- fading out ~stdTrig1, stdTrig2, lorenzTrig2, henoTrig1...".postln;
~stdTrig1.set(\fadeTime, 5, \gate, 0);
@ -280,20 +330,35 @@ timeLine = Routine {
"--- latooWanderings ...".postln;
~latooWan1 = Synth(\latooWanderings, [\out, ~octoBus4, \fadeTime, 30, \amp, 0.3]);
wait(60);
~panBus4y.value = 0.9; // set a fixed value to a bus
~panBus4x.value = 0;
~panBus4r.value = 1;
wait(30);
~panner4y = SynthDef(\randomPanY4, { Out.kr(~panBus4y, LFNoise1.kr(0.9).range(0,1))}).play;
// wait(60);
"\n--- PART 3 ---".postln;
"--- markov1 ...".postln;
~markov1 = Synth(\markovS1, [ \out, ~octoBus1, \freq, 440, \tsize, 3, \amp, 0.3, \clip, 0.69, \fadeTime, 0.01 ]);
~panBus1y.value = 0;
~panBus1x.value = 1;
~panBus1r.value = 1;
wait(60);
"--- cut markov1 & latooWan, start distbleeps ...".postln;
~markov1.set(\gate, 0, \fadeTime, 0.01);
~latooWan1.set(\gate, 0, \fadeTime, 0.01);
~distbleeps = Synth(\latooTriggers, [\out, ~octoBus3, \trigA, 1.1, \fadeTime, 0.01, \amp, 0.9]);
~panBus3y.value = 1; // set a fixed value to a bus
~panBus3x.value = 0;
~panBus3r.value = 2;
wait(30);
"--- markov7 ...".postln;
~panBus2y.value = 1; // set a fixed value to a bus
~panBus2x.value = 1;
~panBus2r.value = 2;
~markov7 = Synth(\markovS1, [ \out, ~octoBus2, \freq, 740, \tsize, 3, \amp, 0.2, \clip, 0.9, \fadeTime, 7 ]);
wait(20);
@ -302,6 +367,9 @@ timeLine = Routine {
~distbleeps.set(\gate, 0, \fadeTime, 0.01);
"--- markov9 ...".postln;
~panner1y = SynthDef(\randomPanY1, { Out.kr(~panBus1y, LFTri.kr(7).range(0,1))}).play;
~panBus1x.value = 1;
~panBus1r.value = 1;
~markov9 = Synth(\markovS1, [ \out, ~octoBus1, \freq, 1940, \tsize, 3, \amp, 0.2, \clip, 0.9, \fadeTime, 0.01 ]);
wait(30);
@ -310,6 +378,14 @@ timeLine = Routine {
wait(5);
"--- markov10,11,12 ...".postln;
~paner2y.free; ~panner3y.free; ~panner4y.free; ~panner2x.free; ~panner3x.free; ~panner4x.free;
~panner2y = SynthDef(\randomPanY2, { Out.kr(~panBus2y, LFNoise1.kr(2).range(0,1))}).play;
~panner3y = SynthDef(\randomPanY3, { Out.kr(~panBus3y, LFNoise1.kr(1).range(0,1))}).play;
~panner4y = SynthDef(\randomPanY4, { Out.kr(~panBus4y, LFNoise1.kr(1).range(0,1))}).play;
~panner2x = SynthDef(\randomPanX2, { Out.kr(~panBus2x, LFPulse.kr(0.3).range(0,1))}).play;
~panner3x = SynthDef(\randomPanX3, { Out.kr(~panBus3x, LFPulse.kr(0.44).range(0,1))}).play;
~panner4x = SynthDef(\randomPanX4, { Out.kr(~panBus4x, LFPulse.kr(0.22).range(0,1))}).play;
~markov10 = Synth(\markovS1, [ \out, ~octoBus4,
\freq, 501, \tsize, 3, \amp, 0.2, \clip, 0.9, \fadeTime, 0.01 ]);
~markov11 = Synth(\markovS1, [ \out, ~octoBus3,
@ -319,16 +395,35 @@ timeLine = Routine {
wait(60);
"--- fade markov10,11,12 ...".postln;
~panner2y.free; ~panner3y.free; ~panner4y.free; ~panner2x.free; ~panner3x.free; ~panner4x.free;
~panBus2y.value = 1;
~panBus2r.value = 0.1;
~panBus3y.value = 1;
~panBus3r.value = 0.1;
~panBus4y.value = 1;
~panBus4r.value = 0.1;
~markov10.set(\gate, 0, \fadeTime, 50);
~markov11.set(\gate, 0, \fadeTime, 50);
~markov12.set(\gate, 0, \fadeTime, 50);
"\n--- PART 4 --- ".postln;
"--- noiseCrackle ...".postln;
~panner1y.free;
~panBus1y.value = 0;
~panner1y = SynthDef(\randomPanY1, { Out.kr(~panBus1y, LFNoise1.kr(0.1).range(0,1))}).play;
~panBus1x.value = 0;
~panBus1r.value = 0.5;
~noiseCr1 = Synth(\noiseCrackle, [\out, ~octoBus1, \fadeTime, 30 ]);
wait(40);
"--- darkHenon ...".postln;
"--- darkHenon ...".postln;
~panBus4x.value = 1;
//~panBus4y.value = 1;
~panBus4r.value = 2;
~panner4y.free;
~panner4y = SynthDef(\sinPanY4, { Out.kr(~panBus4y, SinOsc.kr(0.05).range(0,1))}).play;
~panBus4r.value = 0.1;
~darkHenon1 = Synth(\henonLsynth2, [\out, ~octoBus4, \fadeTime, 30]);
wait(40);
@ -336,14 +431,23 @@ timeLine = Routine {
~henonS1 = Synth(\henonSynth1, [\out, ~octoBus3, \amp, 0.4, \fadeTime, 40]);
"--- noiseCrackle fade ...".postln;
~noiseCr1.set(\fadeTime, 90, \gate,0);
wait(90);
~panBus3x.value = 0;
~panBus3y.value = 1;
~panner3y.free;
~panner3y = SynthDef(\sinPanY3, { Out.kr(~panBus3y, SinOsc.kr(0.08).range(0,1))}).play;
~panBus3r.value = 2;
wait(120);
"--- final fade henonS1, darkHenon ...".postln;
~darkHenon1.set(\gate, 0, \fadeTime, 60);
wait(20);
wait(30);
~henonS1.set(\gate, 0, \fadeTime, 60);
wait(60);
~panner1y.free;
~panner3y.free;
~panner4y.free;
"--- end of the TIMELINE ---".postln