Repository navigation
feat(audio): whole-song tone picker in the player menu - #10
Merged
Merged
Conversation
A "Tone: …" dropdown in the player's Tone & tuning group holds one saved
preset for the entire song ("Tone: follow song" keeps normal switching).
The pick is remembered per song and wins over Tone Automation and per-tone
mappings: the lock is enforced inside installTaSwitcherForSong and
_applyToneMappingsImpl (every switching path funnels through one of them)
and at song start, and the locked switcher ignores the song's tone changes
(no tone toast either).
Why: Tone Automation classifies by tone name, so a song whose BASE tone is
named e.g. "mychdead_solo" plays its whole length on the solo preset, and
there was no simple way to just pick a tone for a song.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Picking a tone while a play queue / album playthrough is running now keeps it for the rest of that run instead of only the current song; the next song loads on the same tone. A song's own pick still wins, "Tone: follow song" releases the run lock, and it clears when the queue ends (queue:changed active:false, re-checked lazily against playQueue.active()). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
Added: a tone picked while a queue / album playthrough is running now holds for the rest of that run (the next song loads on the same tone). A song's own pick still wins, "Tone: follow song" releases it, and it clears when the queue ends. Tests: 151 pass. Live: picked Metal Lead on song 1 of a 2-song queue; song 2 (no per-song pick) loaded on Metal Lead with the picker showing it. |
A tone saved while a song was playing didn't appear until the next song, because the options were built once at song start. Rebuild on pointerdown/focus, only when the preset list actually changed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The song-start lock check in the preload (second IIFE) called getSongToneLock/applySongToneLock, which only exist in the first IIFE, so every song's preload threw ReferenceError and aborted. Go through the window._aeSongToneLock export instead. New tests/renderer-iife-scope.test.js pins the whole class: no IIFE in screen.js may call a top-level function only another IIFE declares. It also caught an older one: the bypass-mode preload called getPresetItems() from the second IIFE (fixed with a local alias). Fixes #12 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The player menu's Tone & tuning group gets a Tone dropdown:
Tone: follow song: normal switching, using Tone Automation or the per-tone mappings.Tone: <preset>: holds that saved preset for the whole song.The pick is remembered per song (localStorage
slopsmith-song-tone-lock). A pick that points at a deleted preset is ignored.Why
Tone Automation classifies tones by name. A song whose base tone is called
mychdead_soloplays its whole length on the solo preset. There was also no simple way to say "just use Main Lead for this song".How
installTaSwitcherForSongand_applyToneMappingsImpl, which every switching path goes through, and at song start before MIDI/TA/bypass.data-ae-chain, so core's player menu files it under Tone & tuning with no core change.Testing
tests/song-tone-lock.test.js(new): store/clear, deleted preset, corrupt storage, lock ignores tone changes, every path checks the lock, picker placement.npm test: 149 pass, 0 fail._solobase tone🤖 Generated with Claude Code