02.02.2013 Views

1. First steps in Reaktor Core - Native Instruments

1. First steps in Reaktor Core - Native Instruments

1. First steps in Reaktor Core - Native Instruments

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

5.6. Other bad numbers<br />

Denormal numbers are not the only k<strong>in</strong>d that can cause problems <strong>in</strong> <strong>Reaktor</strong><br />

<strong>Core</strong> structures with <strong>in</strong>ternal states, and particularly <strong>in</strong> feedback loops. Other<br />

examples <strong>in</strong>clude INFs, NaNs and QNaNs. We are not go<strong>in</strong>g to discuss those<br />

<strong>in</strong> detail here, because that <strong>in</strong>formation is available <strong>in</strong> other places, <strong>in</strong>clud<strong>in</strong>g<br />

the Internet. What’s important for us is prevent<strong>in</strong>g those k<strong>in</strong>ds of numbers<br />

from appear<strong>in</strong>g <strong>in</strong> our structures.<br />

Generally, such numbers appear as the result of <strong>in</strong>valid operations. Division<br />

by zero is the easiest case. Other cases <strong>in</strong>volve numbers gett<strong>in</strong>g too large to<br />

fit <strong>in</strong> the float<strong>in</strong>g po<strong>in</strong>t representation (that would be above 10 38 <strong>in</strong> absolute<br />

magnitude), or outside the reasonable range for a particular operation.<br />

Such numbers tend to get stuck <strong>in</strong>side structures, and <strong>in</strong> a way they are more<br />

sticky than denormals. For example as soon as you add a denormal value to<br />

another value which is not denormal, the result will be non-denormal (unless<br />

the other value is also very small and close to be<strong>in</strong>g a denormal). On the other<br />

hand if you add a normal value to an INF, the result will still be an INF.<br />

Besides hav<strong>in</strong>g a tendency to stick <strong>in</strong> structures forever (or better said, until<br />

the structure is reset), these numbers also have a bad habit of requir<strong>in</strong>g much<br />

larger process<strong>in</strong>g times on some CPUs. Therefore you should do your best to<br />

prevent them from be<strong>in</strong>g created at all. That means, for example, that whenever<br />

you divide two numbers you ensure that the denom<strong>in</strong>ator (the bottom part of<br />

the fraction) is not zero. The case of <strong>in</strong>itialization requires particular attention<br />

here. For example, consider the follow<strong>in</strong>g structure element:<br />

If for whatever reason, the <strong>in</strong>itialization event does not come on the lower<br />

<strong>in</strong>put of the Divider module, a division by zero will happen dur<strong>in</strong>g <strong>in</strong>itialization<br />

process<strong>in</strong>g. In this case you might consider us<strong>in</strong>g a modulation delay macro<br />

<strong>in</strong>stead, or depend<strong>in</strong>g on your particular needs f<strong>in</strong>d another solution.<br />

5.7. Build<strong>in</strong>g a 1-pole low pass filter<br />

A simple 1-pole low pass filter can be built us<strong>in</strong>g a recursive equation:<br />

y=b*x+(1-b)*y -1<br />

where<br />

x is the <strong>in</strong>put sample,<br />

y is the new output sample,<br />

y -1 is the previous output sample, and<br />

b is the coefficient def<strong>in</strong><strong>in</strong>g the filter’s cutoff.<br />

REAKTOR CORE – 101

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!