music.invert¶
- music.invert(notes, degree=0, octaves=1)[source]¶
Move one note of a chord by whole octaves.
The article: “Inversions and open positions can be obtained with the addition of +/- 12 to the selected note.”
- Parameters:
- notes
tupleofintegers The chord.
- degree
integer Which note to move, indexed from the bottom.
- octaves
integer How many octaves, and which way. Positive moves it up.
- notes
- Returns:
tupleofintegersThe chord with that note moved, sorted again so the result reads from the bottom up.
- Raises:
IndexErrorIf degree is not a note of notes.
- Parameters:
- Return type:
Examples
>>> invert(chord('major'), degree=0) (4, 7, 12) >>> invert(chord('major'), degree=2, octaves=-1) (-5, 0, 4) >>> invert(chord('major'), degree=2, octaves=1) # an open position (0, 4, 19)