Browse Source

added 'degradeBy 0.XX' to funStuff()

master
spoonietunes 8 months ago
parent
commit
a952d38e89
  1. 15
      auto-techno.py

15
auto-techno.py

@ -82,6 +82,8 @@ import random @@ -82,6 +82,8 @@ import random
import math
import re
import time
import decimal
from decimal import Decimal
##################################################
@ -263,6 +265,13 @@ def every(): @@ -263,6 +265,13 @@ def every():
bars = random.randint(2,16)
return (indent+indent+"$ every "+str(bars)+" ")
def within():
firstnum = random.choice([0,0.25,0.5,0.75])
secondnum = random.choice([0.25,0.5,0.75,1])
return (indent+indent+"within ("+str(firstnum)+","+str(secondnum)+" ")
def scramble():
divisions = [4,8,16]
return ("scramble "+str(random.choice(divisions)))
@ -307,6 +316,9 @@ def offset(): @@ -307,6 +316,9 @@ def offset():
offsetChoices = [0.125,0.125,0.125,0.125,0.1875,0.1875,0.1875]
return ("("+str(random.choice(offsetChoices))+" ~>)")
def degrade():
degradeAmt = (decimal.Decimal(random.random())).quantize(Decimal('.01'))
return "degradeBy "+str(degradeAmt)
def fills():
"""
@ -385,7 +397,7 @@ for i in range(1,8): @@ -385,7 +397,7 @@ for i in range(1,8):
# a list of things to do to patterns to make them more interesting
# these happen BEFORE struct, note, etc.
#interestingThings = [stut(),bite(),"rev",scramble(),offset()]
interestingThings = [stut(),"rev",scramble(),offset()]
interestingThings = [stut(),"rev",scramble(),offset(),degrade()]
def funThings():
wholeEnchilada = ""
# add between 1 and 4 "fun" things
@ -433,6 +445,7 @@ for i in percNames: @@ -433,6 +445,7 @@ for i in percNames:
if (random.randint(0,10) > 3):
print(funThings())
#### OFFSET ###
# offset the pattern by a certain amount
# this can make things much funkier

Loading…
Cancel
Save