Tables and Scales: Do'h-Ray-Meh
Digital Music systems such as MIDI use integers to represent different notes. This method of representation is known an enumeration. For this exercise, we will write a program to build a hash table that translates note values to numerical values, and an array to translate numerical values back to note values. In order to accomplish this, we will need to know two pieces of information, and let our program enumerate our two lookup tables.
- What are the two pieces of information our program needs to enumerate the tables?
- Why use a hash table for note lookups, and an array for numerical lookups?
For now, we will ignore sharps and flats, and just utilize the "white keys" of a piano when building our table. A full octave is represented by eight notes:
C D E F G A B C. When specifying note values, we will use scientific pitch notation.
- How many full octaves can we enumerate with an 8-bit unsigned integer? h