#import <OnepoleUG.h>
Public Member Functions | |
(id) | - setInput: |
Sets the input patchpoint to aPatchPoint. | |
(id) | - setOutput: |
Sets the output patchpoint to aPatchPoint. | |
(id) | - setB0: |
Sets the filter's gain. | |
(id) | - setA1: |
Sets the filter's coefficient. | |
(id) | - clear |
Clears the filter by setting the delayed sample (the previous output sample) to 0.0. | |
(id) | - setState: |
Sets internal filter running term. | |
(id) | - setBrightness:forFreq: |
This is a convenient method that adjusts the filter's gain and coefficient such that a constant brightness value produces the same number and relative amplitudes of a tone's harmonics regardless of the value of frequency as described in Jaffe/Smith, Computer Music Journal Vol. 7, No. 2, Summer 1983. | |
Static Public Member Functions | |
(BOOL) | + shouldOptimize: |
Specifies that all arguments are to be optimized if possible except the filter state. |
OnepoleUG is a one-pole filter that's implemented by subtracting the previous output sample (initialized as 0.0) from the current input sample:
output = (b0 * input) - (a1 * previousOutput)
previousOutput = output
Note that the two samples have their own scalers:
Similar to the OnepoleUG is the OnezeroUG; it, too, is either a low-pass or a high-pass filter, but the frequency roll-off is gentler than with a OnepoleUG. You should also note that the high-pass/low-pass determination with regard to the sign of the coefficent is switched in the OnezeroUG.
OnepoleUGab a output b input
- (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) setB0: | (double) | value |
Sets the filter's gain.
value | is a double. |
- (id) setA1: | (double) | value |
Sets the filter's coefficient.
value | is a double. |
+ (BOOL) shouldOptimize: | (unsigned) | arg |
Specifies that all arguments are to be optimized if possible except the filter state.
arg | is an unsigned. |
- (id) clear |
Clears the filter by setting the delayed sample (the previous output sample) to 0.0.
- (id) setState: | (double) | val |
Sets internal filter running term.
val | is a double. |
- (id) setBrightness: | (double) | brightness | ||
forFreq: | (double) | frequency | ||
This is a convenient method that adjusts the filter's gain and coefficient such that a constant brightness value produces the same number and relative amplitudes of a tone's harmonics regardless of the value of frequency as described in Jaffe/Smith, Computer Music Journal Vol. 7, No. 2, Summer 1983.
For example, in a musical phrase during which the brightness of the synthesized notes shouldn't be perceived to change, you would invoke this method once per note passing a constant brightness value (the successive frequency values would, of course, be determined by the pitches of the notes).
brightness | is a double specifying the gain. | |
frequency | is a double. |