BogaudioModules

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

commit 10fdd1b0f92fc0cedfacf0adbc3812299e97bb92
parent e9aedd4c77d07a1cd122d75b6739e6bcfa15e751
Author: Matt Demanett <matt@demanett.net>
Date:   Sat, 18 May 2019 23:48:32 -0400

v1: config(), setModule(), configParam() more places.

Diffstat:
Msrc/Analyzer.hpp | 4++++
Msrc/EightFO.cpp | 14+++++++-------
Msrc/EightFO.hpp | 15+++++++++++++++
Msrc/LFO.hpp | 7+++++++
Msrc/LLFO.hpp | 6++++++
Msrc/Manual.hpp | 1-
Msrc/Mix4.cpp | 30++++++++++++------------------
Msrc/Mix4.hpp | 20++++++++++++++++++--
Msrc/Mix8.cpp | 12+++---------
Msrc/Mix8.hpp | 32++++++++++++++++++++++++++++++--
Msrc/Offset.hpp | 6+++---
Msrc/Sums.hpp | 1-
Msrc/Switch.cpp | 7++++---
Msrc/Switch.hpp | 5++++-
Msrc/Test.hpp | 13++++++-------
Msrc/VCM.hpp | 1-
Msrc/analyzer_base.hpp | 8++++----
Msrc/disable_output_limit.hpp | 8++++----
Msrc/lfo_base.hpp | 8+++++---
Msrc/trigger_on_load.hpp | 5++---
20 files changed, 134 insertions(+), 69 deletions(-)

