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