diff --git a/plugins/community/repos/LindenbergResearch/CMakeLists.txt b/plugins/community/repos/LindenbergResearch/CMakeLists.txt index 284e5063..bffc9e98 100644 --- a/plugins/community/repos/LindenbergResearch/CMakeLists.txt +++ b/plugins/community/repos/LindenbergResearch/CMakeLists.txt @@ -41,7 +41,7 @@ set(SOURCE_FILES src/widgets/LRLCDWidget.cpp src/widgets/LRLight.cpp src/widgets/LRPanel.cpp - src/widgets/LRSVGRotator.cpp src/dsp/Saturator.cpp src/dsp/Saturator.hpp src/dsp/Hardclip.cpp src/dsp/Hardclip.hpp src/dsp/RShaper.cpp src/dsp/RShaper.hpp src/dsp/Overdrive.cpp src/dsp/Overdrive.hpp src/QuickMix.cpp) + src/widgets/LRSVGRotator.cpp src/dsp/Saturator.cpp src/dsp/Saturator.hpp src/dsp/Hardclip.cpp src/dsp/Hardclip.hpp src/dsp/RShaper.cpp src/dsp/RShaper.hpp src/dsp/Overdrive.cpp src/dsp/Overdrive.hpp src/QuickMix.cpp src/dsp/FastTanWF.cpp src/dsp/FastTanWF.hpp) include_directories(.) include_directories(src) diff --git a/plugins/community/repos/LindenbergResearch/make.objects b/plugins/community/repos/LindenbergResearch/make.objects index 7e8f8e9b..0601265f 100644 --- a/plugins/community/repos/LindenbergResearch/make.objects +++ b/plugins/community/repos/LindenbergResearch/make.objects @@ -1,5 +1,6 @@ ALL_OBJ= \ src/dsp/DSPMath.o \ + src/dsp/FastTanWF.o \ src/dsp/Hardclip.o \ src/dsp/LadderFilter.o \ src/dsp/LambertW.o \ diff --git a/plugins/community/repos/LindenbergResearch/res/QuickMix.afdesign b/plugins/community/repos/LindenbergResearch/res/QuickMix.afdesign index 872e85c4..5986c82f 100644 Binary files a/plugins/community/repos/LindenbergResearch/res/QuickMix.afdesign and b/plugins/community/repos/LindenbergResearch/res/QuickMix.afdesign differ diff --git a/plugins/community/repos/LindenbergResearch/res/QuickMix.svg b/plugins/community/repos/LindenbergResearch/res/QuickMix.svg index 6975d753..a568a0bb 100644 --- a/plugins/community/repos/LindenbergResearch/res/QuickMix.svg +++ b/plugins/community/repos/LindenbergResearch/res/QuickMix.svg @@ -1,52 +1,71 @@ - - - - + + + + + + - + - + - + - + - + - + - + - + - + - - + @@ -63,18 +82,64 @@ + + - - - - + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + diff --git a/plugins/community/repos/LindenbergResearch/res/Westcoast.afdesign b/plugins/community/repos/LindenbergResearch/res/Westcoast.afdesign index 1f48b460..b5f12ab6 100644 Binary files a/plugins/community/repos/LindenbergResearch/res/Westcoast.afdesign and b/plugins/community/repos/LindenbergResearch/res/Westcoast.afdesign differ diff --git a/plugins/community/repos/LindenbergResearch/res/Westcoast.svg b/plugins/community/repos/LindenbergResearch/res/Westcoast.svg index a0ed7386..396296c7 100644 --- a/plugins/community/repos/LindenbergResearch/res/Westcoast.svg +++ b/plugins/community/repos/LindenbergResearch/res/Westcoast.svg @@ -6,22 +6,22 @@ - + - + - + - + - + - + @@ -152,73 +152,73 @@ - - - - - - - + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - - + + + + + + + + + - - - - - - - - + + + + + + + + @@ -288,30 +288,30 @@ - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -321,7 +321,7 @@ - + @@ -332,7 +332,7 @@ - + diff --git a/plugins/community/repos/LindenbergResearch/res/WestcoastAged.afdesign b/plugins/community/repos/LindenbergResearch/res/WestcoastAged.afdesign index fdec0ca1..66fd240d 100644 Binary files a/plugins/community/repos/LindenbergResearch/res/WestcoastAged.afdesign and b/plugins/community/repos/LindenbergResearch/res/WestcoastAged.afdesign differ diff --git a/plugins/community/repos/LindenbergResearch/res/WestcoastAged.svg b/plugins/community/repos/LindenbergResearch/res/WestcoastAged.svg index 30812233..c02fed33 100644 --- a/plugins/community/repos/LindenbergResearch/res/WestcoastAged.svg +++ b/plugins/community/repos/LindenbergResearch/res/WestcoastAged.svg @@ -7,46 +7,46 @@ - - - - + + + + - + - + - + - + - + - + - + - + - + - + @@ -177,73 +177,73 @@ - - - - - - - + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - - + + + + + + + + + - - - - - - - - + + + + + + + + diff --git a/plugins/community/repos/LindenbergResearch/src/LRComponents.hpp b/plugins/community/repos/LindenbergResearch/src/LRComponents.hpp index 08a8be5c..ad373382 100644 --- a/plugins/community/repos/LindenbergResearch/src/LRComponents.hpp +++ b/plugins/community/repos/LindenbergResearch/src/LRComponents.hpp @@ -50,23 +50,10 @@ namespace lrt { }; - /** - * @brief Standard LRT ModuleWidget definition - */ - struct LRModuleWidget : ModuleWidget { - /** - * @brief - * @param module - */ - LRModuleWidget(Module *module) : ModuleWidget(module) { - } - }; - - - /** - * @brief Emulation of a LCD monochrome display - */ - struct LRLCDWidget : Label { +/** + * @brief Emulation of a LCD monochrome display + */ +struct LRLCDWidget : Label { enum LCDType { NUMERIC, @@ -603,8 +590,8 @@ namespace lrt { static constexpr float MARGIN = 10; /** gradient colors */ - NVGcolor inner = nvgRGBAf(1.5f * .369f, 1.5f * 0.357f, 1.5f * 0.3333f, 0.25f); - NVGcolor outer = nvgRGBAf(0.0f, 0.0f, 0.0f, 0.0f);; + NVGcolor inner = nvgRGBAf(1.4f * .369f, 1.5f * 0.357f, 1.5f * 0.3333f, 0.25f); + NVGcolor outer = nvgRGBAf(0.0f, 0.0f, 0.0f, 0.15f);; /** gradient offset */ Vec offset = Vec(30, -50); @@ -629,7 +616,24 @@ namespace lrt { }; - /** +/** + * @brief Standard LRT ModuleWidget definition + */ +struct LRModuleWidget : ModuleWidget { + + LRPanel *panel; + + + /** + * @brief + * @param module + */ + LRModuleWidget(Module *module) : ModuleWidget(module) { + } +}; + + +/** * @brief Passive rotating SVG image */ struct SVGRotator : FramebufferWidget { diff --git a/plugins/community/repos/LindenbergResearch/src/QuickMix.cpp b/plugins/community/repos/LindenbergResearch/src/QuickMix.cpp index 285d9834..4b76fcf2 100644 --- a/plugins/community/repos/LindenbergResearch/src/QuickMix.cpp +++ b/plugins/community/repos/LindenbergResearch/src/QuickMix.cpp @@ -13,7 +13,7 @@ struct QuickMix : Module { LEVEL3_PARAM, LEVEL4_PARAM, LEVEL5_PARAM, - LEVEL6_PARAM, + SHAPE_PARAM, LEVELM_PARAM, NUM_PARAMS }; @@ -23,7 +23,7 @@ struct QuickMix : Module { M3_INPUT, M4_INPUT, M5_INPUT, - M6_INPUT, + CV_INPUT, NUM_INPUTS }; enum OutputIds { @@ -36,7 +36,6 @@ struct QuickMix : Module { LEVEL3_LIGHT, LEVEL4_LIGHT, LEVEL5_LIGHT, - LEVEL6_LIGHT, LEVELM_LIGHT, NUM_LIGHTS }; @@ -86,47 +85,50 @@ QuickMixWidget::QuickMixWidget(QuickMix *module) : LRModuleWidget(module) { box.size = panel->box.size; // ***** SCREWS ********** - addChild(Widget::create(Vec(4.7f, 1))); - addChild(Widget::create(Vec(4.7f, 366))); - - addChild(Widget::create(Vec(75.f - 19.3f, 1))); - addChild(Widget::create(Vec(75.f - 19.3f, 366))); // ***** SCREWS ********** - - // ***** MAIN KNOBS ****** - addParam(ParamWidget::create(Vec(43, 55.8), module, QuickMix::LEVEL1_PARAM, -1.f, 1.f, 0.f)); - addParam(ParamWidget::create(Vec(43, 100.8), module, QuickMix::LEVEL2_PARAM, -1.f, 1.f, 0.f)); - addParam(ParamWidget::create(Vec(43, 145.8), module, QuickMix::LEVEL3_PARAM, -1.f, 1.f, 0.f)); - addParam(ParamWidget::create(Vec(43, 190.8), module, QuickMix::LEVEL4_PARAM, -1.f, 1.f, 0.f)); - addParam(ParamWidget::create(Vec(43, 235.8), module, QuickMix::LEVEL5_PARAM, -1.f, 1.f, 0.f)); - addParam(ParamWidget::create(Vec(43, 280.8), module, QuickMix::LEVEL6_PARAM, -1.f, 1.f, 0.f)); - - addParam(ParamWidget::create(Vec(8, 326.5), module, QuickMix::LEVELM_PARAM, -3.f, 3.f, 1.f)); - // ***** MAIN KNOBS ****** - - // ***** INPUTS ********** - addInput(Port::create(Vec(7, 55.f), Port::INPUT, module, QuickMix::M1_INPUT)); - addInput(Port::create(Vec(7, 100.f), Port::INPUT, module, QuickMix::M2_INPUT)); - addInput(Port::create(Vec(7, 145.f), Port::INPUT, module, QuickMix::M3_INPUT)); - addInput(Port::create(Vec(7, 190.f), Port::INPUT, module, QuickMix::M4_INPUT)); - addInput(Port::create(Vec(7, 235.f), Port::INPUT, module, QuickMix::M5_INPUT)); - addInput(Port::create(Vec(7, 280.f), Port::INPUT, module, QuickMix::M6_INPUT)); - // ***** INPUTS ********** - - // ***** OUTPUTS ********* - addOutput(Port::create(Vec(40, 326.05), Port::OUTPUT, module, QuickMix::MASTER_OUTPUT)); + addChild(Widget::create(Vec(15, 1))); + addChild(Widget::create(Vec(box.size.x - 30, 1))); + addChild(Widget::create(Vec(15, 366))); + addChild(Widget::create(Vec(box.size.x - 30, 366))); + // ***** SCREWS ********** + + // ***** MAIN KNOBS ****** + addParam(ParamWidget::create(Vec(62.3, 53.8), module, QuickMix::LEVEL1_PARAM, -1.f, 1.f, 0.f)); + addParam(ParamWidget::create(Vec(62.3, 88.8), module, QuickMix::LEVEL2_PARAM, -1.f, 1.f, 0.f)); + addParam(ParamWidget::create(Vec(62.3, 123.8), module, QuickMix::LEVEL3_PARAM, -1.f, 1.f, 0.f)); + addParam(ParamWidget::create(Vec(62.3, 158.8), module, QuickMix::LEVEL4_PARAM, -1.f, 1.f, 0.f)); + addParam(ParamWidget::create(Vec(62.3, 193.8), module, QuickMix::LEVEL5_PARAM, -1.f, 1.f, 0.f)); + + addParam(ParamWidget::create(Vec(62.3, 242.0), module, QuickMix::SHAPE_PARAM, -1.f, 1.f, 0.f)); + + addParam(ParamWidget::create(Vec(18.8, 305.8), module, QuickMix::LEVELM_PARAM, -3.f, 3.f, 1.f)); + // ***** MAIN KNOBS ****** + + // ***** INPUTS ********** + addInput(Port::create(Vec(16.5, 52.6), Port::INPUT, module, QuickMix::M1_INPUT)); + addInput(Port::create(Vec(16.5, 87.6), Port::INPUT, module, QuickMix::M2_INPUT)); + addInput(Port::create(Vec(16.5, 122.6), Port::INPUT, module, QuickMix::M3_INPUT)); + addInput(Port::create(Vec(16.5, 157.6), Port::INPUT, module, QuickMix::M4_INPUT)); + addInput(Port::create(Vec(16.5, 192.6), Port::INPUT, module, QuickMix::M5_INPUT)); + + addInput(Port::create(Vec(16.5, 240.8f), Port::INPUT, module, QuickMix::CV_INPUT)); + // ***** INPUTS ********** + + // ***** OUTPUTS ********* + addOutput(Port::create(Vec(60.9, 304.8), Port::OUTPUT, module, QuickMix::MASTER_OUTPUT)); // ***** OUTPUTS ********* - // ***** LIGHTS ********** - addChild(ModuleLightWidget::create(Vec(33, 81.6), module, QuickMix::LEVEL1_LIGHT)); - addChild(ModuleLightWidget::create(Vec(33, 125.6), module, QuickMix::LEVEL2_LIGHT)); - addChild(ModuleLightWidget::create(Vec(33, 169.6), module, QuickMix::LEVEL3_LIGHT)); - addChild(ModuleLightWidget::create(Vec(33, 214.6), module, QuickMix::LEVEL4_LIGHT)); - addChild(ModuleLightWidget::create(Vec(33, 259.6), module, QuickMix::LEVEL5_LIGHT)); - addChild(ModuleLightWidget::create(Vec(33, 304.6), module, QuickMix::LEVEL6_LIGHT)); + // ***** LIGHTS ********** + addChild(ModuleLightWidget::create(Vec(47.5, 61.3), module, QuickMix::LEVEL1_LIGHT)); + addChild(ModuleLightWidget::create(Vec(47.5, 96.3), module, QuickMix::LEVEL2_LIGHT)); + addChild(ModuleLightWidget::create(Vec(47.5, 131.3), module, QuickMix::LEVEL3_LIGHT)); + addChild(ModuleLightWidget::create(Vec(47.5, 166.3), module, QuickMix::LEVEL4_LIGHT)); + addChild(ModuleLightWidget::create(Vec(47.5, 201.3), module, QuickMix::LEVEL5_LIGHT)); + + + // addChild(ModuleLightWidget::create(Vec(47.5, 304.6), module, QuickMix::LEVEL6_LIGHT)); - addChild(ModuleLightWidget::create(Vec(33, 344.6), module, QuickMix::LEVELM_LIGHT)); - // ***** LIGHTS ********** + // ***** LIGHTS ********** } } // namespace rack_plugin_LindenbergResearch diff --git a/plugins/community/repos/LindenbergResearch/src/VCO.cpp b/plugins/community/repos/LindenbergResearch/src/VCO.cpp index f5199f5b..d4fa6777 100644 --- a/plugins/community/repos/LindenbergResearch/src/VCO.cpp +++ b/plugins/community/repos/LindenbergResearch/src/VCO.cpp @@ -182,6 +182,6 @@ VCOWidget::VCOWidget(VCO *module) : LRModuleWidget(module) { using namespace rack_plugin_LindenbergResearch; RACK_PLUGIN_MODEL_INIT(LindenbergResearch, VCO) { - Model *modelVCO = Model::create("Lindenberg Research", "VCO", "Voltage Controlled Oscillator", OSCILLATOR_TAG); +Model *modelVCO = Model::create("Lindenberg Research", "VCO", "Woldemar VCO", OSCILLATOR_TAG); return modelVCO; } diff --git a/plugins/community/repos/LindenbergResearch/src/Westcoast.cpp b/plugins/community/repos/LindenbergResearch/src/Westcoast.cpp index ffc9f138..bf69cd83 100644 --- a/plugins/community/repos/LindenbergResearch/src/Westcoast.cpp +++ b/plugins/community/repos/LindenbergResearch/src/Westcoast.cpp @@ -1,3 +1,4 @@ +#include "dsp/FastTanWF.hpp" #include "dsp/Overdrive.hpp" #include "dsp/Hardclip.hpp" #include "dsp/RShaper.hpp" @@ -55,6 +56,7 @@ struct Westcoast : LRModule { hardclip = new dsp::Hardclip(engineGetSampleRate()); reshaper = new dsp::ReShaper(engineGetSampleRate()); overdrive = new dsp::Overdrive(engineGetSampleRate()); + fastTan = new dsp::FastTan(engineGetSampleRate()); } dsp::LockhartWavefolder *hs; @@ -63,6 +65,7 @@ struct Westcoast : LRModule { dsp::Hardclip *hardclip; dsp::ReShaper *reshaper; dsp::Overdrive *overdrive; + dsp::FastTan *fastTan; LRAlternateBigKnob *gainBtn = NULL; LRAlternateMiddleKnob *biasBtn = NULL; @@ -172,6 +175,14 @@ void Westcoast::step() { overdrive->process(); out = (float) overdrive->getOut(); break; + case VALERIE: // Overdrive + fastTan->setGain(gain); + fastTan->setBias(bias); + fastTan->setIn(inputs[SHAPER_INPUT].value); + fastTan->process(); + out = (float) fastTan->getOut(); + break; + default: // invalid state, should not happen out = 0; break; @@ -200,6 +211,10 @@ struct WestcoastWidget : LRModuleWidget { WestcoastWidget::WestcoastWidget(Westcoast *module) : LRModuleWidget(module) { panel = new LRPanel(-10, -100); panel->setBackground(SVG::load(assetPlugin(plugin, "res/Westcoast.svg"))); + + panel->setInner(nvgRGBAf(1.5f * .369f, 1.5f * 0.357f, 1.5f * 0.3333f, 0.45f)); + panel->setOuter(nvgRGBAf(0.f, 0.f, 0.f, 0.25f)); + addChild(panel); module->patina = new LRPanel(); diff --git a/plugins/community/repos/LindenbergResearch/src/dsp/DSPMath.cpp b/plugins/community/repos/LindenbergResearch/src/dsp/DSPMath.cpp index 21be09f2..f3f41e16 100644 --- a/plugins/community/repos/LindenbergResearch/src/dsp/DSPMath.cpp +++ b/plugins/community/repos/LindenbergResearch/src/dsp/DSPMath.cpp @@ -150,6 +150,7 @@ float shape2(float a, float x) { return atanf(x * a);//x * (fabs(x) + a) / (x * x + (a - 1) * fabs(x) + 1); } + /** * @brief Soft saturating with a clip of a. Works only with positive values so use 'b' as helper here. * @param x Input sample diff --git a/plugins/community/repos/LindenbergResearch/src/dsp/FastTanWF.cpp b/plugins/community/repos/LindenbergResearch/src/dsp/FastTanWF.cpp new file mode 100644 index 00000000..f8838c52 --- /dev/null +++ b/plugins/community/repos/LindenbergResearch/src/dsp/FastTanWF.cpp @@ -0,0 +1,42 @@ +#include "FastTanWF.hpp" + +using namespace dsp; + + +FastTan::FastTan(float sr) : WaveShaper(sr) { + init(); + noise = new Noise; +} + + +void FastTan::init() { + WaveShaper::rs = new Resampler<1>(8, 16); +} + + +void FastTan::process() { + WaveShaper::process(); +} + + +void FastTan::invalidate() {} + + +double FastTan::compute(double x) { + double out; + double in = clampd(x, -SHAPER_MAX_VOLTS, SHAPER_MAX_VOLTS); + + in *= clampd(gain, 0., 20.); // add gain + in += clampd(bias * 2, -SHAPER_MAX_BIAS, SHAPER_MAX_BIAS); // add bias + + in *= FASTTAN_GAIN; + + in = fastatan(in * 10) / 10; + + in *= 1 / FASTTAN_GAIN * (1 + gain / 15); + if (blockDC) in = dc->filter(in); + + out = in; + + return out; +} diff --git a/plugins/community/repos/LindenbergResearch/src/dsp/FastTanWF.hpp b/plugins/community/repos/LindenbergResearch/src/dsp/FastTanWF.hpp new file mode 100644 index 00000000..8651462c --- /dev/null +++ b/plugins/community/repos/LindenbergResearch/src/dsp/FastTanWF.hpp @@ -0,0 +1,24 @@ +#pragma once + +#include "WaveShaper.hpp" + +#define FASTTAN_GAIN 0.05 + +namespace dsp { + +struct FastTan : WaveShaper { + + Noise *noise; + +public: + + explicit FastTan(float sr); + + void init() override; + void invalidate() override; + void process() override; + double compute(double x) override; + +}; + +} \ No newline at end of file diff --git a/vst2_bin/plugins/LindenbergResearch/res/QuickMix.svg b/vst2_bin/plugins/LindenbergResearch/res/QuickMix.svg index 6975d753..a568a0bb 100644 --- a/vst2_bin/plugins/LindenbergResearch/res/QuickMix.svg +++ b/vst2_bin/plugins/LindenbergResearch/res/QuickMix.svg @@ -1,52 +1,71 @@ - - - - + + + + + + - + - + - + - + - + - + - + - + - + - - + @@ -63,18 +82,64 @@ + + - - - - + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + diff --git a/vst2_bin/plugins/LindenbergResearch/res/Westcoast.svg b/vst2_bin/plugins/LindenbergResearch/res/Westcoast.svg index a0ed7386..396296c7 100644 --- a/vst2_bin/plugins/LindenbergResearch/res/Westcoast.svg +++ b/vst2_bin/plugins/LindenbergResearch/res/Westcoast.svg @@ -6,22 +6,22 @@ - + - + - + - + - + - + @@ -152,73 +152,73 @@ - - - - - - - + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - - + + + + + + + + + - - - - - - - - + + + + + + + + @@ -288,30 +288,30 @@ - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -321,7 +321,7 @@ - + @@ -332,7 +332,7 @@ - + diff --git a/vst2_bin/plugins/LindenbergResearch/res/WestcoastAged.svg b/vst2_bin/plugins/LindenbergResearch/res/WestcoastAged.svg index 30812233..c02fed33 100644 --- a/vst2_bin/plugins/LindenbergResearch/res/WestcoastAged.svg +++ b/vst2_bin/plugins/LindenbergResearch/res/WestcoastAged.svg @@ -7,46 +7,46 @@ - - - - + + + + - + - + - + - + - + - + - + - + - + - + @@ -177,73 +177,73 @@ - - - - - - - + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - - + + + + + + + + + - - - - - - - - + + + + + + + +