Skip to content

Songbook 0.2.0-experimental: setlists - #2431

Open
Andrey-Sidorkin wants to merge 107 commits into
repeat98:mainfrom
Andrey-Sidorkin:module/songbook-setlists
Open

Andrey-Sidorkin wants to merge 107 commits into
repeat98:mainfrom
Andrey-Sidorkin:module/songbook-setlists

Conversation

@Andrey-Sidorkin

@Andrey-Sidorkin Andrey-Sidorkin commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Songbook 0.2.0-experimental: setlists. An update of my own module (0.1.0 in #2116). The package is e06c9f98…, byte for byte the build kept and checked on my MKI.

What changes for players: in the arranger menu, SETLSTS holds 16 setlists of up to 16 songs taken from any book. A setlist plays its songs one after another without a gap and passes over empty ones. CUE + YES in BOOKS (was CHANGE) adds the song under the cursor. While a setlist plays, the main screen shows it and the song's whole name, and CUE + YES picks the next song (never the one playing). Trig keys pick the book in BOOKS and the setlist in SETLSTS, and the lit trig shows the one in use. After LOAD, RELOAD or a power cycle the project comes back into its setlist, on the song it was on, at its first row.

Who must act: the owner. The update names new stock addresses (the setlist hooks and the main screen's name bar), so the release bot leaves it for owner review.

Tested on a unit: package e06c9f98668142f1b1ff79b2501c124ebcb30b0dd8832c79de95ba0dce736bfa (source 3a0b10d), MKI (OS 1.40C). test:procedure songbook on a development twin 46c30886 of base 0.8.2: steps 1-10 passed (emulator rehearsal, scripted pass, 90 s soak, cost at rest 0, put back). The developer's stage was done on the flashed base 0.8.2: the setlist features on 8f9c50a6 kept beside Arr Rows and Smart Reload, the slot 7/8 cases and the update from 0.1.0 on this package.

Details
  • songbook.c / songbook_core.s / manifest.py: setlists (SL slots 7-8 hold the current and next song), the SETLSTS page, the chain, CUE + YES in BOOKS and on the main screen, trig choice with a time debounce and stock's trig lights saved and given back, and the setlist box hidden over stock's messages and in pattern mode.
  • On the main screen in a setlist: the position counter's format is emptied and the arrangement-name bar runs to the screen's edge, with stock's 11-letter limit raised to 16. These are three new stand-ins on stock's name-bar calls (0x4003cf16/0x4003d002 fill, 0x4003cf48 fit, 0x4003cf6e text).
  • The return after a power cycle relies on base 0.8.1+, which brings the module up before stock touches the slots. The setlist then starts at its first row (it showed END OF ARR before).
  • songbook_host.c: 250 checks pass (new: a 0.8.1 power cycle with a matching fingerprint, the recorder's other buffer, the box over a message and in pattern mode, the trig choice and the two-press guard).
  • tests.qualification was written by module:qualify from the procedure's record, and the drafted texts were edited by hand. Memory is 25,816 bytes of code and data and 100,756 of bss (90,432 of it the setlist's 16 song blocks). evidence/performance.json: book 1 to 2 costs 13,941,677 executed ColdFire instructions under ot_emu on the 0.8.2 twin (budget 26.6 M), and a 20-cycle stress run had no hang. resources.cpuPrice is 0.
  • Release notes are the 0.2.0 entry in src/community/module-changelogs/songbook.json. The new thumbnail shows books, trigs and a setlist. The catalog pin and the USB package moved to 0.2.0, and the 0.1.0 package was removed.
  • Not run: MKII; MIDI program changes landing during the soak (the project's receive was off).
  • After the owner's review: the book's own arrangements 7 and 8 are backed up to arrNN.sl before a setlist borrows their slots; arrlend.work notes what the setlist's copies look like, and a slot comes back from the backup only while it still holds such a copy (newer work saved there is kept; a note left for another book is repaired first); while lent, slots 7 and 8 are never written to a book (the mid-load save included); ARR > BOOKS names rows 7 and 8 by the book's own arrangements (a new stand-in on 0x40036e62). The once-seen copies in book 2's slots 7-8 stay unexplained, but every path found is closed or backed up.

Edge cases

Case Why this change makes it a risk How run Result
Power cycle in a setlist the slots hold setlist copies when stock loads the developer's MKI, bases 0.8.1 and 0.8.2 back in the setlist on its song, at the first row
LOAD and RELOAD in a setlist stock reloads the slots the developer's MKI back in the setlist
Empty songs, one or several in a row an empty arrangement stopped playback the developer's MKI passed over
Trig keys, two pressed together; NO with the list open a held trig and the LEDs are stock's too the developer's MKI picks the book or setlist, two together ignored, stock's lights back
CUE + YES quick menu it could pick the playing song the developer's MKI never offered
Stock messages (DISARM ALL), pattern mode the box drew over them the developer's MKI box hidden
Main-screen name, 12 and 16 letters the counter's room and stock's 11-letter limit the developer's MKI (12), ot_emu on 0.7.13 and 0.8.2 (16) whole name, no counter
Beside Arr Rows and Smart Reload, kept one package alone replaces the set the developer's MKI all three run
Recorder's other buffer while a song changes the stop check read one buffer host gate passes
Setlist copies in book 2's slots 7-8 the copies live in slots 7-8 reported once not reproduced, open
A power cycle in a setlist, then SAVE PROJECT with 0.1.0 kept stock saves what its slots hold the developer's MKI arrangements 7 and 8 intact
Stock alone saved the copies over 7 and 8 the module was not there host gate put back from arrNN.sl once installed again
Update in place from 0.1.0 on book 2 0.1.0's record and place file the developer's MKI, ot_emu book 2 and its arrangements kept
ARR > BOOKS during a setlist it showed the copies the developer's MKI the book's own names
Arrangement 7 edited and saved without the module, then Songbook again the backup must not win over newer work host gate the edit kept
A note never given back, then a setlist on another book the new note dropped the old backup host gate the old book repaired first
MKII another panel none not run: no MKII

What the guides lacked or got wrong: OCTATRACK_DRIVING.md did not say that a kept try --accept from one session replaces the set another session kept. Here that hid a fix for an hour, because the unit ran no Songbook at all. The sentence goes in its own Docs: pull request (a module release carries no guide edit).

🤖 Generated with Claude Code

Сидоркін Андрій Володимирович and others added 30 commits November 23, 2026 10:53
…dds, CUE + LEFT/RIGHT moves an arrangement in its book

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ANGE

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… item and opens the setlist page

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	sdk/drafts/songbook/songbook_core.s
…dits saved to each song's file at the end

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	sdk/drafts/songbook/songbook_core.s
…er the corrected writer model

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t ends on a HALT, the chain row reads NEXT SONG

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…et, so the rows show NEXT SONG

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, or the arrangement chosen

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… setlists are read by a card job before they are shown or added to

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… compiled to memcpy); the generated unit current again

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rawn again (stock's arranger event), the end is LIST END

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s chosen again

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…o, so a layout change always starts afresh

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…is read again and none of slots 7 and 8 written

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ement (no chain, no HALT arrangement)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… stock's shared "%d" (it emptied the tempo, MIDI channel and bank numbers)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ooses the next song; copy and paste songs and setlists on the page

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…N a cursor, YES moves the next-song mark to it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ther YES moves the next-song mark (CUE + NO stays stock's DISARM ALL)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…change while it is open

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…(SymbolRefs on stock's two pea operands); writing into a declared poke had left every later install refused as busy

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… song next at once; releasing CUE only closes it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…me editor; arrlists.work ASL2, ASSL still read); the main screen marks a playing setlist

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…box's free line, off the arrangement rows

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pattern line under the Part box

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rst line; the pattern line stays stock's

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

repeat98 commented Dec 1, 2026

Copy link
Copy Markdown
Owner

Hi Andrey, while we talk about this update on Discord, here's what I found in the code and the test record, so it can move as soon as we've spoken.

What works: setlists play gapless on your MKI. They come back after LOAD, RELOAD and a power cycle. The test procedure passed on the exact package (8f9c50a6), and it runs kept beside Arr Rows and Smart Reload. The checks are green.

What stops it for now: someone's own songs could get overwritten. Setlists borrow the open book's arrangements 7 and 8, and this branch already fixed two ways that wrote setlist copies into a book. The third (copies seen in book 2's slots 7 and 8) is still open with no known cause. An update goes out to everyone who has Songbook, so I can't release it while that's unexplained.

Could you do these in one go:

  1. The open slot 7/8 report. Please find the cause, or make sure it can't cost anyone their arrangements. One way: back up arrangements 7 and 8 before a setlist borrows them, like book 1's .bak. Then add the result to the edge-case table.
  2. Two cases for people coming from 0.1.0, run on this package and added to the table:
    • Update in place from Songbook 0.1.0 with a project left on a book other than 1. Do the book and its arrangements come through?
    • A trial (not kept) ended by a power cycle while a setlist is playing, then SAVE PROJECT or SYNC TO CARD on the stock OS. Are that book's arrangements 7 and 8 intact? A power cycle is how a trial is undone, so nobody gets the chance to "end the setlist first", as the README asks.
  3. compatibility.uiClaims: 0.2.0 now also takes over the main screen's arrangement name bar and the position counter next to it (as_head_*, as_count_fmt, as_pos_fill). Please add a claim for them, so the configurator can warn if another module draws there.
  4. Small fixes: the first limitation (and proof_note in manifest.py) still names builds b976e98ff/7a53e26af on base 0.7.13. Please point them at the build in the record.
  5. Refresh: the branch conflicts with main again, in the generated src/engine/assets/module-build.json. Please merge main (merge, not rebase), regenerate rather than editing it by hand, run npm run pr:ready and push.

Thanks, and see you on Discord.


Generated by Claude Code

Сидоркін Андрій Володимирович and others added 16 commits December 1, 2026 08:23
…lists

# Conflicts:
#	src/engine/assets/module-build.json
…ws them (arrNN.sl) and given back from there; slots 7 and 8 never written to a book while lent; UI claims for the main screen's name bar and position; build references (owner's review)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… 7/8 backup)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s arrbook.work after a power cycle), host gate 257 checks

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ok switch 13.85 M instructions, 20-cycle stress)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…c1d4549

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ngements while a setlist borrows their slots (developer's request)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…3.81 M instructions)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dure steps 1-10 on the MKI, the slot 7/8 cases)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nchanged)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…loper's MKI

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Andrey-Sidorkin

Copy link
Copy Markdown
Contributor Author

Thanks, Jannik. All five are done. The package is now c8eb7186, and test:procedure steps 1-10 passed on it on my MKI (base 0.8.2 twin).

1. Slots 7 and 8. Your backup idea is built in. Before a setlist borrows slots 7 and 8, the module copies the book's own arrangements 7 and 8 to arrNN.sl and notes this in arrlend.work. Whenever it gives the slots back (the setlist ends, a load, a reload, a reinstall or a power cycle), it reads 7 and 8 from that backup and writes them to arrNN.work too. The note is a file of its own, because 0.1.0 rewrites arrbook.work after a power cycle. Also, while the record says the slots are lent, nothing writes slots 7 and 8 to a book's files: write_book, write_changed and stock's writer (bits 6 and 7 come off its mask) all skip them. That includes the save stock makes inside a LOAD, which was the one path I found that could have put copies into a book. I still can't reproduce the original report, so its exact cause stays open, but every path I know of is now closed or backed up. On my request while testing, ARR > BOOKS now also names rows 7 and 8 by the book's own arrangements while a setlist plays.

2. Coming from 0.1.0.

  • Update in place on book 2: on my MKI (flashed 0.8.2) I kept 0.1.0 on book 2 with a named arrangement, then kept Arr Rows, Smart Reload and Songbook c8eb7186. It stayed on book 2 with its arrangements, and book 2 → 1 → 2 and a power cycle kept them. The same run in ot_emu on the 0.8.2 twin passed too.
  • Trial ended by a power cycle while a setlist played, then SAVE PROJECT: on my MKI with 0.1.0 kept and book 1's 7 and 8 named SEVEN and EIGHT. After the power cycle the slots showed the setlist copies until the project loaded, then SEVEN and EIGHT, and the save kept them. Nothing was lost. If stock alone ever does save the copies, reinstalling Songbook puts 7 and 8 back from the backup. That part is host-tested only. I didn't run it with no Songbook at all, since the project load restores the slots before any save either way.

3. uiClaims: added screen:MAIN ARR NAME BAR and screen:MAIN ARR POSITION. The BOOKS rows are under the existing screen:ARR CHANGE.

4. Build references: the first limitation and proof_note now name the tested package.

5. Refresh: main merged (merge, not rebase), packages rebuilt and imported, pr:ready Ready.

Details
  • Host gate: 259 checks. New ones cover the backup and its note, stock alone saving the copies and the repair after a reinstall (with arrbook.work rewritten as 0.1.0 does), a write inside a LOAD, and the BOOKS rows.
  • New stock site: the operand of lea 0x40013904,a5 in stock's BOOKS row routine (0x40036e62), pointing it at as_list_row.
  • Performance under ot_emu: book switch 13,809,657 instructions (budget 26.6 M), 20-cycle stress with no hang. Cost at rest on the unit: 0.
  • Memory: 27,124 bytes of code and data, 100,792 of bss.
  • Edge cases and results: TESTING.md, section "Slots 7 and 8 kept safe".

🤖 Generated with Claude Code

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Andrey, that's a lot done in one go, and the backup is the right idea.

Settled now: the two cases for people coming from 0.1.0 are in the table, run on c8eb7186. The main screen's name bar and position counter are claimed. The branch is merged with main and the checks are green (the one red mark is a cancelled duplicate job, and its rerun passed). Slots 7 and 8 now get backed up before a setlist borrows them, and no writer puts them into a book's files while they're lent.

Two things left:

  1. The backup can win over newer work. give_back() restores 7 and 8 from arrNN.sl whenever arrlend.work says they were lent, whatever happened in between. Picture this. A setlist plays in a trial and a power cycle ends it. The musician carries on with 0.1.0 kept (or with no Songbook) and spends a week editing and saving arrangement 7 of that book. Byte 7 of the battery record is still set, because 0.1.0 never clears it. When they install 0.2.0 again, the reread job in songbook.c copies the old .sl over their newer arr07.work, and that week's edits are gone. Please restore a slot only while its .work still holds the setlist's copy. For example, keep each song's name and fingerprint in the note and compare them before writing. Otherwise keep the .work file and just clear the note. A related case: lend() rewrites .sl and the note without checking for an earlier note that was never given back, so a second setlist on another book drops the pointer to the first backup. Please add both cases to the host tests and the edge-case table.
  2. Build references, again: the first limitation in octamod.module.json and proof_note in manifest.py still name package 8f9c50a6 from 1e23308d. Please point them at c8eb7186, the build in the record.

Then run npm run pr:ready and push. The rest of my review from 30 November is done. And let's still talk on Discord before this goes out.

Сидоркін Андрій Володимирович and others added 5 commits December 1, 2026 16:20
…till holds a setlist's copy (fingerprints and names in arrlend.work), an unreturned note for another book repaired first; build references name the record, not a hash (the owner's review)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dure steps 1-10 on the MKI, the give-back cases)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dure entry shortened)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Andrey-Sidorkin

