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.

Distorsion.h 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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 modify
  7. it under the terms of version 2 of the GNU General Public License
  8. as published by the Free Software Foundation.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License (version 2 or later) for more details.
  13. You should have received a copy of the GNU General Public License (version 2)
  14. along with this program; if not, write to the Free Software Foundation,
  15. Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  16. */
  17. #ifndef DISTORSION_H
  18. #define DISTORSION_H
  19. #include "Effect.h"
  20. /**Distortion Effect*/
  21. class Distorsion:public Effect
  22. {
  23. public:
  24. Distorsion(bool insertion, float *efxoutl_, float *efxoutr_, unsigned int srate, int bufsize);
  25. ~Distorsion();
  26. void out(const Stereo<float *> &smp);
  27. void setpreset(unsigned char npreset);
  28. void changepar(int npar, unsigned char value);
  29. unsigned char getpar(int npar) const;
  30. void cleanup(void);
  31. void applyfilters(float *efxoutl, float *efxoutr);
  32. private:
  33. //Parameters
  34. unsigned char Pvolume; //Volume or E/R
  35. unsigned char Pdrive; //the input amplification
  36. unsigned char Plevel; //the output amplification
  37. unsigned char Ptype; //Distorsion type
  38. unsigned char Pnegate; //if the input is negated
  39. unsigned char Plpf; //lowpass filter
  40. unsigned char Phpf; //highpass filter
  41. unsigned char Pstereo; //0=mono, 1=stereo
  42. unsigned char Pprefiltering; //if you want to do the filtering before the distorsion
  43. void setvolume(unsigned char _Pvolume);
  44. void setlpf(unsigned char _Plpf);
  45. void sethpf(unsigned char _Phpf);
  46. //Real Parameters
  47. class AnalogFilter * lpfl, *lpfr, *hpfl, *hpfr;
  48. };
  49. #endif