Created
April 14, 2018 05:14
-
-
Save abelsonlive/996911be413d81edf4046185b71ab038 to your computer and use it in GitHub Desktop.
generative phase music with say
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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