diff --git a/src/Analyzer.hpp b/src/Analyzer.hpp @@ -49,6 +49,10 @@ struct Analyzer : AnalyzerBase { int _modulationStep = 0; Analyzer() : AnalyzerBase(4, NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS) { + createParam(RANGE2_PARAM, -1.0f, 1.0f, 0.0f); + createParam(SMOOTH_PARAM, 0.0f, 1.0f, 0.5f); + createParam(QUALITY_PARAM, 1.0f, 3.0f, 1.0f); + createParam(WINDOW_PARAM, 1.0f, 3.0f, 1.0f); onReset(); } virtual ~Analyzer() { diff --git a/src/EightFO.cpp b/src/EightFO.cpp @@ -220,10 +220,10 @@ struct EightFOWidget : LFOBaseWidget { auto slowLightPosition = Vec(86.0, 335.0); // end generated by svg_widgets.rb - _frequencyKnob = createParam<Knob68>(frequencyParamPosition, module, EightFO::FREQUENCY_PARAM, -8.0, 5.0, 0.0); + _frequencyKnob = createParam<Knob68>(frequencyParamPosition, module, EightFO::FREQUENCY_PARAM); addParam(_frequencyKnob); { - auto w = createParam<Knob16>(waveParamPosition, module, EightFO::WAVE_PARAM, 1.0, 5.0, 3.0); + auto w = createParam<Knob16>(waveParamPosition, module, EightFO::WAVE_PARAM); auto k = dynamic_cast<SVGKnob*>(w); k->snap = true; k->minAngle = 0.0; @@ -231,10 +231,10 @@ struct EightFOWidget : LFOBaseWidget { k->speed = 3.0; addParam(w); } - addParam(createParam<StatefulButton9>(slowParamPosition, module, EightFO::SLOW_PARAM, 0.0, 1.0, 0.0)); - addParam(createParam<Knob26>(samplePwmParamPosition, module, EightFO::SAMPLE_PWM_PARAM, -1.0, 1.0, 0.0)); - addParam(createParam<Knob26>(offsetParamPosition, module, EightFO::OFFSET_PARAM, -1.0, 1.0, 0.0)); - addParam(createParam<Knob26>(scaleParamPosition, module, EightFO::SCALE_PARAM, 0.0, 1.0, 1.0)); + addParam(createParam<StatefulButton9>(slowParamPosition, module, EightFO::SLOW_PARAM)); + addParam(createParam<Knob26>(samplePwmParamPosition, module, EightFO::SAMPLE_PWM_PARAM)); + addParam(createParam<Knob26>(offsetParamPosition, module, EightFO::OFFSET_PARAM)); + addParam(createParam<Knob26>(scaleParamPosition, module, EightFO::SCALE_PARAM)); addPhaseParam(phase7ParamPosition, module, EightFO::PHASE7_PARAM, Phasor::phaseToRadians(basePhase7Offset)); addPhaseParam(phase6ParamPosition, module, EightFO::PHASE6_PARAM, Phasor::phaseToRadians(basePhase6Offset)); @@ -272,7 +272,7 @@ struct EightFOWidget : LFOBaseWidget { } void addPhaseParam(const Vec& position, Module* module, EightFO::ParamsIds paramId, float rotation) { - auto w = createParam<Knob16>(position, module, paramId, -1.0, 1.0, 0.0); + auto w = createParam<Knob16>(position, module, paramId); auto k = dynamic_cast<SVGKnob*>(w); k->minAngle += 0.5 * M_PI - rotation; k->maxAngle += 0.5 * M_PI - rotation; diff --git a/src/EightFO.hpp b/src/EightFO.hpp @@ -117,6 +117,21 @@ struct EightFO : LFOBase { bool _phase0Active = false; EightFO() : LFOBase(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS) { + configParam(FREQUENCY_PARAM, -8.0, 5.0, 0.0, "frequency"); + configParam(WAVE_PARAM, 1.0, 5.0, 3.0, "wave"); + configParam(SLOW_PARAM, 0.0, 1.0, 0.0, "slow"); + configParam(SAMPLE_PWM_PARAM, -1.0, 1.0, 0.0, "sample/pwm"); + configParam(OFFSET_PARAM, -1.0, 1.0, 0.0, "offset"); + configParam(SCALE_PARAM, 0.0, 1.0, 1.0, "scale"); + configParam(PHASE7_PARAM, -1.0, 1.0, 0.0, "phase"); + configParam(PHASE6_PARAM, -1.0, 1.0, 0.0, "phase"); + configParam(PHASE5_PARAM, -1.0, 1.0, 0.0, "phase"); + configParam(PHASE4_PARAM, -1.0, 1.0, 0.0, "phase"); + configParam(PHASE3_PARAM, -1.0, 1.0, 0.0, "phase"); + configParam(PHASE2_PARAM, -1.0, 1.0, 0.0, "phase"); + configParam(PHASE1_PARAM, -1.0, 1.0, 0.0, "phase"); + configParam(PHASE0_PARAM, -1.0, 1.0, 0.0f, "phase"); + onReset(); onSampleRateChange(); } diff --git a/src/LFO.hpp b/src/LFO.hpp @@ -74,6 +74,13 @@ struct LFO : LFOBase { bool _squareActive = false; LFO() : LFOBase(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS) { + configParam(FREQUENCY_PARAM, -8.0f, 5.0f, 0.0f, "frequency"); + configParam(SLOW_PARAM, 0.0f, 1.0f, 0.0f, "slow"); + configParam(SAMPLE_PARAM, 0.0f, 1.0f, 0.0f, "sample"); + configParam(PW_PARAM, -1.0f, 1.0f, 0.0f, "pw"); + configParam(OFFSET_PARAM, -1.0f, 1.0f, 0.0f, "offset"); + configParam(SCALE_PARAM, 0.0f, 1.0f, 1.0f, "scale"); + onReset(); onSampleRateChange(); } diff --git a/src/LLFO.hpp b/src/LLFO.hpp @@ -73,6 +73,12 @@ struct LLFO : LFOBase { , _invert(false) , _oscillator(&_sine) { + configParam(FREQUENCY_PARAM, -8.0f, 5.0f, 0.0f, "frequency"); + configParam(WAVE_PARAM, 1.0f, 5.0f, 3.0f, "wave"); + configParam(SLOW_PARAM, 0.0f, 1.0f, 0.0f, "slow"); + configParam(OFFSET_PARAM, -1.0f, 1.0f, 0.0f, "offset"); + configParam(SCALE_PARAM, 0.0f, 1.0f, 1.0f, "scale"); + onReset(); onSampleRateChange(); } diff --git a/src/Manual.hpp b/src/Manual.hpp @@ -38,7 +38,6 @@ struct Manual : TriggerOnLoadModule { Manual() : TriggerOnLoadModule(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS) { configParam(TRIGGER_PARAM, 0.0f, 1.0f, 0.0f, "trigger"); - _triggerOnLoad = false; onReset(); } diff --git a/src/Mix4.cpp b/src/Mix4.cpp @@ -70,7 +70,8 @@ void Mix4::process(const ProcessArgs& args) { struct Mix4Widget : ModuleWidget { static constexpr int hp = 15; - Mix4Widget(Mix4* module) : ModuleWidget(module) { + Mix4Widget(Mix4* module) { + setModule(module); box.size = Vec(RACK_GRID_WIDTH * hp, RACK_GRID_HEIGHT); { @@ -120,19 +121,19 @@ struct Mix4Widget : ModuleWidget { // end generated by svg_widgets.rb addSlider(level1ParamPosition, module, Mix4::LEVEL1_PARAM, module ? &module->_channel1.rms : NULL); - addParam(createParam<Knob16>(pan1ParamPosition, module, Mix4::PAN1_PARAM, -1.0, 1.0, 0.0)); - addParam(createParam<SoloMuteButton>(mute1ParamPosition, module, Mix4::MUTE1_PARAM, 0.0, 3.0, 0.0)); + addParam(createParam<Knob16>(pan1ParamPosition, module, Mix4::PAN1_PARAM)); + addParam(createParam<SoloMuteButton>(mute1ParamPosition, module, Mix4::MUTE1_PARAM)); addSlider(level2ParamPosition, module, Mix4::LEVEL2_PARAM, module ? &module->_channel2.rms : NULL); - addParam(createParam<Knob16>(pan2ParamPosition, module, Mix4::PAN2_PARAM, -1.0, 1.0, 0.0)); - addParam(createParam<SoloMuteButton>(mute2ParamPosition, module, Mix4::MUTE2_PARAM, 0.0, 3.0, 0.0)); + addParam(createParam<Knob16>(pan2ParamPosition, module, Mix4::PAN2_PARAM)); + addParam(createParam<SoloMuteButton>(mute2ParamPosition, module, Mix4::MUTE2_PARAM)); addSlider(level3ParamPosition, module, Mix4::LEVEL3_PARAM, module ? &module->_channel3.rms : NULL); - addParam(createParam<Knob16>(pan3ParamPosition, module, Mix4::PAN3_PARAM, -1.0, 1.0, 0.0)); - addParam(createParam<SoloMuteButton>(mute3ParamPosition, module, Mix4::MUTE3_PARAM, 0.0, 3.0, 0.0)); + addParam(createParam<Knob16>(pan3ParamPosition, module, Mix4::PAN3_PARAM)); + addParam(createParam<SoloMuteButton>(mute3ParamPosition, module, Mix4::MUTE3_PARAM)); addSlider(level4ParamPosition, module, Mix4::LEVEL4_PARAM, module ? &module->_channel4.rms : NULL); - addParam(createParam<Knob16>(pan4ParamPosition, module, Mix4::PAN4_PARAM, -1.0, 1.0, 0.0)); - addParam(createParam<SoloMuteButton>(mute4ParamPosition, module, Mix4::MUTE4_PARAM, 0.0, 3.0, 0.0)); + addParam(createParam<Knob16>(pan4ParamPosition, module, Mix4::PAN4_PARAM)); + addParam(createParam<SoloMuteButton>(mute4ParamPosition, module, Mix4::MUTE4_PARAM)); addSlider(mixParamPosition, module, Mix4::MIX_PARAM, module ? &module->_rmsLevel : NULL); - addParam(createParam<MuteButton>(mixMuteParamPosition, module, Mix4::MIX_MUTE_PARAM, 0.0, 1.0, 0.0)); + addParam(createParam<MuteButton>(mixMuteParamPosition, module, Mix4::MIX_MUTE_PARAM)); addInput(createInput<Port24>(cv1InputPosition, module, Mix4::CV1_INPUT)); addInput(createInput<Port24>(pan1InputPosition, module, Mix4::PAN1_INPUT)); @@ -153,14 +154,7 @@ struct Mix4Widget : ModuleWidget { } void addSlider(Vec position, Mix4* module, int id, float* rms) { - auto slider = createParam<VUSlider151>( - position, - module, - id, - 0.0, - 1.0, - fabsf(MixerChannel::minDecibels) / (MixerChannel::maxDecibels - MixerChannel::minDecibels) - ); + auto slider = createParam<VUSlider151>(position, module, id); if (rms) { dynamic_cast<VUSlider*>(slider)->setVULevel(rms); } diff --git a/src/Mix4.hpp b/src/Mix4.hpp @@ -67,12 +67,28 @@ struct Mix4 : Module { float _rmsLevel = 0.0f; Mix4() - : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS) - , _channel1(params[LEVEL1_PARAM], params[PAN1_PARAM], params[MUTE1_PARAM], inputs[IN1_INPUT], inputs[CV1_INPUT], inputs[PAN1_INPUT]) + : _channel1(params[LEVEL1_PARAM], params[PAN1_PARAM], params[MUTE1_PARAM], inputs[IN1_INPUT], inputs[CV1_INPUT], inputs[PAN1_INPUT]) , _channel2(params[LEVEL2_PARAM], params[PAN2_PARAM], params[MUTE2_PARAM], inputs[IN2_INPUT], inputs[CV2_INPUT], inputs[PAN2_INPUT]) , _channel3(params[LEVEL3_PARAM], params[PAN3_PARAM], params[MUTE3_PARAM], inputs[IN3_INPUT], inputs[CV3_INPUT], inputs[PAN3_INPUT]) , _channel4(params[LEVEL4_PARAM], params[PAN4_PARAM], params[MUTE4_PARAM], inputs[IN4_INPUT], inputs[CV4_INPUT], inputs[PAN4_INPUT]) { + config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS); + float levelDefault = fabsf(MixerChannel::minDecibels) / (MixerChannel::maxDecibels - MixerChannel::minDecibels)); + configParam(LEVEL1_PARAM, 0.0f, 1.0f, levelDefault); + configParam(PAN1_PARAM, -1.0f, 1.0f, 0.0); + configParam(MUTE1_PARAM, 0.0f, 3.0f, 0.0); + configParam(LEVEL2_PARAM, 0.0f, 1.0f, levelDefault); + configParam(PAN2_PARAM, -1.0f, 1.0f, 0.0); + configParam(MUTE2_PARAM, 0.0f, 3.0f, 0.0); + configParam(LEVEL3_PARAM, 0.0f, 1.0f, levelDefault); + configParam(PAN3_PARAM, -1.0f, 1.0f, 0.0); + configParam(MUTE3_PARAM, 0.0f, 3.0f, 0.0); + configParam(LEVEL4_PARAM, 0.0f, 1.0f, levelDefault); + configParam(PAN4_PARAM, -1.0f, 1.0f, 0.0); + configParam(MUTE4_PARAM, 0.0f, 3.0f, 0.0); + configParam(MIX_PARAM, 0.0f, 1.0f, levelDefault); + configParam(MIX_MUTE_PARAM, 0.0f, 3.0f, 0.0); + onSampleRateChange(); _rms.setSensitivity(0.05f); } diff --git a/src/Mix8.cpp b/src/Mix8.cpp @@ -94,7 +94,8 @@ void Mix8::process(const ProcessArgs& args) { struct Mix8Widget : ModuleWidget { static constexpr int hp = 27; - Mix8Widget(Mix8* module) : ModuleWidget(module) { + Mix8Widget(Mix8* module) { + setModule(module); box.size = Vec(RACK_GRID_WIDTH * hp, RACK_GRID_HEIGHT); { @@ -225,14 +226,7 @@ struct Mix8Widget : ModuleWidget { } void addSlider(Vec position, Mix8* module, int id, float* rms) { - auto slider = createParam<VUSlider151>( - position, - module, - id, - 0.0, - 1.0, - fabsf(MixerChannel::minDecibels) / (MixerChannel::maxDecibels - MixerChannel::minDecibels) - ); + auto slider = createParam<VUSlider151>(position, module, id); if (rms) { dynamic_cast<VUSlider*>(slider)->setVULevel(rms); } diff --git a/src/Mix8.hpp b/src/Mix8.hpp @@ -95,8 +95,7 @@ struct Mix8 : Module { float _rmsLevel = 0.0f; Mix8() - : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS) - , _channel1(params[LEVEL1_PARAM], params[PAN1_PARAM], params[MUTE1_PARAM], inputs[IN1_INPUT], inputs[CV1_INPUT], inputs[PAN1_INPUT]) + : _channel1(params[LEVEL1_PARAM], params[PAN1_PARAM], params[MUTE1_PARAM], inputs[IN1_INPUT], inputs[CV1_INPUT], inputs[PAN1_INPUT]) , _channel2(params[LEVEL2_PARAM], params[PAN2_PARAM], params[MUTE2_PARAM], inputs[IN2_INPUT], inputs[CV2_INPUT], inputs[PAN2_INPUT]) , _channel3(params[LEVEL3_PARAM], params[PAN3_PARAM], params[MUTE3_PARAM], inputs[IN3_INPUT], inputs[CV3_INPUT], inputs[PAN3_INPUT]) , _channel4(params[LEVEL4_PARAM], params[PAN4_PARAM], params[MUTE4_PARAM], inputs[IN4_INPUT], inputs[CV4_INPUT], inputs[PAN4_INPUT]) @@ -105,6 +104,35 @@ struct Mix8 : Module { , _channel7(params[LEVEL7_PARAM], params[PAN7_PARAM], params[MUTE7_PARAM], inputs[IN7_INPUT], inputs[CV7_INPUT], inputs[PAN7_INPUT]) , _channel8(params[LEVEL8_PARAM], params[PAN8_PARAM], params[MUTE8_PARAM], inputs[IN8_INPUT], inputs[CV8_INPUT], inputs[PAN8_INPUT]) { + config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS); + float levelDefault = fabsf(MixerChannel::minDecibels) / (MixerChannel::maxDecibels - MixerChannel::minDecibels)); + configParam(LEVEL1_PARAM, 0.0f, 1.0f, levelDefault); + configParam(PAN1_PARAM, -1.0f, 1.0f, 0.0); + configParam(MUTE1_PARAM, 0.0f, 3.0f, 0.0); + configParam(LEVEL2_PARAM, 0.0f, 1.0f, levelDefault); + configParam(PAN2_PARAM, -1.0f, 1.0f, 0.0); + configParam(MUTE2_PARAM, 0.0f, 3.0f, 0.0); + configParam(LEVEL3_PARAM, 0.0f, 1.0f, levelDefault); + configParam(PAN3_PARAM, -1.0f, 1.0f, 0.0); + configParam(MUTE3_PARAM, 0.0f, 3.0f, 0.0); + configParam(LEVEL4_PARAM, 0.0f, 1.0f, levelDefault); + configParam(PAN4_PARAM, -1.0f, 1.0f, 0.0); + configParam(MUTE4_PARAM, 0.0f, 3.0f, 0.0); + configParam(LEVEL5_PARAM, 0.0f, 1.0f, levelDefault); + configParam(PAN5_PARAM, -1.0f, 1.0f, 0.0); + configParam(MUTE5_PARAM, 0.0f, 3.0f, 0.0); + configParam(LEVEL6_PARAM, 0.0f, 1.0f, levelDefault); + configParam(PAN6_PARAM, -1.0f, 1.0f, 0.0); + configParam(MUTE6_PARAM, 0.0f, 3.0f, 0.0); + configParam(LEVEL7_PARAM, 0.0f, 1.0f, levelDefault); + configParam(PAN7_PARAM, -1.0f, 1.0f, 0.0); + configParam(MUTE7_PARAM, 0.0f, 3.0f, 0.0); + configParam(LEVEL8_PARAM, 0.0f, 1.0f, levelDefault); + configParam(PAN8_PARAM, -1.0f, 1.0f, 0.0); + configParam(MUTE8_PARAM, 0.0f, 3.0f, 0.0); + configParam(MIX_PARAM, 0.0f, 1.0f, levelDefault); + configParam(MIX_MUTE_PARAM, 0.0f, 3.0f, 0.0); + onSampleRateChange(); _rms.setSensitivity(0.05f); } diff --git a/src/Offset.hpp b/src/Offset.hpp @@ -26,10 +26,10 @@ struct Offset : DisableOutputLimitModule { NUM_OUTPUTS }; - Offset() : DisableOutputLimitModule(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS) {configParam(OFFSET_PARAM, -1.0f, 1.0f, 0.0f, "offset"); + Offset() : DisableOutputLimitModule(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS) { + configParam(OFFSET_PARAM, -1.0f, 1.0f, 0.0f, "offset"); configParam(SCALE_PARAM, -1.0f, 1.0f, 0.316f, "scale"); - - } + } void process(const ProcessArgs& args) override; diff --git a/src/Sums.hpp b/src/Sums.hpp @@ -33,7 +33,6 @@ struct Sums : DisableOutputLimitModule { }; Sums() : DisableOutputLimitModule(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS) { - } void process(const ProcessArgs& args) override; diff --git a/src/Switch.cpp b/src/Switch.cpp @@ -32,7 +32,8 @@ void bogaudio::Switch::step() { struct SwitchWidget : ModuleWidget { static constexpr int hp = 3; - SwitchWidget(bogaudio::Switch* module) : ModuleWidget(module) { + SwitchWidget(bogaudio::Switch* module) { + setModule(module); box.size = Vec(RACK_GRID_WIDTH * hp, RACK_GRID_HEIGHT); { @@ -61,8 +62,8 @@ struct SwitchWidget : ModuleWidget { auto latchLightPosition = Vec(4.0, 84.5); // end generated by svg_widgets.rb - addParam(createParam<Button18>(gateParamPosition, module, bogaudio::Switch::GATE_PARAM, 0.0, 10.0, 0.0)); - addParam(createParam<StatefulButton9>(latchParamPosition, module, bogaudio::Switch::LATCH_PARAM, 0.0, 1.0, 0.0)); + addParam(createParam<Button18>(gateParamPosition, module, bogaudio::Switch::GATE_PARAM)); + addParam(createParam<StatefulButton9>(latchParamPosition, module, bogaudio::Switch::LATCH_PARAM)); addInput(createInput<Port24>(gateInputPosition, module, bogaudio::Switch::GATE_INPUT)); addInput(createInput<Port24>(high1InputPosition, module, bogaudio::Switch::HIGH1_INPUT)); diff --git a/src/Switch.hpp b/src/Switch.hpp @@ -36,7 +36,10 @@ struct Switch : Module { Trigger _trigger; bool _latchedHigh = false; - Switch() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS) { + Switch() { + config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS); + configParam(GATE_PARAM, 0.0f, 10.0f, 0.0f, "gate"); + configParam(LATCH_PARAM, 0.0f, 1.0f, 0.0f, "latch"); onReset(); } diff --git a/src/Test.hpp b/src/Test.hpp @@ -234,25 +234,24 @@ struct Test : Module { #endif Test() - : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS) #if SINE - , _table(12) + : _table(12) , _sine2(_table) #elif DECIMATORS - , _cicDecimator(STAGES) + : _cicDecimator(STAGES) #elif INTERPOLATOR - , _decimator(STAGES) + : _decimator(STAGES) , _interpolator(STAGES) #elif TABLES - , _table(StaticBlepTable::table(), 44100.0, 1000.0) + : _table(StaticBlepTable::table(), 44100.0, 1000.0) #elif RAVG - , _average(APP->engine->getSampleRate(), 1.0f, 1000.0f) + : _average(APP->engine->getSampleRate(), 1.0f, 1000.0f) #endif { + config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS); configParam(PARAM1_PARAM, 0.0f, 1.0f, 0.5f, "param1"); configParam(PARAM2_PARAM, 0.0f, 1.0f, 0.5f, "param2"); configParam(PARAM3_PARAM, 0.0f, 1.0f, 0.5f, "param3"); - onReset(); #ifdef SINE diff --git a/src/VCM.hpp b/src/VCM.hpp @@ -56,7 +56,6 @@ struct VCM : DisableOutputLimitModule { configParam(LEVEL4_PARAM, 0.0f, 1.0f, 0.8f, "level4"); configParam(MIX_PARAM, 0.0f, 1.0f, 0.8f, "mix"); configParam(LINEAR_PARAM, 0.0f, 1.0f, 0.0f, "linear"); - onReset(); } diff --git a/src/analyzer_base.hpp b/src/analyzer_base.hpp @@ -107,10 +107,10 @@ struct AnalyzerBase : Module { float _rangeDb = 80.0f; AnalyzerCore _core; - AnalyzerBase(int nChannels, int np, int ni, int no, int nl) - : Module(np, ni, no, nl) - , _core(nChannels) - {} + AnalyzerBase(int nChannels, int np, int ni, int no, int nl) : _core(nChannels) + { + config(np, ni, no, nl); + } }; struct AnalyzerDisplay : TransparentWidget { diff --git a/src/disable_output_limit.hpp b/src/disable_output_limit.hpp @@ -7,9 +7,8 @@ namespace bogaudio { struct DisableOutputLimitModule : Module { bool _disableOutputLimit = false; - DisableOutputLimitModule(int numParams, int numInputs, int numOutputs, int numLights = 0) - : Module(numParams, numInputs, numOutputs, numLights) - { + DisableOutputLimitModule(int numParams, int numInputs, int numOutputs, int numLights = 0) { + config(numParams, numInputs, numOutputs, numLights); } json_t* dataToJson() override; @@ -35,7 +34,8 @@ struct DisableOutputLimitMenuItem : MenuItem { }; struct DisableOutputLimitModuleWidget : ModuleWidget { - DisableOutputLimitModuleWidget(Module* module) : ModuleWidget(module) { + DisableOutputLimitModuleWidget(Module* module) { + setModule(module); } void appendContextMenu(Menu* menu) override { diff --git a/src/lfo_base.hpp b/src/lfo_base.hpp @@ -23,7 +23,9 @@ struct LFOBase : Module { PitchMode _pitchMode = UNKNOWN_PITCH_MODE; PitchModeListener* _pitchModeListener = NULL; - LFOBase(int np, int ni, int no, int nl) : Module(np, ni, no, nl) {} + LFOBase(int np, int ni, int no, int nl) { + config(np, ni, no, nl); + } json_t* dataToJson() override; void dataFromJson(json_t* root) override; @@ -68,12 +70,12 @@ struct LFOBaseWidget : ModuleWidget, PitchModeListener { std::shared_ptr<SVG> classicSVG, std::shared_ptr<SVG> compliantSVG ) - : ModuleWidget(module) - , _module(module) + : _module(module) , _panel(panel) , _classicSVG(classicSVG) , _compliantSVG(compliantSVG) { + setModule(module); setSVG(); if (_module) { _module->setPitchModeListener(this); diff --git a/src/trigger_on_load.hpp b/src/trigger_on_load.hpp @@ -11,9 +11,8 @@ struct TriggerOnLoadModule : Module { bool _triggerOnLoad = true; bool _shouldTriggerOnLoad = true; - TriggerOnLoadModule(int numParams, int numInputs, int numOutputs, int numLights) - : Module(numParams, numInputs, numOutputs, numLights) - { + TriggerOnLoadModule(int numParams, int numInputs, int numOutputs, int numLights) { + config(numParams, numInputs, numOutputs, numLights); } json_t* dataToJson() override;