SynthLab SDK
synthlabcore.h
1 #pragma once
2 
3 #include "synthbase.h"
4 #include "synthfunctions.h"
5 #include "sinetablesource.h"
6 #include "dynamictablesource.h"
7 
8 namespace SynthLab
9 {
10 
11  class SynthLabCore : public ModuleCore
12  {
13  public:
15  SynthLabCore(); /* C-TOR */
16 
18  virtual ~SynthLabCore() {} /* D-TOR */
19 
21  virtual bool reset(CoreProcData& processInfo) override;
22  virtual bool update(CoreProcData& processInfo) override;
23  virtual bool render(CoreProcData& processInfo) override;
24  virtual bool doNoteOn(CoreProcData& processInfo) override;
25  virtual bool doNoteOff(CoreProcData& processInfo) override;
26 
27  protected:
28  // --- basic variables
29  double sampleRate = 0.0;
30  double currentTableRate = 0.0;
31  double midiPitch = 0.0;
32  double outputAmplitude = 1.0;
33  double panLeftGain = 0.707;
34  double panRightGain = 0.707;
35  double hardSyncRatio = 1.0;
36 
37  // --- timebase
39 
40  // --- local variables
41  double harmonic2Amp = 1.0; // converted from dB
42  };
43 
44 } // namespace
45 
virtual bool render(CoreProcData &processInfo)
Renders the output of the module.
Definition: synthlabcore.cpp:164
virtual bool reset(CoreProcData &processInfo)
Resets object to initialized state.
Definition: synthlabcore.cpp:29
SynthLabCore()
Construction: Cores follow the same construction pattern.
Definition: synthlabcore.cpp:7
Compact modulo counter with wrapping used as the timebase for all oscillators.
Definition: synthbase.h:335
double panRightGain
right channel gain
Definition: synthlabcore.h:41
virtual bool update(CoreProcData &processInfo)
Updates the object for the next block of audio processing.
Definition: synthlabcore.cpp:41
double currentTableRate
sample rate
Definition: synthlabcore.h:37
virtual bool doNoteOn(CoreProcData &processInfo)
Note-on handler for the ModuleCore.
Definition: synthlabcore.cpp:202
Definition: synthlabcore.cpp:4
SynthClock oscClock
timebase
Definition: synthlabcore.h:45
double sampleRate
sample rate
Definition: synthlabcore.h:31
double hardSyncRatio
for hard sync
Definition: synthlabcore.h:42
virtual bool doNoteOff(CoreProcData &processInfo)
Note-off handler for the ModuleCore.
Definition: synthlabcore.cpp:212
double outputAmplitude
amplitude in dB
Definition: synthlabcore.h:39
double midiPitch
the midi pitch
Definition: synthlabcore.h:35
double panLeftGain
left channel gain
Definition: synthlabcore.h:40
virtual ~SynthLabCore()
Definition: synthlabcore.h:18
This structure holds all of the information needed to call functions on a ModuleCore object...
Definition: synthbase.h:1233