SynthLab SDK
fmoperator.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "synthbase.h"
4 #include "guiconstants.h"
5 #include "bleptables.h"
6 #include "synthfunctions.h"
7 #include "synthlabwtsource.h"
8 #include "fmocore.h"
9 
10 // -----------------------------
11 // --- SynthLab SDK File --- //
12 // ----------------------------
20 // -----------------------------------------------------------------------------
21 namespace SynthLab
22 {
118  class FMOperator : public SynthModule
119  {
120  public:
122  FMOperator(std::shared_ptr<MidiInputData> _midiInputData,
123  std::shared_ptr<FMOperatorParameters> _parameters,
124  std::shared_ptr<WavetableDatabase> _waveTableDatabase,
125  uint32_t blockSize = 32);
126 
128  virtual ~FMOperator() {}/* D-TOR */
129 
131  virtual bool reset(double _sampleRate) override;
132  virtual bool update() override;
133  virtual bool render(uint32_t samplesToProcess = 1) override;
134  virtual bool doNoteOn(MIDINoteEvent& noteEvent) override;
135  virtual bool doNoteOff(MIDINoteEvent& noteEvent) override;
136 
138  std::shared_ptr<FMOperatorParameters> getParameters() { return parameters; }
139 
140  protected:
142  std::shared_ptr<FMOperatorParameters> parameters = nullptr;
143 
145  std::shared_ptr<WavetableDatabase> waveTableDatabase = nullptr;
146  };
147 
148 
149 }
virtual bool doNoteOn(MIDINoteEvent &noteEvent) override
Calls the note-on handler for all cores.
Definition: fmoperator.cpp:130
virtual bool reset(double _sampleRate) override
Resets object to initialized state.
Definition: fmoperator.cpp:75
std::shared_ptr< FMOperatorParameters > getParameters()
Definition: fmoperator.h:138
Definition: addosccore.cpp:4
FMOperator module.
Definition: fmoperator.h:118
See also Designing Software Synthesizers in C++ 2nd Ed. by Will Pirkle.
Abstract base class that encapsulates functionality of a module; used with the Module-Core paradigm...
Definition: synthbase.h:1600
virtual ~FMOperator()
Definition: fmoperator.h:128
std::shared_ptr< WavetableDatabase > waveTableDatabase
Definition: fmoperator.h:145
See also Designing Software Synthesizers in C++ 2nd Ed. by Will Pirkle.
virtual bool render(uint32_t samplesToProcess=1) override
Renders audio from the selected core.
Definition: fmoperator.cpp:112
virtual bool doNoteOff(MIDINoteEvent &noteEvent) override
Calls the note-off handler for all cores.
Definition: fmoperator.cpp:147
virtual bool update() override
Updates the selected core; sets GLOBAL engine variable unisonDetuneCents that may have changed since ...
Definition: fmoperator.cpp:95
hard-coded arrays of FIR filter coefficients for the sample rate conversion objects (Interpolator and...
std::shared_ptr< FMOperatorParameters > parameters
Definition: fmoperator.h:142
FMOperator(std::shared_ptr< MidiInputData > _midiInputData, std::shared_ptr< FMOperatorParameters > _parameters, std::shared_ptr< WavetableDatabase > _waveTableDatabase, uint32_t blockSize=32)
Constructs FM Operator Oscillator module.
Definition: fmoperator.cpp:28
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.