You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

259 lines
9.6 KiB

(/*
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.
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
// TECHNOKINSHIP - OCTOPODA ////////////////////////////////////
██████╗ ██████╗████████╗ ██████╗ ██████╗ ██████╗ ██████╗ █████╗
██╔═══██╗██╔════╝╚══██╔══╝██╔═══██╗██╔══██╗██╔═══██╗██╔══██╗██╔══██╗
██║ ██║██║ ██║ ██║ ██║██████╔╝██║ ██║██║ ██║███████║
██║ ██║██║ ██║ ██║ ██║██╔═══╝ ██║ ██║██║ ██║██╔══██║
╚██████╔╝╚██████╗ ██║ ╚██████╔╝██║ ╚██████╔╝██████╔╝██║ ██║
╚═════╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝
SONORETUM VERSION FOR 15.DEC 2020 ///////////////////////////////
*/
#[\internal, \local].do { |s|
s = Server.perform(s);
s.options.numInputBusChannels = 2;
s.options.numOutputBusChannels = 8;
s.options.memSize = 2097152; // 2 gigs
};
Server.default.waitForBoot {
var timeLine;
// 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);
});
s.meter;
s.plotTree;
s.scope(8);
timeLine = Routine {
"--- starting main routine ...".postln;
1.wait;
// octoPan busses //////////////
"loading octoPan busses...".postln;
// 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;
~revBus.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.14; // set a fixed value to a bus
~panBus2x.value = 0;
~panBus2r.value = 2;
// 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.14; // set a fixed value to a bus
~panBus3x.value = 0;
~panBus3r.value = 2;
// 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.14; // set a fixed value to a bus
~panBus4x.value = 0;
~panBus4r.value = 2;
// 8chan reverb bus
~revBus = Bus.audio(s,8);
">>> loaded all busses".postln;
1.wait;
//////////////////////////////////////////////////////////////////////////////
"\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>".postln;
"--- O C T O P O D A -----".postln;
">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n".postln;
"--- loading octoPanners ...".postln;
~octoPanner1 = Synth("octoPanner", [\inBus, ~octoBus1, \outBus, ~revBus], addAction: \addToTail);
~octoPanner1.map(\x, ~panBus1x);
~octoPanner1.map(\y, ~panBus1y);
~octoPanner1.map(\radius, ~panBus1r);
~octoPanner2 = Synth("octoPanner", [\inBus, ~octoBus2, \outBus, ~revBus], addAction: \addToTail);
~octoPanner2.map(\x, ~panBus2x);
~octoPanner2.map(\y, ~panBus2y);
~octoPanner2.map(\radius, ~panBus2r);
~octoPanner3 = Synth("octoPanner", [\inBus, ~octoBus3, \outBus, ~revBus], addAction: \addToTail);
~octoPanner3.map(\x, ~panBus3x);
~octoPanner3.map(\y, ~panBus3y);
~octoPanner3.map(\radius, ~panBus3r);
~octoPanner4 = Synth("octoPanner", [\inBus, ~octoBus4, \outBus, ~revBus], addAction: \addToTail);
~octoPanner4.map(\x, ~panBus4x);
~octoPanner4.map(\y, ~panBus4y);
~octoPanner4.map(\radius, ~panBus4r);
// 4 x stereo reverbs are fixed to outputs ([0,1][2,3][4,5][6,7]) not panners!
~reverb = Synth("reverBusser", [\inBus, ~revBus, \outBus, 0], addAction: \addToTail);
// some default oscilations of pan and reverb
//~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
~reverb2wetBus = Bus.control(s, 1); // create control bus
~reverb.map(\verb2wet, ~reverb2wetBus); // map an argument to control bus
~reverb3wetBus = Bus.control(s, 1); // create control bus
~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
//~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;
1.wait;
SynthDef(\tw, {
//Pan2.ar(FreeVerb.ar(
arg outBus;
var snd, rev, z, y;
snd = 0.5 * TermanWang.ar(
input: 2.0 + SinOsc.ar(
LFNoise1.kr(LFNoise0.kr(LFNoise0.kr(1).range(10,0.1)).range(10,0.1)).exprange(10,10000), 0,
LFNoise1.kr(LFNoise0.kr(LFNoise0.kr(1).range(10,0.1)).range(10,0.1)).exprange(0.1,100.0)),
reset: Impulse.kr(LFNoise1.kr(0.1).exprange(1,10000, 'exponential')),
ratex: 0.2,
ratey:0.2,
alpha:2.0,
beta:2.0,
eta:1.0,
initx:LFNoise1.kr(LFNoise0.kr(LFNoise0.kr(1).range(10,0.1)).range(10,0.1)).range(0.4,1.2),
inity:LFNoise1.kr(LFNoise0.kr(LFNoise0.kr(1).range(10,0.1)).range(10,0.1)).range(2.0,4.0)
);
snd = LeakDC.ar(snd);
snd = snd * LFPulse.kr(LFNoise0.kr(0.4).range(0.01,0.1), width:LFNoise0.kr(0.5).exprange(0.01,0.1));
// reverb predelay time :
z = DelayN.ar(snd*100, 0.048);
// 7 length modulated comb delays in parallel :
y = Mix.ar(Array.fill(7,{ CombL.ar(z, 0.1, LFNoise1.kr(0.01, 0.02, 0.022), 15) }));
// two parallel chains of 4 allpass delays (8 total) :
4.do({ y = AllpassN.ar(y, 0.020, [0.050.rand, 0.050.rand], 1) });
rev = Limiter.ar(y, LFNoise1.kr(0.1).exprange(0.01, 0.3)-0);
snd = snd * LFNoise1.kr(0.05).range(0.1,1);
snd = snd + rev;
snd = LeakDC.ar(snd);
//snd = HPF.ar(snd, 300);
Out.ar(outBus, snd);
}).add;
1.wait;
//~tw.free;
~tw = Synth(\tw, [\outBus, ~octoBus1]);
~panBus1y.value = 0; // set a fixed value to a bus
~panBus1x.value = 0;
~panBus1r.value = 0.1;
1.wait;
//~tw2.free;
~tw2 = Synth(\tw, [\outBus, ~octoBus2]);
~panBus2y.value = 0.28; // set a fixed value to a bus
~panBus2x.value = 0;
~panBus2r.value = 0.1;
1.wait;
//~tw3.free;
~tw3 = Synth(\tw, [\outBus, ~octoBus3]);
~panBus2y.value = 1; // set a fixed value to a bus
~panBus2x.value = 0;
~panBus2r.value = 0.001;
1.wait;
//~tw4.free;
~tw4 = Synth(\tw, [\outBus, ~octoBus4]);
~panBus2y.value = 1; // set a fixed value to a bus
~panBus2x.value = 0;
~panBus2r.value = 0.001;
//~panner1y.free; ~panner2y.free; ~panner3y.free; ~panner4y.free;
//~panner1x.free; ~panner2x.free; ~panner3x.free; ~panner4x.free;
~panner1y = SynthDef(\randomPanY1, { Out.kr(~panBus1y, LFNoise1.kr(0.1).range(0,1))}).play;
~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;
"--- end of the TIMELINE ---".postln
};
timeLine.play;
});
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -