Skip to content

Instantly share code, notes, and snippets.

@abelsonlive
Created April 14, 2018 05:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abelsonlive/996911be413d81edf4046185b71ab038 to your computer and use it in GitHub Desktop.
Save abelsonlive/996911be413d81edf4046185b71ab038 to your computer and use it in GitHub Desktop.
generative phase music with say
import os
import sys
import time
import random
VOICES = [
"Agnes",
"Alex",
"Alice",
"Alva",
"Amelie",
"Anna",
"Bruce",
"Carmit",
"Damayanti",
"Daniel",
"Diego",
"Ellen",
"Fiona",
"Fred",
"Ioana",
"Joana",
"Junior",
"Kanya",
"Karen",
"Kathy",
"Kyoko",
"Laura",
"Lekha",
"Luciana",
"Maged",
"Mariska",
"Mei-Jia",
"Melina",
"Milena",
"Moira",
"Monica",
"Nora",
"Paulina",
"Princess",
"Ralph",
"Samantha",
"Sara",
"Satu",
"Sin-ji",
"Tessa",
"Thomas",
"Ting-Ting",
"Veena",
"Vicki",
"Victoria",
"Xander",
"Yelda",
"Yuna",
"Zosia",
"Zuzana"
]
reps = range(20,30)
sleeps = range(3,6)
iterations = range(2,3)
rates = range(5,10)
def main(string):
while True:
rep = random.choice(reps)
sleep = random.choice(sleeps)
rate = random.choice(rates)
voice = random.choice(VOICES)
phrase = ((string + " ") * rep).strip()
iteration = random.choice(iterations)
for i in range(0, iteration):
cmd = "say -r {0} -v {1} {2} &".format(rate, voice, phrase)
print("running:", cmd)
os.system(cmd)
time.sleep(sleep)
if __name__ == '__main__':
main(sys.argv[1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment