In a program, you can define a variable like b to represent a phrase, and use it wherever needed, for example p.play b+b+b on line 22. How many repeats of b are needed for Katy Perry's Teenage Dream?
Change the Pattern altering rhythms
Experiment by changing some of the chords in b or substituting rests. It will line up best if you make sure the variable is still eight beats of music! Can you give the song a different feel just by changing b?
More Ideas
p = new Piano
lowest: "F,,"
keys: 36
p.bk 100
m = new Piano
lowest: "C"
keys: 36
m.fd 100
sync p, m
b = """
[D_B,]/[D_B,]/[D_B,]/[D_B,]/
[D_B,]/[D_B,]/[D_B,]/[D_B,]/
[D_B,]/[C_B,]/[C_B,]/[C_B,]/
[C_B,]/[C_B,]/[C_B,]/[C_B,]/
"""
c = """
[_E_E,]3[GG,]Z/[FF,]3Z/
[_E_E,]3[GG,]/[FF,]4Z/
"""
p.play b+b+b
m.play """
Z8
Z/G'/_B'/G'/_B'/G'/Z/G'/
_B'/C''/D''/C''A'_B'/
Z/G'/_B'/G'/_B'/G'/Z/F'/
_B'/C''/D''/C''A'_B'/
Z/G'/_B'/G'/_B'/G'/Z/G'/
_B'/C''/D''/C''A'_B'/-
_B'2Z/F'/D''/C''/-
C''2Z2
Z/G'/_B'/G'/_B'/G'/Z/Z/
_B'/C''/D''/C''A'_B'/
Z/G'/_B'/G'/_B'/G'/Z/F'/
_B'/C''/D''/C''A'_B'/
Z/G'/_B'/G'/_B'/G'/Z/G'/
_B'/C''/D''/C''A'_B'/-
_B'2Z/F'/D''/C''/-
C''2_B'A'
G'3G'/G'/
Z/F'/F'2D'/F'/
G'3G'/F'/-
F'Z_B'A'
G'3G'/G'/
Z/F'/F'2D'/F'/
G'3Z/G'/
G'A'_B'C''
"""