External plugins for 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.

64 lines
1.9KB

  1. /*
  2. ZynAddSubFX - a software synthesizer
  3. DynamicFilter.h - "WahWah" effect and others
  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 DYNAMICFILTER_H
  12. #define DYNAMICFILTER_H
  13. #include "Effect.h"
  14. #include "EffectLFO.h"
  15. namespace zyncarla {
  16. /**DynamicFilter Effect*/
  17. class DynamicFilter:public Effect
  18. {
  19. public:
  20. DynamicFilter(EffectParams pars, const AbsTime *time = nullptr);
  21. ~DynamicFilter();
  22. void out(const Stereo<float *> &smp);
  23. void setpreset(unsigned char npreset) { setpreset(npreset, false); };
  24. void setpreset(unsigned char npreset, bool protect);
  25. void changepar(int npar, unsigned char value);
  26. unsigned char getpar(int npar) const;
  27. void cleanup(void);
  28. static rtosc::Ports ports;
  29. private:
  30. //Parametrii DynamicFilter
  31. EffectLFO lfo; //lfo-ul DynamicFilter
  32. unsigned char Pvolume; //Volume
  33. unsigned char Pdepth; //the depth of the lfo
  34. unsigned char Pampsns; //how the filter varies according to the input amplitude
  35. unsigned char Pampsnsinv; //if the filter freq is lowered if the input amplitude rises
  36. unsigned char Pampsmooth; //how smooth the input amplitude changes the filter
  37. //Parameter Control
  38. void setvolume(unsigned char _Pvolume);
  39. void setdepth(unsigned char _Pdepth);
  40. void setampsns(unsigned char _Pampsns);
  41. void setfilterpreset(unsigned char npreset);
  42. void reinitfilter(void);
  43. //Internal Values
  44. float depth, ampsns, ampsmooth;
  45. class Filter * filterl, *filterr;
  46. float ms1, ms2, ms3, ms4; //mean squares
  47. };
  48. }
  49. #endif