music.scale¶
- music.scale(name='major', tonic=0)[source]¶
The semitones of a named scale, counted from tonic.
- Parameters:
- Returns:
tupleof integersThe degrees, in ascending order for every scale but the melodic minor, which the article writes as a rise and a fall.
- Raises:
ValueErrorIf name is not a scale this module knows.
- Parameters:
- Return type:
See also
mode_by_rotationthe same seven modes, reached by rotating the steps.
pitch_to_freqturns these semitones into frequencies.
Examples
>>> scale('major') (0, 2, 4, 5, 7, 9, 11) >>> scale('minor') == scale('aeolian') True >>> scale('dorian', tonic=2) (2, 4, 5, 7, 9, 11, 12)