Repository navigation
fix(transpose): open a song at the key its saved record holds - #830
Merged
Merged
Conversation
Checks the counter, every lane's stepper, the audio graph's routing and the saved record agree in Practice, Advanced and Karaoke, after switching back and after a reload. Also a record saved by 0.20, a reopen inside the save debounce, a record read after the engine is up, speed and mutes, and that switching leaves no extra AudioContext or pitch chain. The transpose spec's reopen test asserted the key went back to 0, which only held because the reopen beat the debounced save.
The counter, the engine and the saved record could disagree when a song was opened again: - A record saved by 0.20 has each lane's absolute key but no global key, so the counter opened at 0 over lanes still playing transposed. The global key is now read back from the lanes when the record has none (pitchBus.savedGlobalPitch). - Opening a song inside the 300 ms save debounce read the record from before the change; the late write then stored it behind a screen and an engine at 0. The pending write is flushed before the read. - The engine's ready handler pushed whatever was in memory when the record had not been read yet. Gains, lane keys, EQs, speed and the global key now wait for the record, and the key controls stay off until it is in. Closes #781
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.
Closes #781.
Root cause
On 0.20 the global key was never saved: reopening a song restored each lane's absolute key from the store (audio still -2) but reset the counter to 0. big-release saves
__global.pitch, which fixes a newly saved song, but three paths still let the counter, the engine and the saved record disagree:What changed
pitchBus.savedGlobalPitch: the global key comes from the record, or from its lanes when the record has none.loadMixIntoStateflushes the pending write for that record before reading it.player.js: gains, lane keys, EQs, speed and global key are pushed after the record is in; the key controls stay disabled until then.transpose-switch-song.spec.mjs(Practice, Advanced, Karaoke; global and per-lane key; reload; 0.20 record; debounce; late record; speed and mutes; no AudioContext growth). The audio check reads the graph routing, not only the engine's reported value.transpose.specreopen test expected 0, which only held because of the debounce race; it now expects the key to stay.What did not change
stemdeck:slow-speed) is per browser, not per song: a song saved at 0.75x reopened after the slow value changed plays 0.75x with no speed button lit.