home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 November / CMCD1104.ISO / Software / Complet / ZynAddFX / Setup_ZynAddSubFX-2.1.1.exe / Chorus.h < prev    next >
Encoding:
C/C++ Source or Header  |  2004-07-12  |  2.2 KB  |  74 lines

  1. /*
  2.   ZynAddSubFX - a software synthesizer
  3.  
  4.   Chorus.h - Chorus and Flange effects
  5.   Copyright (C) 2002-2004 Nasca Octavian Paul
  6.   Author: Nasca Octavian Paul
  7.  
  8.   This program is free software; you can redistribute it and/or modify
  9.   it under the terms of version 2 of the GNU General Public License 
  10.   as published by the Free Software Foundation.
  11.  
  12.   This program is distributed in the hope that it will be useful,
  13.   but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.   GNU General Public License (version 2) for more details.
  16.  
  17.   You should have received a copy of the GNU General Public License (version 2)
  18.   along with this program; if not, write to the Free Software Foundation,
  19.   Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  20.  
  21. */
  22.  
  23. #ifndef CHORUS_H
  24. #define CHORUS_H
  25. #include "../globals.h"
  26. #include "Effect.h"
  27. #include "EffectLFO.h"
  28.  
  29. #define MAX_CHORUS_DELAY 250.0 //ms
  30.  
  31. class Chorus:public Effect {
  32.     public:
  33.     Chorus(int insetion_,REALTYPE *efxoutl_,REALTYPE *efxoutr_);
  34.     ~Chorus();
  35.     void out(REALTYPE *smpsl,REALTYPE *smpsr);
  36.         void setpreset(unsigned char npreset);
  37.     void changepar(int npar,unsigned char value);
  38.     unsigned char getpar(int npar);
  39.     void cleanup();
  40.         
  41.     private:
  42.     //Parametrii Chorus
  43.     EffectLFO lfo;//lfo-ul chorus
  44.     unsigned char Pvolume;
  45.     unsigned char Ppanning;
  46.     unsigned char Pdepth;//the depth of the Chorus(ms)
  47.     unsigned char Pdelay;//the delay (ms)
  48.     unsigned char Pfb;//feedback
  49.     unsigned char Plrcross;//feedback
  50.     unsigned char Pflangemode;//how the LFO is scaled, to result chorus or flange
  51.     unsigned char Poutsub;//if I wish to substract the output instead of the adding it
  52.  
  53.     
  54.     //Control Parametrii
  55.     void setvolume(unsigned char Pvolume);
  56.     void setpanning(unsigned char Ppanning);
  57.     void setdepth(unsigned char Pdepth);
  58.     void setdelay(unsigned char Pdelay);
  59.     void setfb(unsigned char Pfb);
  60.     void setlrcross(unsigned char Plrcross);
  61.  
  62.     //Valorile interne
  63.     REALTYPE depth,delay,fb,lrcross,panning;
  64.     REALTYPE dl1,dl2,dr1,dr2,lfol,lfor;
  65.     int insertion,maxdelay;
  66.     REALTYPE *delayl,*delayr;
  67.     int dlk,drk,dlhi,dlhi2;
  68.     REALTYPE getdelay(REALTYPE xlfo);
  69.     REALTYPE dllo,mdel;
  70. };
  71.  
  72. #endif
  73.  
  74.