Skip to content

Commit e1eef73

Browse files
authored
scale-generator: add clear directives (#1884)
Instructions were unclear. There were two tasks (chromatic and diatonic), but they were not clearly delineated. #1640
1 parent 023b63d commit e1eef73

File tree

1 file changed

+28
-8
lines changed

1 file changed

+28
-8
lines changed

exercises/scale-generator/description.md

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
11
# Description
22

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
64

75
Scales in Western music are based on the chromatic (12-note) scale. This
86
scale can be expressed as the following group of pitches:
97

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#
119
1210
A given sharp note (indicated by a #) can also be expressed as the flat
1311
of the note above it (indicated by a b) so the chromatic scale can also be
1412
written like this:
1513

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
1715
1816
The major and minor scale and modes are subsets of this twelve-pitch
1917
collection. They have seven pitches, and are called diatonic scales.
2018
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:
2422

2523
| Key Signature | Major | Minor |
2624
| ------------- | --------------------- | -------------------- |
@@ -32,6 +30,19 @@ Note that by common music theory convention the natural notes "C" and "a"
3230
follow the sharps scale when ascending and the flats scale when descending.
3331
For the scope of this exercise the scale is only ascending.
3432

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+
3546
The diatonic scales, and all other scales that derive from the
3647
chromatic scale, are built upon intervals. An interval is the space
3748
between two pitches.
@@ -47,3 +58,12 @@ Non-diatonic scales can contain other intervals. An "augmented second"
4758
interval, written "A", has two interceding notes (e.g., from A to C or Db to E)
4859
or a "whole step" plus a "half step". There are also smaller and larger
4960
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

Comments
 (0)