Programmable Envelope Detector

The concept of an envelope follower is simple enough: If you drew a line on a piece of paper slowly from left to right while listening to a piece of music, moving the pencil up and down as the music got louder or softer, the resulting shape would describe the amplitude envelope of the music you heard. The act of translating (in real time) what you hear to an envelope shape is exactly what an envelope follower does.

An envelope follower produces a voltage that corresponds to incoming amplitude. The absence of an audio signal at the input results in 0 volts output, while the presence of a loud signal might be +5V PP or greater. An onboard VCA controls the amplitude to prevent clipping or overdriving the playback system.

Other features common to envelope followers include specifying how quickly or slowly to respond to changes in amplitude (aka slewing), or specifying a threshold above which a particular action is taken (aka transient detection). Audio compressors and limiters do both of these things.

Thus, depending on how the envelope follower is configured, it can emit a steady voltage that slowly fluctuates with the loudness of the source material, or it can respond very fast and only spit out pulses whenever a certain loudness threshold is reached.

I’ve called this patch a programmable envelope detector (as opposed to follower), because while it can do both, its primary focus is that of detecting transient peaks for the purpose of generating regular pulses from an audio source. It’s programmable in that it can be configured a variety of ways to perform differently, depending on the type and frequency of pulses you wish to generate.

For this patch you may need the following. Depending on your source material you may not need all of these components. See the update at the end of this write-up for a streamlined version of this patch that's good for simple (sparse) audio sources, or if you don't need to generate multiple pulses from your source.

  • An audio source: This might be an old drum machine or perhaps a sampled drum break or other rhythmic audio loop that you want to use as the master clock.
  • A VCF: The various outputs (LO, HI, BAND, NOTCH) common to most filters will be useful to isolate the elements that provide the best (or most interesting) pulses. 
  • Schmitt Trigger (STR): This will square up your filtered audio pulses and make more usable triggers out of them.
  • Optional: Pulse Divider (PDIV) or ÷N Comparator (NCOM). If the triggers sent from the Schmitt Trigger are too much for the PCO's SYNC input to handle, you can divide out the extra pulses before sending them to the PCO.
  • Precision VCO (PCO) in LFO mode. This will be synced to your audio source.
  • An inverter, such as the Scaling Buffer, to flip the rising ramp from the LFO into a sawtooth (falling ramp) waveform usable as a trigger.
  • Dual Transient Generator (DTG), or the right-hand side of the VC TimeGen Oscillator (TGO) or VC TimeGen Clock (TGC): If you need more clock triggers than you're getting from your audio source, this will be your multiplier. Adjusting the FALL time can be used to double the frequency of pulses seen downstream, or to create irregular timing in the final clock output.
  • Processor (PRC): This is where the triggers from the LFO and DTG are combined before being forwarded on to the DSG or the unused half of the DTG.
  • Dual Universal Slope Generator (DSG) or Dual Transient Generator (DTG): This spits out your final clock pulse train from the triggers sent from the Processor.
  • Clock recipient(s): This patch programmable envelope detector can be used to clock a TKB or other sequencer, slope and envelope generators, or anything else that you'd normally clock.


Syncing synthesizers, drum machines, MIDI devices, etc. can often be done using tools available on those devices; such as CV triggers, DIN-sync, MIDI clock and so on. But not all studio devices have such tools, notably older drum machines that pre-date DIN-sync or MIDI, or which didn’t have so much as a trigger output. Audio samples can also be tricky to sync with other instruments.

This is where an envelope follower, or detector, can be useful. One version of the situation is that your audio source is simple and sparse, with easily identifiable and regularly occurring transients that could be used to create a stable clock against which to sync your other instruments. Another version is that your audio source is sonically dense, or which contains clear but irregular transients. In either case, clear transients is really the key to generating clock. Without them, the best you may get is amplitude envelope following behavior, which doesn’t lend itself to generating clock — unless the amplitude envelope happens to be a repeated pattern (in which case, you may still benefit from this patch).

The essence of this patch is identifying and isolating transients in order to translate them into clock pulses. It can also square up an irregular rhythm and generate a regular pulse train from it, with the added flexibility, using a form of pulse-width modulation (PWM), to make your stream of pulses less than regular if needed — from slightly swung to downright lumpy.


*** Update ***

While working on a patch for a piece of music, I decided late in the game to change my clock source from a self-cycling DTG to my Korg drum machine. Thinking back to this envelope detector patch I realized I was already using my VCFQ and all of my DSGs...

From my work on this article, I knew that a source with more pronounced transients (e.g. a simple drum machine pattern without lots of hi-hat or cymbals) is easier to work with when it comes to clocking. Since my drum machine pattern was sparse and simple I omitted the detection and cleanup part of the patch (VCFQ and STR), and since I didn't require two independently controllable pulse streams I omitted the pulse mixing and processing part (PRC and DUSG).

So here's a streamlined version of the patch. I let the Korg drum machine go for over 90 minutes and the clock tracking was still spot-on!


No comments:

Post a Comment