How to Sync LFO's to Midi Clock?

 

Samuel G. Streeper wrote:

I know how to sync the sequencers to midi clock, that's very easy and works well. But tonight I was trying to sync LFO's to midi clock, and I wonder if I'm missing something. I couldn't ascertain the content of the gray sync line or its utility in generating something useful for an LFO slave. My only solution that worked out with tight timing was to run a clock generator at the same tempo as my sequencer, and then send midi sync to the resets for the clock generator and my LFO, and slave my LFO to the clock generator. This works well but seems clumsy. Is there a better way?

Rob Hordijk wrote:

The Modular doesn't have an internal function that converts the MIDI clock rate into a grey signal, so my guess is that your mentioned method is the only way to go. Use this myself sometimes. The cumbersome part is that if you have tempo changes within your song there is no way of adjusting the clock generators BPM automatically.

Machines that do track their LFO's frequencies to the MIDI clock or e.g. set echotimes from the MIDI clock automatically (MPX100), seem to measure the timelapse between every MIDI clock command and correct the LFO speed or delay time accordingly. Coming to think of it, I don't see a reason why this couldn't be implemented into the MIDI global module. Yes..., we should have a grey output on the MIDI global module, whose value depends on the time interval between the incoming MIDI clock commandbytes! The LFO might drift a little over a longer period of time, due to small timing irregularities in the MIDI stream, but by also resetting the LFO with the sync output every bar or so, it would be pretty solid I guess. So Clavia, we need a GREY OUTPUT ON THE MIDI GLOBAL MODULE.

David Peck wrote:

Attached is a patch I just made, which uses keyboard pressure (aftertouch) to switch between eighth note and sixteenth note patterns. The effect is a bit reminiscent of The Who's "Baba O'Riley" or the patch heard at the beginning and end of "Deeper and Deeper" by The Fixx. Using the clock divider and the 4-1 switch works better than simply doubling the LFO rate, because it assures that when you switch back to the slower rate, you will be back "on the beat", even if you switch back after an odd number of sixteenth notes. Note that the "Clock" LFO must be in MONO mode to achieve the desired effect when playing multiple notes.

The keyboard resets all sequencers at the beginning of the new notes. The sequencers control panning, a sync osc pattern, and filter cutoff via EG amount, but not pitch. It works best by slowly adding new notes to a chord and releasing old notes, gradually changing from one chord to the next, rather than just playing all new notes simultaneously (so each note is at a different step in the sequencer patterns).

Here's the problem - I want to modify this patch to sync it to midi clock (provided by Cakewalk Pro Audio running on a PC). However, simply replacing the LFO with a Midi Global Module and a clock divider loses the LFO MONO Mode capability. I also tried keeping the LFO as a clock, and syncing/resetting it with the Midi Global & clock divider, but that didn't work either.

Anybody have any ideas for syncing this to midi while retaining the LFO MONO Mode effect?

Ico Doornekamp wrote:

I figured out a solution to my own question I asked last week about syncing a LFO to the midiclock. It is based on the pitchfolow-2.0 patch, but for lower frequencies.

The work is done by 3 modules, the output is a grey control signal suitable for driving a slave LFO at 'exactly' the same rate as the incoming midi clock.

The example patch drives a square-LFO connected to the freq input of an oscillator, thus generating a low-hi-low-hi sound at the speed of the midi clock...

David Peck wrote:

I gotta try this patch tonight. If this really works, you just became the most popular guy in the list

K.K.Trawinski wrote:

It works, I've tried it... Nice work Ico! Very very cool!

