PEQ6XF.hpp (1365B)
1 #pragma once 2 3 #include "PEQ6_shared.hpp" 4 5 namespace bogaudio { 6 7 struct PEQ6XF : ExpanderModule<PEQ6ExpanderMessage, PEQXFBase> { 8 enum ParamsIds { 9 DAMP_PARAM, 10 GAIN_PARAM, 11 NUM_PARAMS 12 }; 13 14 enum InputsIds { 15 NUM_INPUTS 16 }; 17 18 enum OutputsIds { 19 EF1_OUTPUT, 20 EF2_OUTPUT, 21 EF3_OUTPUT, 22 EF4_OUTPUT, 23 EF5_OUTPUT, 24 EF6_OUTPUT, 25 NUM_OUTPUTS 26 }; 27 28 struct Engine { 29 EnvelopeFollower efs[6]; 30 }; 31 32 Engine* _engines[maxChannels] {}; 33 float _response = -1.0f; 34 Amplifier _gain; 35 Saturator _saturator; 36 PEQ6ExpanderMessage* _baseMessage = NULL; 37 38 PEQ6XF() { 39 config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS); 40 configParam(DAMP_PARAM, 0.0f, 1.0f, 0.3f, "Envelope follower smoothing", "%", 0.0f, 100.0f); 41 configParam<EFGainParamQuantity>(GAIN_PARAM, -1.0f, 1.0f, 0.0f, "Envelope follower gain", " dB"); 42 43 configOutput(EF1_OUTPUT, "Envelope 1"); 44 configOutput(EF2_OUTPUT, "Envelope 2"); 45 configOutput(EF3_OUTPUT, "Envelope 3"); 46 configOutput(EF4_OUTPUT, "Envelope 4"); 47 configOutput(EF5_OUTPUT, "Envelope 5"); 48 configOutput(EF6_OUTPUT, "Envelope 6"); 49 50 setBaseModelPredicate([](Model* m) { return m == modelPEQ6; }); 51 } 52 53 void addChannel(int c) override; 54 void removeChannel(int c) override; 55 void modulate() override; 56 void processAll(const ProcessArgs& args) override; 57 void processChannel(const ProcessArgs& args, int c) override; 58 }; 59 60 } // namespace bogaudio