SynthLab SDK
fmocore.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "synthbase.h"
4 #include "synthfunctions.h"
5 #include "sinetablesource.h"
6 #include "dx_eg.h"
7 
8 // -----------------------------
9 // --- SynthLab SDK File --- //
10 // ----------------------------
18 // -----------------------------------------------------------------------------
19 namespace SynthLab
20 {
86  class FMOCore : public ModuleCore
87  {
88  public:
90  FMOCore(); /* C-TOR */
91 
93  virtual ~FMOCore() {} /* D-TOR */
94 
96  virtual bool reset(CoreProcData& processInfo) override;
97  virtual bool update(CoreProcData& processInfo) override;
98  virtual bool render(CoreProcData& processInfo) override;
99  virtual bool doNoteOn(CoreProcData& processInfo) override;
100  virtual bool doNoteOff(CoreProcData& processInfo) override;
101 
102  protected:
103  // --- ;ocal variables
104  double sampleRate = 0.0;
105  double midiPitch = 0.0;
106  double outputAmplitude = 1.0;
107  double panLeftGain = 0.707;
108  double panRightGain = 0.707;
109  double outputValue = 0.0;
110 
111  // --- timebase
113 
114  // --- table source
116 
117  // --- EG object and parameters
118  //
119  std::unique_ptr<DXEG> dxEG = nullptr;
120  std::shared_ptr<EGParameters> dxEGParameters = nullptr;
121  };
122 
123 } // namespace
124 
Compact modulo counter with wrapping used as the timebase for all oscillators.
Definition: synthbase.h:137
virtual bool reset(CoreProcData &processInfo) override
Resets object to initialized state.
Definition: fmocore.cpp:73
double panLeftGain
left channel gain
Definition: fmocore.h:107
See also Designing Software Synthesizers in C++ 2nd Ed. by Will Pirkle.
virtual ~FMOCore()
Definition: fmocore.h:93
Storage for one static sinusoidal table source; stores a single sine table that is used for all notes...
Definition: sinetablesource.h:39
Definition: addosccore.cpp:4
SynthClock oscClock
timebase
Definition: fmocore.h:112
double panRightGain
right channel gain
Definition: fmocore.h:108
virtual bool update(CoreProcData &processInfo) override
Updates the object for the next block of audio processing.
Definition: fmocore.cpp:121
std::unique_ptr< DXEG > dxEG
an EG for FM modulation
Definition: fmocore.h:119
virtual bool doNoteOff(CoreProcData &processInfo) override
Note-off handler for the ModuleCore.
Definition: fmocore.cpp:322
double outputAmplitude
amplitude in dB
Definition: fmocore.h:106
Sinusoidal-only oscillator and attached EG.
Definition: fmocore.h:86
double sampleRate
sample rate
Definition: fmocore.h:104
double outputValue
last output value needed for self Feedback
Definition: fmocore.h:109
virtual bool doNoteOn(CoreProcData &processInfo) override
Note-on handler for the ModuleCore.
Definition: fmocore.cpp:292
virtual bool render(CoreProcData &processInfo) override
Renders one block of audio data Core Specific:
Definition: fmocore.cpp:212
std::shared_ptr< EGParameters > dxEGParameters
EG parameters for controlling the EG.
Definition: fmocore.h:120
double midiPitch
the midi pitch
Definition: fmocore.h:105
hard-coded arrays of FIR filter coefficients for the sample rate conversion objects (Interpolator and...
SineTableSource sineTableSource
a single sinewave table
Definition: fmocore.h:115
This structure holds all of the information needed to call functions on a ModuleCore object...
Definition: synthbase.h:1071
Abstract base class that encapsulates functionality of a module core; used with the Module-Core parad...
Definition: synthbase.h:1516
FMOCore()
Constructs FM oscillator Core including standalone DXEG object.
Definition: fmocore.cpp:28
See also Designing Software Synthesizers in C++ 2nd Ed. by Will Pirkle.