00001 /* 00002 $Id: Mul1add2UG.h 3255 2005-05-14 03:27:27Z leighsmith $ 00003 00004 Defined In: The MusicKit 00005 Description: 00006 Mul1add2UG - from dsp macro /usr/lib/dsp/ugsrc/mul1add2.asm (see source for details). 00007 00008 Outputs the sum of one input signal and the product of two others, i.e, 00009 00010 out = input1 + (input2 * input3) 00011 00012 You allocate one of the subclasses Mul1add2UG<a><b><c><d>, where <a> is the output 00013 space, and <b>, <c>, and <d> are the spaces of the inputs. 00014 00015 The number of inner loop instructions is: 00016 spaces: # instructions: 00017 out in1 in2 in3 00018 y x y x 2 00019 * * y x 3 00020 y x * * 3 00021 all others 4 00022 00023 Original Author: David A. Jaffe 00024 00025 Copyright (c) 1988-1992, NeXT Computer, Inc. 00026 Portions Copyright (c) 1994 NeXT Computer, Inc. and reproduced under license from NeXT 00027 Portions Copyright (c) 1994 Stanford University. 00028 Portions Copyright (c) 1999-2001, The MusicKit Project. 00029 */ 00030 // classgroup Patchpoint Arithmetic 00049 #ifndef __MK_Mul1add2UG_H___ 00050 #define __MK_Mul1add2UG_H___ 00051 00052 #import <MusicKit/MKUnitGenerator.h> 00053 00054 @interface Mul1add2UG: MKUnitGenerator 00055 00063 +(BOOL)shouldOptimize:(unsigned) arg; 00064 00074 -setInput1: (id) aPatchPoint; 00075 /* Sets input1 of adder. */ 00076 00077 00087 -setInput2: (id) aPatchPoint; 00088 /* Sets input2 of adder. */ 00089 00090 00100 -setInput3: (id) aPatchPoint; 00101 /* Sets input3 of adder. */ 00102 00103 00113 -setOutput: (id) aPatchPoint; 00114 /* Sets output of adder. */ 00115 00116 @end 00117 00118 #endif