Distortion.h (1960B)
1 /* 2 ZynAddSubFX - a software synthesizer 3 4 Distortion.h - Distortion Effect 5 Copyright (C) 2002-2005 Nasca Octavian Paul 6 Author: Nasca Octavian Paul 7 8 This program is free software; you can redistribute it and/or 9 modify it under the terms of the GNU General Public License 10 as published by the Free Software Foundation; either version 2 11 of the License, or (at your option) any later version. 12 */ 13 14 #ifndef DISTORTION_H 15 #define DISTORTION_H 16 17 #include "Effect.h" 18 19 namespace zyn { 20 21 /**Distortion Effect*/ 22 class Distortion final :public Effect 23 { 24 public: 25 Distortion(EffectParams pars); 26 ~Distortion(); 27 void out(const Stereo<float *> &smp); 28 unsigned char getpresetpar(unsigned char npreset, unsigned int npar); 29 void setpreset(unsigned char npreset); 30 void changepar(int npar, unsigned char value); 31 unsigned char getpar(int npar) const; 32 void cleanup(void); 33 void applyfilters(float *efxoutl, float *efxoutr); 34 35 static rtosc::Ports ports; 36 private: 37 //Parameters 38 unsigned char Pvolume; //Volume or E/R 39 unsigned char Pdrive; //the input amplification 40 unsigned char Plevel; //the output amplification 41 unsigned char Ptype; //Distortion type 42 unsigned char Pnegate; //if the input is negated 43 unsigned char Plpf; //lowpass filter 44 unsigned char Phpf; //highpass filter 45 unsigned char Pstereo; //0=mono, 1=stereo 46 unsigned char Pprefiltering; //if you want to do the filtering before the distortion 47 unsigned char Pfuncpar; //for parametric functions 48 unsigned char Poffset; //the input offset 49 50 void setvolume(unsigned char _Pvolume); 51 void setlpf(unsigned char _Plpf); 52 void sethpf(unsigned char _Phpf); 53 54 //Real Parameters 55 class AnalogFilter * lpfl, *lpfr, *hpfl, *hpfr; 56 }; 57 58 } 59 60 #endif