This commit is contained in:
khodowany
2026-10-02 00:35:31 -05:00
parent f2f371b951
commit a0bd19b3ba
25 changed files with 1421 additions and 586 deletions
+11 -9
View File
@@ -95,23 +95,25 @@ Uncompressed MusicXML 3.1/4.0 scores exported from Soundslice or MuseScore live
`data/songs` supplies the authored music. `data/rhythms/<meter>/<series>/` supplies the accompaniment rhythm library for 2/4, 3/4, 4/4, and 5/4. All three series are active: the original quarter/eighth patterns plus series `3` with half, dotted-half, and whole notes/rests. Rhythm snippets are build inputs, not separate catalog entries or runtime files. Generation loads the library once and shares it across parts.
`data/scales` supplies the 21 C-centered modes of major, melodic minor, and harmonic minor. The Python build uses these collections, the song melody, the accepted paired pitch/rhythm references in `data/lead_phrases`, `data/sequences`, and `data/rhythms` to compose acoustic and electric solos with transformed motifs, connected melodic lines, varying activity, sustained arrivals, and planned space. A passage plan groups roughly four to eight bars, connects opening, intermediate and terminal chord-tone anchors, and carries realized motif identity across smaller search cells and phrase boundaries. A bounded search considers the next phrase before committing. Exact quotation is available but is no longer the default. The other guitar provides solo-aware accompaniment. Scale changes appear above the solo notation and TAB; detailed build-only phrase reports live in `generated_assets/analysis/`. No solo assignments are stored in song XML. Invalid patterns or a harmony without an exact permitted scale fail before replacing the previous output.
`data/scales` supplies the 21 C-centered modes of major, melodic minor, and harmonic minor. Build-time Python uses each song's actual melody, its mapped harmony, `data/sequences`, and `data/rhythms` to compose recognizable acoustic and electric variations. The standalone `data/lead_phrases` material is an audition control, not a production seed. No solo assignments are stored in song XML, and the runtime format is unchanged.
Solo harmonic function is distinct from scale permission. Basic members respect the chord's suspensions, alterations and omissions; symbol-specified extensions require a planned color when sustained, and a non-chord slash bass is not automatically a melodic destination. Ordinary notes lasting two quarter-note beats or longer must remain chord members across every overlapping chord, even when the scale stays unchanged. Short scale motion remains available. A prepared suspension must resolve by the planned deadline to an adjacent chord member. These checks operate on complete sounding events, so notation ties do not change harmonic treatment or attack counts. Protected quotations keep their musical content and report exposed tensions.
Source analysis retains complete sounding notes, rests, pickups and cross-bar holds. Production uses **thematic recomposition**: a short rhythm, contour, opening, or characteristic interval from the head initializes a new solo theme. Later phrases develop that realization through harmonic adaptation, extension, answers, or optional brief callbacks. Each instrument establishes a distinct related theme instead of restarting from the corresponding head phrase at every source boundary. Close paraphrase remains available through `composer.compose(..., mode='paraphrase')` for comparison.
Ordinary solos now start from complete paired lead ideas. Up to twelve rhythm/interval identities and two harmonic realizations per identity produce complete four-to-eight-bar candidates. The candidate contains a statement, a recognizable return with the same timing, development, and a real ending. Four-bar passages remain common; a longer thought uses the existing extended-phrase representation. Each small pitch search compares complete timed figures from a fixed pitch origin, so correcting one note does not shift the rest of the idea. The return is checked against the statement actually heard, including every identifying interval and duration. Later passages can recall that realized identity or deliberately contrast. Head-based treatments and exact quotation remain available through their explicit contracts.
Treatment-specific contracts preserve the selected features only. Whole-source deviation applies to close paraphrase, including sounding durations; it does not penalize recomposition for changing unrelated notes. Before optional runs, realized pitch/time overlap and interval/rhythm fragments reject substantial near-copies (initial settings: 80% agreement across a two-bar window with at least four source attacks). Octave shifts, reattacks and extra attacks cannot dilute the duration comparison. Additional distance earns no bonus. The original source reference and the solo's realized theme remain separate in state and reports.
Ordinary intermediate anchors are selected from the resulting melody rather than inserted over its rhythm. All sustained sounds still receive chord-by-chord harmonic validation. Complete melody alternatives compete before elaboration, and their unornamented score controls selection: a run cannot rescue a weak theme. Both guitars use a broad activity range of 4–6 attacks per four beats across the passage, with quiet bars and busier runs allowed. Active occupancy between 85% and 100% has no penalty; deliberate breaths and missing harmony remain space. Activity never automatically diminishes or broadens an identifying rhythm. These are audition settings, not a musical-quality claim.
Scale permission and chord function remain distinct. Every generated sound must belong to all mapped collections it overlaps. Added chromatic substitutions and their validation exception have been removed; mapped accidentals such as C-sharp in D harmonic minor remain valid. Basic chord members respect suspensions, alterations and omissions; slash-bass requirements do not automatically become melodic targets. Ordinary sounds lasting at least two quarter-note beats must remain chord members across every overlapping chord, unless an explicit valid color or prepared suspension applies. Tied notation is merged before evaluation. Terminal anchors must actually complete, and protected quotations retain their contracts.
Selected figures, their recognizable returns, quotations, and committed arrivals survive elaboration. `data/sequences` supplies complete optional approaches to the tune's destinations using exact octave-aware scale indices. A route retains its timing, pitches, and endpoint across collection changes; an invalid route is rejected as a whole. The existing bounded elaborator and guitar placement remain in use. The plain lead, diatonic elaboration, and final chromatic version share the same underlying melody. The runtime representation, constant playback treatment, frets 1–12, returning vocal pickup, and arrangement-wide measure numbering are unchanged.
Rhythm snippets and complete interval routes realize one- or two-bar edits jointly with chord-tone destinations. Routes retain their entry, complete timing, pitch path and arrival across barlines and collection changes. Later candidates receive the incoming note, position and realized theme before pitch generation. Run entries may extend an existing note without reattack. Intermediate arrivals continue the thought; the final destination has a closed-ending contract. Missing harmony creates explicit silence while preserving thematic memory. Short fragments around missing harmony are explicitly reduced and do not claim full motif fidelity.
Light chromaticism is an explicit exception to scale permission, not a new collection. An unprotected offbeat eighth note may approach the next attacked chord member by one semitone, without a gap. It cannot span a harmonic boundary itself, but its resolution may enter the next chord. The actual pitch, event identity, duration, resolution, and deadline must all validate. No chromatic hold, unresolved approach, missing-harmony exception, or change to a quotation is permitted. The budget is at most four per eight bars, spaced at least two bars apart and at most one per route; unsuitable sites are left diatonic. Approach spelling prefers ordinary accidentals over avoidable double accidentals. The existing suspension/color contracts remain separate.
The plain recomposed theme is exported independently of optional runs. Activity retains a soft 4–6 attacks-per-four-beats preference; occupancy remains diagnostic. No accents, dynamics, swing or other performance-expression changes are applied.
For reproducible listening comparisons, `python -m generator.solo.audition --output build/solo_passage_auditions --capture before` captures the previous implementation; run the corresponding `--capture after` after changing the engine, then `--render`. Use the repository's pinned Python runner. The output includes full solos, opening eight-bar and closing four-bar excerpts, MusicXML, passage reports and structured diagnostics. Fixed-backing comparisons keep the original accompaniment; responsive comparisons use the newly arranged accompaniment. These build-only tools do not add runtime data or playback expression.
Search retains eight phrase alternatives and an eight-state chorus frontier, with two intermediate continuations per established theme. Up to 64 acoustic/electric pairs compete; equivalent themes after transposition are excluded while individual musical costs and pair similarity remain separate. Concrete caches include incoming state, harmony, timing and vocabulary. One bounded replan broadens eligible start and destination pitches. Exhaustion identifies the failed window without invoking a generic composer. Stable ordering and final tie-breaking preserve determinism.
The earlier phrase-draft experiments remain available for investigating the legacy motif/quotation path. Use the lead-melody comparison below for the current production constructor.
Phrase register alternatives cover the available F2–E5 sounding range. Placement uses all six strings, frets 1–12 without open notes, with a four-fret hand-position model and alternative endpoint fingerings. Movement costs use available time; they do not claim a maximum playable speed. Equal-cost tie-breaking has no first-string preference. Chords elsewhere retain their existing 1–12 anchor policy. The other guitarist is recomposed around the selected foreground, and the returning vocal pickup remains protected.
For lead-melody comparisons, preserve the old generator with `python -m generator.solo.audition --output build/solo_lead_melody_auditions --capture baseline`, then use `python -m generator.solo.lead_audition --capture` and `--render`. Open `build/solo_lead_melody_auditions/index.html` to compare baseline, plain lead, diatonic runs, and chromatic approaches with fixed backing or alone. The final version also has responsive accompaniment. Intermediate exports follow the selected production branches, not independent searches. Literal reference controls verify exact sounding notes through validation, guitar placement, notation, and playback. Reports identify the selected idea, return correspondence, complete routes, chromatic resolutions, harmonic exposure, activity, and occupancy. Listen for a tune whose identity survives its ornamentation; metrics alone do not establish musical improvement. The original temporary archive lives in ignored `build/lead_melody_reference.zip`; builds use the tracked structured reference and never execute the archive's script.
Build reports in `generated_assets/analysis/` include selected source features, recurring solo themes, development lineage, anchors, complete routes, plain-versus-head and elaborated-versus-head comparisons, and candidate diagnostics. Audition reports additionally show string use weighted by sounding duration and distinguish forced first-string notes from optional placements. These measurements establish technical behavior, not musical quality.
For comparisons, preserve the previous `elaborated/snapshot.json` under `build/solo_melody_auditions/paraphrase_baseline/`, then run `./modulus.py python -m generator.solo.lead_audition --capture` and `--render`. Open `build/solo_melody_auditions/index.html` for the original source, previous close paraphrase, new theme and theme with runs, alone and with fixed backing. Full final mixes also use responsive accompaniment. Source controls preserve the imported melody and may expose original harmonic tensions; production variations must pass strict validation. The temporary reference archive remains ignored at `build/lead_melody_reference.zip`.
To inspect generated assets without building the full package, run: