Music Derby is a game in which sound of music runs seven robots.
The player predicts which robot will go the farthest when a tune is over.
A single pitch is assigned to each of the four-legged walking robots that imitate animals such as deer, rabbits, and mice.
For example, the note C is assigned to deer, the note D is assigned to rabbits, and note E is assigned to mice.
When the note G is played, the pig moves forward.
When the note F is played, the giraffe moves forward,
and when the note E is played, the mouse moves forward.
If twinkle twinkle little star is played in C major key, which animal will go the farthest at the end of the song?
In C major, C is the tonic note, so you might expect that the deer assigned to C goes the farthest.
But in reality, the pig assigned to G wins.
This is because G appears most frequently on twinkle twinkle little star.
On the contrary, the cat never moves because B never appears.
In this way, Music Derby can visualize the frequency of occurrence of notes on the scale in a song.
The microphone picks up the sound played by the instrument.
Analyze the pitch with Arduino.
Rotate the motor to move the animal forward.