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

DelayUG delays its input patchpoint signal by some amount, then writes it to its output patchpoint. More...

#import <DelayUG.h>

Inheritance diagram for DelayUG:
MKUnitGenerator

List of all members.

Public Member Functions

(id) - setInput:
 Sets the input patchpoint to aPatchPoint.
(id) - setOutput:
 Sets the output patchpoint to aPatchPoint.
(id) - setDelayMemory:
 Sets the SynthData object used as the delay memory to aSynthData.
(id) - adjustLength:
 Sets the number of delayed samples to newDelayLength.
(id) - setPointer:
 Repositions the pointer to point to the n'th sample in the delay memory, counting from sample 0.
(id) - resetPointer
 Resets the pointer to the beginning of the delay memory.
(int) - length
 Returns the number of samples in the delay memory.
(id) - idleSelf
 You never send this message.

Static Public Member Functions

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

Detailed Description

DelayUG delays its input patchpoint signal by some amount, then writes it to its output patchpoint.

DelayUG and DelaymUG both delay their input signal by some number of samples before producing it at its output. They require a SynthData object to store the delayed signal. They differ in that DelayUG will accept any SynthData object, while DelaymUG requires a SynthData object allocated as "moduls", using the Orchestra method allocModulsSynthData:. DelaymUG is much more computationally efficient than DelaymUG.

Each DelayUG maintains a single pointer into the delay memory. When the object is run, a tick's worth of samples are read and replaced with an equal number of samples from the input signal. The pointer is then incremented by a tick. When the pointer reaches the end of the delay memory, it automatically jumps back to the beginning, even if it's in the middle of a tick - in other words, the length of the delay memory needn't be a multiple of the tick size. The rate at which the pointer is incremented can't be modified, nor can you offset the beginning of the delay memory. However, you can reposition the pointer to any arbitrary sample in the delay memory through the setPointer: method.

Memory Spaces

DelayUGabc a output b input c delay memory


Member Function Documentation

- (id) adjustLength: (int)  newDelayLength

Sets the number of delayed samples to newDelayLength.

The argument must be no greater than the length of the SynthData object that's used as the delay memory.

Parameters:
newDelayLengthis an int.
Returns:
Returns nil if newDelayLength is too great or if the delay memory hasn't been set; otherwise returns self.
- (id) idleSelf

You never send this message.

Returns:
Returns an id. It's invoked by sending the idle message to the object. Sets the output patchpoint, as well as the delay memory, to sink, thus ensuring that the object does not produce any output. Note that you must send setOutput: and run again to use the MKUnitGenerator after sending idle.
- (int) length

Returns the number of samples in the delay memory.

Returns:
Returns an int. Note that this is the length that's currently being used; it isn't necessarily the same as the length of the SynthData that's being used as the delay memory.
- (id) resetPointer

Resets the pointer to the beginning of the delay memory.

Returns:
Returns an id. Returns nil if the SynthData hasn't been set; otherwise returns self.
- (id) setDelayMemory: (id)  aSynthData

Sets the SynthData object used as the delay memory to aSynthData.

The length of the SynthData must be greater than or equal to the amount of delay (in samples) that's desired. If aSynthData is nil, the delay memory is set to the sink location. For DelaymUG, aSynthData must be allocated as "modulus" memory.

Parameters:
aSynthDatais an id.
Returns:
Returns self.
- (id) setInput: (id)  aPatchPoint

Sets the input patchpoint to aPatchPoint.

Parameters:
aPatchPointis an id.
Returns:
Returns an id. Returns nil if the argument isn't a patchpoint; otherwise returns self.
- (id) setOutput: (id)  aPatchPoint

Sets the output patchpoint to aPatchPoint.

Parameters:
aPatchPointis an id.
Returns:
Returns an id. Returns nil if the argument isn't a patchpoint; otherwise returns self.
- (id) setPointer: (int)  offset

Repositions the pointer to point to the n'th sample in the delay memory, counting from sample 0.

Parameters:
offsetis an int.
Returns:
Returns nil if n is greater than the current length of the delay, or if the delay memory hasn't been set; otherwise returns self.
+ (BOOL) shouldOptimize: (unsigned)  arg

Specifies that all arguments are to be optimized if possible except the delay pointer.

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

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