|
|
|
@ -8,6 +8,10 @@
|
|
|
|
|
~accompLowBusA = Bus.audio(s, 1);
|
|
|
|
|
~accompLowBusB = Bus.audio(s, 1);
|
|
|
|
|
|
|
|
|
|
~guitarBus = Bus.audio(s, 1);
|
|
|
|
|
~accompHighBus = Bus.audio(s, 1);
|
|
|
|
|
~accompLowBus = Bus.audio(s, 1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SynthDef(\masterPlayerControl, {
|
|
|
|
|
arg sel = 0,
|
|
|
|
@ -19,9 +23,19 @@ SynthDef(\masterPlayerControl, {
|
|
|
|
|
guitarSigPanned, accompHighSigPanned, accompLowSigPanned,
|
|
|
|
|
masterSig, imp;
|
|
|
|
|
|
|
|
|
|
guitarSig = SelectX.ar(sel, [In.ar(~guitarBusA), In.ar(~guitarBusB)]) * guitarVol;
|
|
|
|
|
accompHighSig = SelectX.ar(sel, [In.ar(~accompHighBusA), In.ar(~accompHighBusB)]) * accompHighVol;
|
|
|
|
|
accompLowSig = SelectX.ar(sel, [In.ar(~accompLowBusA), In.ar(~accompLowBusB)]) * accompLowVol;
|
|
|
|
|
//guitarSig = SelectX.ar(sel, [In.ar(~guitarBusA), In.ar(~guitarBusB)]) * guitarVol;
|
|
|
|
|
//accompHighSig = SelectX.ar(sel, [In.ar(~accompHighBusA), In.ar(~accompHighBusB)]) * accompHighVol;
|
|
|
|
|
//accompLowSig = SelectX.ar(sel, [In.ar(~accompLowBusA), In.ar(~accompLowBusB)]) * accompLowVol;
|
|
|
|
|
|
|
|
|
|
guitarSig = In.ar(~guitarBus) * guitarVol;
|
|
|
|
|
accompHighSig = In.ar(~accompHighBus) * accompHighVol;
|
|
|
|
|
//accompLowSig = SelectX.ar(sel, [In.ar(~accompLowBusA), In.ar(~accompLowBusB)]) * accompLowVol;
|
|
|
|
|
accompLowSig = Mix.ar(
|
|
|
|
|
[
|
|
|
|
|
In.ar(~accompLowBusA) * EnvGen.kr(Env.asr(0.001, 1, 0.1), (sel + 1) % 2).poll,
|
|
|
|
|
In.ar(~accompLowBusB) * EnvGen.kr(Env.asr(0.001, 1, 0.1), sel)
|
|
|
|
|
]
|
|
|
|
|
) * accompLowVol;
|
|
|
|
|
|
|
|
|
|
guitarSigPanned = Pan2.ar(guitarSig * guitarMute, guitarPan);
|
|
|
|
|
accompHighSigPanned = Pan2.ar(accompHighSig * accompHighMute, accompHighPan);
|
|
|
|
@ -40,9 +54,10 @@ SynthDef(\masterPlayerControl, {
|
|
|
|
|
}).add;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SynthDef(\transport, {arg beat;
|
|
|
|
|
SendReply.kr(Changed.kr(beat),'/measureClock', values: [beat]);
|
|
|
|
|
SendReply.kr(TDelay.kr(Changed.kr(beat), 0.25),'/measureClockReset', values: [beat]);
|
|
|
|
|
SynthDef(\transport, {arg beat, fin;
|
|
|
|
|
SendReply.kr(Changed.kr(beat * (beat < fin)),'/measureClock', values: [beat]);
|
|
|
|
|
SendReply.kr(TDelay.kr(Changed.kr(beat * (beat < fin)), 0.25),'/measureClockReset', values: [beat]);
|
|
|
|
|
SendReply.kr(Changed.kr(beat.poll < fin.poll),'/playNextSubsection');
|
|
|
|
|
}).add;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -50,25 +65,27 @@ SynthDef(\transport, {arg beat;
|
|
|
|
|
SynthDef(\karplus, {arg freq, gate = 1, amp = 0.5, bus;
|
|
|
|
|
Out.ar(bus,
|
|
|
|
|
Pluck.ar(WhiteNoise.ar(0.1), Impulse.kr(0), 220.reciprocal, freq.reciprocal, 10, coef:0) *
|
|
|
|
|
Linen.kr(gate, doneAction: Done.freeSelf) * amp
|
|
|
|
|
Linen.kr(gate, doneAction: 2) * amp
|
|
|
|
|
)
|
|
|
|
|
}).add;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//~~~~accompaniment
|
|
|
|
|
SynthDef(\accompBass, {arg freq1 = 100, freq2 = 100, gate = 1, amp = 0.5, bus;
|
|
|
|
|
SynthDef(\accompBass, {arg freq1 = 100, freq2 = 100, gate = 1, amp = 0.5, bus, cutoff = 0;
|
|
|
|
|
var bassDrop;
|
|
|
|
|
bassDrop = Mix.ar([SinOsc.ar(freq1, 0, 0.5), SinOsc.ar(freq2, 0, 0.5)]) *
|
|
|
|
|
EnvGen.kr(Env.perc(0.1, 10, level: amp), Impulse.kr(0) + Changed.kr(freq2));
|
|
|
|
|
//EnvGen.kr(Env.cutoff(0.1, level: amp), cutoff);
|
|
|
|
|
Out.ar(bus, bassDrop)
|
|
|
|
|
}).add;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//this is not releasing properly
|
|
|
|
|
SynthDef(\accompTreble, {arg freq, gate = 1, sustain, amp, bus;
|
|
|
|
|
var treble;
|
|
|
|
|
treble = SinOsc.ar(
|
|
|
|
|
freq, 0,
|
|
|
|
|
EnvGen.kr(Env.sine(sustain, amp * 0.1), gate));
|
|
|
|
|
EnvGen.kr(Env.sine(sustain, amp * 0.1), gate, doneAction: 2));
|
|
|
|
|
Out.ar(bus, treble)
|
|
|
|
|
}).add;
|
|
|
|
|
|
|
|
|
@ -99,8 +116,14 @@ SynthDef(\droneOut, {arg gate, bus;
|
|
|
|
|
\bus, ~droneBus.index
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
OSCFunc({ arg msg, time;
|
|
|
|
|
~play.set(\sel, 0);
|
|
|
|
|
~patterns[2].play(quant: 0)
|
|
|
|
|
},'/playNextSubsection', s.addr);
|
|
|
|
|
|
|
|
|
|
//~~~~gen music
|
|
|
|
|
~genPatterns = {arg guitarSeqIn, accompLowSeqIn, accompHighSeqIn, sectionSeqIn;
|
|
|
|
|
~genPatterns = {arg guitarSeqIn, accompLowSeqIn, accompHighSeqIn, sectionSeqIn, tempo = 0.08;
|
|
|
|
|
var calcSustains, genSectionSec, sectionLimits;
|
|
|
|
|
|
|
|
|
|
//~~~~helper sus function
|
|
|
|
@ -130,34 +153,34 @@ SynthDef(\droneOut, {arg gate, bus;
|
|
|
|
|
//sectionSeq.postln;
|
|
|
|
|
durSum = 0;
|
|
|
|
|
resSeqs = [];
|
|
|
|
|
inSecs = switch(type, 0, {false}, 1, {false}, 2, {true});
|
|
|
|
|
mult = if(inSecs, {1}, {0.08});
|
|
|
|
|
seq.do({arg item;
|
|
|
|
|
if(((durSum * mult) >= (startTime * 0.08)) && ((durSum * mult) < (endTime * 0.08)), {
|
|
|
|
|
var dur = (durSum * mult) - (startTime * 0.08);
|
|
|
|
|
if((durSum >= startTime) && (durSum < endTime), {
|
|
|
|
|
var dur = durSum - startTime;
|
|
|
|
|
if((resSeqs.size == 0) && (dur > 0), {
|
|
|
|
|
switch(type,
|
|
|
|
|
0, {resSeqs = resSeqs.add([Rest(-1), Rest(-1), dur])},
|
|
|
|
|
1, {resSeqs = resSeqs.add([Rest(-1), Rest(-1), dur])},
|
|
|
|
|
2, {resSeqs = resSeqs.add([Rest(-1), dur.round(0.08), dur.round(0.08)])})
|
|
|
|
|
2, {resSeqs = resSeqs.add([Rest(-1), dur, dur])})
|
|
|
|
|
});
|
|
|
|
|
resSeqs = resSeqs.add(item);
|
|
|
|
|
});
|
|
|
|
|
durSum = durSum + if(type == 2, {item[1]}, {item[2]});
|
|
|
|
|
});
|
|
|
|
|
//if(type == 1, {resSeqs = resSeqs.add([0, 0, 16])});
|
|
|
|
|
resSeqs.postln;
|
|
|
|
|
resSeqs
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
sectionLimits = [];
|
|
|
|
|
sectionSeqIn.slice(nil, 0).add(100000).doAdjacentPairs({arg a, b; sectionLimits = sectionLimits.add([a, b])});
|
|
|
|
|
sectionLimits.collect({arg timePair, secIndex;
|
|
|
|
|
var startTime, endTime,
|
|
|
|
|
var startTime, endTime, endBeat,
|
|
|
|
|
guitarSecSeq, accompLowSecSeq, accompHighSecSeq,
|
|
|
|
|
stringSeq, fretSeq, durSeq, susSeq, trigSeq, openStrings, pattern;
|
|
|
|
|
|
|
|
|
|
startTime = timePair[0];
|
|
|
|
|
endTime = timePair[1];
|
|
|
|
|
endBeat = endTime - startTime;
|
|
|
|
|
|
|
|
|
|
guitarSecSeq = genSectionSec.value(guitarSeqIn, startTime, endTime, 0);
|
|
|
|
|
accompLowSecSeq = genSectionSec.value(accompLowSeqIn, startTime, endTime, 1);
|
|
|
|
@ -174,6 +197,11 @@ SynthDef(\droneOut, {arg gate, bus;
|
|
|
|
|
fretSeq = guitarSecSeq.slice(nil, 1);
|
|
|
|
|
durSeq = guitarSecSeq.slice(nil, 2);
|
|
|
|
|
susSeq = calcSustains.value(stringSeq, durSeq);
|
|
|
|
|
|
|
|
|
|
susSeq.last.postln;
|
|
|
|
|
durSeq.last.postln;
|
|
|
|
|
accompLowSecSeq.last.postln;
|
|
|
|
|
accompHighSecSeq.last.postln;
|
|
|
|
|
//trigSeq = guitarSeq.slice(nil, 3);
|
|
|
|
|
//~player = EventPatternProxy.new;
|
|
|
|
|
pattern = EventPatternProxy.new;
|
|
|
|
@ -181,39 +209,46 @@ SynthDef(\droneOut, {arg gate, bus;
|
|
|
|
|
Pbind(
|
|
|
|
|
\instrument, \karplus,
|
|
|
|
|
\amp, 0.3,
|
|
|
|
|
\dur, Pseq(durSeq * 0.08),
|
|
|
|
|
\sustain, Pseq(susSeq * 0.08),
|
|
|
|
|
\dur, Pseq(durSeq * tempo),
|
|
|
|
|
\sustain, Pseq(susSeq * tempo),
|
|
|
|
|
\freq, Pseq(stringSeq.collect({arg string, index;
|
|
|
|
|
if(string.isRest, {Rest()}, {
|
|
|
|
|
((62.midicps * openStrings[string]).cpsmidi + fretSeq[index]).midicps})})),
|
|
|
|
|
\bus, if(secIndex % 2 == 0, {~guitarBusA.index}, {~guitarBusB.index})),
|
|
|
|
|
//\bus, if(secIndex % 2 == 0, {~guitarBusA.index}, {~guitarBusB.index})),
|
|
|
|
|
\bus, ~guitarBus.index),
|
|
|
|
|
if(accompLowSecSeq.size > 1, {
|
|
|
|
|
Pmono(
|
|
|
|
|
\accompBass,
|
|
|
|
|
\amp, 0.5,
|
|
|
|
|
\freq1, Pseq(accompLowSecSeq.slice(nil, 0)),
|
|
|
|
|
\freq2, Pseq(accompLowSecSeq.slice(nil, 1)),
|
|
|
|
|
\dur, Pseq(accompLowSecSeq.slice(nil, 2)) * 0.08,
|
|
|
|
|
\dur, Pseq(accompLowSecSeq.slice(nil, 2)) * tempo,
|
|
|
|
|
//\cutoff, Pseq(accompLowSecSeq.drop(-1).size.collect({0}).add(1)),
|
|
|
|
|
\bus, if(secIndex % 2 == 0, {~accompLowBusA.index}, {~accompLowBusB.index}))
|
|
|
|
|
//\bus, ~accompLowBus)
|
|
|
|
|
}, {
|
|
|
|
|
Pmono(
|
|
|
|
|
\accompBass,
|
|
|
|
|
\amp, 0.5,
|
|
|
|
|
\freq1, Pseq([accompLowSecSeq[0][0]]),
|
|
|
|
|
\freq2, Pseq([accompLowSecSeq[0][1]]),
|
|
|
|
|
\dur, Pseq([accompLowSecSeq[0][2]]) * 0.08,
|
|
|
|
|
\dur, Pseq([accompLowSecSeq[0][2]]) * tempo,
|
|
|
|
|
//\cutoff, Pseq(accompLowSecSeq.drop(-1).size.collect({0}).add(1)),
|
|
|
|
|
\bus, if(secIndex % 2 == 0, {~accompLowBusA.index}, {~accompLowBusB.index}))
|
|
|
|
|
//\bus, ~accompLowBus)
|
|
|
|
|
}),
|
|
|
|
|
Pbind(
|
|
|
|
|
\instrument, \accompTreble,
|
|
|
|
|
\freq, Pseq(accompHighSecSeq.slice(nil, 0)),
|
|
|
|
|
\dur, Pseq(accompHighSecSeq.slice(nil, 1)),
|
|
|
|
|
\sustain, Pseq(accompHighSecSeq.slice(nil, 2)),
|
|
|
|
|
\dur, Pseq(accompHighSecSeq.slice(nil, 1) * tempo),
|
|
|
|
|
\sustain, Pseq(accompHighSecSeq.slice(nil, 2) * tempo),
|
|
|
|
|
\amp, 0.5,
|
|
|
|
|
\bus, if(secIndex % 2 == 0, {~accompHighBusA.index}, {~accompHighBusB.index})),
|
|
|
|
|
//\bus, if(secIndex % 2 == 0, {~accompHighBusA.index}, {~accompHighBusB.index})),
|
|
|
|
|
\bus, ~accompHighBus.index),
|
|
|
|
|
Pmono(\transport,
|
|
|
|
|
\beat, Pseq((0..((endTime / 0.16).asInteger - 2))),
|
|
|
|
|
\dur, 0.08 * 8;
|
|
|
|
|
\beat, Pseq((0..((endBeat / 8).asInteger))),
|
|
|
|
|
\dur, tempo * 8,
|
|
|
|
|
\fin, ((endBeat / 8).asInteger).postln
|
|
|
|
|
)
|
|
|
|
|
]);
|
|
|
|
|
pattern
|
|
|
|
|