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.

72 lines
1.8KB

  1. // ----------------------------------------------------------------------
  2. //
  3. // Copyright (C) 2011 Fons Adriaensen <fons@linuxaudio.org>
  4. //
  5. // This program is free software; you can redistribute it and/or modify
  6. // it under the terms of the GNU General Public License as published by
  7. // the Free Software Foundation; either version 2 of the License, or
  8. // (at your option) any later version.
  9. //
  10. // This program is distributed in the hope that it will be useful,
  11. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. // GNU General Public License for more details.
  14. //
  15. // You should have received a copy of the GNU General Public License
  16. // along with this program; if not, write to the Free Software
  17. // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. //
  19. // ----------------------------------------------------------------------
  20. #ifndef __HP3FILT_H
  21. #define __HP3FILT_H
  22. #include <stdint.h>
  23. #include "global.h"
  24. class HP3filt
  25. {
  26. public:
  27. HP3filt (void);
  28. ~HP3filt (void);
  29. void setfsamp (float fsamp);
  30. void setparam (float f)
  31. {
  32. _f0 = f;
  33. _touch0++;
  34. }
  35. void reset (void);
  36. void prepare (int nsamp);
  37. void process (int nsamp, int nchan, float *data[])
  38. {
  39. if (_state != BYPASS) process1 (nsamp, nchan, data);
  40. }
  41. float response (float f);
  42. private:
  43. enum { BYPASS, STATIC, FADING };
  44. void calcpar1 (int nsamp, float f);
  45. void process1 (int nsamp, int nchan, float *data[]);
  46. volatile int16_t _touch0;
  47. volatile int16_t _touch1;
  48. int _state;
  49. float _fsamp;
  50. float _f0, _f1;
  51. float _c1, _c2, _c3;
  52. float _g, _a, _d;
  53. float _z1 [2];
  54. float _z2 [2];
  55. float _z3 [2];
  56. };
  57. #endif