1 #ifndef _FormantGrid_h_
2 #define _FormantGrid_h_
3 /* FormantGrid.h
4  *
5  * Copyright (C) 2008-2011,2014,2015,2017 Paul Boersma & David Weenink
6  *
7  * This code 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 (at
10  * your option) any later version.
11  *
12  * This code is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15  * See the 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 work. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #include "RealTier.h"
22 #include "Sound.h"
23 #include "Formant.h"
24 
25 Thing_declare (Interpreter);
26 
27 #include "FormantGrid_def.h"
28 
29 void FormantGrid_init (FormantGrid me, double tmin, double tmax, integer numberOfFormants);
30 autoFormantGrid FormantGrid_createEmpty (double tmin, double tmax, integer numberOfFormants);
31 
32 autoFormantGrid FormantGrid_create (double tmin, double tmax, integer numberOfFormants,
33 	double initialFirstFormant, double initialFormantSpacing,
34 	double initialFirstBandwidth, double initialBandwidthSpacing);
35 
36 double FormantGrid_getFormantAtTime (FormantGrid me, integer formantNumber, double time);
37 double FormantGrid_getBandwidthAtTime (FormantGrid me, integer formantNumber, double time);
38 
39 void FormantGrid_addFormantPoint (FormantGrid me, integer formantNumber, double time, double value);
40 void FormantGrid_addBandwidthPoint (FormantGrid me, integer formantNumber, double time, double value);
41 void FormantGrid_removeFormantPointsBetween (FormantGrid me, integer formantNumber, double tmin, double tmax);
42 void FormantGrid_removeBandwidthPointsBetween (FormantGrid me, integer formantNumber, double tmin, double tmax);
43 
44 void Sound_FormantGrid_filter_inplace (Sound me, FormantGrid formantGrid);
45 autoSound Sound_FormantGrid_filter (Sound me, FormantGrid formantGrid);
46 autoSound Sound_FormantGrid_filter_noscale (Sound me, FormantGrid formantGrid);
47 
48 autoSound FormantGrid_to_Sound (FormantGrid me, double samplingFrequency,
49 	double tStart, double f0Start, double tMid, double f0Mid, double tEnd, double f0End,
50 	double adaptFactor, double maximumPeriod, double openPhase, double collisionPhase, double power1, double power2);
51 void FormantGrid_playPart (FormantGrid me, double tmin, double tmax, double samplingFrequency,
52 	double tStart, double f0Start, double tMid, double f0Mid, double tEnd, double f0End,
53 	double adaptFactor, double maximumPeriod, double openPhase, double collisionPhase, double power1, double power2,
54 	Sound_PlayCallback playCallback, Thing playBoss);
55 
56 void FormantGrid_formula_frequencies (FormantGrid me, conststring32 expression, Interpreter interpreter, FormantGrid thee);
57 void FormantGrid_formula_bandwidths (FormantGrid me, conststring32 expression, Interpreter interpreter, FormantGrid thee);
58 
59 autoFormantGrid Formant_downto_FormantGrid (Formant me);
60 autoFormant FormantGrid_to_Formant (FormantGrid me, double dt, double intensity);
61 
62 autoSound Sound_Formant_filter (Sound me, Formant formant);
63 autoSound Sound_Formant_filter_noscale (Sound me, Formant formant);
64 
65 /* End of file FormantGrid.h */
66 #endif
67