#!perl # Author: David Seay # Modifed by Charles Albrecht to add accidentals & sing "Daisy Bell" # Further modified by Jim Miner to normalize tempo # Still Further Modifications by Brian McNett # (removed messy string concatenation, added quit-if-runtime) # # Daisy Bell (A Bicycle Built for Two), Henry Darce, 1892 # v 1.2 use Mac::Speech; @noteNames = split(" ", "c d e f g a b C D E F G A B C1"); @scalePitches = split(",", "48,50,52,53,55,57,59,60,62,64,65,67,69,71,72"); for $p (0..$#scalePitches) { $pitch{$noteNames[$p]} = $scalePitches[$p]; } $tempo_factor = .3; # Increase if song is too fast or ends of words are clipped # NOTE DURATIONS $dur{e} = .50 * $tempo_factor; # eighth note $dur{de} = .75 * $tempo_factor; # dotted eighth note $dur{'q'} = 1.0 * $tempo_factor; # quarter note $dur{dq} = 1.5 * $tempo_factor; # dotted quarter note $dur{h} = 2.0 * $tempo_factor; # half note $dur{he} = 2.5 * $tempo_factor; # half note + an eighth $dur{dh} = 3.0 * $tempo_factor; # dotted half note $dur{dhe} = 3.5 * $tempo_factor; # dotted half note + an eighth $dur{w} = 4.0 * $tempo_factor; # whole note # ACCIDENTALS $acc{'s'} = 1; # sharp $acc{n} = 0; # natural $acc{f} = -1; # flat # FORMAT FOR '$song' = syllable pitch accidental duration $song = <