diff --git a/plugins/community/repos/Bogaudio/.gitattributes b/plugins/community/repos/Bogaudio/.gitattributes new file mode 100644 index 00000000..b1dd2b43 --- /dev/null +++ b/plugins/community/repos/Bogaudio/.gitattributes @@ -0,0 +1 @@ +res/* -diff diff --git a/plugins/community/repos/Bogaudio/.gitignore b/plugins/community/repos/Bogaudio/.gitignore new file mode 100644 index 00000000..e4f0853d --- /dev/null +++ b/plugins/community/repos/Bogaudio/.gitignore @@ -0,0 +1,39 @@ +# Prerequisites +*.d + +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll + +# Fortran module files +*.mod +*.smod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app + +dist/ +benchmark +testmain +*.gp +releasenote.md +plot.* diff --git a/plugins/community/repos/Bogaudio/make.objects b/plugins/community/repos/Bogaudio/make.objects index d6cfddf7..851f8686 100644 --- a/plugins/community/repos/Bogaudio/make.objects +++ b/plugins/community/repos/Bogaudio/make.objects @@ -7,8 +7,10 @@ ALL_OBJ= \ src/dsp/oscillator.o \ src/dsp/signal.o \ src/dsp/table.o \ + src/AD.o \ src/ADSR.o \ src/Additator.o \ + src/AMRM.o \ src/Analyzer.o \ src/Bool.o \ src/CVD.o \ @@ -23,13 +25,13 @@ ALL_OBJ= \ src/LFO.o \ src/Lag.o \ src/Manual.o \ + src/Matrix88.o \ src/Mix4.o \ src/Mix8.o \ src/Mult.o \ src/Noise.o \ src/Offset.o \ src/Pan.o \ - src/RM.o \ src/Reftone.o \ src/SampleHold.o \ src/Shaper.o \ @@ -39,6 +41,7 @@ ALL_OBJ= \ src/Switch.o \ src/Test.o \ src/Test2.o \ + src/UMix.o \ src/VCA.o \ src/VCAmp.o \ src/VCM.o \ diff --git a/plugins/community/repos/Bogaudio/res-src/AD-src.svg b/plugins/community/repos/Bogaudio/res-src/AD-src.svg new file mode 100644 index 00000000..d17cd2e9 --- /dev/null +++ b/plugins/community/repos/Bogaudio/res-src/AD-src.svg @@ -0,0 +1,180 @@ + + + + + + + + + + + + + + + + + 0 + + + + + + + + 1 + + + + + + + + + + + + + + 5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AD + + BGA + + + + + + ATTACK + + + + + + + DECAY + + + + + + + + + + LOOP + + + + + + + + LIN + + + + + + + + + TRIG + + ATTACK + + DECAY + + + + + + ENV + + EOC + + + diff --git a/plugins/community/repos/Bogaudio/res-src/AMRM-src.svg b/plugins/community/repos/Bogaudio/res-src/AMRM-src.svg new file mode 100644 index 00000000..216fc7df --- /dev/null +++ b/plugins/community/repos/Bogaudio/res-src/AMRM-src.svg @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + + + + + D + + + + + + + + + + W + + + + + + + + + + + + + + + + + + + + + + + + AM/RM + + BOGAUDIO + + + + + + + + + RECTIFY + + + + + + DRY/WET + + + + + + + + + + MOD + + CAR + + RECT + + D/W + + + + + + RECT + + OUT + + + + + diff --git a/plugins/community/repos/Bogaudio/res-src/Cmp-src.svg b/plugins/community/repos/Bogaudio/res-src/Cmp-src.svg new file mode 100644 index 00000000..7043f7c8 --- /dev/null +++ b/plugins/community/repos/Bogaudio/res-src/Cmp-src.svg @@ -0,0 +1,215 @@ + + + + + + + + + + + + + + + + + + + + + + + -10 + + + + + + + + + + + + + + 0 + + + + + + + + + + + + + + 10 + + + + + + 0 + + + + + + + + + + + + + + 10 + + + + + + 0 + + 0.1 + + + + + + + + + 1 + + + + + + + 0-10V + + +/-5V + + + + + + + + + + + + + + + + + + + + + + + + + CMP + + BOGAUDIO + + + + + + + + + A + + + + + + IN + + + + + B + + + + + + IN + + + + + WINDOW + + + + + + CV + + + + + LAG + + + + + + CV + + + + + + OUTPUT + + + + + + + + > + + < + + EQ + + NOT + + diff --git a/plugins/community/repos/Bogaudio/res-src/Matrix88-src.svg b/plugins/community/repos/Bogaudio/res-src/Matrix88-src.svg new file mode 100644 index 00000000..6e428065 --- /dev/null +++ b/plugins/community/repos/Bogaudio/res-src/Matrix88-src.svg @@ -0,0 +1,427 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MATRIX88 + + BOGAUDIO + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LEVEL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/community/repos/Bogaudio/res-src/RM-src.svg b/plugins/community/repos/Bogaudio/res-src/RM-src.svg deleted file mode 100644 index ffba36fc..00000000 --- a/plugins/community/repos/Bogaudio/res-src/RM-src.svg +++ /dev/null @@ -1,134 +0,0 @@ - - - - - - - - - - - - - - - 0 - - - - - - - - - - - - - - - - D - - - - - - - - - - W - - - - - - - - - - - - - - - - - - - - - - - - - RM - - BGA - - - - - - DEPTH - - - - - - CV - - - - - DRY/WET - - - - - - CV - - - - - - - - - MOD - - CAR - - - - - - OUT - - - - - diff --git a/plugins/community/repos/Bogaudio/res-src/UMix-src.svg b/plugins/community/repos/Bogaudio/res-src/UMix-src.svg new file mode 100644 index 00000000..99f6013b --- /dev/null +++ b/plugins/community/repos/Bogaudio/res-src/UMix-src.svg @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + UMIX + + BGA + + + + + + + + + + + + + + + + + + + + + + OUT + + + + + SUM + + AVG + + + + LEVEL + + + + diff --git a/plugins/community/repos/Bogaudio/res-src/knob_19px-src.svg b/plugins/community/repos/Bogaudio/res-src/knob_19px-src.svg new file mode 100644 index 00000000..8e60cef2 --- /dev/null +++ b/plugins/community/repos/Bogaudio/res-src/knob_19px-src.svg @@ -0,0 +1,15 @@ + + + + + + + + diff --git a/plugins/community/repos/Bogaudio/res-src/knob_45px-src.svg b/plugins/community/repos/Bogaudio/res-src/knob_45px-src.svg new file mode 100644 index 00000000..59448c2e --- /dev/null +++ b/plugins/community/repos/Bogaudio/res-src/knob_45px-src.svg @@ -0,0 +1,14 @@ + + + + + + + diff --git a/plugins/community/repos/Bogaudio/res/AD.svg b/plugins/community/repos/Bogaudio/res/AD.svg new file mode 100644 index 00000000..1842b677 --- /dev/null +++ b/plugins/community/repos/Bogaudio/res/AD.svg @@ -0,0 +1,860 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + 1 + + + + + + + + + + + + + + 5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/community/repos/Bogaudio/res/AMRM.svg b/plugins/community/repos/Bogaudio/res/AMRM.svg new file mode 100644 index 00000000..95af414f --- /dev/null +++ b/plugins/community/repos/Bogaudio/res/AMRM.svg @@ -0,0 +1,718 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + + + + D + + + + + + + + + + W + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/community/repos/Bogaudio/res/Cmp.svg b/plugins/community/repos/Bogaudio/res/Cmp.svg new file mode 100644 index 00000000..af1f06ff --- /dev/null +++ b/plugins/community/repos/Bogaudio/res/Cmp.svg @@ -0,0 +1,1295 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + -10 + + + + + + + + + + 0 + + + + + + + + + + 10 + + + + + 0 + + + + + + + + + + 10 + + + + + 0 + + 0.1 + + + + + + + + + 1 + + + + + + 0-10V + + +/-5V + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/community/repos/Bogaudio/res/Matrix88.svg b/plugins/community/repos/Bogaudio/res/Matrix88.svg new file mode 100644 index 00000000..6c828f8f --- /dev/null +++ b/plugins/community/repos/Bogaudio/res/Matrix88.svg @@ -0,0 +1,2847 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/community/repos/Bogaudio/res/RM.svg b/plugins/community/repos/Bogaudio/res/RM.svg deleted file mode 100644 index 22cf869b..00000000 --- a/plugins/community/repos/Bogaudio/res/RM.svg +++ /dev/null @@ -1,663 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - 0 - - - - - - - - - - - - - - - D - - - - - - - - - - W - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plugins/community/repos/Bogaudio/res/UMix.svg b/plugins/community/repos/Bogaudio/res/UMix.svg new file mode 100644 index 00000000..9c5235b6 --- /dev/null +++ b/plugins/community/repos/Bogaudio/res/UMix.svg @@ -0,0 +1,413 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/community/repos/Bogaudio/res/knob_19px.svg b/plugins/community/repos/Bogaudio/res/knob_19px.svg new file mode 100644 index 00000000..5998c6ce --- /dev/null +++ b/plugins/community/repos/Bogaudio/res/knob_19px.svg @@ -0,0 +1,66 @@ + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/plugins/community/repos/Bogaudio/res/knob_45px.svg b/plugins/community/repos/Bogaudio/res/knob_45px.svg new file mode 100644 index 00000000..b790e31c --- /dev/null +++ b/plugins/community/repos/Bogaudio/res/knob_45px.svg @@ -0,0 +1,62 @@ + + + + + + image/svg+xml + + + + + + + + + + diff --git a/plugins/community/repos/Bogaudio/scripts/svg_widgets.rb b/plugins/community/repos/Bogaudio/scripts/svg_widgets.rb index ca8f864a..8291a9f8 100644 --- a/plugins/community/repos/Bogaudio/scripts/svg_widgets.rb +++ b/plugins/community/repos/Bogaudio/scripts/svg_widgets.rb @@ -62,7 +62,7 @@ struct %MODULE%Widget : ModuleWidget { } }; -Model* model%MODULE% = createModel<%MODULE%, %MODULE%Widget>("%MANUFACTURER%-%MODULE%", "%MODULE%", ""); +Model* model%MODULE% = createModel<%MODULE%, %MODULE%Widget>("%MANUFACTURER%-%MODULE%", "%MODULE%", ""); CPP_TEMPLATE require 'optparse' diff --git a/plugins/community/repos/Bogaudio/src/AD.cpp b/plugins/community/repos/Bogaudio/src/AD.cpp new file mode 100644 index 00000000..022d0530 --- /dev/null +++ b/plugins/community/repos/Bogaudio/src/AD.cpp @@ -0,0 +1,120 @@ + +#include "AD.hpp" + +void AD::onReset() { + _trigger.reset(); + _eocPulseGen.process(10.0); + _envelope.reset(); + _modulationStep = modulationSteps; + _on = false; +} + +void AD::onSampleRateChange() { + float sr = engineGetSampleRate(); + _envelope.setSampleRate(sr); + _attackSL.setParams(sr / (float)modulationSteps); + _decaySL.setParams(sr / (float)modulationSteps); + _modulationStep = modulationSteps; +} + +void AD::step() { + lights[LOOP_LIGHT].value = _loopMode = params[LOOP_PARAM].value > 0.5f; + lights[LINEAR_LIGHT].value = _linearMode = params[LINEAR_PARAM].value > 0.5f; + if (!(outputs[ENV_OUTPUT].active || outputs[EOC_OUTPUT].active || inputs[TRIGGER_INPUT].active)) { + return; + } + + ++_modulationStep; + if (_modulationStep >= modulationSteps) { + _modulationStep = 0; + + float attack = powf(params[ATTACK_PARAM].value, 2.0f); + if (inputs[ATTACK_INPUT].active) { + attack *= clamp(inputs[ATTACK_INPUT].value / 10.0f, 0.0f, 1.0f); + } + _envelope.setAttack(_attackSL.next(attack * 10.f)); + + float decay = powf(params[DECAY_PARAM].value, 2.0f); + if (inputs[DECAY_INPUT].active) { + decay *= clamp(inputs[DECAY_INPUT].value / 10.0f, 0.0f, 1.0f); + } + _envelope.setDecay(_decaySL.next(decay * 10.f)); + + _envelope.setLinearShape(_linearMode); + } + + _trigger.process(inputs[TRIGGER_INPUT].value); + if (!_on && (_trigger.isHigh() || (_loopMode && _envelope.isStage(ADSR::STOPPED_STAGE)))) { + _on = true; + } + _envelope.setGate(_on); + outputs[ENV_OUTPUT].value = _envelope.next() * 10.0f; + if (_on && _envelope.isStage(ADSR::SUSTAIN_STAGE)) { + _envelope.reset(); + _on = false; + _eocPulseGen.trigger(0.001f); + } + outputs[EOC_OUTPUT].value = _eocPulseGen.process(engineGetSampleTime()) ? 5.0f : 0.0f; + + lights[ATTACK_LIGHT].value = _envelope.isStage(ADSR::ATTACK_STAGE); + lights[DECAY_LIGHT].value = _envelope.isStage(ADSR::DECAY_STAGE); +} + +struct ADWidget : ModuleWidget { + static constexpr int hp = 3; + + ADWidget(AD* module) : ModuleWidget(module) { + box.size = Vec(RACK_GRID_WIDTH * hp, RACK_GRID_HEIGHT); + + { + SVGPanel *panel = new SVGPanel(); + panel->box.size = box.size; + panel->setBackground(SVG::load(assetPlugin(plugin, "res/AD.svg"))); + addChild(panel); + } + + addChild(Widget::create(Vec(0, 0))); + addChild(Widget::create(Vec(box.size.x - 15, 365))); + + // generated by svg_widgets.rb + auto attackParamPosition = Vec(8.0, 33.0); + auto decayParamPosition = Vec(8.0, 90.0); + auto loopParamPosition = Vec(33.5, 131.2); + auto linearParamPosition = Vec(33.5, 145.7); + + auto triggerInputPosition = Vec(10.5, 163.5); + auto attackInputPosition = Vec(10.5, 198.5); + auto decayInputPosition = Vec(10.5, 233.5); + + auto envOutputPosition = Vec(10.5, 271.5); + auto eocOutputPosition = Vec(10.5, 306.5); + + auto attackLightPosition = Vec(20.8, 65.0); + auto decayLightPosition = Vec(20.8, 122.0); + auto loopLightPosition = Vec(2.5, 132.5); + auto linearLightPosition = Vec(2.5, 147.0); + // end generated by svg_widgets.rb + + addParam(ParamWidget::create(attackParamPosition, module, AD::ATTACK_PARAM, 0.0, 1.0, 0.12)); + addParam(ParamWidget::create(decayParamPosition, module, AD::DECAY_PARAM, 0.0, 1.0, 0.31623)); + addParam(ParamWidget::create(loopParamPosition, module, AD::LOOP_PARAM, 0.0, 1.0, 0.0)); + addParam(ParamWidget::create(linearParamPosition, module, AD::LINEAR_PARAM, 0.0, 1.0, 0.0)); + + addInput(Port::create(triggerInputPosition, Port::INPUT, module, AD::TRIGGER_INPUT)); + addInput(Port::create(attackInputPosition, Port::INPUT, module, AD::ATTACK_INPUT)); + addInput(Port::create(decayInputPosition, Port::INPUT, module, AD::DECAY_INPUT)); + + addOutput(Port::create(envOutputPosition, Port::OUTPUT, module, AD::ENV_OUTPUT)); + addOutput(Port::create(eocOutputPosition, Port::OUTPUT, module, AD::EOC_OUTPUT)); + + addChild(ModuleLightWidget::create>(attackLightPosition, module, AD::ATTACK_LIGHT)); + addChild(ModuleLightWidget::create>(decayLightPosition, module, AD::DECAY_LIGHT)); + addChild(ModuleLightWidget::create>(loopLightPosition, module, AD::LOOP_LIGHT)); + addChild(ModuleLightWidget::create>(linearLightPosition, module, AD::LINEAR_LIGHT)); + } +}; + +RACK_PLUGIN_MODEL_INIT(Bogaudio, AD) { + Model* modelAD = createModel("Bogaudio-AD", "AD", "utility envelope", ENVELOPE_GENERATOR_TAG); + return modelAD; +} diff --git a/plugins/community/repos/Bogaudio/src/AD.hpp b/plugins/community/repos/Bogaudio/src/AD.hpp new file mode 100644 index 00000000..ec149d47 --- /dev/null +++ b/plugins/community/repos/Bogaudio/src/AD.hpp @@ -0,0 +1,66 @@ +#pragma once + +#include "bogaudio.hpp" +#include "dsp/envelope.hpp" +#include "dsp/signal.hpp" + +using namespace bogaudio::dsp; + +extern Model* modelAD; + +namespace bogaudio { + +struct AD : Module { + enum ParamsIds { + ATTACK_PARAM, + DECAY_PARAM, + LOOP_PARAM, + LINEAR_PARAM, + NUM_PARAMS + }; + + enum InputsIds { + TRIGGER_INPUT, + ATTACK_INPUT, + DECAY_INPUT, + NUM_INPUTS + }; + + enum OutputsIds { + ENV_OUTPUT, + EOC_OUTPUT, + NUM_OUTPUTS + }; + + enum LightsIds { + ATTACK_LIGHT, + DECAY_LIGHT, + LOOP_LIGHT, + LINEAR_LIGHT, + NUM_LIGHTS + }; + + const int modulationSteps = 100; + int _modulationStep = 0; + bool _loopMode = false; + bool _linearMode = false; + SchmittTrigger _trigger; + PulseGenerator _eocPulseGen; + bool _on = false; + ADSR _envelope; + SlewLimiter _attackSL; + SlewLimiter _decaySL; + + AD() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS) { + onReset(); + onSampleRateChange(); + _envelope.setSustain(0.0f); + _envelope.setRelease(0.0f); + } + + void onReset() override; + void onSampleRateChange() override; + void step() override; +}; + +} // namespace bogaudio diff --git a/plugins/community/repos/Bogaudio/src/AMRM.cpp b/plugins/community/repos/Bogaudio/src/AMRM.cpp new file mode 100644 index 00000000..75fb942d --- /dev/null +++ b/plugins/community/repos/Bogaudio/src/AMRM.cpp @@ -0,0 +1,78 @@ + +#include "AMRM.hpp" + +void AMRM::step() { + if (!(outputs[OUT_OUTPUT].active || outputs[RECTIFY_OUTPUT].active)) { + return; + } + + float rectify = 1.0f - params[RECTIFY_PARAM].value; + if (inputs[RECTIFY_INPUT].active) { + rectify = clamp(rectify + inputs[RECTIFY_INPUT].value / 10.0f, 0.0f, 1.0f); + } + + float depth = params[DRYWET_PARAM].value; + if (inputs[DRYWET_INPUT].active) { + depth = clamp(depth + inputs[DRYWET_INPUT].value / 10.0f, 0.0f, 1.0f); + } + + float modulator = inputs[MODULATOR_INPUT].value; + if (rectify < 1.0f) { + rectify *= -5.0f; + if (modulator < rectify) { + modulator = rectify - (modulator - rectify); + } + } + outputs[RECTIFY_OUTPUT].value = modulator; + + modulator *= depth; + modulator += (1.0f - depth) * 5.0f; + outputs[OUT_OUTPUT].value = _saturator.next(modulator * inputs[CARRIER_INPUT].value * 0.2f); +} + +struct AMRMWidget : ModuleWidget { + static constexpr int hp = 6; + + AMRMWidget(AMRM* module) : ModuleWidget(module) { + box.size = Vec(RACK_GRID_WIDTH * hp, RACK_GRID_HEIGHT); + + { + SVGPanel *panel = new SVGPanel(); + panel->box.size = box.size; + panel->setBackground(SVG::load(assetPlugin(plugin, "res/AMRM.svg"))); + addChild(panel); + } + + addChild(Widget::create(Vec(0, 0))); + addChild(Widget::create(Vec(box.size.x - 15, 365))); + + // generated by svg_widgets.rb + auto rectifyParamPosition = Vec(22.5, 66.5); + auto drywetParamPosition = Vec(22.5, 165.5); + + auto modulatorInputPosition = Vec(16.0, 244.0); + auto carrierInputPosition = Vec(50.0, 244.0); + auto rectifyInputPosition = Vec(16.0, 280.0); + auto drywetInputPosition = Vec(50.0, 280.0); + + auto rectifyOutputPosition = Vec(16.0, 320.0); + auto outOutputPosition = Vec(50.0, 320.0); + // end generated by svg_widgets.rb + + addParam(ParamWidget::create(rectifyParamPosition, module, AMRM::RECTIFY_PARAM, 0.0, 1.0, 0.0)); + addParam(ParamWidget::create(drywetParamPosition, module, AMRM::DRYWET_PARAM, 0.0, 1.0, 1.0)); + + addInput(Port::create(modulatorInputPosition, Port::INPUT, module, AMRM::MODULATOR_INPUT)); + addInput(Port::create(carrierInputPosition, Port::INPUT, module, AMRM::CARRIER_INPUT)); + addInput(Port::create(rectifyInputPosition, Port::INPUT, module, AMRM::RECTIFY_INPUT)); + addInput(Port::create(drywetInputPosition, Port::INPUT, module, AMRM::DRYWET_INPUT)); + + addOutput(Port::create(rectifyOutputPosition, Port::OUTPUT, module, AMRM::RECTIFY_OUTPUT)); + addOutput(Port::create(outOutputPosition, Port::OUTPUT, module, AMRM::OUT_OUTPUT)); + } +}; + +RACK_PLUGIN_MODEL_INIT(Bogaudio, AMRM) { + Model* modelAMRM = createModel("Bogaudio-AMRM", "AM/RM", "ring modulator", RING_MODULATOR_TAG, EFFECT_TAG); + return modelAMRM; +} diff --git a/plugins/community/repos/Bogaudio/src/AMRM.hpp b/plugins/community/repos/Bogaudio/src/AMRM.hpp new file mode 100644 index 00000000..373c3010 --- /dev/null +++ b/plugins/community/repos/Bogaudio/src/AMRM.hpp @@ -0,0 +1,45 @@ +#pragma once + +#include "bogaudio.hpp" +#include "dsp/signal.hpp" + +using namespace bogaudio::dsp; + +extern Model* modelAMRM; + +namespace bogaudio { + +struct AMRM : Module { + enum ParamsIds { + RECTIFY_PARAM, + DRYWET_PARAM, + NUM_PARAMS + }; + + enum InputsIds { + MODULATOR_INPUT, + CARRIER_INPUT, + RECTIFY_INPUT, + DRYWET_INPUT, + NUM_INPUTS + }; + + enum OutputsIds { + OUT_OUTPUT, + RECTIFY_OUTPUT, + NUM_OUTPUTS + }; + + enum LightsIds { + NUM_LIGHTS + }; + + Saturator _saturator; + + AMRM() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS) { + } + + void step() override; +}; + +} // namespace bogaudio diff --git a/plugins/community/repos/Bogaudio/src/Additator.cpp b/plugins/community/repos/Bogaudio/src/Additator.cpp index 0a9b3a16..6fdf8707 100644 --- a/plugins/community/repos/Bogaudio/src/Additator.cpp +++ b/plugins/community/repos/Bogaudio/src/Additator.cpp @@ -95,7 +95,7 @@ void Additator::step() { _filter = filter; #ifdef _MSC_VER - float *as = new float[maxPartials + 1]; + float *as = (float*)_alloca(sizeof(float) * (maxPartials + 1)); #else float as[maxPartials + 1]; #endif @@ -126,9 +126,6 @@ void Additator::step() { as[i] /= norm; _oscillator.setPartialAmplitude(i, as[i], i <= envelopes); } -#ifdef _MSC_VER - delete [] as; -#endif } float frequency = params[FREQUENCY_PARAM].value; diff --git a/plugins/community/repos/Bogaudio/src/Cmp.cpp b/plugins/community/repos/Bogaudio/src/Cmp.cpp new file mode 100644 index 00000000..8e797b00 --- /dev/null +++ b/plugins/community/repos/Bogaudio/src/Cmp.cpp @@ -0,0 +1,216 @@ + +#include "Cmp.hpp" + +void Cmp::onReset() { + _thresholdState = LOW; + _windowState = LOW; +} + +void Cmp::step() { + if (!( + outputs[GREATER_OUTPUT].active || + outputs[LESS_OUTPUT].active || + outputs[EQUAL_OUTPUT].active || + outputs[NOT_EQUAL_OUTPUT].active + )) { + return; + } + + float a = params[A_PARAM].value * 10.0f; + if (inputs[A_INPUT].active) { + a = clamp(a + inputs[A_INPUT].value, -12.0f, 12.0f); + } + + float b = params[B_PARAM].value * 10.0f; + if (inputs[B_INPUT].active) { + b = clamp(b + inputs[B_INPUT].value, -12.0f, 12.0f); + } + + float window = params[WINDOW_PARAM].value; + if (inputs[WINDOW_INPUT].active) { + window *= clamp(inputs[WINDOW_INPUT].value / 10.0f, 0.0f, 1.0f); + } + window *= 10.0f; + + float high = 10.0f; + float low = 0.0f; + if (params[OUTPUT_PARAM].value > 0.5f) { + high = 5.0f; + low = -5.0f; + } + + int lag = -1; + stepChannel( + a >= b, + high, + low, + _thresholdState, + _thresholdLag, + lag, + outputs[GREATER_OUTPUT], + outputs[LESS_OUTPUT] + ); + stepChannel( + abs(a - b) <= window, + high, + low, + _windowState, + _windowLag, + lag, + outputs[EQUAL_OUTPUT], + outputs[NOT_EQUAL_OUTPUT] + ); +} + +void Cmp::stepChannel( + bool high, + float highValue, + float lowValue, + State& state, + int& channelLag, + int& lag, + Output& highOutput, + Output& lowOutput +) { + switch (state) { + case LOW: { + if (high) { + if (lag < 0) { + lag = lagInSamples(); + } + if (lag < 1) { + state = HIGH; + } + else { + state = LAG_HIGH; + channelLag = lag; + } + } + break; + } + case HIGH: { + if (!high) { + if (lag < 0) { + lag = lagInSamples(); + } + if (lag < 1) { + state = LOW; + } + else { + state = LAG_LOW; + channelLag = lag; + } + } + break; + } + case LAG_LOW: { + if (!high) { + --channelLag; + if(channelLag == 0) { + state = LOW; + } + } + else { + state = HIGH; + } + break; + } + case LAG_HIGH: { + if (high) { + --channelLag; + if(channelLag == 0) { + state = HIGH; + } + } + else { + state = LOW; + } + break; + } + }; + + switch (state) { + case LOW: + case LAG_HIGH: { + highOutput.value = lowValue; + lowOutput.value = highValue; + break; + } + case HIGH: + case LAG_LOW: { + highOutput.value = highValue; + lowOutput.value = lowValue; + break; + } + } +} + +int Cmp::lagInSamples() { + float lag = params[LAG_PARAM].value; + if (inputs[LAG_INPUT].active) { + lag *= clamp(inputs[LAG_INPUT].value / 10.0f, 0.0f, 1.0f); + } + return lag * lag * engineGetSampleRate(); +} + +struct CmpWidget : ModuleWidget { + static constexpr int hp = 6; + + CmpWidget(Cmp* module) : ModuleWidget(module) { + box.size = Vec(RACK_GRID_WIDTH * hp, RACK_GRID_HEIGHT); + + { + SVGPanel *panel = new SVGPanel(); + panel->box.size = box.size; + panel->setBackground(SVG::load(assetPlugin(plugin, "res/Cmp.svg"))); + addChild(panel); + } + + addChild(Widget::create(Vec(0, 0))); + addChild(Widget::create(Vec(box.size.x - 15, 365))); + + // generated by svg_widgets.rb + auto aParamPosition = Vec(8.0, 46.0); + auto bParamPosition = Vec(53.0, 46.0); + auto windowParamPosition = Vec(8.0, 151.0); + auto lagParamPosition = Vec(53.0, 151.0); + auto outputParamPosition = Vec(25.5, 251.0); + + auto aInputPosition = Vec(10.5, 87.0); + auto bInputPosition = Vec(55.5, 87.0); + auto windowInputPosition = Vec(10.5, 192.0); + auto lagInputPosition = Vec(55.5, 192.0); + + auto greaterOutputPosition = Vec(16.0, 283.0); + auto lessOutputPosition = Vec(50.0, 283.0); + auto equalOutputPosition = Vec(16.0, 319.0); + auto notEqualOutputPosition = Vec(50.0, 319.0); + // end generated by svg_widgets.rb + + addParam(ParamWidget::create(aParamPosition, module, Cmp::A_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(bParamPosition, module, Cmp::B_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(windowParamPosition, module, Cmp::WINDOW_PARAM, 0.0, 1.0, 0.5)); + addParam(ParamWidget::create(lagParamPosition, module, Cmp::LAG_PARAM, 0.0, 1.0, 0.1)); + { + auto w = ParamWidget::create(outputParamPosition, module, Cmp::OUTPUT_PARAM, 0.0, 1.0, 0.0); + auto k = dynamic_cast(w); + k->snap = true; + k->minAngle = 3.0f * (M_PI / 8.0f); + k->maxAngle = 5.0f * (M_PI / 8.0f); + k->speed = 3.0; + addParam(w); + } + + addInput(Port::create(aInputPosition, Port::INPUT, module, Cmp::A_INPUT)); + addInput(Port::create(bInputPosition, Port::INPUT, module, Cmp::B_INPUT)); + addInput(Port::create(windowInputPosition, Port::INPUT, module, Cmp::WINDOW_INPUT)); + addInput(Port::create(lagInputPosition, Port::INPUT, module, Cmp::LAG_INPUT)); + + addOutput(Port::create(greaterOutputPosition, Port::OUTPUT, module, Cmp::GREATER_OUTPUT)); + addOutput(Port::create(lessOutputPosition, Port::OUTPUT, module, Cmp::LESS_OUTPUT)); + addOutput(Port::create(equalOutputPosition, Port::OUTPUT, module, Cmp::EQUAL_OUTPUT)); + addOutput(Port::create(notEqualOutputPosition, Port::OUTPUT, module, Cmp::NOT_EQUAL_OUTPUT)); + } +}; + +Model* modelCmp = createModel("Bogaudio-Cmp", "CMP", "comparator", LOGIC_TAG); diff --git a/plugins/community/repos/Bogaudio/src/Cmp.hpp b/plugins/community/repos/Bogaudio/src/Cmp.hpp new file mode 100644 index 00000000..82d73140 --- /dev/null +++ b/plugins/community/repos/Bogaudio/src/Cmp.hpp @@ -0,0 +1,70 @@ +#pragma once + +#include "bogaudio.hpp" + +extern Model* modelCmp; + +namespace bogaudio { + +struct Cmp : Module { + enum ParamsIds { + A_PARAM, + B_PARAM, + WINDOW_PARAM, + LAG_PARAM, + OUTPUT_PARAM, + NUM_PARAMS + }; + + enum InputsIds { + A_INPUT, + B_INPUT, + WINDOW_INPUT, + LAG_INPUT, + NUM_INPUTS + }; + + enum OutputsIds { + GREATER_OUTPUT, + LESS_OUTPUT, + EQUAL_OUTPUT, + NOT_EQUAL_OUTPUT, + NUM_OUTPUTS + }; + + enum LightsIds { + NUM_LIGHTS + }; + + enum State { + LOW, + HIGH, + LAG_LOW, + LAG_HIGH + }; + + State _thresholdState; + int _thresholdLag = 0; + State _windowState; + int _windowLag = 0; + + Cmp() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS) { + onReset(); + } + + void onReset() override; + void step() override; + void stepChannel( + bool high, + float highValue, + float lowValue, + State& state, + int& channelLag, + int& lag, + Output& highOutput, + Output& lowOutput + ); + int lagInSamples(); +}; + +} // namespace bogaudio diff --git a/plugins/community/repos/Bogaudio/src/Manual.cpp b/plugins/community/repos/Bogaudio/src/Manual.cpp index c73656f4..b6985c74 100644 --- a/plugins/community/repos/Bogaudio/src/Manual.cpp +++ b/plugins/community/repos/Bogaudio/src/Manual.cpp @@ -3,20 +3,20 @@ void Manual::onReset() { _trigger.reset(); - _pulse.process(10.0); + _pulse.process(10.0f); } void Manual::step() { bool high = _trigger.process(params[TRIGGER_PARAM].value) || _trigger.isHigh() || (_firstStep && _triggerOnLoad && _shouldTriggerOnLoad); if (high) { - _pulse.trigger(0.001); + _pulse.trigger(0.001f); _pulse.process(engineGetSampleTime()); } else { high = _pulse.process(engineGetSampleTime()); } - float out = high ? 5.0 : 0.0; + float out = high ? 5.0f : 0.0f; outputs[OUT1_OUTPUT].value = out; outputs[OUT2_OUTPUT].value = out; outputs[OUT3_OUTPUT].value = out; diff --git a/plugins/community/repos/Bogaudio/src/Matrix88.cpp b/plugins/community/repos/Bogaudio/src/Matrix88.cpp new file mode 100644 index 00000000..02c48602 --- /dev/null +++ b/plugins/community/repos/Bogaudio/src/Matrix88.cpp @@ -0,0 +1,213 @@ + +#include "Matrix88.hpp" + +void Matrix88::step() { + for (int i = 0; i < 8; ++i) { + _inputs[i] = inputs[IN1_INPUT + i].active ? inputs[IN1_INPUT + i].value : 5.0f; + } + for (int i = 0; i < 8; ++i) { + if (outputs[OUT1_OUTPUT + i].active) { + int paramOffset = MIX11_PARAM + i * 8; + float out = 0.0f; + for (int j = 0; j < 8; ++j) { + out += _inputs[j] * params[paramOffset + j].value; + } + outputs[OUT1_OUTPUT + i].value = _saturators[i].next(params[LEVEL_PARAM].value * out); + } + } +} + +struct Matrix88Widget : ModuleWidget { + static constexpr int hp = 22; + + Matrix88Widget(Matrix88* module) : ModuleWidget(module) { + box.size = Vec(RACK_GRID_WIDTH * hp, RACK_GRID_HEIGHT); + + { + SVGPanel *panel = new SVGPanel(); + panel->box.size = box.size; + panel->setBackground(SVG::load(assetPlugin(plugin, "res/Matrix88.svg"))); + addChild(panel); + } + + addChild(Widget::create(Vec(15, 0))); + addChild(Widget::create(Vec(box.size.x - 30, 0))); + addChild(Widget::create(Vec(15, 365))); + addChild(Widget::create(Vec(box.size.x - 30, 365))); + + // generated by svg_widgets.rb + auto mix11ParamPosition = Vec(53.7, 32.2); + auto mix21ParamPosition = Vec(53.7, 69.2); + auto mix31ParamPosition = Vec(53.7, 106.2); + auto mix41ParamPosition = Vec(53.7, 143.2); + auto mix51ParamPosition = Vec(53.7, 180.2); + auto mix61ParamPosition = Vec(53.7, 217.2); + auto mix71ParamPosition = Vec(53.7, 254.2); + auto mix81ParamPosition = Vec(53.7, 291.2); + auto mix12ParamPosition = Vec(88.7, 32.2); + auto mix22ParamPosition = Vec(88.7, 69.2); + auto mix32ParamPosition = Vec(88.7, 106.2); + auto mix42ParamPosition = Vec(88.7, 143.2); + auto mix52ParamPosition = Vec(88.7, 180.2); + auto mix62ParamPosition = Vec(88.7, 217.2); + auto mix72ParamPosition = Vec(88.7, 254.2); + auto mix82ParamPosition = Vec(88.7, 291.2); + auto mix13ParamPosition = Vec(123.7, 32.2); + auto mix23ParamPosition = Vec(123.7, 69.2); + auto mix33ParamPosition = Vec(123.7, 106.2); + auto mix43ParamPosition = Vec(123.7, 143.2); + auto mix53ParamPosition = Vec(123.7, 180.2); + auto mix63ParamPosition = Vec(123.7, 217.2); + auto mix73ParamPosition = Vec(123.7, 254.2); + auto mix83ParamPosition = Vec(123.7, 291.2); + auto mix14ParamPosition = Vec(158.7, 32.2); + auto mix24ParamPosition = Vec(158.7, 69.2); + auto mix34ParamPosition = Vec(158.7, 106.2); + auto mix44ParamPosition = Vec(158.7, 143.2); + auto mix54ParamPosition = Vec(158.7, 180.2); + auto mix64ParamPosition = Vec(158.7, 217.2); + auto mix74ParamPosition = Vec(158.7, 254.2); + auto mix84ParamPosition = Vec(158.7, 291.2); + auto mix15ParamPosition = Vec(193.7, 32.2); + auto mix25ParamPosition = Vec(193.7, 69.2); + auto mix35ParamPosition = Vec(193.7, 106.2); + auto mix45ParamPosition = Vec(193.7, 143.2); + auto mix55ParamPosition = Vec(193.7, 180.2); + auto mix65ParamPosition = Vec(193.7, 217.2); + auto mix75ParamPosition = Vec(193.7, 254.2); + auto mix85ParamPosition = Vec(193.7, 291.2); + auto mix16ParamPosition = Vec(228.7, 32.2); + auto mix26ParamPosition = Vec(228.7, 69.2); + auto mix36ParamPosition = Vec(228.7, 106.2); + auto mix46ParamPosition = Vec(228.7, 143.2); + auto mix56ParamPosition = Vec(228.7, 180.2); + auto mix66ParamPosition = Vec(228.7, 217.2); + auto mix76ParamPosition = Vec(228.7, 254.2); + auto mix86ParamPosition = Vec(228.7, 291.2); + auto mix17ParamPosition = Vec(263.7, 32.2); + auto mix27ParamPosition = Vec(263.7, 69.2); + auto mix37ParamPosition = Vec(263.7, 106.2); + auto mix47ParamPosition = Vec(263.7, 143.2); + auto mix57ParamPosition = Vec(263.7, 180.2); + auto mix67ParamPosition = Vec(263.7, 217.2); + auto mix77ParamPosition = Vec(263.7, 254.2); + auto mix87ParamPosition = Vec(263.7, 291.2); + auto mix18ParamPosition = Vec(298.7, 32.2); + auto mix28ParamPosition = Vec(298.7, 69.2); + auto mix38ParamPosition = Vec(298.7, 106.2); + auto mix48ParamPosition = Vec(298.7, 143.2); + auto mix58ParamPosition = Vec(298.7, 180.2); + auto mix68ParamPosition = Vec(298.7, 217.2); + auto mix78ParamPosition = Vec(298.7, 254.2); + auto mix88ParamPosition = Vec(298.7, 291.2); + auto levelParamPosition = Vec(14.5, 339.5); + + auto in1InputPosition = Vec(10.5, 30.0); + auto in2InputPosition = Vec(10.5, 67.0); + auto in3InputPosition = Vec(10.5, 104.0); + auto in4InputPosition = Vec(10.5, 141.0); + auto in5InputPosition = Vec(10.5, 178.0); + auto in6InputPosition = Vec(10.5, 215.0); + auto in7InputPosition = Vec(10.5, 252.0); + auto in8InputPosition = Vec(10.5, 289.0); + + auto out1OutputPosition = Vec(51.5, 328.0); + auto out2OutputPosition = Vec(86.5, 328.0); + auto out3OutputPosition = Vec(121.5, 328.0); + auto out4OutputPosition = Vec(156.5, 328.0); + auto out5OutputPosition = Vec(191.5, 328.0); + auto out6OutputPosition = Vec(226.5, 328.0); + auto out7OutputPosition = Vec(261.5, 328.0); + auto out8OutputPosition = Vec(296.5, 328.0); + // end generated by svg_widgets.rb + + addParam(ParamWidget::create(mix11ParamPosition, module, Matrix88::MIX11_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix21ParamPosition, module, Matrix88::MIX21_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix31ParamPosition, module, Matrix88::MIX31_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix41ParamPosition, module, Matrix88::MIX41_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix51ParamPosition, module, Matrix88::MIX51_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix61ParamPosition, module, Matrix88::MIX61_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix71ParamPosition, module, Matrix88::MIX71_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix81ParamPosition, module, Matrix88::MIX81_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix12ParamPosition, module, Matrix88::MIX12_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix22ParamPosition, module, Matrix88::MIX22_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix32ParamPosition, module, Matrix88::MIX32_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix42ParamPosition, module, Matrix88::MIX42_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix52ParamPosition, module, Matrix88::MIX52_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix62ParamPosition, module, Matrix88::MIX62_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix72ParamPosition, module, Matrix88::MIX72_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix82ParamPosition, module, Matrix88::MIX82_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix13ParamPosition, module, Matrix88::MIX13_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix23ParamPosition, module, Matrix88::MIX23_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix33ParamPosition, module, Matrix88::MIX33_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix43ParamPosition, module, Matrix88::MIX43_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix53ParamPosition, module, Matrix88::MIX53_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix63ParamPosition, module, Matrix88::MIX63_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix73ParamPosition, module, Matrix88::MIX73_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix83ParamPosition, module, Matrix88::MIX83_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix14ParamPosition, module, Matrix88::MIX14_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix24ParamPosition, module, Matrix88::MIX24_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix34ParamPosition, module, Matrix88::MIX34_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix44ParamPosition, module, Matrix88::MIX44_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix54ParamPosition, module, Matrix88::MIX54_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix64ParamPosition, module, Matrix88::MIX64_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix74ParamPosition, module, Matrix88::MIX74_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix84ParamPosition, module, Matrix88::MIX84_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix15ParamPosition, module, Matrix88::MIX15_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix25ParamPosition, module, Matrix88::MIX25_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix35ParamPosition, module, Matrix88::MIX35_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix45ParamPosition, module, Matrix88::MIX45_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix55ParamPosition, module, Matrix88::MIX55_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix65ParamPosition, module, Matrix88::MIX65_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix75ParamPosition, module, Matrix88::MIX75_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix85ParamPosition, module, Matrix88::MIX85_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix16ParamPosition, module, Matrix88::MIX16_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix26ParamPosition, module, Matrix88::MIX26_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix36ParamPosition, module, Matrix88::MIX36_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix46ParamPosition, module, Matrix88::MIX46_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix56ParamPosition, module, Matrix88::MIX56_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix66ParamPosition, module, Matrix88::MIX66_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix76ParamPosition, module, Matrix88::MIX76_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix86ParamPosition, module, Matrix88::MIX86_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix17ParamPosition, module, Matrix88::MIX17_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix27ParamPosition, module, Matrix88::MIX27_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix37ParamPosition, module, Matrix88::MIX37_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix47ParamPosition, module, Matrix88::MIX47_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix57ParamPosition, module, Matrix88::MIX57_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix67ParamPosition, module, Matrix88::MIX67_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix77ParamPosition, module, Matrix88::MIX77_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix87ParamPosition, module, Matrix88::MIX87_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix18ParamPosition, module, Matrix88::MIX18_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix28ParamPosition, module, Matrix88::MIX28_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix38ParamPosition, module, Matrix88::MIX38_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix48ParamPosition, module, Matrix88::MIX48_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix58ParamPosition, module, Matrix88::MIX58_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix68ParamPosition, module, Matrix88::MIX68_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix78ParamPosition, module, Matrix88::MIX78_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(mix88ParamPosition, module, Matrix88::MIX88_PARAM, -1.0, 1.0, 0.0)); + addParam(ParamWidget::create(levelParamPosition, module, Matrix88::LEVEL_PARAM, 0.0, 1.0, 1.0)); + + addInput(Port::create(in1InputPosition, Port::INPUT, module, Matrix88::IN1_INPUT)); + addInput(Port::create(in2InputPosition, Port::INPUT, module, Matrix88::IN2_INPUT)); + addInput(Port::create(in3InputPosition, Port::INPUT, module, Matrix88::IN3_INPUT)); + addInput(Port::create(in4InputPosition, Port::INPUT, module, Matrix88::IN4_INPUT)); + addInput(Port::create(in5InputPosition, Port::INPUT, module, Matrix88::IN5_INPUT)); + addInput(Port::create(in6InputPosition, Port::INPUT, module, Matrix88::IN6_INPUT)); + addInput(Port::create(in7InputPosition, Port::INPUT, module, Matrix88::IN7_INPUT)); + addInput(Port::create(in8InputPosition, Port::INPUT, module, Matrix88::IN8_INPUT)); + + addOutput(Port::create(out1OutputPosition, Port::OUTPUT, module, Matrix88::OUT1_OUTPUT)); + addOutput(Port::create(out2OutputPosition, Port::OUTPUT, module, Matrix88::OUT2_OUTPUT)); + addOutput(Port::create(out3OutputPosition, Port::OUTPUT, module, Matrix88::OUT3_OUTPUT)); + addOutput(Port::create(out4OutputPosition, Port::OUTPUT, module, Matrix88::OUT4_OUTPUT)); + addOutput(Port::create(out5OutputPosition, Port::OUTPUT, module, Matrix88::OUT5_OUTPUT)); + addOutput(Port::create(out6OutputPosition, Port::OUTPUT, module, Matrix88::OUT6_OUTPUT)); + addOutput(Port::create(out7OutputPosition, Port::OUTPUT, module, Matrix88::OUT7_OUTPUT)); + addOutput(Port::create(out8OutputPosition, Port::OUTPUT, module, Matrix88::OUT8_OUTPUT)); + } +}; + +RACK_PLUGIN_MODEL_INIT(Bogaudio, Matrix88) { + Model* modelMatrix88 = createModel("Bogaudio-Matrix88", "Matrix88", "signal routing matrix", MIXER_TAG); + return modelMatrix88; +} diff --git a/plugins/community/repos/Bogaudio/src/Matrix88.hpp b/plugins/community/repos/Bogaudio/src/Matrix88.hpp new file mode 100644 index 00000000..dc16114d --- /dev/null +++ b/plugins/community/repos/Bogaudio/src/Matrix88.hpp @@ -0,0 +1,119 @@ +#pragma once + +#include "bogaudio.hpp" +#include "dsp/signal.hpp" + +using namespace bogaudio::dsp; + +extern Model* modelMatrix88; + +namespace bogaudio { + +struct Matrix88 : Module { + enum ParamsIds { + MIX11_PARAM, + MIX21_PARAM, + MIX31_PARAM, + MIX41_PARAM, + MIX51_PARAM, + MIX61_PARAM, + MIX71_PARAM, + MIX81_PARAM, + MIX12_PARAM, + MIX22_PARAM, + MIX32_PARAM, + MIX42_PARAM, + MIX52_PARAM, + MIX62_PARAM, + MIX72_PARAM, + MIX82_PARAM, + MIX13_PARAM, + MIX23_PARAM, + MIX33_PARAM, + MIX43_PARAM, + MIX53_PARAM, + MIX63_PARAM, + MIX73_PARAM, + MIX83_PARAM, + MIX14_PARAM, + MIX24_PARAM, + MIX34_PARAM, + MIX44_PARAM, + MIX54_PARAM, + MIX64_PARAM, + MIX74_PARAM, + MIX84_PARAM, + MIX15_PARAM, + MIX25_PARAM, + MIX35_PARAM, + MIX45_PARAM, + MIX55_PARAM, + MIX65_PARAM, + MIX75_PARAM, + MIX85_PARAM, + MIX16_PARAM, + MIX26_PARAM, + MIX36_PARAM, + MIX46_PARAM, + MIX56_PARAM, + MIX66_PARAM, + MIX76_PARAM, + MIX86_PARAM, + MIX17_PARAM, + MIX27_PARAM, + MIX37_PARAM, + MIX47_PARAM, + MIX57_PARAM, + MIX67_PARAM, + MIX77_PARAM, + MIX87_PARAM, + MIX18_PARAM, + MIX28_PARAM, + MIX38_PARAM, + MIX48_PARAM, + MIX58_PARAM, + MIX68_PARAM, + MIX78_PARAM, + MIX88_PARAM, + LEVEL_PARAM, + NUM_PARAMS + }; + + enum InputsIds { + IN1_INPUT, + IN2_INPUT, + IN3_INPUT, + IN4_INPUT, + IN5_INPUT, + IN6_INPUT, + IN7_INPUT, + IN8_INPUT, + NUM_INPUTS + }; + + enum OutputsIds { + OUT1_OUTPUT, + OUT2_OUTPUT, + OUT3_OUTPUT, + OUT4_OUTPUT, + OUT5_OUTPUT, + OUT6_OUTPUT, + OUT7_OUTPUT, + OUT8_OUTPUT, + NUM_OUTPUTS + }; + + enum LightsIds { + NUM_LIGHTS + }; + + float _inputs[8] {}; + Saturator _saturators[8]; + + Matrix88() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS) { + } + + void step() override; +}; + +} // namespace bogaudio diff --git a/plugins/community/repos/Bogaudio/src/Test.cpp b/plugins/community/repos/Bogaudio/src/Test.cpp index d90b4ded..ef01ee63 100644 --- a/plugins/community/repos/Bogaudio/src/Test.cpp +++ b/plugins/community/repos/Bogaudio/src/Test.cpp @@ -268,6 +268,26 @@ void Test::step() { // outputs[OUT2_OUTPUT].value = _lpfDecimator.next(buf) * 5.0f; outputs[OUT2_OUTPUT].value = _rackDecimator.process(buf) * 5.0f; +#elif INTERPOLATOR + const int quality = 12; + float sampleRate = engineGetSampleRate(); + float frequency = oscillatorPitch(); + _saw.setSampleRate(sampleRate); + _saw.setFrequency(frequency); + _saw.setQuality(quality); + _decimator.setParams(sampleRate, FACTOR); + _interpolator.setParams(sampleRate, FACTOR); + if (_steps >= FACTOR) { + _steps = 0; + for (int i = 0; i < FACTOR; ++i) { + _rawSamples[i] = _saw.next(); + } + _interpolator.next(_decimator.next(_rawSamples), _processedSamples); + } + outputs[OUT_OUTPUT].value = _processedSamples[_steps] * 5.0f; + outputs[OUT2_OUTPUT].value = _rawSamples[_steps] * 5.0f; + ++_steps; + #elif FM const float amplitude = 5.0f; float baseHz = oscillatorPitch(); diff --git a/plugins/community/repos/Bogaudio/src/Test.hpp b/plugins/community/repos/Bogaudio/src/Test.hpp index be08d874..8f776d09 100644 --- a/plugins/community/repos/Bogaudio/src/Test.hpp +++ b/plugins/community/repos/Bogaudio/src/Test.hpp @@ -17,6 +17,7 @@ extern Model* modelTest; // #define OVERSAMPLED_BL 1 // #define ANTIALIASING 1 // #define DECIMATORS 1 +#define INTERPOLATOR 1 // #define FM 1 // #define PM 1 // #define FEEDBACK_PM 1 @@ -25,7 +26,7 @@ extern Model* modelTest; // #define SLEW 1 // #define RMS 1 // #define RAVG 1 -#define SATURATOR 1 +// #define SATURATOR 1 #include "pitch.hpp" #ifdef LPF @@ -63,6 +64,9 @@ extern Model* modelTest; #include "dsp/oscillator.hpp" #include "dsp/filter.hpp" #include "dsp/decimator.hpp" // rack +#elif INTERPOLATOR +#include "dsp/oscillator.hpp" +#include "dsp/filter.hpp" #elif FM #include "dsp/oscillator.hpp" #elif PM @@ -171,6 +175,15 @@ struct Test : Module { bogaudio::dsp::CICDecimator _cicDecimator; bogaudio::dsp::LPFDecimator _lpfDecimator; rack::Decimator _rackDecimator; +#elif INTERPOLATOR + #define FACTOR 8 + #define STAGES 4 + BandLimitedSawOscillator _saw; + bogaudio::dsp::CICDecimator _decimator; + bogaudio::dsp::CICInterpolator _interpolator; + int _steps; + float _rawSamples[FACTOR] {}; + float _processedSamples[FACTOR] {}; #elif FM float _baseHz = 0.0f; float _ratio = 0.0f; @@ -211,6 +224,9 @@ struct Test : Module { , _sine2(_table) #elif DECIMATORS , _cicDecimator(STAGES) +#elif INTERPOLATOR + , _decimator(STAGES) + , _interpolator(STAGES) #elif TABLES , _table(StaticBlepTable::table(), 44100.0, 1000.0) #elif RAVG diff --git a/plugins/community/repos/Bogaudio/src/UMix.cpp b/plugins/community/repos/Bogaudio/src/UMix.cpp new file mode 100644 index 00000000..82ae67ab --- /dev/null +++ b/plugins/community/repos/Bogaudio/src/UMix.cpp @@ -0,0 +1,81 @@ + +#include "UMix.hpp" + +void UMix::step() { + if (!outputs[OUT_OUTPUT].active) { + return; + } + if (params[MODE_PARAM].value > 0.5f) { + float out = 0.0f; + for (int i = 0; i < 6; ++i) { + out += inputs[IN1_INPUT + i].value; + } + outputs[OUT_OUTPUT].value = _saturator.next(params[LEVEL_PARAM].value * out); + } + else { + float out = 0.0f; + int active = 0; + for (int i = 0; i < 6; ++i) { + if (inputs[IN1_INPUT + i].active) { + out += inputs[IN1_INPUT + i].value; + ++active; + } + } + if (active > 0) { + out /= (float)active; + outputs[OUT_OUTPUT].value = _saturator.next(params[LEVEL_PARAM].value * out); + } + else { + outputs[OUT_OUTPUT].value = 0.0f; + } + } +} + +struct UMixWidget : ModuleWidget { + static constexpr int hp = 3; + + UMixWidget(UMix* module) : ModuleWidget(module) { + box.size = Vec(RACK_GRID_WIDTH * hp, RACK_GRID_HEIGHT); + + { + SVGPanel *panel = new SVGPanel(); + panel->box.size = box.size; + panel->setBackground(SVG::load(assetPlugin(plugin, "res/UMix.svg"))); + addChild(panel); + } + + addChild(Widget::create(Vec(0, 0))); + addChild(Widget::create(Vec(box.size.x - 15, 365))); + + // generated by svg_widgets.rb + auto modeParamPosition = Vec(15.0, 255.5); + auto levelParamPosition = Vec(14.5, 314.5); + + auto in1InputPosition = Vec(10.5, 23.0); + auto in2InputPosition = Vec(10.5, 53.0); + auto in3InputPosition = Vec(10.5, 83.0); + auto in4InputPosition = Vec(10.5, 113.0); + auto in5InputPosition = Vec(10.5, 143.0); + auto in6InputPosition = Vec(10.5, 173.0); + + auto outOutputPosition = Vec(10.5, 203.0); + // end generated by svg_widgets.rb + + addParam(ParamWidget::create(modeParamPosition, module, UMix::MODE_PARAM, 0.0, 1.0, 1.0)); + addParam(ParamWidget::create(levelParamPosition, module, UMix::LEVEL_PARAM, 0.0, 1.0, 1.0)); + + addInput(Port::create(in1InputPosition, Port::INPUT, module, UMix::IN1_INPUT)); + addInput(Port::create(in2InputPosition, Port::INPUT, module, UMix::IN2_INPUT)); + addInput(Port::create(in3InputPosition, Port::INPUT, module, UMix::IN3_INPUT)); + addInput(Port::create(in4InputPosition, Port::INPUT, module, UMix::IN4_INPUT)); + addInput(Port::create(in5InputPosition, Port::INPUT, module, UMix::IN5_INPUT)); + addInput(Port::create(in6InputPosition, Port::INPUT, module, UMix::IN6_INPUT)); + + addOutput(Port::create(outOutputPosition, Port::OUTPUT, module, UMix::OUT_OUTPUT)); + } +}; + +RACK_PLUGIN_MODEL_INIT(Bogaudio, UMix) { + Model* modelUMix = createModel("Bogaudio-UMix", "UMix", "unity mixer", MIXER_TAG); + return modelUMix; +} diff --git a/plugins/community/repos/Bogaudio/src/UMix.hpp b/plugins/community/repos/Bogaudio/src/UMix.hpp new file mode 100644 index 00000000..ad45b834 --- /dev/null +++ b/plugins/community/repos/Bogaudio/src/UMix.hpp @@ -0,0 +1,46 @@ +#pragma once + +#include "bogaudio.hpp" +#include "dsp/signal.hpp" + +using namespace bogaudio::dsp; + +extern Model* modelUMix; + +namespace bogaudio { + +struct UMix : Module { + enum ParamsIds { + MODE_PARAM, + LEVEL_PARAM, + NUM_PARAMS + }; + + enum InputsIds { + IN1_INPUT, + IN2_INPUT, + IN3_INPUT, + IN4_INPUT, + IN5_INPUT, + IN6_INPUT, + NUM_INPUTS + }; + + enum OutputsIds { + OUT_OUTPUT, + NUM_OUTPUTS + }; + + enum LightsIds { + NUM_LIGHTS + }; + + Saturator _saturator; + + UMix() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS) { + } + + void step() override; +}; + +} // namespace bogaudio diff --git a/plugins/community/repos/Bogaudio/src/bogaudio.cpp b/plugins/community/repos/Bogaudio/src/bogaudio.cpp index 2203bf72..0789720e 100644 --- a/plugins/community/repos/Bogaudio/src/bogaudio.cpp +++ b/plugins/community/repos/Bogaudio/src/bogaudio.cpp @@ -1,10 +1,13 @@ #include "bogaudio.hpp" +#include "AD.hpp" #include "ADSR.hpp" #include "Additator.hpp" +#include "AMRM.hpp" #include "Analyzer.hpp" #include "Bool.hpp" +#include "Cmp.hpp" #include "CVD.hpp" #include "DADSRH.hpp" #include "DADSRHPlus.hpp" @@ -17,13 +20,13 @@ #include "LFO.hpp" #include "Lag.hpp" #include "Manual.hpp" +#include "Matrix88.hpp" #include "Mix4.hpp" #include "Mix8.hpp" #include "Mult.hpp" #include "Noise.hpp" #include "Offset.hpp" #include "Pan.hpp" -#include "RM.hpp" #include "Reftone.hpp" #include "SampleHold.hpp" #include "Shaper.hpp" @@ -31,6 +34,7 @@ #include "Stack.hpp" #include "Sums.hpp" #include "Switch.hpp" +#include "UMix.hpp" #include "VCA.hpp" #include "VCAmp.hpp" #include "VCM.hpp" @@ -89,7 +93,6 @@ RACK_PLUGIN_MODEL_DECLARE(Bogaudio, Switch); #ifdef EXPERIMENTAL RACK_PLUGIN_MODEL_DECLARE(Bogaudio, Lag); -RACK_PLUGIN_MODEL_DECLARE(Bogaudio, RM); #endif #ifdef TEST @@ -110,9 +113,16 @@ RACK_PLUGIN_MODEL_DECLARE(Bogaudio, TwentyFiveHP); RACK_PLUGIN_MODEL_DECLARE(Bogaudio, ThirtyHP); #endif +RACK_PLUGIN_MODEL_DECLARE(Bogaudio, AD); +RACK_PLUGIN_MODEL_DECLARE(Bogaudio, AMRM); +RACK_PLUGIN_MODEL_DECLARE(Bogaudio, Matrix88); +RACK_PLUGIN_MODEL_DECLARE(Bogaudio, UMix); + RACK_PLUGIN_INIT(Bogaudio) { RACK_PLUGIN_INIT_ID(); + RACK_PLUGIN_INIT_VERSION("0.6.7"); + RACK_PLUGIN_INIT_WEBSITE("https://github.com/bogaudio/BogaudioModules"); RACK_PLUGIN_INIT_MANUAL("https://github.com/bogaudio/BogaudioModules/blob/master/README.md"); @@ -160,7 +170,6 @@ RACK_PLUGIN_INIT(Bogaudio) { #ifdef EXPERIMENTAL RACK_PLUGIN_MODEL_ADD(Bogaudio, Lag); - RACK_PLUGIN_MODEL_ADD(Bogaudio, RM); #endif #ifdef TEST @@ -181,5 +190,10 @@ RACK_PLUGIN_INIT(Bogaudio) { RACK_PLUGIN_MODEL_ADD(Bogaudio, ThirtyHP); #endif + RACK_PLUGIN_MODEL_ADD(Bogaudio, AD); + RACK_PLUGIN_MODEL_ADD(Bogaudio, AMRM); + RACK_PLUGIN_MODEL_ADD(Bogaudio, Matrix88); + RACK_PLUGIN_MODEL_ADD(Bogaudio, UMix); + //NEW_MODELS_HERE } diff --git a/plugins/community/repos/Bogaudio/src/dsp/filter.cpp b/plugins/community/repos/Bogaudio/src/dsp/filter.cpp index 5c51115d..a07e178c 100644 --- a/plugins/community/repos/Bogaudio/src/dsp/filter.cpp +++ b/plugins/community/repos/Bogaudio/src/dsp/filter.cpp @@ -1,6 +1,6 @@ -#include #include +#include #include "filter.hpp" @@ -234,3 +234,50 @@ float CICDecimator::next(const float* buf) { } return _gainCorrection * (s / (float)scale); } + + +CICInterpolator::CICInterpolator(int stages, int factor) { + assert(stages > 0); + _stages = stages; + _integrators = new T[_stages + 1] {}; + _combs = new T[_stages] {}; + _buffer = NULL; + setParams(0.0f, factor); +} + +CICInterpolator::~CICInterpolator() { + delete[] _integrators; + delete[] _combs; + delete[] _buffer; +} + +void CICInterpolator::setParams(float _sampleRate, int factor) { + assert(factor > 0); + if (_factor != factor) { + _factor = factor; + _gainCorrection = 1.0f / 512.0f; // (float)(pow(_factor, _stages / 2)); + if (_buffer) { + delete[] _buffer; + } + _buffer = new T[_factor] {}; + } +} + +void CICInterpolator::next(float sample, float* buf) { + T s = sample * scale; + for (int i = 0; i < _stages; ++i) { + T t = s; + s -= _combs[i]; + _combs[i] = t; + } + + std::fill(_buffer, _buffer + _factor, (T)0); + _buffer[0] = s; + for (int i = 0; i < _factor; ++i) { + _integrators[0] = _buffer[i]; + for (int j = 1; j <= _stages; ++j) { + _integrators[j] += _integrators[j - 1]; + } + buf[i] = _gainCorrection * (_integrators[_stages] / (float)scale); + } +} diff --git a/plugins/community/repos/Bogaudio/src/dsp/filter.hpp b/plugins/community/repos/Bogaudio/src/dsp/filter.hpp index 79416a25..71f50568 100644 --- a/plugins/community/repos/Bogaudio/src/dsp/filter.hpp +++ b/plugins/community/repos/Bogaudio/src/dsp/filter.hpp @@ -162,5 +162,29 @@ struct CICDecimator : Decimator { float next(const float* buf) override; }; +struct Interpolator { + Interpolator() {} + virtual ~Interpolator() {} + + virtual void setParams(float sampleRate, int factor) = 0; + virtual void next(float sample, float* buf) = 0; +}; + +struct CICInterpolator : Interpolator { + typedef int64_t T; + static constexpr T scale = ((T)1) << 32; + int _stages; + T* _integrators; + T* _combs; + T* _buffer; + int _factor = 0; + float _gainCorrection; + + CICInterpolator(int stages = 4, int factor = 8); + virtual ~CICInterpolator(); + + void setParams(float sampleRate, int factor) override; + void next(float sample, float* buf) override; +}; } // namespace dsp } // namespace bogaudio diff --git a/plugins/community/repos/Bogaudio/src/widgets.cpp b/plugins/community/repos/Bogaudio/src/widgets.cpp index 8d6cd407..501dbf05 100644 --- a/plugins/community/repos/Bogaudio/src/widgets.cpp +++ b/plugins/community/repos/Bogaudio/src/widgets.cpp @@ -5,7 +5,6 @@ using namespace bogaudio; using namespace bogaudio::dsp; - Button18::Button18() { addFrame(SVG::load(assetPlugin(plugin, "res/button_18px_0.svg"))); addFrame(SVG::load(assetPlugin(plugin, "res/button_18px_1.svg"))); @@ -27,6 +26,11 @@ Knob16::Knob16() : BGKnob("res/knob_16px.svg", 16) { } +Knob19::Knob19() : BGKnob("res/knob_19px.svg", 19) { + shadow->box.pos = Vec(0.0, 2.5); +} + + Knob26::Knob26() : BGKnob("res/knob_26px.svg", 26) { } @@ -39,6 +43,10 @@ Knob38::Knob38() : BGKnob("res/knob_38px.svg", 38) { } +Knob45::Knob45() : BGKnob("res/knob_45px.svg", 45) { +} + + Knob68::Knob68() : BGKnob("res/knob_68px.svg", 68) { shadow->box.pos = Vec(0.0, 4.0); } diff --git a/plugins/community/repos/Bogaudio/src/widgets.hpp b/plugins/community/repos/Bogaudio/src/widgets.hpp index f4191616..b88d115a 100644 --- a/plugins/community/repos/Bogaudio/src/widgets.hpp +++ b/plugins/community/repos/Bogaudio/src/widgets.hpp @@ -22,6 +22,10 @@ struct Knob16 : BGKnob { Knob16(); }; +struct Knob19 : BGKnob { + Knob19(); +}; + struct Knob26 : BGKnob { Knob26(); }; @@ -34,6 +38,10 @@ struct Knob38 : BGKnob { Knob38(); }; +struct Knob45 : BGKnob { + Knob45(); +}; + struct Knob68 : BGKnob { Knob68(); }; diff --git a/vst2_bin/plugins/Bogaudio/doc/www/envelopes1.png b/vst2_bin/plugins/Bogaudio/doc/www/envelopes1.png new file mode 100644 index 00000000..24a90b12 Binary files /dev/null and b/vst2_bin/plugins/Bogaudio/doc/www/envelopes1.png differ diff --git a/vst2_bin/plugins/Bogaudio/doc/www/envelopes2.png b/vst2_bin/plugins/Bogaudio/doc/www/envelopes2.png new file mode 100644 index 00000000..2216b84d Binary files /dev/null and b/vst2_bin/plugins/Bogaudio/doc/www/envelopes2.png differ diff --git a/vst2_bin/plugins/Bogaudio/doc/www/lfos.png b/vst2_bin/plugins/Bogaudio/doc/www/lfos.png new file mode 100644 index 00000000..b1a95bab Binary files /dev/null and b/vst2_bin/plugins/Bogaudio/doc/www/lfos.png differ diff --git a/vst2_bin/plugins/Bogaudio/doc/www/mixers1.png b/vst2_bin/plugins/Bogaudio/doc/www/mixers1.png new file mode 100644 index 00000000..aed43553 Binary files /dev/null and b/vst2_bin/plugins/Bogaudio/doc/www/mixers1.png differ diff --git a/vst2_bin/plugins/Bogaudio/doc/www/mixers2.png b/vst2_bin/plugins/Bogaudio/doc/www/mixers2.png new file mode 100644 index 00000000..b5569abe Binary files /dev/null and b/vst2_bin/plugins/Bogaudio/doc/www/mixers2.png differ diff --git a/vst2_bin/plugins/Bogaudio/doc/www/modules.png b/vst2_bin/plugins/Bogaudio/doc/www/modules.png new file mode 100644 index 00000000..98b778f5 Binary files /dev/null and b/vst2_bin/plugins/Bogaudio/doc/www/modules.png differ diff --git a/vst2_bin/plugins/Bogaudio/doc/www/oscillators.png b/vst2_bin/plugins/Bogaudio/doc/www/oscillators.png new file mode 100644 index 00000000..eae27f49 Binary files /dev/null and b/vst2_bin/plugins/Bogaudio/doc/www/oscillators.png differ diff --git a/vst2_bin/plugins/Bogaudio/doc/www/pitch.png b/vst2_bin/plugins/Bogaudio/doc/www/pitch.png new file mode 100644 index 00000000..0210b048 Binary files /dev/null and b/vst2_bin/plugins/Bogaudio/doc/www/pitch.png differ diff --git a/vst2_bin/plugins/Bogaudio/doc/www/resumeloop.png b/vst2_bin/plugins/Bogaudio/doc/www/resumeloop.png new file mode 100644 index 00000000..cb24f489 Binary files /dev/null and b/vst2_bin/plugins/Bogaudio/doc/www/resumeloop.png differ diff --git a/vst2_bin/plugins/Bogaudio/doc/www/utilities.png b/vst2_bin/plugins/Bogaudio/doc/www/utilities.png new file mode 100644 index 00000000..fedc55ff Binary files /dev/null and b/vst2_bin/plugins/Bogaudio/doc/www/utilities.png differ diff --git a/vst2_bin/plugins/Bogaudio/doc/www/visualizers.png b/vst2_bin/plugins/Bogaudio/doc/www/visualizers.png new file mode 100644 index 00000000..7fc10a26 Binary files /dev/null and b/vst2_bin/plugins/Bogaudio/doc/www/visualizers.png differ diff --git a/vst2_bin/plugins/Bogaudio/res/AD.svg b/vst2_bin/plugins/Bogaudio/res/AD.svg new file mode 100644 index 00000000..1842b677 --- /dev/null +++ b/vst2_bin/plugins/Bogaudio/res/AD.svg @@ -0,0 +1,860 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + 1 + + + + + + + + + + + + + + 5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vst2_bin/plugins/Bogaudio/res/AMRM.svg b/vst2_bin/plugins/Bogaudio/res/AMRM.svg new file mode 100644 index 00000000..95af414f --- /dev/null +++ b/vst2_bin/plugins/Bogaudio/res/AMRM.svg @@ -0,0 +1,718 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + + + + D + + + + + + + + + + W + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vst2_bin/plugins/Bogaudio/res/Cmp.svg b/vst2_bin/plugins/Bogaudio/res/Cmp.svg new file mode 100644 index 00000000..af1f06ff --- /dev/null +++ b/vst2_bin/plugins/Bogaudio/res/Cmp.svg @@ -0,0 +1,1295 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + -10 + + + + + + + + + + 0 + + + + + + + + + + 10 + + + + + 0 + + + + + + + + + + 10 + + + + + 0 + + 0.1 + + + + + + + + + 1 + + + + + + 0-10V + + +/-5V + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vst2_bin/plugins/Bogaudio/res/Matrix88.svg b/vst2_bin/plugins/Bogaudio/res/Matrix88.svg new file mode 100644 index 00000000..6c828f8f --- /dev/null +++ b/vst2_bin/plugins/Bogaudio/res/Matrix88.svg @@ -0,0 +1,2847 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vst2_bin/plugins/Bogaudio/res/RM.svg b/vst2_bin/plugins/Bogaudio/res/RM.svg deleted file mode 100644 index 22cf869b..00000000 --- a/vst2_bin/plugins/Bogaudio/res/RM.svg +++ /dev/null @@ -1,663 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - 0 - - - - - - - - - - - - - - - D - - - - - - - - - - W - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vst2_bin/plugins/Bogaudio/res/UMix.svg b/vst2_bin/plugins/Bogaudio/res/UMix.svg new file mode 100644 index 00000000..9c5235b6 --- /dev/null +++ b/vst2_bin/plugins/Bogaudio/res/UMix.svg @@ -0,0 +1,413 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vst2_bin/plugins/Bogaudio/res/knob_19px.svg b/vst2_bin/plugins/Bogaudio/res/knob_19px.svg new file mode 100644 index 00000000..5998c6ce --- /dev/null +++ b/vst2_bin/plugins/Bogaudio/res/knob_19px.svg @@ -0,0 +1,66 @@ + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/vst2_bin/plugins/Bogaudio/res/knob_45px.svg b/vst2_bin/plugins/Bogaudio/res/knob_45px.svg new file mode 100644 index 00000000..b790e31c --- /dev/null +++ b/vst2_bin/plugins/Bogaudio/res/knob_45px.svg @@ -0,0 +1,62 @@ + + + + + + image/svg+xml + + + + + + + + + +