TracktionEngine
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
engine::ImpulseResponsePlugin Class Reference

ImpulseResponsePlugin that loads an impulse response and applies it the audio stream. More...

#include <tracktion_ImpulseResponsePlugin.h>

Inheritance diagram for engine::ImpulseResponsePlugin:

Public Member Functions

 ImpulseResponsePlugin (PluginCreationInfo)
 Creates an ImpulseResponsePlugin.
 
 ~ImpulseResponsePlugin () override
 Destructor.
 
bool loadImpulseResponse (const void *sourceData, size_t sourceDataSize)
 Loads an impulse from binary audio file data i.e.
 
bool loadImpulseResponse (const juce::File &fileImpulseResponse)
 Loads an impulse from a file.
 
bool loadImpulseResponse (juce::AudioBuffer< float > &&bufferImpulseResponse, double sampleRateToStore, int bitDepthToStore)
 Loads an impulse from an AudioBuffer<float>.
 
juce::String getName () const override
 
juce::String getShortName (int) override
 
juce::String getPluginType () override
 
juce::String getSelectableDescription () override
 
BusLayout getBusses () const override
 
double getLatencySeconds () override
 
void initialise (const PluginInitialisationInfo &) override
 
void deinitialise () override
 
void reset () override
 
void applyToBuffer (const PluginRenderContext &) override
 
void restorePluginStateFromValueTree (const juce::ValueTree &) override
 
- Public Member Functions inherited from engine::Plugin
 Plugin (PluginCreationInfo)
 
 ~Plugin () override
 
void selectableAboutToBeDeleted () override
 Called just before the selectable is about to be deleted so any subclasses should still be valid at this point.
 
void playStartedOrStopped ()
 called by the system to let the plugin manage its automation stuff
 
virtual void initialiseFully ()
 Gives the plugin a chance to do extra initialisation when it's been added to an edit.
 
virtual void flushPluginStateToValueTree () override
 
virtual juce::String getVendor ()
 Returns the plugin vendor/manufacturer name.
 
juce::String getDisplayName () const
 Returns the custom name if set, otherwise the built-in getName().
 
juce::String getCustomName () const
 Returns the raw custom name (may be empty).
 
void setCustomName (const juce::String &)
 Sets a custom display name.
 
virtual juce::String getIdentifierString ()
 A unique string to identify a plugin independent of install location.
 
virtual juce::String getTooltip ()
 Returns a tooltip string for UI display.
 
virtual void setEnabled (bool)
 Enable/disable the plugin.
 
bool isEnabled () const noexcept
 
void setFrozen (bool shouldBeFrozen)
 Freezing is stronger than disabling – a frozen plugin cannot be interacted with at all.
 
bool isFrozen () const noexcept
 
void setProcessingEnabled (bool p)
 Enable/disable processing.
 
bool isProcessingEnabled () const noexcept
 
virtual void initialiseWithoutStopping (const PluginInitialisationInfo &)
 Tells the plugin that the audio graph has changed but the plugin isn't being re-initialised - i.e.
 
virtual void trackPropertiesChanged ()
 Track name or colour has changed.
 
virtual void midiPanic ()
 Tells the plugin to turn off any playing notes, if applicable.
 
virtual void prepareForNextBlock (TimePosition)
 Called between successive rendering blocks.
 
void applyToBufferWithAutomation (const PluginRenderContext &)
 
virtual bool shouldMeasureCpuUsage () const noexcept
 Plugins can return false if they want to avoid the overhead of measuring the CPU usage.
 
double getCpuUsage () const noexcept
 Returns the proportion of the current buffer size spent processing this plugin.
 
virtual int getNumOutputChannelsGivenInputs (int numInputChannels)
 Returns the number of output channels this plugin will produce for track routing.
 
