SynthLab SDK
synthlabcore.h
1 #pragma once
2 
3 #include "synthbase.h"
4 #include "synthfunctions.h"
5 
6 namespace SynthLab
7 {
8 
9  class SynthLabCore : public ModuleCore
10  {
11  public:
12  // --- constructor/destructor
13  SynthLabCore(); /* C-TOR */
14  virtual ~SynthLabCore() {} /* D-TOR */
15 
16  virtual bool reset(CoreProcData& processInfo);
17  virtual bool update(CoreProcData& processInfo);
18  virtual bool render(CoreProcData& processInfo);
19  virtual bool doNoteOn(CoreProcData& processInfo);
20  virtual bool doNoteOff(CoreProcData& processInfo);
21 
22  void flushDelays()
23  {
24  for (uint32_t i = 0; i < STEREO_CHANNELS; i++)
25  filter[i].flushDelays();
26  }
27 
28  protected:
29  BQAudioFilter filter[STEREO_CHANNELS];
30  enum { a0, a1, a2, b1, b2, c0, d0 };
31  double sampleRate = 1.0;
32  double outputAmp = 1.0;
33 
34  // --- for key track
35  double midiPitch = 440.0;
36  };
37 
38 
39 
40 } // namespace
41 
SynthLabCore()
Construction: Cores follow the same construction pattern.
Definition: synthlabcore.cpp:29
virtual bool doNoteOff(CoreProcData &processInfo) override
Note-off handler for the ModuleCore.
Definition: synthlabcore.cpp:135
Definition: synthengine.cpp:16
virtual bool update(CoreProcData &processInfo) override
Updates the object for the next block of audio processing.
Definition: synthlabcore.cpp:79
double sampleRate
sample rate
Definition: synthlabcore.h:108
virtual bool render(CoreProcData &processInfo) override
Renders the output of the module.
Definition: synthlabcore.cpp:98
virtual bool doNoteOn(CoreProcData &processInfo) override
Note-on handler for the ModuleCore.
Definition: synthlabcore.cpp:116
double midiPitch
the midi pitch
Definition: synthlabcore.h:35
virtual bool reset(CoreProcData &processInfo) override
Resets object to initialized state.
Definition: synthlabcore.cpp:61