SynthLab SDK
dca.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "synthbase.h"
4 #include "synthfunctions.h"
5 
6 // -----------------------------
7 // --- SynthLab SDK File --- //
8 // ----------------------------
16 // -----------------------------------------------------------------------------
17 namespace SynthLab
18 {
99  class DCA : public SynthModule
100  {
101  public:
103  DCA(std::shared_ptr<MidiInputData> _midiInputData,
104  std::shared_ptr<DCAParameters> _parameters,
105  uint32_t blockSize = 64);
106  virtual ~DCA() {}
107 
109  virtual bool reset(double _sampleRate) override;
110  virtual bool update() override;
111  virtual bool render(uint32_t samplesToProcess = 1) override;
112  virtual bool doNoteOn(MIDINoteEvent& noteEvent) override;
113  virtual bool doNoteOff(MIDINoteEvent& noteEvent) override;
114 
116  std::shared_ptr<DCAParameters> getParameters() { return parameters; }
117 
118  protected:
120  std::shared_ptr<DCAParameters> parameters = nullptr;
121 
122  // --- local variables
123  double gainRaw = 1.0;
124  double panLeftGain = 0.707;
125  double panRightGain = 0.707;
126  double midiVelocityGain = 0.0;
127 
129  double panValue = 0.0;
130  };
131 
132 }
double panLeftGain
left channel gain
Definition: dca.h:124
virtual bool update() override
Updates object by applying GUI parameter and input modulations to the internal variables.
Definition: dca.cpp:65
double panValue
Definition: dca.h:129
virtual bool reset(double _sampleRate) override
Resets object to initialized state.
Definition: dca.cpp:49
double panRightGain
right channel gain
Definition: dca.h:125
Definition: addosccore.cpp:4
double gainRaw
the final raw gain value
Definition: dca.h:123
Abstract base class that encapsulates functionality of a module; used with the Module-Core paradigm...
Definition: synthbase.h:1600
virtual bool doNoteOn(MIDINoteEvent &noteEvent) override
Perform note-on operations for the component.
Definition: dca.cpp:140
virtual bool render(uint32_t samplesToProcess=1) override
Processes audio from the input buffers to the output buffers.
Definition: dca.cpp:114
std::shared_ptr< DCAParameters > getParameters()
Definition: dca.h:116
std::shared_ptr< DCAParameters > parameters
Definition: dca.h:120
hard-coded arrays of FIR filter coefficients for the sample rate conversion objects (Interpolator and...
Digitally Controlled Amplifier module.
Definition: dca.h:99
DCA(std::shared_ptr< MidiInputData > _midiInputData, std::shared_ptr< DCAParameters > _parameters, uint32_t blockSize=64)
Constructs Digitally Controlled Amplifier module.
Definition: dca.cpp:26
double midiVelocityGain
gain from MIDI input velocity
Definition: dca.h:126
Information about a MIDI note event (note on or note off).
Definition: synthstructures.h:212
See also Designing Software Synthesizers in C++ 2nd Ed. by Will Pirkle.
virtual bool doNoteOff(MIDINoteEvent &noteEvent) override
Perform note-off operations for the component; Here there is nothing to do.
Definition: dca.cpp:157