iOS core: Synth voice, Sampler, sample store and SF2/XI loader ported, bit-exact with Kotlin

All six instruments now run in C++ (61 reference scenarios, 16 sampler tests).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Reactorcoremeltdown
2026-11-15 22:06:51 +01:00
co-authored by Claude Opus 5.5
parent 8d85b14a67
commit a5b2f4c873
19 changed files with 2149 additions and 13 deletions
+18
View File
@@ -52,6 +52,24 @@ Each milestone ends with a build that runs on the iPad.
5. **Everything else.** MIDI in/out and clock sync, gamepad and key bindings,
recording, sample recorder, sharing/import, backups, themes, settings.
## Progress
- 2026-11-15: all six instruments' sound is in C++ and matches Kotlin bit for bit
(Synth, Morph Pad, Wavetable, Grain Cloud, Sampler, SF2/XI), plus the 12 factory
wavetables, the sample store and the WAV/SF2/XI readers (`core/tests/sampler_test`).
`make -C ios core-test`: 61 reference scenarios + 16 sampler tests.
Notes for the engine port (from the voice ports):
- Kotlin seeds every new FrasilVoice and GrainCloud from global counters, and every
SynthVoice builds a FrasilVoice. The C++ engine owns one `frasil::FrasilSeeds`,
one `echofield::GrainSeeds` and one `frasil::FrasilClock`, and builds its voice
pools in AudioEngine's order, or full-song renders won't match.
- `synth::SynthPatch` has an id standing in for Kotlin's object identity
(`setPatch` skips retuning for the same patch): reuse the patch built per block,
don't rebuild it.
- `sampler::SampleStore`: the audio thread calls `quiescent()` once per block;
voices pin samples. The Grain Cloud's custom-sample pointer isn't pinned yet.
## Rules for ports
- Translate line for line and keep Kotlin's types (`Float` → `float`, `Double` →