|
|
@ -11,7 +11,6 @@ genInitSeq = {arg seed = 1004;
|
|
|
|
setDur = {[0, 2, 3, 4, 5.rand + 3].wchoose([0, 5, 5, 5, 1].normalizeSum)};
|
|
|
|
setDur = {[0, 2, 3, 4, 5.rand + 3].wchoose([0, 5, 5, 5, 1].normalizeSum)};
|
|
|
|
|
|
|
|
|
|
|
|
strings = (0..5);
|
|
|
|
strings = (0..5);
|
|
|
|
//stringIndex = 0;
|
|
|
|
|
|
|
|
state = 6.collect({[0, 1].wchoose([2, 1].normalizeSum)}); //fretted or not
|
|
|
|
state = 6.collect({[0, 1].wchoose([2, 1].normalizeSum)}); //fretted or not
|
|
|
|
lastStrings = [nil, nil];
|
|
|
|
lastStrings = [nil, nil];
|
|
|
|
position = 6.collect({10 + 3.rand}); //which frets
|
|
|
|
position = 6.collect({10 + 3.rand}); //which frets
|
|
|
@ -32,7 +31,6 @@ genInitSeq = {arg seed = 1004;
|
|
|
|
strings = (0..5).scramble[..(4.rand + 1)];
|
|
|
|
strings = (0..5).scramble[..(4.rand + 1)];
|
|
|
|
//rotate if a note gets repeated
|
|
|
|
//rotate if a note gets repeated
|
|
|
|
if(lastStrings.last == strings.first, {strings = strings.rotate});
|
|
|
|
if(lastStrings.last == strings.first, {strings = strings.rotate});
|
|
|
|
//stringIndex = 0;
|
|
|
|
|
|
|
|
lastStrings = strings;
|
|
|
|
lastStrings = strings;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
@ -126,7 +124,6 @@ finalizeSeqs = {arg initSeq;
|
|
|
|
// this makes sure it is some multiple of a beat
|
|
|
|
// this makes sure it is some multiple of a beat
|
|
|
|
timeStampTotal = seq.slice(nil, 2).sum;
|
|
|
|
timeStampTotal = seq.slice(nil, 2).sum;
|
|
|
|
altEndDur = timeStampTotal.round(round) - timeStampTotal;
|
|
|
|
altEndDur = timeStampTotal.round(round) - timeStampTotal;
|
|
|
|
//if(altEndDur < 0, {altEndDur = altEndDur + round});
|
|
|
|
|
|
|
|
seq.last[2] = seq.last[2] + altEndDur;
|
|
|
|
seq.last[2] = seq.last[2] + altEndDur;
|
|
|
|
if(altEndDur < 0, {seq.last[2]});
|
|
|
|
if(altEndDur < 0, {seq.last[2]});
|
|
|
|
[seq, altEndDur];
|
|
|
|
[seq, altEndDur];
|
|
|
@ -139,7 +136,7 @@ finalizeSeqs = {arg initSeq;
|
|
|
|
noMeasures = ((timeStampTotal - timeStampSectionStart) / 16);
|
|
|
|
noMeasures = ((timeStampTotal - timeStampSectionStart) / 16);
|
|
|
|
if(noMeasures.frac > 0, {
|
|
|
|
if(noMeasures.frac > 0, {
|
|
|
|
timeSigInsSeq = timeSigInsSeq.add(
|
|
|
|
timeSigInsSeq = timeSigInsSeq.add(
|
|
|
|
// make 5/4 instrad of 1/4
|
|
|
|
// make 3/2 instrad of 1/2
|
|
|
|
if((noMeasures.frac / 0.25).asInteger != 2, {
|
|
|
|
if((noMeasures.frac / 0.25).asInteger != 2, {
|
|
|
|
[timeStampTotal - (4 * (noMeasures.frac / 0.25).asInteger),(noMeasures.frac / 0.25).asInteger]
|
|
|
|
[timeStampTotal - (4 * (noMeasures.frac / 0.25).asInteger),(noMeasures.frac / 0.25).asInteger]
|
|
|
|
}, {
|
|
|
|
}, {
|
|
|
@ -204,7 +201,6 @@ finalizeSeqs = {arg initSeq;
|
|
|
|
timeStampTotal = guitarSeq.slice(nil, 2).sum;
|
|
|
|
timeStampTotal = guitarSeq.slice(nil, 2).sum;
|
|
|
|
insertTS.value(guitarSeq, timeStampSectionStart, 0, true);
|
|
|
|
insertTS.value(guitarSeq, timeStampSectionStart, 0, true);
|
|
|
|
timeStampSectionStart = timeStampTotal;
|
|
|
|
timeStampSectionStart = timeStampTotal;
|
|
|
|
//sectionSeq = sectionSeq.add([timeStampTotal, 0, true]);
|
|
|
|
|
|
|
|
rec = guitarSeq[(guitarSeq.size - (10.rand + 5))..guitarSeq.size].deepCopy;
|
|
|
|
rec = guitarSeq[(guitarSeq.size - (10.rand + 5))..guitarSeq.size].deepCopy;
|
|
|
|
reps = 5.rand + 5;
|
|
|
|
reps = 5.rand + 5;
|
|
|
|
reps.do({arg index;
|
|
|
|
reps.do({arg index;
|
|
|
@ -216,21 +212,17 @@ finalizeSeqs = {arg initSeq;
|
|
|
|
rec[rIndex] = [item[0], item[1], dur];
|
|
|
|
rec[rIndex] = [item[0], item[1], dur];
|
|
|
|
if([true, false].wchoose([5, 1].normalizeSum), {
|
|
|
|
if([true, false].wchoose([5, 1].normalizeSum), {
|
|
|
|
guitarSeq = guitarSeq.add(rec[rIndex].add((1 / reps) * index));
|
|
|
|
guitarSeq = guitarSeq.add(rec[rIndex].add((1 / reps) * index));
|
|
|
|
//timeStampTotal = timeStampTotal + dur;
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
// if chord randomly choose one of the notes
|
|
|
|
// if chord randomly choose one of the notes
|
|
|
|
if(guitarSeq.last[2] == 0, {
|
|
|
|
if(guitarSeq.last[2] == 0, {
|
|
|
|
arg toAdd = [];
|
|
|
|
arg toAdd = [];
|
|
|
|
//guitarSeq[(guitarSeq.size - 3)..].postln;
|
|
|
|
|
|
|
|
toAdd = toAdd.add(guitarSeq.pop);
|
|
|
|
toAdd = toAdd.add(guitarSeq.pop);
|
|
|
|
toAdd = toAdd.add(guitarSeq.pop);
|
|
|
|
toAdd = toAdd.add(guitarSeq.pop);
|
|
|
|
toAdd[0][2] = toAdd[1][2];
|
|
|
|
toAdd[0][2] = toAdd[1][2];
|
|
|
|
toAdd[1][3] = toAdd[0][3];
|
|
|
|
toAdd[1][3] = toAdd[0][3];
|
|
|
|
//toAdd.postln;
|
|
|
|
|
|
|
|
toAdd = toAdd.choose;
|
|
|
|
toAdd = toAdd.choose;
|
|
|
|
guitarSeq = guitarSeq.add(toAdd);
|
|
|
|
guitarSeq = guitarSeq.add(toAdd);
|
|
|
|
//guitarSeq[(guitarSeq.size - 2)..].postln
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
@ -261,33 +253,35 @@ finalizeAccompHigh = {arg sectionSeq;
|
|
|
|
timeStamp = 0;
|
|
|
|
timeStamp = 0;
|
|
|
|
secType = 0;
|
|
|
|
secType = 0;
|
|
|
|
|
|
|
|
|
|
|
|
sectionSeq.do({arg secData;
|
|
|
|
sectionSeq.do({arg secData, secIndex;
|
|
|
|
var secEnd, freq, noRestCount, shortCount;
|
|
|
|
var secEnd, freq, noRestCount, shortCount;
|
|
|
|
secEnd = secData[0];
|
|
|
|
secEnd = secData.postln[0];
|
|
|
|
freq = if(secType == 0, {62.midicps * 8}, {62.midicps * 8 * 6/5});
|
|
|
|
//freq = if(secType == 0, {62.midicps * 8}, {62.midicps * 8 * 6/5});
|
|
|
|
|
|
|
|
freq = if(secIndex.even, {62.midicps * 8}, {62.midicps * 8 * 6/5});
|
|
|
|
if(secData.last, {secType = ((secType + 1) % 2)});
|
|
|
|
if(secData.last, {secType = ((secType + 1) % 2)});
|
|
|
|
noRestCount = 0;
|
|
|
|
noRestCount = 0;
|
|
|
|
shortCount = 0;
|
|
|
|
shortCount = 0;
|
|
|
|
|
|
|
|
secIndex.postln;
|
|
|
|
while({timeStamp < secEnd}, {
|
|
|
|
while({timeStamp < secEnd}, {
|
|
|
|
var dur, sus, isShort, insertRest;
|
|
|
|
var dur, sus, isShort, insertRest;
|
|
|
|
|
|
|
|
|
|
|
|
isShort = case
|
|
|
|
isShort = case
|
|
|
|
{shortCount == 0} {true}
|
|
|
|
{shortCount == 0} {true}
|
|
|
|
{shortCount < 3} {[true, false].wchoose([2, 1].normalizeSum)}
|
|
|
|
{shortCount < 3} {[true, false].wchoose([3, 1].normalizeSum)}
|
|
|
|
{true} {false};
|
|
|
|
{true} {false};
|
|
|
|
|
|
|
|
|
|
|
|
insertRest = [true, noRestCount > 3].wchoose([1, 1].normalizeSum);
|
|
|
|
insertRest = [true, noRestCount > 3].wchoose([2, 1].normalizeSum);
|
|
|
|
|
|
|
|
|
|
|
|
if(isShort, {
|
|
|
|
if(isShort, {
|
|
|
|
sus = (20.rand + 20).round(2);
|
|
|
|
sus = (10.rand + 10).round(2);
|
|
|
|
shortCount = shortCount + 1;
|
|
|
|
shortCount = shortCount + 1;
|
|
|
|
}, {
|
|
|
|
}, {
|
|
|
|
sus = (62.rand + 50).round(2);
|
|
|
|
sus = (30.rand + 30).round(2);
|
|
|
|
shortCount = 0;
|
|
|
|
shortCount = 0;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
if(insertRest, {
|
|
|
|
if(insertRest, {
|
|
|
|
dur = sus + (20.rand + 20).round(2);
|
|
|
|
dur = sus + (20.rand + 10).round(2);
|
|
|
|
noRestCount = 0;
|
|
|
|
noRestCount = 0;
|
|
|
|
}, {
|
|
|
|
}, {
|
|
|
|
dur = sus + 2;
|
|
|
|
dur = sus + 2;
|
|
|
@ -297,8 +291,13 @@ finalizeAccompHigh = {arg sectionSeq;
|
|
|
|
if((timeStamp + dur) < secEnd, {
|
|
|
|
if((timeStamp + dur) < secEnd, {
|
|
|
|
accompHighSeq = accompHighSeq.add([freq, dur, sus.clip(0, dur)]);
|
|
|
|
accompHighSeq = accompHighSeq.add([freq, dur, sus.clip(0, dur)]);
|
|
|
|
}, {
|
|
|
|
}, {
|
|
|
|
dur = ((secEnd - timeStamp) + 38.rand).clip(2, 1000).round(2);
|
|
|
|
//dur = ((secEnd - timeStamp) + 38.rand).clip(2, 1000).round(2);
|
|
|
|
accompHighSeq = accompHighSeq.add([freq, dur, 0]);
|
|
|
|
//accompHighSeq = accompHighSeq.add([freq, dur, 0]);
|
|
|
|
|
|
|
|
var remainder;
|
|
|
|
|
|
|
|
remainder = (secEnd - timeStamp);
|
|
|
|
|
|
|
|
sus = if(remainder > 10, {((remainder - 10).rand + 8).round(2)}, {0});
|
|
|
|
|
|
|
|
dur = (remainder + 10.rand).clip(2, 1000).round(2);
|
|
|
|
|
|
|
|
accompHighSeq = accompHighSeq.add([freq, dur, sus]);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
timeStamp = timeStamp + dur;
|
|
|
|
timeStamp = timeStamp + dur;
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -348,8 +347,6 @@ finalizeAccompLow = {arg guitarSeq, sectionSeq;
|
|
|
|
accompLowSeq = [accompLowSeq.slice(nil, 0), accompLowSeq.slice(nil, 1),
|
|
|
|
accompLowSeq = [accompLowSeq.slice(nil, 0), accompLowSeq.slice(nil, 1),
|
|
|
|
accompLowSeq.slice(nil, 2).differentiate.drop(1).add(1)].flop;
|
|
|
|
accompLowSeq.slice(nil, 2).differentiate.drop(1).add(1)].flop;
|
|
|
|
|
|
|
|
|
|
|
|
//accompLowSeq = [accompLowSeq.slice(nil, 0), accompLowSeq.slice(nil, 1),accompLowSeq.slice(nil, 2).drop(1).add(1)].flop;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
accompLowSeq
|
|
|
|
accompLowSeq
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
@ -359,8 +356,8 @@ finalizeAccompLow = {arg guitarSeq, sectionSeq;
|
|
|
|
|
|
|
|
|
|
|
|
initSeq = genInitSeq.value;
|
|
|
|
initSeq = genInitSeq.value;
|
|
|
|
finalSeqs = finalizeSeqs.value(initSeq);
|
|
|
|
finalSeqs = finalizeSeqs.value(initSeq);
|
|
|
|
guitarSeq = finalSeqs[0];
|
|
|
|
guitarSeq = finalSeqs[0].postln;
|
|
|
|
accompHighSeq = finalizeAccompHigh.value(finalSeqs[1]);
|
|
|
|
accompHighSeq = finalizeAccompHigh.value(finalSeqs[1].postln.add([finalSeqs[0].slice(nil, 2).sum, -1, false]));
|
|
|
|
accompLowSeq = finalizeAccompLow.value(finalSeqs[0], finalSeqs[1]);
|
|
|
|
accompLowSeq = finalizeAccompLow.value(finalSeqs[0], finalSeqs[1]);
|
|
|
|
sectionSeq = finalSeqs[1];
|
|
|
|
sectionSeq = finalSeqs[1];
|
|
|
|
timeSigSeq = finalSeqs[2];
|
|
|
|
timeSigSeq = finalSeqs[2];
|
|
|
|