EQ.h (1679B)
1 /* 2 ZynAddSubFX - a software synthesizer 3 4 EQ.h - EQ Effect 5 Copyright (C) 2002-2005 Nasca Octavian Paul 6 Author: Nasca Octavian Paul 7 8 This program is free software; you can redistribute it and/or 9 modify it under the terms of the GNU General Public License 10 as published by the Free Software Foundation; either version 2 11 of the License, or (at your option) any later version. 12 */ 13 14 #ifndef EQ_H 15 #define EQ_H 16 17 #include "Effect.h" 18 19 namespace zyn { 20 21 /**EQ Effect*/ 22 class EQ final:public Effect 23 { 24 public: 25 EQ(EffectParams pars); 26 ~EQ(); 27 void out(const Stereo<float *> &smp); 28 unsigned char getpresetpar(unsigned char npreset, unsigned int npar); 29 void setpreset(unsigned char npreset); 30 void changepar(int npar, unsigned char value); 31 unsigned char getpar(int npar) const; 32 void cleanup(void); 33 float getfreqresponse(float freq); 34 35 void getFilter(float *a/*[MAX_EQ_BANDS*MAX_FILTER_STAGES*3]*/, 36 float *b/*[MAX_EQ_BANDS*MAX_FILTER_STAGES*3]*/) const; 37 38 static rtosc::Ports ports; 39 private: 40 //Parameters 41 unsigned char Pvolume; 42 43 void setvolume(unsigned char _Pvolume); 44 45 struct { 46 //parameters 47 unsigned char Ptype, Pfreq, Pgain, Pq, Pstages; 48 //internal values 49 50 /* TODO 51 * The analog filters here really ought to be dumbed down some as 52 * you are just looking to do a batch convolution in the end 53 * Perhaps some static functions to do the filter design? 54 */ 55 class AnalogFilter *l, *r; 56 } filter[MAX_EQ_BANDS]; 57 }; 58 59 } 60 61 #endif