Om  1.0.0
A universal framework for multimedia simulation
Public Types | Public Member Functions | Static Public Attributes | List of all members
om::sound::filters::Delay Class Reference

A class that mixes input sound with a delayed version of itself. More...

#include <omSoundDelay.h>

Inheritance diagram for om::sound::filters::Delay:
om::sound::filters::SoundFilter

Public Types

enum  DelayType { COMB = 0, ALL_PASS = 1 }
 An enum type which describes the various types of delay effects that a Delay can produce. More...
 

Public Member Functions

 Delay ()
 Create a comb delay filter with 500ms delay time, 0 delay feedback, 0dB delay gain, and 0dB dry gain. More...
 
 Delay (DelayType newType, Float newDelayTime, Gain newFeedbackGain, Gain newDelayGain, Gain newDryGain)
 Create a delay filter with the specified type and delay parameters. More...
 
 Delay (const Delay &other)
 Create an exact copy of the specified delay filter. More...
 
 ~Delay ()
 Destroy this delay filter, releasing all internal resources. More...
 
Delayoperator= (const Delay &other)
 Assign the state of another delay filter to this one. More...
 
DelayType getType () const
 Return the kind of delay effect that this delay filter is producing. More...
 
void setType (DelayType newType)
 Set the kind of delay effect that this delay filter is producing. More...
 
Float getDelayTime () const
 Return the delay time for this delay filter in seconds. More...
 
void setDelayTime (Float newDelayTime)
 Set the delay time for this delay filter in seconds. More...
 
Float getDecayTime () const
 Return the time it takes for the output of this delay filter to decay to -60dB. More...
 
void setDecayTime (Float newDecayTime)
 Set the time it takes for the output of this delay filter to decay to -60dB. More...
 
Gain getFeedbackGain () const
 Return the feedback gain of this delay filter. More...
 
Gain getFeedbackGainDB () const
 Return the feedback gain of this delay filter in decibels. More...
 
void setFeedbackGain (Gain newFeedbackGain)
 Set the feedback gain of this delay filter. More...
 
void setFeedbackGainDB (Gain newFeedbackGain)
 Set the feedback gain of this delay filter in decibels. More...
 
Gain getDelayGain () const
 Return the linear delay gain of this delay filter. More...
 
Gain getDelayGainDB () const
 Return the delay gain of this delay filter in decibels. More...
 
void setDelayGain (Gain newDelayGain)
 Set the linear delay gain of this delay filter. More...
 
void setDelayGainDB (Gain newDelayGain)
 Set the delay gain of this delay filter in decibels. More...
 
Gain getDryGain () const
 Return the linear dry gain of this delay filter. More...
 
Gain getDryGainDB () const
 Return the dry gain of this delay filter in decibels. More...
 
void setDryGain (Gain newDryGain)
 Set the linear dry gain of this delay filter. More...
 
void setDryGainDB (Gain newDryGain)
 Set the dry gain of this delay filter in decibels. More...
 
Bool getDelayIsFrozen () const
 Return whether or not the delay buffer's contents for this delay filter are frozen. More...
 
void setDelayIsFrozen (Bool newDelayIsFrozen)
 Set whether or not the delay buffer's contents for this delay filter are frozen. More...
 
Bool getHighPassIsEnabled () const
 Return whether or not this delay filter's high pass filter is enabled. More...
 
void setHighPassIsEnabled (Bool newHighPassIsEnabled)
 Set whether or not this delay filter's high pass filter is enabled. More...
 
Float getHighPassFrequency () const
 Return the high pass filter frequency of this delay filter. More...
 
void setHighPassFrequency (Float newHighPassFrequency)
 Set the high pass filter frequency of this delay filter. More...
 
Size getHighPassOrder () const
 Return the high pass filter order of this delay filter. More...
 
void setHighPassOrder (Size newHighPassOrder)
 Set the high pass filter order of this delay filter. More...
 
Bool getLowPassIsEnabled () const
 Return whether or not this delay filter's low pass filter is enabled. More...
 
void setLowPassIsEnabled (Bool newLowPassIsEnabled)
 Set whether or not this delay filter's low pass filter is enabled. More...
 
Float getLowPassFrequency () const
 Return the low pass filter frequency of this delay filter. More...
 
void setLowPassFrequency (Float newLowPassFrequency)
 Set the low pass filter frequency of this delay filter. More...
 
Size getLowPassOrder () const
 Return the low pass filter order of this delay filter. More...
 
void setLowPassOrder (Size newLowPassOrder)
 Set the low pass filter order of this delay filter. More...
 
