From ac2e292457348f87023064c1761af1b05f6deb66 Mon Sep 17 00:00:00 2001 From: spoonietunes Date: Fri, 8 Oct 2021 11:28:12 -0400 Subject: [PATCH] added CC generation to control things like delay and reverb sends; added extra area near the bottom for manually adding finishing touches (like handclaps or extra kicks here and there) - after all, this is a collaboration between human and algorithm --- auto-techno.py | 88 +++++++++++++++++++++++++++++++++-- deleteme.tidal | 122 ++++++++++++++++++++++++++----------------------- test.tidal | 1 + 3 files changed, 150 insertions(+), 61 deletions(-) diff --git a/auto-techno.py b/auto-techno.py index f0aa185..5e754a6 100644 --- a/auto-techno.py +++ b/auto-techno.py @@ -106,7 +106,7 @@ padMidiChanStart = melodyMidiChanStart + 1 # on what channel should we send MIDI CC messages? midiCCChannel = 15 # list of MIDI CC's: -midiCCs = [0,1,2,3,4,5,6]] +midiCCs = [0,1,2,3,4,5,6] ################# SETUP ################# @@ -750,19 +750,101 @@ for i in range(padCount): ############## MIDI CCS ############# # the goal: # do reverb/delay throws +# basically create step sequences that modulate CC values +# this assumes that midi cc 0-N are mapped to effects wherever +# the output of this script is being sent +# eg delay sends, reverb sends, etc +print(indent+indent+"--------- MIDI CC's ---------------") +print(indent+indent+"stack [") -for i in range(midiCCs): - print("midicc: "+i) +# the kick is on midi channel 0 +# don't do midi CC's for that track, start at 1 +midiChannel = 1 +for i in midiCCs: + # generate MIDI ccs rhythmically or over time + # how many steps? + ccLength = random.randint(2,16) + if (random.randint(0,1) == 0): + # don't do any CC value > 0 + ccFinalPattern = "struct \"t*1\" $ ccn "+str(i)+" # ccv \"{0}%" + ccEndNumber = 1 + else: + ccPattern = str(genOnOff(ccLength,5,0)) + + ccPattern = "" + for v in range(ccLength): + ccPattern = str(random.randint(0,127))+" "+str(ccPattern) + + # how fast should these change? + ccSpeed = random.choice([0,0,0,0,0,0,0]) + if (ccSpeed == 0): + # slow + ccEndNumber = random.choice([1,2,3,4,5]) + else: + # fast + ccEndNumber = random.choice([8,16]) + + ccPattern = ccPattern.rstrip() + # right now ccPattern looks like this: + # 0 12 78 127 45 60 + + #ccPattern = list(ccPattern) + # + + ccPatStruct = "struct \"[t*"+str(ccEndNumber)+"]\" $ " + + # how likely is it that we'll actually send MIDI cc's for this value? + if (random.randint(0,10) > 4): + ccPatStart = ccPatStruct+"ccn "+str(i)+" # ccv \"{" + else: + #ccPatStart = "-- "+ccPatStruct+"ccn "+str(i)+" # ccv \"{" + ccPatStart = ""+ccPatStruct+"ccn "+str(i)+" # ccv \"{" + + ccPatEnd = "}%" + + ccFinalPattern = ccPatStart+ccPattern+ccPatEnd + + + #ccs = ccPatStart+ccFinalPattern+ccPatEnd+str(ccEndNumber)+"\" # midichan "+str(midiChannel)+"," + ccs = ccFinalPattern+str(ccEndNumber)+"\"," + + print(indent+indent+indent+str(ccs)) + + midiChannel = midiChannel + 1 + + + + + + # end result like + # ccn 0 # ccv "{0 1 0 1 1 0 0 1 0}%N" + + + # 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)) +############### EXTRA STUFF ################# +# sometimes this will generate a great groove +# that could be perfect with one or two extra things, +# like a handclap or extra kick +# This section creates an area to easily add that +# extra something +# hardcoded to midi channel 12 +print(indent+indent+"-- EXTRA STUFF ---") +print(indent+indent+"stack [") +print(indent+indent+indent+"(# gain 0) $ struct \"[~ t ~ t]\" $ n \"0\",") +print(indent+indent+indent+"(# gain 0) $ struct \"[~t~t~t~t]\" $ n \"1\"] # midichan 12") ## put the finishing touches on the beautiful stack! :-) :-) print(indent+indent+"] # sunvox") diff --git a/deleteme.tidal b/deleteme.tidal index 7796492..1dfee7a 100644 --- a/deleteme.tidal +++ b/deleteme.tidal @@ -1,7 +1,7 @@ --- raw input: 1280237863746818918 --- hex seed: 0x11C4518DD8A25366 --- decimal seed: 1280237863746818918 --- generated at 1633699097.67 +-- raw input: -1432897721833003170 +-- hex seed: -0x13E2ACE2DD5298A2 +-- decimal seed: -1432897721833003170 +-- generated at 1633706019.61 -- Auto-Techno Generator v0.1.1 do @@ -18,96 +18,102 @@ do cymbalM = "[1111]" p "techno" -- fills - $ whenmod 32 31 (bite 2 "{12}%2") - $ whenmod 16 14 (bite 2 "{0}%2") - $ whenmod 32 30 (rev) - $ whenmod 16 15 (bite 4 "{4}%4") - $ whenmod 32 31 (scramble 4) + $ whenmod 8 7 (rev) + $ whenmod 64 63 (scramble 8) + $ whenmod 32 31 (bite 4 "{0}%4") + $ whenmod 64 63 (rev) + $ whenmod 8 7 (bite 4 "{4}%4") $ 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 0 - # gain "{1 1}%16" + $ n 7 + # gain "{1 0.9 1}%16" # midichan 0, -------------- hh --------------- mask hhM - $ degradeBy "<0 0 0 0 0 1 1 0>/8" - $ every 4 (degradeBy 0.93) - $ every 14 (scramble 16) - $ every 14 (stut 1 1 "0.0625") $ (0.125 ~>) - $ struct "" - $ n 2 - # gain "{1 1 0.85 0.85 0.9 0.85 0.9 0.85}%16" + $ struct "<[{111111011}%16]>" + $ n 1 + # gain "{0.9 0.9}%16" # midichan 1, -------------- sd --------------- mask sdM - $ degradeBy "<1 1 0 0 1 1 1 0>/8" - $ struct "<[{0000}%16]>" - $ n 2 - # gain "{0.9 1 1 0.85 1}%16" + $ 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" # midichan 2, -------------- ohh --------------- mask ohhM - $ degradeBy "<1 0 0 0 1 0 1 1>/8" - $ (0.1875 ~>) - $ struct "<[tt*2]*4 [[0001]000]>" - $ n 4 - # gain "{0.85 0.9 0.9 1 0.85 0.85 0.9 0.9 0.85 1 0.85}%16" + $ every 16 (stut 5 1 "0.0625") + $ struct "<[t(6,16)]>" + $ n 5 + # gain "{1 0.9}%16" # midichan 3, -------------- rim --------------- mask rimM - $ degradeBy "<0 1 0 0 0 0 1 1>/8" - $ struct "<[t(6,16)]>" - $ n 2 - # gain "{0.85 1 1 0.85 1}%16" + $ 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" # midichan 4, -------------- cp --------------- mask cpM - $ degradeBy "<0 1 1 0 0 0 0 0>/8" - $ every 12 (degradeBy 0.93) - $ every 6 (rev) - $ (0.125 ~>) - $ struct "<[{0000001}%16]>" - $ n 7 - # gain "{1 1 0.9 0.9 0.85 0.9 0.85 1 1}%16" + $ struct "<[{01000}%16]>" + $ n 6 + # gain "{0.85 0.9 0.9 0.85 1}%16" # midichan 5, -------------- tom --------------- mask tomM - $ degradeBy "<1 0 1 0 0 1 0 0>/8" - $ (0.1875 ~>) - $ struct "<[t(7,16)]>" - $ n 6 - # gain "{0.9 0.9 0.9 0.9 0.9 0.9 1 0.9 1 0.85}%16" + $ every 13 (scramble 8) + $ struct "<[t(11,16)] [{0001000}%16]>" + $ n 2 + # gain "{0.9 0.85}%16" # midichan 6, -------------- ride --------------- mask rideM - $ degradeBy "<1 1 0 1 1 0 1 1>/8" - $ every 14 ((0.125 ~>)) - $ (0.125 ~>) - $ struct "<[1*16]>" - $ n 1 - # gain "{1 1 0.85 0.9 1 0.9 0.9 0.9 0.9 1}%16" + $ struct "" + $ n 2 + # gain "{1 0.9 0.9 0.9 0.9 0.9 0.85 1 0.85 0.9}%16" # midichan 7, -------------- cymbal --------------- mask cymbalM - $ every 14 (degradeBy 0.93) - $ struct "<[t*4]>" + $ struct "<[t(3,16)]>" $ n 4 - # gain "{1 0.85 0.85 1 0.85 0.85 0.9 1 0.85 1}%16" + # 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" # midichan 8, ------------ bassline ------- degradeBy 0 - $ struct "[{1111011111110111}%16]" - $ n "[{7 18 6 20 3 7 15 0 2 10 23 5 10 16 20 22 }%16]" + $ struct "[{1010000011011111}%16]" + $ n "[{18 11 0 14 23 7 1 0 6 8 6 4 2 4 6 5 }%16]" # midichan 10 + n (-24), ------------ pad ------- degradeBy 0 - -- $ degradeBy "<1 1 0 1 1 0 0 0>/8" - $ struct "[t ~ ~ ~]" - $ n "<[10,7,20,15]>/2" - # midichan 11 + n (0) + $ degradeBy "<0 1 0 0 0 1 1 0>/8" + $ struct "[{1110011100000010}%16]" + $ n "<[2,11,6,7]>/2" + # 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*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 + stack [ + struct "[~ t ~ t]" $ n "0" # midichan 12 + + ] ] # sunvox diff --git a/test.tidal b/test.tidal index 1e8952d..8a92109 100644 --- a/test.tidal +++ b/test.tidal @@ -21,6 +21,7 @@ some seeds I've liked: 0x508DFAD3954D1C9 -- cooool seed: -2138151558308434562 82408580741001929 -- cool bassline +1432897721833003170 -- very chill, cool, rolling setcps = (18/60/4)