SndAudioProcessor Class Reference

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

#import <SndAudioProcessor.h>

Inheritance diagram for SndAudioProcessor:

SndAudioFader SndAudioProcessorDelay SndAudioProcessorDistortion SndAudioProcessorFlanger SndAudioProcessorNoiseGate SndAudioProcessorRecorder SndAudioProcessorReverb 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

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.

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

+ (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:
fxclass The class of an SndAudioProcessor

+ (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 *) 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.

+ (id) audioProcessor  

Factory method.

To come

Returns:
Returns a freshly initialized, autoreleased SndAudioProcessor

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

Returns an autoreleased instance of a SndProcessor subclass named processorName.

Parameters:
processorName The name of a SndAudioProcessor as returned previously by availableAudioProcessors.
Factory method.

Reimplemented in SndAudioUnitProcessor.

- (id) init  

Initialization method.

Returns:
Returns self.

Reimplemented in SndAudioProcessorReverb.

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

Initialization method.

Parameters:
count Number of parameters.
name Name of sound audio processor.
Returns:
Returns self.

Reimplemented in SndAudioUnitProcessor.

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

Initialization using a dictionary of parameters.

Parameters:
paramDictionary NSDictionary of parameters and values to initialise SndAudioProcessor instance with.
name Name of the SndAudioProcessor to initialise.
Returns:
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

- (int) paramCount  

Gets the number of parameters.

Returns:
number of parameters

- (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:
index Index of the parameter
Returns:
parameter value

Reimplemented in SndAudioUnitProcessor, SndAudioFader, and SndAudioProcessorReverb.

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

Gets the name of indexed parameter.

Parameters:
index Parameter index
Returns:
NSString with parameter name

Reimplemented in SndAudioUnitProcessor, SndAudioFader, and SndAudioProcessorReverb.

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

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

Parameters:
index Parameter 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 *) paramDisplay: (const int)  index  

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

Parameters:
index Parameter 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.

- (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:
index Index of the parameter to be set.
value Floating point value in the range [0,1]

Reimplemented in SndAudioUnitProcessor, SndAudioFader, and SndAudioProcessorReverb.

- (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:
inB The input buffer
outB The 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 SndAudioUnitProcessor, SndAudioFader, and SndAudioProcessorReverb.

- (void) setAudioProcessorChain: (SndAudioProcessorChain *)  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 

Returns the SndAudioProcessorChain to which the processor is attached.

Returns:
Returns a SndAudioProcessorChain instance.

- (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.

- (id) setActive: (const BOOL)  b  

Sets the active status of the processor.

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

- (id) setName: (NSString *)  aName  

Assigns the SndAudioProcessor instance a new name.

Returns:
Returns self.

- (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.

- (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.

- (void) setParamsWithDictionary: (NSDictionary *)  paramDictionary  

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

Parameters:
paramDictionary an 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:
keyName An NSString case-sensitively matching a parameter name.
value An NSValue holding an encoded float value between 0.0 and 1.0.

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

Returns the parameter value as an NSNumber given an index.

Returns:
Returns an NSNumber instance.

- (void) setParameterDelegate: (id)  delegate  

Assigns the current parameter delegate.

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

Parameters:
delegate An object to receive notification that a parameter changed value.

- (id) parameterDelegate  

Returns:
Returns the current parameter delegate.


Member Data Documentation

- (int) numParams [protected]

Number of parameters in the audio processor

The SndAudioProcessorChain hosting this processor

- (NSString*) name [protected]

- (BOOL) active [protected]

Indicates the processor instance will perform the processing.

- (id) parameterDelegate [protected]

Delegate object informed when a parameters value is changed.


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

Generated on Sat Dec 5 17:01:16 2009 for MusicKit by  doxygen 1.5.6