Commit 3f37c498 authored by Kenneth Flak's avatar Kenneth Flak

added mb switchboard, started porting old sketches to FxChain system

parent e511d43b
/home/kf/mySamples/klliBreath
\ No newline at end of file
......@@ -22,6 +22,11 @@
~hasLaunchPad = true;
~launchPadOut.control(176, 0, 127);
~launchPadOut.latency = 0;
LPButton.midiout = ~launchPadOut;
LPButton.uid = ~launchPadOut.uid;
SystemClock.sched(5, {
~launchPadOut.control(176, 0, 0);
});
}
};
......@@ -55,15 +60,6 @@
//global settings for minibees
// Külli left wrist: 9
// Külli right wrist: 10
// Külli left ankle: 11
// Külli right ankle: 12
// Kenneth left wrist: 13
// Kenneth right wrist: 14
// Kenneth left ankle: 15
// Kenneth right ankle: 16
~mb = (9..16);
~klAllMB = (9..12);
~klLeftWrist = 9;
......@@ -89,13 +85,13 @@
~master = Synth(\route, [\in, ~masterBus, \amp, 6.dbamp, \out, 0], ~masterGroup);
// prepare scenes
this.executeFile(~sketchdir+/+"mbEarthulator.scd");
this.executeFile(~sketchdir+/+"arvopbind.scd");
this.executeFile(~sketchdir+/+"mbFM.scd");
this.executeFile(~sketchdir+/+"fourmics.scd");
this.executeFile(~sketchdir+/+"numbers.scd");
this.executeFile(~sketchdir+/+"mbLooper.scd");
this.executeFile(~sketchdir+/+"bd.scd");
// this.executeFile(~sketchdir+/+"mbEarthulator.scd");
// this.executeFile(~sketchdir+/+"arvopbind.scd");
// this.executeFile(~sketchdir+/+"mbFM.scd");
// this.executeFile(~sketchdir+/+"fourmics.scd");
// this.executeFile(~sketchdir+/+"numbers.scd");
// this.executeFile(~sketchdir+/+"mbLooper.scd");
// this.executeFile(~sketchdir+/+"bd.scd");
~launchPadColor = (
\off: 12,
......@@ -108,7 +104,7 @@
\greenHi: 60
);
this.executeFile(~root+/+"cues.scd");
// this.executeFile(~root+/+"cues.scd");
//control master level with encoder 9
// if(~hasPush){
......
This diff is collapsed.
(
~arvopbind = {|fadeInTime=10, level=0.2, fadeOutTime=10, mb, threshold=0.03|
var bufs, mbTrig;
var piano;
var eq, eqBus;
var rev, revBus, revTime=3;
var out, outBus;
outBus = Bus.audio(s, ~numSpeakers);
out = Synth(\route, [
\in, outBus,
\out, ~masterBus,
\attack, fadeInTime,
\release, fadeOutTime,
\amp, level,
]);
eqBus = Bus.audio(s, ~numSpeakers);
eq = Synth(\eq, [
\in, eqBus,
\out, outBus,
\locut, 120,
\hishelffreq, 800,
\hishelfdb, -6
]);
revBus = Bus.audio(s, ~numSpeakers);
rev = Synth(\jpverb, [
\in, revBus,
\out, eqBus,
\revtime, revTime,
\mix, 0.2,
]);
// ~free[\arvopbindfx].();
// mbTrig = [15].collect{|id, idx|
mbTrig = mb.collect{|id, idx|
MBDeltaTrig.new(
speedlim: 0.5,
threshold: threshold,
minibeeID: id,
minAmp: -20,
maxAmp: -6,
function: {|dt, minAmp, maxAmp|
Pbind(
\instrument, \grbufphasor,
\buf, Prand(~buf[\arvo]),
\dur, dt.linlin(0.0, 1.0, 0.5, 2),
\attack, Pkey(\dur) * 0.2,
\release, Pkey(\dur) * Pwhite(1.0, 2.0),
\rate, Pwrand(
[-1, -0.5, 0.25, 0.25, 1],
[0.75, 0.5, 0.25, 0.1, 0.1].normalizeSum,
inf
),
\rateDev, Pwhite(0, 0.001),
\posDev, Pwhite(0, 0.01),
\playbackRate, Pwrand(
[-1, -0.5, 0.25, 0.25, 1],
[0.5, 0.5, 0.25, 0.3, 0.3].normalizeSum,
inf
),
\grainsize, Pwhite(0.01, 0.8),
\grainfreq, Pwhite(4, 20),
\db, dt.linlin(0.0, 1.0, minAmp, maxAmp),
\pan, Pwhite(-1.0, 1.0),
\panDev, Pwhite(0.0, 1.0),
\out, revBus,
).play;
};
).play;
};
~play[\arvopbind] = {|i|
if(i.isInteger){
mbTrig[~mb.indexOf(i)].play;
};
if(i.isCollection){
i.do{|item|
mbTrig[~mb.indexOf(item)].play;
}
~arvopbindFx = FxChain.new(
fadeInTime:10,
level:0.2,
fadeOutTime:10,
out: ~masterBus,
);
~arvopbindFx.add(\jpverb, [
\revtime, 3,
\mix, 0.2,
]);
~arvopbindFx.add(\eq, [
\locut, 120,
\hishelffreq, 800,
\hishelfdb, -6
]);
~arvopbind = ~mb.collect{|id, idx|
MBDeltaTrig.new(
speedlim: 0.5,
threshold: 0.03,
minibeeID: id,
minAmp: -20,
maxAmp: -6,
function: {|dt, minAmp, maxAmp|
Pbind(
\instrument, \grbufphasor,
\buf, Prand(~buf[\arvo]),
\dur, dt.linlin(0.0, 1.0, 0.5, 2),
\attack, Pkey(\dur) * 0.2,
\release, Pkey(\dur) * Pwhite(1.0, 2.0),
\rate, Pwrand(
[-1, -0.5, 0.25, 0.25, 1],
[0.75, 0.5, 0.25, 0.1, 0.1].normalizeSum,
inf
),
\rateDev, Pwhite(0, 0.001),
\posDev, Pwhite(0, 0.01),
\playbackRate, Pwrand(
[-1, -0.5, 0.25, 0.25, 1],
[0.5, 0.5, 0.25, 0.3, 0.3].normalizeSum,
inf
),
\grainsize, Pwhite(0.01, 0.8),
\grainfreq, Pwhite(4, 20),
\db, dt.linlin(0.0, 1.0, minAmp, maxAmp),
\pan, Pwhite(-1.0, 1.0),
\panDev, Pwhite(0.0, 1.0),
\out, ~arvopbindFx.in,
\group, ~arvopbindFx.group,
).play;
};
};
~stop[\arvopbind] = {|i|
if(i.isInteger){
mbTrig[~mb.indexOf(i)].stop;
};
if(i.isCollection){
i.do{|item|
mbTrig[~mb.indexOf(item)].stop;
}
};
};
~free[\arvopbind] = {
fork{
out.set(\gate, 0);
fadeOutTime.wait;
mbTrig.do(_.free);
[revBus, eqBus].do(_.free);
}
};
}
);
};
)
// ~play[\arvopbind].((9..12));
// ~stop[\arvopbind].((9..12));
// ~free[\arvopbindfx].();
// s.plotTree;
(
~arvopbind = {|fadeInTime=10, level=0.2, fadeOutTime=10, mb, threshold=0.03|
var bufs, mbTrig;
var piano;
var eq, eqBus;
var rev, revBus, revTime=3;
var out, outBus;
outBus = Bus.audio(s, ~numSpeakers);
out = Synth(\route, [
\in, outBus,
\out, ~masterBus,
\attack, fadeInTime,
\release, fadeOutTime,
\amp, level,
]);
eqBus = Bus.audio(s, ~numSpeakers);
eq = Synth(\eq, [
\in, eqBus,
\out, outBus,
\locut, 120,
\hishelffreq, 800,
\hishelfdb, -6
]);
revBus = Bus.audio(s, ~numSpeakers);
rev = Synth(\jpverb, [
\in, revBus,
\out, eqBus,
\revtime, revTime,
\mix, 0.2,
]);
// ~free[\arvopbindfx].();
// mbTrig = [15].collect{|id, idx|
mbTrig = mb.collect{|id, idx|
MBDeltaTrig.new(
speedlim: 0.5,
threshold: threshold,
minibeeID: id,
minAmp: -20,
maxAmp: -6,
function: {|dt, minAmp, maxAmp|
Pbind(
\instrument, \grbufphasor,
\buf, Prand(~buf[\arvo]),
\dur, dt.linlin(0.0, 1.0, 0.5, 2),
\attack, Pkey(\dur) * 0.2,
\release, Pkey(\dur) * Pwhite(1.0, 2.0),
\rate, Pwrand(
[-1, -0.5, 0.25, 0.25, 1],
[0.75, 0.5, 0.25, 0.1, 0.1].normalizeSum,
inf
),
\rateDev, Pwhite(0, 0.001),
\posDev, Pwhite(0, 0.01),
\playbackRate, Pwrand(
[-1, -0.5, 0.25, 0.25, 1],
[0.5, 0.5, 0.25, 0.3, 0.3].normalizeSum,
inf
),
\grainsize, Pwhite(0.01, 0.8),
\grainfreq, Pwhite(4, 20),
\db, dt.linlin(0.0, 1.0, minAmp, maxAmp),
\pan, Pwhite(-1.0, 1.0),
\panDev, Pwhite(0.0, 1.0),
\out, revBus,
).play;
};
).play;
};
~play[\arvopbind] = {|i|
if(i.isInteger){
mbTrig[~mb.indexOf(i)].play;
};
if(i.isCollection){
i.do{|item|
mbTrig[~mb.indexOf(item)].play;
}
};
};
~stop[\arvopbind] = {|i|
if(i.isInteger){
mbTrig[~mb.indexOf(i)].stop;
};
if(i.isCollection){
i.do{|item|
mbTrig[~mb.indexOf(item)].stop;
}
};
};
~free[\arvopbind] = {
fork{
out.set(\gate, 0);
fadeOutTime.wait;
mbTrig.do(_.free);
[revBus, eqBus].do(_.free);
}
};
}
)
// ~play[\arvopbind].((9..12));
// ~stop[\arvopbind].((9..12));
// ~free[\arvopbindfx].();
// s.plotTree;
(
var currentPos = 0;
var initTime = thisThread.seconds;
// var convergeTime = 10;
// var convergeTime = 3 * 60;
~birdGirlFx = List.new(0);
4.do{
......@@ -98,19 +96,22 @@
);
};
fork{
5.wait;
~birdGirlFx.do(_.play);
~birdGirl.do(_.play);
// ~birdGirl[0].play;
// ~birdGirl[1].play;
// ~birdGirl[2].play;
// ~birdGirl[3].play;
}
)
(
~birdGirlFx.do(_.free);
~birdGirl.do(_.free);
)
s.plotTree
// (
// fork{
// 5.wait;
// ~birdGirlFx.do(_.play);
// ~birdGirl.do(_.play);
// // ~birdGirl[0].play;
// // ~birdGirl[1].play;
// // ~birdGirl[2].play;
// // ~birdGirl[3].play;
// }
// )
// (
// ~birdGirlFx.do(_.free);
// ~birdGirl.do(_.free);
// )
// s.plotTree
(
var lowRateBegin = 1;
var lowRateTarget = 0.125;
var lowRate = lowRateBegin;
var highRateBegin = 2;
var highRateTarget = 0.25;
var highRate = highRateBegin;
var rateTime = 120;
~mbBreathFx.do(_.free);
~mbBreath.do(_.free);
~mbBreathFx = List.new(0);
// ~mbLowRateEnv.stop;
// ~mbHighRateEnv.stop;
4.do{
~mbBreathFx.add(
FxChain.new(
fadeInTime: 60,
level: 6.dbamp,
fadeOutTime: 10,
out: ~masterBus,
);
);
};
~mbBreathFx[0].addPar(
\comb, [\mix, 0.3, \delay, 0.2, \decay, 1, \amp, 1/3],
\comb, [\mix, 0.3, \delay, 0.5, \decay, 1, \amp, 1/3],
\comb, [\mix, 0.3, \delay, 0.7, \decay, 1, \amp, 1/3],
);
~mbBreathFx[0].add(\eq, [
\locut, 120,
\hishelfdb, -12,
]);
//---------------------------------------------------------
~mbBreathFx[1].add(\jpverb, [
\revtime, 2,
\mix, 0.1
]);
~mbBreathFx[1].add(\eq, [
\locut, 120,
\hishelfdb, -12,
]);
//---------------------------------------------------------
~mbBreathFx[2].add(\greyhole, [
\delayTime, 0.3,
\feedback, 0.6,
\mix, 0.1
]);
~mbBreathFx[2].add(\eq, [
\locut, 500,
\hishelfdb, -12,
]);
//---------------------------------------------------------
// ~mbLowRateEnv = KFEnv.new([lowRateBegin, lowRateTarget], [rateTime], 5).play;
// ~mbHighRateEnv = KFEnv.new([highRateBegin, highRateTarget], [rateTime], 5).play;
~mbBreath = ~mb.collect{|id, idx|
MBDeltaTrig.new(
speedlim: 0.5,
threshold: 0.05,
minibeeID: id,
minAmp: -12,
maxAmp: -0,
function: {|dt, minAmp, maxAmp|
var currentFx;
var buf = ~buf[\klliBreath][0];
var numFrames = buf.numFrames;
var currentPos = numFrames.rand;
var durFrom = rrand(0.1, 0.2);
var durTo = rrand(0.1, 0.2);
var step = durFrom * s.sampleRate;
var count = 20;
var len = dt.linlin(0.0, 1.0, step, step * count);
var pos = (currentPos, currentPos+step..currentPos+len).mod(numFrames);
var time = pos[pos.size-1] - pos[0] / s.sampleRate;
Pbind(
\instrument, \playbuf,
\buf, buf,
\dur, Pseg(durFrom, durTo, time),
\attack, Pkey(\dur) * 0.5,
\release, Pkey(\dur) * 1.5,
\startPos, Pseq(pos),
\legato, Pwhite(0.1, 0.2),
\rate, Pexprand(0.25, 2),
// \rate, Pexprand(~mbLowRateEnv.value, ~mbHighRateEnv.value),
\db, dt.linlin(0.0, 1.0, minAmp, maxAmp),
\pan, Pseg(Pwhite(0.0, 1.0), Pwhite(0.0, 1.0), time),
\out, Pfunc({
currentFx = ~mbBreathFx.choose;
currentFx.in
}),
\group, Pfunc({
currentFx.group
}),
).play;
}
);
};
)
// (
// ~mbBreathFx.do(_.play);
// ~mbBreath.do(_.play);
// )
// (
// ~mbBreathFx.do(_.free);
// ~mbBreath.do(_.free);
// )
(
~mbEarthulator = {|fadeInTime=10, level=0.2, fadeOutTime=10, mb, threshold=0.07|
var mbTrig, bufs;
var out, outBus;
var comp, compBus;
var group, fx, instr;
// var fadeInTime=10, level=0.2, fadeOutTime=10, threshold=0.05;
group = Group.new();
fx = Group.tail(group);
instr = Group.head(group);
s.makeBundle(nil, {
outBus = Bus.audio(s, ~numSpeakers);
out = Synth(\route, [
\in, outBus,
\out, ~masterBus,
\attack, fadeInTime,
\release, fadeOutTime,
\amp, level,
], fx);
compBus = Bus.audio(s, ~numSpeakers);
comp = Synth(\compressor, [
\in, compBus,
\out, outBus,
\thresh, -4.dbamp,
\ratio, 8,
\amp, 3.dbamp,
], fx);
if (mb.isInteger){ mb = Array.newClear(1).fill(mb) };
mbTrig = mb.collect{|id, idx|
MBDeltaTrig.new(
speedlim: 0.5,
threshold: threshold,
minibeeID: id,
minAmp: -6,
maxAmp: 6,
function: {|dt, minAmp, maxAmp|
Pbind(
\instrument, \grbufphasor,
\buf, Prand(~buf[\dancefloor]),
// \endPos, Pfunc{|ev| ev.buf.duration },
\dur, dt.linlin(0.0, 1.0, 0.5, 2),
\attack, Pkey(\dur) * 0.2,
\release, Pkey(\dur) * 2,
\rate, Prand([0.25, 1], inf),
\rateDev, Pwhite(0.0, 0.5),
\posDev, Pwhite(0.0, 0.3),
\playbackRate, Pwhite(0.1, 2),
\grainsize, Pwhite(0.01, 0.5),
\grainfreq, Pwhite(2, 40),
\db, dt.linlin(0.0, 1.0, minAmp, maxAmp),
\pan, Pwhite(-1.0, 1.0, 1),
\panDev, Pwhite(0.0, 1.0),
\out, compBus,
\group, instr,
).play;
}
~mbEarthulatorFx = FxChain.new(
fadeInTime: 10,
level: 0.2,
fadeOutTime: 10,
out: ~masterBus
);
~mbEarthulatorFx.add( \compressor, [
\thresh, -4.dbamp,
\ratio, 8,
\amp, 3.dbamp,
]);
~mbEarthulator = ~mb.collect{|id, idx|
MBDeltaTrig.new(
speedlim: 0.5,
threshold: 0.07,
minibeeID: id,
minAmp: -6,
maxAmp: 6,
function: {|dt, minAmp, maxAmp|
Pbind(
\instrument, \grbufphasor,
\buf, Prand(~buf[\dancefloor]),
// \endPos, Pfunc{|ev| ev.buf.duration },
\dur, dt.linlin(0.0, 1.0, 0.5, 2),
\attack, Pkey(\dur) * 0.2,
\release, Pkey(\dur) * 2,
\rate, Prand([0.25, 1], inf),
\rateDev, Pwhite(0.0, 0.5),
\posDev, Pwhite(0.0, 0.3),
\playbackRate, Pwhite(0.1, 2),
\grainsize, Pwhite(0.01, 0.5),
\grainfreq, Pwhite(2, 40),
\db, dt.linlin(0.0, 1.0, minAmp, maxAmp),
\pan, Pwhite(-1.0, 1.0, 1),
\panDev, Pwhite(0.0, 1.0),
\out, ~mbEarthulatorFx.in,
\group, ~mbEarthulatorFx.group,
).play;
};