Chopsticks
by tekwiz@beyondbb.com
This program plays the popular piano melody Chop Sticks using Logo’s built-in multiple voice music capability.
This project illustrates
- Music programming
- Multiple voices
- Using lists
Chopsticks.lgo
TO MAIN
MAKE "F "TRUE
PLAY [t300 O4 L4 M1 I0]
LABEL "TOP
REPEAT 6 [PLAY [[f g]]]
REPEAT 6 [PLAY [[e g]]]
REPEAT 4 [PLAY [[D B]]]
PLAY [[A D] [D B] L2 [E C] L4 [E C] [E C] [D B] [A E]]
REPEAT 6 [PLAY [[f g]]]
REPEAT 6 [PLAY [[e g]]]
REPEAT 4 [PLAY [[D B]]]
PLAY [[A D] [D B] [E C] P [E C] [E C] P]
IF :F = "TRUE [
PLAY [O5 L4 [C E] L2 [B4 D5] O4 L4 [A4 C5] O4 L2 [G B] L4 [F A] L2 [E G] L4 [E G] [E G] [F A] [E G] L2 [D F] L4 [D F] [D F] [E G] [D F] L2 [C E] L4 [D F] L2 [E G]]
PLAY [O5 L4 [C E] L2 [B4 D5] O4 L4 [A4 C5] O4 L2 [G B] L4 [F A] L2 [E G] L4 [E G] [E G] [F A] [E G] L2 [D F] L4 [D F] [D F] [D G] [F4 D5] L1 [C5 E4] L2 P L4]
MAKE "F "FALSE
GO "TOP
]
END
MAIN
Procedure | MAIN |
Description | Play "Chopsticks" on the computer |
Level | Beginner |
Tags | Music, Lists, Voices |