Browse Source

added ACID MODE for busy basslines with filter cutoff modulation

master
spoonietunes 8 months ago
parent
commit
15e14598a7
  1. 68
      auto-techno.py
  2. 136
      deleteme.tidal

68
auto-techno.py

@ -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)+",")

136
deleteme.tidal

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
-- raw input: -1432897721833003170
-- hex seed: -0x13E2ACE2DD5298A2
-- decimal seed: -1432897721833003170
-- generated at 1633706019.61
-- raw input: -995834641349709608
-- hex seed: -0xDD1EA5484AD8F28
-- decimal seed: -995834641349709608
-- generated at 1633709399.6
-- Auto-Techno Generator v0.1.1
do
@ -17,103 +17,113 @@ do @@ -17,103 +17,113 @@ do
rideM = "[1111]"
cymbalM = "[1111]"
p "techno"
$ swingBy 0.18 8
-- fills
$ whenmod 8 7 (rev)
$ whenmod 64 63 (scramble 8)
$ whenmod 64 63 (bite 4 "{4}%4")
$ whenmod 16 14 (scramble 4)
$ whenmod 32 31 (bite 4 "{0}%4")
$ whenmod 64 63 (rev)
$ whenmod 8 7 (bite 4 "{4}%4")
$ whenmod 32 31 (scramble 8)
$ stack [
-- four to the floor
degradeBy fourToTheFloor $ struct "[t*4]" $ n "0" # midichan 0,
-------------- kick ---------------
mask kickM
$ every 8 (scramble 8)
$ every 16 (scramble 8)
$ struct "<[t*4]>"
$ n 7
# gain "{1 0.9 1}%16"
$ (0.125 ~>)
$ struct "<[0101]>"
$ n 5
# gain "{0.9 0.85 0.85 0.85 0.9 0.85 0.9 0.85 0.85 0.9 0.85 0.9 1 0.85 0.9}%16"
# midichan 0,
-------------- hh ---------------
mask hhM
$ (0.125 ~>)
$ struct "<[{111111011}%16]>"
$ n 1
# gain "{0.9 0.9}%16"
$ every 2 (stut 4 1 "0.125")
$ struct "<[t(5,16)] t(3,8)>"
$ n 2
# gain "{0.85 0.9 1 0.9 0.85 1 1 0.9 0.9 1}%16"
# midichan 1,
-------------- sd ---------------
mask sdM
$ every 4 (scramble 8)
$ every 5 ((0.125 ~>))
$ (0.125 ~>)
$ struct "<[t(7,16)]>"
$ n 5
# gain "{1 1 1 1 1 0.85 0.85 0.9}%16"
$ every 2 ((0.1875 ~>))
$ every 6 (stut 4 1 "0.125")
$ struct "<[11*2]*4 t(3,8)>"
$ n 6
# gain "{1 1 0.9 0.85 0.85 0.85 0.85 0.85 0.9 0.9 1}%16"
# midichan 2,
-------------- ohh ---------------
mask ohhM
$ every 16 (stut 5 1 "0.0625")
$ struct "<[t(6,16)]>"
$ n 5
# gain "{1 0.9}%16"
$ struct "<[t(3,16)] [t*4]>"
$ n 7
# gain "{0.85 0.9 0.85 0.85 1 0.9 0.85 0.9 1}%16"
# midichan 3,
-------------- rim ---------------
mask rimM
$ every 7 ((0.125 ~>))
$ every 2 (stut 5 1 "0.0625")
$ struct "<[t(3,16)] [{00000}%16]>"
$ n 7
# gain "{1 1 1 0.9 0.85 0.85 0.85 0.9 0.85 0.9 1 0.85}%16"
$ every 5 (stut 4 1 "0.125")
$ every 12 (degradeBy 0.49)
$ every 4 (stut 4 1 "0.125")
$ struct "<[{00001010}%16]>"
$ n 1
# gain "{1 0.85 0.9 0.85 0.9 0.9 0.9 0.85 1 0.9 0.85 0.85}%16"
# midichan 4,
-------------- cp ---------------
mask cpM
$ struct "<[{01000}%16]>"
$ n 6
# gain "{0.85 0.9 0.9 0.85 1}%16"
$ every 7 (rev)
$ every 5 (scramble 8)
$ struct "<[{000000000}%16]>"
$ n 3
# gain "{1 1 0.85 0.85 0.85 0.9 0.9}%16"
# midichan 5,
-------------- tom ---------------
mask tomM
$ every 13 (scramble 8)
$ struct "<[t(11,16)] [{0001000}%16]>"
$ n 2
# gain "{0.9 0.85}%16"
$ every 12 (scramble 8)
$ every 10 (stut 4 1 "0.125")
$ every 8 (stut 4 1 "0.125")
$ (0.125 ~>)
$ struct "<[t(6,16)]>"
$ n 0
# gain "{0.9 1 0.9 1 0.9 1 1 0.9 0.9 0.85 0.9 1 0.85 1 0.9}%16"
# midichan 6,
-------------- ride ---------------
mask rideM
$ struct "<t(3,8)>"
$ n 2
# gain "{1 0.9 0.9 0.9 0.9 0.9 0.85 1 0.85 0.9}%16"
$ every 13 (rev)
$ every 7 (scramble 8)
$ every 15 (degradeBy 0.49)
$ struct "<[{000001000}%16] [tttt*2]>"
$ n 6
# gain "{0.85 0.85 0.85 0.85 0.9 1}%16"
# midichan 7,
-------------- cymbal ---------------
mask cymbalM
$ struct "<[t(3,16)]>"
$ n 4
# gain "{0.9 0.9 0.9 1 0.9 0.9 0.9 0.9 0.85 0.85 0.85 1 0.85 1 0.9}%16"
$ every 14 (stut 4 1 "0.125")
$ every 2 ((0.1875 ~>))
$ every 15 (scramble 8)
$ (0.125 ~>)
$ struct "<[0101]>"
$ n 5
# gain "{1 1 0.9 1 0.85}%16"
# midichan 8,
------------ bassline -------
------------ bassline {{{ACID MODE}}}-------
degradeBy 0
$ struct "[{1010000011011111}%16]"
$ n "[{18 11 0 14 23 7 1 0 6 8 6 4 2 4 6 5 }%16]"
$ struct "[{1101111111101100}%16]"
$ n "[{3 4 9 0 8 10 9 2 9 4 11 8 10 9 1 19 }%16]"
# midichan 10 + n (-24),
--------- bassline filter cutoff ----
struct "[t*16]" $ ccn 20 # ccv "{82 1 21 17 53 88 21 4 88 71 15 76 10 84 48 7}%16" # midichan 10,
------------ pad -------
degradeBy 0
$ degradeBy "<0 1 0 0 0 1 1 0>/8"
$ struct "[{1110011100000010}%16]"
$ n "<[2,11,6,7]>/2"
degradeBy 1
$ degradeBy "<0 1 0 1 1 0 0 1>/8"
$ n "<[9,19,11,19]>/1"
# midichan 11 + n (0),
--------- MIDI CC's ---------------
stack [
struct "[t*5]" $ ccn 0 # ccv "{62 99 97 95 111 60 51 24}%5",
struct "t*1" $ ccn 1 # ccv "{0}%1",
struct "[t*3]" $ ccn 2 # ccv "{79 124 39 94 52 57 17 40 35 8 41 14 3 30 53 54}%3",
struct "t*1" $ ccn 3 # ccv "{0}%1",
struct "t*1" $ ccn 4 # ccv "{0}%1",
struct "[t*5]" $ ccn 0 # ccv "{39 45 50 100 13 79 5 55 112 31 93}%5",
struct "[t*3]" $ ccn 1 # ccv "{127 16 42 96 59 86 95 5 40 86 98 119 5}%3",
struct "[t*2]" $ ccn 2 # ccv "{110 21 70}%2",
struct "[t*2]" $ ccn 3 # ccv "{113 41 105 26 46 3 104 100 59}%2",
struct "[t*2]" $ ccn 4 # ccv "{25 44 68 42}%2",
struct "t*1" $ ccn 5 # ccv "{0}%1",
struct "[t*2]" $ ccn 6 # ccv "{4 33 118 44 10 94 49 99 110 92}%2",
ccn 126 # ccv 71] # midichan 15,
-- extra stuff
struct "[t*4]" $ ccn 6 # ccv "{104 26 10 119 64 17}%4",
ccn 126 # ccv 84] # midichan 15,
-- EXTRA STUFF ---
stack [
struct "[~ t ~ t]" $ n "0" # midichan 12
]
(# gain 0) $ struct "[~ t ~ t]" $ n "0",
(# gain 0) $ struct "[~t~t~t~t]" $ n "1"] # midichan 12
] # sunvox

Loading…
Cancel
Save