SynthLab SDK
dx_eg.h
1 #pragma once
2 
3 #include "synthbase.h"
4 #include "synthfunctions.h"
5 
6 // -----------------------------
7 // --- SynthLab SDK File --- //
8 // ----------------------------
16 // -----------------------------------------------------------------------------
17 namespace SynthLab
18 {
101  class DXEG : public SynthModule
102  {
103  public:
105  DXEG(std::shared_ptr<MidiInputData> _midiInputData,
106  std::shared_ptr<EGParameters> _parameters,
107  uint32_t blockSize = 64);
108 
110  virtual ~DXEG() {}
111 
113  virtual bool reset(double _sampleRate) override;
114  virtual bool update() override;
115  virtual bool render(uint32_t samplesToProcess = 1) override;
116  virtual bool doNoteOn(MIDINoteEvent& noteEvent) override;
117  virtual bool doNoteOff(MIDINoteEvent& noteEvent) override;
118 
120  virtual int32_t getState() override;
121  virtual bool shutdown() override;
122 
124  inline virtual void setSustainOverride(bool b)
125  {
126  if (selectedCore)
127  selectedCore->setSustainOverride(b);
128  }
129 
131  std::shared_ptr<EGParameters> getParameters() { return parameters; }
132 
133  protected:
135  std::shared_ptr<EGParameters> parameters = nullptr;
136  };
137 
138 
139 }
virtual bool doNoteOn(MIDINoteEvent &noteEvent) override
Calls the note-on handler for all cores.
Definition: dx_eg.cpp:116
virtual ~DXEG()
Definition: dx_eg.h:110
virtual bool render(uint32_t samplesToProcess=1) override
Renders audio from the selected core.
Definition: dx_eg.cpp:101
std::shared_ptr< EGParameters > parameters
Definition: dx_eg.h:135
Specialized version of the Envelope Generator (EG) module.
Definition: dx_eg.h:101
Definition: addosccore.cpp:4
virtual bool update() override
Updates the selected core; sets GLOBAL engine variable unisonDetuneCents that may have changed since ...
Definition: dx_eg.cpp:85
DXEG(std::shared_ptr< MidiInputData > _midiInputData, std::shared_ptr< EGParameters > _parameters, uint32_t blockSize=64)
Constructs DXEG module.
Definition: dx_eg.cpp:26
Abstract base class that encapsulates functionality of a module; used with the Module-Core paradigm...
Definition: synthbase.h:1600
virtual void setSustainOverride(bool b)
Definition: dx_eg.h:124
virtual bool shutdown() override
Quickly turn off the EG for voice steal and RTZ operation.
Definition: dx_eg.cpp:159
virtual int32_t getState() override
Get staste of selected core; used as part of note life-cycle.
Definition: dx_eg.cpp:148
virtual bool reset(double _sampleRate) override
Resets object to initialized state.
Definition: dx_eg.cpp:67
virtual bool doNoteOff(MIDINoteEvent &noteEvent) override
Calls the note-off handler for all cores.
Definition: dx_eg.cpp:132
hard-coded arrays of FIR filter coefficients for the sample rate conversion objects (Interpolator and...
std::shared_ptr< EGParameters > getParameters()
Definition: dx_eg.h:131
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.