|
|
|
@ -9,12 +9,13 @@ var formatPatternData;
|
|
|
|
|
~accompBus = Bus.audio(s, 1);
|
|
|
|
|
~clickBus = Bus.audio(s, 1);
|
|
|
|
|
|
|
|
|
|
~busses = 7.collect({Bus.audio(s, 1)});
|
|
|
|
|
~postampBusses = 7.collect({Bus.audio(s, 1)});
|
|
|
|
|
~preampBusses = 7.collect({Bus.audio(s, 1)});
|
|
|
|
|
|
|
|
|
|
SynthDef(\masterPlayerControl_ ++ ~hash, {
|
|
|
|
|
var sigs, sigsPanned, masterSig, imp;
|
|
|
|
|
|
|
|
|
|
sigs = ~busses.collect({arg bus, i; In.ar(bus) * NamedControl.kr(\vol_ ++ i, 1, 0.1)});
|
|
|
|
|
sigs = ~postampBusses.collect({arg bus, i; In.ar(bus) * NamedControl.kr(\vol_ ++ i, 1, 0.1)});
|
|
|
|
|
sigsPanned = sigs.collect({arg sig, i; Pan2.ar(sig * NamedControl.kr(\mute_ ++ i, 1, 0.1), NamedControl.kr(\pan_ ++ i, 0.5, 0.1))});
|
|
|
|
|
masterSig = Mix.ar(sigsPanned.drop(-1)) * NamedControl.kr("vol_master" ++ i, 1, 0.1) * NamedControl.kr("mute_master" ++ i, 1, 0.1);
|
|
|
|
|
|
|
|
|
@ -35,18 +36,22 @@ SynthDef(\transport_ ++ ~hash, {arg measure = 0, beat = 0, section = 0, subsecti
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SynthDef(\click_ ++ ~hash, {arg beat = 0, gate = 1, dur = 1;
|
|
|
|
|
Out.ar(~busses[6], 10 * BPF.ar(WhiteNoise.ar * EnvGen.kr(Env.perc(0.01, 0.1), gate), 440 * ((beat <= 1) + 1), 0.02));
|
|
|
|
|
Out.ar(~postampBusses[6], 10 * BPF.ar(WhiteNoise.ar * EnvGen.kr(Env.perc(0.01, 0.1), gate), 440 * ((beat <= 1) + 1), 0.02));
|
|
|
|
|
EnvGen.kr(Env.sine(dur), gate, doneAction: 2);
|
|
|
|
|
}).add;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//~~~~~~~~~~~~DEFINE SYNTHS~~~~~~~~~~~~
|
|
|
|
|
SynthDef(\ens_ ++ ~hash, {arg freq = 440, amp = 1, dur = 1, gate = 1, bus = 0;
|
|
|
|
|
Out.ar(bus, SinOsc.ar(freq, 2pi.rand, amp * 0.1) * EnvGen.kr(Env.asr(0.1, 1, 0.1), gate, doneAction: 2))
|
|
|
|
|
SynthDef(\amp_curve_ ++ ~hash, {arg amp = 0, dur = 0.1, gate = 1, bus = 0;
|
|
|
|
|
Out.kr(bus, amp)
|
|
|
|
|
}).add;
|
|
|
|
|
|
|
|
|
|
SynthDef(\accomp_ ++ ~hash, {arg freq = 440, amp = 1, attack = 1, dur = 1, gate = 1, bout = 0;
|
|
|
|
|
Out.ar(bout, SinOsc.ar(freq, 2pi.rand, 1) * 0.01 * amp * EnvGen.kr(Env.asr(attack, 1, 0.01), gate, doneAction: 2))
|
|
|
|
|
SynthDef(\ens_ ++ ~hash, {arg freq = 440, amp = 1, dur = 1, gate = 1, bus = 0, ampBus = 0;
|
|
|
|
|
Out.ar(bus, SinOsc.ar(freq, 2pi.rand, 0.1) * Latch.kr(In.kr(ampBus), Impulse.kr(0)) * EnvGen.kr(Env.asr(0.1, 1, 0.1), gate, doneAction: 2))
|
|
|
|
|
}).add;
|
|
|
|
|
|
|
|
|
|
SynthDef(\accomp_ ++ ~hash, {arg freq = 440, amp = 1, attack = 1, dur = 1, gate = 1, bout = 0, ampBus = 0;
|
|
|
|
|
Out.ar(bout, SinOsc.ar(freq, 2pi.rand, 1) * 0.01 * amp * Latch.kr(In.kr(ampBus), Impulse.kr(0)) * EnvGen.kr(Env.asr(attack, 1, 0.01), gate, doneAction: 2))
|
|
|
|
|
}).add;
|
|
|
|
|
|
|
|
|
|
SynthDef(\clip_ ++ ~hash, {arg dur = 1, gate = 1, bin = 0, bus = 0;
|
|
|
|
@ -58,6 +63,10 @@ SynthDef(\bass_ ++ ~hash, {arg freq = 440, amp = 1, dur = 1, attack = 1, decay =
|
|
|
|
|
Out.ar(bus, (SinOsc.ar(freq) * 0.3 * amp * EnvGen.kr(Env.adsr(attack, decay, 0.5, release, curve: \sqr), gate, doneAction: 2)))
|
|
|
|
|
}).add;
|
|
|
|
|
|
|
|
|
|
SynthDef(\bass_mono_ ++ ~hash, {arg freq = 440, ampBus = 0, bus = 0;
|
|
|
|
|
Out.ar(bus, (SinOsc.ar(freq.poll) * 0.4 * In.kr(ampBus)))
|
|
|
|
|
}).add;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// group data by measures for navigation
|
|
|
|
|
formatPatternData = {arg musData, measureLen;
|
|
|
|
@ -78,9 +87,11 @@ formatPatternData = {arg musData, measureLen;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//~~~~~~~~~~~~GENERATE PATTERNS~~~~~~~~~~~~
|
|
|
|
|
~genPatterns = {arg ensData, accompData, bassData, sectionData;
|
|
|
|
|
var measureLen, ensDataFormatted, accompDataFormatted, bassDataFormatted, dUnit, section, subsection;
|
|
|
|
|
~genPatterns = {arg ensData, accompData, bassData, ampData, sectionData;
|
|
|
|
|
var measureLen, ensDataFormatted, accompDataFormatted, bassDataFormatted, ampDataFormatted,
|
|
|
|
|
dUnit, section, subsection, patterns;
|
|
|
|
|
|
|
|
|
|
"here5".postln;
|
|
|
|
|
measureLen = ((
|
|
|
|
|
ensData.collect({arg partData; partData.last[1]}) ++
|
|
|
|
|
accompData.flatten.collect({arg partData; partData.last[1]})
|
|
|
|
@ -88,10 +99,12 @@ formatPatternData = {arg musData, measureLen;
|
|
|
|
|
|
|
|
|
|
ensDataFormatted = formatPatternData.value(ensData, measureLen);
|
|
|
|
|
accompDataFormatted = formatPatternData.value(accompData.flatten, measureLen);
|
|
|
|
|
bassDataFormatted = formatPatternData.value(bassData[..0], measureLen);
|
|
|
|
|
//bassDataFormatted = formatPatternData.value(bassData[..0], measureLen);
|
|
|
|
|
//ampDataFormatted = formatPatternData.value([ampData, ampData, ampData, ampData].postln, measureLen);
|
|
|
|
|
"here6".postln;
|
|
|
|
|
dUnit = 8.reciprocal;
|
|
|
|
|
|
|
|
|
|
measureLen.collect({arg measure;
|
|
|
|
|
patterns = measureLen.collect({arg measure;
|
|
|
|
|
if(sectionData[measure * 4] != nil, {
|
|
|
|
|
section = sectionData[measure * 4][2];
|
|
|
|
|
subsection = sectionData[measure * 4][3];
|
|
|
|
@ -106,7 +119,8 @@ formatPatternData = {arg musData, measureLen;
|
|
|
|
|
\amp, [0.5, 0.3, 0.3, 0.3][m],
|
|
|
|
|
//\amp, Pseq(musData[2].collect({arg item; [0, 0.25, 0.5, 0.75][item]}) * [1, 0.5, 0.25, 0.1][m] * 16);
|
|
|
|
|
// * musData[3].collect({arg val; if(val < 0.25, {0}, {0.5})}))
|
|
|
|
|
\bus, ~busses[m].index
|
|
|
|
|
\ampBus, ~preampBusses[0].index,
|
|
|
|
|
\bus, ~postampBusses[m].index
|
|
|
|
|
)
|
|
|
|
|
}) ++
|
|
|
|
|
accompDataFormatted[measure].collect({arg musData, m;
|
|
|
|
@ -119,9 +133,11 @@ formatPatternData = {arg musData, measureLen;
|
|
|
|
|
\amp, Pseq(musData[3].collect({arg item; [0, 2, 4, 8][item]}) * 0.0125 * 1),
|
|
|
|
|
//\attack, Pseq(musData[1] * abs(musData[3].clip(0, 0.25) * 2 - 1) * dUnit),
|
|
|
|
|
\attack, Pseq(musData[2] * 1 * dUnit),
|
|
|
|
|
\ampBus, ~preampBusses[0].index,
|
|
|
|
|
\bout, Pseq(musData[4] + 6)
|
|
|
|
|
)
|
|
|
|
|
}) ++
|
|
|
|
|
/*
|
|
|
|
|
bassDataFormatted[measure][..0].postln.collect({arg musData, m;
|
|
|
|
|
Pbind(
|
|
|
|
|
\instrument, \bass_ ++ ~hash,
|
|
|
|
@ -134,9 +150,19 @@ formatPatternData = {arg musData, measureLen;
|
|
|
|
|
\amp, 1,
|
|
|
|
|
//\amp, Pseq(musData[2].collect({arg item; [0, 0.25, 0.5, 0.75][item]}) * [1, 0.5, 0.25, 0.1][m] * 16);
|
|
|
|
|
// * musData[3].collect({arg val; if(val < 0.25, {0}, {0.5})}))
|
|
|
|
|
\bus, ~busses[4].index
|
|
|
|
|
\bus, ~postampBusses[4].index
|
|
|
|
|
)
|
|
|
|
|
}) ++
|
|
|
|
|
ampDataFormatted[measure].collect({arg musData, m;
|
|
|
|
|
Pbind(
|
|
|
|
|
\instrument, \amp_curve_ ++ ~hash,
|
|
|
|
|
\amp, Pseq(musData[0]),
|
|
|
|
|
\dur, Pseq(musData[1].replace(0, Rest(0)) * dUnit),
|
|
|
|
|
\bus, ~preampBusses[m].index
|
|
|
|
|
)
|
|
|
|
|
}) ++
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
[
|
|
|
|
|
Pbind(
|
|
|
|
|
\instrument, \transport_ ++ ~hash,
|
|
|
|
@ -154,6 +180,7 @@ formatPatternData = {arg musData, measureLen;
|
|
|
|
|
]
|
|
|
|
|
)
|
|
|
|
|
});
|
|
|
|
|
[patterns, bassData, ampData]
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|