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.

58 lines
1.7KB

  1. /*
  2. ZynAddSubFX - a software synthesizer
  3. Distorsion.h - Distorsion Effect
  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 DISTORSION_H
  12. #define DISTORSION_H
  13. #include "Effect.h"
  14. namespace zyncarla {
  15. /**Distortion Effect*/
  16. class Distorsion:public Effect
  17. {
  18. public:
  19. Distorsion(EffectParams pars);
  20. ~Distorsion();
  21. void out(const Stereo<float *> &smp);
  22. void setpreset(unsigned char npreset);
  23. void changepar(int npar, unsigned char value);
  24. unsigned char getpar(int npar) const;
  25. void cleanup(void);
  26. void applyfilters(float *efxoutl, float *efxoutr);
  27. static rtosc::Ports ports;
  28. private:
  29. //Parameters
  30. unsigned char Pvolume; //Volume or E/R
  31. unsigned char Pdrive; //the input amplification
  32. unsigned char Plevel; //the output amplification
  33. unsigned char Ptype; //Distorsion type
  34. unsigned char Pnegate; //if the input is negated
  35. unsigned char Plpf; //lowpass filter
  36. unsigned char Phpf; //highpass filter
  37. unsigned char Pstereo; //0=mono, 1=stereo
  38. unsigned char Pprefiltering; //if you want to do the filtering before the distorsion
  39. void setvolume(unsigned char _Pvolume);
  40. void setlpf(unsigned char _Plpf);
  41. void sethpf(unsigned char _Phpf);
  42. //Real Parameters
  43. class AnalogFilter * lpfl, *lpfr, *hpfl, *hpfr;
  44. };
  45. }
  46. #endif