Oscillators in Reaktor Core, Part II
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.
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, 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!
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.
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!