Nibbles and Bits
The Care and Feeding of My Pet Arduino


by Budd Churchward - WB7FHC - NIBBLES AND BITS LIBRARY

'My Dog Has Fleas' - A Binary Music Machine
« 1 2 3 4 5 6 7  8  9 10 11 12 »

Section 8 - Four Buttons → Fifteen Notes [Frequency Charts]
We are going to keep this project simple. We will set up two scales of 15 notes. One will be made up of only 'natural' notes, the white keys. The other will be made up of only the 'sharp' notes, the black keys. You will have to select which scale you want to play by REMing out a line before you compile the code.
Why would anyone want a scale that plays only the black keys? Well, this is an old music lovers' trick. If you are ever around a small child who wants to play with a piano, make a rule that she may only touch the black keys.

The black keys form the pentatonic scale. In it, there is no order or combination of notes that can be played that sounds discordant.

No matter what the child does, her playfulness will sound melodious if she only plays the black keys.

Try it yourself, if you can. You will find that it is true. Your experimenting will remind you of Japanese music. In fact, wind chimes are tuned to this scale so that their random notes will always sound pleasant.

Perhaps some of you would like to figure out how to create an electronic wind chime with your Pet Arduino.

Here are the notes and frequencies that we will use in our two scales:
 Naturals:
C D E F G A B C D E F G A B C
131 147 165 175 196 220 247 262 294 330 349 392 440 498 523
 Pentatonic:
C# D# F# G# A# C# D# F# G# A# C# D# F# G# A#
139 156 185 208 233 277 311 370 415 466 554 622 740 831 932
  In the next section we will take our 'Four Note' sketch and turn it into Fifteen!

  Next Section »