@@ -72,6 +72,9 @@ def degrees(harmony: dict) -> dict[int, int]:
|
||||
raise ValueError('harmony contains no pitch information')
|
||||
return result
|
||||
|
||||
def is_triad(harmony: dict) -> bool:
|
||||
return set(degrees(harmony)) == {1, 3, 5}
|
||||
|
||||
def degree_semitones(degree: int, alter: int) -> int:
|
||||
return 12 * ((degree - 1) // 7) + (0, 2, 4, 5, 7, 9, 11)[(degree - 1) % 7] + alter
|
||||
|
||||
|
||||
Reference in New Issue
Block a user