SynthLab SDK
synthfilter.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 {
109 class SynthFilter : public SynthModule
110 {
111 public:
113  SynthFilter(std::shared_ptr<MidiInputData> _midiInputData,
114  std::shared_ptr<FilterParameters> _parameters,
115  uint32_t blockSize = 64);
116 
118  virtual ~SynthFilter() {}
119 
121  virtual bool reset(double _sampleRate) override;
122  virtual bool update() override;
123  virtual bool render(uint32_t samplesToProcess = 1) override;
124  virtual bool doNoteOn(MIDINoteEvent& noteEvent) override;
125  virtual bool doNoteOff(MIDINoteEvent& noteEvent) override;
126 
128  std::shared_ptr<FilterParameters> getParameters() { return parameters; }
129 
130 protected:
132  std::shared_ptr<FilterParameters> parameters = nullptr;
133 };
134 
135 
136 } // namespace
virtual bool update() override
Updates the selected core.
Definition: synthfilter.cpp:91
virtual bool render(uint32_t samplesToProcess=1) override
Renders processes audio from the selected core.
Definition: synthfilter.cpp:105
Definition: addosccore.cpp:4
std::shared_ptr< FilterParameters > getParameters()
Definition: synthfilter.h:128
virtual bool reset(double _sampleRate) override
Resets object to initialized state.
Definition: synthfilter.cpp:71
Abstract base class that encapsulates functionality of a module; used with the Module-Core paradigm...
Definition: synthbase.h:1600
Synthesizer filter module.
Definition: synthfilter.h:109
virtual bool doNoteOn(MIDINoteEvent &noteEvent) override
Calls the note-on handler for all cores.
Definition: synthfilter.cpp:119
std::shared_ptr< FilterParameters > parameters
Definition: synthfilter.h:132
virtual bool doNoteOff(MIDINoteEvent &noteEvent) override
Calls the note-off handler for all cores.
Definition: synthfilter.cpp:134
virtual ~SynthFilter()
Definition: synthfilter.h:118
hard-coded arrays of FIR filter coefficients for the sample rate conversion objects (Interpolator and...
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.
SynthFilter(std::shared_ptr< MidiInputData > _midiInputData, std::shared_ptr< FilterParameters > _parameters, uint32_t blockSize=64)
Constructs SynthFilter module.
Definition: synthfilter.cpp:28