@@ -49,6 +49,8 @@ def degrees(harmony: dict) -> dict[int, int]:
|
||||
else:
|
||||
raise ValueError(f'unsupported degree operation: {operation}')
|
||||
if kind != 'none' and not result:
|
||||
if kind == 'other':
|
||||
raise ValueError("harmony kind 'other' requires explicit added degrees; use a standard <kind> or add <degree> elements; display text alone does not define pitches")
|
||||
raise ValueError('harmony contains no pitch information')
|
||||
return result
|
||||
|
||||
|
||||
@@ -591,9 +591,9 @@ class Importer:
|
||||
self.children(item, {'duration', 'voice', 'staff'})
|
||||
self.identity(item)
|
||||
duration = self.number(item.findtext('duration'), positive=True) / self.divisions
|
||||
self.sequence += 1
|
||||
from generator.model import make_event
|
||||
if item.find('voice') is not None:
|
||||
self.sequence += 1
|
||||
voices.setdefault(self.voice_id, []).append(make_event(f'spacer-{self.sequence}', cursor, duration, 'spacer') | {'voice': self.voice_id})
|
||||
cursor += duration
|
||||
extent = max(extent, cursor)
|
||||
|
||||
Reference in New Issue
Block a user