MusicKit  0.0.0
Public Member Functions | Static Public Member Functions
ConstantUG Class Reference

ConstantUG simply writes a constant to its output patchpoint. More...

#import <ConstantUG.h>

Inheritance diagram for ConstantUG:
MKUnitGenerator

List of all members.

Public Member Functions

(id) - setConstantDSPDatum:
 Sets the constant value to value.
(id) - setConstant:
 Sets the constant value to a DSPDatum converted from value.
(id) - setOutput:
 Sets the output patchpoint to aPatchPoint.

Static Public Member Functions

(BOOL) + shouldOptimize:
 Specifies that all arguments are to be optimized if possible.

Detailed Description

ConstantUG simply writes a constant to its output patchpoint.

ConstantUG produces a constant value. Since you can set the value of a patchpoint directly through the MKSynthData method setToConstant:, you rarely need instances of this class. However, a ConstantUG object can be used to initialize, on each tick, a constant-valued patchpoint that may have been written to during the previous tick. For example, you can implement additive synthesis by creating a patch in which each oscillator reads a patchpoint, adds its own signal into the value, and then writes the sum back to the same patchpoint in preparation for the next oscillator. In this case, you would use a ConstantUG to clear the patchpoint before the first oscillator reads it.

Memory Spaces

ConstantUGa a output


Member Function Documentation

- (id) setConstant: (double)  value

Sets the constant value to a DSPDatum converted from value.

Parameters:
valueis a double.
Returns:
Returns self.
- (id) setConstantDSPDatum: (DSPDatum)  value

Sets the constant value to value.

Parameters:
valueis an DSPDatum.
Returns:
Returns self.
- (id) setOutput: (id)  aPatchPoint

Sets the output patchpoint to aPatchPoint.

Parameters:
aPatchPointis an id.
Returns:
Returns nil if the argument isn't a patchpoint; otherwise returns self.
+ (BOOL) shouldOptimize: (unsigned)  arg

Specifies that all arguments are to be optimized if possible.

Parameters:
argis an unsigned.
Returns:
Returns an BOOL.

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