this is how costly the filter in my synth is right now.
these are nanoseconds per sample measurements on a single 2.2 GHz i7 core, with 5 keys held down.
the baseline measurement just has 2 oscillators running per voice, with the filter disabled.
full unison means playing 8 voices per key held down, so 40 in total for 5 keys, meaning 80 oscillators and 40 filters running simultaneously.
K-LUT is a lookup table that saves time by avoiding expensive calls to tanf() and exp2f(). you can see how using the K-LUT cuts the total computation time in half in unison mode.
for reference, the synth takes about 160 ns per sample when it's idle.
where it says "with clamping" is particularly revealing though. all i'm doing there is limiting a single number in the computation to a maximum value to avoid a buffer overflow in the K-LUT.
as you can see, that alone causes a 34% increase in computation time. why? because it causes branching. a check has to be performed.
if there was dedicated hardware for clamping like you might find on a DSP or a GPU, that operation would have virtually no cost.
QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.