In traditional music theory there are 12 different pitches in a given octave. For example from the bottom C to the top C on the piano below is one octave. If you count the keys from C up to B, you get 12. 7 white keys and 5 black. So why do the black keys have 2 different names? Aren't they the same pitch? Yes indeed they are however they have two different names. A pitch with two different names is called an enharmonic. One reason you might see one over the other is if the song or melody is in a specific key. For example if you were playing in the key of G, you would call the 7th note in the G major scale F# rather than Gb.
One last note (pun intended :-D ), the notes E#, Fb, B#, and Cb, the invisible notes in between the white keys with no black keys, are rarely recognized as notes in music so we won't worry about them for the purposes of this project. If this question interests you learn more about it here.
In this project you'll be able use your Circuit Playground Express as a digital pitch pipe. Thanks to the Circuit Playground Express's built-in microphone sensor, speaker, buttons and NeoPixel leds, all you have to do is upload the code and it works!
- We'll be using seven of the ten neopixels to represent each pitch.
- Use the up and down buttons to move up and down pitches.
- Once a pitch is selected, blow into the Circuit Playground and hear your pitch!
- Blue means the note is flat, green means natural and red is sharp.
In the example below, Bb is selected and sounded.
If this is your first CircuitPython project or you are new to Python or even coding, no need to worry, I've included the steps needed to go about setting up the Circuit Playground Express with CircuitPython, and a step by step process of how the code works. If you're wondering, CircuitPython is a variation of the Python programming language but optimized for hardware like our Circuit Playground Express. It was developed right here at Adafruit!
If you are a CircuitPython expert or already have your board configured for CircuitPython feel free to skip ahead!
Let's get started.