Skip to content
integrated computational thinking

Art Practice A2.2: Use computing to create interactive art that is responsive to viewer inputs (Activity)

< Back to Building Block
Step 4 of 6: Melodies come from Scales to make Rhythm
the nested code "on button A pressed" then "play tone 0 or 1 beat" shown above the image of a keyboard labeled Middle C

Rhythm is dictated by the number of syllables in a melody. In this step, you will use Makecode again to code a familiar melody.

♪ Twinkle, Twinkle, little star, how I wonder what you are? ♪

This popular melody can be translated into the notes: do-do-so-so-la-la-so fa-fa-mi-mi-re-re-do

Your Task

  1. Go to makecode.microbit.org and select "New project"
  2. Name your new project "Twinkle Twinkle"
  3. From the Input menu, add an [on button A pressed] block to your code workspace
  4. From the Music menu, select the [play tone] block and place it inside your [on button A pressed] block.
  5. Click on the whitespace in the [play tone] block to edit the note that is played for 1 beat when button A is pressed.
  6. Add more [play tone] blocks to your code stack so that the Twinkle Twinkle melody is played when you press the A button. Remember, this melody has 14 syllables!

Reflection

Save a URL or screenshot of your program in your design journal.