SynthLab SDK
vaocore.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 {
83  class VAOCore : public ModuleCore
84  {
85  public:
87  VAOCore(); /* C-TOR */
88 
90  virtual ~VAOCore() {} /* D-TOR */
91 
93  virtual bool reset(CoreProcData& processInfo) override;
94  virtual bool update(CoreProcData& processInfo) override;
95  virtual bool render(CoreProcData& processInfo) override;
96  virtual bool doNoteOn(CoreProcData& processInfo) override;
97  virtual bool doNoteOff(CoreProcData& processInfo) override;
98 
100  double renderSawtoothSample(SynthClock& clock, bool advanceClock = true);
101  double renderSquareSample(SynthClock& clock, double& sawtoothSample);
102 
103  protected:
104  // --- basic variables
105  double sampleRate = 0.0;
106  double midiPitch = 0.0;
107  double outputAmplitude = 1.0;
108  double panLeftGain = 0.707;
109  double panRightGain = 0.707;
110  double pulseWidth = 0.5;
111 
112  // --- timebase
114  };
115 
116 } // namespace
117 
double pulseWidth
[0.5, 0.95] for square wave only
Definition: vaocore.h:110
Virtual Analog oscillator implementation.
Definition: vaocore.h:83
Compact modulo counter with wrapping used as the timebase for all oscillators.
Definition: synthbase.h:137
virtual bool doNoteOn(CoreProcData &processInfo) override
Note-on handler for the ModuleCore.
Definition: vaocore.cpp:330
virtual bool doNoteOff(CoreProcData &processInfo) override
Note-off handler for the ModuleCore.
Definition: vaocore.cpp:369
VAOCore()
Construction: Cores follow the same construction pattern.
Definition: vaocore.cpp:31
virtual bool render(CoreProcData &processInfo) override
Renders the output of the module.
Definition: vaocore.cpp:273
Definition: addosccore.cpp:4
double panRightGain
right channel gain
Definition: vaocore.h:109
double outputAmplitude
amplitude in dB
Definition: vaocore.h:107
double midiPitch
the midi pitch
Definition: vaocore.h:106
virtual ~VAOCore()
Definition: vaocore.h:90
virtual bool reset(CoreProcData &processInfo) override
Resets object to initialized state.
Definition: vaocore.cpp:67
virtual bool update(CoreProcData &processInfo) override
Updates the object for the next block of audio processing.
Definition: vaocore.cpp:101
double panLeftGain
left channel gain
Definition: vaocore.h:108
double renderSawtoothSample(SynthClock &clock, bool advanceClock=true)
BLEP sawtooth.
Definition: vaocore.cpp:180
double renderSquareSample(SynthClock &clock, double &sawtoothSample)
sum of saws method
Definition: vaocore.cpp:227
SynthClock oscClock
timebase
Definition: vaocore.h:113
hard-coded arrays of FIR filter coefficients for the sample rate conversion objects (Interpolator and...
This structure holds all of the information needed to call functions on a ModuleCore object...
Definition: synthbase.h:1071
double sampleRate
sample rate
Definition: vaocore.h:105
Abstract base class that encapsulates functionality of a module core; used with the Module-Core parad...
Definition: synthbase.h:1516
See also Designing Software Synthesizers in C++ 2nd Ed. by Will Pirkle.