diff --git a/src/8vert.cpp b/src/8vert.cpp index ee0e7db..9a95ced 100644 --- a/src/8vert.cpp +++ b/src/8vert.cpp @@ -45,53 +45,52 @@ struct _8vert : Module { struct _8vertWidget : ModuleWidget { - _8vertWidget(_8vert *module); -}; - -_8vertWidget::_8vertWidget(_8vert *module) : ModuleWidget(module) { - setPanel(SVG::load(asset::plugin(plugin, "res/8vert.svg"))); + _8vertWidget(_8vert *module) { + setModule(module); + setPanel(SVG::load(asset::plugin(plugin, "res/8vert.svg"))); - addChild(createWidget(Vec(15, 0))); - addChild(createWidget(Vec(box.size.x - 30, 0))); - addChild(createWidget(Vec(15, 365))); - addChild(createWidget(Vec(box.size.x - 30, 365))); + addChild(createWidget(Vec(15, 0))); + addChild(createWidget(Vec(box.size.x - 30, 0))); + addChild(createWidget(Vec(15, 365))); + addChild(createWidget(Vec(box.size.x - 30, 365))); - addParam(createParam(Vec(45.308, 47.753), module, _8vert::GAIN_PARAMS + 0)); - addParam(createParam(Vec(45.308, 86.198), module, _8vert::GAIN_PARAMS + 1)); - addParam(createParam(Vec(45.308, 124.639), module, _8vert::GAIN_PARAMS + 2)); - addParam(createParam(Vec(45.308, 163.084), module, _8vert::GAIN_PARAMS + 3)); - addParam(createParam(Vec(45.308, 201.529), module, _8vert::GAIN_PARAMS + 4)); - addParam(createParam(Vec(45.308, 239.974), module, _8vert::GAIN_PARAMS + 5)); - addParam(createParam(Vec(45.308, 278.415), module, _8vert::GAIN_PARAMS + 6)); - addParam(createParam(Vec(45.308, 316.86), module, _8vert::GAIN_PARAMS + 7)); + addParam(createParam(Vec(45.308, 47.753), module, _8vert::GAIN_PARAMS + 0)); + addParam(createParam(Vec(45.308, 86.198), module, _8vert::GAIN_PARAMS + 1)); + addParam(createParam(Vec(45.308, 124.639), module, _8vert::GAIN_PARAMS + 2)); + addParam(createParam(Vec(45.308, 163.084), module, _8vert::GAIN_PARAMS + 3)); + addParam(createParam(Vec(45.308, 201.529), module, _8vert::GAIN_PARAMS + 4)); + addParam(createParam(Vec(45.308, 239.974), module, _8vert::GAIN_PARAMS + 5)); + addParam(createParam(Vec(45.308, 278.415), module, _8vert::GAIN_PARAMS + 6)); + addParam(createParam(Vec(45.308, 316.86), module, _8vert::GAIN_PARAMS + 7)); - addInput(createInput(Vec(9.507, 50.397), module, _8vert::IN_INPUTS + 0)); - addInput(createInput(Vec(9.507, 88.842), module, _8vert::IN_INPUTS + 1)); - addInput(createInput(Vec(9.507, 127.283), module, _8vert::IN_INPUTS + 2)); - addInput(createInput(Vec(9.507, 165.728), module, _8vert::IN_INPUTS + 3)); - addInput(createInput(Vec(9.507, 204.173), module, _8vert::IN_INPUTS + 4)); - addInput(createInput(Vec(9.507, 242.614), module, _8vert::IN_INPUTS + 5)); - addInput(createInput(Vec(9.507, 281.059), module, _8vert::IN_INPUTS + 6)); - addInput(createInput(Vec(9.507, 319.504), module, _8vert::IN_INPUTS + 7)); + addInput(createInput(Vec(9.507, 50.397), module, _8vert::IN_INPUTS + 0)); + addInput(createInput(Vec(9.507, 88.842), module, _8vert::IN_INPUTS + 1)); + addInput(createInput(Vec(9.507, 127.283), module, _8vert::IN_INPUTS + 2)); + addInput(createInput(Vec(9.507, 165.728), module, _8vert::IN_INPUTS + 3)); + addInput(createInput(Vec(9.507, 204.173), module, _8vert::IN_INPUTS + 4)); + addInput(createInput(Vec(9.507, 242.614), module, _8vert::IN_INPUTS + 5)); + addInput(createInput(Vec(9.507, 281.059), module, _8vert::IN_INPUTS + 6)); + addInput(createInput(Vec(9.507, 319.504), module, _8vert::IN_INPUTS + 7)); - addOutput(createOutput(Vec(86.393, 50.397), module, _8vert::OUT_OUTPUTS + 0)); - addOutput(createOutput(Vec(86.393, 88.842), module, _8vert::OUT_OUTPUTS + 1)); - addOutput(createOutput(Vec(86.393, 127.283), module, _8vert::OUT_OUTPUTS + 2)); - addOutput(createOutput(Vec(86.393, 165.728), module, _8vert::OUT_OUTPUTS + 3)); - addOutput(createOutput(Vec(86.393, 204.173), module, _8vert::OUT_OUTPUTS + 4)); - addOutput(createOutput(Vec(86.393, 242.614), module, _8vert::OUT_OUTPUTS + 5)); - addOutput(createOutput(Vec(86.393, 281.059), module, _8vert::OUT_OUTPUTS + 6)); - addOutput(createOutput(Vec(86.393, 319.504), module, _8vert::OUT_OUTPUTS + 7)); + addOutput(createOutput(Vec(86.393, 50.397), module, _8vert::OUT_OUTPUTS + 0)); + addOutput(createOutput(Vec(86.393, 88.842), module, _8vert::OUT_OUTPUTS + 1)); + addOutput(createOutput(Vec(86.393, 127.283), module, _8vert::OUT_OUTPUTS + 2)); + addOutput(createOutput(Vec(86.393, 165.728), module, _8vert::OUT_OUTPUTS + 3)); + addOutput(createOutput(Vec(86.393, 204.173), module, _8vert::OUT_OUTPUTS + 4)); + addOutput(createOutput(Vec(86.393, 242.614), module, _8vert::OUT_OUTPUTS + 5)); + addOutput(createOutput(Vec(86.393, 281.059), module, _8vert::OUT_OUTPUTS + 6)); + addOutput(createOutput(Vec(86.393, 319.504), module, _8vert::OUT_OUTPUTS + 7)); - addChild(createLight>(Vec(107.702, 50.414), module, _8vert::OUT_LIGHTS + 0*2)); - addChild(createLight>(Vec(107.702, 88.859), module, _8vert::OUT_LIGHTS + 1*2)); - addChild(createLight>(Vec(107.702, 127.304), module, _8vert::OUT_LIGHTS + 2*2)); - addChild(createLight>(Vec(107.702, 165.745), module, _8vert::OUT_LIGHTS + 3*2)); - addChild(createLight>(Vec(107.702, 204.19), module, _8vert::OUT_LIGHTS + 4*2)); - addChild(createLight>(Vec(107.702, 242.635), module, _8vert::OUT_LIGHTS + 5*2)); - addChild(createLight>(Vec(107.702, 281.076), module, _8vert::OUT_LIGHTS + 6*2)); - addChild(createLight>(Vec(107.702, 319.521), module, _8vert::OUT_LIGHTS + 7*2)); -} + addChild(createLight>(Vec(107.702, 50.414), module, _8vert::OUT_LIGHTS + 0*2)); + addChild(createLight>(Vec(107.702, 88.859), module, _8vert::OUT_LIGHTS + 1*2)); + addChild(createLight>(Vec(107.702, 127.304), module, _8vert::OUT_LIGHTS + 2*2)); + addChild(createLight>(Vec(107.702, 165.745), module, _8vert::OUT_LIGHTS + 3*2)); + addChild(createLight>(Vec(107.702, 204.19), module, _8vert::OUT_LIGHTS + 4*2)); + addChild(createLight>(Vec(107.702, 242.635), module, _8vert::OUT_LIGHTS + 5*2)); + addChild(createLight>(Vec(107.702, 281.076), module, _8vert::OUT_LIGHTS + 6*2)); + addChild(createLight>(Vec(107.702, 319.521), module, _8vert::OUT_LIGHTS + 7*2)); + } +}; Model *model_8vert = createModel<_8vert, _8vertWidget>("8vert"); diff --git a/src/ADSR.cpp b/src/ADSR.cpp index 6021d0d..fa5ad31 100644 --- a/src/ADSR.cpp +++ b/src/ADSR.cpp @@ -106,36 +106,35 @@ struct ADSR : Module { struct ADSRWidget : ModuleWidget { - ADSRWidget(ADSR *module); + ADSRWidget(ADSR *module) { + setModule(module); + setPanel(SVG::load(asset::plugin(plugin, "res/ADSR.svg"))); + + addChild(createWidget(Vec(15, 0))); + addChild(createWidget(Vec(box.size.x-30, 0))); + addChild(createWidget(Vec(15, 365))); + addChild(createWidget(Vec(box.size.x-30, 365))); + + addParam(createParam(Vec(62, 57), module, ADSR::ATTACK_PARAM)); + addParam(createParam(Vec(62, 124), module, ADSR::DECAY_PARAM)); + addParam(createParam(Vec(62, 191), module, ADSR::SUSTAIN_PARAM)); + addParam(createParam(Vec(62, 257), module, ADSR::RELEASE_PARAM)); + + addInput(createInput(Vec(9, 63), module, ADSR::ATTACK_INPUT)); + addInput(createInput(Vec(9, 129), module, ADSR::DECAY_INPUT)); + addInput(createInput(Vec(9, 196), module, ADSR::SUSTAIN_INPUT)); + addInput(createInput(Vec(9, 263), module, ADSR::RELEASE_INPUT)); + + addInput(createInput(Vec(9, 320), module, ADSR::GATE_INPUT)); + addInput(createInput(Vec(48, 320), module, ADSR::TRIG_INPUT)); + addOutput(createOutput(Vec(87, 320), module, ADSR::ENVELOPE_OUTPUT)); + + addChild(createLight>(Vec(94, 41), module, ADSR::ATTACK_LIGHT)); + addChild(createLight>(Vec(94, 109), module, ADSR::DECAY_LIGHT)); + addChild(createLight>(Vec(94, 175), module, ADSR::SUSTAIN_LIGHT)); + addChild(createLight>(Vec(94, 242), module, ADSR::RELEASE_LIGHT)); + } }; -ADSRWidget::ADSRWidget(ADSR *module) : ModuleWidget(module) { - setPanel(SVG::load(asset::plugin(plugin, "res/ADSR.svg"))); - - addChild(createWidget(Vec(15, 0))); - addChild(createWidget(Vec(box.size.x-30, 0))); - addChild(createWidget(Vec(15, 365))); - addChild(createWidget(Vec(box.size.x-30, 365))); - - addParam(createParam(Vec(62, 57), module, ADSR::ATTACK_PARAM)); - addParam(createParam(Vec(62, 124), module, ADSR::DECAY_PARAM)); - addParam(createParam(Vec(62, 191), module, ADSR::SUSTAIN_PARAM)); - addParam(createParam(Vec(62, 257), module, ADSR::RELEASE_PARAM)); - - addInput(createInput(Vec(9, 63), module, ADSR::ATTACK_INPUT)); - addInput(createInput(Vec(9, 129), module, ADSR::DECAY_INPUT)); - addInput(createInput(Vec(9, 196), module, ADSR::SUSTAIN_INPUT)); - addInput(createInput(Vec(9, 263), module, ADSR::RELEASE_INPUT)); - - addInput(createInput(Vec(9, 320), module, ADSR::GATE_INPUT)); - addInput(createInput(Vec(48, 320), module, ADSR::TRIG_INPUT)); - addOutput(createOutput(Vec(87, 320), module, ADSR::ENVELOPE_OUTPUT)); - - addChild(createLight>(Vec(94, 41), module, ADSR::ATTACK_LIGHT)); - addChild(createLight>(Vec(94, 109), module, ADSR::DECAY_LIGHT)); - addChild(createLight>(Vec(94, 175), module, ADSR::SUSTAIN_LIGHT)); - addChild(createLight>(Vec(94, 242), module, ADSR::RELEASE_LIGHT)); -} - Model *modelADSR = createModel("ADSR"); diff --git a/src/Delay.cpp b/src/Delay.cpp index f2477a8..3d87798 100644 --- a/src/Delay.cpp +++ b/src/Delay.cpp @@ -111,7 +111,8 @@ struct Delay : Module { struct DelayWidget : ModuleWidget { - DelayWidget(Delay *module) : ModuleWidget(module) { + DelayWidget(Delay *module) { + setModule(module); setPanel(SVG::load(asset::plugin(plugin, "res/Delay.svg"))); addChild(createWidget(Vec(15, 0))); diff --git a/src/LFO.cpp b/src/LFO.cpp index be939d0..173d94a 100644 --- a/src/LFO.cpp +++ b/src/LFO.cpp @@ -129,39 +129,38 @@ struct LFO : Module { struct LFOWidget : ModuleWidget { - LFOWidget(LFO *module); + LFOWidget(LFO *module) { + setModule(module); + setPanel(SVG::load(asset::plugin(plugin, "res/LFO-1.svg"))); + + addChild(createWidget(Vec(15, 0))); + addChild(createWidget(Vec(box.size.x-30, 0))); + addChild(createWidget(Vec(15, 365))); + addChild(createWidget(Vec(box.size.x-30, 365))); + + addParam(createParam(Vec(15, 77), module, LFO::OFFSET_PARAM)); + addParam(createParam(Vec(119, 77), module, LFO::INVERT_PARAM)); + + addParam(createParam(Vec(47, 61), module, LFO::FREQ_PARAM)); + addParam(createParam(Vec(23, 143), module, LFO::FM1_PARAM)); + addParam(createParam(Vec(91, 143), module, LFO::PW_PARAM)); + addParam(createParam(Vec(23, 208), module, LFO::FM2_PARAM)); + addParam(createParam(Vec(91, 208), module, LFO::PWM_PARAM)); + + addInput(createInput(Vec(11, 276), module, LFO::FM1_INPUT)); + addInput(createInput(Vec(45, 276), module, LFO::FM2_INPUT)); + addInput(createInput(Vec(80, 276), module, LFO::RESET_INPUT)); + addInput(createInput(Vec(114, 276), module, LFO::PW_INPUT)); + + addOutput(createOutput(Vec(11, 320), module, LFO::SIN_OUTPUT)); + addOutput(createOutput(Vec(45, 320), module, LFO::TRI_OUTPUT)); + addOutput(createOutput(Vec(80, 320), module, LFO::SAW_OUTPUT)); + addOutput(createOutput(Vec(114, 320), module, LFO::SQR_OUTPUT)); + + addChild(createLight>(Vec(99, 42.5f), module, LFO::PHASE_POS_LIGHT)); + } }; -LFOWidget::LFOWidget(LFO *module) : ModuleWidget(module) { - setPanel(SVG::load(asset::plugin(plugin, "res/LFO-1.svg"))); - - addChild(createWidget(Vec(15, 0))); - addChild(createWidget(Vec(box.size.x-30, 0))); - addChild(createWidget(Vec(15, 365))); - addChild(createWidget(Vec(box.size.x-30, 365))); - - addParam(createParam(Vec(15, 77), module, LFO::OFFSET_PARAM)); - addParam(createParam(Vec(119, 77), module, LFO::INVERT_PARAM)); - - addParam(createParam(Vec(47, 61), module, LFO::FREQ_PARAM)); - addParam(createParam(Vec(23, 143), module, LFO::FM1_PARAM)); - addParam(createParam(Vec(91, 143), module, LFO::PW_PARAM)); - addParam(createParam(Vec(23, 208), module, LFO::FM2_PARAM)); - addParam(createParam(Vec(91, 208), module, LFO::PWM_PARAM)); - - addInput(createInput(Vec(11, 276), module, LFO::FM1_INPUT)); - addInput(createInput(Vec(45, 276), module, LFO::FM2_INPUT)); - addInput(createInput(Vec(80, 276), module, LFO::RESET_INPUT)); - addInput(createInput(Vec(114, 276), module, LFO::PW_INPUT)); - - addOutput(createOutput(Vec(11, 320), module, LFO::SIN_OUTPUT)); - addOutput(createOutput(Vec(45, 320), module, LFO::TRI_OUTPUT)); - addOutput(createOutput(Vec(80, 320), module, LFO::SAW_OUTPUT)); - addOutput(createOutput(Vec(114, 320), module, LFO::SQR_OUTPUT)); - - addChild(createLight>(Vec(99, 42.5f), module, LFO::PHASE_POS_LIGHT)); -} - Model *modelLFO = createModel("LFO"); @@ -227,32 +226,31 @@ struct LFO2 : Module { struct LFO2Widget : ModuleWidget { - LFO2Widget(LFO2 *module); -}; + LFO2Widget(LFO2 *module) { + setModule(module); + setPanel(SVG::load(asset::plugin(plugin, "res/LFO-2.svg"))); -LFO2Widget::LFO2Widget(LFO2 *module) : ModuleWidget(module) { - setPanel(SVG::load(asset::plugin(plugin, "res/LFO-2.svg"))); + addChild(createWidget(Vec(15, 0))); + addChild(createWidget(Vec(box.size.x-30, 0))); + addChild(createWidget(Vec(15, 365))); + addChild(createWidget(Vec(box.size.x-30, 365))); - addChild(createWidget(Vec(15, 0))); - addChild(createWidget(Vec(box.size.x-30, 0))); - addChild(createWidget(Vec(15, 365))); - addChild(createWidget(Vec(box.size.x-30, 365))); + addParam(createParam(Vec(62, 150), module, LFO2::OFFSET_PARAM)); + addParam(createParam(Vec(62, 215), module, LFO2::INVERT_PARAM)); - addParam(createParam(Vec(62, 150), module, LFO2::OFFSET_PARAM)); - addParam(createParam(Vec(62, 215), module, LFO2::INVERT_PARAM)); + addParam(createParam(Vec(18, 60), module, LFO2::FREQ_PARAM)); + addParam(createParam(Vec(11, 142), module, LFO2::WAVE_PARAM)); + addParam(createParam(Vec(11, 207), module, LFO2::FM_PARAM)); - addParam(createParam(Vec(18, 60), module, LFO2::FREQ_PARAM)); - addParam(createParam(Vec(11, 142), module, LFO2::WAVE_PARAM)); - addParam(createParam(Vec(11, 207), module, LFO2::FM_PARAM)); + addInput(createInput(Vec(11, 276), module, LFO2::FM_INPUT)); + addInput(createInput(Vec(54, 276), module, LFO2::RESET_INPUT)); + addInput(createInput(Vec(11, 319), module, LFO2::WAVE_INPUT)); - addInput(createInput(Vec(11, 276), module, LFO2::FM_INPUT)); - addInput(createInput(Vec(54, 276), module, LFO2::RESET_INPUT)); - addInput(createInput(Vec(11, 319), module, LFO2::WAVE_INPUT)); + addOutput(createOutput(Vec(54, 319), module, LFO2::INTERP_OUTPUT)); - addOutput(createOutput(Vec(54, 319), module, LFO2::INTERP_OUTPUT)); - - addChild(createLight>(Vec(68, 42.5f), module, LFO2::PHASE_POS_LIGHT)); -} + addChild(createLight>(Vec(68, 42.5f), module, LFO2::PHASE_POS_LIGHT)); + } +}; Model *modelLFO2 = createModel("LFO2"); diff --git a/src/Mutes.cpp b/src/Mutes.cpp index 203f049..9b62e60 100644 --- a/src/Mutes.cpp +++ b/src/Mutes.cpp @@ -92,61 +92,60 @@ struct MuteLight : BASE { struct MutesWidget : ModuleWidget { - MutesWidget(Mutes *module); + MutesWidget(Mutes *module) { + setModule(module); + setPanel(SVG::load(asset::plugin(plugin, "res/Mutes.svg"))); + + addChild(createWidget(Vec(15, 0))); + addChild(createWidget(Vec(box.size.x - 30, 0))); + addChild(createWidget(Vec(15, 365))); + addChild(createWidget(Vec(box.size.x - 30, 365))); + + addParam(createParam(mm2px(Vec(16.57, 18.165)), module, Mutes::MUTE_PARAM + 0)); + addParam(createParam(mm2px(Vec(16.57, 28.164)), module, Mutes::MUTE_PARAM + 1)); + addParam(createParam(mm2px(Vec(16.57, 38.164)), module, Mutes::MUTE_PARAM + 2)); + addParam(createParam(mm2px(Vec(16.57, 48.165)), module, Mutes::MUTE_PARAM + 3)); + addParam(createParam(mm2px(Vec(16.57, 58.164)), module, Mutes::MUTE_PARAM + 4)); + addParam(createParam(mm2px(Vec(16.57, 68.165)), module, Mutes::MUTE_PARAM + 5)); + addParam(createParam(mm2px(Vec(16.57, 78.164)), module, Mutes::MUTE_PARAM + 6)); + addParam(createParam(mm2px(Vec(16.57, 88.164)), module, Mutes::MUTE_PARAM + 7)); + addParam(createParam(mm2px(Vec(16.57, 98.165)), module, Mutes::MUTE_PARAM + 8)); + addParam(createParam(mm2px(Vec(16.57, 108.166)), module, Mutes::MUTE_PARAM + 9)); + + addInput(createInput(mm2px(Vec(4.214, 17.81)), module, Mutes::IN_INPUT + 0)); + addInput(createInput(mm2px(Vec(4.214, 27.809)), module, Mutes::IN_INPUT + 1)); + addInput(createInput(mm2px(Vec(4.214, 37.809)), module, Mutes::IN_INPUT + 2)); + addInput(createInput(mm2px(Vec(4.214, 47.81)), module, Mutes::IN_INPUT + 3)); + addInput(createInput(mm2px(Vec(4.214, 57.81)), module, Mutes::IN_INPUT + 4)); + addInput(createInput(mm2px(Vec(4.214, 67.809)), module, Mutes::IN_INPUT + 5)); + addInput(createInput(mm2px(Vec(4.214, 77.81)), module, Mutes::IN_INPUT + 6)); + addInput(createInput(mm2px(Vec(4.214, 87.81)), module, Mutes::IN_INPUT + 7)); + addInput(createInput(mm2px(Vec(4.214, 97.809)), module, Mutes::IN_INPUT + 8)); + addInput(createInput(mm2px(Vec(4.214, 107.809)), module, Mutes::IN_INPUT + 9)); + + addOutput(createOutput(mm2px(Vec(28.214, 17.81)), module, Mutes::OUT_OUTPUT + 0)); + addOutput(createOutput(mm2px(Vec(28.214, 27.809)), module, Mutes::OUT_OUTPUT + 1)); + addOutput(createOutput(mm2px(Vec(28.214, 37.809)), module, Mutes::OUT_OUTPUT + 2)); + addOutput(createOutput(mm2px(Vec(28.214, 47.81)), module, Mutes::OUT_OUTPUT + 3)); + addOutput(createOutput(mm2px(Vec(28.214, 57.809)), module, Mutes::OUT_OUTPUT + 4)); + addOutput(createOutput(mm2px(Vec(28.214, 67.809)), module, Mutes::OUT_OUTPUT + 5)); + addOutput(createOutput(mm2px(Vec(28.214, 77.81)), module, Mutes::OUT_OUTPUT + 6)); + addOutput(createOutput(mm2px(Vec(28.214, 87.81)), module, Mutes::OUT_OUTPUT + 7)); + addOutput(createOutput(mm2px(Vec(28.214, 97.809)), module, Mutes::OUT_OUTPUT + 8)); + addOutput(createOutput(mm2px(Vec(28.214, 107.809)), module, Mutes::OUT_OUTPUT + 9)); + + addChild(createLight>(mm2px(Vec(17.32, 18.915)), module, Mutes::MUTE_LIGHT + 0)); + addChild(createLight>(mm2px(Vec(17.32, 28.916)), module, Mutes::MUTE_LIGHT + 1)); + addChild(createLight>(mm2px(Vec(17.32, 38.915)), module, Mutes::MUTE_LIGHT + 2)); + addChild(createLight>(mm2px(Vec(17.32, 48.915)), module, Mutes::MUTE_LIGHT + 3)); + addChild(createLight>(mm2px(Vec(17.32, 58.916)), module, Mutes::MUTE_LIGHT + 4)); + addChild(createLight>(mm2px(Vec(17.32, 68.916)), module, Mutes::MUTE_LIGHT + 5)); + addChild(createLight>(mm2px(Vec(17.32, 78.915)), module, Mutes::MUTE_LIGHT + 6)); + addChild(createLight>(mm2px(Vec(17.32, 88.916)), module, Mutes::MUTE_LIGHT + 7)); + addChild(createLight>(mm2px(Vec(17.32, 98.915)), module, Mutes::MUTE_LIGHT + 8)); + addChild(createLight>(mm2px(Vec(17.32, 108.915)), module, Mutes::MUTE_LIGHT + 9)); + } }; -MutesWidget::MutesWidget(Mutes *module) : ModuleWidget(module) { - setPanel(SVG::load(asset::plugin(plugin, "res/Mutes.svg"))); - - addChild(createWidget(Vec(15, 0))); - addChild(createWidget(Vec(box.size.x - 30, 0))); - addChild(createWidget(Vec(15, 365))); - addChild(createWidget(Vec(box.size.x - 30, 365))); - - addParam(createParam(mm2px(Vec(16.57, 18.165)), module, Mutes::MUTE_PARAM + 0)); - addParam(createParam(mm2px(Vec(16.57, 28.164)), module, Mutes::MUTE_PARAM + 1)); - addParam(createParam(mm2px(Vec(16.57, 38.164)), module, Mutes::MUTE_PARAM + 2)); - addParam(createParam(mm2px(Vec(16.57, 48.165)), module, Mutes::MUTE_PARAM + 3)); - addParam(createParam(mm2px(Vec(16.57, 58.164)), module, Mutes::MUTE_PARAM + 4)); - addParam(createParam(mm2px(Vec(16.57, 68.165)), module, Mutes::MUTE_PARAM + 5)); - addParam(createParam(mm2px(Vec(16.57, 78.164)), module, Mutes::MUTE_PARAM + 6)); - addParam(createParam(mm2px(Vec(16.57, 88.164)), module, Mutes::MUTE_PARAM + 7)); - addParam(createParam(mm2px(Vec(16.57, 98.165)), module, Mutes::MUTE_PARAM + 8)); - addParam(createParam(mm2px(Vec(16.57, 108.166)), module, Mutes::MUTE_PARAM + 9)); - - addInput(createInput(mm2px(Vec(4.214, 17.81)), module, Mutes::IN_INPUT + 0)); - addInput(createInput(mm2px(Vec(4.214, 27.809)), module, Mutes::IN_INPUT + 1)); - addInput(createInput(mm2px(Vec(4.214, 37.809)), module, Mutes::IN_INPUT + 2)); - addInput(createInput(mm2px(Vec(4.214, 47.81)), module, Mutes::IN_INPUT + 3)); - addInput(createInput(mm2px(Vec(4.214, 57.81)), module, Mutes::IN_INPUT + 4)); - addInput(createInput(mm2px(Vec(4.214, 67.809)), module, Mutes::IN_INPUT + 5)); - addInput(createInput(mm2px(Vec(4.214, 77.81)), module, Mutes::IN_INPUT + 6)); - addInput(createInput(mm2px(Vec(4.214, 87.81)), module, Mutes::IN_INPUT + 7)); - addInput(createInput(mm2px(Vec(4.214, 97.809)), module, Mutes::IN_INPUT + 8)); - addInput(createInput(mm2px(Vec(4.214, 107.809)), module, Mutes::IN_INPUT + 9)); - - addOutput(createOutput(mm2px(Vec(28.214, 17.81)), module, Mutes::OUT_OUTPUT + 0)); - addOutput(createOutput(mm2px(Vec(28.214, 27.809)), module, Mutes::OUT_OUTPUT + 1)); - addOutput(createOutput(mm2px(Vec(28.214, 37.809)), module, Mutes::OUT_OUTPUT + 2)); - addOutput(createOutput(mm2px(Vec(28.214, 47.81)), module, Mutes::OUT_OUTPUT + 3)); - addOutput(createOutput(mm2px(Vec(28.214, 57.809)), module, Mutes::OUT_OUTPUT + 4)); - addOutput(createOutput(mm2px(Vec(28.214, 67.809)), module, Mutes::OUT_OUTPUT + 5)); - addOutput(createOutput(mm2px(Vec(28.214, 77.81)), module, Mutes::OUT_OUTPUT + 6)); - addOutput(createOutput(mm2px(Vec(28.214, 87.81)), module, Mutes::OUT_OUTPUT + 7)); - addOutput(createOutput(mm2px(Vec(28.214, 97.809)), module, Mutes::OUT_OUTPUT + 8)); - addOutput(createOutput(mm2px(Vec(28.214, 107.809)), module, Mutes::OUT_OUTPUT + 9)); - - addChild(createLight>(mm2px(Vec(17.32, 18.915)), module, Mutes::MUTE_LIGHT + 0)); - addChild(createLight>(mm2px(Vec(17.32, 28.916)), module, Mutes::MUTE_LIGHT + 1)); - addChild(createLight>(mm2px(Vec(17.32, 38.915)), module, Mutes::MUTE_LIGHT + 2)); - addChild(createLight>(mm2px(Vec(17.32, 48.915)), module, Mutes::MUTE_LIGHT + 3)); - addChild(createLight>(mm2px(Vec(17.32, 58.916)), module, Mutes::MUTE_LIGHT + 4)); - addChild(createLight>(mm2px(Vec(17.32, 68.916)), module, Mutes::MUTE_LIGHT + 5)); - addChild(createLight>(mm2px(Vec(17.32, 78.915)), module, Mutes::MUTE_LIGHT + 6)); - addChild(createLight>(mm2px(Vec(17.32, 88.916)), module, Mutes::MUTE_LIGHT + 7)); - addChild(createLight>(mm2px(Vec(17.32, 98.915)), module, Mutes::MUTE_LIGHT + 8)); - addChild(createLight>(mm2px(Vec(17.32, 108.915)), module, Mutes::MUTE_LIGHT + 9)); -} - Model *modelMutes = createModel("Mutes"); diff --git a/src/SEQ3.cpp b/src/SEQ3.cpp index 55dab2d..55b4690 100644 --- a/src/SEQ3.cpp +++ b/src/SEQ3.cpp @@ -173,7 +173,8 @@ struct SEQ3 : Module { struct SEQ3Widget : ModuleWidget { - SEQ3Widget(SEQ3 *module) : ModuleWidget(module) { + SEQ3Widget(SEQ3 *module) { + setModule(module); setPanel(SVG::load(asset::plugin(plugin, "res/SEQ3.svg"))); addChild(createWidget(Vec(15, 0))); diff --git a/src/Scope.cpp b/src/Scope.cpp index 37cc0b1..fae4bb7 100644 --- a/src/Scope.cpp +++ b/src/Scope.cpp @@ -311,43 +311,42 @@ struct ScopeDisplay : TransparentWidget { struct ScopeWidget : ModuleWidget { - ScopeWidget(Scope *module); -}; + ScopeWidget(Scope *module) { + setModule(module); + setPanel(SVG::load(asset::plugin(plugin, "res/Scope.svg"))); -ScopeWidget::ScopeWidget(Scope *module) : ModuleWidget(module) { - setPanel(SVG::load(asset::plugin(plugin, "res/Scope.svg"))); + addChild(createWidget(Vec(15, 0))); + addChild(createWidget(Vec(box.size.x-30, 0))); + addChild(createWidget(Vec(15, 365))); + addChild(createWidget(Vec(box.size.x-30, 365))); - addChild(createWidget(Vec(15, 0))); - addChild(createWidget(Vec(box.size.x-30, 0))); - addChild(createWidget(Vec(15, 365))); - addChild(createWidget(Vec(box.size.x-30, 365))); + { + ScopeDisplay *display = new ScopeDisplay(); + display->module = module; + display->box.pos = Vec(0, 44); + display->box.size = Vec(box.size.x, 140); + addChild(display); + } - { - ScopeDisplay *display = new ScopeDisplay(); - display->module = module; - display->box.pos = Vec(0, 44); - display->box.size = Vec(box.size.x, 140); - addChild(display); + addParam(createParam(Vec(15, 209), module, Scope::X_SCALE_PARAM)); + addParam(createParam(Vec(15, 263), module, Scope::X_POS_PARAM)); + addParam(createParam(Vec(61, 209), module, Scope::Y_SCALE_PARAM)); + addParam(createParam(Vec(61, 263), module, Scope::Y_POS_PARAM)); + addParam(createParam(Vec(107, 209), module, Scope::TIME_PARAM)); + addParam(createParam(Vec(106, 262), module, Scope::LISSAJOUS_PARAM)); + addParam(createParam(Vec(153, 209), module, Scope::TRIG_PARAM)); + addParam(createParam(Vec(152, 262), module, Scope::EXTERNAL_PARAM)); + + addInput(createInput(Vec(17, 319), module, Scope::X_INPUT)); + addInput(createInput(Vec(63, 319), module, Scope::Y_INPUT)); + addInput(createInput(Vec(154, 319), module, Scope::TRIG_INPUT)); + + addChild(createLight>(Vec(104, 251), module, Scope::PLOT_LIGHT)); + addChild(createLight>(Vec(104, 296), module, Scope::LISSAJOUS_LIGHT)); + addChild(createLight>(Vec(150, 251), module, Scope::INTERNAL_LIGHT)); + addChild(createLight>(Vec(150, 296), module, Scope::EXTERNAL_LIGHT)); } - - addParam(createParam(Vec(15, 209), module, Scope::X_SCALE_PARAM)); - addParam(createParam(Vec(15, 263), module, Scope::X_POS_PARAM)); - addParam(createParam(Vec(61, 209), module, Scope::Y_SCALE_PARAM)); - addParam(createParam(Vec(61, 263), module, Scope::Y_POS_PARAM)); - addParam(createParam(Vec(107, 209), module, Scope::TIME_PARAM)); - addParam(createParam(Vec(106, 262), module, Scope::LISSAJOUS_PARAM)); - addParam(createParam(Vec(153, 209), module, Scope::TRIG_PARAM)); - addParam(createParam(Vec(152, 262), module, Scope::EXTERNAL_PARAM)); - - addInput(createInput(Vec(17, 319), module, Scope::X_INPUT)); - addInput(createInput(Vec(63, 319), module, Scope::Y_INPUT)); - addInput(createInput(Vec(154, 319), module, Scope::TRIG_INPUT)); - - addChild(createLight>(Vec(104, 251), module, Scope::PLOT_LIGHT)); - addChild(createLight>(Vec(104, 296), module, Scope::LISSAJOUS_LIGHT)); - addChild(createLight>(Vec(150, 251), module, Scope::INTERNAL_LIGHT)); - addChild(createLight>(Vec(150, 296), module, Scope::EXTERNAL_LIGHT)); -} +}; Model *modelScope = createModel("Scope"); diff --git a/src/SequentialSwitch.cpp b/src/SequentialSwitch.cpp index 37fc712..4686e67 100644 --- a/src/SequentialSwitch.cpp +++ b/src/SequentialSwitch.cpp @@ -77,64 +77,64 @@ struct SequentialSwitch : Module { struct SequentialSwitch1Widget : ModuleWidget { - SequentialSwitch1Widget(SequentialSwitch<1> *module); -}; - -SequentialSwitch1Widget::SequentialSwitch1Widget(SequentialSwitch<1> *module) : ModuleWidget(module) { typedef SequentialSwitch<1> TSequentialSwitch; - setPanel(SVG::load(asset::plugin(plugin, "res/SequentialSwitch1.svg"))); - addChild(createWidget(Vec(RACK_GRID_WIDTH, 0))); - addChild(createWidget(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); + SequentialSwitch1Widget(SequentialSwitch<1> *module) { + setModule(module); + setPanel(SVG::load(asset::plugin(plugin, "res/SequentialSwitch1.svg"))); + + addChild(createWidget(Vec(RACK_GRID_WIDTH, 0))); + addChild(createWidget(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); - addParam(createParam(mm2px(Vec(5.24619, 46.9153)), module, TSequentialSwitch::CHANNELS_PARAM)); + addParam(createParam(mm2px(Vec(5.24619, 46.9153)), module, TSequentialSwitch::CHANNELS_PARAM)); - addInput(createInput(mm2px(Vec(3.51398, 17.694)), module, TSequentialSwitch::CLOCK_INPUT)); - addInput(createInput(mm2px(Vec(3.51398, 32.1896)), module, TSequentialSwitch::RESET_INPUT)); - addInput(createInput(mm2px(Vec(3.51536, 62.8096)), module, TSequentialSwitch::IN_INPUT + 0)); + addInput(createInput(mm2px(Vec(3.51398, 17.694)), module, TSequentialSwitch::CLOCK_INPUT)); + addInput(createInput(mm2px(Vec(3.51398, 32.1896)), module, TSequentialSwitch::RESET_INPUT)); + addInput(createInput(mm2px(Vec(3.51536, 62.8096)), module, TSequentialSwitch::IN_INPUT + 0)); - addOutput(createOutput(mm2px(Vec(3.51536, 77.8095)), module, TSequentialSwitch::OUT_OUTPUT + 0)); - addOutput(createOutput(mm2px(Vec(3.51398, 87.8113)), module, TSequentialSwitch::OUT_OUTPUT + 1)); - addOutput(createOutput(mm2px(Vec(3.51398, 97.809)), module, TSequentialSwitch::OUT_OUTPUT + 2)); - addOutput(createOutput(mm2px(Vec(3.51398, 107.809)), module, TSequentialSwitch::OUT_OUTPUT + 3)); + addOutput(createOutput(mm2px(Vec(3.51536, 77.8095)), module, TSequentialSwitch::OUT_OUTPUT + 0)); + addOutput(createOutput(mm2px(Vec(3.51398, 87.8113)), module, TSequentialSwitch::OUT_OUTPUT + 1)); + addOutput(createOutput(mm2px(Vec(3.51398, 97.809)), module, TSequentialSwitch::OUT_OUTPUT + 2)); + addOutput(createOutput(mm2px(Vec(3.51398, 107.809)), module, TSequentialSwitch::OUT_OUTPUT + 3)); - addChild(createLight>(mm2px(Vec(10.8203, 77.7158)), module, TSequentialSwitch::CHANNEL_LIGHT + 0)); - addChild(createLight>(mm2px(Vec(10.8203, 87.7163)), module, TSequentialSwitch::CHANNEL_LIGHT + 1)); - addChild(createLight>(mm2px(Vec(10.8203, 97.7167)), module, TSequentialSwitch::CHANNEL_LIGHT + 2)); - addChild(createLight>(mm2px(Vec(10.8203, 107.716)), module, TSequentialSwitch::CHANNEL_LIGHT + 3)); -} + addChild(createLight>(mm2px(Vec(10.8203, 77.7158)), module, TSequentialSwitch::CHANNEL_LIGHT + 0)); + addChild(createLight>(mm2px(Vec(10.8203, 87.7163)), module, TSequentialSwitch::CHANNEL_LIGHT + 1)); + addChild(createLight>(mm2px(Vec(10.8203, 97.7167)), module, TSequentialSwitch::CHANNEL_LIGHT + 2)); + addChild(createLight>(mm2px(Vec(10.8203, 107.716)), module, TSequentialSwitch::CHANNEL_LIGHT + 3)); + } +}; Model *modelSequentialSwitch1 = createModel, SequentialSwitch1Widget>("SequentialSwitch1"); struct SequentialSwitch2Widget : ModuleWidget { - SequentialSwitch2Widget(SequentialSwitch<2> *module); -}; - -SequentialSwitch2Widget::SequentialSwitch2Widget(SequentialSwitch<2> *module) : ModuleWidget(module) { typedef SequentialSwitch<2> TSequentialSwitch; - setPanel(SVG::load(asset::plugin(plugin, "res/SequentialSwitch2.svg"))); - addChild(createWidget(Vec(RACK_GRID_WIDTH, 0))); - addChild(createWidget(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); + SequentialSwitch2Widget(SequentialSwitch<2> *module) { + setModule(module); + setPanel(SVG::load(asset::plugin(plugin, "res/SequentialSwitch2.svg"))); + + addChild(createWidget(Vec(RACK_GRID_WIDTH, 0))); + addChild(createWidget(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); - addParam(createParam(mm2px(Vec(5.24619, 46.9153)), module, TSequentialSwitch::CHANNELS_PARAM)); + addParam(createParam(mm2px(Vec(5.24619, 46.9153)), module, TSequentialSwitch::CHANNELS_PARAM)); - addInput(createInput(mm2px(Vec(3.51398, 17.694)), module, TSequentialSwitch::CLOCK_INPUT)); - addInput(createInput(mm2px(Vec(3.51398, 32.191)), module, TSequentialSwitch::RESET_INPUT)); - addInput(createInput(mm2px(Vec(3.51398, 62.811)), module, TSequentialSwitch::IN_INPUT + 0)); - addInput(createInput(mm2px(Vec(3.51398, 72.8114)), module, TSequentialSwitch::IN_INPUT + 1)); - addInput(createInput(mm2px(Vec(3.51398, 82.8091)), module, TSequentialSwitch::IN_INPUT + 2)); - addInput(createInput(mm2px(Vec(3.51398, 92.8109)), module, TSequentialSwitch::IN_INPUT + 3)); + addInput(createInput(mm2px(Vec(3.51398, 17.694)), module, TSequentialSwitch::CLOCK_INPUT)); + addInput(createInput(mm2px(Vec(3.51398, 32.191)), module, TSequentialSwitch::RESET_INPUT)); + addInput(createInput(mm2px(Vec(3.51398, 62.811)), module, TSequentialSwitch::IN_INPUT + 0)); + addInput(createInput(mm2px(Vec(3.51398, 72.8114)), module, TSequentialSwitch::IN_INPUT + 1)); + addInput(createInput(mm2px(Vec(3.51398, 82.8091)), module, TSequentialSwitch::IN_INPUT + 2)); + addInput(createInput(mm2px(Vec(3.51398, 92.8109)), module, TSequentialSwitch::IN_INPUT + 3)); - addOutput(createOutput(mm2px(Vec(3.51398, 107.622)), module, TSequentialSwitch::OUT_OUTPUT + 0)); + addOutput(createOutput(mm2px(Vec(3.51398, 107.622)), module, TSequentialSwitch::OUT_OUTPUT + 0)); - addChild(createLight>(mm2px(Vec(10.7321, 62.6277)), module, TSequentialSwitch::CHANNEL_LIGHT + 0)); - addChild(createLight>(mm2px(Vec(10.7321, 72.6281)), module, TSequentialSwitch::CHANNEL_LIGHT + 1)); - addChild(createLight>(mm2px(Vec(10.7321, 82.6285)), module, TSequentialSwitch::CHANNEL_LIGHT + 2)); - addChild(createLight>(mm2px(Vec(10.7321, 92.6276)), module, TSequentialSwitch::CHANNEL_LIGHT + 3)); -} + addChild(createLight>(mm2px(Vec(10.7321, 62.6277)), module, TSequentialSwitch::CHANNEL_LIGHT + 0)); + addChild(createLight>(mm2px(Vec(10.7321, 72.6281)), module, TSequentialSwitch::CHANNEL_LIGHT + 1)); + addChild(createLight>(mm2px(Vec(10.7321, 82.6285)), module, TSequentialSwitch::CHANNEL_LIGHT + 2)); + addChild(createLight>(mm2px(Vec(10.7321, 92.6276)), module, TSequentialSwitch::CHANNEL_LIGHT + 3)); + } +}; Model *modelSequentialSwitch2 = createModel, SequentialSwitch2Widget>("SequentialSwitch2"); diff --git a/src/Unity.cpp b/src/Unity.cpp index 4be8402..54497ea 100644 --- a/src/Unity.cpp +++ b/src/Unity.cpp @@ -92,54 +92,6 @@ struct Unity : Module { }; - -struct UnityWidget : ModuleWidget { - UnityWidget(Unity *module); - void appendContextMenu(Menu *menu) override; -}; - -UnityWidget::UnityWidget(Unity *module) : ModuleWidget(module) { - setPanel(SVG::load(asset::plugin(plugin, "res/Unity.svg"))); - - addChild(createWidget(Vec(15, 0))); - addChild(createWidget(Vec(box.size.x - 30, 0))); - addChild(createWidget(Vec(15, 365))); - addChild(createWidget(Vec(box.size.x - 30, 365))); - - addParam(createParam(mm2px(Vec(12.867, 52.961)), module, Unity::AVG1_PARAM)); - addParam(createParam(mm2px(Vec(12.867, 107.006)), module, Unity::AVG2_PARAM)); - - addInput(createInput(mm2px(Vec(2.361, 17.144)), module, Unity::IN1_INPUT + 0)); - addInput(createInput(mm2px(Vec(19.907, 17.144)), module, Unity::IN1_INPUT + 1)); - addInput(createInput(mm2px(Vec(2.361, 28.145)), module, Unity::IN1_INPUT + 2)); - addInput(createInput(mm2px(Vec(19.907, 28.145)), module, Unity::IN1_INPUT + 3)); - addInput(createInput(mm2px(Vec(2.361, 39.145)), module, Unity::IN1_INPUT + 4)); - addInput(createInput(mm2px(Vec(19.907, 39.145)), module, Unity::IN1_INPUT + 5)); - addInput(createInput(mm2px(Vec(2.361, 71.145)), module, Unity::IN2_INPUT + 0)); - addInput(createInput(mm2px(Vec(19.907, 71.145)), module, Unity::IN2_INPUT + 1)); - addInput(createInput(mm2px(Vec(2.361, 82.145)), module, Unity::IN2_INPUT + 2)); - addInput(createInput(mm2px(Vec(19.907, 82.145)), module, Unity::IN2_INPUT + 3)); - addInput(createInput(mm2px(Vec(2.361, 93.144)), module, Unity::IN2_INPUT + 4)); - addInput(createInput(mm2px(Vec(19.907, 93.144)), module, Unity::IN2_INPUT + 5)); - - addOutput(createOutput(mm2px(Vec(2.361, 54.15)), module, Unity::MIX1_OUTPUT)); - addOutput(createOutput(mm2px(Vec(19.907, 54.15)), module, Unity::INV1_OUTPUT)); - addOutput(createOutput(mm2px(Vec(2.361, 108.144)), module, Unity::MIX2_OUTPUT)); - addOutput(createOutput(mm2px(Vec(19.907, 108.144)), module, Unity::INV2_OUTPUT)); - - addChild(createLight>(mm2px(Vec(13.652, 19.663)), module, Unity::VU1_LIGHT + 0)); - addChild(createLight>(mm2px(Vec(13.652, 25.163)), module, Unity::VU1_LIGHT + 1)); - addChild(createLight>(mm2px(Vec(13.652, 30.663)), module, Unity::VU1_LIGHT + 2)); - addChild(createLight>(mm2px(Vec(13.652, 36.162)), module, Unity::VU1_LIGHT + 3)); - addChild(createLight>(mm2px(Vec(13.652, 41.662)), module, Unity::VU1_LIGHT + 4)); - addChild(createLight>(mm2px(Vec(13.652, 73.663)), module, Unity::VU2_LIGHT + 0)); - addChild(createLight>(mm2px(Vec(13.652, 79.163)), module, Unity::VU2_LIGHT + 1)); - addChild(createLight>(mm2px(Vec(13.652, 84.663)), module, Unity::VU2_LIGHT + 2)); - addChild(createLight>(mm2px(Vec(13.652, 90.162)), module, Unity::VU2_LIGHT + 3)); - addChild(createLight>(mm2px(Vec(13.652, 95.662)), module, Unity::VU2_LIGHT + 4)); -} - - struct UnityMergeItem : MenuItem { Unity *unity; void onAction(const event::Action &e) override { @@ -150,16 +102,61 @@ struct UnityMergeItem : MenuItem { } }; -void UnityWidget::appendContextMenu(Menu *menu) { - menu->addChild(new MenuEntry); - Unity *unity = dynamic_cast(module); - assert(unity); +struct UnityWidget : ModuleWidget { + UnityWidget(Unity *module) { + setModule(module); + setPanel(SVG::load(asset::plugin(plugin, "res/Unity.svg"))); + + addChild(createWidget(Vec(15, 0))); + addChild(createWidget(Vec(box.size.x - 30, 0))); + addChild(createWidget(Vec(15, 365))); + addChild(createWidget(Vec(box.size.x - 30, 365))); + + addParam(createParam(mm2px(Vec(12.867, 52.961)), module, Unity::AVG1_PARAM)); + addParam(createParam(mm2px(Vec(12.867, 107.006)), module, Unity::AVG2_PARAM)); + + addInput(createInput(mm2px(Vec(2.361, 17.144)), module, Unity::IN1_INPUT + 0)); + addInput(createInput(mm2px(Vec(19.907, 17.144)), module, Unity::IN1_INPUT + 1)); + addInput(createInput(mm2px(Vec(2.361, 28.145)), module, Unity::IN1_INPUT + 2)); + addInput(createInput(mm2px(Vec(19.907, 28.145)), module, Unity::IN1_INPUT + 3)); + addInput(createInput(mm2px(Vec(2.361, 39.145)), module, Unity::IN1_INPUT + 4)); + addInput(createInput(mm2px(Vec(19.907, 39.145)), module, Unity::IN1_INPUT + 5)); + addInput(createInput(mm2px(Vec(2.361, 71.145)), module, Unity::IN2_INPUT + 0)); + addInput(createInput(mm2px(Vec(19.907, 71.145)), module, Unity::IN2_INPUT + 1)); + addInput(createInput(mm2px(Vec(2.361, 82.145)), module, Unity::IN2_INPUT + 2)); + addInput(createInput(mm2px(Vec(19.907, 82.145)), module, Unity::IN2_INPUT + 3)); + addInput(createInput(mm2px(Vec(2.361, 93.144)), module, Unity::IN2_INPUT + 4)); + addInput(createInput(mm2px(Vec(19.907, 93.144)), module, Unity::IN2_INPUT + 5)); + + addOutput(createOutput(mm2px(Vec(2.361, 54.15)), module, Unity::MIX1_OUTPUT)); + addOutput(createOutput(mm2px(Vec(19.907, 54.15)), module, Unity::INV1_OUTPUT)); + addOutput(createOutput(mm2px(Vec(2.361, 108.144)), module, Unity::MIX2_OUTPUT)); + addOutput(createOutput(mm2px(Vec(19.907, 108.144)), module, Unity::INV2_OUTPUT)); + + addChild(createLight>(mm2px(Vec(13.652, 19.663)), module, Unity::VU1_LIGHT + 0)); + addChild(createLight>(mm2px(Vec(13.652, 25.163)), module, Unity::VU1_LIGHT + 1)); + addChild(createLight>(mm2px(Vec(13.652, 30.663)), module, Unity::VU1_LIGHT + 2)); + addChild(createLight>(mm2px(Vec(13.652, 36.162)), module, Unity::VU1_LIGHT + 3)); + addChild(createLight>(mm2px(Vec(13.652, 41.662)), module, Unity::VU1_LIGHT + 4)); + addChild(createLight>(mm2px(Vec(13.652, 73.663)), module, Unity::VU2_LIGHT + 0)); + addChild(createLight>(mm2px(Vec(13.652, 79.163)), module, Unity::VU2_LIGHT + 1)); + addChild(createLight>(mm2px(Vec(13.652, 84.663)), module, Unity::VU2_LIGHT + 2)); + addChild(createLight>(mm2px(Vec(13.652, 90.162)), module, Unity::VU2_LIGHT + 3)); + addChild(createLight>(mm2px(Vec(13.652, 95.662)), module, Unity::VU2_LIGHT + 4)); + } + + void appendContextMenu(Menu *menu) override { + menu->addChild(new MenuEntry); - UnityMergeItem *mergeItem = createMenuItem("Merge channels 1 & 2"); - mergeItem->unity = unity; - menu->addChild(mergeItem); -} + Unity *unity = dynamic_cast(module); + assert(unity); + + UnityMergeItem *mergeItem = createMenuItem("Merge channels 1 & 2"); + mergeItem->unity = unity; + menu->addChild(mergeItem); + } +}; Model *modelUnity = createModel("Unity"); diff --git a/src/VCA.cpp b/src/VCA.cpp index 8115469..f1bc6e4 100644 --- a/src/VCA.cpp +++ b/src/VCA.cpp @@ -24,8 +24,8 @@ struct VCA : Module { VCA() { config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS); - params[LEVEL1_PARAM].config(0.0, 1.0, 0.0); - params[LEVEL2_PARAM].config(0.0, 1.0, 0.0); + params[LEVEL1_PARAM].config(0.0, 1.0, 0.0, "Ch 1 level", "%", 0, 100); + params[LEVEL2_PARAM].config(0.0, 1.0, 0.0, "Ch 2 level", "%", 0, 100); } void stepChannel(InputIds in, ParamIds level, InputIds lin, InputIds exp, OutputIds out) { @@ -47,30 +47,30 @@ struct VCA : Module { struct VCAWidget : ModuleWidget { - VCAWidget(VCA *module); -}; + VCAWidget(VCA *module) { + setModule(module); + setPanel(SVG::load(asset::plugin(plugin, "res/VCA.svg"))); -VCAWidget::VCAWidget(VCA *module) : ModuleWidget(module) { - setPanel(SVG::load(asset::plugin(plugin, "res/VCA.svg"))); + addChild(createWidget(Vec(RACK_GRID_WIDTH, 0))); + addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0))); + addChild(createWidget(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); + addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); - addChild(createWidget(Vec(RACK_GRID_WIDTH, 0))); - addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0))); - addChild(createWidget(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); - addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); + addParam(createParam(mm2px(Vec(6.35, 19.11753)), module, VCA::LEVEL1_PARAM)); + addParam(createParam(mm2px(Vec(6.35, 74.80544)), module, VCA::LEVEL2_PARAM)); - addParam(createParam(mm2px(Vec(6.35, 19.11753)), module, VCA::LEVEL1_PARAM)); - addParam(createParam(mm2px(Vec(6.35, 74.80544)), module, VCA::LEVEL2_PARAM)); + addInput(createInput(mm2px(Vec(2.5907, 38.19371)), module, VCA::EXP1_INPUT)); + addInput(createInput(mm2px(Vec(14.59752, 38.19371)), module, VCA::LIN1_INPUT)); + addInput(createInput(mm2px(Vec(2.5907, 52.80642)), module, VCA::IN1_INPUT)); + addInput(createInput(mm2px(Vec(2.5907, 93.53435)), module, VCA::EXP2_INPUT)); + addInput(createInput(mm2px(Vec(14.59752, 93.53435)), module, VCA::LIN2_INPUT)); + addInput(createInput(mm2px(Vec(2.5907, 108.14706)), module, VCA::IN2_INPUT)); - addInput(createInput(mm2px(Vec(2.5907, 38.19371)), module, VCA::EXP1_INPUT)); - addInput(createInput(mm2px(Vec(14.59752, 38.19371)), module, VCA::LIN1_INPUT)); - addInput(createInput(mm2px(Vec(2.5907, 52.80642)), module, VCA::IN1_INPUT)); - addInput(createInput(mm2px(Vec(2.5907, 93.53435)), module, VCA::EXP2_INPUT)); - addInput(createInput(mm2px(Vec(14.59752, 93.53435)), module, VCA::LIN2_INPUT)); - addInput(createInput(mm2px(Vec(2.5907, 108.14706)), module, VCA::IN2_INPUT)); + addOutput(createOutput(mm2px(Vec(14.59752, 52.80642)), module, VCA::OUT1_OUTPUT)); + addOutput(createOutput(mm2px(Vec(14.59752, 108.14706)), module, VCA::OUT2_OUTPUT)); + } +}; - addOutput(createOutput(mm2px(Vec(14.59752, 52.80642)), module, VCA::OUT1_OUTPUT)); - addOutput(createOutput(mm2px(Vec(14.59752, 108.14706)), module, VCA::OUT2_OUTPUT)); -} struct VCA_1 : Module { @@ -96,8 +96,8 @@ struct VCA_1 : Module { VCA_1() { config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS); - params[LEVEL_PARAM].config(0.0, 1.0, 1.0); - params[EXP_PARAM].config(0.0, 1.0, 1.0); + params[LEVEL_PARAM].config(0.0, 1.0, 1.0, "Level", "%", 0, 100); + params[EXP_PARAM].config(0.0, 1.0, 1.0, "Response mode"); } void step() override { @@ -153,7 +153,8 @@ struct VCA_1VUKnob : Knob { struct VCA_1Widget : ModuleWidget { - VCA_1Widget(VCA_1 *module) : ModuleWidget(module) { + VCA_1Widget(VCA_1 *module) { + setModule(module); setPanel(SVG::load(asset::plugin(plugin, "res/VCA-1.svg"))); addChild(createWidget(Vec(RACK_GRID_WIDTH, 0))); diff --git a/src/VCF.cpp b/src/VCF.cpp index 3ec48f7..cbf2890 100644 --- a/src/VCF.cpp +++ b/src/VCF.cpp @@ -150,7 +150,8 @@ struct VCF : Module { struct VCFWidget : ModuleWidget { - VCFWidget(VCF *module) : ModuleWidget(module) { + VCFWidget(VCF *module) { + setModule(module); setPanel(SVG::load(asset::plugin(plugin, "res/VCF.svg"))); addChild(createWidget(Vec(15, 0))); diff --git a/src/VCMixer.cpp b/src/VCMixer.cpp index 3d692bd..3add0c5 100644 --- a/src/VCMixer.cpp +++ b/src/VCMixer.cpp @@ -47,7 +47,8 @@ struct VCMixer : Module { struct VCMixerWidget : ModuleWidget { - VCMixerWidget(VCMixer *module) : ModuleWidget(module) { + VCMixerWidget(VCMixer *module) { + setModule(module); setPanel(SVG::load(asset::plugin(plugin, "res/VCMixer.svg"))); addChild(createWidget(Vec(RACK_GRID_WIDTH, 0))); diff --git a/src/VCO.cpp b/src/VCO.cpp index 63efc9d..c7ae6c7 100644 --- a/src/VCO.cpp +++ b/src/VCO.cpp @@ -107,7 +107,7 @@ struct VoltageControlledOscillator { sinBuffer[i] *= 1.08f; } else { - sinBuffer[i] = sinf(2.f*M_PI * phase); + sinBuffer[i] = std::sin(2.f*M_PI * phase); } if (analog) { triBuffer[i] = 1.25f * interpolateLinear(triTable, phase * 2047.f); @@ -155,7 +155,7 @@ struct VoltageControlledOscillator { return sqrDecimator.process(sqrBuffer); } float light() { - return sinf(2*M_PI * phase); + return std::sin(2*M_PI * phase); } }; @@ -195,82 +195,79 @@ struct VCO : Module { VCO() { config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS); - params[MODE_PARAM].config(0.f, 1.f, 1.f, "Mode"); - params[SYNC_PARAM].config(0.f, 1.f, 1.f, "Sync"); + params[MODE_PARAM].config(0.f, 1.f, 1.f, "Analog mode"); + params[SYNC_PARAM].config(0.f, 1.f, 1.f, "Hard sync"); params[FREQ_PARAM].config(-54.0f, 54.0f, 0.0f, "Frequency", " Hz", std::pow(2, 1/12.f), dsp::FREQ_C4); params[FINE_PARAM].config(-1.0f, 1.0f, 0.0f, "Fine frequency"); params[FM_PARAM].config(0.0f, 1.0f, 0.0f, "Frequency modulation"); params[PW_PARAM].config(0.0f, 1.0f, 0.5f, "Pulse width", "%", 0.f, 100.f); params[PWM_PARAM].config(0.0f, 1.0f, 0.0f, "Pulse width modulation", "%", 0.f, 100.f); } - void step() override; -}; - -void VCO::step() { - oscillator.analog = params[MODE_PARAM].value > 0.0f; - oscillator.soft = params[SYNC_PARAM].value <= 0.0f; + void step() override { + oscillator.analog = params[MODE_PARAM].value > 0.0f; + oscillator.soft = params[SYNC_PARAM].value <= 0.0f; - float pitchFine = 3.0f * dsp::quadraticBipolar(params[FINE_PARAM].value); - float pitchCv = 12.0f * inputs[PITCH_INPUT].value; - if (inputs[FM_INPUT].active) { - pitchCv += dsp::quadraticBipolar(params[FM_PARAM].value) * 12.0f * inputs[FM_INPUT].value; + float pitchFine = 3.0f * dsp::quadraticBipolar(params[FINE_PARAM].value); + float pitchCv = 12.0f * inputs[PITCH_INPUT].value; + if (inputs[FM_INPUT].active) { + pitchCv += dsp::quadraticBipolar(params[FM_PARAM].value) * 12.0f * inputs[FM_INPUT].value; + } + oscillator.setPitch(params[FREQ_PARAM].value, pitchFine + pitchCv); + oscillator.setPulseWidth(params[PW_PARAM].value + params[PWM_PARAM].value * inputs[PW_INPUT].value / 10.0f); + oscillator.syncEnabled = inputs[SYNC_INPUT].active; + + oscillator.process(app()->engine->getSampleTime(), inputs[SYNC_INPUT].value); + + // Set output + if (outputs[SIN_OUTPUT].active) + outputs[SIN_OUTPUT].value = 5.0f * oscillator.sin(); + if (outputs[TRI_OUTPUT].active) + outputs[TRI_OUTPUT].value = 5.0f * oscillator.tri(); + if (outputs[SAW_OUTPUT].active) + outputs[SAW_OUTPUT].value = 5.0f * oscillator.saw(); + if (outputs[SQR_OUTPUT].active) + outputs[SQR_OUTPUT].value = 5.0f * oscillator.sqr(); + + lights[PHASE_POS_LIGHT].setBrightnessSmooth(fmaxf(0.0f, oscillator.light())); + lights[PHASE_NEG_LIGHT].setBrightnessSmooth(fmaxf(0.0f, -oscillator.light())); } - oscillator.setPitch(params[FREQ_PARAM].value, pitchFine + pitchCv); - oscillator.setPulseWidth(params[PW_PARAM].value + params[PWM_PARAM].value * inputs[PW_INPUT].value / 10.0f); - oscillator.syncEnabled = inputs[SYNC_INPUT].active; - - oscillator.process(app()->engine->getSampleTime(), inputs[SYNC_INPUT].value); - - // Set output - if (outputs[SIN_OUTPUT].active) - outputs[SIN_OUTPUT].value = 5.0f * oscillator.sin(); - if (outputs[TRI_OUTPUT].active) - outputs[TRI_OUTPUT].value = 5.0f * oscillator.tri(); - if (outputs[SAW_OUTPUT].active) - outputs[SAW_OUTPUT].value = 5.0f * oscillator.saw(); - if (outputs[SQR_OUTPUT].active) - outputs[SQR_OUTPUT].value = 5.0f * oscillator.sqr(); - - lights[PHASE_POS_LIGHT].setBrightnessSmooth(fmaxf(0.0f, oscillator.light())); - lights[PHASE_NEG_LIGHT].setBrightnessSmooth(fmaxf(0.0f, -oscillator.light())); -} +}; struct VCOWidget : ModuleWidget { - VCOWidget(VCO *module); + VCOWidget(VCO *module) { + setModule(module); + setPanel(SVG::load(asset::plugin(plugin, "res/VCO-1.svg"))); + + addChild(createWidget(Vec(15, 0))); + addChild(createWidget(Vec(box.size.x-30, 0))); + addChild(createWidget(Vec(15, 365))); + addChild(createWidget(Vec(box.size.x-30, 365))); + + addParam(createParam(Vec(15, 77), module, VCO::MODE_PARAM)); + addParam(createParam(Vec(119, 77), module, VCO::SYNC_PARAM)); + + addParam(createParam(Vec(47, 61), module, VCO::FREQ_PARAM)); + addParam(createParam(Vec(23, 143), module, VCO::FINE_PARAM)); + addParam(createParam(Vec(91, 143), module, VCO::PW_PARAM)); + addParam(createParam(Vec(23, 208), module, VCO::FM_PARAM)); + addParam(createParam(Vec(91, 208), module, VCO::PWM_PARAM)); + + addInput(createInput(Vec(11, 276), module, VCO::PITCH_INPUT)); + addInput(createInput(Vec(45, 276), module, VCO::FM_INPUT)); + addInput(createInput(Vec(80, 276), module, VCO::SYNC_INPUT)); + addInput(createInput(Vec(114, 276), module, VCO::PW_INPUT)); + + addOutput(createOutput(Vec(11, 320), module, VCO::SIN_OUTPUT)); + addOutput(createOutput(Vec(45, 320), module, VCO::TRI_OUTPUT)); + addOutput(createOutput(Vec(80, 320), module, VCO::SAW_OUTPUT)); + addOutput(createOutput(Vec(114, 320), module, VCO::SQR_OUTPUT)); + + addChild(createLight>(Vec(99, 42.5f), module, VCO::PHASE_POS_LIGHT)); + } }; -VCOWidget::VCOWidget(VCO *module) : ModuleWidget(module) { - setPanel(SVG::load(asset::plugin(plugin, "res/VCO-1.svg"))); - - addChild(createWidget(Vec(15, 0))); - addChild(createWidget(Vec(box.size.x-30, 0))); - addChild(createWidget(Vec(15, 365))); - addChild(createWidget(Vec(box.size.x-30, 365))); - - addParam(createParam(Vec(15, 77), module, VCO::MODE_PARAM)); - addParam(createParam(Vec(119, 77), module, VCO::SYNC_PARAM)); - - addParam(createParam(Vec(47, 61), module, VCO::FREQ_PARAM)); - addParam(createParam(Vec(23, 143), module, VCO::FINE_PARAM)); - addParam(createParam(Vec(91, 143), module, VCO::PW_PARAM)); - addParam(createParam(Vec(23, 208), module, VCO::FM_PARAM)); - addParam(createParam(Vec(91, 208), module, VCO::PWM_PARAM)); - - addInput(createInput(Vec(11, 276), module, VCO::PITCH_INPUT)); - addInput(createInput(Vec(45, 276), module, VCO::FM_INPUT)); - addInput(createInput(Vec(80, 276), module, VCO::SYNC_INPUT)); - addInput(createInput(Vec(114, 276), module, VCO::PW_INPUT)); - - addOutput(createOutput(Vec(11, 320), module, VCO::SIN_OUTPUT)); - addOutput(createOutput(Vec(45, 320), module, VCO::TRI_OUTPUT)); - addOutput(createOutput(Vec(80, 320), module, VCO::SAW_OUTPUT)); - addOutput(createOutput(Vec(114, 320), module, VCO::SQR_OUTPUT)); - - addChild(createLight>(Vec(99, 42.5f), module, VCO::PHASE_POS_LIGHT)); -} - Model *modelVCO = createModel("VCO"); @@ -304,69 +301,68 @@ struct VCO2 : Module { VCO2() { config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS); - params[MODE_PARAM].config(0.f, 1.f, 1.f, "Mode"); - params[SYNC_PARAM].config(0.f, 1.f, 1.f, "Sync"); + params[MODE_PARAM].config(0.f, 1.f, 1.f, "Analog mode"); + params[SYNC_PARAM].config(0.f, 1.f, 1.f, "Hard sync"); params[FREQ_PARAM].config(-54.0f, 54.0f, 0.0f, "Frequency", " Hz", std::pow(2, 1/12.f), dsp::FREQ_C4); params[WAVE_PARAM].config(0.0f, 3.0f, 1.5f, "Wave"); params[FM_PARAM].config(0.0f, 1.0f, 0.0f, "Frequency modulation"); } - void step() override; -}; - - -void VCO2::step() { - oscillator.analog = params[MODE_PARAM].value > 0.0f; - oscillator.soft = params[SYNC_PARAM].value <= 0.0f; - - float pitchCv = params[FREQ_PARAM].value + dsp::quadraticBipolar(params[FM_PARAM].value) * 12.0f * inputs[FM_INPUT].value; - oscillator.setPitch(0.0f, pitchCv); - oscillator.syncEnabled = inputs[SYNC_INPUT].active; - oscillator.process(app()->engine->getSampleTime(), inputs[SYNC_INPUT].value); + void step() override { + oscillator.analog = params[MODE_PARAM].value > 0.0f; + oscillator.soft = params[SYNC_PARAM].value <= 0.0f; + + float pitchCv = params[FREQ_PARAM].value + dsp::quadraticBipolar(params[FM_PARAM].value) * 12.0f * inputs[FM_INPUT].value; + oscillator.setPitch(0.0f, pitchCv); + oscillator.syncEnabled = inputs[SYNC_INPUT].active; + + oscillator.process(app()->engine->getSampleTime(), inputs[SYNC_INPUT].value); + + // Set output + float wave = clamp(params[WAVE_PARAM].value + inputs[WAVE_INPUT].value, 0.0f, 3.0f); + float out; + if (wave < 1.0f) + out = crossfade(oscillator.sin(), oscillator.tri(), wave); + else if (wave < 2.0f) + out = crossfade(oscillator.tri(), oscillator.saw(), wave - 1.0f); + else + out = crossfade(oscillator.saw(), oscillator.sqr(), wave - 2.0f); + outputs[OUT_OUTPUT].value = 5.0f * out; + + lights[PHASE_POS_LIGHT].setBrightnessSmooth(fmaxf(0.0f, oscillator.light())); + lights[PHASE_NEG_LIGHT].setBrightnessSmooth(fmaxf(0.0f, -oscillator.light())); + } +}; - // Set output - float wave = clamp(params[WAVE_PARAM].value + inputs[WAVE_INPUT].value, 0.0f, 3.0f); - float out; - if (wave < 1.0f) - out = crossfade(oscillator.sin(), oscillator.tri(), wave); - else if (wave < 2.0f) - out = crossfade(oscillator.tri(), oscillator.saw(), wave - 1.0f); - else - out = crossfade(oscillator.saw(), oscillator.sqr(), wave - 2.0f); - outputs[OUT_OUTPUT].value = 5.0f * out; - lights[PHASE_POS_LIGHT].setBrightnessSmooth(fmaxf(0.0f, oscillator.light())); - lights[PHASE_NEG_LIGHT].setBrightnessSmooth(fmaxf(0.0f, -oscillator.light())); -} struct VCO2Widget : ModuleWidget { - VCO2Widget(VCO2 *module); -}; + VCO2Widget(VCO2 *module) { + setModule(module); + setPanel(SVG::load(asset::plugin(plugin, "res/VCO-2.svg"))); -VCO2Widget::VCO2Widget(VCO2 *module) : ModuleWidget(module) { - setPanel(SVG::load(asset::plugin(plugin, "res/VCO-2.svg"))); + addChild(createWidget(Vec(15, 0))); + addChild(createWidget(Vec(box.size.x-30, 0))); + addChild(createWidget(Vec(15, 365))); + addChild(createWidget(Vec(box.size.x-30, 365))); - addChild(createWidget(Vec(15, 0))); - addChild(createWidget(Vec(box.size.x-30, 0))); - addChild(createWidget(Vec(15, 365))); - addChild(createWidget(Vec(box.size.x-30, 365))); + addParam(createParam(Vec(62, 150), module, VCO2::MODE_PARAM)); + addParam(createParam(Vec(62, 215), module, VCO2::SYNC_PARAM)); - addParam(createParam(Vec(62, 150), module, VCO2::MODE_PARAM)); - addParam(createParam(Vec(62, 215), module, VCO2::SYNC_PARAM)); + addParam(createParam(Vec(17, 60), module, VCO2::FREQ_PARAM)); + addParam(createParam(Vec(12, 143), module, VCO2::WAVE_PARAM)); + addParam(createParam(Vec(12, 208), module, VCO2::FM_PARAM)); - addParam(createParam(Vec(17, 60), module, VCO2::FREQ_PARAM)); - addParam(createParam(Vec(12, 143), module, VCO2::WAVE_PARAM)); - addParam(createParam(Vec(12, 208), module, VCO2::FM_PARAM)); + addInput(createInput(Vec(11, 276), module, VCO2::FM_INPUT)); + addInput(createInput(Vec(54, 276), module, VCO2::SYNC_INPUT)); + addInput(createInput(Vec(11, 320), module, VCO2::WAVE_INPUT)); - addInput(createInput(Vec(11, 276), module, VCO2::FM_INPUT)); - addInput(createInput(Vec(54, 276), module, VCO2::SYNC_INPUT)); - addInput(createInput(Vec(11, 320), module, VCO2::WAVE_INPUT)); + addOutput(createOutput(Vec(54, 320), module, VCO2::OUT_OUTPUT)); - addOutput(createOutput(Vec(54, 320), module, VCO2::OUT_OUTPUT)); - - addChild(createLight>(Vec(68, 42.5f), module, VCO2::PHASE_POS_LIGHT)); -} + addChild(createLight>(Vec(68, 42.5f), module, VCO2::PHASE_POS_LIGHT)); + } +}; Model *modelVCO2 = createModel("VCO2");