This commit is contained in:
khodowany
2026-10-03 12:44:53 -05:00
parent 59afd78205
commit 04c6ea2e00
25 changed files with 673 additions and 185 deletions
+3 -1
View File
@@ -5,6 +5,7 @@ import fractions
import time
import generator.solo.enclosures
import generator.solo.profiles
import generator.fretboard
import generator.harmony
@@ -129,10 +130,11 @@ def choose_phrases(plans, realize, revise_pair=None):
def validate(solo):
previous = None
profile = solo.profile or generator.solo.profiles.for_part(solo.part)
for note in solo.notes():
if note.start < 0 or note.end > solo.end or note.end <= note.start or previous and previous.end > note.start:
raise ValueError(f'{solo.part} solo: overlapping or out-of-bounds note at {note.start}')
if note.position not in generator.fretboard.single_positions_for_pitch(fractions.Fraction(note.pitch.number())):
if note.position not in generator.solo.placement.positions(note.pitch.number(), profile):
raise ValueError(f'{solo.part} solo: invalid guitar placement at {note.start}')
previous = note
for phrase in solo.phrases: