MusicKit
0.0.0
|
A VST-like audio FX processing module base class. More...
#import <SndAudioProcessor.h>
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 |
SndAudioProcessorChain * | audioProcessorChain |
NSString * | name |
BOOL | active |
id | parameterDelegate |
A VST-like audio FX processing module base class.
To come
+ (id) audioProcessor |
+ (id) audioProcessor |
Returns the SndAudioProcessorChain to which the processor is attached.
Returns the SndAudioProcessorChain to which the processor is attached.
+ (SndAudioProcessor *) audioProcessorNamed: | (NSString *) | processorName |
Returns an autoreleased instance of a SndProcessor subclass named processorName.
processorName | The 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.
processorName | The 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:.
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:.
Reimplemented in SndAudioUnitProcessor.
+ (NSArray*) fxClasses |
Use this to get a list of all the available FX processors.
+ (NSArray*) fxClasses |
Use this to get a list of all the available FX processors.
- (id) init |
Initialization method.
Reimplemented in SndAudioProcessorReverb, and SndAudioProcessorReverb.
- (id) init |
Initialization method.
Reimplemented in SndAudioProcessorReverb, and SndAudioProcessorReverb.
- (id) initWithParamCount: | (const int) | count | |
name: | (NSString *) | name | |
Initialization method.
count | Number of parameters. |
name | Name of sound audio processor. |
Reimplemented in SndAudioUnitProcessor.
- (id) initWithParamCount: | (const int) | count | |
name: | (NSString *) | name | |
Initialization method.
count | Number of parameters. |
name | Name of sound audio processor. |
Reimplemented in SndAudioUnitProcessor.
- (id) initWithParameterDictionary: | (NSDictionary *) | paramDictionary | |
name: | (NSString *) | name | |
Initialization using a dictionary of parameters.
paramDictionary | NSDictionary of parameters and values to initialise SndAudioProcessor instance with. |
name | Name of the SndAudioProcessor to initialise. |
- (id) initWithParameterDictionary: | (NSDictionary *) | paramDictionary | |
name: | (NSString *) | name | |
Initialization using a dictionary of parameters.
paramDictionary | NSDictionary of parameters and values to initialise SndAudioProcessor instance with. |
name | Name of the SndAudioProcessor to initialise. |
- (BOOL) isActive |
Processor activity status query method.
- (BOOL) isActive |
Processor activity status query method.
- (NSString *) name |
Returns the name of the audio processor.
The name may or may not be unique to each instance of a SndAudioProcessor.
- (NSString *) name |
Returns the name of the audio processor.
The name may or may not be unique to each instance of a SndAudioProcessor.
- (int) paramCount |
Gets the number of parameters.
- (int) paramCount |
Gets the number of parameters.
- (NSDictionary *) paramDictionary |
Returns an NSDictionary holding all parameters of a SndAudioProcessor instance.
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.
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.
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.
Reimplemented in SndAudioUnitProcessor.
- (NSString *) paramDisplay: | (const int) | index |
Converts an object-internal value into a more user-friendly representation.
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.
Reimplemented in SndAudioUnitProcessor.
- (id) parameterDelegate |
- (id) parameterDelegate |
- (NSString *) paramLabel: | (const int) | index |
Returns a label or extra text describing the parameters units of measurement.
index | Parameter index |
Example: if the parameter is in deciBels, an appropriate result might be to return "dB"
Reimplemented in SndAudioUnitProcessor.
- (NSString *) paramLabel: | (const int) | index |
Returns a label or extra text describing the parameters units of measurement.
index | Parameter index |
Example: if the parameter is in deciBels, an appropriate result might be to return "dB"
Reimplemented in SndAudioUnitProcessor.
- (NSString *) paramName: | (const int) | index |
Gets the name of indexed parameter.
index | Parameter index |
Reimplemented in SndAudioFader, SndAudioFader, SndAudioProcessorReverb, SndAudioProcessorReverb, and SndAudioUnitProcessor.
- (NSString *) paramName: | (const int) | index |
Gets the name of indexed parameter.
index | Parameter index |
Reimplemented in SndAudioFader, SndAudioFader, SndAudioProcessorReverb, SndAudioProcessorReverb, and SndAudioUnitProcessor.
- (NSNumber *) paramObjectForIndex: | (const int) | i |
Returns the parameter value as an NSNumber given an index.
- (NSNumber *) paramObjectForIndex: | (const int) | i |
Returns the parameter value as an NSNumber given an index.
- (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.
index | Index of the parameter |
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.
index | Index of the parameter |
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.
inB | The input buffer |
outB | The output buffer |
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.
inB | The input buffer |
outB | The output buffer |
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.
fxclass | The 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.
fxclass | The 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.
- (id) reset |
Message sent when host determines the SndAudioProcessor should reinitialize its processing state. Eg, a delay processor would zero its z-buffers.
- (id) setActive: | (const BOOL) | b |
Sets the active status of the processor.
b | TRUE if the processor is to be made active. |
- (id) setActive: | (const BOOL) | b |
Sets the active status of the processor.
b | TRUE if the processor is to be made active. |
- (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.
inChain |
- (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.
inChain |
- (id) setName: | (NSString *) | aName |
Assigns the SndAudioProcessor instance a new name.
- (id) setName: | (NSString *) | aName |
Assigns the SndAudioProcessor instance a new name.
- (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.
index | Index of the parameter to be set. |
value | Floating 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.
index | Index of the parameter to be set. |
value | Floating 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.
delegate | An 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.
delegate | An object to receive notification that a parameter changed value. |
- (void) setParamsWithDictionary: | (NSDictionary *) | paramDictionary |
Sets parameters with names and values provided by the given NSDictionary.
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) setParamsWithDictionary: | (NSDictionary *) | paramDictionary |
Sets parameters with names and values provided by the given NSDictionary.
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.
keyName | An NSString case-sensitively matching a parameter name. |
value | An 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.
keyName | An NSString case-sensitively matching a parameter name. |
value | An NSValue holding an encoded float value between 0.0 and 1.0. |
- (BOOL) active [protected] |
Indicates the processor instance will perform the processing.
- (SndAudioProcessorChain *) audioProcessorChain [protected] |
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.