00001 /* 00002 $Id: OnepoleUG.h 3255 2005-05-14 03:27:27Z leighsmith $ 00003 Defined In: This class is part of the Music Kit UnitGenerator Library. 00004 00005 Description: 00006 OnepoleUG - from dsp macro /usr/lib/dsp/ugsrc/onepole.asm (see source for details). 00007 00008 The onepole unit-generator implements a one-pole 00009 filter section in direct form. 00010 00011 You instantiate a subclass of the form 00012 OnepoleUG<a><b>, where <a> = space of output and <b> = space of input. 00013 00014 Original Author: David A. Jaffe 00015 00016 Copyright (c) 1988-1992, NeXT Computer, Inc. 00017 Portions Copyright (c) 1994 NeXT Computer, Inc. and reproduced under license from NeXT 00018 Portions Copyright (c) 1994 Stanford University 00019 Portions Copyright (c) 2000 The MusicKit Project 00020 */ 00021 // classgroup Filters 00061 #ifndef __MK_OnepoleUG_H___ 00062 #define __MK_OnepoleUG_H___ 00063 00064 #import <MusicKit/MKUnitGenerator.h> 00065 00066 @interface OnepoleUG : MKUnitGenerator 00067 00077 -setInput: (id) aPatchPoint; 00078 /* Sets filter input. */ 00079 00080 00090 -setOutput: (id) aPatchPoint; 00091 /* Sets filter output. */ 00092 00102 -setB0:(double) value; 00103 /* Sets gain of filter. */ 00104 00105 00116 -setA1:(double)value; 00117 /* Sets gain of delayed output sample. */ 00118 00127 +(BOOL)shouldOptimize:(unsigned) arg; 00128 00136 -clear; 00137 /* Clears internal filter running term. */ 00138 00146 -setState:(double)val; 00147 00165 - setBrightness: (double) brightness forFreq: (double) frequency; 00166 /* You specify the gain at the specified fundamental frequency and the 00167 appropriate filter frequency response is selected for you. By keeping 00168 the gain constant and varying the frequency, you can have a uniform 00169 amplitude and brightness percept (i.e. a "dynamic level"). 00170 00171 Note that setting the brightness does not clear the filter state variable. 00172 You may want to do this in some cases. 00173 */ 00174 00175 @end 00176 00177 #endif