Oscillators in Reaktor Core, Part II

In this tutorial, I’ll show how to expand upon the generic Reaktor Core oscillator structure I created in the first part of this series. Specifically, we’ll be creating a gate sync function, phase modulation, and frequency modulation.

I’ll be using a basic sine oscillator as the basis for these demonstrations, but as I explained last week, the phase accumulator design can be used by many oscillator types.

GATE SYNC

Not to be confused with a hard sync, (which we will avoid for now, since it causes substantial aliasing) a gate sync function will reset the phase accumulator to zero on a new gate input. This is useful when used alongside phase or frequency modulation – if an oscillator is modulating another oscillator, having both oscillators reset on a new gate ensures that the sound they make will be consistent.
Adding this function to our exisiting design is not hard:

The ‘G’ input is supplied by MIDI Gate module, and will only work properly if the input type is set to Event. If you are unfamiliar with the Compare and Router modules in Reaktor core, the following two structures are nearly identical in functionality, the only difference being that the Core structure will accept an audio input, and the Primary one will not:

PHASE MODULATION

Phase modulation, an effect quite similar to frequency modulation, is quite easy to implement as well. We already have a phase accumulator, ranging from -N to N. We will presume that the input to the phase modulation is in the range of -1 to 1, as most digital audio signals are.

So we multiply the modulator by N, add it to the current phase, and use the Wrap function to once again make sure that the phase is within the range of -N to N. Done!

FREQUENCY MODULATION

There are many different ways one could implement frequency modulation. In the Reaktor Primary oscillator modules, the F inputs add or subtract the incoming value to the frequency of the oscillator.

While this seems very straight-forward, a lot of people try to route an oscillator with a value from -1 to 1 into the F inputs, and wondering why FM doesn’t work in Reaktor! Well, when you have an oscillator at 440 Hz (or whatever), you ears may not be able to tell if instead it modulates from 439-441 Hz!

I prefer a method that allows that user to simply attach an audio signal (such as another oscillator) into the FM input like so:

This method assumes the range of modulation is from 0 to Pitch*2, with an input from -1 to 1. If the input is boosted beyond the range of -1 to 1, you can achieve negative frequencies, which causes the phase accumulator to run backwards! This is not a problem, and can actually sound pretty great. Similarly, you can boost the level of the phase modulator well beyond it’s ‘recommended’ range of -1 to 1, to great results.

CONCLUSION

Next time, I’ll begin discussing bandlimited oscillators. Until then, if you have any questions about today’s tutorial or it’s implementation in core, please let me know in the comments!

• http://James James

Quick question: How are compare and router similar? I’m guessing you meant compare + router is similar to primary level module separator, right? I’m quite new to Reaktor and it got me a bit confused and since you’re the expert it’d be great if you can confirm or disconfirm my misunderstanding.

Thanks again! The world needs more people like you !

• salamanderangram

Hi,
The wording might be a little clunky on my part, but essentially what I’m saying there is that the two pictures beneath that paragraph are functionally identical (more or less).

So yes, the Compare/Router is similar to a primary Separator.

• James

Thank you for your answer! Hope to see even more tutorials here.

• alfonso

hi, great stuff!
i wondering how to add phase offset for oscillators…

• salamanderangram

thanks for the feedback.
you can simply set the oscillator to a value other than zero on a new gate to do this. the latch currently has no value (IE 0) so you can add a quick constant or use a knob to control the phase offset.

alternately you can just supply a constant value to the phase modulation input, this will work too. however it is less efficient.

• alfonso

thanks man! is exactly what i tried but i’ve attached a scope to the sine osc output and i don’t see any phase movement. can you post an example? many thanks again!

• salamanderangram

i’m not sure what you would see on a scope, seems unlikely to really appear on most scopes, unless the scope shows only a single cycle of the waveform and has a sync function (IE with an XY module)

• alfonso

IE i would like to see a sine morphing to a cosine while i move the phase offset. i come from MaxMSP so probably there is something that i don’t know about Reaktor scopes

• salamanderangram

putting (-0.5*pi) as an input to the phase should give you a cosine.

so to morph simply use a ramp from 0 to -.5pi to the PM input.