SynthLab SDK
envelopegenerator.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 {
102  {
103  public:
105  EnvelopeGenerator(std::shared_ptr<MidiInputData> _midiInputData,
106  std::shared_ptr<EGParameters> _parameters,
107  uint32_t blockSize = 64);
108 
110  virtual ~EnvelopeGenerator() {}
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 void setSustainOverride(bool b)
Definition: envelopegenerator.h:124
std::shared_ptr< EGParameters > parameters
Definition: envelopegenerator.h:135
virtual bool update() override
Updates the selected core; sets GLOBAL engine variable unisonDetuneCents that may have changed since ...
Definition: envelopegenerator.cpp:90
Definition: addosccore.cpp:4
virtual ~EnvelopeGenerator()
Definition: envelopegenerator.h:110
EnvelopeGenerator(std::shared_ptr< MidiInputData > _midiInputData, std::shared_ptr< EGParameters > _parameters, uint32_t blockSize=64)
Constructs Envelope Generator module.
Definition: envelopegenerator.cpp:28
virtual bool render(uint32_t samplesToProcess=1) override
Renders audio from the selected core.
Definition: envelopegenerator.cpp:106
Abstract base class that encapsulates functionality of a module; used with the Module-Core paradigm...
Definition: synthbase.h:1600
virtual bool shutdown() override
Quickly turn off the EG for voice steal and RTZ operation.
Definition: envelopegenerator.cpp:164
virtual int32_t getState() override
Get staste of selected core; used as part of note life-cycle.
Definition: envelopegenerator.cpp:153
Envelope Generator (EG) module.
Definition: envelopegenerator.h:101
virtual bool doNoteOff(MIDINoteEvent &noteEvent) override
Calls the note-off handler for all cores.
Definition: envelopegenerator.cpp:137
virtual bool reset(double _sampleRate) override
Resets object to initialized state.
Definition: envelopegenerator.cpp:69
hard-coded arrays of FIR filter coefficients for the sample rate conversion objects (Interpolator and...
virtual bool doNoteOn(MIDINoteEvent &noteEvent) override
Calls the note-on handler for all cores.
Definition: envelopegenerator.cpp:121
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.
std::shared_ptr< EGParameters > getParameters()
Definition: envelopegenerator.h:131