virtual UTF8String getName () const
 Return a human-readable name for this delay filter. More...
 
virtual UTF8String getManufacturer () const
 Return the manufacturer name of this delay filter. More...
 
virtual FilterVersion getVersion () const
 Return an object representing the version of this delay filter. More...
 
virtual FilterCategory getCategory () const
 Return an object that describes the category of effect that this filter implements. More...
 
virtual Size getParameterCount () const
 Return the total number of generic accessible parameters this delay filter has. More...
 
virtual Bool getParameterInfo (Index parameterIndex, FilterParameterInfo &info) const
 Get information about the delay filter parameter at the specified index. More...
 
virtual Bool getParameterValueName (Index parameterIndex, const FilterParameter &value, UTF8String &name) const
 Get any special name associated with the specified value of an indexed parameter. More...
 
- Public Member Functions inherited from om::sound::filters::SoundFilter
virtual ~SoundFilter ()
 Destroy this sound filter object. More...
 
SoundResult read (SoundBuffer &outputBuffer, Size numSamples)
 Fill the specified output buffer with the requested number of samples, based on internal filter state. More...
 
SoundResult read (SoundFrame &outputFrame, Size numSamples)
 Fill the specified output frame with the requested number of samples, based on internal filter state. More...
 
SoundResult write (const SoundBuffer &inputBuffer, Size numSamples)
 Process the specified input buffer samples and do something with them. More...
 
SoundResult write (const SoundFrame &inputFrame, Size numSamples)
 Process the specified input frame samples and do something with them. More...
 
SoundResult process (const SoundBuffer &inputBuffer, SoundBuffer &outputBuffer, Size numSamples)
 Apply this filter to the specified input buffer data, placing the result in the output buffer. More...
 
SoundResult process (const SoundBuffer &inputBuffer, SoundFrame &outputFrame, Size numSamples)
 Apply this filter to the specified input buffer data, placing the result in the output frame. More...
 
SoundResult process (const SoundFrame &inputFrame, SoundFrame &outputFrame, Size numSamples)
 Apply this filter to the specified input frame data, placing the result in the output frame. More...
 
SoundResult process (const SoundFrame &inputBuffer, SoundBuffer &outputBuffer, Size numSamples)
 Apply this filter to the specified input frame data, placing the result in the output buffer. More...
 
void reset ()
 Signal to the filter that the audio stream is restarting. More...
 
UInt64 getFrameIndex () const
 Return the index of the next frame to be processed (or the current one if currently processing). More...
 
Size getInputCount () const
 Return the current number of audio inputs that this filter has. More...
 
virtual UTF8String getInputName (Index inputIndex) const
 Return a human-readable name of the filter audio input at the specified index. More...
 
Size getOutputCount () const
 Return the current number of audio outputs that this filter has. More...
 
virtual UTF8String getOutputName (Index outputIndex) const
 Return a human-readable name of the filter audio output at the specified index. More...
 
Size getMIDIInputCount () const
 Return the current number of MIDI inputs that this filter has. More...
 
virtual UTF8String getMIDIInputName (Index inputIndex) const
 Return a human-readable name of the filter MIDI input at the specified index. More...
 
Size getMIDIOutputCount () const
 Return the current number of MIDI outputs that this filter has. More...
 
virtual UTF8String getMIDIOutputName (Index outputIndex) const
 Return a human-readable name of the filter MIDI output at the specified index. More...
 
virtual Time getLatency () const
 Return a Time value indicating the latency of this sound filter in seconds. More...
 
virtual Bool getParameterIndex (const UTF8String &parameterName, Index &parameterIndex) const
 Query the index of the parameter with the specified name. More...
 
Bool getParameter (Index parameterIndex, FilterParameter &value) const
 Place the value of the parameter at the specified index in the output parameter. More...
 
Bool getParameter (Index parameterIndex, Bool &value) const
 Place the value of the parameter at the specified index in the output parameter. More...
 
Bool getParameter (Index parameterIndex, Int64 &value) const
 Place the value of the parameter at the specified index in the output parameter. More...
 
Bool getParameter (Index parameterIndex, Float32 &value) const
 Place the value of the parameter at the specified index in the output parameter. More...
 
Bool getParameter (Index parameterIndex, Float64 &value) const
 Place the value of the parameter at the specified index in the output parameter. More...
 
template<typename ParameterType >
Bool getParameter (const UTF8String &name, ParameterType &value) const
 Place the value of the parameter with the specified name in the output parameter. More...
 
