BogaudioModules

BogaudioModules for VCV Rack
Log | Files | Refs | README | LICENSE

commit b2d2d81f80984b7603aabe4cf4aea7c79daf7654
parent 5f6ea9ba2331971ea372bb6855b33b3654f922f7
Author: Matt Demanett <matt@demanett.net>
Date:   Fri, 25 May 2018 01:00:59 -0400

Fix VCAmp to show level when no output connected.

Diffstat:
Msrc/VCAmp.cpp | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/VCAmp.cpp b/src/VCAmp.cpp @@ -6,7 +6,7 @@ void VCAmp::onSampleRateChange() { } void VCAmp::step() { - if (inputs[IN_INPUT].active && outputs[OUT_OUTPUT].active) { + if (inputs[IN_INPUT].active) { float level = params[LEVEL_PARAM].value; if (inputs[CV_INPUT].active) { level *= clamp(inputs[CV_INPUT].value, 0.0f, 10.0f) / 10.0f; @@ -15,7 +15,10 @@ void VCAmp::step() { level += minDecibels; _amplifier.setLevel(level); outputs[OUT_OUTPUT].value = _amplifier.next(inputs[IN_INPUT].value); - _rmsLevel = _rms.next(outputs[OUT_OUTPUT].value) / 5.0f; + _rmsLevel = _rms.next(outputs[OUT_OUTPUT].value / 5.0f); + } + else { + _rmsLevel = _rms.next(0.0f); } }