#import <DelayqpUG.h>
Public Member Functions | |
(id) | - setInput: |
Sets the input patchpoint to aPatchPoint. | |
(id) | - setOutput: |
Sets the output patchpoint to aPatchPoint. | |
(id) | - setDelayAddress:length: |
Sets the address and length of the DRAM segment used as delay memory. | |
(id) | - adjustLength: |
Sets the number of delayed samples to newDelayLength. | |
(id) | - setPointer: |
Repositions the pointer to point to the n'th sample in the DRAM segment used as delay memory, counting from sample 0. | |
(id) | - resetPointer |
Resets the pointer to the beginning of the DRAM segment used as delay memory. | |
(int) | - length |
Returns the number of samples delay. | |
(id) | - runSelf |
Subclass implementation of this method provides instructions for making the object's DSP code usable (as defined by the subclass). | |
(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. |
DelayqpUG may only be used on the hub (master) DSP of the Ariel QuintProcessor. It delays its input signal by some number of samples, using the dynamic RAM (DRAM), before producing it at its output. Each DelayqpUG 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.
DRAM requires periodic refreshing. You can control whether this is "implicit" (done by the mere accessing of the memory) or "automatic" (done by the Quint Processor refresh hardware.) The ArielQP method setDRAMAutoRefresh:controls the refresh mode.
Currently there is no support for automatic allocation of DRAM. That is, there is no parallel to the automatic system provided for DSP SRAM. The application must keep track of allocation itself. By convention, location 1 is used as a "sink" location (a place to write garbage) and location 0 is a "zero" location (a place that is guaranteed to always hold a zero, assuming nobody overwrites it.)
The MusicKit does not automatically clear DRAM, with the exception of the "zero" location. If you want to clear a segment of DRAM, use a DelayqpUG, set the input location to [orchestra segmentZero: MK_xPatch] (or MK_yPatch), and let the DelayqpUG run for a while.
DelayqpUGab a output b input
+ (BOOL) shouldOptimize: | (unsigned) | arg |
Specifies that all arguments are to be optimized if possible except the delay pointer.
arg | is an unsigned. |
Reimplemented from MKUnitGenerator.
- (id) setInput: | (id) | aPatchPoint |
Sets the input patchpoint to aPatchPoint.
aPatchPoint | is an id. |
- (id) setOutput: | (id) | aPatchPoint |
Sets the output patchpoint to aPatchPoint.
aPatchPoint | is an id. |
- (id) setDelayAddress: | (DSPDatum) | address | ||
length: | (DSPDatum) | length | ||
Sets the address and length of the DRAM segment used as delay memory.
Also sets the pointer to the start of the DRAM segment.
address | is a DSPDatum. | |
length | is a DSPDatum. |
- (id) adjustLength: | (int) | newDelayLength |
Sets the number of delayed samples to newDelayLength.
newDelayLength | is an int. |
- (id) setPointer: | (int) | offset |
Repositions the pointer to point to the n'th sample in the DRAM segment used as delay memory, counting from sample 0.
offset | is an int. |
- (id) resetPointer |
Resets the pointer to the beginning of the DRAM segment used as delay memory.
- (int) length |
Returns the number of samples delay.
- (id) runSelf |
Subclass implementation of this method provides instructions for making the object's DSP code usable (as defined by the subclass).
You never invoke this method directly, it's invoked automatically by the run method. The default does nothing and returns the receiver.
Reimplemented from MKUnitGenerator.
- (id) idleSelf |
You never send this message.
It's invoked by sending the idlemessage to the object. Sets the output patchpoint to sink, thus ensuring that the object does not produce any output. Also, sets the DRAM delay memory segment to DRAM's sink (location 0) and the length to 1, so that the object. Note that you must send setOutput: and run again to use the MKUnitGenerator after sending idle.
Reimplemented from MKUnitGenerator.