|
|
|
@ -54,7 +54,7 @@ percNames = ["kick", "hh","sd","ohh","rim","cp","tom","ride","cymbal"]
@@ -54,7 +54,7 @@ percNames = ["kick", "hh","sd","ohh","rim","cp","tom","ride","cymbal"]
|
|
|
|
|
# these notes correspond to notes (C3, C#3, etc) |
|
|
|
|
# each percussion track will pick one of these notes |
|
|
|
|
# and send note on/off messages to that note |
|
|
|
|
percNotes = [0,1,2,3,4,5,6,7] |
|
|
|
|
percNotes = [0,1,2,3,4,5,6,7,8,9,10,11] |
|
|
|
|
|
|
|
|
|
# |
|
|
|
|
####### MELODY ################################# |
|
|
|
@ -71,11 +71,18 @@ noteRange = [12,24]
@@ -71,11 +71,18 @@ noteRange = [12,24]
|
|
|
|
|
shortestMelodic = 3 |
|
|
|
|
longestMelodic = 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# for melodic lines, what divisions do you want to choose from? |
|
|
|
|
# eg 4 = quarter notes, 8 = eighth notes |
|
|
|
|
# tip: adding more of the same number will weight the randomness toward that |
|
|
|
|
melodicDivisions = [8,16,16,16] |
|
|
|
|
|
|
|
|
|
# assuming this is a bassline, and you want to do acid stuff... |
|
|
|
|
# what midi CC and channel should the filter cutoff be? |
|
|
|
|
melodyCCChannel = 10 |
|
|
|
|
melodyFilterCutoffCC = 20 |
|
|
|
|
# ^^^ map this to the filter cutoff for whatever synth you're using for bass/melody |
|
|
|
|
|
|
|
|
|
# keep melodies within 1 bar |
|
|
|
|
#melodicOneBar = 1 |
|
|
|
|
# how many |
|
|
|
@ -204,7 +211,7 @@ def generateBinary(busyness):
@@ -204,7 +211,7 @@ def generateBinary(busyness):
|
|
|
|
|
and 0 is no activity at all |
|
|
|
|
""" |
|
|
|
|
if (busyness == 0): |
|
|
|
|
binary = [0,0,0,0,0,0,0,0,0,0,0,1] |
|
|
|
|
binary = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1] |
|
|
|
|
elif (busyness == 1): |
|
|
|
|
binary = [0,0,0,0,0,0,0,0,1] |
|
|
|
|
elif (busyness == 2): |
|
|
|
@ -662,14 +669,34 @@ for i in percNames:
@@ -662,14 +669,34 @@ for i in percNames:
|
|
|
|
|
print(notes+"\n"+velocity+"\n"+midi+",") |
|
|
|
|
percMidiChan = percMidiChan + 1 |
|
|
|
|
|
|
|
|
|
# generate melodic tracks |
|
|
|
|
# generate melodic tracks (bassline) |
|
|
|
|
melodicMidiChan = melodyMidiChanStart |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# acid mode: like a TR-303 playing 16th notes |
|
|
|
|
# roll the dice for acid mode |
|
|
|
|
if (random.randint(0,10) > 6): |
|
|
|
|
acidMode = 1 |
|
|
|
|
else: |
|
|
|
|
acidMode = 0 |
|
|
|
|
|
|
|
|
|
#melodyMidiChanStart = 7 |
|
|
|
|
for i in range(melodyCount): |
|
|
|
|
print(indent+indent+"------------ bassline -------") |
|
|
|
|
if (acidMode == 1): |
|
|
|
|
busyness = 9 |
|
|
|
|
oneBar == 1 |
|
|
|
|
# generate a sequence of filter cutoff values |
|
|
|
|
print(indent+indent+"------------ bassline {{{ACID MODE}}}-------") |
|
|
|
|
|
|
|
|
|
else: |
|
|
|
|
busyness = random.choice([0,1,2,3,4,5,6,6,6,6,7,7,7,7,8,8,8,9,9]) |
|
|
|
|
melodyCutoffSeq = "0" |
|
|
|
|
print(indent+indent+"------------ bassline -------") |
|
|
|
|
|
|
|
|
|
print(indent+indent+"degradeBy 0 ") |
|
|
|
|
#print(", ") |
|
|
|
|
busyness = random.choice([0,1,2,3,4,5,6,6,6,6,7,7,7,7,8,8,8,9,9]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (oneBar == 1): |
|
|
|
|
print(indent+indent+"$ struct \""+genOnOff(16,(busyness),1)+"\"") |
|
|
|
|
notes = genNotes(1) |
|
|
|
@ -681,7 +708,25 @@ for i in range(melodyCount):
@@ -681,7 +708,25 @@ for i in range(melodyCount):
|
|
|
|
|
print(indent+indent+"$ struct \""+genOnOff(thisLength,(busyness),1)+"\"") |
|
|
|
|
notes = genNotes(0) |
|
|
|
|
print(indent+indent+"$ "+str(notes)) |
|
|
|
|
|
|
|
|
|
print(indent+indent+"# midichan "+str(melodicMidiChan)+" + n (-24),") |
|
|
|
|
|
|
|
|
|
if (acidMode == 1): |
|
|
|
|
|
|
|
|
|
ccLength = 16 |
|
|
|
|
# create a MIDI cc track for filter cutoff |
|
|
|
|
print(indent+indent+"--------- bassline filter cutoff ----") |
|
|
|
|
# we want: struct "[t*16]" $ ccn NN # ccv "{12 45 90 126 78 23}%NN # midichan NN |
|
|
|
|
ccPattern = "" |
|
|
|
|
for v in range(ccLength): |
|
|
|
|
ccPattern = str(random.randint(0,90))+" "+str(ccPattern) |
|
|
|
|
|
|
|
|
|
print(indent+indent+"struct \"[t*16]\" $ ccn "+str(melodyFilterCutoffCC)+" # ccv \"{"+str(ccPattern).rstrip()+"}%16\" # midichan "+str(melodyCCChannel)+",") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#melodyCCChannel = 10 |
|
|
|
|
#melodyFilterCutoffCC = 20 |
|
|
|
|
|
|
|
|
|
melodicMidiChan = melodicMidiChan + 1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -734,14 +779,21 @@ for i in range(padCount):
@@ -734,14 +779,21 @@ for i in range(padCount):
|
|
|
|
|
for i in range(random.choice(padBars)): |
|
|
|
|
pads = "["+ random.choice(padNotesList)+","+random.choice(padNotesList)+","+random.choice(padNotesList)+","+random.choice(padNotesList)+"]"+str(pads) |
|
|
|
|
|
|
|
|
|
# should we even play the pads? |
|
|
|
|
if (random.randint(0,10) > 6): |
|
|
|
|
print(indent+indent+"degradeBy 0 ") |
|
|
|
|
else: |
|
|
|
|
print(indent+indent+"degradeBy 1 ") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# build the track |
|
|
|
|
print(indent+indent+"degradeBy 0 ") |
|
|
|
|
sometimesBeQuiet() |
|
|
|
|
|
|
|
|
|
# roll the dice, choose between a long steady pad |
|
|
|
|
# or more rhythmic hits |
|
|
|
|
#if (random.choice([1,1]) == 1): |
|
|
|
|
if (random.choice([0,1]) == 1): |
|
|
|
|
# if = 1 |
|
|
|
|
print(indent+indent+"$ struct \""+genOnOff(16,(busyness),1)+"\"") |
|
|
|
|
|
|
|
|
|
print(indent+indent+"$ n "+padsStart+pads+padsEnd+"/"+str(random.choice(padSpeed))+"\"") |
|
|
|
@ -765,7 +817,7 @@ midiChannel = 1
@@ -765,7 +817,7 @@ midiChannel = 1
|
|
|
|
|
for i in midiCCs: |
|
|
|
|
# generate MIDI ccs rhythmically or over time |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# TODO wrap this into a new function |
|
|
|
|
# how many steps? |
|
|
|
|
ccLength = random.randint(2,16) |
|
|
|
|
|
|
|
|
@ -829,7 +881,7 @@ for i in midiCCs:
@@ -829,7 +881,7 @@ for i in midiCCs:
|
|
|
|
|
# make one more line so we don't have to worry about the trailing comma |
|
|
|
|
# in the last ccs line |
|
|
|
|
|
|
|
|
|
print(indent+indent+indent+"ccn 126 # ccv "+str(random.randint(0,126))+"] # midichan "+str(midiCCChannel)) |
|
|
|
|
print(indent+indent+indent+"ccn 126 # ccv "+str(random.randint(0,126))+"] # midichan "+str(midiCCChannel)+",") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|