@@ -146,6 +146,9 @@ def validate_document(document: dict) -> None:
|
||||
staves = document.get('staves', [])
|
||||
if len(staves) != 1:
|
||||
raise ValueError('exactly one staff is currently supported')
|
||||
if any(m.get('repeats') or m.get('endings') for m in staves[0]['measures']):
|
||||
from generator.repeats import performed_order
|
||||
performed_order(staves[0]['measures'])
|
||||
instruments = staves[0].get('instruments', [])
|
||||
instrument_ids = {i['id'] for i in instruments}
|
||||
if len(instruments) != len(instrument_ids) or any(not isinstance(i, str) or not i for i in instrument_ids):
|
||||
|
||||
Reference in New Issue
Block a user