All Classes Namespaces Functions Variables Enumerations Enumerator Modules Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ModulatorSynthVoice Class Referenceabstract
Inheritance diagram for ModulatorSynthVoice:
ModulatorSamplerVoice ModulatorSynthGroupVoice MultiMicModulatorSamplerVoice

Public Member Functions

virtual void renderNextBlock (AudioSampleBuffer &outputBuffer, int startSample, int numSamples) override
virtual bool canPlaySound (SynthesiserSound *s) override
virtual void startNote (int, float, SynthesiserSound *, int)
virtual void stopNote (float velocity, bool allowTailOff) override
void killVoice ()
virtual void checkRelease ()

Protected Member Functions

const ModulatorSynthgetOwnerSynth () const noexcept

Protected Attributes

double uptimeDelta = 0.0
double voiceUptime

Detailed Description

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.

Member Function Documentation

virtual bool canPlaySound ( SynthesiserSound *  s)

This only checks if the sound is valid, but you can override this with the desired behaviour.

void checkRelease ( )

This checks the envelopes of the gain modulation if any envelopes are tailing off.

const ModulatorSynth* getOwnerSynth ( ) const

Returns the ModulatorSynth instance that this voice belongs to.

You need this to get the information needed for the processing of the Modulators.

void killVoice ( )

This kills the note with a short fade time.

void renderNextBlock ( AudioSampleBuffer &  outputBuffer,
int  startSample,
int  numSamples 

If not overriden, this uses a sine generator for an example usage of this voice class.

virtual void startNote ( int  ,
float  ,
SynthesiserSound *  ,

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.

void stopNote ( float  velocity,
bool  allowTailOff 

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.

Member Data Documentation

double uptimeDelta = 0.0

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.

double voiceUptime

The total voice uptime. If you want to stop the rendering, set this to 0.0.

©2017 HISE. This documentation is autogenerated from the HISE source code using Doxygen.