00001 /* 00002 $Id: SnoiseUG.h 3255 2005-05-14 03:27:27Z leighsmith $ 00003 Defined In: The MusicKit 00004 00005 Description: 00006 SnoiseUG - from dsp macro /usr/lib/dsp/ugsrc/snoise.asm (see source for details). 00007 00008 You instantiate a subclass of the form SnoiseUG<a>, where 00009 <a> = space of output. 00010 00011 SnoiseUG computes uniform pseudo-white noise using the linear congruential 00012 method for random number generation (reference: Knuth, volume II of The Art 00013 of Computer Programming). Whereas UnoiseUG computes a new random value 00014 every sample, SnoiseUG computes a new random value every tick (16 samples), 00015 and is 3 times faster. 00016 00017 Original Author: David A. Jaffe 00018 00019 Copyright (c) 1988-1992, NeXT Computer, Inc. 00020 Portions Copyright (c) 1994 NeXT Computer, Inc. and reproduced under license from NeXT 00021 Portions Copyright (c) 1994 Stanford University. 00022 Portions Copyright (c) 1999-2001, The MusicKit Project. 00023 */ 00024 // classgroup Oscillators and Waveform Generators 00041 #ifndef __MK_SnoiseUG_H___ 00042 #define __MK_SnoiseUG_H___ 00043 00044 #import <MusicKit/MKUnitGenerator.h> 00045 00046 @interface SnoiseUG: MKUnitGenerator 00047 00059 - idleSelf; 00060 00066 + (BOOL) shouldOptimize: (unsigned) arg; 00067 00077 - setSeed: (DSPDatum) seedVal; 00078 00087 -anySeed; 00088 /* Sets seed of random sequence to a new seed, never before used by previous 00089 invocations of anySeed. Useful, for insuring that different 00090 noise generators generate different noise. */ 00091 00092 00098 - setOutput: (id) aPatchPoint; 00099 00100 @end 00101 00102 #endif