Skip to content

Instantly share code, notes, and snippets.

@rsayers
Created December 15, 2014 00:30
Show Gist options
  • Save rsayers/0e715890192254caff40 to your computer and use it in GitHub Desktop.
Save rsayers/0e715890192254caff40 to your computer and use it in GitHub Desktop.
Generate random workouts for pell drills
import random
import time
# Usage:
# python pell.py | espeak -m -w output.wav
#
# This will generate a wav file of your random workout
# eSpeak (http://espeak.sourceforge.net/) is used to generate
# the speech. OSX has a builtin "say" command, which can be used on that
# platform instead.
# 1-6 represent target areas on a pell.
# see https://www.youtube.com/watch?v=UGL8aIB6bicfor more info
words = ['one','two','three','four','five','six']
# Alter this to change the length of the workout.
# 80 is roughly 5 minutes, but of course this varies as
# each attach is 1-3 strikes and you will have a 2-4 second
# pause between each one.
NUMBER_OF_ATTACKS = 80
print("<speak>")
print("Starting in three.")
print("<break time=\"1s\"/>")
print("Two.")
print("<break time=\"1s\"/>")
print("One.")
print("<break time=\"1s\"/>")
for x in range(1,NUMBER_OF_ATTACKS):
number_of_strikes = 2
rand = random.randint(1,10)
if rand < 3:
number_of_strikes=1
if rand > 7:
number_of_strikes=3
print( ", ".join( random.sample(words,number_of_strikes)))
sleep = random.randint(2,4)
print("<break time=\"%ss\"/>" % ( sleep,) )
print("Workout Complete")
print("</speak>")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment