stardate 20240421

In a recent blog article, Kevin of diyelectromusic went to some lengths to look at using vactrols for a VCA with an ESP32 project.

I hadn’t intended on reading it all (https://diyelectromusic.wordpress.com/2024/04/20/esp32-dac-envelope-generator-part-2/) but then I opened my gob on mastodon before having done so and recognized, now I was done for. I’d have to see what he was actually up to. This can be quite involving. Kevin does a great job of documenting the minute details of the experimental procedure. Damn it.

This reading all got me thinking, as I use vactrols in my Keep synth and for tremollo effects all being purely analog applications … do I need to learn something on this front?

And the voltages are much higher than those Kevin has to work with. And, curiousity killed the cat.

A tldr:

In short, I built several variants of vactrols I have previously used. From pure dark LDRs with 1+ MegaOhm to pure dark 100 KiloOhm. This time to test with a Nano-like lgt8f328p.

The leds used were all rated for 3-5 volts and I stuck to transparent white ones to eliminate the effects of color (which change the rate and intensity of illumination)).

In any case, the homemade variants were made as I make them for keep with shrink tube in blue in two layers (blue out of vanity/consistency, hence double to block light).

OUT <- ldr 2 | ldr 1 -> pin 9 arduino (pwm)
  ^
  |
2.2uf
  ^
  |
GND -> -LED | +LED -> pin 6 pwm

The circuit is simply PWM audio to one leg of the LDR (tried both Mozzi pin 9 Osc and bit banged on pin 11 with a timer). The second leg of the LDR is connected to audio out and a capacitor (2.2uF) which is grounded. Audio out is amplified by an opamp.

The positive pin of the LED is connected to pin 6 where we do PWM to gradually inlluminate the LED. With the Mozzi examples I used an OSC. Otherwise, I just gradually incremented the values to analogWrite and reset at 8 bits. The negative end of the LED is grounded via a 100 Ohm resistor.

When controlling the vactrol in this way, a high pitched hum found it’s way to the signal. Irrespective of power source (battery/usb). When switching the + of the LED to 5+volts via a potentiometer, the high pitch hum, quel surprise, vanished.

In any case, DIY vactrols can work quite well. But controlling them with a digital circuit will take some care to filter the control noise.

A general rul of thumb is to aim for at least 1 Mega Ohm of resistance at fully dark (LDR5549 is 49K to 1M, I believe) and don’t forget on the output pin of the LDR to add an Elko at 2.2 uF (1 will also work, but 2.2 is cleaner).

So, but for the high pitched artifact of doing PWM to drive the led, it does work as a VCA under digital control. But it’s sub-optimal. Now, driving the LED by other means and it works really well.

Ok, that’s enough for now. I’m just blathering on :)