Shared Catalog

This commit is contained in:
khodowany
2026-09-17 00:44:19 -05:00
parent aa1273b07d
commit 5941a4cd49
44 changed files with 3613 additions and 733 deletions
+6
View File
@@ -78,6 +78,12 @@ def shift_key(key: dict, steps: int, semitones: int) -> dict:
break
else:
result['custom'] = True
if 'cancel' in key:
# A cancellation references the old signature, not a count of naturals.
cancelled = shift_key(key_from_fifths(key['cancel']), steps, semitones)
if cancelled.get('custom'):
raise ValueError('transposed key cancellation cannot be represented by fifths')
result['cancel'] = cancelled['fifths']
return result
def transposition_interval(document: dict, target_key_name: str) -> tuple[int, int]: