tweak amps and fix ampcurve bug

main
mwinter 4 years ago
parent ec1f32350e
commit 2c11afac7a

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -406,12 +406,12 @@ genAmpCurve = {arg temporalData1, temporalData2, offset1, offset2, type;
{1} {temporalData2[0].size - firsts2.maxItem} {1} {temporalData2[0].size - firsts2.maxItem}
{2} {(offset2 - temporalData2[0].size) - offset1} ; {2} {(offset2 - temporalData2[0].size) - offset1} ;
min = switch(type) min = switch(type)
{0} {0.25} {0} {0.15}
{1} {0} {1} {0}
{2} {0}; {2} {0};
max = switch(type) max = switch(type)
{0} {0.5} {0} {0.5}
{1} {0.75} {1} {0.65}
{2} {1}; {2} {1};
env = Env.dadsr(delay, attack, decay, 0.25, release, curve: \cub).range(min, max); env = Env.dadsr(delay, attack, decay, 0.25, release, curve: \cub).range(min, max);
@ -433,7 +433,7 @@ genAmpCurve = {arg temporalData1, temporalData2, offset1, offset2, type;
thisThread.randSeed = seed.postln; thisThread.randSeed = seed.postln;
# totalDur, section1Dur, dUnit, curLen, cadence, ultimate = [6 * 60, 2 * 60, 8.reciprocal, 0, false, false]; # totalDur, section1Dur, dUnit, curLen, cadence, ultimate = [16 * 60, 8 * 60, 8.reciprocal, 0, false, false];
# totalLen, section1Len = [(totalDur / dUnit).round(16), (section1Dur / dUnit).round(16)]; # totalLen, section1Len = [(totalDur / dUnit).round(16), (section1Dur / dUnit).round(16)];
# modeState, temporalState, partStates = [initModeState.value, initTemporalState.value, initPartStates.value]; # modeState, temporalState, partStates = [initModeState.value, initTemporalState.value, initPartStates.value];
# lastCadenceTemporalData, lastCadenceState, lastSectionPoint = [nil, modeState.deepCopy, 0]; # lastCadenceTemporalData, lastCadenceState, lastSectionPoint = [nil, modeState.deepCopy, 0];
@ -512,7 +512,7 @@ genAmpCurve = {arg temporalData1, temporalData2, offset1, offset2, type;
}); });
}); });
ampDataTmp = genAmpCurve.value(lastCadenceTemporalData, [[1], [1], [1], [1]], lastSectionPoint, lastSectionPoint + 80, 2); ampDataTmp = genAmpCurve.value(lastCadenceTemporalData, [[1], [1], [1], [1]], lastSectionPoint, lastSectionPoint + 360, 2);
ampData[2] = ampData[2] ++ ampDataTmp; ampData[2] = ampData[2] ++ ampDataTmp;
bassData[1] = bassData[1] ++ genBassPart.value(collectRoots.value(lastCadenceState).asList[0], ampDataTmp, false); bassData[1] = bassData[1] ++ genBassPart.value(collectRoots.value(lastCadenceState).asList[0], ampDataTmp, false);

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

Loading…
Cancel
Save