MusicKit  0.0.0
DswitchtUG.h
00001 /*
00002   $Id$
00003   
00004   Defined In: The MusicKit
00005   Description:
00006     DswitchtUG  - from dsp macro /usr/lib/dsp/ugsrc/dswitcht.asm (see source for details).
00007 
00008   The DswitchtUG switches from input1 (scaled by scale1) to a 
00009   input2 (scaled by scale2) 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 its own scaling.
00015 
00016   You instantiate a subclass of the form 
00017   DswitchtUG<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
00051 #ifndef __MK_DswitchtUG_H___
00052 #define __MK_DswitchtUG_H___
00053 
00054 #import <MusicKit/MKUnitGenerator.h>
00055 
00056 @interface DswitchtUG : MKUnitGenerator
00057 
00066 +(BOOL)shouldOptimize:(unsigned) arg;
00067 /* Specifies that all arguments are to be optimized if possible except the
00068    delay counter. */
00069 
00070 
00080 -setInput1: (id) aPatchPoint;
00081 /* Sets input1 to specified patchPoint. */
00082 
00083 
00093 -setInput2: (id) aPatchPoint;
00094 /* Sets input2 to specified patchPoint. */
00095 
00096 
00106 - setOutput: (id) aPatchPoint;
00107 
00113 - setScale1: (double) scale;
00114 
00120 - setScale2: (double) scale;
00121 
00135 - setDelayTicks: (int) count;
00136 /* Sets delay in ticks (units of DSPMK_NTICK). 
00137    A negative value will switch immediately to input2. */
00138 
00139 
00151 -idleSelf;
00152 /* Patches output to sink. */
00153 
00154 @end
00155 
00156 #endif