MusicKit  0.0.0
Public Member Functions | Static Public Member Functions | Protected Attributes
SndAudioProcessor Class Reference

A VST-like audio FX processing module base class. More...

#import <SndAudioProcessor.h>

Inheritance diagram for SndAudioProcessor:
SndAudioFader SndAudioFader SndAudioProcessorDelay SndAudioProcessorDelay SndAudioProcessorDistortion SndAudioProcessorDistortion SndAudioProcessorFlanger SndAudioProcessorFlanger SndAudioProcessorNoiseGate SndAudioProcessorNoiseGate SndAudioProcessorRecorder SndAudioProcessorRecorder SndAudioProcessorReverb SndAudioProcessorReverb SndAudioProcessorToneGenerator SndAudioProcessorToneGenerator SndAudioUnitProcessor

List of all members.

Public Member Functions

(id) - init
 Initialization method.
(id) - initWithParamCount:name:
 Initialization method.
(id) - initWithParameterDictionary:name:
 Initialization using a dictionary of parameters.
(id) - reset
 Message sent when host determines the SndAudioProcessor should reinitialize its processing state. Eg, a delay processor would zero its z-buffers.
(int) - paramCount
 Gets the number of parameters.
(float) - paramValue:
 Gets the value of the indexed parameter.
(NSString *) - paramName:
 Gets the name of indexed parameter.
(NSString *) - paramLabel:
 Returns a label or extra text describing the parameters units of measurement.
(NSString *) - paramDisplay:
 Converts an object-internal value into a more user-friendly representation.
(void) - setParam:toValue:
 Sets the indexed parameter to the value given.
(BOOL) - processReplacingInputBuffer:outputBuffer:
 Process the inputBuffer, and replace the results in the output buffer.
(void) - setAudioProcessorChain:
 (Internal SndKit use only) Individual processors may want to query their enclosing processor chain, for example to get the time at the start of the buffer (nowTime). This method gets called when a processor gets added to the chain, with the id of the chain.
(SndAudioProcessorChain *) - audioProcessorChain
 Returns the SndAudioProcessorChain to which the processor is attached.
(BOOL) - isActive
 Processor activity status query method.
(id) - setActive:
 Sets the active status of the processor.
(id) - setName:
 Assigns the SndAudioProcessor instance a new name.
(NSString *) - name
 Returns the name of the audio processor.
(NSDictionary *) - paramDictionary
 Returns an NSDictionary holding all parameters of a SndAudioProcessor instance.
(void) - setParamsWithDictionary:
 Sets parameters with names and values provided by the given NSDictionary.
(void) - setParamWithKey:toValue:
 Assigns the parameter named keyName to the passed value.
(NSNumber *) - paramObjectForIndex:
 Returns the parameter value as an NSNumber given an index.
(void) - setParameterDelegate:
 Assigns the current parameter delegate.
(id) - parameterDelegate
(id) - init
 Initialization method.
(id) - initWithParamCount:name:
 Initialization method.
(id) - initWithParameterDictionary:name:
 Initialization using a dictionary of parameters.
(id) - reset
 Message sent when host determines the SndAudioProcessor should reinitialize its processing state. Eg, a delay processor would zero its z-buffers.
(int) - paramCount
 Gets the number of parameters.
(float) - paramValue:
 Gets the value of the indexed parameter.
(NSString *) - paramName:
 Gets the name of indexed parameter.
(NSString *) - paramLabel:
 Returns a label or extra text describing the parameters units of measurement.
(NSString *) - paramDisplay:
 Converts an object-internal value into a more user-friendly representation.
(void) - setParam:toValue:
 Sets the indexed parameter to the value given.
(BOOL) - processReplacingInputBuffer:outputBuffer:
 Process the inputBuffer, and replace the results in the output buffer.
(void) - setAudioProcessorChain:
 (Internal SndKit use only) Individual processors may want to query their enclosing processor chain, for example to get the time at the start of the buffer (nowTime). This method gets called when a processor gets added to the chain, with the id of the chain.
(SndAudioProcessorChain *) - audioProcessorChain
 Returns the SndAudioProcessorChain to which the processor is attached.
