diff --git a/Makefile b/Makefile index 90e19f5..aa75e92 100755 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ RACK_DIR ?= ../.. SLUG = AS -VERSION = 0.6.0.2 +VERSION = 0.6.1 FLAGS += -Idep/include SOURCES += $(wildcard src/*.cpp freeverb/*.cpp) diff --git a/README.md b/README.md index 131445e..81a74f8 100755 --- a/README.md +++ b/README.md @@ -40,6 +40,8 @@ V 0.5.4: Fixed a reset signal issue. V 0.5.5: 16th clock output now sends unipolar signal, just as the other outputs. +V 0.6.1: Now BPM Clock outputs a short length trigger signal, as most of the available clocks. + ### 8 Channel Mixer Fundamental/Autodafe mixer module. Mods: graphics, sliders for channel volume, stereo or mono output(L channel outputs L+R signal if R channel is not active). Now with main mix mute button. Beware,the default setting for each channel volume is at 70% in stead of 0%. @@ -87,15 +89,21 @@ V 0.5.7 Module size reduced to 4HP ### TriLFO Fundamental LFO module. Mods:graphics, controls stripped to the basics but you get 3 LFOS on the same space. -### Triggers +### AtNuVrTr Dual attenuverter module +Just like Befaco Attenuverter module but with added cv inputs to modulate both Attenueverter and Offset parameters. + +V 0.6.1: First relase of this module. + +### Triggers REMOVED A couple of manual trigger buttons, one ON/OFF, one temporary, both with 4 trigger outputs, trigger volts knob going from 1 to 10 v output. (NOTICE: Triggers MKI will supersede Triggers, so Triggers will be removed from the plugin by v0.6 but you have time now to replace it on your current patches and keep everything working fine). ### Triggers MKI -A manual CV signal trigger module with latch and temporary triggers, volts knob lets you adjust from 0 to 10 v output. +A manual CV signal trigger module with latch and temporary triggers, volts knob lets you adjust the range from -10v to 10v output. V 0.5.7: First relase of this module. +V 0.6.1: Changed the volts range to -10v +10v and now the display shows positive values in green, and negative values in red. ### Triggers MKII A manual CV signal temporary trigger module with labeling integrated, so you remember where the signal is going. diff --git a/res/AtNuVrTr.svg b/res/AtNuVrTr.svg new file mode 100644 index 0000000..dee58ff --- /dev/null +++ b/res/AtNuVrTr.svg @@ -0,0 +1,440 @@ + + + +image/svg+xmlMyModule \ No newline at end of file diff --git a/res/Multiple2_5 copy.svg b/res/Multiple2_5 copy.svg deleted file mode 100644 index 6056081..0000000 --- a/res/Multiple2_5 copy.svg +++ /dev/null @@ -1,395 +0,0 @@ - - - - - - image/svg+xml - - MyModule - - - - - - MyModule - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/AS.cpp b/src/AS.cpp index c6452e7..0bedc8b 100755 --- a/src/AS.cpp +++ b/src/AS.cpp @@ -15,6 +15,8 @@ void init(rack::Plugin *p) { p->addModel(modelVCA); p->addModel(modelQuadVCA); p->addModel(modelTriLFO); + p->addModel(modelAtNuVrTr); + p->addModel(modelBPMClock); p->addModel(modelSEQ16); p->addModel(modelMixer8ch); diff --git a/src/AS.hpp b/src/AS.hpp index a21049b..64b3240 100755 --- a/src/AS.hpp +++ b/src/AS.hpp @@ -17,6 +17,8 @@ extern Model *modelADSR; extern Model *modelVCA; extern Model *modelQuadVCA; extern Model *modelTriLFO; +extern Model *modelAtNuVrTr; + extern Model *modelBPMClock; extern Model *modelSEQ16; extern Model *modelMixer8ch; diff --git a/src/AtNuVrTr.cpp b/src/AtNuVrTr.cpp new file mode 100644 index 0000000..a2d5d5a --- /dev/null +++ b/src/AtNuVrTr.cpp @@ -0,0 +1,115 @@ +#include "AS.hpp" + + +struct AtNuVrTr : Module { + enum ParamIds { + ATEN1_PARAM, + OFFSET1_PARAM, + ATEN2_PARAM, + OFFSET2_PARAM, + NUM_PARAMS + }; + enum InputIds { + CV_ATEN_1, + CV_ATEN_2, + CV_OFFSET_1, + CV_OFFSET_2, + IN1_INPUT, + IN2_INPUT, + NUM_INPUTS + }; + enum OutputIds { + OUT1_OUTPUT, + OUT2_OUTPUT, + NUM_OUTPUTS + }; + enum LightIds { + OUT1_POS_LIGHT, + OUT1_NEG_LIGHT, + OUT2_POS_LIGHT, + OUT2_NEG_LIGHT, + NUM_LIGHTS + }; + + AtNuVrTr() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS) {} + void step() override; +}; + + +void AtNuVrTr::step() { + float cv_at1 = 0.0f; + if(inputs[CV_ATEN_1].active){ + cv_at1 = rescale(inputs[CV_ATEN_1].value, -10.0f,10.0f, -1.0f, 1.0f); + } + float cv_off1 = 0.0f; + if(inputs[CV_OFFSET_1].active){ + cv_off1 = rescale(inputs[CV_OFFSET_1].value, -10.0f,10.0f, -10.0f, 10.0f); + } + float atten1 = params[ATEN1_PARAM].value + cv_at1; + float offset1 = params[OFFSET1_PARAM].value + cv_off1; + float out1 = inputs[IN1_INPUT].value * atten1 + offset1; + + float cv_at2 = 0.0f; + if(inputs[CV_ATEN_2].active){ + cv_at2 = rescale(inputs[CV_ATEN_2].value, -10.0f,10.0f, -1.0f, 1.0f); + } + float cv_off2 = 0.0f; + if(inputs[CV_OFFSET_2].active){ + cv_off2 = rescale(inputs[CV_OFFSET_2].value, -10.0f,10.0f, -10.0f, 10.0f); + } + float atten2 = params[ATEN2_PARAM].value + cv_at2; + float offset2 = params[OFFSET2_PARAM].value + cv_off2; + float out2 = inputs[IN2_INPUT].value * atten2 + offset2; + + + out1 = clamp(out1, -10.0f, 10.0f); + out2 = clamp(out2, -10.0f, 10.0f); + + outputs[OUT1_OUTPUT].value = out1; + outputs[OUT2_OUTPUT].value = out2; + lights[OUT1_POS_LIGHT].value = fmaxf(0.0f, out1 / 5.0f); + lights[OUT1_NEG_LIGHT].value = fmaxf(0.0f, -out1 / 5.0f); + lights[OUT2_POS_LIGHT].value = fmaxf(0.0f, out2 / 5.0f); + lights[OUT2_NEG_LIGHT].value = fmaxf(0.0f, -out2 / 5.0f); +} + + +struct AtNuVrTrWidget : ModuleWidget { + AtNuVrTrWidget(AtNuVrTr *module) : ModuleWidget(module) { + setPanel(SVG::load(assetPlugin(plugin, "res/AtNuVrTr.svg"))); + + //SCREWS + addChild(Widget::create(Vec(RACK_GRID_WIDTH, 0))); + addChild(Widget::create(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0))); + addChild(Widget::create(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); + addChild(Widget::create(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); + +const int group_offset = 160; + //ATTN 1 + addParam(ParamWidget::create(Vec(34, 45), module, AtNuVrTr::ATEN1_PARAM, -1.0f, 1.0f, 0.0f)); + addParam(ParamWidget::create(Vec(34, 100), module, AtNuVrTr::OFFSET1_PARAM, -10.0f, 10.0f, 0.0f)); + + addChild(ModuleLightWidget::create>(Vec(65, 95), module, AtNuVrTr::OUT1_POS_LIGHT)); + + addInput(Port::create(Vec(4, 51), Port::INPUT, module, AtNuVrTr::CV_ATEN_1)); + addInput(Port::create(Vec(4, 106), Port::INPUT, module, AtNuVrTr::CV_OFFSET_1)); + + addInput(Port::create(Vec(8, 165), Port::INPUT, module, AtNuVrTr::IN1_INPUT)); + addOutput(Port::create(Vec(43, 165), Port::OUTPUT, module, AtNuVrTr::OUT1_OUTPUT)); + //ATTN 2 + addParam(ParamWidget::create(Vec(34, 45+group_offset), module, AtNuVrTr::ATEN2_PARAM, -1.0f, 1.0f, 0.0f)); + addParam(ParamWidget::create(Vec(34, 100+group_offset), module, AtNuVrTr::OFFSET2_PARAM, -10.0f, 10.0f, 0.0f)); + + addChild(ModuleLightWidget::create>(Vec(65, 95+group_offset), module, AtNuVrTr::OUT2_POS_LIGHT)); + + addInput(Port::create(Vec(4, 51+group_offset), Port::INPUT, module, AtNuVrTr::CV_ATEN_2)); + addInput(Port::create(Vec(4, 106+group_offset), Port::INPUT, module, AtNuVrTr::CV_OFFSET_2)); + + addInput(Port::create(Vec(8, 165+group_offset), Port::INPUT, module, AtNuVrTr::IN2_INPUT)); + addOutput(Port::create(Vec(43, 165+group_offset), Port::OUTPUT, module, AtNuVrTr::OUT2_OUTPUT)); + + } +}; + + +Model *modelAtNuVrTr = Model::create("AS", "AtNuVrTr", "AtNuVrTr Attenuverter", ATTENUATOR_TAG, DUAL_TAG); diff --git a/src/TriggersMKI.cpp b/src/TriggersMKI.cpp index b52930b..228356b 100755 --- a/src/TriggersMKI.cpp +++ b/src/TriggersMKI.cpp @@ -37,6 +37,8 @@ struct TriggersMKI: Module { float resetLight = 0.0f; float volts = 0.0f; bool running = false; + float display_volts = 0.0f; + bool negative_volts = false; TriggersMKI() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS) {} void step() override; @@ -67,8 +69,25 @@ struct TriggersMKI: Module { void TriggersMKI::step() { - volts = clamp(params[VOLTAGE_PARAM].value, 0.0f, 10.0f); + display_volts = 0.0f; + volts = params[VOLTAGE_PARAM].value; + display_volts = volts; + negative_volts = false; + if(volts< 0.0){ + negative_volts = true; + } + if(negative_volts){ + display_volts = - display_volts; + //doesn't update fast enough to get rid of the negative 0 display color + /* + if(display_volts == -0.0){ + display_volts = 0.0; + } + */ + }else{ + display_volts = volts; + } //LATCH TRIGGER //EXTERNAL TRIGGER if (LatchTrigger.process(params[RUN_SWITCH].value)||LatchExtTrigger.process(inputs[CV_RUN_INPUT].value)) { @@ -104,6 +123,7 @@ void TriggersMKI::step() { struct VoltsDisplayWidget : TransparentWidget { float *value; + bool *negative; std::shared_ptr font; VoltsDisplayWidget() { @@ -140,10 +160,16 @@ struct VoltsDisplayWidget : TransparentWidget { nvgFillColor(vg, nvgTransRGBA(textColor, 16)); nvgText(vg, textPos.x, textPos.y, "\\\\\\\\\\", NULL); - textColor = nvgRGB(0xf0, 0x00, 0x00); + if(*negative){ + textColor = nvgRGB(0xf0, 0x00, 0x00); + }else{ + //textColor = nvgRGB(0x90, 0xc6, 0x3e); + textColor = nvgRGB(0x00, 0xaf, 0x25); + } + nvgFillColor(vg, textColor); nvgText(vg, textPos.x, textPos.y, display_string, NULL); - //nvgText(vg, textPos.x, textPos.y, to_display.str().c_str(), NULL); + } }; //////////////////////////////////// @@ -168,11 +194,12 @@ TriggersMKIWidget::TriggersMKIWidget(TriggersMKI *module) : ModuleWidget(module) VoltsDisplayWidget *display1 = new VoltsDisplayWidget(); display1->box.pos = Vec(10,50); display1->box.size = Vec(70, 20); - display1->value = &module->volts; + display1->value = &module->display_volts; + display1->negative = &module->negative_volts; addChild(display1); //PARAMS - addParam(ParamWidget::create(Vec(26, 77), module, TriggersMKI::VOLTAGE_PARAM, 0.0f, 10.0f, 5.0f)); + addParam(ParamWidget::create(Vec(26, 77), module, TriggersMKI::VOLTAGE_PARAM, -10.0f, 10.0f, 0.0f)); //SWITCHES static const float led_offset = 3.3; static const float led_center = 15;