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 // Alternatively, you may add a new "Include Path" to your compiler setup.
12 // **********************************************************************************
13 
14 #include "../../../../source/synthbase.h"
15 #include "../../../../source/synthfunctions.h"
16 #include "../../../../source/exciter.h"
17 #include "../../../../source/resonator.h"
18 
19 // -----------------------------
20 // SynthLab SDK File //
21 // for //
22 // DynamicModule //
23 // Development //
24 // ----------------------------
25 
33 // -----------------------------------------------------------------------------
34 namespace SynthLab
35 {
106  class SynthLabCore : public ModuleCore
107  {
108  public:
110  SynthLabCore(); /* C-TOR */
111 
113  virtual ~SynthLabCore() {} /* D-TOR */
114 
116  virtual bool reset(CoreProcData& processInfo) override;
117  virtual bool update(CoreProcData& processInfo) override;
118  virtual bool render(CoreProcData& processInfo) override;
119  virtual bool doNoteOn(CoreProcData& processInfo) override;
120  virtual bool doNoteOff(CoreProcData& processInfo) override;
121 
122  protected:
123  // --- local variables
124  double sampleRate = 0.0;
125  double midiPitch = 0.0;
126  double outputAmplitude = 1.0;
127  double panLeftGain = 0.707;
128  double panRightGain = 0.707;
129  uint32_t pluckPosition = 1;
130  double saturation = 1.0;
131 
134 
138 
141 
143  enum {kNylonGtr, kDistGtr, kBass, kSilent};
144  };
145 
146 } // namespace
147 
HighShelfFilter highShelfFilter
filter for adding bite to exciter
Definition: synthlabcore.h:135
SynthLabCore()
Construction: Cores follow the same construction pattern.
Definition: synthlabcore.cpp:29
double panRightGain
right channel gain
Definition: synthlabcore.h:130
Special purpose object for use as Karplus Strong resonator.
Definition: resonator.h:35
PluckPosFilter pluckPosFilter
for simulating pluck position with comb filter
Definition: synthlabcore.h:139
virtual bool doNoteOff(CoreProcData &processInfo) override
Note-off handler for the ModuleCore.
Definition: synthlabcore.cpp:135
Implementation of a high shelving filter.
Definition: synthbase.h:2594
Implements a simple 2nd order LPF.
Definition: synthbase.h:2266
Implementation of a constant-Q parametric EQ filter.
Definition: synthbase.h:2671
Definition: addosccore.cpp:4
Exciter exciter
exciter for KS model
Definition: synthlabcore.h:132
double saturation
for distortion control
Definition: synthlabcore.h:130
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
LP2Filter bassFilter
for bass guitar pickup simulation
Definition: synthlabcore.h:136
virtual bool render(CoreProcData &processInfo) override
Renders the output of the module.
Definition: synthlabcore.cpp:98
Resonator resonator
resonator for KS model
Definition: synthlabcore.h:133
Special purpose object for use as Karplus Strong exciter.
Definition: exciter.h:99
virtual bool doNoteOn(CoreProcData &processInfo) override
Note-on handler for the ModuleCore.
Definition: synthlabcore.cpp:116
double outputAmplitude
amplitude in dB
Definition: synthlabcore.h:128
double midiPitch
midi note pitch
Definition: synthlabcore.h:123
virtual bool reset(CoreProcData &processInfo) override
Resets object to initialized state.
Definition: synthlabcore.cpp:61
double panLeftGain
left channel gain
Definition: synthlabcore.h:129
virtual ~SynthLabCore()
Definition: synthlabcore.h:113
ParametricFilter bodyFilter
sinple parameteric filter for adding a resonant hump to th output
Definition: synthlabcore.h:140
uint32_t pluckPosition
position: 0 = at nut, 1 = at center of string
Definition: synthlabcore.h:129
This structure holds all of the information needed to call functions on a ModuleCore object...
Definition: synthbase.h:1071
LP2Filter distortionFilter
for soft clip distortion
Definition: synthlabcore.h:137
Comnination of three filters in one; note that the figure in the book does not show the variety of co...
Definition: synthbase.h:2862