Pianotime for Sprout gives Arduino bots a voice in Oregon


By Warren Volkmann
Sprout Pro Storyteller

When the kids in the Makers Club at Calapooia Middle School in Albany, Oregon, learned that their Arduino bots (all named Buzz) came equipped with a tone generator, they, of course, wanted them to sing.

The tune that 7th graders Sam Snider and Joseph “Joey” Passenant wanted their Buzz bots to sing was a classic – the opening of Beethoven’s Fifth Symphony: 


The boys could hum the famous passage, but neither knew the notes. And Buzz’s little Arduino brain isn’t Shazam. It can’t recognize musical notes. It knows tones in an Arduino library. Sam and Joey needed to figure out the notes so they could program the tones. 

Joey and Sam turned to the club’s Sprout Pro, which HP donated as part of its Sprouts in the Community program. (Bill Lewey is the HP employee who advocated for the school’s Makers Club and its instructor, Tim Oar.)

Sam and Joey launched the customized Pianotime app, one of the most popular and engaging apps on the Sprout. The boys started plinking keys on the touch mat, searching for Beethoven’s eight famous notes:

G-G-G-D sharp…

Armed with the notes, they returned to the laptop where they were programming Buzz. They opened an Arduino “toneMelody” library – listing every note on a keyboard – and discovered a fundamental of music – octaves.

“There were a lot of G’s and F’s!” Sam declared.

They opted to have Buzz sing in the 4th octave and added “melody” lines to Buzz’s code:

      NOTE_G4, NOTE_G4, NOTE_G4, NOTE_DS4,
      NOTE_F4, NOTE_F4, NOTE_F4, NOTE_D4

When they hit “play,” they learned another music fundamental. Music isn’t just a series of notes. It is notes played for a specific amount of time. Some notes are short. Some notes are long. And music has pauses, where there are no notes at all.

Back they went to Pianotime. This time Sam and Joey more carefully considered the duration of each note and the rests in between. They studied the treble and bass clef that appeared on the Sprout’s monitor, learning how music is notated.

Back at the laptop, they inserted lines in the code for “noteDurations.”

Code for a musical passage popular with barbershop quartets.

This time, when they hit play, Buzz’s program combined the tones with the durations and played Beethoven’s famous passage perfectly.

Could the Makers Club kids have done the same thing with a piano or a laptop running Pianotime?

“Yes,” Joey said, “but if we didn’t have the Sprout, it would have taken much, much longer.”

Sam agreed. “The Sprout made it a lot easier. We learned that you have to find the right octave in the tone library, then you have to coordinate notes to numbers.”

Sprout Pro with the Pianotime app made it easier for all the kids in the Maker Club to map melody to notes, notes to tones, and finally tones to code. It helped them learn not only the structure of code, but also of music. Music is more than notes. And surprisingly, to program music, you sometimes have to program silence.

More Sprout posts:





  • Inspired 1-minute videos about HP's view of "Immersive Computing" and "Blended Reality"

Blended Reality


Immersive Computing

Click image to watch

Author : TheSkipper

A note from the Editor... As the Dev Portal's editor, I am not a coder. Nor am I a musician, but I had just enough piano lessons as a boy to know that the code block I received from Calapooia's Makers Club did not code the start of Beethoven's famous 5th Symphony. I studied the notes (C-G-G-A-G-B-C) and the timing (4-8-8-4-4-4-4-4). The rhythm of the quarter notes (4) and eighth notes (8) finally revealed the melody I was looking at. It's a ditty used to great effect in the movie Roger Rabbit: Shave and a haircut....six bits! (Hence the clever caption under the block of code.)