Voice Leading
ci / checks (push) Successful in 48m12s

This commit is contained in:
khodowany
2026-09-30 15:13:00 -05:00
parent 10d295abfe
commit fb92ed78ee
17 changed files with 511 additions and 484 deletions
+3
View File
@@ -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