Hello, today I am going to build a digital LFO CV to turn on-off the VCO output signal, resulting beat and rhythmic patterns within a time frame and this can be sync with external clock sync for controlling the ‘on-off’ tempo. The difference between LFO module and EG (envelope generator) module is that LFO output continues cycle of waveform signals for triggering, pitch shift and dynamic modulation function, while EG output single cycle of waveform only when is triggered for articulating sound event; ADSR function.
LFO was meant not to be an ‘audible’ signal (AC 5V-0-5+) but as a gate or triggering signal like a switch (DC 0-5V+) that is repeating on-off within a time frame or voltage-pitch shift or dynamic-articulation control. This behavior output is based on the shape and pattern of the LFO wave form, amplitude +/- and wave length peak to peak programmed in the digital circuit. However, I will maintain the ‘analog’ circuit for ‘audible signal’ generator in my DIY eurorack module project.
This project will be using an arduino Nano (clone) inspired by Hagiwo (again, thank you for sharing this!) and I will do some simple minor modification by adding vactrol inputs to externally control the LFO parameters. We will be exploring the LFO arduino codes by Hagiwo for various LFO waveform output possibilities and other external controls.
Code sketch from Hagiwo will requiring additional library in arduino IDE: FlexiTimer2 which can be downloaded from arduino playground page or gitHub (download in zip file format) and installed in arduino library as zip file (Sketch>Include Library> Add .ZIP Library then restart IDE).
If you have problems getting the arduino Nano clone to be working with arduino IDE please refer to my previous page here.
The Hagiwo LFO source codes outline i/o summary:
- Set wave frequency output max range at 30Hz (max as LFO), this range can be adjusted at Analog Pin 1 and will effect the amplitude of the wave proportionally (wave stretching like). If external clock is used, the Analog Pin 1 will only change the frequency of the LFO and no ‘wave stretching-squeeze’ like effect occurred.
- Set default internal clock at 60 beat per minutes (1 sec click). – perhaps we can manually change this with external control clock!
- Set types of LFO wave form using wave table array. Hagiwo introduce seven types of DC 0-5V wave forms: saw 1, saw 2 (inverted), sine, triangle, square (pulse), random form (noise), and constant (Attack-Sustain-Release). MOD: However, we can add additional wave form: concave saw, convex saw, inverted concave saw and inverted convex saw.
- Set modulation wave form and wave form variation combination.
- PWM Pin Digital 10 (output) LFO CV signal out (with Schottky diode – reverse current protection).
- PWM Pin Digital 3 (input) External Clock CV signal in (with Schottky diode – reverse current protection).
- Analog Pin 3 (input analog read), to select LFO wave types based on wave form table arrays. However, we can modified this for additional wave form and changes the potentiometer range to trigger the additional array. Instead of using the potentiometer, we can use select switch, but will not be ‘fun’ to press-press for live-performance, lets leave it as it is and keep it simple!.
- Analog Pin 1 (input analog read), to shift the wave phase ‘plot-cycle’ point and stretch or squeeze across time<> resulting slow or fast pulse (peak to peak wider or closer) while continuous changes causing glitch-like and simultaneously lowering or increasing the amplitude. However, when using external sync clock, it will disable and change to LFO frequency variable mode. MOD: VACTROL
- Analog Pin 5 (input analog read), to select modulation / variation of wave form combination and phase variation. MOD: VACTROL
- Analog Pin 0 (input analog read), to amplify signal output (amplitude)
Note that the arduino operates at around 5v+ and it can handle either the 5v+ or 12+DC from the eurorack power supply option and do add a Schottky diode to protect from reverse current across the system, bonus if you can include polyfused component 0.5A)
and so far it is working well. In the future we may experiment to maximise the MCU by doubling all the I/O using multiplex/ I2C?