Copy link
Copy Markdown
Contributor Author

Both done. The package is now e06c9f98, and test:procedure steps 1-10 passed on it on my MKI (base 0.8.2 twin).

1. The backup no longer wins over newer work. arrlend.work ("ASL2") now keeps the book's own names for 7 and 8, plus each setlist song's name and a fingerprint of its block. These are written once the songs are in memory. When the module gives the slots back, it restores a slot from arrNN.sl only while that slot still holds a setlist's copy: the exact block, or a song's name that isn't the book's own name for it. Anything else in arrNN.work is kept, and the note is cleared. Before a new setlist starts, a note still on for another book now repairs that book's files the same way, arr0N.bak included for book 1, so its pointer is never dropped. Both cases are in the host gate (264 checks) and the edge-case table:

  • arrangement 7 edited and saved while the module was away: the edit is kept, and the copy in 8 is restored;
  • an unreturned note for book 1, then a setlist on book 2: book 1's 7 and 8 are repaired in .work and .bak, and the note becomes book 2's.

2. Build references. proof_note and the first limitation now point at the build in tests.qualification instead of naming a hash. manifest.py is part of the package, so any hash written there changes the package it names, which is why it kept going stale.

main merged, pr:ready Ready. Happy to talk on Discord whenever suits you.

Details
  • Book switch under ot_emu: 13,950,460 instructions (budget 26.6 M), 20-cycle stress with no hang. Cost at rest on the unit: 0.
  • Memory: 28,252 bytes of code and data, 101,156 of bss.
  • Two procedure runs first stopped at the preflight on my side (an unsaved Part, then a busy pattern). On D02 Part 1 it ran through.
  • TESTING.md, section "The give-back keeps newer work".

