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

A class that measures the impulse response of a sound signal processing chain. More...

#include <omSoundIRUtility.h>

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

Public Member Functions

 IRUtility ()
 Create a IR utility with the default initial state. More...
 
void start ()
 Start measuring the impulse response. More...
 
void stop ()
 Stop measuring the impulse response if it was being measured. More...
 
Bool isMeasuring () const
 Return whether or not the IR utility is currently measuring an impulse response. More...
 
Bool hasMeasurement () const
 Return whether or not the IR utility has finished measuring data for an impulse resopnse. More...
 
Bool deconvolve (SoundBuffer &ir) const
 Deconvolve the measured IR and write it to the buffer output parameter. More...
 
Size getChannelCount () const
 Return the number of channels there are in the measured impulse response. More...
 
void setChannelCount (Size newChannelCount)
 Set the number of channels there are in the measured impulse response. More...
 
const TimegetIRLength () const
 Return the length of the measured impulse response. More...
 
void setIRLength (const Time &newIRLength)
 Set the length of the measured impulse response. More...
 
SampleRate getSampleRate () const
 Return the sample rate of the impulse response that is being measured. More...
 
void setSampleRate (SampleRate newSampleRate)
 Set the sample rate of the impulse response that is being measured. More...
 
const TimegetStimulusLength () const
 Return the length of the IR test signal. More...
 
void setStimulusLength (const Time &newStimulusLength)
 Set the length of the IR test signal. More...
 
Size getMeasurementCount () const
 Return the number of repeated measurements that should be taken for robustness. More...
 
void setMeasurementCount (Size newMeasurementCount)
 Set the number of repeated measurements that should be taken for robustness. More...
 
virtual UTF8String getName () const
 Return a human-readable name for this IR utility. More...
 
virtual UTF8String getManufacturer () const
 Return the manufacturer name of this IR utility. More...
 
virtual FilterVersion getVersion () const
 Return an object representing the version of this IR utility. 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 filter has. More...
 
virtual Bool getParameterInfo (Index parameterIndex, FilterParameterInfo &info) const
 Get information about the parameter at the specified index. 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...
 
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...
 
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 IR utility. More...
 
static const UTF8String MANUFACTURER
 A string indicating the manufacturer name of this IR utility. More...
 
static const FilterVersion VERSION
 An object indicating the version of this IR utility. 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 measures the impulse response of a sound signal processing chain.

Constructor & Destructor Documentation

om::sound::filters::IRUtility::IRUtility ( )

Create a IR utility with the default initial state.

Member Function Documentation

void om::sound::filters::IRUtility::start ( )

Start measuring the impulse response.

If the response was already being measured, the utility aborts that measurement and restarts the process.

void om::sound::filters::IRUtility::stop ( )

Stop measuring the impulse response if it was being measured.

The method aborts the measurement.

Bool om::sound::filters::IRUtility::isMeasuring ( ) const
inline

Return whether or not the IR utility is currently measuring an impulse response.

Bool om::sound::filters::IRUtility::hasMeasurement ( ) const
inline

Return whether or not the IR utility has finished measuring data for an impulse resopnse.

Bool om::sound::filters::IRUtility::deconvolve ( SoundBuffer ir) const

Deconvolve the measured IR and write it to the buffer output parameter.

Depending on the length of the stimulus signal, this is a potentially slow operation. This method should only be called when the hasMeasurement() function returns TRUE.

Size om::sound::filters::IRUtility::getChannelCount ( ) const
inline

Return the number of channels there are in the measured impulse response.

void om::sound::filters::IRUtility::setChannelCount ( Size  newChannelCount)

Set the number of channels there are in the measured impulse response.

If the IR was in the process of being measured, the measurement is aborted and the channel count is changed.

const Time& om::sound::filters::IRUtility::getIRLength ( ) const
inline

Return the length of the measured impulse response.

void om::sound::filters::IRUtility::setIRLength ( const Time newIRLength)

Set the length of the measured impulse response.

If the IR was in the process of being measured, the measurement is aborted and the IR length is changed.

SampleRate om::sound::filters::IRUtility::getSampleRate ( ) const
inline

Return the sample rate of the impulse response that is being measured.

void om::sound::filters::IRUtility::setSampleRate ( SampleRate  newSampleRate)

Set the sample rate of the impulse response that is being measured.

If the IR was in the process of being measured, the measurement is aborted and the sample rate is changed.

const Time& om::sound::filters::IRUtility::getStimulusLength ( ) const
inline

Return the length of the IR test signal.

This influences the signal to noise ratio of the resulting impulse response as well as the computation time. A longer stimulus results in a better IR but takes longer to compute.

void om::sound::filters::IRUtility::setStimulusLength ( const Time newStimulusLength)

Set the length of the IR test signal.

This influences the signal to noise ratio of the resulting impulse response as well as the computation time. A longer stimulus results in a better IR but takes longer to compute. If the IR was in the process of being measured, the measurement is aborted and the IR length is changed.

Size om::sound::filters::IRUtility::getMeasurementCount ( ) const
inline

Return the number of repeated measurements that should be taken for robustness.

void om::sound::filters::IRUtility::setMeasurementCount ( Size  newMeasurementCount)

Set the number of repeated measurements that should be taken for robustness.

If the IR was in the process of being measured, the measurement is aborted and the measurement count is changed.

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

Return a human-readable name for this IR utility.

The method returns the string "IR Utility".

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

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

Return the manufacturer name of this IR utility.

The method returns the string "Om Sound".

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

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

Return an object representing the version of this IR utility.

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

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

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

This method returns the value FilterCategory::ANALYSIS.

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

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

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

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

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

Get information about the parameter at the specified index.

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

Member Data Documentation

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

A string indicating the human-readable name of this IR utility.

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

A string indicating the manufacturer name of this IR utility.

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

An object indicating the version of this IR utility.


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