[LAD] Pluginization example?

Steve Harris steve at plugin.org.uk
Wed Aug 15 16:04:39 UTC 2007


On 15 Aug 2007, at 16:39, Steve Harris wrote:

> Hi Juhana,
>
> On 15 Aug 2007, at 15:43, Juhana Sadeharju wrote:
>> 1. Denormalization. Feeding noise at the reverb input would
>> save me trouble of finding all places where the problem
>> occurs, but is this wise? How to generate the proper noise?
>
> You don't have to use noise, you could use a fs/2 signal at very  
> low amplitude, eg.
>
> sig = 1e-30;
> for (i in input)
>    x[i] += sig;
>    sig = -sig;

Hm, I've just realised that this is a bad idea if you do it to the  
effect when its 100% dry. If someone else does it and the plugin are  
chained it will either be inphase in which case it will build, or out  
of phase in which case it will cancel and you'll have denormal  
problems again :-/

Needs to be done with care. But as long as the effect is even  
slightly wet it should be fine.

To avoid any risk there are cheap psuedorandom number generators you  
can use, eg. take a large prime unsigned integer and keep multiplying  
it by another large prime integer, then divide by UINT_MAX/2 and  
subtract 1.0 to get a floating point value in [-1.0,1.0].

- Steve



More information about the Linux-audio-dev mailing list