CSE 231
Fall 2007
Programming Project #2
Assignment Overview:
This assignment involves the coding and testing of a program that uses arithmetic expressions.
The assignment is worth 20 points (2% of the course grades), and must be completed before 11:59
pm on Monday, September 10
th
.
Background:
One of the oldest problems of music is how to map the notes of a musical piece to a set of audio
frequencies. There are various ``tuning approaches'' that state slightly different ways of assigning
notes to a particular frequency. This project will require that you write a program that does one
particular kind of this mapping.
First, we must define some form of musical note notation. The one common representation is the
octpch
note notation. This notation represents each note as a number pair, where the first number
indicates which
octave
the note belongs to and the second number the note within the octave,
termed the
pitch class
. There are 12
semitones
within each octave on the keyboard, namely:
Note
C
C#
D
D#
E
F
F#
G
G#
A
A#
B
Pc
0
1
2
3
4
5
6
7
8
9
10
11
We must map sound frequencies to this representation. We start by choosing a reference note. The
reference note frequency mapping is that 4.9 (A in the fourth octave) is 440 Hz. Every tuning
mapping must insure that each note in the next higher octave has a frequency that is twice the
previous octave, therefore 5.9
⇒
880 Hz and 3.9
⇒
220 Hz. Our tuning system will assume that
each of the semitones within an octave is equally spaced, that is the distance from one semitone to
the next is the same within the octave. This is called a
Tempered Scale
. The formula we use is:
)
12
(
2
*
m
o
x
+
where
x
is a reference Hz value for a known note,
o
is the
difference
(sign matters) in octave
between the reference note and the note in question and
m
is the
difference
(sign matters) between
the reference semitone and the note semitone in question. Consider the value for 0.0, C in the first
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview.
Sign up
to
access the rest of the document.
 Fall '07
 Punch
 Hertz, Octave

Click to edit the document details