00001 /* 00002 $Id: DswitchUG.h 3255 2005-05-14 03:27:27Z leighsmith $ 00003 00004 Defined In: The MusicKit 00005 Description: 00006 DswitchUG - from dsp macro /usr/lib/dsp/ugsrc/dswitch.asm (see source for details). 00007 00008 The DswitchUG switches from input1 (scaled) to a 00009 input2 (unscaled) after a delay specified in samples. The delay 00010 can be interpreted as the number of samples input1 is passed to 00011 the output. On each output sample, the delay is decremented by 1. 00012 Input1 times the scale factor scale1 is passed to the output as long 00013 as delay remains nonnegative. Afterwards, input2 is passed 00014 to the output with no scaling. 00015 00016 You instantiate a subclass of the form 00017 DswitchUG<a><b>, where 00018 <a> = space of output 00019 <b> = space of inputs 00020 00021 Original Author: David A. Jaffe 00022 00023 Copyright (c) 1988-1992, NeXT Computer, Inc. 00024 Portions Copyright (c) 1994 NeXT Computer, Inc. and reproduced under license from NeXT 00025 Portions Copyright (c) 1994 Stanford University. 00026 Portions Copyright (c) 1999-2001, The MusicKit Project. 00027 */ 00028 // classgroup Delays and Time-Modification Units 00050 #ifndef __MK_DswitchUG_H___ 00051 #define __MK_DswitchUG_H___ 00052 00053 #import <MusicKit/MKUnitGenerator.h> 00054 00055 @interface DswitchUG : MKUnitGenerator 00056 00065 +(BOOL)shouldOptimize:(unsigned) arg; 00066 /* Specifies that all arguments are to be optimized if possible except the 00067 delay counter. */ 00068 00078 -setInput1: (id) aPatchPoint; 00079 /* Sets input1 to specified patchPoint. */ 00080 00081 00091 -setInput2: (id) aPatchPoint; 00092 /* Sets input2 to specified patchPoint. */ 00093 00094 00104 -setOutput: (id) aPatchPoint; 00105 /* Sets output to specified patchPoint. */ 00106 00107 00113 - setScale1: (double) scale; 00114 00128 - setDelaySamples: (int) count; 00129 00140 -idleSelf; 00141 /* Patches output to sink. */ 00142 00143 @end 00144 00145 #endif