(BOOL) - isActive
 Processor activity status query method.
(id) - setActive:
 Sets the active status of the processor.
(id) - setName:
 Assigns the SndAudioProcessor instance a new name.
(NSString *) - name
 Returns the name of the audio processor.
(NSDictionary *) - paramDictionary
 Returns an NSDictionary holding all parameters of a SndAudioProcessor instance.
(void) - setParamsWithDictionary:
 Sets parameters with names and values provided by the given NSDictionary.
(void) - setParamWithKey:toValue:
 Assigns the parameter named keyName to the passed value.
(NSNumber *) - paramObjectForIndex:
 Returns the parameter value as an NSNumber given an index.
(void) - setParameterDelegate:
 Assigns the current parameter delegate.
(id) - parameterDelegate

Static Public Member Functions

(void) + registerAudioProcessorClass:
 Registers an SndAudioProcessor class.
(NSArray *) + fxClasses
 Use this to get a list of all the available FX processors.
(NSArray *) + availableAudioProcessors
 Returns an array of names of available audio units (on MacOS X).
(id) + audioProcessor
 Factory method.
(SndAudioProcessor *) + audioProcessorNamed:
 Returns an autoreleased instance of a SndProcessor subclass named processorName.
(void) + registerAudioProcessorClass:
 Registers an SndAudioProcessor class.
(NSArray *) + fxClasses
 Use this to get a list of all the available FX processors.
(NSArray *) + availableAudioProcessors
 Returns an array of names of available audio units (on MacOS X).
(id) + audioProcessor
 Factory method.
(SndAudioProcessor *) + audioProcessorNamed:
 Returns an autoreleased instance of a SndProcessor subclass named processorName.

Protected Attributes

int numParams
SndAudioProcessorChainaudioProcessorChain
NSString * name
BOOL active
id parameterDelegate

Detailed Description

A VST-like audio FX processing module base class.

To come


Member Function Documentation

Factory method.

To come

Returns:
Returns a freshly initialized, autoreleased SndAudioProcessor

Factory method.

To come

Returns:
Returns a freshly initialized, autoreleased SndAudioProcessor

Returns the SndAudioProcessorChain to which the processor is attached.

Returns:
Returns a SndAudioProcessorChain instance.

Returns the SndAudioProcessorChain to which the processor is attached.

Returns:
Returns a SndAudioProcessorChain instance.
+ (SndAudioProcessor *) audioProcessorNamed: (NSString *)  processorName

Returns an autoreleased instance of a SndProcessor subclass named processorName.

Parameters:
processorNameThe name of a SndAudioProcessor as returned previously by availableAudioProcessors.

Factory method.

Reimplemented in SndAudioUnitProcessor.

+ (SndAudioProcessor *) audioProcessorNamed: (NSString *)  processorName

Returns an autoreleased instance of a SndProcessor subclass named processorName.

Parameters:
processorNameThe name of a SndAudioProcessor as returned previously by availableAudioProcessors.

Factory method.

Reimplemented in SndAudioUnitProcessor.

+ (NSArray *) availableAudioProcessors

Returns an array of names of available audio units (on MacOS X).

The names returned can be assumed to be human readable and reasonably formatted. They can also be assumed to be unique and therefore can be used to create an instance using +processorNamed:.

Returns:
Returns an autoreleased NSArray of NSStrings of audio processors.

Reimplemented in SndAudioUnitProcessor.

+ (NSArray *) availableAudioProcessors

Returns an array of names of available audio units (on MacOS X).

The names returned can be assumed to be human readable and reasonably formatted. They can also be assumed to be unique and therefore can be used to create an instance using +processorNamed:.

Returns:
Returns an autoreleased NSArray of NSStrings of audio processors.

Reimplemented in SndAudioUnitProcessor.

+ (NSArray*) fxClasses

Use this to get a list of all the available FX processors.

Returns:
An NSArray of SndAudioProcessor sub-classed Class object ids
+ (NSArray*) fxClasses

Use this to get a list of all the available FX processors.

Returns:
An NSArray of SndAudioProcessor sub-classed Class object ids
- (id) init

Initialization method.

Returns:
Returns self.

