Commit 10721b7b authored by Kenneth Flak's avatar Kenneth Flak

mbFbnoise and mbMelodic

parent 7799a624
......@@ -8,7 +8,7 @@ hport = 57120
[serial]
baudrate = 57600
serial = /dev/ttyUSB0
serial = /dev/ttyUSB1
apimode = True
[hive]
......
This diff is collapsed.
......@@ -10,7 +10,7 @@
\feedback, 0.6,
\delayTime, 0.2
]);
~emFx.add( \compressor, [
~emFx.add(\compressor, [
\thresh, -4.dbamp,
\ratio, 8,
\amp, 3.dbamp,
......
(
~fbnoiseFx = FxChain.new(
out: ~masterBus,
level: -6.dbamp,
fadeInTime: 3,
fadeOutTime: 8,
);
~fbnoiseFx.add(\comb, [
\delay, Pwhite(20, 380).midicps.reciprocal, Pwhite(2, 7),
\decay, 2,
\mix, Pwhite(0.1, 0.3),
\lag, Pwhite(3, 6)
]);
~fbnoiseFx.add(\ringMod, [
\modfreq, Pwhite(3.0, 10.0), Pwhite(2, 4),
\depth, 1,
\lag, 3,
\mix, 0.3,
]);
~fbnoiseFx.add(\ringMod, [
\modfreq, Pwhite(1.0, 8.0), Pwhite(2, 3),
\depth, 1,
\lag, 2,
\mix, 0.3,
]);
~fbnoiseFx.addPar(
\comb, [\mix, 0.2, \delay, 0.08, \decay, 1, \amp, 1/12],
\comb, [\mix, 0.2, \delay, 0.5, \decay, 1, \amp, 1/12],
\comb, [\mix, 0.2, \delay, 0.6, \decay, 1, \amp, 1/12],
\comb, [\mix, 0.2, \delay, 0.7, \decay, 1, \amp, 1/12],
);
~fbnoiseFx.add(\comb, [
\delay, 0.125,
\decay, 2,
\mix, 0.3,
]);
~fbnoiseFx.add(\eq, [
\locut, 120,
\hishelf, 600,
\hishelfdb, -9,
]);
~fbnoiseFx.add(\compressor, [
\ratio, 8,
\clampTime, 0.01,
\ratio, -13.dbamp,
]);
~fbnoiseFx.add(\grainIn, [
\grainsize, Pwhite(0.01, 0.03), Pwhite(3, 5),
\grainfreq, Pwhite(33, 100), Pwhite(3, 5),
\lag, 3,
]);
~fbnoiseFx.add(\compressor, [
\ratio, 8,
\clampTime, 0.03,
\ratio, -13.dbamp,
]);
~fbnoise = Pbind(
\instrument, \pink,
\db, -30,
\dur, 0.1,
// \dur, Pwhite(3, 5),
\legato, 0.3,
\attack, 0,
\release, Pkey(\dur) / 4,
\out, ~fbnoiseFx.in,
\group, ~fbnoiseFx.group,
);
)
s.record("~/sc-rec/fbnoise"+/+Date.localtime.stamp++".wav");
(
~fbnoiseFx.play;
~fbnoise = ~fbnoise.play;
)
(
~fbnoiseFx.free;
~fbnoise.stop;
)
s.stopRecording;
(
var scale = Scale.hexPhrygian;
var mset = MarkovSet([
[0, [1, 2, 5]],
[1, [2, 3]],
[2, [0, 4]],
[3, [4, 6]],
[4, [0, 6]],
[5, [3, 7]],
[6, [2, 3]],
[7, [0, 6, 12]],
[12, [0, 2]]
]).makeSeeds;
mset = mset.asStream;
~markovFx = FxChain.new(
out: ~masterBus,
level: -6.dbamp,
fadeInTime: 10,
fadeOutTime: 30,
);
~markovFx.add(\comb, [
\delay, 0.125,
\decay, 2,
\mix, 0.3,
]);
~markovFx.add(\jpverb, [
\revtime, 3,
\mix, 0.2,
]);
~markovFx.play;
Pdef(\markov,
Pbind(
\instrument, \klang,
\scale, scale,
\octave, Prand((3..6), inf),
\spread, Pwhite(1.999, 2.001),
\decay, 0.2,
\degree, Pfunc{[
mset.next,
({mset.next} ! 2)
].wchoose([2, 1].normalizeSum)},
\amp, Pfunc {|ev| ev.use {12 / ~freq}},
\release, Pkey(\dur) * 2,
\attack, Pkey(\octave).reciprocal / 4,
\dur, Prand([0.125, 0.25, 0.5, 1, 2, Rest(0.5), Rest(1)], inf),
\legato, Pwhite(0.3, 0.4),
\out, ~markovFx.in,
\group, ~markovFx.group,
)
).play;
)
(
Pdef(\markov).stop;
~markovFx.free
)
// Scale.minorPentatonic;
// Scale.phrygian;
// Scale.director
(
~mbFMFx = FxChain.new(
fadeInTime: 10,
level: -2.dbamp,
fadeOutTime: 10,
out: ~masterBus,
);
~mbFMFx.add(\eq, [
\locut, 60,
]);
~mbFMFx.add(\jpverb, [
\mix, 0.4,
\revtime, 3,
]);
~mbFMFx.add(\flanger, [
\feedback, 0.08,
\depth, 0.04,
\rate, 0.03,
\decay, 0.01,
\mix, 0.3,
]);
~mbFMFx = FxChain.new(
fadeInTime: 10,
level: -2.dbamp,
fadeOutTime: 10,
out: ~masterBus,
);
~mbFMFx.add(\eq, [
\locut, 60,
]);
~mbFMFx.add(\jpverb, [
\mix, 0.4,
\revtime, 3,
]);
~mbFMFx.add(\flanger, [
\feedback, 0.08,
\depth, 0.04,
\rate, 0.03,
\decay, 0.01,
\mix, 0.3,
]);
~mbFM = ~mb.collect{|id, idx|
MBDeltaTrig.new(
speedlim: 0.5,
threshold: 0.05,
minibeeID: id,
minAmp: -40,
maxAmp: -12,
function: {|dt, minAmp, maxAmp|
Pbind(
\instrument, \pm,
\dur, dt.linlin(0.0, 1.0, 0.1, 2),
\octave, Pwhite(2, 5, 1),
\degree, 0,
\modfreq, Pfunc{|ev| ev.use { ~freq.() + rrand(-10.0, 10.0) }},
\attack, Pwhite(2.0, 7),
\modattack, Pkey(\attack) * 2,
\release, dt.linlin(0.0, 1.0, 2.5, 15),
\modrelease, Pkey(\release),
\pmindex, Pwhite(4, 13),
\db, dt.linlin(0.0, 1.0, minAmp, maxAmp),
\pan, Pwhite(-1.0, 1.0, 1),
\out, ~mbFMFx.in,
\group, ~mbFMFx.group,
).play;
}
);
}
~mbFM = ~mb.collect{|id, idx|
MBDeltaTrig.new(
speedlim: 0.5,
threshold: 0.05,
minibeeID: id,
minAmp: -40,
maxAmp: -12,
function: {|dt, minAmp, maxAmp|
Pbind(
\instrument, \pm,
\dur, dt.linlin(0.0, 1.0, 0.1, 2),
\octave, Pwhite(2, 5, 1),
\degree, 0,
\modfreq, Pfunc{|ev| ev.use { ~freq.() + rrand(-10.0, 10.0) }},
\attack, Pwhite(2.0, 7),
\modattack, Pkey(\attack) * 2,
\release, dt.linlin(0.0, 1.0, 2.5, 15),
\modrelease, Pkey(\release),
\pmindex, Pwhite(4, 13),
\db, dt.linlin(0.0, 1.0, minAmp, maxAmp),
\pan, Pwhite(-1.0, 1.0, 1),
\out, ~mbFMFx.in,
\group, ~mbFMFx.group,
).play;
}
);
}
)
// (
// ~mbFMFx.play;
......
(fork{
~mbFbnoiseOut = Bus.audio(s, ~numSpeakers);
~mbFbnoiseFx = FxChain.new(
// out: ~masterBus,
out: ~mbFbnoiseOut,
level: -3.dbamp,
fadeInTime: 3,
fadeOutTime: 8,
);
~mbFbnoiseFx.add(\eq, [
\hicut, Pexprand(620, 10000), Pwhite(3, 5),
\locut, Pexprand(20, 380), Pwhite(3, 5),
\lag, 3,
]);
~mbFbnoiseFx.add(\comb, [
\delay, Pwhite(20, 60).midicps.reciprocal, Pwhite(2, 7),
\decay, Pwhite(1.0, 2.0), Pwhite(1.0, 2.0),
\mix, Pwhite(0.1, 0.3),
\lag, Pwhite(0.1, 0.3),
]);
~mbFbnoiseFx.add(\ringMod, [
\modfreq, Pwhite(3.0, 10.0), Pwhite(2, 4),
\depth, 2,
\lag, 0.3,
\mix, 0.3,
]);
~mbFbnoiseFx.add(\ringMod, [
\modfreq, Pwhite(3.0, 10.0), Pwhite(2, 4),
\depth, 2,
\lag, 0.3,
\mix, 0.3,
]);
~mbFbnoiseFx.addPar(
\comb, [\mix, 0.2, \delay, 0.08, \decay, 1, \amp, 1/12],
\comb, [\mix, 0.2, \delay, 0.4, \decay, 1, \amp, 1/12],
\comb, [\mix, 0.2, \delay, 0.6, \decay, 1, \amp, 1/12],
\comb, [\mix, 0.2, \delay, 0.7, \decay, 1, \amp, 1/12],
\comb, [\mix, 0.2, \delay, 0.9, \decay, 1, \amp, 1/12],
);
~mbFbnoiseFx.add(\eq, [
\locut, 120,
\hishelf, 600,
\hishelfdb, -9,
]);
~mbFbnoiseFx.add(\eq, [
\hicut, Pexprand(820, 10000), Pwhite(3, 5),
\locut, Pexprand(20, 380), Pwhite(3, 5),
\lag, 0.1,
]);
~mbFbnoiseFx.add(\compressor, [
\ratio, 8,
\clampTime, 0.01,
\ratio, -13.dbamp,
]);
~mbFbnoiseFx.add(\compressor, [
\ratio, 8,
\clampTime, 0.03,
\ratio, -13.dbamp,
]);
~mbFbnoiseFx.play;
~mbFbnoiseFB = Pbind(
\instrument, \allpass,
\in, ~mbFbnoiseOut,
\dur, Pwhite(1, 3),
\attack, Pkey(\dur),
\release, Pkey(\dur),
\legato, 1,
\mix, 1,
\maxdelay, 1,
\delay, Pwhite(0.001, 0.2),
\decay, Pwhite(1.0, 3.0),
\db, Pwhite(-8, -0),
\out, ~mbFbnoiseFx.in,
\group, ~mbFbnoiseFx.group,
\addAction, 1, //add to tail of group
);
~mbFbnoise = ~mb.collect{|id, idx|
MBDeltaTrig.new(
speedlim: 0.5,
threshold: 0.03,
minibeeID: id,
minAmp: -26,
maxAmp: -16,
function: {|dt, minAmp, maxAmp|
Pbind(
\instrument, \playbuf,
\buf, Prand(~buf[\treeperc], dt.linlin(0.0, 1.0, 1, 10)),
\dur, Pwhite(0.1, 0.3),
\db, dt.linlin(0.0, 1.0, minAmp, maxAmp),
\pan, Pwhite(-1.0, 1.0),
\delaytimes, Pfunc{
5.do{|i|
~mbFbnoiseFx.fx[(\comb++(i+1)).asSymbol].set(
\delay, rrand(0.08, 1.0),
\decay, rrand(0.5, 2.0),
);
};
},
\legato, 0.8,
\attack, 0,
\out, ~mbFbnoiseFx.in,
\group, ~mbFbnoiseFx.group,
).play;
};
)
};
s.sync;
~mbFbnoiseDry = Synth(\route, [
\in, ~mbFbnoiseOut,
\out, ~masterBus,
], ~mbFbnoiseFx.group, \addToTail);
})
s.record("~/sc-rec/mbFbnoise"+/+Date.localtime.stamp++".wav");
(
~mbFbnoiseFB = ~mbFbnoiseFB.play;
~mbFbnoise[3].play;
// ~mbFbnoise.do(_.play);
)
(
~mbFbnoiseFx.free;
~mbFbnoise.do(_.stop);
~mbFbnoiseFB.stop;
)
s.stopRecording;
s.plotTree;
(
var scale = Scale.hexPhrygian;
var ms;
var mset = MarkovSet([
[0, [1, 2, 5]],
[1, [2, 3]],
[2, [3, 4]],
[3, [4, 6]],
[4, [5, 6]],
[5, [6, 7]],
[6, [8, 9]],
[7, [0, 6, 12]],
[8, [7, 6, 12]],
[9, [4, 12]],
[12, [0, 2]]
]);
mset.makeSeeds;
ms = mset.asStream;
~mbMarkovFx = FxChain.new(
out: ~masterBus,
level: -6.dbamp,
fadeInTime: 10,
fadeOutTime: 30,
);
~mbMarkovFx.add(\comb, [
\delay, 0.125,
\decay, 2,
\mix, 0.3,
]);
~mbMarkovFx.add(\jpverb, [
\revtime, 3,
\mix, 0.2,
]);
~mbMarkov = ~mb.collect{|id, idx|
MBDeltaTrig.new(
speedlim: 0.5,
threshold: 0.05,
minibeeID: id,
// minAmp: -40,
// maxAmp: -12,
function: {|dt|
var deg = ms.next;
Pbind(
\instrument, \klang,
\scale, scale,
\spread, Pwhite(1.999, 2.001),
\decay, Pn(0.25, 1),
\degree, deg,
\amp, Pfunc {|ev| ev.use {12 / ~freq}},
\release, Pkey(\dur) * 2,
\attack, Pkey(\octave).reciprocal / 4,
\dur, dt.linlin(0.0, 1.0, 0.1, 2.0),
\legato, Pwhite(0.3, 0.4),
\out, ~mbMarkovFx.in,
\group, ~mbMarkovFx.group,
).play;
}
)
}
)
(
~mbMarkovFx.play;
~mbMarkov.do(_.play);
)
(
~mbMarkovFx.free;
~mbMarkov.do(_.free);
)
(
var scale = Scale.majorPentatonic;
var ms;
var mset = MarkovSet([
[0, [1, 2, 7]],
[1, [2, 3]],
[2, [3, 4]],
[3, [4, 6]],
[4, [5, 6]],
[5, [6, 7]],
[6, [0, 7]],
[7, [0, 6]],
]);
var motifs = [
[0, 1, 2, 3, 5],
[1, 2, 6],
[3, 4, 0],
[6, 3, 0],
[2, 4, 6, 1],
[2, 3, 4],
[4, 5, 4, 5],
[6, 7, 6, 9],
];
mset.makeSeeds;
ms = mset.asStream;
~mbMelodicFx = FxChain.new(
out: ~masterBus,
level: -6.dbamp,
fadeInTime: 10,
fadeOutTime: 30,
);
~mbMelodicFx.add(\comb, [
\delay, Pwhite(80, 90).midicps.reciprocal, Pwhite(2, 5),
\decay, 2,
\mix, Pwhite(0.01, 0.2),
\lag, 2,
]);
~mbMelodicFx.add(\ringMod, [
\modfreq, Pwhite(3.0, 10.0), Pwhite(2, 4),
\depth, 1,
\lag, 3,
\mix, 0.3,
]);
~mbMelodicFx.add(\ringMod, [
\modfreq, Pwhite(1.0, 8.0), Pwhite(2, 3),
\depth, 1,
\lag, 2,
\mix, 0.3,
]);
~mbMelodicFx.add(\noiseMod, [
\modfreq, Pwhite(10.0, 40.0), Pwhite(2, 4),
\depth, 2,
\mix, Pwhite(0.3, 1.0), Pwhite(2, 4),
\lag, 3,
]);
~mbMelodicFx.add(\eq, [
\locut, 80,
\hishelf, 600,
\hishelfdb, -9,
]);
~mbMelodicFx.addPar(
\comb, [\mix, 0.3, \delay, 0.6, \decay, 1, \amp, 1/3],
\comb, [\mix, 0.3, \delay, 1.5, \decay, 3, \amp, 1/3],
\comb, [\mix, 0.3, \delay, 0.7, \decay, 1, \amp, 1/3],
);
~mbMelodicFx.add(\comb, [
\delay, 0.125,
\decay, 2,
\mix, 0.3,
]);
~mbMelodicFx.add(\jpverb, [
\revtime, 3,
\mix, 0.2,
]);
~mbMelodic = ~mb.collect{|id, idx|
MBDeltaTrig.new(
speedlim: 0.5,
threshold: 0.05,
minibeeID: id,
// minAmp: -40,
// maxAmp: -12,
function: {|dt|
var deg, dur, totalDur, octave;
var phraseIndex = ms.next;
deg = motifs[phraseIndex];
dur = rrand(0.2, 2);
octave = rrand(5, 7);
totalDur = (dur * deg.size * rrand(0.3, 2.0));
Pbind(
\instrument, \pm,
\octave, Pwrand((6..8), [1, 2, 2].normalizeSum, inf),
\pmindex, Pwhite(0.2, 0.5),
\modfreq, Pfunc {|ev| ev.use { ~freq * rrand(0.98, 1.02)}},
\degree, Pseq(deg),
\amp, Pfunc {|ev| ev.use {8 / ~freq}} * dt.linlin(0.0, 1.0, 0.1, 0.3),
\release, Pkey(\dur) * 2,
\dur, Pwhite(dur/2, dur),
\attack, Pkey(\dur) / Pwhite(1, 4),
\legato, 0.9,
\out, ~mbMelodicFx.in,
\group, ~mbMelodicFx.group,
).play;
}
)
}
)
s.record("~/sc-rec/melodic"+/+Date.localtime.stamp++".wav");
(
~mbMelodicFx.play;
~mbMelodic[1].play;
// ~mbMelodic.do(_.play);
)
(
~mbMelodicFx.free;