Lennart Regebro wrote:

  1. I've needed this sometimes, and the solutions depend on the waveform you want.
  2. The most obvious one is the random step generator used to make sample-and-hold type of LFO's. This is the one I use all the time. I just love it. That is of course just a question of taking the midi clock through a clock divider and then in to the clock inpit of the random step generator. But you all know that already.
  3. The simplest one is the square wave LFO. Just take the divided clock output: Done.
  4. Sawtooth is also pretty easy. Use an LFO A, set it to sawtooth and use the divided clock out as a reset signal. Set the rate to the lowest rate you are going to reasonaby use. The drawback with this is that the higher the MIDI BMP is as compared to the rate you have on the LFO the lower the amplitude of the LFO output you'll get. Usually you don't use the same patch over a ridicoulous MIDI rate range, so it's not much of a problem. I have some ideas to fix that if anybody needs it, but I don't have the modular here right now (I'm at home), so I can't test it.
  5. Triangle/Sine: Put the divided output through a portamento (for triangle) and a "smooth" for a more sine-like output. Suffers from the same amplitude problem as the sawtooth, but if you are using it in a small BMP range that's not an issue. No ideas on how to solve it either. I'll go down to the studio and test the attached patch when I have the time, but this is now done completely in the blind, so I can't guarantee anything, but in theory it SHOULD work. :-) Use the "Waveform" switch to switch between the above mentioned setups.

Rob Hordijk wrote:

Here's two Midi-tempo controlled LFO solutions I dug up from my patch archive, plus a filter-efx patch using Kees v.d. Maarel's 'pulse integrating' pitch follower.

Notes on patch MidiLFOMod:

Stereo 24db audio filter. Lfo pattern is varied by using two midi-tempo controlled lfo's, crossfading between the waves and a wavewrapper to vary the waveforms. The tempo of the Lfo's can be chosen by a four way switch, they are 'bar|halfbar|beat|quarter beat'. A slow LFO and an envelope follower can be used as well. The LFO for the right channel can be inverted to create a nice stereo panning effect. Some 'frutsels' are used to automatically reduce the filters resonance setting at lower frequencies to prevent heavy bass resonances.

Notes on patch Midi Synced LFOs:

Column 1 is a LFO using a modulatable AHD and a divider to trigger the AHD in a rate fixed to the midiclock. Pretty straightforward I would say. Column 2 and 3 form a LFO that uses the midiclock to control an actual LFO circuit assembled from various modules. It resembles the working of an analog LFO where a capacitor device is used to 'store' the output voltage and a flipflop circuit is used to periodically charge or decharge the capacitor, making the output voltage ramp up or down.

In the patch a S&H module is used as a memory cell (LFO Register) acting as the capacitor, which value is constantly incremented until it reaches a top value. Then its value is decremented until a botton value, whereafter it is incremented again, etc. The S&H module has a feedbackloop through a mixer. On every clockpulse it is sampling its own output through the 'Accumulator' mixer module. The mixer receives a little bit of signal on another input which might be positive or negative. If positive the output of the S&H will gradually increase over time, but if negative the output will decrease gradually. The positive/negative value is controlled by a so called RS FlipFlop, a circuit built from a couple of logic modules which can toggle an output positive by a level on the S(et) input and toggle it negative by a level on the R(eset) input. Compare modules are used to check the output level of the S&H and whether to toggle the FF to generate either the positive or negative value. The amount of this value will make the 'LFO' go faster or slower. There are actually two knobs that control the LFO speed, the Constant module 'Speed' and the left knob on the mixer module. The mixer knob is used to set the global speed range and the Constant module is used to control the frequency in a linear fashion. Alternatively the 'Speed' module can be set to a fixed value controlling the global range and the left 'Accumulator' mixer knob can be used to control the frequency in a exponential fashion.

The LFO can be either free running with the tempo controlled by the Midi Clock or be periodically restarted by the Midi Global Sync output. If it is restarted it can have an initial value similar to the Phase setting of a regular LFO module. Then after a restart the direction the LFO will go can be controlled as well. If the initial value is a positive value the LFO will go downwards on a restart, if negative it will go upwards. But a button is added to reverse this behaviour, so a positive initial value will make the LFO go upwards and a negative value will make it go downwards.

The LFO has a tight relationship to the midiclock as its the midiclock that does the actual sampling. This means that the output also steps and is not smooth, so a smooth module is added on the output. It would have been nice if the 96tick midiclock signal would have been present on the Global module next to the 24tick signal. But a trick is used to double the 24tick signal to a 48tick signal.

The output of the UpDown FF module can be used as a pulse output. Pulsewitdh depends on the Symmetry setting. Initial on or off depends in the initial direction button. The output is off if the triable is rising and on if the triangle is falling, but an inverted pulse is available on the inverter module imediately following the UpDown FF output.

A very nice feature of the LFO on the Korg MS20 and some more analog synths, is that you can gradually morph the waveform of the LFO from a sawtooth with a falling slope through a triangle wave to a sawtooth with a rising slope. In other words you can control the symmetry of the LFO waveform (regrettably the rate of the LFO slightly changes as well).

Both examples in the patch have some control over the symmetry. The second example would imho be a nice candidate to be implemented into a single module by Clavia, as every parameter is in essence modulatable, still overal tempo is controlled by the midiclock rate.

But as it is all about creating interesting modulation patterns every solution has its own nice features and merits.

I thought that a thorough explanation was in place only to help people better understand the subject.

David Peck wrote:

Many many thanks to all who have recently posted solutions to the issue of syncing LFOs to midi (or re-creating an LFO effect by other means, synced to midi). Lots of useful ideas, suitable for a variety of applications.

Here's a finished patch that makes use of one of the ideas. It's a modified version of the original non-midi-synced patch I sent in a few days ago. The neat thing about this method is that it allows the relative phase of all LFOs to be shifted ahead of the beat or behind the beat (determined by midi clock) with one knob, while all LFOs retain their proper phase relationship to each other. I also included multiple clock dividers under morph control, to select 1/4 note, 1/8th note, 1/16th note, or 1/32nd note tempo relativeto the beat.