1 /*
2   ZynAddSubFX - a software synthesizer
3 
4   Echo.h - Echo Effect
5   Copyright (C) 2002-2005 Nasca Octavian Paul
6   Author: Nasca Octavian Paul
7 
8   Modified for rakarrack by Josep Andreu
9 
10   This program is free software; you can redistribute it and/or modify
11   it under the terms of version 2 of the GNU General Public License
12   as published by the Free Software Foundation.
13 
14   This program is distributed in the hope that it will be useful,
15   but WITHOUT ANY WARRANTY; without even the implied warranty of
16   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17   GNU General Public License (version 2) for more details.
18 
19   You should have received a copy of the GNU General Public License (version 2)
20   along with this program; if not, write to the Free Software Foundation,
21   Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
22 
23 */
24 
25 #ifndef MUSDELAY_H
26 #define MUSDELAY_H
27 
28 #include "global.h"
29 
30 
31 class MusicDelay
32 {
33 public:
34     MusicDelay (float * efxoutl_, float * efxoutr_, double sample_rate);
35     ~MusicDelay ();
36     void out (float * smpsl, float * smpr, uint32_t period);
37     void setpreset (int npreset);
38     void changepar (int npar, int value);
39     int getpar (int npar);
40     void cleanup ();
41 
42     int Ppreset;
43     float outvolume;
44 
45     float *efxoutl;
46     float *efxoutr;
47 
48 
49 private:
50 
51     void setvolume (int Pvolume);
52     void setpanning (int num, int Ppanning);
53     void setdelay (int num, int Pdelay);
54     void setgain (int num, int Pgain);
55     void setlrdelay (int Plrdelay);
56     void setlrcross (int Plrcross);
57     void setfb (int num, int Pfb);
58     void sethidamp (int Phidamp);
59     void settempo (int Ptempo);
60     void initdelays ();
61 
62 
63 
64     float fSAMPLE_RATE;
65     //Parametrii
66     int Pvolume;			//Volumul or E/R
67     int Ppanning1;		//Panning
68     int Ppanning2;
69     int Pgain1;
70     int Pgain2;
71     int Pdelay1;
72     int Pdelay2;
73     int Plrdelay;			// L/R delay difference
74     int Plrcross;			// L/R Mixing
75     int Pfb1;			//Feed-back-ul
76     int Pfb2;
77     int Phidamp;
78     int Ptempo;
79 
80     //Parametrii reali
81     int dl1, dr1, dl2, dr2, delay1, delay2, lrdelay;
82     int kl1, kr1, kl2, kr2;
83     int maxx_delay;
84     float panning1, panning2, lrcross, fb1, fb2, hidamp;
85     float gain1, gain2;
86     float *ldelay1, *rdelay1, *ldelay2, *rdelay2;
87     float oldl1, oldr1, oldl2, oldr2;	//pt. lpf
88 
89     class FPreset *Fpre;
90 
91 };
92 
93 
94 #endif
95