Public Types | Public Member Functions | List of all members
Modulation Class Referenceabstract

This is the base class for all modulation behaviour. More...

Inheritance diagram for Modulation:
TimeModulation VoiceModulation EnvelopeModulator TimeVariantModulator EnvelopeModulator VoiceStartModulator AhdsrEnvelope ModulatorChain MonophonicEnvelope MPEModulator SimpleEnvelope TableEnvelope AudioFileEnvelope ControlModulator GlobalTimeVariantModulator LfoModulator MacroModulator PitchwheelModulator AhdsrEnvelope ModulatorChain MonophonicEnvelope MPEModulator SimpleEnvelope TableEnvelope ArrayModulator ConstantModulator GlobalStaticTimeVariantModulator GlobalVoiceStartModulator KeyModulator RandomModulator VelocityModulator

Public Types

enum  Mode { GainMode = 0, PitchMode, PanMode }
 There are two modes that Modulation can work: GainMode and PitchMode. More...
 

Public Member Functions

void applyModulationValue (float calculatedModulationValue, float &destinationValue) const noexcept
 This applies the previously calculated value to the supplied destination value depending on the modulation mode (adding or multiplying). More...
 
float calcIntensityValue (float calculatedModulationValue) const noexcept
 This applies the intensity to the given value and returns the applied value. More...
 
float getDisplayIntensity () const noexcept
 Returns the actual intensity of the Modulation. More...
 
float getIntensity () const noexcept
 Returns the intensity. More...
 
Mode getMode () const noexcept
 returns the mode the Modulator is operating. More...
 
void setIntensity (float newIntensity) noexcept
 Sets the intensity of the modulation. More...
 
void setIntensityFromSlider (float sliderValue) noexcept
 Use this method to set the intensity from the ModulatorEditorHeader's intensity slider converting linear -12 ... More...
 

Detailed Description

This is the base class for all modulation behaviour.

Member Enumeration Documentation

enum Mode

There are two modes that Modulation can work: GainMode and PitchMode.

Enumerator
GainMode 

The supplied buffer is multiplied with the modulation value (like a gain effect).

PitchMode 

The modulation value is added to the supplied buffer, which is assumed to be used as temporary storage for pitch modulation.

The range is supposed to be -1.0 ... 1.0 and must be converted using convertToFreqRatio directly before using it.

PanMode 

Range is -1.0 ...

1.0

Member Function Documentation

void applyModulationValue ( float  calculatedModulationValue,
float &  destinationValue 
) const
noexcept

This applies the previously calculated value to the supplied destination value depending on the modulation mode (adding or multiplying).

float calcIntensityValue ( float  calculatedModulationValue) const
noexcept

This applies the intensity to the given value and returns the applied value.

  • In GainMode the input is supposed to be between 0.0 and 1.0. The output will be between 0.0 and 1.0 (and 1.0 if the intensity is 0.0)
  • in PitchMode the input is supposed to be between 0.0 and 1.0. The output will be between -1.0 and 1.0 (and 0.0 if the intensity is 0.0)
float getDisplayIntensity ( ) const
noexcept

Returns the actual intensity of the Modulation.

Use this for GUI displays, since getIntensity() could be overwritten and behave funky.

float getIntensity ( ) const
noexcept

Returns the intensity.

This is used by the modulator chain to either multiply or add the outcome of the Modulation.

You can subclass this method if you modulate the intensity. In this case, don't change the intensity directly (or you can't change it in the GUI anymore), but save the modulation value elsewhere and return the product:

virtual float getIntensity() const
{
    return intensityModulation * Modulator::getIntensity();
};
Mode getMode ( ) const
inlinenoexcept

returns the mode the Modulator is operating.

void setIntensity ( float  newIntensity)
noexcept

Sets the intensity of the modulation.

The intensity is multiplied with the outcome or added depending on the TargetMode of the owner ModulatorChain.

In GainMode, the Intensity is between 0.0 and 1.0. In PitchMode, the Intensity can be between 0.5 and 2.0.

void setIntensityFromSlider ( float  sliderValue)
noexcept

Use this method to set the intensity from the ModulatorEditorHeader's intensity slider converting linear -12 ...

12 to log 0.5 ... 2.

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