2 ZynAddSubFX - a software synthesizer
4 Resonance.h - Resonance
5 Copyright (C) 2002-2005 Nasca Octavian Paul
6 Author: Nasca Octavian Paul
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.
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.
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
25 #define N_RES_POINTS 256
29 bool enabled
; // whether resonance is enabled
30 unsigned char points
[N_RES_POINTS
]; // how many points define the resonance function
31 unsigned char maxdB
; // how many dB the signal may be amplified
32 unsigned char centerfreq
; // the center frequency of the res. func.
33 unsigned char octavesfreq
; // and the number of octaves
34 unsigned char protectthefundamental
; // the fundamental (1-st harmonic) is not damped, even it resonance function is low
36 float center
; // center frequency(relative)
37 float bw
; // bandwidth(relative)
44 } /* Adjust editor indent */
49 struct zyn_resonance
* resonance_ptr
);
53 struct zyn_resonance
* resonance_ptr
,
55 struct zyn_fft_freqs
* fftdata_ptr
,
59 { /* Adjust editor indent */
66 void setpoint(int n
,unsigned char p
);
68 void interpolatepeaks(int type
);
69 void randomize(int type
);
72 REALTYPE
getfreqpos(REALTYPE freq
);
73 REALTYPE
getfreqx(REALTYPE x
);
74 REALTYPE
getfreqresponse(REALTYPE freq
);
75 REALTYPE
getcenterfreq();
76 REALTYPE
getoctavesfreq();
78 void set_center(float center
);
79 void set_badnwidth(float bandwidth
);