• jon@schemawound.com
Misc Tutorial
Logical Clocks

Logical Clocks

Recently I have been experimenting with clock dividers and logic modules.  It’s an area that often gets overlooked by newcomers to modular synthesis.  Discussions of logic modules will usually only explain them from a technical viewpoint, but avoid the practical musical applications of them.

For a good introductory experience, I would recommend experimenting with Reaktor Blocks.  The Blocks Framework includes a number of modules that help you to learn these concepts before committing to any hardware.  In the screenshot below I use the factory Clock, Clk Div and MIDI Out objects as well as the Euro Reakt Boolean Logic module.

Clock

In a modular system a clock is simply a steady stream of pulses.  The clock signal is read on the rising edge of the pulse.  You can use a square wave LFO as your clock signal as well.  The clock signal has two states: at the top of the pulse the signal is said to be high and at the bottom it is low.

Clock Dividers

A clock divider takes the clock signal as input and outputs various time divisions of the signal.  When dividing a clock signal it will always be slower than the source.  If you were to take a clock representing 16th notes and divide it by 2 you would have a clock signal representing 8th notes.  The clock divider counts the number of pulses it has received and will output a high signal every X pulses.  The counting always starts with pulse 1 being high.  In the example below the clock signal sends 4 pulses and the /2 output goes high on pulse 1 and 3.

Most basic clock dividers only output divisions based off powers of two: 2, 4, 8, 16, etc.  Our early experiments will be working with these.  In the chart below, I show an example of what you would expect from each of the outputs of a basic power-of-two clock divider.

ClockBeat1

If you were to patch the clock signal to a closed hat and the /4 output to a bass drum you would have the start of a very boring techno beat.  In the next section we will build off this and improve it.

Logic Modules

Logic modules accept two signals as input and produce one signal as output. We use a truth table
to detail the output of a logic module; such a table will list every combination of inputs, both high and low, and the resultant output for each of those combinations.  For now, I will only deal with the three most basic logic modules.

Logic and Power-of-Two Dividers

Let’s apply what we have learned using the example below: A and B are two different outputs from the same basic clock divider, with B being the A output divided by 2.  In this scenario the AND and OR output do not provide us with anything useful.  They each mirror one of the inputs.  Notice the XOR output:  it is running the same speed as the AND output, but is offset by one clock division.  This can lead to a lot of useful applications.

More XOR

Taking the above concept farther, you can see that we can produce a number of off-beats using XOR.  Follow along with the chart below and use the XOR truth table to understand the results I am showing.

ClockBeat2

Using our newfound knowledge about XOR, we can continue to add to our beat by adding snares on every other kick.  /4 XOR /8 will trigger our snare on beats 2 and 4.

ClockBeat3

Using /2 XOR /4, we can add an open hat on the upbeats.  Unfortunately, this is attempting to play a closed hat and open hat at the same time; looking at the two hat patterns side by side you can likely see the solution to this.

ClockBeat4

Since we want closed hats on every beat of the clock except the ones to contain open hats, we can use XOR with the open hat triggers and the clock.  I am using parenthesis below to show order of operations for our new closed hat pattern.  

Other Divisions and Resets

Earlier I mentioned that the most basic form of a clock dividers contains power-of-two divisions.  Many clock dividers allow other divisions as well.  

While these can be very interesting for polyrhythms, they can take on new uses when combined with resetting the clock divider.  The reset input of the clock divider will bring all inputs high and reset all counts when it is triggered.  This is best demonstrated in the example below.

ClockBeat5

Below I have begun triggering a rim off of the /3 output of the clock divider and also self-patched from the /8 output into the reset input.  Notice how after 8 divisions, the /3 pattern resets leaving us with a 3-3-2 pattern.  This provides much more interest to the very straight beat we have been producing so far.  

NOTE: if you are following along with Reaktor there are 2 things to be aware of:

  1. You cannot directly self-patch within a block.  In order to get around this you will need to go through another block before patching back.  (I used a single input on a Boolean module and the OR output, effectively an OR with one input always zero, resulting in an unaltered signal.)
  2. The clock divider module within Reaktor seems to function differently in that the /3 output does not appear to fire on a reset.  I get around this by using an OR on the /3 and /8 output to combine the two.