CLAM-Development  1.4.0
SegmentSMSMorph.hxx
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2001-2004 MUSIC TECHNOLOGY GROUP (MTG)
3  * UNIVERSITAT POMPEU FABRA
4  *
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  *
20  */
21 
22 
23 #ifndef _SEGMENTSMSMORPH_
24 #define _SEGMENTSMSMORPH_
25 
28 #include "SDIFIn.hxx"
29 #include "FrameInterpolator.hxx"
30 
31 namespace CLAM{
32 
33 
34 
38  {
39 
40  public:
47 
51  const char *GetClassName() const {return "SegmentSMSMorph";}
52 
53  const ProcessingConfig& GetConfig() const
54  {
55  return mConfig;
56  }
57 
58  bool ConcreteConfigure(const ProcessingConfig& c);
59  bool ConcreteStart();
60 
63  {}
64 
65 
66  bool Do(const Segment& in1, Segment& out);
67  bool Do(const Segment& in1,Segment& in2, Segment& out);
68  bool Do(const Frame& in1, Frame& out);
69  bool Do()
70  {
71  CLAM_ASSERT(false, "Do with ports not implemented");
72  return false;
73  }
74 
75  virtual bool UpdateControlValueFromBPF(TData pos);
76 
77  void SetSegmentToMorph(Segment&segmentToMorph);
78 
81 
84 
85  bool mUseSinAmp;
87 
92 
93  bool mUsePitch;
95 
98 
99  bool mUseResAmp;
101 
106 
107  protected:
108 
109  void UpdateFrameInterpolatorFactors(bool useFrameFactor);
110  bool FindInterpolatedFrameFromSegment2Morph(Frame& interpolatedFrame);
111  void UpdateSpectralShape(const BPF& weightBPF1, const BPF& weightBPF2, TData interpFactor, Spectrum& spectralShape);
112  void InitializeFactorsToUse();
113 
114  bool LoadSDIF( std::string fileName, Segment& segment );
115 
118 
119 
124 
127 
129 
132 
133 
137  };
138 };//namespace CLAM
139 
140 #endif // _SegmentSMSMorph_
141