The ‘Scale’ class

class music_essentials.scale.Scale

Static class methods for building lists of notes according to pre-defined patterns.

classmethod build_scale(tonic, scale_type)

Build a scale.

The scale will be built from the provided tonic, for one ascending octave. If building the scale will result in creating an invalid note (e.g., a note for which there is no MIDI number), the program will crash.

Args:
tonic : Note
The tonic note of the scale.
scale_type : str

The type of scale to build. Supported scale types are:

  • ‘major’/’maj’: major scale
  • ‘minor’/’min’: harmonic minor scale
  • ‘natural minor’/’nat min’: natural minor scale
Returns:
list
The notes in the specified scale, in ascending order.
Raises:
ValueError:
If an scale type is provided.
TypeError:
If the tonic is not a Note., or scale type is not a string.