Repository navigation
fix: reduce audio loudness and pulse channel aliasing - #2
Merged
Merged
Conversation
- Add a DC-blocking high-pass filter (SameBoy-equivalent coefficient) and 50% output gain in the audio output stage. The mixer reaches full scale at max volume, so resampling overshoot saturated and distorted. - Box-filter pulse channels (ch1/ch2) like wave/noise. Point sampling at 22050 Hz folded harmonics back as inharmonic tones. - Pulse accumulators are not saved in save states (reset on load), so the save state format is unchanged. 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.
概要
音が大きすぎて割れる問題と、元の音にない別の周波数が聞こえる問題を修正する。
変更
Packages/App/Src/Audio.rux): 実機のカップリングコンデンサ相当の DC 除去ハイパスフィルタ(係数は SameBoy 準拠で約 0.992)を追加し、出力ゲインを 50% にした。ミキサーは最大音量でちょうどフルスケールになるため、SDL のリサンプリングで生じるオーバーシュートが飽和して音が割れていた。Packages/Core/Src/Apu.rux): 矩形波 ch1/ch2 も wave/noise と同じく区間平均(ボックスフィルタ)を取るようにした。ad4300aでサンプルレートを 22050Hz に下げたことで、点サンプリングによる高調波の折り返しが非整数倍の音として聞こえていた。Packages/Core/Src/SaveState.rux): 追加した pulse のアキュムレータは保存せず、ロード時に 0 に戻す。形式は変えていない。確認
scripts/test.sh全 PASS(dmg_sound / SaveState / ApuBatch の PCM 一致を含む)scripts/bench_cpu.sh --release: 1488% → 1483% realtime🤖 Generated with Claude Code