Reimplemented in SndAudioProcessorReverb, and SndAudioProcessorReverb.

- (id) init

Initialization method.

Returns:
Returns self.

Reimplemented in SndAudioProcessorReverb, and SndAudioProcessorReverb.

- (id) initWithParamCount: (const int)  count
name: (NSString *)  name 

Initialization method.

Parameters:
countNumber of parameters.
nameName of sound audio processor.
Returns:
Returns self.

Reimplemented in SndAudioUnitProcessor.

- (id) initWithParamCount: (const int)  count
name: (NSString *)  name 

Initialization method.

Parameters:
countNumber of parameters.
nameName of sound audio processor.
Returns:
Returns self.

Reimplemented in SndAudioUnitProcessor.

- (id) initWithParameterDictionary: (NSDictionary *)  paramDictionary
name: (NSString *)  name 

Initialization using a dictionary of parameters.

Parameters:
paramDictionaryNSDictionary of parameters and values to initialise SndAudioProcessor instance with.
nameName of the SndAudioProcessor to initialise.
Returns:
Returns self.
- (id) initWithParameterDictionary: (NSDictionary *)  paramDictionary
name: (NSString *)  name 

Initialization using a dictionary of parameters.

Parameters:
paramDictionaryNSDictionary of parameters and values to initialise SndAudioProcessor instance with.
nameName of the SndAudioProcessor to initialise.
Returns:
Returns self.
- (BOOL) isActive

Processor activity status query method.

Returns:
Returns TRUE if the processor is active, ie whether the host processor chain should pass the audio stream through this processor.
- (BOOL) isActive

Processor activity status query method.

Returns:
Returns TRUE if the processor is active, ie whether the host processor chain should pass the audio stream through this processor.
- (NSString *) name

Returns the name of the audio processor.

Returns:
Returns an NSString instance.

The name may or may not be unique to each instance of a SndAudioProcessor.

- (NSString *) name

Returns the name of the audio processor.

Returns:
Returns an NSString instance.

The name may or may not be unique to each instance of a SndAudioProcessor.

- (int) paramCount

Gets the number of parameters.

Returns:
number of parameters
- (int) paramCount

Gets the number of parameters.

Returns:
number of parameters
- (NSDictionary *) paramDictionary

Returns an NSDictionary holding all parameters of a SndAudioProcessor instance.

Returns:
An autoreleased NSDictionary.

Each element in the dictionary has a key with an NSString of the parameter name and an object which is an NSValue of the floating point parameter value.

- (NSDictionary *) paramDictionary

Returns an NSDictionary holding all parameters of a SndAudioProcessor instance.

Returns:
An autoreleased NSDictionary.

Each element in the dictionary has a key with an NSString of the parameter name and an object which is an NSValue of the floating point parameter value.

- (NSString *) paramDisplay: (const int)  index

Converts an object-internal value into a more user-friendly representation.

Parameters:
indexParameter index

Example: An instance variable may have a floating point range [0,1], but it represents a deciBel amount for user purposes. This method is an opportunity for the object to provide a more meaningful description of the parameter.

Returns:
Returns an NSString containing the alternative string representation of the parameter

Reimplemented in SndAudioUnitProcessor.

- (NSString *) paramDisplay: (const int)  index

Converts an object-internal value into a more user-friendly representation.

Parameters:
indexParameter index

Example: An instance variable may have a floating point range [0,1], but it represents a deciBel amount for user purposes. This method is an opportunity for the object to provide a more meaningful description of the parameter.

Returns:
Returns an NSString containing the alternative string representation of the parameter

Reimplemented in SndAudioUnitProcessor.

Returns:
Returns the current parameter delegate.
Returns:
Returns the current parameter delegate.
- (NSString *) paramLabel: (const int)  index

Returns a label or extra text describing the parameters units of measurement.

Parameters:
indexParameter index

Example: if the parameter is in deciBels, an appropriate result might be to return "dB"

Returns:
Returns the label for the parameter.

Reimplemented in SndAudioUnitProcessor.

- (NSString *) paramLabel: (const int)  index

Returns a label or extra text describing the parameters units of measurement.

Parameters:
indexParameter index

