SynthLab SDK
pcmoscillator.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "synthbase.h"
4 #include "synthfunctions.h"
5 #include "pcmlegacycore.h"
6 #include "mellotroncore.h"
7 #include "waveslicecore.h"
8 
9 // -----------------------------
10 // --- SynthLab SDK File --- //
11 // ----------------------------
19 // -----------------------------------------------------------------------------
20 namespace SynthLab
21 {
120  class PCMOscillator : public SynthModule
121  {
122  public:
124  PCMOscillator(std::shared_ptr<MidiInputData> _midiInputData,
125  std::shared_ptr<PCMOscParameters> _parameters,
126  std::shared_ptr<PCMSampleDatabase> _sampleDatabase,
127  uint32_t blockSize = 64);
128 
130  virtual ~PCMOscillator() {}/* D-TOR */
131 
133  virtual bool reset(double _sampleRate) override;
134  virtual bool update() override;
135  virtual bool render(uint32_t samplesToProcess = 1) override;
136  virtual bool doNoteOn(MIDINoteEvent& noteEvent) override;
137  virtual bool doNoteOff(MIDINoteEvent& noteEvent) override;
138 
140  std::shared_ptr<PCMOscParameters> getParameters() { return parameters; }
141 
142  protected:
144  std::shared_ptr<PCMOscParameters> parameters = nullptr;
145 
147  std::shared_ptr<PCMSampleDatabase> sampleDatabase;
148  };
149 
150 
151 }
virtual bool doNoteOff(MIDINoteEvent &noteEvent) override
Calls the note-off handler for all cores.
Definition: pcmoscillator.cpp:151
See also Designing Software Synthesizers in C++ 2nd Ed. by Will Pirkle.
See also Designing Software Synthesizers in C++ 2nd Ed. by Will Pirkle.
Definition: addosccore.cpp:4
PCM sample based oscillator module.
Definition: pcmoscillator.h:120
virtual bool render(uint32_t samplesToProcess=1) override
Renders audio from the selected core.
Definition: pcmoscillator.cpp:120
virtual ~PCMOscillator()
Definition: pcmoscillator.h:130
virtual bool doNoteOn(MIDINoteEvent &noteEvent) override
Calls the note-on handler for all cores.
Definition: pcmoscillator.cpp:134
Abstract base class that encapsulates functionality of a module; used with the Module-Core paradigm...
Definition: synthbase.h:1600
PCMOscillator(std::shared_ptr< MidiInputData > _midiInputData, std::shared_ptr< PCMOscParameters > _parameters, std::shared_ptr< PCMSampleDatabase > _sampleDatabase, uint32_t blockSize=64)
Constructs Wavetable Oscillator module.
Definition: pcmoscillator.cpp:27
std::shared_ptr< PCMOscParameters > parameters
Definition: pcmoscillator.h:144
std::shared_ptr< PCMSampleDatabase > sampleDatabase
Definition: pcmoscillator.h:147
std::shared_ptr< PCMOscParameters > getParameters()
Definition: pcmoscillator.h:140
virtual bool reset(double _sampleRate) override
Resets object to initialized state.
Definition: pcmoscillator.cpp:82
hard-coded arrays of FIR filter coefficients for the sample rate conversion objects (Interpolator and...
virtual bool update() override
Updates the selected core; sets GLOBAL engine variable unisonDetuneCents that may have changed since ...
Definition: pcmoscillator.cpp:104
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.