AScustomWorks / AS

VCV Rack Modules
Other
114 stars 16 forks source link

Quad VCA CV Input bug #59

Closed circadiansound closed 2 years ago

circadiansound commented 2 years ago

Hi Alfredo,

Hope all is well on your end.

Just wanted to take a moment to report a bug with the CV input on your Quad VCA.

It seems as though any type of voltage input in the CV channels causes the linear/exponential switches to animate. This even happens with a constant voltage. You can test this by connecting a Befaco Dual Attenuator to a CV input and adjusting the Offest of the Befaco DA.

I've tested this on 2 different Mac OS systems (Catalina and Mojave) running the latest version of Rack (2.0.2 and 2.0.5).

AScustomWorks commented 2 years ago

Hi Simon, thanks for the input! Indeed, that's weird hehe, and it happens both on the QuadVCA and also on the VCA module.

Let's see: the CV input for the linear/exponential switches is intended to react only to a gate, so each gate flips the state of the switch, that part works as expected, but I'll see if there's a way to prevent the switches from going nuts when a constant voltage is present.

circadiansound commented 2 years ago

Thank you for responding so quickly.

I always thought the CV inputs were for CV modulation for each VCA channel, and the switches weren't switchable via CV?

This is how I've always been using your VCA mixer. The CV inputs still seem to affect the VCA, which I imagine is the preferred use. But, this newer CV exp/Lin switch behaviour changes the effect of the VCA.

Is it possible to retain the older configuration from the version 1 module?

AScustomWorks commented 2 years ago

Hi, well, it was always like that, I just updated the code to work fine on V2 hehe. I guess not many people use those ports anyway(not that useful) so I'll change it to work for the VCA channel parameter instead... hopefully no patches will be broken :)

circadiansound commented 2 years ago

That is weird. Your Quad VCA is and has been my goto VCA.

The CV inputs always behaved as standard VCA CV ins, which modulate the level of each VCA. The way the V2 Quad VCA works is still quite close to the V1 build. The only difference I noticed was that the VCA type switches would animate. I just tested the V1 and V2 against each other, and the behaviour still seems the same, with the exception of the animated switches.

There was some awkward behaviour I'm trying to reproduce, as I couldn't reproduce it on the Mac I was testing on today (due to it being an older Mac where some other devs modules crash the browser). I will try to reproduce it again on my newer Mac.

The main issue I was having is the CV animating the behaviour switches has/had effect over the audio, like modulating between the lin/exp modes, instead of just modulating the VCA level, which was visible on a scope (to confirm).

Either way, you're taking a look at it, so thank you!

I love this module, it's compact, and the fact it's also a mixer works well with a lot of my patching techniques.

AScustomWorks commented 2 years ago

Hi there!, sorry fro the delay to get back to this, let's see if the video embed works (just to be sure this is how it's supposed to work before committing. It would be the same change for each channel of the VCA and QUAD VCA)

https://user-images.githubusercontent.com/34798768/162555637-909fa77c-83ac-44a4-875b-34fe9328efa6.mp4

circadiansound commented 2 years ago

Hi Alfredo,

Glad to see you've worked on a fix. From the video below, it seems to behave as it should now. Since our last conversation, I thought I'd take a crack at it for my own personal use because I needed the old behaviour back. I found deleting the lines which allow the CV ins to affect the lin/exp switches did the trick. This is what one channel looked like after I removed those lines and got it working like how it use to.


//QuadVCA 1
        float out = 0.0;
        v1 = inputs[IN1_INPUT].getVoltage() * params[GAIN1_PARAM].getValue();

        if(inputs[GAIN1_CV_INPUT].isConnected()){
            if(params[MODE1_PARAM].getValue()==1){
                v1 *= clamp(inputs[GAIN1_CV_INPUT].getVoltage() / 10.0f, 0.0f, 1.0f);
            }else{
                v1 *= rescale(powf(expBase, clamp(inputs[GAIN1_CV_INPUT].getVoltage() / 10.0f, 0.0f, 1.0f)), 1.0f, expBase, 0.0f, 1.0f);
            }
        }
        out+=v1;
        lights[GAIN1_LIGHT].setSmoothBrightness(fmaxf(0.0f, out / 5.0f), args.sampleTime);
        if (outputs[OUT1_OUTPUT].isConnected()) {
                outputs[OUT1_OUTPUT].setVoltage(out);
                out = 0.0f;
        }

By the way. I found that when looking at the passed thru signal on a scope (with the behaviour in the plugin manager version) shows some really awkward high frequency modulation happening, as a byproduct of the channel switches modulating between lin and exp. So keeping them static and not modulating is a more standard use case, that would avoid the extra high frequency modulation. Either way, I'm glad you worked on a fix.

circadiansound commented 2 years ago

Just to double check. It's these lines that need to be removed to get the VCAs back to their old way of working. I'm assuming the master (v2) branch still has the old code, before you commit.


if(inputs[GAIN1_CV_INPUT].getVoltage()){
            env1_mode_cv =! env1_mode_cv;
            params[MODE1_PARAM].setValue(env1_mode_cv);
        }
AScustomWorks commented 2 years ago

Yes, it seems like I intended to add the extra ports for lin/exp cv control but there's no space left... somehow forgot about removing the extra code🤦🏻‍♂️

I'll remove that and send a new commit😉

circadiansound commented 2 years ago

Hi Alfredo,

I wanted to follow up and let you know I tested the VCAs from the recent submit to the plugin manager. The lin/exp issues seems to be fixed now, but, the channels now need to have a cv signal connected to the cv inputs to pass audio, which prevents certain creative routings and also being able to use the channels as a simple level attenuator. The original behaviour allows this pass thru without having to use a cv signal, as most other VCAs behave this way.

AScustomWorks commented 2 years ago

Hi, my fault hehe, everything should be fine now. Can you compile from source to test before I send the update to the VCV library?

circadiansound commented 2 years ago

Just built from source and tested. All seems back to working order.

Thank you for making the time to fix these up 😁

AScustomWorks commented 2 years ago

This update is already available on VCV RACK library, closing now ;)