Repository navigation
Rachael's S-DSP: the whole chip, a port of ares's - #106
Merged
Merged
Conversation
lib/rachael/dsp.c is now ares's S-DSP in C: 32 steps a sample, one after every cycle of her SPC700, with ADSR, every GAIN mode, loops, noise, pitch modulation, echo with its FIR filter, the key-on delay, ENDX, ENVX and OUTX. RachaelDspTest compares it with blargg's accurate SPC_DSP (-PdspTests, 200 random scenarios, every sample the same) and checks the hashes of 20 in every build. The BRR Lab's voice runs the same steps, so the Lab still plays what Rachael plays. NOTICE carries ares's licence. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
skerkewitz
approved these changes
Dec 1, 2026
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
This is step 3 of "Krautrecker's songs on the desktop and the web". Rachael's DSP is now the whole sound chip. It plays ADSR envelopes, every GAIN mode, looped samples, noise, pitch modulation and echo, and it has the chip's five-sample key-on delay. As you chose, it is exact against the hardware: a port of ares's S-DSP, checked sample for sample against blargg's accurate SPC_DSP. The decision is a new record: Rachael's S-DSP is a port of ares's, checked against blargg's (ADR-6G426G3P).
How
lib/rachael/dsp.cis rewritten as a port ofares/sfc/dsp(ISC). The chip's 32 steps per sample are a switch on the step, each doing what the chip does at that point. The register write logic, the rate counter, the BRR decoder, the Gaussian interpolation (Rachael's literal table equals ares's computed one, checked), the envelopes and the echo follow ares function for function.apu.cruns one DSP step after every SPC700 cycle, so a driver's write lands on the step it would on the chip.sdevkit__dsp_renderremains for tests without the SPC700 (32 steps per sample).RachaelDspTest:-PdspTests, it fetches blargg'sSPC_DSP(snes_spc 0.9.0 at a pinned commit of the blarggs-audio-libraries mirror) into~/.cache/dampf/snes_spcand builds it with the host's C++ compiler. Both DSPs then replay 200 random scenarios of 3,000 samples: random audio RAM (BRR blocks with every filter, loop and end flag), every register of every voice, and writes at random steps. Every sample must be the same.-PdspTests=update, it also records the hashes of 20 scenarios. Every build checks Rachael's output against those, without blargg.$E0. blargg's reset latches ESA and FLG's echo bit from a hardware snapshot for one sample, so a scenario keeps the echo from writing and starts its random writes after 16 samples. And blargg'sSPC_DSPdoesn't wrap the sample directory's address at 64 KB (snes_spc pads its RAM for that), so the test's runner mirrors the start of the RAM behind its end.voicePlay(tools/brr_lab.html) runs the same steps for one voice. It now takes the BRR bytes instead of decoded samples, so the Lab still plays exactly what Rachael plays.RachaelSoundTestchecks it on its five cases; the Lab's three callers and its browser test are updated.unheard: Rachael plays every feature now, so nothing counts as unheard. The count stays in the desktop check's line, always 0, so the line's format doesn't change. The test of the old counting is gone.Verified
./gradlew build: 1301 tests, 0 failed, including every example's desktop and web checks with the new DSP.-PdspTests: 200 of 200 scenarios match blargg's sample for sample.RachaelSoundTest: the Lab's new voice equals Rachael on all five cases, every sample including the voice's end.What follows
docs/game-findings.md.docs/sound.md(On Rachael),docs/roadmap.md(step 3 built) anddocs/testing.md;compiler/build.gradle.ktsgains-PdspTests.Open
Step 4: Krautrecker's driver on Rachael's SPC700, so the songs play on the desktop.
🤖 Generated with Claude Code