![]() ![]() |
Nov 21 2007, 10:41 AM
Post
#1
|
|
|
Group: Members Posts: 22 Joined: 11-October 05 Member No.: 8,291 |
Just wanted to share a little script I wrote for my Zaurus. I studied Tae Kwon Do (Korean Karate) a while back, and I always thought it provided a good aerobic workout. So I wrote down in a file every move (kicks, punches, blocks) I had learned, sent that list through an awk script that spat out random moves, and piped *that* list through flite.
The result is a script that runs completely on my SL-5500 and speaks 1000 random Tae Kwon Do moves for me to perform. Takes 30-40 minutes to run through the whole routine, and I'm sweating pretty hard by the end. Don't know if anyone else would be interested in this. I suppose it could be adapted to call out any random series of phrases for someone's amusement. :-) Requires flite, awk, and, umm, probably the GNU textutils or bash or something. Anyway, here's the script, between the rows of equals signs: ==== export MAXCOUNT=10 export COUNT=0 while [ $COUNT -lt $MAXCOUNT ] do COUNT=`expr $COUNT + 1` echo "front kick jumping front kick side kick #jumping side kick turning side kick back wheel kick roundhouse kick jumping roundhouse kick half-moon kick jumping half-moon kick crescent kick jumping crescent kick side attack fighting stance number one fighting stance number two one knife hand attack reverse punch middle punch upper punch reverse spinning knife hand attack inside knife hand outside knife hand upper block inside block double inside block outside block lower block double lower block"| grep -v ^# | \ awk -v COUNT=$COUNT -v MAXCOUNT=$MAXCOUNT \ 'BEGIN {srand();INDEX=0} {MOVE[INDEX]=$0;INDEX++} END { if (COUNT == 1) {print "begin tie kwon doe exercise.";} print "begin part " COUNT "."; I=0; while (I < 100) { print MOVE[int(INDEX*rand())] "."; I++; } print "end part " COUNT "." if (COUNT == MAXCOUNT) {print "end tie kwon doe exercise.";} }' |\ flite --setf duration_stretch=1.5 --setf int_f0_target_mean=145 done ==== Hope somebody likes it. |
|
|
|
Nov 24 2007, 03:06 PM
Post
#2
|
|
![]() Group: Admin Posts: 3,277 Joined: 29-July 04 From: Cambridge, England Member No.: 4,149 |
hmm, change the phrase list and you could inadvertently give your Zaurus a case of Tourettes Syndrome!
|
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 22nd May 2013 - 06:46 AM |