1 
2 // Based in gate_1410.c LADSPA Swh-plugins
3 
4 /*
5   rakarrack - a guitar effects software
6 
7  Gate.h  -  Noise Gate Effect definitions
8  Based on Steve Harris LADSPA gate.
9 
10   Copyright (C) 2008 Josep Andreu
11   Author: Josep Andreu
12 
13  This program is free software; you can redistribute it and/or modify
14  it under the terms of version 2 of the GNU General Public License
15  as published by the Free Software Foundation.
16 
17  This program is distributed in the hope that it will be useful,
18  but WITHOUT ANY WARRANTY; without even the implied warranty of
19  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  GNU General Public License (version 2) for more details.
21 
22  You should have received a copy of the GNU General Public License
23  (version2)  along with this program; if not, write to the Free Software
24  Foundation,
25  Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
26 
27 */
28 
29 
30 #ifndef NOISEGATE_H
31 #define NOISEGATE_H
32 
33 #include "global.h"
34 #include "AnalogFilter.h"
35 
36 class Gate
37 {
38 
39 public:
40 
41     Gate (float * efxoutl_, float * efxoutr_, double samplerate, uint32_t intermediate_bufsize);
42     ~Gate ();
43 
44     void out (float * smps_l, float * smps_r, uint32_t period);
45 
46     void Gate_Change (int np, int value);
47     void Gate_Change_Preset (int npreset);
48     void cleanup ();
49     int getpar (int npar);
50 
51 
52 
53 
54     // Compressor
55 
56     int Pthreshold;		// attack time  (ms)
57     int Pattack;			// release time (ms)
58     int Ohold;
59     int Pdecay;
60     int Prange;
61     int Plpf;
62     int Phpf;
63     int Phold;
64 
65     float *efxoutl;
66     float *efxoutr;
67 
68 
69 private:
70 
71     void setlpf (int Plpf);
72     void sethpf (int Phpf);
73 
74 
75     int hold_count;
76     int state;
77     float range;
78     float cut;
79     float t_level;
80     float a_rate;
81     float d_rate;
82     float env;
83     float gate;
84     float fs;
85     float hold;
86 
87 
88     float* interpbuf; //buffer for filters
89     AnalogFilter *lpfl, *lpfr, *hpfl, *hpfr;
90     class FPreset *Fpre;
91 
92 };
93 
94 #endif
95