In Part 1 we created a simple subtractive synth structure in Reaktor using the inbuilt library of Macros. So far we have an oscillator with an ADSR envelope being fed into a Multimode filter with its own ADSR. Simple stuff!
In this part we're going to modify some of these Macros to incorporate an LFO that will modulate the Pulse Width of the Pulse waveform.
Before I start I'd just like to say that although Reaktor is complex (an understatement!!) it follows the simple principle of signal path, for both MIDI (Events) and Audio. It's taken me a number of years of head scratching to figure out the best way of doing things. Most of what I learned came from opening other Reaktor instruments and seeing how they were made. You learn a lot that way!
Step -1 - Create an LFO
Control-Click the Structure window and choose Macros > Building Blocks > LFO etc > LFO.
You'll see the LFO in the Structure window.
Click Edit Panel and move your LFO over.
You're free to move any element to suit your design needs. You can also scale your elements using the Size parameters in the View tab.
Step 2 - Create The PWM
Double-click the Osc 3 Wave macro. Inside you'll see the structure of the Macro. We're going to edit this!
Create a new In Port. Control-Click the Structure window and choose Built-In Module > Terminal > In Port. Name the port "LFO".
Delete the cable between P-Width and W on the Pulse oscillator and drag it near the LFO input. Create a new Knob.
Name it "LFO '"> PW".
You'll see in the Function tab the range of the Knob. By default, it has a Max value of 1 and a Min value of 0. This is good.
What we're going to do is Multiply the LFO signal by the value of the Knob. At 1 it will be the full value sent by the LFO, at 0 we'll have no signal being passed. This is down to simple math: Any number times 0 equals 0. Any number times 1 equals the same number! At 0.5 it will be half the value of the signal.
This way we can choose the amount of signal being sent from the LFO to the Width control.
Step 3 - Do Some Math
Create a Multiply module: Control-Click the Structure window and choose Built-In Module > Math > Multiply.
Connect the LFO input and the LFO > PW knob to the left hand ports of the Multiply module.
I now want to add the result of this to the current value set by P-Width which controls the overall Pulse Width value.
To do this create an Add module from Built-In Module > Math > Multiply. Connect the outputs from P-Width and the Multiply module to the left hand ports. Then connect the output of Add to the Width (W) port on the Pulse oscillator.
Go back to the Instrument structure and connect the LFO out to the LFO port on the Osc 3 Wave macro.
Step 4 - Clean Up And Test
Unlock the panel and move your new LFO > PW control over so you can see it and lock the panel.
If I play some notes and increase the value you can hear the Pulse Width Modulation. I'll also increase the speed of the LFO so you can hear the effect.
All done for now. Next time we'll send the LFO to the Filter. This is a bit more tricky and uses a slightly different approach as we need to mix it with the Filter-Env. Till then!