Module to count gates

Hi, I’m new to VCV Rack and currently building my own basic synthesizer with the aim to control it almost completely via MIDI with my ALESIS VI49 Controller. One task was to switch the active state of several VCO shapes by pressing a MIDI on/off button. I found a solution to do this, but I found it a bit messy and not really satisfying:

When I activate multiple VCO shapes together via MIDI CC, the volume also increases. To avoid this, I use the Little Utils Multiply/Divide Plugin as an attenuater:

So the mixed signal of the shapes goes into A which gets divided by B what is the number of activated VCO shapes as volt. So 4 volt when all shapes of a VCO are activated. So I just need the number of the activated shapes / midi buttons as volt.

I guess there are a lot of approaches to do this. My first approach was to use the OctaSwitch from ML Modules and pass a constant voltage of 1 to B:

And then use the Sum8 simple summer from ML Modules to count them. (unfortunately cannot post more links as a newb :frowning_face:)

Because I needed to do this a few times, it got a bit messy, so I currently ended up using the A0-106 math module from Submarine to divide the summed gate voltages by 10. But I found this solution also not really satisfying.

Here a screenshot of my current solution:

Long story short: Perfect would be a module that is as simple as the sum module from ML Modules, but instead of summing, it counts the open gates. Does anyone know a single module that does exactly this? Or am I generally thinking too complicated and there is an easier way attenuate the signal automatically?

I’m also thinking about to write such a module since I’m a professional programmer and know C++, but before I dive into this, I want to get sure, this doesn’t already exist. :sunglasses:

A compressor ?

1 Like

Never read in detail about compressors but seems to be a solution when it limits to a certain decibel level. :sunglasses:

1 Like

My “Comp” module is a very popular compressor: SquinkyVCV-main/ at master · kockie69/SquinkyVCV-main · GitHub