27
2
This task is simple: Write a program or function that outputs the list of all musical notes (using English note names) from A♭ to G♯.
All notes without a name consisting of a single letter (i.e. black notes on a musical keyboard) should have their name printed twice, once as the sharp of a note, once as the flat of one. Sharp or flat notes that can be described with a single letter, like B♯ (C) or F♭ (E) should not be outputted.
Here is an example of the output:
Ab, A, A#, Bb, B, C, C#, Db, D, D#, Eb, E, F, F#, Gb, G, G#
Specifications
The program or function must not take any input.
The notes may be printed in any order, and in any list output permitted by our standard I/O rules
The sharp and flat Unicode symbols (♯/♭) may be substituted with
b
and#
As always, Standard loopholes are forbidden.
As this is code-golf, the smallest program, in bytes, wins.
3related – Jonathan Allan – 2019-08-14T22:32:23.393
1May we output
"C "
instead of"C"
? – Arnauld – 2019-08-14T22:55:15.2371@Arnauld yes you may – TheOnlyMrCat – 2019-08-14T23:04:14.743
7By the way, B# exists in music notation; it's for example in the key signature for the key of C#, where it serves as the leading tone. – Kaz – 2019-08-14T23:39:43.757
So no naturals, double-flats or double-sharps either? :-) (I kid, those are only needed for certain scales.) – ErikF – 2019-08-15T00:41:13.237
2I don't know, it feels like Cb is missing here ;) – AJFaraday – 2019-08-15T11:31:57.993
No input. Does that include any pointers to output to? – me' – 2019-08-26T07:04:42.640