#import <TablookiUG.h>
Public Member Functions | |
(id) | - setInput: |
Sets the input patchpoint to aPatchPoint. | |
(id) | - setOutput: |
Sets the output patchpoint to aPatchPoint. | |
(id) | - setLookupTable: |
Sets the SynthData object used as the lookup table to aSynthData. | |
(id) | - idleSelf |
You never send this message. | |
Static Public Member Functions | |
(BOOL) | + shouldOptimize: |
Specifies that all arguments are to be optimized if possible. |
TablookiUG does interpolated table-lookup. It takes its input, which is assumed to be between -1 and 1, scales it so that -1.0 maps onto the start of the table and 1.0 maps onto the end of the table, then does a lookup and returns the corresponding table value. If the computed address is not an integer, TablookiUG does linear interpolation between table values - thus, it gives a high-quality mapping.
To use it in a Waveshaping context, simply use an oscillator as the input to the TablookiUG and set the TablookiUG's table to the appropriate distortion table. For an example, see the Waveshape MKSynthPatch in the Music Kit's MKSynthPatch library.
Note that the table size should be odd. This gives a symetrical table. For example, if the table size is 101, the point at 50 represents 0, there are 50 points corresponding to negative input (0-49, inclusive) and 50 points corresponding to positive input (51-100, inclusive).
TablookiUGabc a output b input c lookup table memory
+ (BOOL) shouldOptimize: | (unsigned) | arg |
Specifies that all arguments are to be optimized if possible.
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) setLookupTable: | (id) | aSynthData |
Sets the SynthData object used as the lookup table to aSynthData.
The table size must be odd. If aSynthData has an even length, the top-most point is not used.
aSynthData | is an id. |
- (id) idleSelf |
You never send this message.
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.
Reimplemented from MKUnitGenerator.