|
1 | 1 | # Instructions
|
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 |
| -Scales in Western music are based on the chromatic (12-note) scale. This |
8 |
| -scale can be expressed as the following group of pitches: |
| 5 | +Scales in Western music are based on the chromatic (12-note) scale. |
| 6 | +This 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 |
| -A given sharp note (indicated by a #) can also be expressed as the flat |
13 |
| -of the note above it (indicated by a b) so the chromatic scale can also be |
14 |
| -written like this: |
| 10 | +A given sharp note (indicated by a ♯) can also be expressed as the flat of the note above it (indicated by a ♭) so the chromatic scale can also be written like this: |
15 | 11 |
|
16 |
| -A, Bb, B, C, Db, D, Eb, E, F, Gb, G, Ab |
| 12 | +> A, B♭, B, C, D♭, D, E♭, E, F, G♭, G, A♭ |
17 | 13 |
|
18 |
| -The major and minor scale and modes are subsets of this twelve-pitch |
19 |
| -collection. They have seven pitches, and are called diatonic scales. |
20 |
| -The collection of notes in these scales is written with either sharps or |
21 |
| -flats, depending on the tonic. Here is a list of which are which: |
| 14 | +The major and minor scale and modes are subsets of this twelve-pitch collection. |
| 15 | +They have seven pitches, and are called diatonic scales. |
| 16 | +The collection of notes in these scales is written with either sharps or flats, depending on the tonic (starting note). |
| 17 | +Here is a table indicating whether the flat expression or sharp expression of the scale would be used for a given tonic: |
22 | 18 |
|
23 |
| -No Sharps or Flats: |
24 |
| -C major |
25 |
| -a minor |
| 19 | +| Key Signature | Major | Minor | |
| 20 | +| ------------- | --------------------- | -------------------- | |
| 21 | +| Natural | C | a | |
| 22 | +| Sharp | G, D, A, E, B, F♯ | e, b, f♯, c♯, g♯, d♯ | |
| 23 | +| Flat | F, B♭, E♭, A♭, D♭, G♭ | d, g, c, f, b♭, e♭ | |
26 | 24 |
|
27 |
| -Use Sharps: |
28 |
| -G, D, A, E, B, F# major |
29 |
| -e, b, f#, c#, g#, d# minor |
| 25 | +Note that by common music theory convention the natural notes "C" and "a" follow the sharps scale when ascending and the flats scale when descending. |
| 26 | +For the scope of this exercise the scale is only ascending. |
30 | 27 |
|
31 |
| -Use Flats: |
32 |
| -F, Bb, Eb, Ab, Db, Gb major |
33 |
| -d, g, c, f, bb, eb minor |
| 28 | +### Task |
34 | 29 |
|
35 |
| -The diatonic scales, and all other scales that derive from the |
36 |
| -chromatic scale, are built upon intervals. An interval is the space |
37 |
| -between two pitches. |
| 30 | +Given a tonic, generate the 12 note chromatic scale starting with the tonic. |
38 | 31 |
|
39 |
| -The simplest interval is between two adjacent notes, and is called a |
40 |
| -"half step", or "minor second" (sometimes written as a lower-case "m"). |
41 |
| -The interval between two notes that have an interceding note is called |
42 |
| -a "whole step" or "major second" (written as an upper-case "M"). The |
43 |
| -diatonic scales are built using only these two intervals between |
44 |
| -adjacent notes. |
| 32 | +- Shift the base scale appropriately so that all 12 notes are returned starting with the given tonic. |
| 33 | +- For the given tonic, determine if the scale is to be returned with flats or sharps. |
| 34 | +- Return all notes in uppercase letters (except for the `b` for flats) irrespective of the casing of the given tonic. |
45 | 35 |
|
46 |
| -Non-diatonic scales can contain other intervals. An "augmented second" |
47 |
| -interval, written "A", has two interceding notes (e.g., from A to C or Db to E) |
48 |
| -or a "whole step" plus a "half step". There are also smaller and larger |
49 |
| -intervals, but they will not figure into this exercise. |
| 36 | +## Diatonic Scales |
| 37 | + |
| 38 | +The diatonic scales, and all other scales that derive from the chromatic scale, are built upon intervals. |
| 39 | +An interval is the space between two pitches. |
| 40 | + |
| 41 | +The simplest interval is between two adjacent notes, and is called a "half step", or "minor second" (sometimes written as a lower-case "m"). |
| 42 | +The interval between two notes that have an interceding note is called a "whole step" or "major second" (written as an upper-case "M"). |
| 43 | +The diatonic scales are built using only these two intervals between adjacent notes. |
| 44 | + |
| 45 | +Non-diatonic scales can contain other intervals. |
| 46 | +An "augmented second" interval, written "A", has two interceding notes (e.g., from A to C or D♭ to E) or a "whole step" plus a "half step". |
| 47 | +There are also smaller and larger intervals, but they will not figure into this exercise. |
| 48 | + |
| 49 | +### Task |
| 50 | + |
| 51 | +Given a tonic and a set of intervals, generate the musical scale starting with the tonic and following the specified interval pattern. |
| 52 | + |
| 53 | +This is similar to generating chromatic scales except that instead of returning 12 notes, you will return N+1 notes for N intervals. |
| 54 | +The first note is always the given tonic. |
| 55 | +Then, for each interval in the pattern, the next note is determined by starting from the previous note and skipping the number of notes indicated by the interval. |
| 56 | + |
| 57 | +For example, starting with G and using the seven intervals MMmMMMm, there would be the following eight notes: |
| 58 | + |
| 59 | +Note | Reason |
| 60 | +--|-- |
| 61 | +G | Tonic |
| 62 | +A | M indicates a whole step from G, skipping G♯ |
| 63 | +B | M indicates a whole step from A, skipping A♯ |
| 64 | +C | m indicates a half step from B, skipping nothing |
| 65 | +D | M indicates a whole step from C, skipping C♯ |
| 66 | +E | M indicates a whole step from D, skipping D♯ |
| 67 | +F♯ | M indicates a whole step from E, skipping F |
| 68 | +G | m indicates a half step from F♯, skipping nothing |
0 commit comments