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.

77 lines
1.9KB

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