All Classes Namespaces Functions Variables Enumerations Enumerator Modules Pages
Public Member Functions | List of all members
Modulator Class Referenceabstract
Inheritance diagram for Modulator:
Processor SafeChangeBroadcaster RestorableObject ControlledObject EnvelopeModulator TimeVariantModulator VoiceStartModulator AhdsrEnvelope ModulatorChain SimpleEnvelope TableEnvelope AudioFileEnvelope ControlModulator LfoModulator MacroModulator PitchwheelModulator ArrayModulator ConstantModulator KeyModulator RandomModulator VelocityModulator

Public Member Functions

 Modulator (MainController *m, const String &id)
 
virtual void handleHiseEvent (const HiseEvent &)=0
 
virtual int getNumChildProcessors () const override
 
virtual void setColour (Colour c)
 
void setPlotter (Plotter *targetPlotter)
 
void addValueToPlotter (float v) const
 
- Public Member Functions inherited from Processor
 Processor (MainController *m, const String &id_)
 
virtual ~Processor ()
 
virtual ProcessorEditorBodycreateEditor (ProcessorEditor *parentEditor)=0
 
virtual ValueTree exportAsValueTree () const override
 
virtual void restoreFromValueTree (const ValueTree &previouslyExportedProcessorState) override
 
virtual const Identifier getType () const =0
 
const Path getSymbol () const
 
void setSymbol (Path newSymbol)
 
void setAttribute (int parameterIndex, float newValue, juce::NotificationType notifyEditor)
 
virtual float getAttribute (int parameterIndex) const =0
 
virtual float getDefaultValue (int) const
 
virtual ProcessorgetChildProcessor (int processorIndex)=0
 
virtual int getNumInternalChains () const
 
void enableConsoleOutput (bool shouldBeEnabled)
 
const String & getId () const
 
virtual const String getName () const
 
virtual void setBypassed (bool shouldBeBypassed, NotificationType notifyChangeHandler=dontSendNotification) noexcept
 
bool isBypassed () const noexcept
 
virtual void prepareToPlay (double sampleRate_, int samplesPerBlock_)
 
double getSampleRate () const
 
int getBlockSize () const
 
float getOutputValue () const
 
float getInputValue () const
 
void setEditorState (int state, bool isOn, NotificationType notifyView=sendNotification)
 
bool getEditorState (int state) const
 
void restoreCompleteEditorState (const XmlElement *storedState)
 
const Identifier getIdentifierForParameterIndex (int parameterIndex) const
 
int getNumParameters () const
 
void setIsOnAir (bool isBeingProcessedInAudioThread)
 
const CriticalSection & getDummyLockWhenNotOnAir () const
 
- Public Member Functions inherited from SafeChangeBroadcaster
void sendSynchronousChangeMessage ()
 
void addChangeListener (SafeChangeListener *listener)
 
void removeChangeListener (SafeChangeListener *listener)
 
void removeAllChangeListeners ()
 
void sendChangeMessage (const String &=String())
 
void sendAllocationFreeChangeMessage ()
 
- Public Member Functions inherited from ControlledObject
 ControlledObject (MainController *m)
 
const MainControllergetMainController () const noexcept
 
MainControllergetMainController () noexcept
 

Additional Inherited Members

- Public Types inherited from Processor
enum  SpecialParameters
 
enum  InternalChains
 
- Protected Member Functions inherited from Processor
virtual Path getSpecialSymbol () const
 
void setOutputValue (float newValue)
 
void setInputValue (float newValue, NotificationType notify=sendNotification)
 
virtual void setInternalAttribute (int parameterIndex, float newValue)=0
 

Detailed Description

A modulator is a module that encapsulates modulation behaviour and returns a float value between 0.0 and 1.0.

A Modulator should be always inside a ModulatorChain, which handles the processing according to the characteristics of each Modulator.

In order to create a modulator, subclass one of the two subclasses, VoiceStartModulator or TimeVariantModulator (never subclass this directly), and overwrite the following methods:

const String getType () const;
ModulatorEditor *createEditor();
float calculateVoiceStartValue(const MidiMessage &messageThatStartedVoice);
XmlElement *getDescription () const;
float getAttribute (int parameter_index) const;
void setAttribute (int parameter_index, float newValue);
float getDisplayValue() const;

There are two handy features to debug a modulator: If plotThisModulator() is set to true, the Modulator will print its output on a popup plotter.

See also
ModulatorChain, ModulatorEditor

Constructor & Destructor Documentation

Modulator ( MainController m,
const String &  id 
)

Creates a new modulator with the given Identifier.

Member Function Documentation

void addValueToPlotter ( float  v) const

Adds a value to the plotter. It is okay to do this on a sample level, the Plotter automatically interpolates it.

virtual int getNumChildProcessors ( ) const
inlineoverridevirtual

Normally a Modulator has no child processors, you can overwrite it if you use internal chains.

Implements Processor.

Reimplemented in ModulatorChain.

virtual void handleHiseEvent ( const HiseEvent )
pure virtual

If the modulator uses Midi events, you can specify the behaviour here.

This is likely to be used with midi messages that do not trigger a voice start like cc-messages. For the handling of note-on messages better use the calculateVoiceStartValue() method instead.

Implemented in VoiceStartModulator, AudioFileEnvelope, LfoModulator, ModulatorChain, PitchwheelModulator, TableEnvelope, MacroModulator, and ControlModulator.

void setColour ( Colour  c)
virtual

Sets the colour of the modulator.

void setPlotter ( Plotter targetPlotter)

enables the plotting of time variant modulators in the plotter popup.

If a valid Plotter object is set, the modulator sends his results to the plotter.

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