Note names, chords and scales, worked out as plain MIDI note numbers.
A note name is a letter from a to g, upper or lower case, an optional s for sharp or b for flat, and an optional octave that defaults to 4, so :c4 is 60, middle C.
Chords and scales are lists of note numbers, built from a root given as a name or a number, and a scale ends on the octave above its root.
Summary
Functions
The note of a chord, in any octave, closest below a note.
The notes of a chord, from a root given as a name or a number.
A scale bent to a chord: each chord tone missing from the scale takes the place of the scale note a semitone below it, or a semitone above when there is none below.
The note number for text giving a number or a note name, such as "60" or "c4", raising ArgumentError for neither.
The step from each note to the next, from notes given as names or numbers.
The notes reached by taking each step in turn from a start note given as a name or a number.
The note of a chord, in any octave, closest to a note, the lower on a tie; except: leaves out one note.
A note number for a number or a note name such as :c4, raising ArgumentError for an unknown name.
The note number for a note name written as text, such as "A2", raising ArgumentError for an unknown name.
The notes of a scale from a root, ending on the octave above it, over octaves: octaves (1 by default).
Each note of a chord placed once from from: up to to:, leaving out the root of a chord of more notes than limit:.
Functions
The note of a chord, in any octave, closest below a note.
The notes of a chord, from a root given as a name or a number.
A scale bent to a chord: each chord tone missing from the scale takes the place of the scale note a semitone below it, or a semitone above when there is none below.
The note number for text giving a number or a note name, such as "60" or "c4", raising ArgumentError for neither.
The step from each note to the next, from notes given as names or numbers.
The notes reached by taking each step in turn from a start note given as a name or a number.
The note of a chord, in any octave, closest to a note, the lower on a tie; except: leaves out one note.
A note number for a number or a note name such as :c4, raising ArgumentError for an unknown name.
The note number for a note name written as text, such as "A2", raising ArgumentError for an unknown name.
The notes of a scale from a root, ending on the octave above it, over octaves: octaves (1 by default).
Each note of a chord placed once from from: up to to:, leaving out the root of a chord of more notes than limit:.