@@ -1,9 +1,10 @@
|
||||
"""Compact reports of actual selected phrases, not duplicated draft ancestry."""
|
||||
import dataclasses, fractions, json
|
||||
import generator.solo.placement
|
||||
import generator.solo.harmonic
|
||||
import collections
|
||||
import generator.fretboard
|
||||
import dataclasses, fractions, json
|
||||
|
||||
import generator.solo.harmonic
|
||||
import generator.solo.placement
|
||||
import generator.vocabulary
|
||||
|
||||
def plain(value):
|
||||
if dataclasses.is_dataclass(value):
|
||||
@@ -16,8 +17,9 @@ def plain(value):
|
||||
return str(value)
|
||||
return value
|
||||
|
||||
def structure(solo):
|
||||
harmony = generator.solo.harmonic.Harmony(solo.harmony)
|
||||
def structure(solo, *, composition=None):
|
||||
composition = composition or generator.vocabulary.current()
|
||||
harmony = generator.solo.harmonic.Harmony(solo.harmony, composition=composition)
|
||||
contracts = tuple(c for p in solo.phrases for c in p.expressions)
|
||||
checked = harmony.evaluate(solo.notes(), until=solo.end, complete=True, expressions=contracts)
|
||||
phrases = []
|
||||
@@ -37,8 +39,9 @@ def structure(solo):
|
||||
'harmonic_roles': harmony.describe(ns, expressions=contracts), 'harmonic_policy': 'contextual (shared by authored and predicted music)', 'harmonic_valid': checked.valid, 'harmonic_error': checked.error,
|
||||
'harmonic_exposure': checked.exposure, 'unresolved_treatments': plain(checked.pending)}
|
||||
|
||||
def describe(solo, measure_offset=0, time_offset=0, *, detail=None):
|
||||
detail = detail or structure(solo)
|
||||
def describe(solo, measure_offset=0, time_offset=0, *, detail=None, composition=None):
|
||||
composition = composition or generator.vocabulary.current()
|
||||
detail = detail or structure(solo, composition=composition)
|
||||
lines = [f'{solo.diagnostics.get("construction", "solo")}: {solo.part}', 'Times are exact quarter beats from the chorus start; negative times are allocated lead-ins. Pitches sound one octave below guitar notation.',
|
||||
'Approximate fingering costs are not a biomechanical guarantee.', json.dumps(detail['phrasing'])]
|
||||
for p in solo.phrases:
|
||||
|
||||
Reference in New Issue
Block a user