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.

shuffler.h 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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 __SHUFFLER_H
  22. #define __SHUFFLER_H
  23. #include <zita-convolver.h>
  24. #include "global.h"
  25. namespace BLS1 {
  26. class Shuffler
  27. {
  28. public:
  29. Shuffler (void);
  30. ~Shuffler (void);
  31. void init (int fsamp, int quant, int abspri, int policy);
  32. void reset (void);
  33. void prepare (float gain, float freq);
  34. void process (int nsamp, float *inp [], float *out []);
  35. bool ready (void) { return _touch0 == _touch1; }
  36. private:
  37. void fini (void);
  38. float _fsamp;
  39. int _quant;
  40. int _minpt;
  41. int _iplen;
  42. int _delay;
  43. float *_fft_time;
  44. fftwf_complex *_fft_freq;
  45. fftwf_plan _fft_plan;
  46. int _del_size;
  47. int _del_wind;
  48. float *_del_data;
  49. int _state;
  50. int _count;
  51. volatile int16_t _touch0;
  52. volatile int16_t _touch1;
  53. Convproc _convproc;
  54. };
  55. }
  56. #endif