MusicKit  0.0.0
SndAudioProcessorReverb.h
00001 
00002 //
00003 //  $Id$
00004 //
00005 //  Description:
00006 //    FreeVerb-based
00007 //    FreeVerb originally written by Jezar at Dreampoint, June 2000
00008 //    http://www.dreampoint.co.uk
00009 //
00010 //  Original Author: SKoT McDonald, <skot@tomandandy.com>
00011 //  Rewritten by: Leigh M. Smith <leigh@leighsmith.com>
00012 //
00013 //  Jezar's code described as "This code is public domain"
00014 //
00015 //  Copyright (c) 2001,2009 The MusicKit Project.  All rights reserved.
00016 //
00017 //  Permission is granted to use and modify this code for commercial and
00018 //  non-commercial purposes so long as the author attribution and copyright
00019 //  messages remain intact and accompany all relevant code.
00020 //
00022 
00023 #ifndef __SNDKIT_SNDAUDIOPROCESSORREVERB_H__
00024 #define __SNDKIT_SNDAUDIOPROCESSORREVERB_H__
00025 
00026 #import <Foundation/Foundation.h>
00027 #import "SndAudioProcessor.h"
00028 
00029 @class SndReverbCombFilter;
00030 @class SndReverbAllpassFilter;
00031 
00032 #define NUMCOMBS 8
00033 #define NUMALLPASSES 4
00034 #define NUMCHANNELS 2
00035 
00046 enum {
00047     rvrbRoomSize  = 0,
00048     rvrbDamp      = 1,
00049     rvrbWet       = 2,
00050     rvrbDry       = 3,
00051     rvrbWidth     = 4,
00052     rvrbMode      = 5, 
00053     rvrbNumParams = 6
00054 };
00055 
00057 
00064 @interface SndAudioProcessorReverb : SndAudioProcessor {
00065     float gain;
00066     float roomsize, roomsize1;
00067     float damp, damp1;
00068     float wet, wet1, wet2;
00069     float dry;
00070     float width;
00071     float mode;
00072 
00073     // The following are all declared statically allocated 
00074     // to speed up the traversal across the filters.
00075 
00077     SndReverbCombFilter *comb[NUMCHANNELS][NUMCOMBS];
00078 
00080     SndReverbAllpassFilter *allpass[NUMCHANNELS][NUMALLPASSES];
00081 
00082     long   bufferLength;
00083     float *inputMix;
00084     float *outputAccumL;
00085     float *outputAccumR;
00086 }
00087 
00088 - init;
00089 
00090 - (void) mute;
00091 
00092 - (BOOL) processReplacingInputBuffer: (SndAudioBuffer *) inB 
00093                         outputBuffer: (SndAudioBuffer *) outB;
00094 
00095 - (float) paramValue: (const int) index;
00096 
00097 - (NSString *) paramName: (const int) index;
00098 
00099 - (void) setParam: (const int) index toValue: (const float) v;
00100 
00101 // Recalculate internal values after parameter change
00102 - (void) update;
00103 
00104 - (void) setRoomSize: (float) value;
00105 
00106 - (float) getRoomSize;
00107 
00108 - (void) setDamp: (float) value;
00109 
00110 - (float) getDamp;
00111 
00112 - (void) setWet: (float) value;
00113 
00114 - (float) getWet;
00115 
00116 - (void) setDry: (float) value;
00117 
00118 - (float) getDry;
00119 
00120 - (void) setWidth: (float) value;
00121 
00122 - (float) getWidth;
00123 
00124 - (void) setMode: (float) value;
00125 
00126 - (float) getMode;
00127 
00129 
00130 @end
00131 
00132 #endif