KEG Klockable Envelope Generator

KEG Clockable Envelope Generator

This is an Audulus recreation of one side of the 4ms PEG “Pingable Envelope Generator”. Like the original it is a combination of a sync-able LFO and AR/ASR envelope generator. The LFO frequency is determined either by using a Tap Tempo button or by feeding the KEG an external clock on the klock input. A multiply/divide control allows the user to set the internal LFO frequency to a multiple of the incoming clock from 8 to 1/8. The duration of the AR envelope is determined by the internal LFO. The relative duration of the attack and release (skew) and shape of the attack and release curves can also be adjusted.
There are two modes of operation, sync and async. In sync mode, the internal LFO remains synchronized with the incoming clock. A gate on the quantized (qnt) input will start an envelope on the next LFO clock. The envelope will repeat while the gate is high. If cycle is on and the incoming clock is divided, the internal LFO and envelope will be re-synced to the next incoming clock if the qnt input is high when the clock is received.
In async mode the envelope rise and fall duration is still determined by the internal LFO, but the LFO and envelope start point is no longer synced to the incoming clock. A gate on the async input enters async mode and will trigger an immediate envelope. If the gate is held high the envelope will sustain until the gate falls. To return to sync mode, apply a gate to the sync input or reset. See the 4ms documentation at: http://4mscompany.com/peg/manuals/PEG_manual_v4.3.pdf for further details.


I/O

Input Signal Range Notes
klock 0-1 gate provides frequency and sync to the KEG. The KEG LFO frequency is set by the last two clocks received and in sync mode will synchronize with the klock signal
async 0-1 gate asyncronous trigger - causes the KEG to enter async mode and produces an immediate envelope. If the gate is held high the envelope will sustain. retriggering before the release has completed will immediately start a new envelope.
qnt 0-1 gate quantized trigger - causes the KEG to enter sync mode and produces an envelope at the beginning of the next KEG LFO clock. If the gate is held high, the envelope will repeat.
reset 0-1 gate resets the KEG

Output Signal Range Notes
env 0-1 modulation envelope output - all envelopes begin and end at 0 and rise to 1 if not interrupted.
c 0-1 clock Internal LFO output
rise 0-1 gate rise gate - high during the attack phase
fall 0-1 gate fall gate - high during the release phase
freq floating point number internal LFO frequency

Controls

Control Function Notes
cyc cycle switch switches cycle mode - when cycle mode is active the envelope will continue to repeat. The input inverts the button state when high.
skew skew control controls the ratio of attack and decay times. Goes from ramp to triangle to reverse ramp
tap tap tempo sets the internal LFO frequency by measuring the time between two taps. Disabled when klock is high.
div-mult clock divide/multiply adjusts the internal LFO frequency from 1/8 to 8 times the incoming clock.
rise%20curve rise segment curve adjusts the curve of the attack portion of the envelope from log to linear to exponential.
fall%20curve fall segment curve adjusts the curve of the release portion of the envelope from log to linear to exponential.

Displays

Meter Displays Notes
scale current multiply/divide factor


Version History

Revision File Date Notes
1.5 KEG Klockable Envelope Generator V1.5.audulus (123.2 KB) 07/17/2018 another rework of the gate logic to improve triggering.
1.4 superceded 07/15/2018 modified rise and fall gate logic so gates are only active during an envelope
1.3 superceded 07/15/2018 fixed quantized gate logic, improved ramp skew, reversed fall curve control to match label
1.2 superceded 07/11/2018 fixed divide by zero problem and reversed knob with skew control
1.1 superceded 07/11/2018 Fixed swapped curve controls
1.0 superceded 07/11/2018 Initial upload

Demos

Revision File Date Notes
1.5 KEG - Klockable Envelope Generator Demo V1.5.audulus (1.0 MB) 07/17/2018 demo with KEG version 1.5
1.4 superceded 07/15/2018 KEG version 1.4
1.3 superseded 07/15/2018 initial upload - includes preliminary rotating clock generator module
2 Likes

Excellent!

I’ve already personalized mine for added faux symmetry. :heart_eyes:

2 Likes

Still working on the trigger logic. It’s a bit flakey at the moment. It’s a complex module and the switching is causing me some headaches. I think it can be worked out, but it might take me a bit of time. Patience is a virtue. :cowboy_hat_face:

1 Like

I think I finally got all the gate logic working. It was one of those tricky timing deals where it would work if a waveform node was attached then stop if you removed it. I included a preliminary version of the 4ms RCD (rotating clock divider). It works but still lacks some of the functionality of the original. (no spread mode). I want to get it closer to the original before I post it in modules. Let me know if you encounter any bugs in either module. :cowboy_hat_face:

2 Likes

Still one “glitch” in the quantized gate logic. If the quantized gate is clocked by the same source as the klock input you would expect that the envelope would start on the current cycle rather than the next one, however this is not currently the case. If the qnt gate arrives at the same time as the klock, the envelope will be delayed to the next cycle. This leads to an envelope every second cycle rather than one per cycle as you would expect.

1 Like

I think V1.5 is getting pretty close. I tried a lot of different approaches to creating a quantized gate. Turned out to be much more difficult than it first appeared. Since nothing in Audulus actually happens simultaneously, when you have logic signals that are very close in time, weird things begin to happen. This one seems pretty stable, but let me know if you find any anomalies. :cowboy_hat_face:

2 Likes

Looks great! Thanks for the upgrade.

1 Like

Beautiful looking module! :slight_smile:

3 Likes

Got lost for hours…

KEG - Demo V1.5(snapshot by FAM).audulus (1.1 MB)

3 Likes

I love to see how others use my stuff! Great patch. :cowboy_hat_face:

1 Like

13%20PM
KEG - Demo V1.5(FAMSNAP 2).audulus (1.3 MB)

1 Like

Can you share the evil twin?

1 Like

10%20PM
KEG - Demo V1.5(snapshot 3 by FAM).audulus (1.3 MB)

1 Like