|
| SynthVoice (std::shared_ptr< MidiInputData > _midiInputData, std::shared_ptr< MidiOutputData > _midiOutputData, std::shared_ptr< SynthVoiceParameters > _parameters, std::shared_ptr< WavetableDatabase > _wavetableDatabase, std::shared_ptr< PCMSampleDatabase > _sampleDatabase, uint32_t _blockSize=64) |
| This is a template file with a minimal implementation. More...
|
|
virtual | ~SynthVoice () |
| empty destructor
|
|
virtual bool | reset (double _sampleRate) |
| Reset all SynthModules on init or when sample rate changes. More...
|
|
virtual bool | update () |
| Update voice specific stuff. More...
|
|
virtual bool | render (SynthProcessInfo &synthProcessInfo) |
| Render a block of audio data for an active note event. More...
|
|
virtual bool | processMIDIEvent (midiEvent &event) |
| MIDI Event handler. More...
|
|
virtual bool | initialize (const char *dllPath=nullptr) |
| Initialize the voice sub-components; this really only applies to PCM oscillators that need DLL path BUT, DLL path is avaialble for all modules and may be used in clever ways. More...
|
|
virtual bool | doNoteOn (midiEvent &event) |
| Note-on handler for voice. More...
|
|
virtual bool | doNoteOff (midiEvent &event) |
| Note-off handler for voice. More...
|
|
bool | isVoiceActive () |
|
voiceState | getVoiceState () |
|
uint32_t | getTimestamp () |
| get current timestamp, the higher the value, the older the voice has been running
|
|
void | incrementTimestamp () |
| increment timestamp when a new note is triggered
|
|
void | clearTimestamp () |
| reset timestamp after voice is turned off
|
|
unsigned int | getMIDINoteNumber () |
| note is data byte 1, velocity is byte 2
|
|
unsigned int | getStealMIDINoteNumber () |
| note is data byte 1, velocity is byte 2
|
|
bool | voiceIsStealing () |
| trur if voice will be stolen
|
|
void | setAllCustomUpdateCodes () |
| one of many ways to keep track of what needs updating; this will likely be very dependent on your GUI system and plugin framework More...
|
|
| SynthVoice (std::shared_ptr< MidiInputData > _midiInputData, std::shared_ptr< MidiOutputData > _midiOutputData, std::shared_ptr< SynthVoiceParameters > _parameters, std::shared_ptr< WavetableDatabase > _wavetableDatabase, std::shared_ptr< PCMSampleDatabase > _sampleDatabase, uint32_t _blockSize=64) |
|
virtual | ~SynthVoice () |
| empty destructor
|
|
virtual bool | reset (double _sampleRate) |
|
virtual bool | update () |
|
virtual bool | render (SynthProcessInfo &synthProcessInfo) |
|
virtual bool | processMIDIEvent (midiEvent &event) |
|
virtual bool | initialize (const char *dllPath=nullptr) |
|
virtual bool | doNoteOn (midiEvent &event) |
|
virtual bool | doNoteOff (midiEvent &event) |
|
bool | isVoiceActive () |
|
voiceState | getVoiceState () |
|
uint32_t | getTimestamp () |
| get current timestamp, the higher the value, the older the voice has been running
|
|
void | incrementTimestamp () |
| increment timestamp when a new note is triggered
|
|
void | clearTimestamp () |
| reset timestamp after voice is turned off
|
|
uint32_t | getMIDINoteNumber () |
| note is data byte 1, velocity is byte 2
|
|
uint32_t | getStealMIDINoteNumber () |
| note is data byte 1, velocity is byte 2
|
|
bool | voiceIsStealing () |
| trur if voice will be stolen
|
|
std::vector< std::string > | getModuleCoreNames (uint32_t moduleType) |
| only for dynamic string loading More...
|
|
std::vector< std::string > | getModuleStrings (uint32_t mask, bool modKnobs) |
| only for dynamic string loading More...
|
|
void | setAllCustomUpdateCodes () |
| one of many ways to keep track of what needs updating; this will likely be very dependent on your GUI system and plugin framework
|
|
void | loadLFOCore (uint32_t lfoIndex, uint32_t index) |
| load a new LFO core More...
|
|
void | loadFilterCore (uint32_t filterIndex, uint32_t index) |
| load a new filter core More...
|
|
void | loadOscCore (uint32_t oscIndex, uint32_t index) |
| load a new oscillator core More...
|
|
void | loadEGCore (uint32_t egIndex, uint32_t index) |
| load a new EG core More...
|
|
void | setDynamicModules (std::vector< std::shared_ptr< SynthLab::ModuleCore >> modules) |
| add dynamically loaded DLL modules to existing cores More...
|
|
| SynthVoice (std::shared_ptr< MidiInputData > _midiInputData, std::shared_ptr< MidiOutputData > _midiOutputData, std::shared_ptr< SynthVoiceParameters > _parameters, std::shared_ptr< WavetableDatabase > _wavetableDatabase, std::shared_ptr< PCMSampleDatabase > _sampleDatabase, uint32_t _blockSize=64) |
|
virtual | ~SynthVoice () |
| empty destructor
|
|
virtual bool | reset (double _sampleRate) |
|
virtual bool | update () |
|
virtual bool | render (SynthProcessInfo &synthProcessInfo) |
|
virtual bool | processMIDIEvent (midiEvent &event) |
|
virtual bool | initialize (const char *dllPath=nullptr) |
|
virtual bool | doNoteOn (midiEvent &event) |
|
virtual bool | doNoteOff (midiEvent &event) |
|
bool | isVoiceActive () |
|
voiceState | getVoiceState () |
|
uint32_t | getTimestamp () |
| get current timestamp, the higher the value, the older the voice has been running
|
|
void | incrementTimestamp () |
| increment timestamp when a new note is triggered
|
|
void | clearTimestamp () |
| reset timestamp after voice is turned off
|
|
unsigned int | getMIDINoteNumber () |
| note is data byte 1, velocity is byte 2
|
|
unsigned int | getStealMIDINoteNumber () |
| note is data byte 1, velocity is byte 2
|
|
bool | voiceIsStealing () |
| trur if voice will be stolen
|
|
|
void | accumulateToMixBuffer (std::shared_ptr< AudioBuffer > oscBuffers, uint32_t samplesInBlock, double scaling) |
| accumulating voice audio data More...
|
|
void | writeToMixBuffer (std::shared_ptr< AudioBuffer > oscBuffers, uint32_t samplesInBlock, double scaling) |
| write to final mix buffer More...
|
|
void | accumulateToMixBuffer (std::shared_ptr< AudioBuffer > oscBuffers, uint32_t samplesInBlock, double scaling) |
| accumulating voice audio data
|
|
void | writeToMixBuffer (std::shared_ptr< AudioBuffer > oscBuffers, uint32_t samplesInBlock, double scaling=1.0) |
| write to final mix buffer
|
|
void | removeMixBufferDC (uint32_t blockSize) |
|
void | accumulateToMixBuffer (std::shared_ptr< AudioBuffer > oscBuffers, uint32_t samplesInBlock, double scaling) |
| accumulating voice audio data
|
|
void | writeToMixBuffer (std::shared_ptr< AudioBuffer > oscBuffers, uint32_t samplesInBlock, double scaling) |
| write to final mix buffer
|
|
This is the voice object for a software synth.
The voice performs three tasks during the synth’s operation:
- initialization
- responding to MIDI note-on and note-off messages
- controlling the audio signal flow through a set of member objects called modules.
The voice object’s central responsibility is maintaining this set of SynthModule objects that make up the synthesizer components such as oscillators and filters. I designed the SynthVoice object to expose simple functions that service these three areas of operation. The voice object also processes incoming MIDI data for note-on and note-off events, which it uses to control its set of modules.
- Initialization: the voice calls the module’s reset function
- Note-on and Note-off: the voice calls the doNoteOn and doNoteOff methods on its set of modules
- Controlling Audio Signal Flow: the voice calls the module’s update and render functions during each block processing cycle, and delivers the rendered audio back to the engine
Base Class: None
- This object has no base class. It may be used as a base class for your own implementaitons, so several functions are declared as virtual.
GUI Parameters: SynthVoiceParameters
- getParameters() function allows direct access to std::shared_ptr<SynthVoiceParameters>
std::shared_ptr<SynthVoiceParameters> getParameters()
- call the getParameters() function
- set the parameters in the SynthVoiceParameters structure with new values, typically from a GUI
- the parameters will be applied to the underlying module during the render cycle.
Construction:
(1) For use within a synth project, the constructor is specialized to use shared recources for:
The owning object (SynthEngine for the SynthLab projects) must pass these valid pointers to the object at construction time. Typically the engine will be the primary synthesizers of these resources. See the 2nd Edition Synth Book for more information.
(2) Standalone:
To use in standalone mode, call the constructor with the shared resoure pointers as null:
SynthVoice(nullptr, nullptr, nullptr, nullptr, nullptr, 64);
In standalone mode, the object creates and maintains these resources:
- SynthVoiceParameters: in standalone mode only, these are synthesized locally on the object, and then the owning object may obtain a shared pointer to them to read/write the parameters directly.
Render:
- Author
- Will Pirkle http://www.willpirkle.com
- Version
- Revision : 1.0
- Date
- Date : 2021 / 04 / 26