Use the Rover’s speaker to make it play songs. Combine the world of music and robotics by going through sheet music and coding the Rover to play each note.

Rover playing notes from sheet music
Basics of Music
When it comes to reading sheet music for this task, we use two pieces of information from each note: the tone (which note it is) and the duration (how long it’s played for).
A note can sit on a line or a space. You may find many notes of the same letter (tone) but at a higher pitch (different octave).

Sheet music notes, letter, octave, and duration
Songs can be divided into a rhythm, the constant beat the music follows. Note durations are: a whole note (semibreve) lasts 4 beats; a minim lasts 2; a crotchet lasts 1. We’ll only use semibreves, minims, and crotchets for basic songs.
We’ll use ‘Mary Had a Little Lamb’ as our example for the rest of this guide. The letters have been written below the notes, but feel free to find your own songs or write your own music.
Code
Constant: a variable that never changes while the code is running. In Python, we write these in all capitals with underscores between words.
1. Setting the Constants

Setting constants for crotchet, minim, and semibreve durations
Set up the framework by defining constants for each note length. A constant is a value used repeatedly throughout the code that never changes, perfect for what we need here. Since all the notes are multiples of the crotchet, you can use the diagram above and some simple multiplication to set all the constants. Also decide on an octave to use, and add a comment so you remember. For this example, we’ll use octave 4.
2. Making the Music

Using the Play Note and Delay blocks to play a single note
This part can take a while. Use the Play Note and Delay blocks to play each note individually. The Play Note block starts playing the note; the Delay block controls how long it’s played. Use the constants from the previous step to control the delay. Do this for each note in the song with the correct note lengths.
Complete Code
We’ve completed part of the example song. Try to finish the rest on your own.

Example code, partial 'Mary Had a Little Lamb'
