diff --git a/README.md b/README.md index c96c99d..9c380f3 100755 --- a/README.md +++ b/README.md @@ -22,6 +22,10 @@ Buy them on the [VCV plugin library](https://vcvrack.com/plugins.html#Alfredo%20 # AS modules +### V 2.0.4 + +Reverted back part of the code for the VCA and QUADVCA modules, all should be fine now (thanks to circadiansound for finding the bug) + ### V 2.0.3 Removed some leftover extra code on VCA and QUADVCA modules that caused wrong behavior when using the CV Level ports (thanks to circadiansound for finding the bug) diff --git a/plugin.json b/plugin.json index 7e57275..cd85504 100644 --- a/plugin.json +++ b/plugin.json @@ -1,6 +1,6 @@ { "slug": "AS", - "version": "2.0.3", + "version": "2.0.4", "license": "MIT", "name": "AS", "brand": "AS", diff --git a/src/QuadVCA.cpp b/src/QuadVCA.cpp index 6d32ff4..b1e1419 100755 --- a/src/QuadVCA.cpp +++ b/src/QuadVCA.cpp @@ -94,13 +94,13 @@ struct QuadVCA : Module { float out = 0.0; v1 = inputs[IN1_INPUT].getVoltage() * params[GAIN1_PARAM].getValue(); - //if(inputs[GAIN1_CV_INPUT].isConnected()){ + 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()) { @@ -109,13 +109,13 @@ struct QuadVCA : Module { } //QuadVCA 2 v2 = inputs[IN2_INPUT].getVoltage() * params[GAIN2_PARAM].getValue(); - //if(inputs[GAIN2_CV_INPUT].isConnected()){ + if(inputs[GAIN2_CV_INPUT].isConnected()){ if(params[MODE2_PARAM].getValue()){ v2 *= clamp(inputs[GAIN2_CV_INPUT].getVoltage() / 10.0f, 0.0f, 1.0f); }else{ v2 *= rescale(powf(expBase, clamp(inputs[GAIN2_CV_INPUT].getVoltage() / 10.0f, 0.0f, 1.0f)), 1.0f, expBase, 0.0f, 1.0f); } - //} + } out+=v2; lights[GAIN2_LIGHT].setSmoothBrightness(fmaxf(0.0f, out / 5.0f), args.sampleTime); if (outputs[OUT2_OUTPUT].isConnected()) { @@ -125,13 +125,13 @@ struct QuadVCA : Module { //QuadVCA 3 v3 = inputs[IN3_INPUT].getVoltage() * params[GAIN3_PARAM].getValue(); - //if(inputs[GAIN3_CV_INPUT].isConnected()){ + if(inputs[GAIN3_CV_INPUT].isConnected()){ if(params[MODE3_PARAM].getValue()){ v3 *= clamp(inputs[GAIN3_CV_INPUT].getVoltage() / 10.0f, 0.0f, 1.0f); }else{ v3 *= rescale(powf(expBase, clamp(inputs[GAIN3_CV_INPUT].getVoltage() / 10.0f, 0.0f, 1.0f)), 1.0f, expBase, 0.0f, 1.0f); } - //} + } out+=v3; lights[GAIN3_LIGHT].setSmoothBrightness(fmaxf(0.0f, out / 5.0f), args.sampleTime); if (outputs[OUT3_OUTPUT].isConnected()) { @@ -141,13 +141,13 @@ struct QuadVCA : Module { //QuadVCA 4 v4 = inputs[IN4_INPUT].getVoltage() * params[GAIN4_PARAM].getValue(); - //if(inputs[GAIN4_CV_INPUT].isConnected()){ + if(inputs[GAIN4_CV_INPUT].isConnected()){ if(params[MODE4_PARAM].getValue()){ v4 *= clamp(inputs[GAIN4_CV_INPUT].getVoltage() / 10.0f, 0.0f, 1.0f); }else{ v4 *= rescale(powf(expBase, clamp(inputs[GAIN4_CV_INPUT].getVoltage() / 10.0f, 0.0f, 1.0f)), 1.0f, expBase, 0.0f, 1.0f); } - //} + } out+=v4; lights[GAIN4_LIGHT].setSmoothBrightness(fmaxf(0.0f, out / 5.0f), args.sampleTime); if (outputs[OUT4_OUTPUT].isConnected()) { diff --git a/src/VCA.cpp b/src/VCA.cpp index 3fee481..830b7a1 100755 --- a/src/VCA.cpp +++ b/src/VCA.cpp @@ -55,27 +55,26 @@ struct VCA : Module { void process(const ProcessArgs &args) override { //VCA 1 - v1 = inputs[IN1_INPUT].getVoltage() * params[LEVEL1_PARAM].getValue(); - //if(inputs[ENV1_INPUT].isConnected()){ + if(inputs[ENV1_INPUT].isConnected()){ if(params[MODE1_PARAM].getValue()==1){ v1 *= clamp(inputs[ENV1_INPUT].getVoltage() / 10.0f, 0.0f, 1.0f); }else{ v1 *= rescale(powf(expBase, clamp(inputs[ENV1_INPUT].getVoltage() / 10.0f, 0.0f, 1.0f)), 1.0f, expBase, 0.0f, 1.0f); } - //} + } outputs[OUT1_OUTPUT].setVoltage(v1); //VCA 2 v2 = inputs[IN2_INPUT].getVoltage() * params[LEVEL2_PARAM].getValue(); - //if(inputs[ENV2_INPUT].isConnected()){ + if(inputs[ENV2_INPUT].isConnected()){ if(params[MODE2_PARAM].getValue()){ v2 *= clamp(inputs[ENV2_INPUT].getVoltage() / 10.0f, 0.0f, 1.0f); }else{ v2 *= rescale(powf(expBase, clamp(inputs[ENV2_INPUT].getVoltage() / 10.0f, 0.0f, 1.0f)), 1.0f, expBase, 0.0f, 1.0f); } - //} + } outputs[OUT2_OUTPUT].setVoltage(v2); }