Files
JIANT/docs/SAVE-SONG-AS.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

50 lines
2.8 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.
# Save a complete song
Based on the public V10.6c firmware (`d993eae82ff33ead15daf96f2de1d1779f275f8c`).
(V10.7.20: the SAVE SONG AS page is gone; **SAVE > PROJECT > PROJECTS** does its job.)
Open **SAVE > PROJECT > PROJECTS**. KNOB 1 picks the destination project without
opening it. KNOB 4 arms SAVE; OCT+ continues. A used destination asks **OVERWRITE
PROJECT n? / NEXT: K3 SONG OR LOOP**. Confirm with OCT+; on the NAME screen KNOB 3 chooses
SONG (everything below) or LOOP (the music now into A, B–D and the arrangement cleared),
type a name, then OCT+ saves. OCT- cancels either screen. Stop playback before saving.
The copy includes:
- Sections A–D, including the current section's unsaved edits.
- Current tempo and global settings, written into each section so loading A restores them.
- Arrangement rows, bar counts, END/repetitions, scenes, per-track source sections and variations.
- LOOP/SONG mode, restored when selecting the saved song. Previously saved projects keep their existing mode behavior.
The source stays open and unchanged. Open the destination in PROJECTS to use the copy.
The name belongs to section A, as with existing project names. If A is empty, the live
music supplies A. Sections absent from the source clear old destination sections using
CRC-protected zero-length storage records. Saved copies no longer carry GEN ownership
bits, protecting them from a subsequent generation.
No storage format sizes or flash regions change. The copy reuses existing stopped-song
and editor staging buffers. The audio ISR, DSP and USB input path are unchanged.
## Failure behavior
Preflight validates serialization and arrangement dependencies before any destination
write. Each section and the final index use the existing verified A/B storage writes.
An error is reported, the naming dialog remains open, and the source stays available
for a retry. An overwrite of all four sections plus index is **not atomic as a whole**:
power loss or a write failure midway can leave a partially replaced destination. The
original song is not erased or replaced by this command.
## Validation
`tests/persistence_test.c` includes `song_save_cases.h`: actual NOR storage, full reload,
unsaved C, global tempo, scenes/source/variation metadata, empty sections over old data,
invalid targets, pending PLAY, missing sections, erase failure and index-write failure.
`tests/ui_test.c` includes `song_save_ui_cases.h`. Build with `-DSONG_SAVE_ONLY` to run
the new controls, dialogs, cancellation, failed-save behavior and SAVE navigation.
The full pre-existing UI suite has unrelated failures on the V10.6c base; compare against
the unchanged source before attributing those failures to this feature.
The branch CI builds an FM-1 package and checks target flash/RAM/layout limits. It does
not deploy the public or beta installer. Hardware validation is still required.