🤖 Generated with Claude Code

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Andrey, both are done, and the note with names and fingerprints is a neat way to tell a setlist's copy from the book's own work.

Settled now:

  1. The backup no longer wins over newer work. A slot comes back from the backup only while it still holds one of the setlist's copies. A note left over for another book is repaired before a new setlist starts, so its backup isn't lost. Both cases are in the host tests and the edge-case table, and the test procedure passed on e06c9f98 on your MKI.
  2. Build references. Pointing at the record instead of a hash is the right fix, since the manifest is part of the package.

One note, not blocking: a slot whose name matches a setlist song still counts as a copy even when its contents changed. So if stock saved a copy into arrangement 7 and someone then edited it on 0.1.0 without renaming it, a reinstall still brings back the backup. That's narrow and I'm fine shipping it, but a line in the README's limitations would help anyone who hits it.

The checks are green (the one red mark is the cancelled duplicate job again). From the code's side this is ready. Release waits for our talk on Discord.

…py edited without the module, not renamed)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Andrey. The README's limitations now cover the case I mentioned: a copy edited without the module but not renamed still counts as a copy. That was the last thing I had, so nothing is open from my side.

The code is ready. The release still waits for our talk on Discord.

@Andrey-Sidorkin

Copy link
Copy Markdown
Contributor Author

The code is ready. The release still waits for our talk on Discord.

Waiting for your answer on Discord

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants