Music with Blocks: Beep’s Band

Music with Blocks: Beep's Band: Block Coding lesson banner with Beep and Pixel

Track: Block Coding  ·  Lesson 8 of 10  ·  Ages: 6+  ·  Time: 40 minutes

Every song you have ever heard is a list of notes played one after another. Some notes are high and some are low. Some are long and some are short. And sometimes there is a quiet gap in between. A song is really a sequence, and you already know how to build sequences with blocks!

Beep says I have a speaker in my tummy. When I play a note, my antenna light blinks. Beep boop! Let’s make some music together.

What you need

  • A block-coding app that a grown-up has helped you open. Look for a “music” or “sound” section of blocks. Some apps have it built in and some need it added from a menu. Ask your grown-up to help you find it.
  • Speakers, or headphones if you like.
  • About 40 minutes.

Safety first Keep the volume low and comfortable. Loud sounds, especially through headphones, can hurt your ears. If you use headphones, ask a grown-up to check the volume before you start.

Grown-ups The note numbers in this lesson follow the MIDI system, where 60 is middle C. Many block apps use it, but some use letter names or a picture of a piano keyboard instead. If your app is different, treat the numbers here as the pattern and pick the matching notes. If your app has no music blocks, you can still do the lesson by clapping the rhythms or writing the notes on paper.

Words to know

  • A note is one musical sound. Its pitch says how high or low it is.
  • A beat is the steady “pulse” of a song, like a heartbeat or tapping your foot.
  • A rest is a quiet gap, a beat with no sound.
  • The tempo is how fast the beats go. It is counted in beats per minute.

Play a note

Here is the block that plays one note:

A script that plays note 60 for 1 beat after the start button is clicked.

The 60 is the pitch. A bigger number means a higher sound. In many apps, 60 is middle C, a note right in the middle of a piano. The 1 says how long the note lasts, in beats.

Here are the notes for the “white keys” on a piano, starting at middle C:

NoteCDEFGABhigh C
Number6062646567697172

A rhythm with a rest

A rhythm is a pattern of long and short sounds and rests. This script plays two quick notes and then a gap, over and over:

A script with a repeat 4 loop that plays note 60 for half a beat twice, then rests for 1 beat.

Each time round the loop takes 0.5 + 0.5 + 1 = 2 beats. Four times round is 4 × 2 = 8 beats in all. Say it out loud as you tap it: “tap-tap-rest, tap-tap-rest…”

Pixel says The rest is just as important as the notes! If you took out all the rests, a song would be one long messy sound. Meow!

Twinkle, twinkle

The old tune “Twinkle, Twinkle, Little Star” starts like this: C C G G A A G. Each note is played twice (C C, then G G, then A A), and the line ends with one G that lasts twice as long. Pairs like that are a perfect job for repeat blocks:

A script that plays note 60 twice, note 67 twice, note 69 twice, each for 1 beat, and then note 67 for 2 beats.

Count the beats: 6 notes of 1 beat each, plus 2 beats for the last note. That is 6 + 2 = 8 beats.

Changing the tempo

The tempo block sets how fast the beats go. It counts beats per minute. At 60 beats per minute, each beat takes 1 second. At 120 beats per minute, each beat takes half a second.

A script that sets the tempo to 120 and plays note 60 for 1 beat.

So the 8-beat tune above lasts 8 seconds at tempo 60, but only 4 seconds at tempo 120. Same notes, double the speed!

Challenges

Try it The tune goes on: F F E E D D C, with the last note lasting 2 beats. The numbers are F = 65, E = 64, D = 62 and C = 60. Build the second line of the song.

Show the answer
A script that plays note 65 twice, note 64 twice, note 62 twice, each for 1 beat, and then note 60 for 2 beats.

To play both lines in one script, build the first line, and then add the second line underneath it. The whole tune is 8 + 8 = 16 beats.

Try it Make a tune that goes up the piano from middle C to high C, one note per beat. How many play note blocks do you need, and what are their numbers?

Show the answer

You need 8 blocks, with the numbers 60, 62, 64, 65, 67, 69, 71 and 72, the numbers from the table. That is 8 beats in total.

Try it At tempo 120, how many seconds do 6 beats take? What about at tempo 60?

Show the answer

At 120 beats per minute, each beat takes 0.5 seconds, so 6 beats take 6 × 0.5 = 3 seconds. At 60 beats per minute, each beat takes 1 second, so 6 beats take 6 seconds.

Did you know? A piano has 88 keys, but a song only uses a few of them at a time. Computers store music as lists of numbers, just like the note numbers in this lesson!

What you learned

  • A note has a pitch (high or low) and a length measured in beats.
  • A rest is a beat of silence.
  • A repeat block saves you from building the same notes again and again.
  • Tempo is how fast the beats go, counted in beats per minute.