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.

7.4. Build<strong>in</strong>g a ris<strong>in</strong>g edge counter macro<br />

Now we are go<strong>in</strong>g to discuss a sign comparison technique which you might<br />

sometimes need <strong>in</strong> build<strong>in</strong>g <strong>Reaktor</strong> <strong>Core</strong> structures. Sign comparison is a<br />

special way of compar<strong>in</strong>g two numbers, <strong>in</strong> which you ignore their values and<br />

pay attention only to their signs (plus or m<strong>in</strong>us). Naturally, plus is considered<br />

greater than m<strong>in</strong>us. So for example:<br />

3.1 is sign-greater than –<strong>1.</strong>4<br />

2.1 is sign-equal to 5.0<br />

4.5 is sign-equal to –2.9<br />

Beware that the sign of zero is undef<strong>in</strong>ed, which means that result of<br />

any sign comparison <strong>in</strong>volv<strong>in</strong>g a zero value can be arbitrary.<br />

Of course you could have implemented the sign comparison us<strong>in</strong>g several<br />

Comparison modules and several Routers, but there is a more efficient way.<br />

The sign comparison can be done <strong>in</strong> <strong>Reaktor</strong> <strong>Core</strong> structures us<strong>in</strong>g the Compare<br />

Sign module (Built-In Module > Flow > Compare Sign):<br />

This module produces a BoolCtl signal at the output, so that you can connect<br />

it to a Router.<br />

One of the possible uses of such a module is detect<strong>in</strong>g the ris<strong>in</strong>g edges of an<br />

<strong>in</strong>com<strong>in</strong>g signal. Below we are go<strong>in</strong>g to build a ris<strong>in</strong>g edge counter <strong>Reaktor</strong><br />

<strong>Core</strong> macro:<br />

Note that the output is set to <strong>in</strong>teger mode because the count is an <strong>in</strong>teger<br />

value.<br />

The first th<strong>in</strong>g we are go<strong>in</strong>g to need <strong>in</strong>side is an edge detector macro to convert<br />

the detected edge to an event:<br />

This is how the detector macro can be implemented:<br />

116 – REAKTOR CORE

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

Saved successfully!

Ooh no, something went wrong!