Gate SSG pseudo-stereo on the same pan detection as FM - #21
Merged
Merged
Conversation
The Haas widener was applied to the SSG mix whenever pseudo-stereo was enabled, ignoring fmPanDetected. A tune that pans its FM channels — so one that authored its own stereo image — still had its SSG part widened underneath that image. Use the same gate the FM path uses. fmPanDetected is not part of the save state, so a state captured after a pan write came back with the latch clear and the widener wrongly active. Rebuild it from the restored FMCh pan bits, which the FMSynthesizer blob already carries: no format change, and older states load as before. The chorus delay lines are dropped on load for the same reason the CD-mix ones are. Co-Authored-By: Claude Opus 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.
Summary
疑似ステレオ (Haas コーラス) の適用条件を FM と SSG で揃えました。
mixOutputFrameの SSG 経路がfmPanDetectedを見ておらず、PAN を振った OPNA 曲でも SSG にだけコーラスがかかり続けていました。FM 経路 (generateFMSamples) と同じ条件に統一しています。fmPanDetectedはシリアライズされていないため、PAN 書き込み後のステートをロードするとラッチが落ちた状態で復帰し、疑似ステレオが誤って有効になっていました。FMCh.panLeft/panRightは既にステートに含まれているので、ロード後にそこから再構築します (refreshPanDetection())。セーブフォーマットは変更なし、既存ステートもそのまま読めます。PAN を振った後センターへ戻す曲はロードでラッチが落ちますが、直後のレジスタ書き込みで立ち直ります。
Test plan
swift test— 930 tests / 43 suites パス (新規YM2608 pseudo-stereo gating5 件を含む)scripts/regression_compare.py— 20 PASS / FAIL 0🤖 Generated with Claude Code