Pharrell William's Happy has an uptempo, catchy beat, but this program plays it too slowly. Experiment with the tempo of the song and see if you can find the right speed.
Variables musical algebra
This program sets up variables to represent entire lines of the song Happy. Variables need to be defined before you ask the computer to `play` them. What happens if you reorder or add variables?
Extend the Tune can you play Happy?
Try extending the the tune and make your own question-and-answer melodies. It takes a good ear and a lot of experimentation to create a catchy riff!
More Ideas
t = "[F'F,,A,C,_E,]/Z/"
t2 = "[F,,A,C,_E,]/Z/"
intro = t + t + t + t + t
q1 = "Z/C'/F'/F'/Z/F'C'/C'/C'/_E'/F'/F'"
q2 = "Z/A'/A'/_A'_A'_E'/_E'/_E'/E'/F'/F'"
q3 = "F'F'/Z/_E'/G'/Z/_E'/Z/_E'/E'/E'/F'"
q4 = "=D'/C'/Z/_B/Z/_BA_B/A/F"
a = """
[F'_E,A,C,F,]_A,/Z/
[_B,_BD,F,DF]_A,/
[C,CE,G]_B,/Z/
[_A,_BD,FA]_B,/_A,/
"""
a2 = """
[F'_E,A,C,F,]_A,/Z/
[_B,_BD,F,DF]_A,/
[C,CE,G]_B,/Z/
[_A,_BD,FA][E'_B,]/[E'_A,]/E'/
"""
b = """
[_D_D,F_AC]F/_E/F3/Z/
[C,C,_EG_BG]FFF/_E/
[C,C,_EG_BF]FF_E/
[F,F,C,A_E]ZC/C_E
"""
p = new Piano 49
p.play
tempo: 100
song: intro + q1 +
a + t + q2 +
a + t + q3 +
a2 + t2 + q4 +
a + b + b