Skip to content
KBHXgamesAll games

Play Block Code Music Online

Turn note blocks into a full song, using functions, rests and extra start blocks to build a four-part round.

Block Code Music gameplay screenshot
  • Phones: some features

Tip: rotate your phone to landscape for a larger screen.

Block Code Music at a glance

Genre
Puzzle Games
Play with
Mouse, Touch screen, Keyboard
On phones
Partly
Players
1 player
Price
Free, no sign-up
License
Apache-2.0

Block Code Music is a coding puzzle where your program makes a song instead of moving a character. You place note blocks, press Run and hear the result right away. Over ten levels, one old children’s round teaches a key idea in programming, the function. You write a phrase once, give it a name and use it as often as you need.

The Goal

Match the target melody shown on the staff. Notes you still need appear in gray. As your program plays, the correct ones are drawn in black. If you hit every note, you pass and see the JavaScript that matches your blocks.

How a Round Plays Out

Each program starts with a “when Run clicked” block. Drop “play note” blocks inside it, then set the pitch and length on each one. Press Run Program to hear it, and Reset to stop.

The levels build in a clear order:

  1. Play the first four notes of the tune.
  2. Play those notes twice without adding more note blocks, which means using a function.
  3. Add functions for the next phrases until the song is complete.
  4. Swap sounds with the set-instrument block, and add silence with rests.
  5. Use several start blocks at once, each delayed, to stack voices into a round.

Level 10 drops the target, and you can compose whatever you like.

Keys and Buttons for Block Code Music

Keyboard, mouse and touch controls for Block Code Music
What you do⌨ Keyboard🖱 Mouse👆 Touch
Add note, rest or function blocks—Click the Music category and drag a block into the workspaceTap the category and drag a block
Choose a pitchType a note name such as D4 and press EnterClick the note name and pick a line on the small staffTap the note name and pick a line
Choose a note length—Click the note symbol on the blockTap the note symbol
Play or stop your tune—Click Run Program, then ResetTap Run Program, then Reset
Change playback speed—Drag the tempo sliderSlide the tempo control

Winning Strategies

  • Give functions clear names. Labels like “part one” keep a long tune easy to follow.
  • Watch for gray notes. Any gray note left after a run is one you missed or got wrong.
  • Fix length, not count. When one phrase ends on a held note, make that note longer instead of adding a second block.
  • Offset each voice with rests. In the round levels, each new part enters a little later than the last one.
  • Slow the tempo to debug. Drag the slider down to hear exactly where a note goes wrong.

Handy Details

Nothing plays until you press Run Program, so the game won’t surprise you with sound. Different instruments in each start block make the round parts easier to tell apart. The JavaScript shown after a win is a useful look at real code.

Who Should Play It

It fits young coders and music lovers who want a gentle, hands-on look at functions. Players who enjoy rhythm toys or step-by-step logic puzzles will like how the song comes together.

Played and checked by the KBHX Games team · updated

Block Code Music: Questions and Answers

Is Block Code Music free to play?

Yes. All ten levels run free in your browser, with no account or download needed. You only need sound turned on, since the game checks and plays your tune out loud.

What song am I building?

The target levels are all based on "Frère Jacques". You begin with its first four notes, C4, D4, E4 and C4, and by the end you play the whole tune as a round in four parts.

My notes are right, so why does it say I could do better?

Starting at the function levels, the game wants repeated phrases placed in a function. If you copy the same note blocks twice, it reminds you. Move the phrase into a function and call it twice.

Which instruments are included?

The set-instrument block lets you choose piano, trumpet, banjo, violin, guitar, flute, drum or choir. Each one uses recorded samples instead of synthetic beeps.

If You Liked Block Code Music, Try These