arrow_back Make Your Own Music
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.