SynthLab SDK
SynthModule Without Cores

If you can write a ModuleCore then writing a SynthModule without cores is very nearly identical. The only differences are in the function arguments for the 5 operational phase methods. Take a look at the difference here where the ModuleCore functions are listed first followed by the same named functions in SynthModule:

// --- ModuleCore Overrides
virtual bool reset(CoreProcData& processInfo) override;
virtual bool update(CoreProcData& processInfo) override;
virtual bool render(CoreProcData& processInfo) override;
virtual bool doNoteOn(CoreProcData& processInfo) override;
virtual bool doNoteOff(CoreProcData& processInfo) override;
// --- SynthModule Overrides
virtual bool reset(double _sampleRate) override;
virtual bool update() override;
virtual bool render(uint32_t samplesToProcess = 1) override;
virtual bool doNoteOn(MIDINoteEvent& noteEvent) override;
virtual bool doNoteOff(MIDINoteEvent& noteEvent) override;
// ---

Empty SynthModule Template

The SDK contains a pair of source files for an empty SynthModule that is a core container object in the files synthmodule_nocores.h and synthmodule_nocores.cpp. Use this as a starting point for your own modules that contain cores. It's constructor is setup to accept a ficitious shared SynthModuleNoCores parameter structure and you will need to change that for your particular object. You may also need to add an argument to the constructor if:

  1. you are implementing a wavetable synth, where you will want to add the wavetable database interface pointer like this (note also the change of the parameter structure type):
  2. you are implementing a PCM Sample synth, where you will want to add the PCMSample database interface pointer like this (note also the change of the parameter structure type):
// --- synth module with wavetable database
SynthModuleNoCores(std::shared_ptr<MidiInputData> _midiInputData,
std::shared_ptr<WTOscParameters> _parameters,
std::shared_ptr<WavetableDatabase> _waveTableDatabase,
uint32_t blockSize = 64);
//
// --- synth module with PCM database
SynthModuleNoCores(std::shared_ptr<MidiInputData> _midiInputData,
std::shared_ptr<PCMOscParameters> _parameters,
std::shared_ptr<PCMSampleDatabase> _sampleDatabase,
uint32_t blockSize = 64);
//

In the next section we will go through the template code and learn how to convert it into a filter module without cores. This will add the third kind of module to your toolkit - a processor that accepts an audio input and processes it into an output one block at a time.


synthlab_4.png