template<typename ParameterType >
Bool getParameter (const char *name, ParameterType &value) const
 Place the value of the parameter with the specified name in the output parameter. More...
 
Bool setParameter (Index parameterIndex, const FilterParameter &value)
 Attempt to set the parameter value at the specified index. More...
 
Bool setParameter (Index parameterIndex, Bool value)
 Attempt to set the parameter value at the specified index. More...
 
Bool setParameter (Index parameterIndex, Int64 value)
 Attempt to set the parameter value at the specified index. More...
 
Bool setParameter (Index parameterIndex, Float32 value)
 Attempt to set the parameter value at the specified index. More...
 
Bool setParameter (Index parameterIndex, Float64 value)
 Attempt to set the parameter value at the specified index. More...
 
template<typename ParameterType >
Bool setParameter (const UTF8String &name, ParameterType value)
 Attempt to set the parameter value with the specified name. More...
 
template<typename ParameterType >
Bool setParameter (const char *name, ParameterType value)
 Attempt to set the parameter value with the specified name. More...
 
virtual Bool writeState (DataOutputStream &stream) const
 Write the current state of this sound filter to a data output stream. More...
 
virtual Bool readState (DataInputStream &stream)
 Read a previously saved filter state from the specified data input stream and replace the filter's state. More...
 
virtual Size getPresetCount () const
 Return the number of standard configuration presets that this sound filter has. More...
 
virtual Bool getPreset (Index presetIndex, FilterPreset &preset) const
 Get the standard preset for this sound filter with the specified index. More...
 
Bool getIsSynchronized () const
 Return whether or not this sound filter performs thread synchronization. More...
 
void setIsSynchronized (Bool newIsSynchronized)
 Set whether or not this sound filter performs thread synchronization. More...
 
virtual Bool allowsInPlaceProcessing () const
 Return whether or not this sound filter can process audio data in-place. More...
 

Static Public Attributes

static const UTF8String NAME
 A string indicating the human-readable name of this delay filter. More...
 
static const UTF8String MANUFACTURER
 A string indicating the manufacturer name of this delay filter. More...
 
static const FilterVersion VERSION
 An object indicating the version of this delay filter. More...
 
- Static Public Attributes inherited from om::sound::filters::SoundFilter
static const om::resources::ResourceType RESOURCE_TYPE
 The resource type for a sound filter. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from om::sound::filters::SoundFilter
static Size getMaximumNumberOfInputs ()
 Return the maximum number of audio inputs that a SoundFilter can support. More...
 
static Size getMaximumNumberOfOutputs ()
 Return the maximum number of audio outputs that a SoundFilter can support. More...
 
static Size getMaximumNumberOfMIDIInputs ()
 Return the maximum number of MIDI inputs that a SoundFilter can support. More...
 
static Size getMaximumNumberOfMIDIOutputs ()
 Return the maximum number of MIDI outputs that a SoundFilter can support. More...
 
- Protected Member Functions inherited from om::sound::filters::SoundFilter
 SoundFilter ()
 Create a new sound filter with 1 audio input and output, and no MIDI inputs or outputs. More...
 
 SoundFilter (Size numInputs, Size numOutputs)
 Create a new sound filter with the specified number of audio inputs and outputs. More...
 
 SoundFilter (Size numInputs, Size numOutputs, Size numMIDIInputs, Size numMIDIOutputs)
 Create a new sound filter with the specified number of audio inputs and outputs. More...
 
void setInputCount (Size newNumInputs)
 Set the number of inputs that this filter should have. More...
 
void setOutputCount (Size newNumOutputs)
 Set the number of outputs that this filter should have. More...
 
void setMIDIInputCount (Size newNumMIDIInputs)
 Set the number of MIDI inputs that this filter should have. More...
 
void setMIDIOutputCount (Size newNumMIDIOutputs)
 Set the number of MIDI outputs that this filter should have. More...
 
Bool isFirstFrame () const
 Return whether or not the filter's next frame to be processed is also its first frame. More...
 
void lockMutex () const
 Acquire a mutex which handles subclass rendering parameter synchronization. More...
 
void unlockMutex () const
 Release a mutex which handles subclass rendering parameter synchronization. More...
 

Detailed Description

A class that mixes input sound with a delayed version of itself.

This class represents a generic delay-style effect. It can be switched between comb filtering and all-pass delay.

Member Enumeration Documentation

An enum type which describes the various types of delay effects that a Delay can produce.

Enumerator
COMB 

The delay filter behaves as a comb filter (the same as a standard delay effect).

ALL_PASS 

The delay filter behaves as an all-pass filter.

