12 KiB
12 KiB
Step 12 — COMPLETE: exact rational beat scheduling, triplets and cross-bar PH
Date: 2026-10-20
Implemented
- Added reusable strict TimedNote/PhrasePlan models with reduced rational start,
positive duration, per-note technique and optional finite intensity. Plans
enforce ordering, nonoverlap, part coverage, score length and event budgets.
They are internal composition models, not a new public score tool.
- Added bounded clause parsing, not a whole-string prompt match or canned riff:
[chugging] palm mute/muted/muting eighth/8th [notes] from X to Y;
triplets on B&A with the A as a pinch harmonic that carries over a whole note
in the second/2nd measure.
X/Y are inclusive beats 1-4 with optional &, B is a beat 1-4.
Spacing around &, supported palm/pinch hyphens, Em/full E minor and F#m work.
- Generic phrase composition applies actual rational note timing, technique,
seeded or explicit intensity, low-tonic pitch policy and profile validation.
The typed composer also passes an independently authored 3/4 bass schedule
with mixed normal/PM durations, demonstrating reuse beyond this text phrase.
- Added only AME pinch_harmonic/PH, keyswitch31 and native Articulation="PH".
AME product 4.0.1 and production ID ample.ame.4.0.1.riffer.v1 are retained;
mapping_version is riffer-subset-2. XML layout remains 2.1/native PPQ480.
Ray, SD3 and Standard MIDI profiles have NOT gained PH.
- Updated supported-text guidance shared by errors, tool descriptions and
request schema; README, architecture and articulation-profile documentation.
Complete safe JSON remains identical in TextContent and structuredContent.
Before / after grammar
- Before: description Em shorthand, from/to timing clauses and triplets/PH
could not express this request. The blanket changes/sequences guard rejected
temporal clauses; the ordinary template could not represent mixed durations
or a per-note cross-bar PH.
- After: complete recognized range/hold clauses are consumed before that guard.
Numeric positions produce the plan mathematically. Unrelated from/to tempo
changes, then/sequences, unsupported prose and embellishments still fail.
Existing simple global templates use the original composition path.
- Exact original wording is sent verbatim through real source stdio and a fresh
noneditable installed wheel, with only basename and allow_midi_fallback=false.
Formats/profiles/key/tempo/parts are NOT supplied as corrective overrides.
Both return complete success with automatic mid+griff, lead only, E minor,
the real default AME ID and no fallback or drum project.
Returned assumptions
- A is the final eighth-triplet COUNT, not an A-pitch instruction.
- The PH is one continuous note through ALL of measure 2, without retrigger.
- Low tonic nearest MIDI40 within selected profile range/tuning; default Em
produces E2/MIDI40 for every musical note, including the PH.
- Tempo omitted: documented 120 quarter-note BPM.
- Length omitted: the hold implies two bars, eight quarter beats.
There are no invented melodies, transpositions, CC91 or effects.
Exact observed acceptance, independently parsed from saved files
All musical notes: MIDI pitch40; native string6, fret4.
Index Technique MIDI960 on/off Native480 Begin/End Velocity
1 PM 0 / 480 0 / 240 80
2 PM 480 / 960 240 / 480 80
3 PM 960 / 1440 480 / 720 64
4 PM 1440 / 1920 720 / 960 80
5 PM 1920 / 2400 960 / 1200 96
6 PM 2400 / 2880 1200 / 1440 80
7 PM 2880 / 3200 1440 / 1600 80
8 PM 3200 / 3520 1600 / 1760 80
9 PH 3520 / 7680 1760 / 3840 80
- Six durations 1/2, then two durations 1/3, then PH duration 13/3 quarter beats.
No rounding: MIDI durations 480 x6, 320 x2, 4160; native exactly half.
- Exactly nine musical note-ons: eight PM plus one PH. No musical onset at
MIDI3840/native1920; no split, second-measure attack or bar-boundary retrigger.
- MIDI selectors: PM=D0/26 on0/off30; PH=G0/31 on3520/off3550; velocity100.
Selector-before-musical-note ordering is independently checked.
Zero lead, 1/32-quarter positive pulse gates, channel0, latched state and
interpolation are explicit generator POLICY, not vendor timing guarantees.
Total MIDI note-ons = 11 including two switches, not eleven musical notes.
- MIDI type1, PPQ960, Conductor/Lead tracks, 120 BPM, 4/4, common EOT7680.
Existing writer does not emit a key-signature meta event; E minor is verified
in resolved metadata/native key Em and actual low-tonic pitch40.
- Native Riff XML: AME, PPQBase480, Measures2, 4/4, loopEnd3840, Key Em;
eight actual PM labels and one actual PH label. Final End3840.
- Zero MIDI CC events, zero program changes and no fabricated native CC lane.
Existing native ccName metadata is not a generated CC event.
- Native saved-file validator is also run against the requested typed score
and compiled events, in addition to independent Mido/XML numeric assertions.
Source and installed-wheel output bytes are identical
phrase-original.mid: 168 bytes
SHA256 c1967e698a50b8c22a22e458c3e2dd02d04407d1ad1d61f8a462d790b0810e62
phrase-original_lead.griff: 1701 bytes
SHA256 e8195e74c60ac93b1a4c92967a0834a64b2a2ebd74f453d6d3640ea465c4104c
Persistent ORIGINAL authored acceptance evidence only under:
.test-artifacts\step12\source\
.test-artifacts\step12\installed-wheel\
Each contains the original MIDI/griff and independently checked evidence.json.
Full final suite output: .test-artifacts\step12\full-suite.txt.
No requested riff was published outside test artifacts.
Nearby variants / invalid requests
- Original with 1-to-3& changed to 2-to-3& works through BOTH real transports.
Musical starts: 960,1440,1920,2400,2880,3200,3520; PH still ends7680.
Four straight PM eighths, two PM triplets and one continuous PH: seven notes.
- Another unit variant changes range to 1-to-2& and triplets to beat3.
Starts: 0,1/2,1,3/2,2,7/3,8/3; final duration16/3, end8.
This independently demonstrates computed range and triplet positions.
- Overlapping 1-to-4 range and a one-bar score return UNSUPPORTED_DESCRIPTION
on source and wheel, without publishing directories or leaving owned stages.
- Tests reject reversed/out-of-bar labels, extra &, fractional beat labels,
duplicate clauses, invalid meter, too-short explicit length, other parts,
unsupported techniques/prose and unrelated tempo changes.
- Explicit longer scores keep the phrase ONCE with trailing silence.
Structured scalar overrides cannot erase notes or invalidate the hold.
Native PH evidence verified before declaring support
- Read-only AME.vst3 ProductVersion check: 4.0.1.
- Read-only aggregate of 35 local .griff files under the requested AME Presets
folder: 17 genuine Articulation PH notes, velocities80-100, NoteID49-73.
Those observations establish encoding, NOT hard PH pitch/velocity limits.
No factory sequences, filenames, assets or manual copies entered source,
tests, retained artifacts or external uploads.
- Official https://www.amplesound.net/en/Main_Panel_Manual-AME.pdf was fetched
and parsed entirely in memory with the already installed pypdf.
Page6 section2.2.1 lists PH: G0, C1-C5; page9 section2.2.9 confirms G0.
Established vendor octave mapping C0=24 gives G0=31 and C1-C5=36-84.
Thus generated E2/MIDI40 is within documented PH range even though below
the local factory aggregate's observed pitch minimum49.
- PH uses dedicated G0/31, NOT normal-C0 velocity127 or a softer PM substitute.
Positive musical velocities1-127 and interpolation are declared generator
policy, not invented vendor PH layers or factory-observed hard bounds.
Native guards reject wrong PH switch/label, arbitrary labels and bass PH.
Preservation / safety
- Step11's simple lead quarter-note recovery remains BYTE-identical:
MIDI SHA256 922d4c30e4618b6cce61a2ecebb36193773ca3884e56db80f7c18fe18e813f26
griff SHA256 213adde1c4785dccd2289e6888328c16bca720fb8d2786edb4df34f3863d1c2f
Both source and wheel tests assert these previously recorded baselines.
- Ordinary defaults/patterns, strict request/private feedback, integer/finite
checks, profile identity/ranges, string assignment, shared duration, stable
ordering and source/installed discovery regressions pass unchanged.
- Explicit CC1/CC91 on the held phrase survives the compiler exactly as asked;
it is never inferred, silently removed or reset. Existing native CC limits,
fallback=false failures, combined event budget and atomic/root safety tests
continue to pass. Unrequested original acceptance contains no controls.
- Both note-pair and compiler budgets (including switch events) are tested.
Mutated invalid plans/profiles fail defensively rather than approximating.
- No dependency manifests changed, no new dependencies were installed.
Existing distribution tests build/install the requested project wheel
noneditably and verify all 16 module origins outside the source checkout.
Executed final validation
Interpreter: repository .venv, Python3.13.13.
1. Focused parser/composer/Riffer/phrase source-stdio command:
python -m pytest tests\unit\test_phrase_timing.py
tests\unit\test_description.py tests\unit\test_compose.py
tests\unit\test_riffer.py tests\integration\test_phrase_stdio.py -q
PASS: 286 tests in 2.99s.
2. Complete current suite: python -m pytest -q
PASS: 1502 tests in 63.15s; no failures/skips.
Includes real source and noneditable installed-wheel stdio, actual saved
MIDI/native comparisons, private errors, explicit CC and atomicity tests.
The expanded installed native process has 23 expected protocol stdout lines,
exits0, and has empty diagnostics; source phrase also exits0/empty stderr.
3. python -m ruff check src tests: PASS, all checks passed.
4. python -m ruff format --check src tests: PASS, 50 files already formatted.
5. python -m mypy src tests --strict: PASS, 50 source files, no issues.
6. python -m pip check: PASS, no broken requirements.
7. Editor diagnostics for changed source/new tests: no errors.
8. git diff --check: PASS.
9. Retained source/wheel evidence JSON and actual file hashes were independently
compared and are identical.
Issues encountered and resolved
- Test discovery tool reported no discovered tests; actual pytest CLI runs
supplied all focused/full validation, not a claim based on editor discovery.
- Initial precise-parser test caught acceptance of an extra &, due to existing
separator policy. Tightened the numeric range boundary; rejection now passes.
- Initial register field name shadowed a Pydantic base attribute; renamed it
register_policy. No runtime warning remains.
- New independent tests initially assumed omitted null profile fields and an
existing MIDI key-signature event. Corrected those test assumptions to the
actual preserved contract; no unrelated writer/protocol change was made.
- Initial format checks identified long/new expressions; final format/lint and
strict type checks are clean. No unresolved implementation blocker.
Unsupported limits / readiness
The expanded text grammar remains deliberately bounded to the documented
lead-only 4/4 range-plus-triplet/cross-bar-PH phrase. It is NOT arbitrary
melodies, sections, arbitrary triplet prose, tempo/meter changes, legato or
effects; no bass/drum/standard PH support is implied. Saved-file/software
validation does not claim audible plugin/Cubase/DAW acceptance.
Ready for review and the next authorized step. Stopped here: no commits,
delegation, later prompts, LM Studio data/configuration, app/UI manipulation
or DAW edits. Pre-existing accepted Step11 work has been preserved.