music.interval_names

music.interval_names(semitones)[source]

Every traditional name for an interval of this many semitones.

Parameters:
semitonesinteger

Semitones above the lower note, from 0 upwards.

Returns:
tuple of strings

One name for most intervals and three for the tritone, which the article names aug4, dim5 and TT. Compound intervals are named as the simple one raised by octaves.

Raises:
ValueError

If semitones is negative. An interval is measured upward; use the two notes the other way round.

Parameters:

semitones (int)

Return type:

tuple[str, …]

See also

interval

the same, forwards.

Examples

>>> interval_names(4)
('M3',)
>>> interval_names(6)
('aug4', 'dim5', 'TT')
>>> interval_names(14)
('M9',)