BogaudioModules

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

Lag.hpp (832B)


      1 #pragma once
      2 
      3 #include "bogaudio.hpp"
      4 #include "dsp/signal.hpp"
      5 
      6 using namespace bogaudio::dsp;
      7 
      8 extern Model* modelLag;
      9 
     10 namespace bogaudio {
     11 
     12 struct Lag : BGModule {
     13 	enum ParamsIds {
     14 		TIME_PARAM,
     15 		TIME_SCALE_PARAM,
     16 		SHAPE_PARAM,
     17 		NUM_PARAMS
     18 	};
     19 
     20 	enum InputsIds {
     21 		TIME_INPUT,
     22 		SHAPE_INPUT,
     23 		IN_INPUT,
     24 		NUM_INPUTS
     25 	};
     26 
     27 	enum OutputsIds {
     28 		OUT_OUTPUT,
     29 		NUM_OUTPUTS
     30 	};
     31 
     32 	ShapedSlewLimiter _slew;
     33 
     34 	Lag() {
     35 		config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS);
     36 		configParam(TIME_PARAM, 0.0f, 1.0f, 0.5f, "time");
     37 		configParam(TIME_SCALE_PARAM, 0.0f, 2.0f, 1.0f, "time_scale");
     38 		paramQuantities[TIME_SCALE_PARAM]->snapEnabled = true;
     39 		configParam(SHAPE_PARAM, -1.0f, 1.0f, 0.0f, "shape");
     40 	}
     41 
     42 	bool active() override;
     43 	void modulate() override;
     44 	void processAll(const ProcessArgs& args) override;
     45 };
     46 
     47 } // namespace bogaudio