Jesusonic Tutorials Fixing Denormals

From CockosWiki

Jump to: navigation, search

How to fix a plug-in that exhibits denormalization problems

Whenever you exhibit a Jesusonic Plug-in that uses alot more CPU when there is no signal fed in, this might be a problem of denormalization (i.e. the numbers e.g. in the feedback loop of the FX get too small and the FPU therefor switches into an more accurate but much slower state to process those numbers).

The easiest way to fix this is to add a tiny amount of DC-offset (~ -600dBFS) so the internals of the effect will not denormalize. Here is how this is done:

1. Add this to the @init code in the effect's source code.

@init
cDenorm = 10^-30;

2. Add the following right at the beginning of the @sample code.

@sample
spl0 += cDenorm;
spl1 += cDenorm;

Now the denormal problems shoud be fixed.


You may want to add

spl0 -= cDenorm;
spl1 -= cDenorm;

to the end of your @sample code to remove the DC-offset again, but note that the procession of the effect may alter the incoming data and this may not remove the DC offset proper. It is, however, a very small DC-offset (~ -600dBFS only) and shouldn't matter too much, but it may sum up in the FX chain, so use your own judgement.

Personal tools