Constructor & Destructor Documentation

om::sound::filters::Delay::Delay ( )

Create a comb delay filter with 500ms delay time, 0 delay feedback, 0dB delay gain, and 0dB dry gain.

om::sound::filters::Delay::Delay ( DelayType  newType,
Float  newDelayTime,
Gain  newFeedbackGain,
Gain  newDelayGain,
Gain  newDryGain 
)

Create a delay filter with the specified type and delay parameters.

This constructor creates a filter with the specified delay time, delay feedback gain, delay output gain, and input-to-output gain.

om::sound::filters::Delay::Delay ( const Delay other)

Create an exact copy of the specified delay filter.

om::sound::filters::Delay::~Delay ( )

Destroy this delay filter, releasing all internal resources.

Member Function Documentation

Delay& om::sound::filters::Delay::operator= ( const Delay other)

Assign the state of another delay filter to this one.

DelayType om::sound::filters::Delay::getType ( ) const
inline

Return the kind of delay effect that this delay filter is producing.

void om::sound::filters::Delay::setType ( DelayType  newType)
inline

Set the kind of delay effect that this delay filter is producing.

Float om::sound::filters::Delay::getDelayTime ( ) const
inline

Return the delay time for this delay filter in seconds.

void om::sound::filters::Delay::setDelayTime ( Float  newDelayTime)
inline

Set the delay time for this delay filter in seconds.

Float om::sound::filters::Delay::getDecayTime ( ) const
inline

Return the time it takes for the output of this delay filter to decay to -60dB.

This method computes the decay time of the delay filter using the current values for the feedback gain and delay time of the delay filter.

void om::sound::filters::Delay::setDecayTime ( Float  newDecayTime)
inline

Set the time it takes for the output of this delay filter to decay to -60dB.

This method uses the current delay filter delay time to compute the feedback gain necessary to produce the desired decay time.

Gain om::sound::filters::Delay::getFeedbackGain ( ) const
inline

Return the feedback gain of this delay filter.

This value represents how much of each output delay sample is sent back to the delay buffer during each pass over the delay buffer. This value should be between -0.99999 and 0.99999 in order to ensure filter stability.

Gain om::sound::filters::Delay::getFeedbackGainDB ( ) const
inline

Return the feedback gain of this delay filter in decibels.

This value represents the gain applied to the output delay sample that is sent back to the delay buffer during each pass over the delay buffer. This value should be between -infinity and -0.00001 in order to ensure filter stability.

void om::sound::filters::Delay::setFeedbackGain ( Gain  newFeedbackGain)
inline

Set the feedback gain of this delay filter.

This value represents how much of each output delay sample is sent back to the delay buffer during each pass over the delay buffer. This value is clamped to be between -0.99999 and 0.99999 in order to ensure filter stability.

void om::sound::filters::Delay::setFeedbackGainDB ( Gain  newFeedbackGain)
inline

Set the feedback gain of this delay filter in decibels.

This value represents the gain applied to the output delay sample that is sent back to the delay buffer during each pass over the delay buffer. This value should be between -infinity and -0.00001 in order to ensure filter stability.

Gain om::sound::filters::Delay::getDelayGain ( ) const
inline

Return the linear delay gain of this delay filter.

This value represents the gain applied to the delayed signal before it is mixed with input signal.

Gain om::sound::filters::Delay::getDelayGainDB ( ) const
inline

Return the delay gain of this delay filter in decibels.

This value represents the gain applied to the delayed signal before it is mixed with input signal.

void om::sound::filters::Delay::setDelayGain ( Gain  newDelayGain)
inline

Set the linear delay gain of this delay filter.

This value represents the gain applied to the delayed signal before it is mixed with input signal.

void om::sound::filters::Delay::setDelayGainDB ( Gain  newDelayGain)
inline

Set the delay gain of this delay filter in decibels.

This value represents the gain applied to the delayed signal before it is mixed with input signal.

Gain om::sound::filters::Delay::getDryGain ( ) const
inline

Return the linear dry gain of this delay filter.

This value represents the gain applied to the input signal before it is mixed with delayed signal.

Gain om::sound::filters::Delay::getDryGainDB ( ) const
inline

Return the dry gain of this delay filter in decibels.

This value represents the gain applied to the input signal before it is mixed with delayed signal.

void om::sound::filters::Delay::setDryGain ( Gain  newDryGain)
inline

Set the linear dry gain of this delay filter.

This value represents the gain applied to the input signal before it is mixed with delayed signal.

void om::sound::filters::Delay::setDryGainDB ( Gain  newDryGain)
inline

