1 /**
2  *  Simple FDN Reverb based on zita-rev1
3  *
4  *  Copyright (C) 2003-2010 Fons Adriaensen <fons@linuxaudio.org>
5  *  Copyright (C) 2006-2018 Teru Kamogashira
6  *
7  *  This program is free software; you can redistribute it and/or modify
8  *  it under the terms of the GNU General Public License as published by
9  *  the Free Software Foundation; either version 2 of the License, or
10  *  (at your option) any later version.
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 for more details.
16  *
17  *  You should have received a copy of the GNU General Public License
18  *  along with this program; if not, write to the Free Software
19  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20  */
21 
_FV3_(zrev2)22 class _FV3_(zrev2) : public _FV3_(zrev)
23 {
24 public:
25   _FV3_(zrev2)() throw(std::bad_alloc);
26 
27   virtual void mute();
28   virtual void processreplace(_fv3_float_t *inputL, _fv3_float_t *inputR, _fv3_float_t *outputL, _fv3_float_t *outputR, long numsamples)
29     throw(std::bad_alloc);
30 
31   virtual void setrt60(_fv3_float_t value);
32   virtual void setloopdamp(_fv3_float_t value);
33 
34   void setrt60_factor_low(_fv3_float_t gain);
35   _fv3_float_t getrt60_factor_low() const;
36   void setrt60_factor_high(_fv3_float_t gain);
37   _fv3_float_t getrt60_factor_high() const;
38 
39 
40   void setxover_low(_fv3_float_t fc);
41   _fv3_float_t getxover_low() const;
42   void setxover_high(_fv3_float_t fc);
43   _fv3_float_t getxover_high() const;
44 
45   /**
46    * set the allpass diffusion parameter.
47    * @param[in] value The parameter in -1~1.
48    */
49   void setidiffusion1(_fv3_float_t value);
50   _fv3_float_t getidiffusion1() const;
51 
52   /**
53    * set the comb filter length for the modulation.
54    * @param[in] value The comb filter length in ms.
55    */
56   void setwander(_fv3_float_t ms);
57   _fv3_float_t getwander() const;
58 
59   /**
60    * set the modulation frequency of the strength of the comb filter.
61    * @param[in] value LFO modulation freqneucy.
62    */
63   void setspin(_fv3_float_t fq);
64   _fv3_float_t getspin() const;
65   void setspinfactor(_fv3_float_t value);
66   _fv3_float_t getspinfactor();
67 
68  protected:
69   _FV3_(zrev2)(const _FV3_(zrev2)& x);
70   _FV3_(zrev2)& operator=(const _FV3_(zrev2)& x);
71   virtual void setFsFactors();
72   _fv3_float_t rt60_f_low, rt60_f_high, rt60_xo_low, rt60_xo_high, idiff1, wander_ms, spin_fq, spin_factor;
73   _FV3_(biquad) _lsf0[FV3_ZREV_NUM_DELAYS], _hsf0[FV3_ZREV_NUM_DELAYS];
74   _FV3_(allpassm) iAllpassL[FV3_ZREV2_NUM_IALLPASS], iAllpassR[FV3_ZREV2_NUM_IALLPASS];
75   _FV3_(lfo) spin1_lfo; _FV3_(iir_1st) spin1_lpf;
76   const static long iAllpassLCo[FV3_ZREV2_NUM_IALLPASS], iAllpassRCo[FV3_ZREV2_NUM_IALLPASS], allpM_EXCURSION;
77   _FV3_(comb) spincombl, spincombr;
78 };
79