This voice calculates the ModulatorChains of the ModulatorSynth it belongs to. More...
Public Member Functions | |
virtual bool | canPlaySound (SynthesiserSound *s) override |
This only checks if the sound is valid, but you can override this with the desired behaviour. More... | |
virtual void | checkRelease () |
This checks the envelopes of the gain modulation if any envelopes are tailing off. More... | |
void | killVoice () |
This kills the note with a short fade time. More... | |
virtual void | renderNextBlock (AudioSampleBuffer &outputBuffer, int startSample, int numSamples) override |
If not overriden, this uses a sine generator for an example usage of this voice class. More... | |
virtual void | startNote (int, float, SynthesiserSound *, int) |
This calculates the angle delta. More... | |
virtual void | stopNote (float velocity, bool allowTailOff) override |
This handles the voice stop. More... | |
Protected Member Functions | |
const ModulatorSynth * | getOwnerSynth () const noexcept |
Returns the ModulatorSynth instance that this voice belongs to. More... | |
Protected Attributes | |
double | uptimeDelta = 0.0 |
The current delta value in which the uptime gets increased per calculated sample. More... | |
double | voiceUptime |
The total voice uptime. More... | |
This voice calculates the ModulatorChains of the ModulatorSynth it belongs to.
Since the pitch information and the gain information is processed differently for each voice type, you need this base class to get the data calculated by the owner ModulatorSynth. This class isn't purely virtual as the base class SynthesiserVoice is. Instead, it acts as sine generator. Just copy the behaviour in the subclass and do what you like.
|
inlineoverridevirtual |
This only checks if the sound is valid, but you can override this with the desired behaviour.
|
virtual |
This checks the envelopes of the gain modulation if any envelopes are tailing off.
|
inlineprotectednoexcept |
Returns the ModulatorSynth instance that this voice belongs to.
You need this to get the information needed for the processing of the Modulators.
|
inline |
This kills the note with a short fade time.
|
overridevirtual |
If not overriden, this uses a sine generator for an example usage of this voice class.
|
inlinevirtual |
This calculates the angle delta.
For this synth, it detects the sine frequency, but you can override it to make something else.
Reimplemented in ModulatorSynthGroupVoice.
|
overridevirtual |
This handles the voice stop.
If any envelopes are active, the voice keeps playing and repeatedly call checkRelease(), until they are finished.
Reimplemented in ModulatorSynthGroupVoice.
|
protected |
The current delta value in which the uptime gets increased per calculated sample.
The unit can change from Synth to synth (eg. angle vs. sample position ), so it must be calculated for each subclass in its startNote function.
|
protected |
The total voice uptime.
If you want to stop the rendering, set this to 0.0.