iiwusynth-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[iiwusynth-devel] Bugs / optimization


From: M. Nentwig
Subject: [iiwusynth-devel] Bugs / optimization
Date: Sat, 26 Oct 2002 19:15:25 +0300

Hello,

Thanks to Josh we got (hopefully) rid of some bugs.
I fixed the
iiwu_voice_determine_amplitude_that_reaches_noise_floor_for_sample
problem.
Now a warning in the API says, that the
'amplitude_that_reaches_noise_floor_is_valid' flag should be cleared,
when the sample changes (iiwu_defsfont.c uses memset to clear the
sample, but that's a bit sneaky).
There is also a new condition that should avoid the lockup in the DSP
loop, but I didn't have a testcase at hand. So don't bet too much money
on it.

The new version should be (and is with my testcase) quite a bit faster
than it was a week ago.
A couple of multiplications in the DSP loop were unnecessary. The worst
offender in many cases was the continuous recalculation of the filter
coefficients. Now the DSP loop will avoid to do needless work wherever
possible, for example it will not interpolate, when pitch and phase are
normal.

I have tried the Intel compiler, but it didn't work right
out-of-the-box. With some optimization flags it even reports, that it
vectorizes the interesting parts in iiwu_dsp_core.c. Still, the
non-vectorized GCC version is faster (I found that using the built-in
profiling functions and a ten-second 'chord' with 64 keys down).
Probably this would take more effort to get the most out of the
compiler, I was unable to turn on all the interesting optimizations
(because of problems with building the library).
Also the test for ALSA header files does not work with icc, I had to
hack the configure script.

Some profiling with parts of the code removed revealed, that the
interpolation requires almost 50 % of the DSP time, the filter almost 20
% and the buffer copying (pan / reverb / chorus) almost 20 %. With that
in mind I implemented a couple of new interpolation algorithms, which
can be selected from the command line with 'interp x' for the synth or
'interpc chan x' on a per-channel-basis.
x=0: No interpolation
x=1: linear interpolation
x=4: old four-point interpolation algorithm, default
x=7: sinc-interpolation, seven points
I haven't yet figured out, whether '7' actually sounds better than '4'.
But it needs more horsepower, that's for sure.
Linear interpolation sounds quite OK in most cases.
Some experiments with 3rd and 5th order methods were unsatisfying, I did
not commit them to CVS.

Since the new gcc supports Intel's SSE instructions, it would be
feasible to recode the DSP loop for that instruction set. Four float
multiplications at the same time should really speed up interpolation...

Cheers

Markus

PS: The last changes in iiwu_voice.c were committed through a telnet
login. I haven't compiled that myself yet.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]