diff --git a/src/Mutes.cpp b/src/Mutes.cpp index 8d7fb27..4168458 100644 --- a/src/Mutes.cpp +++ b/src/Mutes.cpp @@ -41,7 +41,7 @@ struct Mutes : Module { // Get input // Inputs are normalized to the input above it, so only set if connected - if (inputs[IN_INPUT + i].active) { + if (inputs[IN_INPUT + i].isConnected()) { inputs[IN_INPUT + i].getVoltages(out); channels = inputs[IN_INPUT + i].getChannels(); } diff --git a/src/SEQ3.cpp b/src/SEQ3.cpp index 9cc4368..a381aff 100644 --- a/src/SEQ3.cpp +++ b/src/SEQ3.cpp @@ -125,7 +125,7 @@ struct SEQ3 : Module { bool gateIn = false; if (running) { - if (inputs[EXT_CLOCK_INPUT].active) { + if (inputs[EXT_CLOCK_INPUT].isConnected()) { // External clock if (clockTrigger.process(inputs[EXT_CLOCK_INPUT].getVoltage())) { setIndex(index + 1); diff --git a/src/Scope.cpp b/src/Scope.cpp index 493a89b..abd135b 100644 --- a/src/Scope.cpp +++ b/src/Scope.cpp @@ -88,7 +88,7 @@ struct Scope : Module { // Are we waiting on the next trigger? if (bufferIndex >= BUFFER_SIZE) { // Trigger immediately if external but nothing plugged in, or in Lissajous mode - if (lissajous || (external && !inputs[TRIG_INPUT].active)) { + if (lissajous || (external && !inputs[TRIG_INPUT].isConnected())) { bufferIndex = 0; frameIndex = 0; return; @@ -279,20 +279,20 @@ struct ScopeDisplay : TransparentWidget { // Draw waveforms if (module->lissajous) { // X x Y - if (module->inputs[Scope::X_INPUT].active || module->inputs[Scope::Y_INPUT].active) { + if (module->inputs[Scope::X_INPUT].isConnected() || module->inputs[Scope::Y_INPUT].isConnected()) { nvgStrokeColor(args.vg, nvgRGBA(0x9f, 0xe4, 0x36, 0xc0)); drawWaveform(args, valuesX, valuesY); } } else { // Y - if (module->inputs[Scope::Y_INPUT].active) { + if (module->inputs[Scope::Y_INPUT].isConnected()) { nvgStrokeColor(args.vg, nvgRGBA(0xe1, 0x02, 0x78, 0xc0)); drawWaveform(args, valuesY, NULL); } // X - if (module->inputs[Scope::X_INPUT].active) { + if (module->inputs[Scope::X_INPUT].isConnected()) { nvgStrokeColor(args.vg, nvgRGBA(0x28, 0xb0, 0xf3, 0xc0)); drawWaveform(args, valuesX, NULL); } diff --git a/src/Unity.cpp b/src/Unity.cpp index aeadc2b..e2ff5b9 100644 --- a/src/Unity.cpp +++ b/src/Unity.cpp @@ -43,7 +43,7 @@ struct Unity : Module { // Inputs for (int j = 0; j < 6; j++) { mix[i] += inputs[IN_INPUTS + 6 * i + j].getVoltage(); - if (inputs[IN_INPUTS + 6 * i + j].active) + if (inputs[IN_INPUTS + 6 * i + j].isConnected()) count[i]++; } } diff --git a/src/VCA.cpp b/src/VCA.cpp index 916ee60..37400b4 100644 --- a/src/VCA.cpp +++ b/src/VCA.cpp @@ -30,10 +30,10 @@ struct VCA : Module { void stepChannel(InputIds in, ParamIds level, InputIds lin, InputIds exp, OutputIds out) { float v = inputs[in].getVoltage() * params[level].getValue(); - if (inputs[lin].active) + if (inputs[lin].isConnected()) v *= clamp(inputs[lin].getVoltage() / 10.0f, 0.0f, 1.0f); const float expBase = 50.0f; - if (inputs[exp].active) + if (inputs[exp].isConnected()) v *= rescale(std::pow(expBase, clamp(inputs[exp].getVoltage() / 10.0f, 0.0f, 1.0f)), 1.0f, expBase, 0.0f, 1.0f); outputs[out].setVoltage(v); } diff --git a/src/VCF.cpp b/src/VCF.cpp index c2dd17f..5123473 100644 --- a/src/VCF.cpp +++ b/src/VCF.cpp @@ -92,7 +92,7 @@ struct VCF : Module { } void process(const ProcessArgs &args) override { - if (!outputs[LPF_OUTPUT].active && !outputs[HPF_OUTPUT].active) { + if (!outputs[LPF_OUTPUT].isConnected() && !outputs[HPF_OUTPUT].isConnected()) { outputs[LPF_OUTPUT].setVoltage(0.f); outputs[HPF_OUTPUT].setVoltage(0.f); return; @@ -112,7 +112,7 @@ struct VCF : Module { // Set cutoff frequency float pitch = 0.f; - if (inputs[FREQ_INPUT].active) + if (inputs[FREQ_INPUT].isConnected()) pitch += inputs[FREQ_INPUT].getVoltage() * dsp::quadraticBipolar(params[FREQ_CV_PARAM].getValue()); pitch += params[FREQ_PARAM].getValue() * 10.f - 5.f; pitch += dsp::quadraticBipolar(params[FINE_PARAM].getValue() * 2.f - 1.f) * 7.f / 12.f; @@ -135,10 +135,10 @@ struct VCF : Module { } // Set outputs - if (outputs[LPF_OUTPUT].active) { + if (outputs[LPF_OUTPUT].isConnected()) { outputs[LPF_OUTPUT].setVoltage(5.f * lowpassDecimator.process(lowpassBuf)); } - if (outputs[HPF_OUTPUT].active) { + if (outputs[HPF_OUTPUT].isConnected()) { outputs[HPF_OUTPUT].setVoltage(5.f * highpassDecimator.process(highpassBuf)); } */ diff --git a/src/VCMixer.cpp b/src/VCMixer.cpp index 3f0404d..3085cb5 100644 --- a/src/VCMixer.cpp +++ b/src/VCMixer.cpp @@ -33,13 +33,13 @@ struct VCMixer : Module { for (int i = 0; i < 4; i++) { float ch = inputs[CH_INPUT + i].getVoltage(); ch *= std::pow(params[LVL_PARAM + i].getValue(), 2.f); - if (inputs[CV_INPUT + i].active) + if (inputs[CV_INPUT + i].isConnected()) ch *= clamp(inputs[CV_INPUT + i].getVoltage() / 10.f, 0.f, 1.f); outputs[CH_OUTPUT + i].setVoltage(ch); mix += ch; } mix *= params[MIX_LVL_PARAM].getValue(); - if (inputs[MIX_CV_INPUT].active) + if (inputs[MIX_CV_INPUT].isConnected()) mix *= clamp(inputs[MIX_CV_INPUT].getVoltage() / 10.f, 0.f, 1.f); outputs[MIX_OUTPUT].setVoltage(mix); } diff --git a/src/VCO.cpp b/src/VCO.cpp index e3c906b..187b1e9 100644 --- a/src/VCO.cpp +++ b/src/VCO.cpp @@ -210,23 +210,23 @@ struct VCO : Module { float pitchFine = 3.f * dsp::quadraticBipolar(params[FINE_PARAM].getValue()); float pitchCv = 12.f * inputs[PITCH_INPUT].getVoltage(); - if (inputs[FM_INPUT].active) { + if (inputs[FM_INPUT].isConnected()) { pitchCv += dsp::quadraticBipolar(params[FM_PARAM].getValue()) * 12.f * inputs[FM_INPUT].getVoltage(); } oscillator.setPitch(params[FREQ_PARAM].getValue(), pitchFine + pitchCv); oscillator.setPulseWidth(params[PW_PARAM].getValue() + params[PWM_PARAM].getValue() * inputs[PW_INPUT].getVoltage() / 10.f); - oscillator.syncEnabled = inputs[SYNC_INPUT].active; + oscillator.syncEnabled = inputs[SYNC_INPUT].isConnected(); oscillator.process(args.sampleTime, inputs[SYNC_INPUT].getVoltage()); // Set output - if (outputs[SIN_OUTPUT].active) + if (outputs[SIN_OUTPUT].isConnected()) outputs[SIN_OUTPUT].setVoltage(5.f * oscillator.sin()); - if (outputs[TRI_OUTPUT].active) + if (outputs[TRI_OUTPUT].isConnected()) outputs[TRI_OUTPUT].setVoltage(5.f * oscillator.tri()); - if (outputs[SAW_OUTPUT].active) + if (outputs[SAW_OUTPUT].isConnected()) outputs[SAW_OUTPUT].setVoltage(5.f * oscillator.saw()); - if (outputs[SQR_OUTPUT].active) + if (outputs[SQR_OUTPUT].isConnected()) outputs[SQR_OUTPUT].setVoltage(5.f * oscillator.sqr()); lights[PHASE_POS_LIGHT].setSmoothBrightness(oscillator.light(), args.sampleTime); @@ -315,7 +315,7 @@ struct VCO2 : Module { float pitchCv = params[FREQ_PARAM].getValue() + dsp::quadraticBipolar(params[FM_PARAM].getValue()) * 12.f * inputs[FM_INPUT].getVoltage(); oscillator.setPitch(0.f, pitchCv); - oscillator.syncEnabled = inputs[SYNC_INPUT].active; + oscillator.syncEnabled = inputs[SYNC_INPUT].isConnected(); oscillator.process(deltaTime, inputs[SYNC_INPUT].getVoltage());