Skip to content

Please update your browser

Your browser version is not supported by this site. CS First may not work properly. Learn more

arrow_back Make Your Own Music

Transcript

Many games play songs. In this add-on, you’ll create some music to make your game more exciting. First, make a drum beat. Start by clicking the sound menu. Here, you’ll find the “play drum” block.

It plays a drum sound. You can change two values in this block.

The first is the type of drum. Click the drop-down menu, and try a few. When you create your song, you’ll want to test many different sounds until you find the one you want.

The second value changes the drum beat. To explore how the beat works, put the “play drum” block into a forever loop, click it, and tinker with the beat value.

Start at 1… too slow. Try something bigger, like 2.

Whoa, way too slow. Try something smaller, like 0.5 What about 0.1?

Play around with the number of beats to see what happens.

Most popular music uses quarter, half, and whole notes, so a good rule of thumb is to use .25, .5, and 1 as beat values. This will give your song a smooth rhythm.

This example will fast forward through making a drum beat so you can see the basics. But, feel free to explore and create your own!

Now that you have explored how to make a drum beat, it’s time to add another instrument. Using the “play note” block, you can play musical notes. This example will use four blocks, because the drum beat also has four blocks. You can change the notes these blocks play using the drop-down menu. Play around with a few, and find a sound you like.

You can loop this, too, and play it with your drums.

*drum and note sounds* Finally, you can change the instrument being played using the “set instrument to” block.

Computer Science and music have a lot in common: It’s important to explore and tinker until you create something that you enjoy!

to your program: one to play a drum beat, and another to play an instrument.

Choose an Add-On
Make Your Own Music
Add a drum beat and background music to your game.
Add Another Cave Section
Design a new cave sprite with black edges and add it to your game.
Make the Game Harder
Make the player press the spacebar over and over to keep the sprite in flight.
Dangerous Cave Walls
Make the player sprite explode when it touches the walls of the cave.
Add Another Level
Create additional game levels that get faster and harder as the player progresses.
Dive!
Make the sprite dive, or move down faster than it falls.
arrow_backward Back
Next arrow_forward
Instructions
  1. Choose an Add-On, and click "watch" to learn how to build it.
  2. Once you finish one Add-On, try another one below the video!