virtual bool producesAudioWhenNoAudioInput ()
 Returns true if the plugin can produce audio when its input is silent (e.g.
 
virtual bool noTail ()
 Returns true if the plugin has no tail (i.e.
 
virtual void getChannelNames (juce::StringArray *ins, juce::StringArray *outs)
 Fills the provided StringArrays with the names of this plugin's input and/or output channels.
 
virtual bool takesAudioInput ()
 Returns true if this plugin should be fed audio from upstream in the chain.
 
virtual bool takesMidiInput ()
 
virtual bool isSynth ()
 
virtual double getTailLength () const
 Returns the length of the plugin's tail in seconds (e.g.
 
virtual bool canSidechain ()
 Returns true if this plugin supports sidechain input.
 
AutomatableParameteraddParam (const juce::String &paramID, const juce::String &name, juce::NormalisableRange< float > valueRange)
 Registers a new automatable parameter owned by this plugin.
 
AutomatableParameteraddParam (const juce::String &paramID, const juce::String &name, juce::NormalisableRange< float > valueRange, std::function< juce::String(float)> valueToStringFunction, std::function< float(const juce::String &)> stringToValueFunction)
 Registers a new automatable parameter with custom string conversion functions.
 
juce::StringArray getInputChannelNames ()
 Returns the names of this plugin's input channels (convenience wrapper around getChannelNames).
 
juce::StringArray getSidechainSourceNames (bool allowNone)
 Returns the names of available sidechain sources for this plugin.
 
void setSidechainSourceByName (const juce::String &name)
 Sets the sidechain source by its display name.
 
juce::String getSidechainSourceName ()
 Returns the display name of the current sidechain source.
 
void guessSidechainRouting ()
 Attempts to automatically determine a sensible sidechain routing.
 
int getNumWires () const
 
WiregetWire (int index) const
 
void makeConnection (int srcChannel, int dstChannel, juce::UndoManager *)
 
void breakConnection (int srcChannel, int dstChannel)
 
virtual bool hasNameForMidiNoteNumber (int note, int midiChannel, juce::String &name)
 If it's a synth that names its notes, this can return the name it uses for this note 0-127.
 
virtual bool hasNameForMidiProgram (int programNum, int bank, juce::String &name)
 Returns the name for a midi program, if there is one.
 
virtual bool hasNameForMidiBank (int bank, juce::String &name)
 
virtual bool canBeAddedToClip ()
 
virtual bool canBeAddedToRack ()
 
virtual bool canBeAddedToFolderTrack ()
 
virtual bool canBeAddedToMaster ()
 
virtual bool canBeDisabled ()
 
virtual bool canBeMoved ()
 
virtual bool needsConstantBufferSize ()
 Returns true if this plugin requires a constant audio buffer size (no variable-size blocks).
 
virtual bool isMissing ()
 Returns true if the plugin's backing file/DLL is missing (e.g.
 
virtual bool isDisabled ()
 Returns true if the plugin has been forcibly disabled (e.g.
 
bool isInRack () const
 Returns true if this plugin lives inside a RackType.
 
juce::ReferenceCountedObjectPtr< RackTypegetOwnerRackType () const
 
bool isClipEffectPlugin () const
 Returns true if this plugin is being used as a clip effect.
 
virtual juce::AudioProcessor * getWrappedAudioProcessor () const
 Returns the underlying juce::AudioProcessor, if this plugin wraps one.
 
AutomatableParameter::Ptr getQuickControlParameter () const
 
void setQuickControlParameter (AutomatableParameter *)
 
virtual void deleteFromParent ()
 Attempts to delete this plugin, whether it's a master plugin, track plugin, etc.
 
void removeFromParent ()
 Detaches the plugin from any parent it might be in.
 
TrackgetOwnerTrack () const
 Returns the track if it's a track or clip plugin.
 
ClipgetOwnerClip () const
 Returns the clip if that's what it's in.
 
PluginListgetOwnerList () const
 Returns the PluginList that contains this plugin.
 
Ptr findPluginThatFeedsIntoThis () const
 Returns the previous plugin in the same PluginList, or nullptr.
 
Ptr findPluginThatThisFeedsInto () const
 Returns the next plugin in the same PluginList, or nullptr.
 
void changed () override
 Marks the plugin as changed and notifies the Edit.
 
juce::Array< ReferencedItemgetReferencedItems () override
 
void reassignReferencedItem (const ReferencedItem &, ProjectItemRef newRef, double newStartTime) override
 
virtual void sourceMediaChanged ()
 Called when ProjectItem sources are re-assigned so you can reload from the new source.
 
bool setPluginToMirror (const Plugin::Ptr &)
 Sets a master plugin whose settings this one will mirror.
 
virtual void updateFromMirroredPluginIfNeeded (Plugin &)
 Called to pull state from the mirrored master.
 
Plugin::Ptr getMirroredPlugin () const
 Returns the plugin this one is mirroring, or nullptr.
 
bool baseClassNeedsInitialising () const noexcept
 Returns true if baseClassInitialise() has not yet been called (or has been fully deinitialised).
 
void baseClassInitialise (const PluginInitialisationInfo &)
 Prepares the plugin for playback.
 
void baseClassDeinitialise ()
 Tears down the plugin after playback.
 
void setSidechainSourceID (EditItemID newID)
 
EditItemID getSidechainSourceID () const
 
virtual std::unique_ptr< EditorComponentcreateEditor ()
 Creates a custom editor component for this plugin, or nullptr if none.
 
void showWindowExplicitly ()
 Shows the plugin's editor window, creating it if necessary.
 
void hideWindowForShutdown ()
 Hides the plugin window during shutdown (avoids dangling references).
 
juce::UndoManager * getUndoManager () const noexcept
 
bool isInitialising () const
 
- Public Member Functions inherited from engine::Selectable
 Selectable ()
 
virtual ~Selectable ()
 
virtual void selectionStatusChanged (bool isNowSelected)
 Can be overridden to tell this object that it has just been selected or deselected.
 
void addListener (SelectableListener *)
 
void removeListener (SelectableListener *)
 
void addSelectableListener (SelectableListener *)
 
void removeSelectableListener (SelectableListener *)
 
void cancelAnyPendingUpdates ()
 If changed() has been called, this will cancel any pending async change notificaions.
 
void deselect ()
 
void propertiesChanged ()
 
void notifyListenersOfDeletion ()
 
WeakRef getWeakRef ()
 
- Public Member Functions inherited from engine::Exportable
virtual ~Exportable ()=default
 
- Public Member Functions inherited from engine::AutomatableEditItem
 AutomatableEditItem (Edit &, const juce::ValueTree &)
 
 ~AutomatableEditItem () override
 
juce::Array< AutomatableParameter * > getAutomatableParameters () const
 
int getNumAutomatableParameters () const
 
AutomatableParameter::Ptr getAutomatableParameter (int index) const
 
AutomatableParameter::Ptr getAutomatableParameterByID (const juce::String &paramID) const
 
void visitAllAutomatableParams (const std::function< void(AutomatableParameter &)> &visit) const
 
void deleteParameter (AutomatableParameter *)
 
void deleteAutomatableParameters ()
 
int indexOfAutomatableParameter (const AutomatableParameter::Ptr &) const
 
AutomatableParameterTreegetParameterTree () const
 
juce::ReferenceCountedArray< AutomatableParametergetFlattenedParameterTree () const
 
void addParameterListChangeListener (ParameterListChangeListener *)
 
void removeParameterListChangeListener (ParameterListChangeListener *)
 
bool isAutomationNeeded () const noexcept
 
void setAutomatableParamPosition (TimePosition)
 
bool isBeingActivelyPlayed () const
 
virtual void updateAutomatableParamPosition (TimePosition)
 Updates all the auto params to their positions at this time.
 
void updateParameterStreams (TimePosition)
 Updates all the parameter streams to their positions at this time.
 
void resetRecordingStatus ()
 Marks the end of an automation recording stream.
 
void updateStreamIterators ()
 
void addActiveParameter (const AutomatableParameter &)
 
void removeActiveParameter (const AutomatableParameter &)
 
bool isActiveParameter (AutomatableParameter &)
 
- Public Member Functions inherited from engine::EditItem
 EditItem (EditItemID, Edit &)
 
 EditItem (Edit &, const juce::ValueTree &)
 
virtual ~EditItem ()=default
 
- Public Member Functions inherited from engine::MacroParameterElement
 MacroParameterElement (Edit &, const juce::ValueTree &)
 Constructor.
 
virtual ~MacroParameterElement ()=default
 Destructor.
 
MacroParameterListgetMacroParameterList ()
 If no parameters have been created, this may return nullptr.
 
MacroParameterListgetMacroParameterListForWriting ()
 This ensures that the list has been created.
 
juce::ReferenceCountedArray< MacroParametergetMacroParameters () const
 

Static Public Member Functions

static const chargetPluginName ()
 
- Static Public Member Functions inherited from engine::Plugin
static bool areSelectedPluginsRackable (SelectionManager &)
 
static RackInstancewrapSelectedPluginsInRack (SelectionManager &)
 
static void sortPlugins (Plugin::Array &)
 
static void sortPlugins (std::vector< Plugin * > &)
 
- Static Public Member Functions inherited from engine::Selectable
static void initialise ()
 
static bool isSelectableValid (const Selectable *) noexcept
 checks whether this object has been deleted.
 
- Static Public Member Functions inherited from engine::Exportable
static juce::Array< Exportable * > addAllExportables (Edit &)
 Returns all the Exportables contained in an Edit.
 

Public Attributes

juce::CachedValue< juce::String > name
 A name property.
 
juce::CachedValue< boolnormalise
 Normalise the IR file when loading from the state.
 
juce::CachedValue< booltrimSilence
 Trim silence from the IR file when loading from the state.
 
AutomatableParameter::Ptr highPassCutoffParam
 Cutoff frequency for the high pass filter to applied after the IR.
 
AutomatableParameter::Ptr lowPassCutoffParam
 Cutoff frequency for the low pass filter to applied after the IR.
 
AutomatableParameter::Ptr gainParam
 Parameter for the gain to apply.
 
AutomatableParameter::Ptr mixParam
 Parameter for the mix control, 0.0 = dry, 1.0 = wet.
 
AutomatableParameter::Ptr filterQParam
 Parameter for the Q factor of the high pass and low pass filters.
 
- Public Attributes inherited from engine::Plugin
std::unique_ptr< WindowStatewindowState
 
Engineengine
 
juce::ValueTree state
 The ValueTree that stores this plugin's persistent state within the Edit.
 
- Public Attributes inherited from engine::Selectable
WeakRef::Master masterReference
 
- Public Attributes inherited from engine::AutomatableEditItem
juce::ValueTree elementState
 
juce::CachedValue< bool > remapOnTempoChange
 
- Public Attributes inherited from engine::EditItem
Editedit
 
const EditItemID itemID
 Every EditItem has an ID which is unique within the edit.
 
- Public Attributes inherited from engine::MacroParameterElement
EditownerEdit
 
juce::ValueTree parentStateForList
 

Static Public Attributes

static const charxmlTypeName = "impulseResponse"
 

Additional Inherited Members

- Public Types inherited from engine::Plugin
enum class  Type { allPlugins , folderTrackPlugins , effectPlugins }
 Filter categories used when enumerating plugins. More...
 
using Ptr = juce::ReferenceCountedObjectPtr< Plugin >
 
using Array = juce::ReferenceCountedArray< Plugin >
 
- Public Types inherited from engine::Selectable
using WeakRef = juce::WeakReference< Selectable >
 
- Protected Member Functions inherited from engine::Plugin
void valueTreePropertyChanged (juce::ValueTree &, const juce::Identifier &) override
 
void valueTreeChanged () override
 
void valueTreeChildAdded (juce::ValueTree &, juce::ValueTree &) override
 
void valueTreeChildRemoved (juce::ValueTree &, juce::ValueTree &, int) override
 
void valueTreeParentChanged (juce::ValueTree &) override
 
virtual void processingChanged ()
 Called when the processing enabled state changes.
 
- Protected Member Functions inherited from engine::AutomatableEditItem
virtual void buildParameterTree () const
 
void updateLastPlaybackTime ()
 
void clearParameterList ()
 
void addAutomatableParameter (const AutomatableParameter::Ptr &)
 
void rebuildParameterTree ()
 
void saveChangedParametersToState ()
 Saves the explicit value of any parameters that have deviated to the state.
 
void restoreChangedParametersFromState ()
 Restores the value of any explicitly set parameters.
 
- Protected Member Functions inherited from engine::ValueTreeAllEventListener
void valueTreePropertyChanged (juce::ValueTree &, const juce::Identifier &) override
 
void valueTreeChildAdded (juce::ValueTree &, juce::ValueTree &) override
 
void valueTreeChildRemoved (juce::ValueTree &, juce::ValueTree &, int) override
 
void valueTreeChildOrderChanged (juce::ValueTree &, int, int) override
 
void valueTreeParentChanged (juce::ValueTree &) override
 
void valueTreeRedirected (juce::ValueTree &) override
 
- Static Protected Member Functions inherited from engine::Plugin
static void getLeftRightChannelNames (juce::StringArray *ins, juce::StringArray *outs)
 Helper to populate stereo left/right channel name arrays.
 
static void getLeftRightChannelNames (juce::StringArray *chans)
 
- Protected Attributes inherited from engine::Plugin
juce::CachedValue< AtomicWrapper< bool > > enabled
 
juce::CachedValue< boolfrozen
 
juce::CachedValue< boolprocessing
 
juce::CachedValue< juce::String > quickParamName
 
juce::CachedValue< juce::String > customName
 
juce::CachedValue< EditItemIDmasterPluginID
 
juce::CachedValue< EditItemIDsidechainSourceID
 
double sampleRate = 44100.0
 Current sample rate and block size, set during baseClassInitialise().
 
int blockSizeSamples = 512
 

Detailed Description

ImpulseResponsePlugin that loads an impulse response and applies it the audio stream.

Additionally this has high and low pass filters to shape the sound.

Constructor & Destructor Documentation

◆ ImpulseResponsePlugin()

engine::ImpulseResponsePlugin::ImpulseResponsePlugin ( PluginCreationInfo  )

Creates an ImpulseResponsePlugin.

Initially this will be have no IR loaded, use one of the loadImpulseResponse methods to apply it to the audio.

◆ ~ImpulseResponsePlugin()

engine::ImpulseResponsePlugin::~ImpulseResponsePlugin ( )
override

Destructor.

Member Function Documentation

◆ getPluginName()

static const char * engine::ImpulseResponsePlugin::getPluginName ( )
static

◆ loadImpulseResponse() [1/3]

bool engine::ImpulseResponsePlugin::loadImpulseResponse ( const void sourceData,
size_t  sourceDataSize 
)

Loads an impulse from binary audio file data i.e.

not a block of raw floats.

See also
juce::Convolution::loadImpulseResponse

◆ loadImpulseResponse() [2/3]

bool engine::ImpulseResponsePlugin::loadImpulseResponse ( const juce::File &  fileImpulseResponse)

Loads an impulse from a file.

See also
juce::Convolution::loadImpulseResponse

◆ loadImpulseResponse() [3/3]

bool engine::ImpulseResponsePlugin::loadImpulseResponse ( juce::AudioBuffer< float > &&  bufferImpulseResponse,
double  sampleRateToStore,
int  bitDepthToStore 
)

Loads an impulse from an AudioBuffer<float>.

See also
juce::Convolution::loadImpulseResponse

◆ getName()

juce::String engine::ImpulseResponsePlugin::getName ( ) const
overridevirtual

Implements engine::Plugin.

◆ getShortName()

juce::String engine::ImpulseResponsePlugin::getShortName ( int  )
overridevirtual

Reimplemented from engine::Plugin.

◆ getPluginType()

juce::String engine::ImpulseResponsePlugin::getPluginType ( )
overridevirtual

Implements engine::Plugin.

◆ getSelectableDescription()

juce::String engine::ImpulseResponsePlugin::getSelectableDescription ( )
overridevirtual

Implements engine::Selectable.

◆ getBusses()

BusLayout engine::ImpulseResponsePlugin::getBusses ( ) const
overridevirtual

Implements engine::Plugin.

◆ getLatencySeconds()

double engine::ImpulseResponsePlugin::getLatencySeconds ( )
overridevirtual

Reimplemented from engine::Plugin.

◆ initialise()

void engine::ImpulseResponsePlugin::initialise ( const PluginInitialisationInfo )
overridevirtual

Implements engine::Plugin.

◆ deinitialise()

void engine::ImpulseResponsePlugin::deinitialise ( )
overridevirtual

Implements engine::Plugin.

◆ reset()

void engine::ImpulseResponsePlugin::reset ( )
overridevirtual

Reimplemented from engine::Plugin.

◆ applyToBuffer()

void engine::ImpulseResponsePlugin::applyToBuffer ( const PluginRenderContext )
overridevirtual

Implements engine::Plugin.

◆ restorePluginStateFromValueTree()

void engine::ImpulseResponsePlugin::restorePluginStateFromValueTree ( const juce::ValueTree &  )
overridevirtual

Reimplemented from engine::AutomatableEditItem.

Member Data Documentation

◆ xmlTypeName

const char* engine::ImpulseResponsePlugin::xmlTypeName = "impulseResponse"
static

◆ name

juce::CachedValue<juce::String> engine::ImpulseResponsePlugin::name

A name property.

This isn't used by the IR itselt but useful in UI contexts.

◆ normalise

juce::CachedValue<bool> engine::ImpulseResponsePlugin::normalise

Normalise the IR file when loading from the state.

True by default.

◆ trimSilence

juce::CachedValue<bool> engine::ImpulseResponsePlugin::trimSilence

Trim silence from the IR file when loading from the state.

False by default.

◆ highPassCutoffParam

AutomatableParameter::Ptr engine::ImpulseResponsePlugin::highPassCutoffParam

Cutoff frequency for the high pass filter to applied after the IR.

◆ lowPassCutoffParam

AutomatableParameter::Ptr engine::ImpulseResponsePlugin::lowPassCutoffParam

Cutoff frequency for the low pass filter to applied after the IR.

◆ gainParam

AutomatableParameter::Ptr engine::ImpulseResponsePlugin::gainParam

Parameter for the gain to apply.

◆ mixParam

AutomatableParameter::Ptr engine::ImpulseResponsePlugin::mixParam

Parameter for the mix control, 0.0 = dry, 1.0 = wet.

◆ filterQParam

AutomatableParameter::Ptr engine::ImpulseResponsePlugin::filterQParam

Parameter for the Q factor of the high pass and low pass filters.


The documentation for this class was generated from the following file: