1
1
# Description
2
2
3
- Given a tonic, or starting note, and a set of intervals, generate
4
- the musical scale starting with the tonic and following the
5
- specified interval pattern.
3
+ ## Chromatic Scales
6
4
7
5
Scales in Western music are based on the chromatic (12-note) scale. This
8
6
scale can be expressed as the following group of pitches:
9
7
10
- A, A#, B, C, C#, D, D#, E, F, F#, G, G#
8
+ > A, A#, B, C, C#, D, D#, E, F, F#, G, G#
11
9
12
10
A given sharp note (indicated by a #) can also be expressed as the flat
13
11
of the note above it (indicated by a b) so the chromatic scale can also be
14
12
written like this:
15
13
16
- A, Bb, B, C, Db, D, Eb, E, F, Gb, G, Ab
14
+ > A, Bb, B, C, Db, D, Eb, E, F, Gb, G, Ab
17
15
18
16
The major and minor scale and modes are subsets of this twelve-pitch
19
17
collection. They have seven pitches, and are called diatonic scales.
20
18
The collection of notes in these scales is written with either sharps or
21
- flats, depending on the tonic. Here is a table indicating whether the
22
- flat expression or sharp expression of the scale would be used for a given
23
- note :
19
+ flats, depending on the tonic (starting note) . Here is a table indicating
20
+ whether the flat expression or sharp expression of the scale would be used for
21
+ a given tonic :
24
22
25
23
| Key Signature | Major | Minor |
26
24
| ------------- | --------------------- | -------------------- |
@@ -32,6 +30,19 @@ Note that by common music theory convention the natural notes "C" and "a"
32
30
follow the sharps scale when ascending and the flats scale when descending.
33
31
For the scope of this exercise the scale is only ascending.
34
32
33
+ ### Task
34
+
35
+ Given a tonic, generate the 12 note chromatic scale starting with the tonic.
36
+
37
+ - Shift the base scale appropriately so that all 12 notes are returned
38
+ starting with the given tonic.
39
+ - For the given tonic, determine if the scale is to be returned with flats
40
+ or sharps.
41
+ - Return all notes in uppercase letters (except for the ` b ` for flats)
42
+ irrespective of the casing of the given tonic.
43
+
44
+ ## Diatonic Scales
45
+
35
46
The diatonic scales, and all other scales that derive from the
36
47
chromatic scale, are built upon intervals. An interval is the space
37
48
between two pitches.
@@ -47,3 +58,12 @@ Non-diatonic scales can contain other intervals. An "augmented second"
47
58
interval, written "A", has two interceding notes (e.g., from A to C or Db to E)
48
59
or a "whole step" plus a "half step". There are also smaller and larger
49
60
intervals, but they will not figure into this exercise.
61
+
62
+ ### Task
63
+
64
+ Given a tonic and a set of intervals, generate the musical scale starting with
65
+ the tonic and following the specified interval pattern.
66
+
67
+ This is similar to generating chromatic scales except that instead of returning
68
+ 12 notes you need to return one note for each interval in the given pattern by
69
+ skipping the number of notes indicated by each interval in the pattern.
0 commit comments