SynthLab SDK
oscillator.h
1 #pragma once
2 
3 #include "synthbase.h"
4 #include "guiconstants.h"
5 #include "synthfunctions.h"
6 
7 // -----------------------------
8 // --- SynthLab SDK File --- //
9 // ----------------------------
17 // -----------------------------------------------------------------------------
18 namespace SynthLab
19 {
106  class Oscillator : public SynthModule
107  {
108  public:
110  Oscillator(std::shared_ptr<MidiInputData> _midiInputData,
111  std::shared_ptr<OscParameters> _parameters,
112  uint32_t blockSize = 64);
113 
115  virtual ~Oscillator() {}
116 
118  virtual bool reset(double _sampleRate) override;
119  virtual bool update() override;
120  virtual bool render(uint32_t samplesToProcess = 1) override;
121  virtual bool doNoteOn(MIDINoteEvent& noteEvent) override;
122  virtual bool doNoteOff(MIDINoteEvent& noteEvent) override;
123 
125  std::shared_ptr<OscParameters> getParameters() { return parameters; }
126 
127  protected:
129  std::shared_ptr<OscParameters> parameters = nullptr;
130 
131  };
132 
133 
134 }
virtual bool doNoteOn(MIDINoteEvent &noteEvent) override
Calls the note-on handler for all cores.
Definition: oscillator.cpp:116
virtual bool render(uint32_t samplesToProcess=1) override
Renders audio from the selected core.
Definition: oscillator.cpp:102
std::shared_ptr< OscParameters > parameters
Definition: oscillator.h:129
Definition: addosccore.cpp:4
std::shared_ptr< OscParameters > getParameters()
Definition: oscillator.h:125
virtual bool reset(double _sampleRate) override
Resets object to initialized state.
Definition: oscillator.cpp:68
Abstract base class that encapsulates functionality of a module; used with the Module-Core paradigm...
Definition: synthbase.h:1600
virtual bool doNoteOff(MIDINoteEvent &noteEvent) override
Calls the note-off handler for all cores.
Definition: oscillator.cpp:134
Oscillator(std::shared_ptr< MidiInputData > _midiInputData, std::shared_ptr< OscParameters > _parameters, uint32_t blockSize=64)
Constructs General Purpose Pitched Oscillator module.
Definition: oscillator.cpp:27
virtual ~Oscillator()
Destructor is empty: all resources are smart pointers.
Definition: oscillator.h:115
virtual bool update() override
Updates the selected core; sets GLOBAL engine variable unisonDetuneCents that may have changed since ...
Definition: oscillator.cpp:85
hard-coded arrays of FIR filter coefficients for the sample rate conversion objects (Interpolator and...
General pirched oscillator module; use this object for oscillators that do not fit into one of the ot...
Definition: oscillator.h:106
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.