First of all, we need to tell ChickBot how to sing in tune – and to do that, we need to tell it what notes to play. For this example, we’ll be using just a few notes. Later on, you’ll have access to a whole piano’s worth of notes.

This setups a simple way for us to know what note we want but for the ChickBot to know what that notes is as a frequency. We’ll find out a bit more about music and frequencies in another tutorial, for now, just know that C4 is what is commonly known as middle C.

You can see we have pairs to tell the program the note and its duration using whole, half, quarter (4) and eighths (8) as sheet music To put a space, we use a note of 0 and we put 0, 0 to indicate no note, no duration so the program knows when to end.

This needs to be put after the note definitions and before the setup section.

If you don’t yet know how to read music, we’ll show you how to do that in another tutorial. If you can read music, you can put your own tunes in – at the bottom of this page is the definitions for two octaves including the sharps. Remember, C4 is middle C.

But now, we will expand on our button pressing, tune playing, moving backwards ChickBot program so you can get it dancing and singing to your commands.