+3
-3
@@ -142,13 +142,13 @@ Electric chord blocks use strings 1-3 or 1-4, including string 1. Rootless voici
|
||||
|
||||
`melody.py` treats the full tied duration as one note when testing whether it exceeds one quarter-note beat. Qualifying notes receive a chord at their initial attack and at each subsequent changed harmony, even if a resulting fragment is less than one beat. Changed harmonies break ties and reattack the melody; repeated identical harmonies do not. N.C. releases the added voices while preserving the melody's sustain. Added tones through unchanged harmony retain their own ties. The quarter-note cap on electric stabs does not apply to these melody chords. If no valid chord fits, the exact melody remains with a diagnostic; it is not octave-wrapped or omitted.
|
||||
|
||||
Placement uses the ordered `VoicingCost` components: electric string shortfall from four, melody covered, number of tones above the melody, physical effort, acoustic simplicity, and missing optional pitch classes. These costs accumulate over the whole passage, so movement cannot outweigh the earlier electric musical priorities. Melody height compares sounding pitch; unison doubling does not cover it. Electric accompaniment uses the same ranking without the melody-height terms. Acoustic does not receive electric fullness penalties: movement takes priority over simplicity, and a simpler three-note grip can beat an equally nearby but more awkward four-note grip.
|
||||
Placement uses the ordered `VoicingCost` components: electric string shortfall from four, melody covered, number of tones above the melody, combined physical effort, and missing optional pitch classes. These costs accumulate over the whole passage, so physical effort cannot outweigh the earlier electric musical priorities. Melody height compares sounding pitch; unison doubling does not cover it. Electric accompaniment uses the same ranking without the melody-height terms. Acoustic does not receive electric fullness penalties: a simpler three-note grip can beat a more awkward four-note grip. Shape difficulty competes directly with fret height and movement, not as a later tie-breaker.
|
||||
|
||||
`electric.py` links song accompaniment attacks to harmonized melody events using authored source positions, not displayed measure numbers or a song-wide chord dictionary. References stay inside the corresponding source harmony span and must match its structured chord. Within a span, an attack uses the latest available melody grip at or before its source position, or the first later grip if it precedes all melody chords. This allows different shapes for the same chord in different passages. After guitar placement and melody tie resolution, linked stabs copy the actual melody pitches and TAB positions while retaining their own IDs, timing, and written durations; melody ties and markings are not copied. A melody that remains a single note provides no grip. Passages without a matching playable three- or four-string melody chord, including altered endings without a corresponding reference, retain independently generated electric shapes. No reference metadata reaches runtime JSON.
|
||||
|
||||
Physical effort for generated electric chords is `movement + highest_fret + 2 * max(0, highest_fret - 12) + fret_span`. Exact, unharmonized melody placement retains its previous cost without the `highest_fret` term. Their movement metric remains the Manhattan distance between doubled fret/string position centers, with the exact small-grid distance transform used for independent attacks. Acoustic effort is `movement + highest_fret + 2 * max(0, highest_fret - 12)`, followed by a separate simplicity cost of `3 * fret_span + 2 * (distinct_frets - 1)`. Acoustic movement sums fret changes on retained strings plus one unit per added or released string; an unchanged position costs zero. Exact candidate-to-candidate dynamic programming retains all acoustic grips, including different grips with equal centers. This favors C7 at `5:10, 3:9, 2:11` after Gm7 at `5:10, 3:10, 2:11`, without a song-specific shape dictionary.
|
||||
Both generated chord profiles use the same shape-and-height cost: `highest_fret + 2 * max(0, highest_fret - 12) + 3 * fret_span + 2 * max(0, distinct_frets - 1)`. Electric adds its existing movement metric, the Manhattan distance between doubled fret/string position centers, with the exact small-grid distance transform used for independent attacks. Acoustic adds twice its per-string movement: fret changes on retained strings plus one unit per added or released string. The doubled weight balances transitions against shape difficulty so a lower isolated grip does not justify a large jump. An unchanged grip costs zero movement. Exact candidate-to-candidate dynamic programming retains all acoustic grips, including different grips with equal centers. Exact, unharmonized melody placement retains `movement + 2 * max(0, highest_fret - 12) + fret_span`.
|
||||
|
||||
Generated chord height contributes one point per fret throughout the allowed range. The shared `PREFERRED_MAX_FRET` remains 12, above which each excess fret adds two more points. Lower positions compete with movement and span costs rather than winning unconditionally; higher grips remain available when they reduce movement enough. Acoustic shape costs are charged once per harmony span, independent of rhythm density, and transitions compare complete grips rather than whichever lane last sounded. Pure melody tie continuations add no fresh shape or movement cost. There is no automatic octave fitting or finger-assignment model. Stable position ordering resolves equal costs.
|
||||
Generated chord height contributes one point per fret throughout the allowed range. The shared `PREFERRED_MAX_FRET` remains 12, above which each excess fret adds two more points. Compact mid-neck grips can beat stretched lower ones, while lower positions still win when shape difficulty and movement are comparable. Autumn Leaves begins with Em7b5 at `5:7, 4:8, 3:7, 2:8` and A7b9 at `5:7, 4:8, 3:6, 2:8`; the nearby C7 at `5:10, 3:9, 2:11` remains preferred after Gm7 at `5:10, 3:10, 2:11`. These are regression examples, not a song-specific shape dictionary. Acoustic shape costs are charged once per harmony span, independent of rhythm density, and transitions compare complete grips rather than whichever lane last sounded. Pure melody tie continuations add no fresh shape or movement cost. There is no automatic octave fitting or finger-assignment model. Stable position ordering resolves equal costs.
|
||||
|
||||
There is no finger assignment, barre logic, or predefined chord-shape dictionary. These are proximity and fretboard-feasibility constraints, not a guarantee of comfortable fingering. Nonstandard tuning, capos, microtonal frets, and unplayable passages fail with source/part/event context; there is no slash fallback for a failed chord. Existing assets remain untouched after failure.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user