SynthLab SDK
synthlabcore.h
1 #pragma once
2 
3 // *** NOTE: relative paths to SDK files ********************************************
4 // these are setup so that ModuleCore DM projects are compiled directly
5 // from the SDK itself with minimal effort
6 //
7 // You may want to adjust these to suit your particular development folder
8 // system if you only want to use parts of the SDK or plan on modifying
9 // SDK files, or need to alter the folder hierarchy for your setup.
10 //
11 // Another option is to add a new "Include Path" to your compiler project
12 // that points to the ../../../../source folder
13 // **********************************************************************************
14 #include "../../../../source/synthbase.h"
15 #include "../../../../source/synthfunctions.h"
16 
17 
18 // -----------------------------
19 // SynthLab SDK File //
20 // for //
21 // DynamicModule //
22 // Development //
23 // ----------------------------
31 // -----------------------------------------------------------------------------
32 namespace SynthLab
33 {
95  class SynthLabCore : public ModuleCore
96  {
97  public:
99  SynthLabCore(); /* C-TOR */
100 
102  virtual ~SynthLabCore() {} /* D-TOR */
103 
105  virtual bool reset(CoreProcData& processInfo) override;
106  virtual bool update(CoreProcData& processInfo) override;
107  virtual bool render(CoreProcData& processInfo) override;
108  virtual bool doNoteOn(CoreProcData& processInfo) override;
109  virtual bool doNoteOff(CoreProcData& processInfo) override;
110 
112  void flushDelays()
113  {
114  for (uint32_t i = 0; i < STEREO_CHANNELS; i++)
115  filter[i].flushDelays();
116  }
117 
118  protected:
119  BQAudioFilter filter[STEREO_CHANNELS];
120  enum { a0, a1, a2, b1, b2, c0, d0 };
121  double sampleRate = 1.0;
122  double outputAmp = 1.0;
123  double midiPitch = 440.0;
124  };
125 
126 
127 
128 } // namespace
129 
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
Simple version of the AudioFilter object from Designing Audio Effects Plugins in C++ 2nd Ed...
Definition: synthbase.h:1954
Definition: addosccore.cpp:4
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
midi note pitch
Definition: synthlabcore.h:123
virtual bool reset(CoreProcData &processInfo) override
Resets object to initialized state.
Definition: synthlabcore.cpp:61
virtual ~SynthLabCore()
Definition: synthlabcore.h:102
BQAudioFilter filter[STEREO_CHANNELS]
biquad audio filter objects
Definition: synthlabcore.h:119
void flushDelays()
Definition: synthlabcore.h:112
This structure holds all of the information needed to call functions on a ModuleCore object...
Definition: synthbase.h:1071
double outputAmp
output scaling
Definition: synthlabcore.h:122