Files
JIANT/docs/MODULATION-SONG-BETA.md
Claude 2346957d9f SAVE: the SAVE SONG AS page removed; PROJECTS saves, SONG / LOOP on the NAME screen
The owner's decision. SAVE has nine pages (TIMELINE PARTS CLIPS SECTIONS PROJECTS
ARRANGE TOOLS USER PRESETS); GR_SONGSAVE stays in the enum (append only), unused.

PROJECTS (SAVE > PROJECT):
- KNOB 1 picks a project and opens nothing (it opened the project); the tile
  picked is tinted and framed, the open one keeps its number lit. Entering the
  page picks the open project (a GENE draft: its destination).
- ERASE and SAVE act on the picked project; LOAD opens it (song_select) when it is
  not the open one, else loads the section as before.
- SAVE does what SAVE SONG AS did: STOP TO SAVE while playing, OVERWRITE PROJECT n?
  when the destination holds something (its second line "NEXT: K3 SONG OR LOOP"),
  then the NAME screen. It starts at SONG every time: a LOOP left chosen by the
  save before would clear B-D unasked.
- NAME for a song save: KNOB 3 right LOOP, left SONG; its third card says SCOPE,
  the title SAVE SONG / LOOP TO PROJECT n, the foot "NAME . K3 SONG/LOOP . OCT-
  CANCEL".
- GENE's SAVE tap opens PROJECTS with SAVE armed (it opened SAVE SONG AS).

Fixed on the way: graph_save_lz was left starting with "else"; the dead
GR_SONGSAVE tests in ui.c, ui_graph.c and ui_layer.c are gone.

Tests:
- song_save_ui_cases.h rewritten for PROJECTS: no SAVE SONG AS page, the pick
  opens nothing, empty destination names, occupied asks, cancel writes nothing, a
  failed save keeps NAME open, the open project is a destination, playing
  refuses, KNOB 3 on NAME switches SONG / LOOP, LOAD / ERASE on the pick.
- song_draft_test: a LOOP saved over a whole song elsewhere clears its B-D and
  its rows (on the flash model).
- ui_test: SAVE's chain of nine, 1/9; the project page (pick, then LOAD).
- The #63 soak failed with the new page order: not this change. Since V10.47 the
  roll, drawn after the cards, follows the playhead to another bar, and SEQ > BAR's
  card says it one frame later; the soak now skips the comparison on the frame
  the bar moved.
- song_generator_test: GENE's SAVE opens PROJECTS armed; the scope on NAME.

Docs: MANUAL.md / MANUAL.es.md (the chain, the page tables, the section "Saving a
whole song or a loop"), README, SAVE-SONG-AS.md, GENERATOR-DRAFT-SAVE.md,
MODULATION-SONG-BETA.md; cheat sheets generated and rendered.

Image: 3556 B free (456 B freed). RAM code headroom 2092 B.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KMHk6yH4XbP1xxHYKCo9Mh
2026-11-12 10:14:32 +00:00

86 lines
4.9 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ADD modulation and song beta
This candidate builds on the published VOICE/SPLIT ADD beta. It has no sampler.
Only the preview installer is intended to receive this candidate after target checks.
## Song generator
All three GEN pages display the actual arrangement when it exists: sections, bar lengths,
current row, remaining bars and play position. The display refreshes at bar
boundaries. A generated SONG can have 16- or 32-bar sections, so hearing the same
phrase for several bars does not itself mean the arranger is stuck.
SAVE from GEN opens PROJECTS with SAVE armed (V10.7.20; SAVE SONG AS until V10.7.19). Pick a destination project
(KNOB 1), OCT+, confirm an existing destination if needed, then on the NAME screen choose SONG or LOOP (KNOB 3) and name it. SONG copies sections A–D, arrangement,
scenes and per-track source/variation metadata. LOOP writes the current music to A,
clearing B–D and the arrangement at that destination. The current project can be
overwritten explicitly. Stop playback before saving.
GEN now uses a RAM draft; saved A–D no longer block generation. Subsequent
generations do not overwrite saved projects. MAKE during playback stops,
regenerates and resumes the new draft. Projects and individual sections can be
erased explicitly from SAVE. See [draft and save behavior](GENERATOR-DRAFT-SAVE.md)
for the complete flow and persistence limits.
Explicit SONG/LOOP mode is restored from the existing tagged project index field;
legacy projects without the tag retain their default behavior.
## Track envelopes in the matrix
New sources T1 ENV through T6 ENV measure each track's stereo audio amplitude.
For example, on T3 set SRC=T1 ENV, DST=F.CUT and a positive AMT: track 1 opens
track 3's filter. A negative AMT moves it in the opposite direction. LEVEL is
also available as a destination for cross-track level movement.
The follower reads the track after its local processing, including stereo IMAGE,
and approximates its output level using the smoothed end-of-block LEVEL/PAN
and duck gain. Shared effect returns and legacy direct INPUT fallback are not
included. An INPUT engine track is measured normally. Attack moves halfway to
its peak per block; release uses the input follower's smoothing with rounding
that reaches zero. Publication is one block late, making cross-track routes
independent of track rendering order and avoiding an instantaneous feedback loop.
Only requested source tracks receive a peak scan; engines are not rendered a
second time, and no audio buffers or voices are allocated. The added envelope
state uses approximately 28 bytes of static RAM. There are no hardware CPU
measurements yet. Existing source/destination IDs remain unchanged.
F.CUT controls the audible track filter (the ANALOG engine uses its dedicated
cutoff parameter). Existing CUT now reaches the track filter on WHEEL, DRUM-X,
STRING and INPUT, whose renderers did not consume the voice cutoff value.
Other engines keep their existing CUT behavior. INPUT's former FOLLOW source
is displayed as IN ENV to distinguish it from track envelopes.
## Additional fixes
- Inactive tracks no longer disable the direct STEMS+IN fallback merely because
their saved engine is INPUT; their master matrix routes are also ignored.
- ENV/ENV2 return zero for track/master routes when the owning voice has ended.
- INPUT meters and envelopes decay fully to zero.
- The matrix graph shows the source beside each of its four routes, keeping all
sources selectable without trying to stack 24 source labels on the screen.
- Loading a project clears previous track envelope state.
Decorative pseudo-note previews are replaced by real stored sections or the
actual arrangement on every GEN page, without removing sound controls.
No existing matrix source was removed. No new step-component opcode is added:
the existing component encoding is full. Resonance was not appended as a matrix
destination because the existing 32-bit destination masks are now full.
## Validation
Host checks cover generated parts across 45 genre choices, traversal through all
six arrangement rows and wrap, real playhead invalidation, SAVE entry, regeneration
during playback and saved playback mode. Separate NOR/persistence tests cover both
save scopes, draft preservation, failure/retry, erase and round-tripping matrix IDs.
The matrix tests cover inactive INPUT, ended FM6 ENV2, cutoff mappings, restored
parameters, silent tracks, opposite-polarity stereo signals, one-block snapshots,
release to zero and demand-driven scanning. An AddressSanitizer/bounds sweep
completed 11,408 valid source/destination configurations across 16 engines.
The full UI suite is compared against the same pre-split baseline rather than
claiming its existing 18 failures are fixed. The generator's existing audio
balance test failure was also reproduced on the baseline. Target memory, layout,
RAM-call reach and package checks must pass before the beta is published.