Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

EQ.h 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. ZynAddSubFX - a software synthesizer
  3. EQ.h - EQ Effect
  4. Copyright (C) 2002-2005 Nasca Octavian Paul
  5. Author: Nasca Octavian Paul
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of version 2 of the GNU General Public License
  8. as published by the Free Software Foundation.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License (version 2 or later) for more details.
  13. You should have received a copy of the GNU General Public License (version 2)
  14. along with this program; if not, write to the Free Software Foundation,
  15. Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  16. */
  17. #ifndef EQ_H
  18. #define EQ_H
  19. #include "Effect.h"
  20. /**EQ Effect*/
  21. class EQ:public Effect
  22. {
  23. public:
  24. EQ(EffectParams pars);
  25. ~EQ();
  26. void out(const Stereo<float *> &smp);
  27. void setpreset(unsigned char npreset);
  28. void changepar(int npar, unsigned char value);
  29. unsigned char getpar(int npar) const;
  30. void cleanup(void);
  31. float getfreqresponse(float freq);
  32. void getFilter(float *a/*[MAX_EQ_BANDS*MAX_FILTER_STAGES*3]*/,
  33. float *b/*[MAX_EQ_BANDS*MAX_FILTER_STAGES*3]*/) const;
  34. private:
  35. //Parameters
  36. unsigned char Pvolume;
  37. void setvolume(unsigned char _Pvolume);
  38. struct {
  39. //parameters
  40. unsigned char Ptype, Pfreq, Pgain, Pq, Pstages;
  41. //internal values
  42. /* TODO
  43. * The analog filters here really ought to be dumbed down some as
  44. * you are just looking to do a batch convolution in the end
  45. * Perhaps some static functions to do the filter design?
  46. */
  47. class AnalogFilter *l, *r;
  48. } filter[MAX_EQ_BANDS];
  49. };
  50. #endif