Set the dry gain of this delay filter in decibels.

This value represents the gain applied to the input signal before it is mixed with delayed signal.

Bool om::sound::filters::Delay::getDelayIsFrozen ( ) const
inline

Return whether or not the delay buffer's contents for this delay filter are frozen.

If TRUE, this means that writes to the delay buffer disabled, so it will repeat the same delay buffer over and over.

void om::sound::filters::Delay::setDelayIsFrozen ( Bool  newDelayIsFrozen)
inline

Set whether or not the delay buffer's contents for this delay filter are frozen.

If TRUE, this means that writes to the delay buffer disabled, so it will repeat the same delay buffer over and over.

Bool om::sound::filters::Delay::getHighPassIsEnabled ( ) const
inline

Return whether or not this delay filter's high pass filter is enabled.

void om::sound::filters::Delay::setHighPassIsEnabled ( Bool  newHighPassIsEnabled)
inline

Set whether or not this delay filter's high pass filter is enabled.

Float om::sound::filters::Delay::getHighPassFrequency ( ) const
inline

Return the high pass filter frequency of this delay filter.

void om::sound::filters::Delay::setHighPassFrequency ( Float  newHighPassFrequency)
inline

Set the high pass filter frequency of this delay filter.

The new high pass frequency is clamped to the range [0,infinity].

Size om::sound::filters::Delay::getHighPassOrder ( ) const
inline

Return the high pass filter order of this delay filter.

void om::sound::filters::Delay::setHighPassOrder ( Size  newHighPassOrder)
inline

Set the high pass filter order of this delay filter.

The new high pass order is clamped to the range [1,100].

Bool om::sound::filters::Delay::getLowPassIsEnabled ( ) const
inline

Return whether or not this delay filter's low pass filter is enabled.

void om::sound::filters::Delay::setLowPassIsEnabled ( Bool  newLowPassIsEnabled)
inline

Set whether or not this delay filter's low pass filter is enabled.

Float om::sound::filters::Delay::getLowPassFrequency ( ) const
inline

Return the low pass filter frequency of this delay filter.

void om::sound::filters::Delay::setLowPassFrequency ( Float  newLowPassFrequency)
inline

Set the low pass filter frequency of this delay filter.

The new low pass frequency is clamped to the range [0,infinity].

Size om::sound::filters::Delay::getLowPassOrder ( ) const
inline

Return the low pass filter order of this delay filter.

void om::sound::filters::Delay::setLowPassOrder ( Size  newLowPassOrder)
inline

Set the low pass filter order of this delay filter.

The new low pass order is clamped to the range [1,100].

virtual UTF8String om::sound::filters::Delay::getName ( ) const
virtual

Return a human-readable name for this delay filter.

The method returns the string "Delay".

Reimplemented from om::sound::filters::SoundFilter.

virtual UTF8String om::sound::filters::Delay::getManufacturer ( ) const
virtual

Return the manufacturer name of this delay filter.

The method returns the string "Om Sound".

Reimplemented from om::sound::filters::SoundFilter.

virtual FilterVersion om::sound::filters::Delay::getVersion ( ) const
virtual

Return an object representing the version of this delay filter.

Reimplemented from om::sound::filters::SoundFilter.

virtual FilterCategory om::sound::filters::Delay::getCategory ( ) const
virtual

Return an object that describes the category of effect that this filter implements.

This method returns the value FilterCategory::DELAY.

Reimplemented from om::sound::filters::SoundFilter.

virtual Size om::sound::filters::Delay::getParameterCount ( ) const
virtual

Return the total number of generic accessible parameters this delay filter has.

Reimplemented from om::sound::filters::SoundFilter.

virtual Bool om::sound::filters::Delay::getParameterInfo ( Index  parameterIndex,
FilterParameterInfo info 
) const
virtual

Get information about the delay filter parameter at the specified index.

Reimplemented from om::sound::filters::SoundFilter.

virtual Bool om::sound::filters::Delay::getParameterValueName ( Index  parameterIndex,
const FilterParameter value,
UTF8String &  name 
) const
virtual

Get any special name associated with the specified value of an indexed parameter.

Reimplemented from om::sound::filters::SoundFilter.

Member Data Documentation

const UTF8String om::sound::filters::Delay::NAME
static

A string indicating the human-readable name of this delay filter.

const UTF8String om::sound::filters::Delay::MANUFACTURER
static

A string indicating the manufacturer name of this delay filter.

const FilterVersion om::sound::filters::Delay::VERSION
static

An object indicating the version of this delay filter.


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