AudioKit / AudioKitSynthOne

AudioKit Synth One: Open-Source iOS Synthesizer App
http://audiokitpro.com/synth
MIT License
1.67k stars 217 forks source link

RFC: Replace Soundpipe Moog Ladder with S1DSP Version #91

Closed sieren closed 5 years ago

sieren commented 5 years ago

Posting this as an RFC.


Benchmarks

Compiler Settings & Benchmark Scenario

All profiling was done under the same circumstances. AudioKit SDK through CocoaPods is compiled with -0s (Fastest, Smallest) even for Debug builds, so in order to replicate, same had to be done with SynthOne.

For playback, I used a 3-Note held Chord with the sequencer activated to increase polyphony.

CPU Usage

SoundPipe Moog Ladder: ~36-43% S1DSPMoogLadder: ~27-35%

Instruments

SoundPipe Screenshot 2019-06-08 at 12 04 48

S1DSPMoogLadder Screenshot 2019-06-08 at 12 04 37

Discussion

The sound is pretty much he same, because of identical sources for the algorithms. In both modules tanh calculation is the most expensive operation, and it seems like the one in @PaulBatchelor s implementation is actually the cheapest available. Alternatives like vox_fasttanh (as discussed here) are in fact slower (but may lead to slightly better sound).

The slightly better CPU performance of this new filter is presumably because of fewer calculations for Cutoff/Resonance parameters on each sample and a less complex call-hierarchy (no calls to the kernel to access the SoundPipe Kernel).

@aure @analogcode @marcussatellite @PaulBatchelor feel free to play around with this. I'll leave it open for discussion whether we should merge this or not. I've attached the Instruments Profiling results at the bottom.

1_old_2_new.trace.zip

marcus-w-hobbs commented 5 years ago

@sieren I played around with this. As you pointed out, there is not a noticeable difference in sound. @analogcode It would be great if we could get a third set of ears on this before merging.