BogaudioModules

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

Mumix.hpp (2267B)


      1 #pragma once
      2 
      3 #include "bogaudio.hpp"
      4 #include "matrix_base.hpp"
      5 #include "dsp/signal.hpp"
      6 
      7 using namespace bogaudio::dsp;
      8 
      9 extern Model* modelMumix;
     10 
     11 namespace bogaudio {
     12 
     13 struct Mumix : MatrixBaseModule {
     14 	enum ParamsIds {
     15 		MUTE1_PARAM,
     16 		MUTE2_PARAM,
     17 		MUTE3_PARAM,
     18 		MUTE4_PARAM,
     19 		MUTE5_PARAM,
     20 		MUTE6_PARAM,
     21 		MUTE7_PARAM,
     22 		MUTE8_PARAM,
     23 		NUM_PARAMS
     24 	};
     25 
     26 	enum InputsIds {
     27 		IN1_INPUT,
     28 		IN2_INPUT,
     29 		IN3_INPUT,
     30 		IN4_INPUT,
     31 		IN5_INPUT,
     32 		IN6_INPUT,
     33 		IN7_INPUT,
     34 		IN8_INPUT,
     35 		NUM_INPUTS
     36 	};
     37 
     38 	enum OutputsIds {
     39 		OUT_OUTPUT,
     40 		NUM_OUTPUTS
     41 	};
     42 
     43 	static const float maxDecibels;
     44 	static const float minDecibels;
     45 	static const float slewTimeMS;
     46 
     47 	Saturator _saturator[maxChannels];
     48 	Amplifier _amplifiers[8];
     49 	bogaudio::dsp::SlewLimiter _slewLimiters[8];
     50 	bool _muted[8] {};
     51 	float _invActive = 0.0f;
     52 
     53 	Mumix() {
     54 		config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS);
     55 		configSwitch(MUTE1_PARAM, 0.0f, 3.0f, 0.0f, "Mute 1", {"Unmuted", "Muted", "Soloed", "Soloed"});
     56 		configSwitch(MUTE2_PARAM, 0.0f, 3.0f, 0.0f, "Mute 2", {"Unmuted", "Muted", "Soloed", "Soloed"});
     57 		configSwitch(MUTE3_PARAM, 0.0f, 3.0f, 0.0f, "Mute 3", {"Unmuted", "Muted", "Soloed", "Soloed"});
     58 		configSwitch(MUTE4_PARAM, 0.0f, 3.0f, 0.0f, "Mute 4", {"Unmuted", "Muted", "Soloed", "Soloed"});
     59 		configSwitch(MUTE5_PARAM, 0.0f, 3.0f, 0.0f, "Mute 5", {"Unmuted", "Muted", "Soloed", "Soloed"});
     60 		configSwitch(MUTE6_PARAM, 0.0f, 3.0f, 0.0f, "Mute 6", {"Unmuted", "Muted", "Soloed", "Soloed"});
     61 		configSwitch(MUTE7_PARAM, 0.0f, 3.0f, 0.0f, "Mute 7", {"Unmuted", "Muted", "Soloed", "Soloed"});
     62 		configSwitch(MUTE8_PARAM, 0.0f, 3.0f, 0.0f, "Mute 8", {"Unmuted", "Muted", "Soloed", "Soloed"});
     63 
     64 		configInput(IN1_INPUT, "Signal 1");
     65 		configInput(IN2_INPUT, "Signal 2");
     66 		configInput(IN3_INPUT, "Signal 3");
     67 		configInput(IN4_INPUT, "Signal 4");
     68 		configInput(IN5_INPUT, "Signal 5");
     69 		configInput(IN6_INPUT, "Signal 6");
     70 		configInput(IN7_INPUT, "Signal 7");
     71 		configInput(IN8_INPUT, "Signal 8");
     72 
     73 		configOutput(OUT_OUTPUT, "Signal");
     74 	}
     75 
     76 	void sampleRateChange() override;
     77 	bool active() override;
     78 	int channels() override;
     79 	void modulate() override;
     80 	void processAlways(const ProcessArgs& args) override;
     81 	void processChannel(const ProcessArgs& args, int c) override;
     82 };
     83 
     84 } // namespace bogaudio