Example: if the parameter is in deciBels, an appropriate result might be to return "dB"

Returns:
Returns the label for the parameter.

Reimplemented in SndAudioUnitProcessor.

- (NSString *) paramName: (const int)  index

Gets the name of indexed parameter.

Parameters:
indexParameter index
Returns:
NSString with parameter name

Reimplemented in SndAudioFader, SndAudioFader, SndAudioProcessorReverb, SndAudioProcessorReverb, and SndAudioUnitProcessor.

- (NSString *) paramName: (const int)  index

Gets the name of indexed parameter.

Parameters:
indexParameter index
Returns:
NSString with parameter name

Reimplemented in SndAudioFader, SndAudioFader, SndAudioProcessorReverb, SndAudioProcessorReverb, and SndAudioUnitProcessor.

- (NSNumber *) paramObjectForIndex: (const int)  i

Returns the parameter value as an NSNumber given an index.

Returns:
Returns an NSNumber instance.
- (NSNumber *) paramObjectForIndex: (const int)  i

Returns the parameter value as an NSNumber given an index.

Returns:
Returns an NSNumber instance.
- (float) paramValue: (const int)  index

Gets the value of the indexed parameter.

Following the VST convention, this should be in the range [0,1]. No enforcement at the present time.

Parameters:
indexIndex of the parameter
Returns:
parameter value

Reimplemented in SndAudioFader, SndAudioFader, SndAudioProcessorReverb, SndAudioProcessorReverb, and SndAudioUnitProcessor.

- (float) paramValue: (const int)  index

Gets the value of the indexed parameter.

Following the VST convention, this should be in the range [0,1]. No enforcement at the present time.

Parameters:
indexIndex of the parameter
Returns:
parameter value

Reimplemented in SndAudioFader, SndAudioFader, SndAudioProcessorReverb, SndAudioProcessorReverb, and SndAudioUnitProcessor.

- (BOOL) processReplacingInputBuffer: (SndAudioBuffer *)  inB
outputBuffer: (SndAudioBuffer *)  outB 

Process the inputBuffer, and replace the results in the output buffer.

Overide this method with your own FX processing routines. There is nothing to stop inB and outB referring to the same buffer - be warned that replacing the output values in outB may change inB in these cases.

Parameters:
inBThe input buffer
outBThe output buffer
Returns:
BOOL indicates whether the output is held in outB (YES), or inB (NO). Means that processors that decide not to touch their data at all don't need to spend time copying between buffers.

Reimplemented in SndAudioFader, SndAudioFader, SndAudioProcessorReverb, SndAudioProcessorReverb, and SndAudioUnitProcessor.

- (BOOL) processReplacingInputBuffer: (SndAudioBuffer *)  inB
outputBuffer: (SndAudioBuffer *)  outB 

Process the inputBuffer, and replace the results in the output buffer.

Overide this method with your own FX processing routines. There is nothing to stop inB and outB referring to the same buffer - be warned that replacing the output values in outB may change inB in these cases.

Parameters:
inBThe input buffer
outBThe output buffer
Returns:
BOOL indicates whether the output is held in outB (YES), or inB (NO). Means that processors that decide not to touch their data at all don't need to spend time copying between buffers.

Reimplemented in SndAudioFader, SndAudioFader, SndAudioProcessorReverb, SndAudioProcessorReverb, and SndAudioUnitProcessor.

+ (void) registerAudioProcessorClass: (id)  fxclass

Registers an SndAudioProcessor class.

Automatically called by the SndAudioProcessor init method, so any subclasses will automatically register themselves once instantiated.

Parameters:
fxclassThe class of an SndAudioProcessor
+ (void) registerAudioProcessorClass: (id)  fxclass

Registers an SndAudioProcessor class.

Automatically called by the SndAudioProcessor init method, so any subclasses will automatically register themselves once instantiated.

Parameters:
fxclassThe class of an SndAudioProcessor
- (id) reset

Message sent when host determines the SndAudioProcessor should reinitialize its processing state. Eg, a delay processor would zero its z-buffers.

Returns:
self
- (id) reset

