The document discusses creating a code model to represent concepts in music theory, including notes, intervals, scales, and chords. It describes modeling notes with properties like name and pitch, handling accidentals that raise or lower a note, calculating intervals between two notes, generating major scales from a root note, and identifying the quality (major, minor, etc.) of chords based on the notes. The goal is to programmatically represent these core elements of music theory.
8. Interval
Exercise
Return
interval
name
given
two
notes
Input
First
Note:
C
Second
Note:
E
Output
Major
3
Input
First
Note:
E
Second
Note:
G
Output
Minor
3
13. Chord
Three
or
more
notes
played
simultaneously
Traditional
western
harmony
Chords
are
constructed
on
intervals
of
thirds
C
E
G
(Major
chord)
C
E
G#
(Augmented
chord)
C
E
Gb
(Diminished
chord)
C
Eb
G
(Minor
chord)
C
E
G
B
(Major
Seventh
chord)
C
E
G
Bb
(Dominant
Seventh
chord)
C
Eb
G
Bb
(Minor
Seventh
chord)
14. Chord
Exercise
Return
chord
quality
name
given
three
notes
Input
First
Note:
C
Second
Note:
E
Third
Note:
G
Output
Major