|
|
|
@ -27,45 +27,45 @@ var formatPatternData;
|
|
|
|
|
imp = Impulse.kr(10);
|
|
|
|
|
SendReply.kr(imp, '/masterLevels_' ++ ~hash, values: [Amplitude.kr(masterSig)]);
|
|
|
|
|
sigs.collect({arg sig, i; SendReply.kr(imp, '/trackLevel_' ++ i ++ "_" ++ ~hash, values: [Amplitude.kr(sig)])});
|
|
|
|
|
}).add;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sdTransport = SynthDef(\transport_ ++ ~hash, {arg measure = 0, beat = 0, section = 0, subsection = 0, gate = 1, dur = 1;
|
|
|
|
|
SendReply.kr(Impulse.kr(0) * (measure > 0) * (beat > 0),'/measureClock_' ++ ~hash, values: [measure, beat, section, subsection]);
|
|
|
|
|
//SendReply.kr(Impulse.kr(0),'/nextSubsection_' ++ ~hash);
|
|
|
|
|
EnvGen.kr(Env.sine(dur), gate, doneAction: 2);
|
|
|
|
|
}).add;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sdClick = SynthDef(\click_ ++ ~hash, {arg beat = 0, gate = 1, dur = 1;
|
|
|
|
|
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;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sdAmpCurve = SynthDef(\amp_curve_ ++ ~hash, {arg amp = 0, dur = 0.1, gate = 1, bus = 0;
|
|
|
|
|
Out.kr(bus, amp)
|
|
|
|
|
}).add;
|
|
|
|
|
sdAmpCurve = SynthDef(\amp_curve_ ++ ~hash, {arg amp = 1, dur = 0.1, bus = 0;
|
|
|
|
|
Out.kr(bus, amp.lag)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sdEns = 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;
|
|
|
|
|
Out.ar(bus, SinOsc.ar(freq, 2pi.rand, 0.1) * amp * Latch.kr(In.kr(ampBus), Impulse.kr(0)) * EnvGen.kr(Env.asr(0.1, 1, 0.1), gate, doneAction: 2))
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sdAccomp = 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;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sdClip = SynthDef(\clip_ ++ ~hash, {arg dur = 1, gate = 1, bin = 0, bus = 0;
|
|
|
|
|
//Out.ar([0, 1], (In.ar(bin)).clip(0, 1) * pow(Line.kr(0, 1, 240), 2))
|
|
|
|
|
Out.ar(bus, (In.ar(bin)).clip(0, 1) * 50 * pow(Line.kr(0, 1, 10), 2))
|
|
|
|
|
}).add;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sdBass = SynthDef(\bass_mono_ ++ ~hash, {arg freq = 440, ampBus = 0, bus = 0;
|
|
|
|
|
Out.ar(bus, (SinOsc.ar(freq) * 0.4 * In.kr(ampBus)))
|
|
|
|
|
}).add;
|
|
|
|
|
Out.ar(bus, (SinOsc.ar(freq) * 0.5 * In.kr(ampBus)))
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sdDiskOut = SynthDef(\disk_out_ ++ ~hash, {arg bufnum, inbus;
|
|
|
|
|
DiskOut.ar(bufnum, In.ar(inbus));
|
|
|
|
|
}).add;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
allSds = [sdPlayer, sdTransport, sdClick, sdAmpCurve, sdEns, sdAccomp, sdClip, sdBass, sdDiskOut];
|
|
|
|
|
allSds.do({arg sd; sd.add});
|
|
|
|
@ -120,7 +120,7 @@ formatPatternData = {arg musData, measureLen;
|
|
|
|
|
\freq, Pseq(musData[0].replace(0, Rest(0))),
|
|
|
|
|
\dur, Pseq(musData[1] * dUnit),
|
|
|
|
|
\sustain, Pseq(musData[2] * dUnit),
|
|
|
|
|
\amp, [0.5, 0.3, 0.3, 0.3][m],
|
|
|
|
|
\amp, [1, 0.7, 0.5, 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);
|
|
|
|
|
\ampBus, preampBusses[0].index,
|
|
|
|
|
\bus, postampBusses[m].index
|
|
|
|
|