Message sent when host determines the SndAudioProcessor should reinitialize its processing state. Eg, a delay processor would zero its z-buffers.

Returns:
self
- (id) setActive: (const BOOL)  b

Sets the active status of the processor.

Parameters:
bTRUE if the processor is to be made active.
Returns:
self
- (id) setActive: (const BOOL)  b

Sets the active status of the processor.

Parameters:
bTRUE if the processor is to be made active.
Returns:
self

(Internal SndKit use only) Individual processors may want to query their enclosing processor chain, for example to get the time at the start of the buffer (nowTime). This method gets called when a processor gets added to the chain, with the id of the chain.

Parameters:
inChain

(Internal SndKit use only) Individual processors may want to query their enclosing processor chain, for example to get the time at the start of the buffer (nowTime). This method gets called when a processor gets added to the chain, with the id of the chain.

Parameters:
inChain
- (id) setName: (NSString *)  aName

Assigns the SndAudioProcessor instance a new name.

Returns:
Returns self.
- (id) setName: (NSString *)  aName

Assigns the SndAudioProcessor instance a new name.

Returns:
Returns self.
- (void) setParam: (const int)  index
toValue: (const float)  value 

Sets the indexed parameter to the value given.

By VST convention, the argument v should be in the range [0,1]. If the internal parameter has a different range, this should be mapped internally.

Parameters:
indexIndex of the parameter to be set.
valueFloating point value in the range [0,1]

Reimplemented in SndAudioFader, SndAudioFader, SndAudioUnitProcessor, SndAudioProcessorReverb, and SndAudioProcessorReverb.

- (void) setParam: (const int)  index
toValue: (const float)  value 

Sets the indexed parameter to the value given.

By VST convention, the argument v should be in the range [0,1]. If the internal parameter has a different range, this should be mapped internally.

Parameters:
indexIndex of the parameter to be set.
valueFloating point value in the range [0,1]

Reimplemented in SndAudioFader, SndAudioFader, SndAudioUnitProcessor, SndAudioProcessorReverb, and SndAudioProcessorReverb.

- (void) setParameterDelegate: (id)  delegate

Assigns the current parameter delegate.

The message -parameter:ofAudioProcessor:didChangeTo: is sent to the delegate when a parameter changes.

Parameters:
delegateAn object to receive notification that a parameter changed value.
- (void) setParameterDelegate: (id)  delegate

Assigns the current parameter delegate.

The message -parameter:ofAudioProcessor:didChangeTo: is sent to the delegate when a parameter changes.

Parameters:
delegateAn object to receive notification that a parameter changed value.
- (void) setParamsWithDictionary: (NSDictionary *)  paramDictionary

Sets parameters with names and values provided by the given NSDictionary.

Parameters:
paramDictionaryan NSDictionary holding NSString keys and NSValue float encoded objects.

Each element in the dictionary has a key with an NSString of the parameter name and an object which is an NSValue of the floating point parameter value.

- (void) setParamsWithDictionary: (NSDictionary *)  paramDictionary

Sets parameters with names and values provided by the given NSDictionary.

Parameters:
paramDictionaryan NSDictionary holding NSString keys and NSValue float encoded objects.

Each element in the dictionary has a key with an NSString of the parameter name and an object which is an NSValue of the floating point parameter value.

- (void) setParamWithKey: (NSString *)  keyName
toValue: (NSNumber *)  value 

Assigns the parameter named keyName to the passed value.

Parameters:
keyNameAn NSString case-sensitively matching a parameter name.
valueAn NSValue holding an encoded float value between 0.0 and 1.0.
- (void) setParamWithKey: (NSString *)  keyName
toValue: (NSNumber *)  value 

Assigns the parameter named keyName to the passed value.

Parameters:
keyNameAn NSString case-sensitively matching a parameter name.
valueAn NSValue holding an encoded float value between 0.0 and 1.0.

Member Data Documentation

- (BOOL) active [protected]

Indicates the processor instance will perform the processing.

The SndAudioProcessorChain hosting this processor

- (NSString *) name [protected]
- (int) numParams [protected]

Number of parameters in the audio processor

- (id) parameterDelegate [protected]

Delegate object informed when a parameters value is changed.


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