Dancing isn't much fun if there's no music, so in this screencast you'll add some tunesfor Cassy to dance to. Watch as this screencast demonstrates how to add music, then you'llget to try it in your project. In Scratch, there is a "stage," or backdrop,where the sprites move. The code blocks you've added so far all belong to the sprite Cassy,and they tell her how to move. You want the music you add to your project to play forall sprites, not just Cassy, so click on the stage and add your music blocks there.
With the stage selected, click on the sounds tab and choose a sound from the sound library.
Scratch has many types of sounds to choose from, but since this is a dance scene, you'regoing to choose the music loops menu. A music loop is a sound that is designed to play overand over again, but that still sounds like one continuous song. Listen to the differentmusic loops available, select one, and click OK to add it to your project. You can seehere that the sound is now added to the project. Next, click on the scripts tab, and look underthe sound menu. Choose the “play sound until done” block. If you click the block, themusic will play once. But you want it to play forever, so add a forever loop around the“play sound until done" block. After you add the the forever loop, the block stackwill instruct the computer to keep playing the music forever.
If you look back at the sound menu, you'll notice there's a "play sound until done" blockAND a "play sound block." There's an important difference between these two, and you cansee what it is in this example using the “meow” sound. If you put the "play sound meow untildone" block into the forever loop, the cat will meow over and over again. If you trythe same code using the "play sound meow" block, watch what happens. Whoa! That sounds crazy!
This block stack says "play sound meow forever," but the computer plays the meow sound, thenimmediately plays it again. So, not a single meow is ever finished, and the cat just keepsinterrupting himself. When you use the "play sound meow until done" block, the computerwill wait until the meow finishes before it moves on to the next block of code.
In your dance project, you'll want to use the “play sound until done” block. Otherwise,your project will never be able to play the music.
Lastly, add a "when flag clicked" block to the top of your music stack.
Now, it's your turn! Click on the stage backdrop. On the sounds tab, choose a music loop. Usea forever loop and a “play sound until done” block to play the music forever when the flagis clicked.
Remember, you can ask your neighbor for help if you get stuck, or put up a sticky to getthe attention of your CS First Guru.