music.chord

music.chord(name='major', root=0)[source]

The semitones of a named chord, counted from root.

Parameters:
namestr

One of CHORDS: the four triads or the six tetrads.

rootinteger

Semitones to shift the whole chord by.

Returns:
tuple of integers

The chord’s notes, in ascending order.

Raises:
ValueError

If name is not a chord this module knows.

Parameters:
Return type:

tuple[int, …]

See also

add_seventh

builds a tetrad from a triad, as the article describes.

invert

moves a note by an octave, for inversions and open positions.

Examples

>>> chord('major')
(0, 4, 7)
>>> chord('minor seventh', root=3)
(3, 6, 10, 13)