The base class for all HISE modules in the signal path. More...
Classes | |
class | Iterator |
A iterator over all child processors. More... | |
Public Types | |
enum | InternalChains |
Overwrite this enum and list all internal chains. More... | |
enum | SpecialParameters |
Overwrite this enum and add new parameters. More... | |
Public Member Functions | |
virtual ProcessorEditorBody * | createEditor (ProcessorEditor *parentEditor)=0 |
Creates a ProcessorEditor for this Processor and returns the pointer. More... | |
void | enableConsoleOutput (bool shouldBeEnabled) |
Enables the Processor to output messages to the Console. More... | |
virtual ValueTree | exportAsValueTree () const override |
This saves the Processor. More... | |
virtual float | getAttribute (int parameterIndex) const =0 |
returns the attribute with the specified index (use a enum in the derived class). More... | |
virtual Processor * | getChildProcessor (int processorIndex)=0 |
This must be overriden by every Processor and return the Chain with the Chain index. More... | |
virtual Colour | getColour () const |
Overwrite this method if you want a special colour. More... | |
virtual float | getDefaultValue (int) const |
Overwrite this and return the default value. More... | |
bool | getEditorState (int state) const |
Restores the state of the Processor's editor. More... | |
const String & | getId () const |
Returns the unique id of the Processor instance (!= the Processor name). More... | |
virtual Identifier | getIdentifierForParameterIndex (int parameterIndex) const |
This returns a Identifier with the name of the parameter. More... | |
float | getInputValue () const |
This can be used to display the Processors input value. More... | |
int | getLargestBlockSize () const |
Returns the block size. More... | |
virtual const String | getName () const |
Overwrite this and return a pretty name. More... | |
virtual int | getNumChildProcessors () const =0 |
This must return the number of Child processors. More... | |
virtual int | getNumInternalChains () const |
If your processor uses internal chains, you can return the number here. More... | |
int | getNumParameters () const |
This returns the number of (named) parameters. More... | |
float | getOutputValue () const |
This can be used to display the Processors output value. More... | |
double | getSampleRate () const |
Returns the sample rate. More... | |
const Path | getSymbol () const |
Returns the symbol of the Processor. More... | |
virtual const Identifier | getType () const =0 |
Overwrite this method to specify the name. More... | |
int | getVoiceAmount () const noexcept |
getNumVoices() is occupied by the Synthesiser class, d'oh! | |
bool | isBypassed () const noexcept |
Returns true if the processor is bypassed. More... | |
virtual void | prepareToPlay (double sampleRate_, int samplesPerBlock_) |
Sets the sample rate and the block size. More... | |
Processor (MainController *m, const String &id_, int numVoices) | |
Creates a new Processor with the given Identifier. More... | |
void | restoreCompleteEditorState (const XmlElement *storedState) |
Restores the EditorState from a BigInteger that was retrieved using getCompleteEditorState. More... | |
virtual void | restoreFromValueTree (const ValueTree &previouslyExportedProcessorState) override |
Restores a previously saved ValueTree. More... | |
void | setAttribute (int parameterIndex, float newValue, juce::NotificationType notifyEditor) |
Changes a Processor parameter. More... | |
virtual void | setBypassed (bool shouldBeBypassed, NotificationType notifyChangeHandler=dontSendNotification) noexcept |
This bypasses the processor. More... | |
void | setEditorState (int state, bool isOn, NotificationType notifyView=sendNotification) |
Saves the state of the Processor's editor. More... | |
void | setIsOnAir (bool isBeingProcessedInAudioThread) |
Call this method after inserting the processor in the signal chain. More... | |
void | setSymbol (Path newSymbol) |
Sets a special symbol for the Processor. More... | |
virtual | ~Processor () |
Overwrite this if you need custom destruction behaviour. More... | |
Public Member Functions inherited from SafeChangeBroadcaster | |
void | addChangeListener (SafeChangeListener *listener) |
Registers a listener to receive change callbacks from this broadcaster. More... | |
void | removeAllChangeListeners () |
Removes all listeners from the list. More... | |
void | removeChangeListener (SafeChangeListener *listener) |
Unregisters a listener from the list. More... | |
void | sendAllocationFreeChangeMessage () |
This will send a message without allocating a message slot. More... | |
void | sendChangeMessage (const String &=String()) |
Causes an asynchronous change message to be sent to all the registered listeners. More... | |
void | sendSynchronousChangeMessage () |
Sends a synchronous change message to all the registered listeners. More... | |
Public Member Functions inherited from ControlledObject | |
ControlledObject (MainController *m) | |
Creates a new ControlledObject. More... | |
const MainController * | getMainController () const noexcept |
Provides read-only access to the main controller. More... | |
MainController * | getMainController () noexcept |
Provides write access to the main controller. More... | |
Protected Member Functions | |
virtual Path | getSpecialSymbol () const |
Overwrite this method if you want to supply a custom symbol for the Processor. More... | |
void | setInputValue (float newValue, NotificationType notify=sendNotification) |
Call this from the baseclass whenever you want its editor to display a input value change. More... | |
virtual void | setInternalAttribute (int parameterIndex, float newValue)=0 |
Changes a Processor parameter. More... | |
void | setOutputValue (float newValue) |
Call this from the baseclass whenever you want its editor to display a value change. More... | |
The base class for all HISE modules in the signal path.
Every object within HISE that processes audio or MIDI is derived from this base class to share the following features:
The general architecture of a HISE patch is a tree of Processor objects, all residing in a main container of the type ModulatorSynthChain (which can be obtained using getMainController()->getMainSynthChain()). There is a small helper class ProcessorHelpers, which contains some static methods for searching & checking the type of the Processor.
Normally, you would not derive from this class directly, but use some of its less generic subclasses (MidiProcessor, Modulator, EffectProcessor or ModulatorSynth). There are also some additional interface classes to extend the Processor class with specific features: Processor Interface Classes
enum InternalChains |
Overwrite this enum and list all internal chains.
This can be used to access them by index.
enum SpecialParameters |
Overwrite this enum and add new parameters.
This is used by the set- / getAttribute methods.
Processor | ( | MainController * | m, |
const String & | id_, | ||
int | numVoices | ||
) |
Creates a new Processor with the given Identifier.
|
virtual |
Overwrite this if you need custom destruction behaviour.
|
pure virtual |
Creates a ProcessorEditor for this Processor and returns the pointer.
If you subclass this, just allocate a ProcessorEditor of the desired type on the heap and return it. Remember to pass the Processor as parameter to allow asynchronous GUI notification. The concept between Processor and ProcessorEditor is the same as AudioProcessor and AudioProcessorEditor.
Implemented in AudioFileEnvelope, LfoModulator, PitchwheelModulator, MidiProcessor, and MacroModulator.
|
inline |
Enables the Processor to output messages to the Console.
This method itself does nothing, but you can use this to make a button or something else.
|
overridevirtual |
This saves the Processor.
It saves the ID, the bypassed state and the fold state. It also saves all child processors. You can overwrite this function and add more properties and their child processors but make sure you call the base class method.
For primitive values, you can use the macro saveAttribute(name, nameAsString):
You don't need to save the editor states, as the first 32 bits of EditorState is saved.
Implements RestorableObject.
|
pure virtual |
returns the attribute with the specified index (use a enum in the derived class).
Implemented in ArrayModulator, and ConstantModulator.
|
pure virtual |
This must be overriden by every Processor and return the Chain with the Chain index.
You can either:
Implemented in VoiceStartModulator, ModulatorChain, ModulatorSynthGroup, and MidiProcessor.
|
inlinevirtual |
Overwrite this method if you want a special colour.
This colour will be used in the debug console and in the editor.
|
inlinevirtual |
Overwrite this and return the default value.
|
inline |
|
inline |
|
virtual |
This returns a Identifier with the name of the parameter.
If you want to use this feature (this lets you access Parameters with the script, you should add the parameter name for each parameter in your subtype constructor.
|
inline |
This can be used to display the Processors input value.
|
inline |
Returns the block size.
|
inlinevirtual |
Overwrite this and return a pretty name.
If you don't overwrite it, the getType() method is used.
|
pure virtual |
This must return the number of Child processors.
If this Processor is a Chain, you can use it's getHandler()->getNumProcessor() method.
Implemented in ModulatorChain, Modulator, ModulatorSynthGroup, ModulatorSynthChain, and MidiProcessor.
|
inlinevirtual |
If your processor uses internal chains, you can return the number here.
This is used by the ProcessorEditor to make the chain button bar.
int getNumParameters | ( | ) | const |
This returns the number of (named) parameters.
|
inline |
This can be used to display the Processors output value.
|
inline |
Returns the sample rate.
|
inlineprotectedvirtual |
Overwrite this method if you want to supply a custom symbol for the Processor.
By default, it creates an empty Path, so you either have to set a custom Symbol using setSymbol(), or overwrite the getSpecialSymbol() method in a subclass.
|
inline |
Returns the symbol of the Processor.
It either checks if a special symbol is set for this particular Processor, or returns the default one defined in getSpecialSymbol()
|
pure virtual |
Overwrite this method to specify the name.
Use non-whitespace Strings (best practice is CamelCase). In most cases, this will be enough:
const String getType() const { return "ProcessorName";};
|
inlinenoexcept |
Returns true if the processor is bypassed.
For checking the bypass state of ModulatorSynths, better use isSoftBypassed().
|
inlinevirtual |
Sets the sample rate and the block size.
Reimplemented in ModulatorSynthGroup, ModulatorChain, ModulatorSynth, AudioFileEnvelope, LfoModulator, ModulatorSynthChain, PitchwheelModulator, MacroModulator, and EffectProcessor.
|
inline |
Restores the EditorState from a BigInteger that was retrieved using getCompleteEditorState.
|
overridevirtual |
Restores a previously saved ValueTree.
The value tree must be created with exportAsValueTree or it will be unpredictable. The child processors are created automatically (both for chains and processors with fixed internal chains, but you should overwrite this method if your Processor uses parameters.
There is a handy macro saveAttribute(name, nameAsString) for this purpose.
Implements RestorableObject.
Reimplemented in ModulatorSynthChain.
|
inline |
Changes a Processor parameter.
This can be used in the audio thread eg. by other Processors. Overwrite the method setInternalAttribute() to store the parameters in private member variables. If the Processor is polyphonic, the attributes must stay the same for different voices. In this case store a multiplicator for the attribute in a ProcessorState.
parameterIndex | the parameter index (use a enum from the derived class) |
newValue | the new value between 0.0 and 1.0 |
notifyEditor | if sendNotification, then a asynchronous message is sent. |
|
inlinevirtualnoexcept |
This bypasses the processor.
You don't have to check in the processors logic itself, normally the chain should do that for you.
|
inline |
|
inlineprotected |
Call this from the baseclass whenever you want its editor to display a input value change.
For most stuff a 0.0 ... 1.0 range is assumed.
|
protectedpure virtual |
Changes a Processor parameter.
Overwrite this method to do your handling. Call the overloaded method with the notification type parameter for external changes.
parameterIndex | the parameter index (use a enum from the derived class) |
newValue | the new value between 0.0 and 1.0 |
Implemented in TableEnvelope, ArrayModulator, and ConstantModulator.
void setIsOnAir | ( | bool | isBeingProcessedInAudioThread | ) |
Call this method after inserting the processor in the signal chain.
If you call prepareToPlay before calling this method, it won't lock which makes inserting new processors nicer.
|
inlineprotected |
Call this from the baseclass whenever you want its editor to display a value change.
|
inline |
Sets a special symbol for the Processor.
If this method is used, the getSymbol() method will return this Path instead of the default one defined in getSpecialSymbol();