Piano Song: Ascend to Charge

String together notes to make a song. Once you have the basics, you can create any tune you can imagine!

Code

The code in the editor below already works. Just plug in your Code Piano and press upload to see what it does! Tinker with it and make changes to see what each line of code controls.

Walkthrough Videos

Watch the videos for line-by-line explanation of how the example program works. Then you'll be ready to make some changes of your own!

Challenges

Can you complete the challenge? Change the code in your code editor above. Upload your code to see the effect when you're finished. Complete a challenge? Check it off the list!


Concepts

These are the new code concepts covered in this example program. To become a great coder, read through these concepts to learn new vocabulary.

New Concept: Real-world crossover with code

Code is often created to reflect something from the ‘real world’, just like this program. It’s very easy to look up the hertz value of a piano note and convert it to a tone command you can use to build songs on your Code Piano. There are some things, like chords, that you aren’t able to play on your Code Piano. But there are some things, like playing at extremely high speeds with 100% accuracy, that are much easier to do on Code Piano than on a real piano!

Quiz

If you're having trouble, try to run an experimental program or look at the example code to help you find the answer.

1. True or False: You have to use a noTone() command between every note that plays on Code Speaker.