Cleanup
This commit is contained in:
@@ -44,6 +44,13 @@ def _load(contents):
|
||||
raise ValueError(p['id']+': invalid chord-member step')
|
||||
if not p['prefix_attacks'] or any(n not in (2,3,4) for n in p['prefix_attacks']) or not 1<=p['max_interval']<=12:
|
||||
raise ValueError(p['id']+': unsupported bounded chord prefix')
|
||||
gestures=result['melodic_vocabulary']['gesture_rules']
|
||||
if len({g['id'] for g in gestures})!=len(gestures):raise ValueError('Duplicate joint gesture rule')
|
||||
for g in gestures:
|
||||
if g['kind'] not in ('harmonic_arrival','sustained_color'):raise ValueError(g['id']+': unsupported joint gesture')
|
||||
if g['kind']=='harmonic_arrival':
|
||||
if not g['arrival_offsets'] or any(abs(F(v))>F(result['harmony']['anticipation_max']) for v in g['arrival_offsets']):raise ValueError(g['id']+': arrival outside bounded policy')
|
||||
if not g['holds'] or any(F(v)<=0 for v in g['holds']) or F(g['release'])<0:raise ValueError(g['id']+': invalid sounding interval')
|
||||
return result
|
||||
|
||||
@functools.lru_cache(maxsize=1)
|
||||
|
||||
Reference in New Issue
Block a user