Eq.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. Eq.h
  3. Copyright 2004-5 Tim Goetze <tim@quitte.de>
  4. http://quitte.de/dsp/
  5. equalizer circuit using recursive filtering.
  6. */
  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. This program is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. GNU General Public License for more details.
  16. You should have received a copy of the GNU General Public License
  17. along with this program; if not, write to the Free Software
  18. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  19. 02111-1307, USA or point your web browser to http://www.gnu.org.
  20. */
  21. #ifndef _EQ_H_
  22. #define _EQ_H_
  23. #include "dsp/util.h"
  24. #include "dsp/Eq.h"
  25. #include "dsp/BiQuad.h"
  26. #include "dsp/RBJ.h"
  27. class Eq
  28. : public Plugin
  29. {
  30. public:
  31. sample_t gain[10];
  32. DSP::Eq<10> eq;
  33. int block;
  34. enum { BlockSize = 64 };
  35. template <sample_func_t F>
  36. void one_cycle (int frames);
  37. public:
  38. static PortInfo port_info [];
  39. void init();
  40. void activate();
  41. void run (int n)
  42. {
  43. one_cycle<store_func> (n);
  44. }
  45. void run_adding (int n)
  46. {
  47. one_cycle<adding_func> (n);
  48. }
  49. };
  50. class Eq2x2
  51. : public Plugin
  52. {
  53. public:
  54. sample_t gain[10];
  55. DSP::Eq<10> eq[2];
  56. template <sample_func_t F>
  57. void one_cycle (int frames);
  58. public:
  59. static PortInfo port_info [];
  60. void init();
  61. void activate();
  62. void run (int n)
  63. {
  64. one_cycle<store_func> (n);
  65. }
  66. void run_adding (int n)
  67. {
  68. one_cycle<adding_func> (n);
  69. }
  70. };
  71. #endif /* _EQ_H_ */