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.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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
  7. modify it under the terms of the GNU General Public License
  8. as published by the Free Software Foundation; either version 2
  9. of the License, or (at your option) any later version.
  10. */
  11. #ifndef EQ_H
  12. #define EQ_H
  13. #include "Effect.h"
  14. namespace zyncarla {
  15. /**EQ Effect*/
  16. class EQ:public Effect
  17. {
  18. public:
  19. EQ(EffectParams pars);
  20. ~EQ();
  21. void out(const Stereo<float *> &smp);
  22. void setpreset(unsigned char npreset);
  23. void changepar(int npar, unsigned char value);
  24. unsigned char getpar(int npar) const;
  25. void cleanup(void);
  26. float getfreqresponse(float freq);
  27. void getFilter(float *a/*[MAX_EQ_BANDS*MAX_FILTER_STAGES*3]*/,
  28. float *b/*[MAX_EQ_BANDS*MAX_FILTER_STAGES*3]*/) const;
  29. static rtosc::Ports ports;
  30. private:
  31. //Parameters
  32. unsigned char Pvolume;
  33. void setvolume(unsigned char _Pvolume);
  34. struct {
  35. //parameters
  36. unsigned char Ptype, Pfreq, Pgain, Pq, Pstages;
  37. //internal values
  38. /* TODO
  39. * The analog filters here really ought to be dumbed down some as
  40. * you are just looking to do a batch convolution in the end
  41. * Perhaps some static functions to do the filter design?
  42. */
  43. class AnalogFilter *l, *r;
  44. } filter[MAX_EQ_BANDS];
  45. };
  46. }
  47. #endif