CLAM-Development
1.4.0
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
src
Processing
Transformations
SMS
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
26
#include "
SegmentTransformation.hxx
"
27
#include "
SegmentSMSMorphConfig.hxx
"
28
#include "
SDIFIn.hxx
"
29
#include "
FrameInterpolator.hxx
"
30
31
namespace
CLAM{
32
33
34
37
class
SegmentSMSMorph
:
public
SegmentTransformation
38
{
39
40
public
:
42
SegmentSMSMorph
();
46
SegmentSMSMorph
(
const
SegmentSMSMorphConfig
&c);
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
62
~SegmentSMSMorph
()
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
79
bool
mUseGlobalFactor
;
80
FloatInControl
mHybBPF
;
81
82
bool
mUseSynchronizeTime
;
83
FloatInControl
mSynchronizeTime
;
84
85
bool
mUseSinAmp
;
86
FloatInControl
mHybSinAmp
;
87
88
bool
mUseSinSpectralShape
;
89
FloatInControl
mHybSinSpectralShape
;
90
FloatInControl
mHybSinShapeW1
;
91
FloatInControl
mHybSinShapeW2
;
92
93
bool
mUsePitch
;
94
FloatInControl
mHybPitch
;
95
96
bool
mUseSinFreq
;
97
FloatInControl
mHybSinFreq
;
98
99
bool
mUseResAmp
;
100
FloatInControl
mHybResAmp
;
101
102
bool
mUseResSpectralShape
;
103
FloatInControl
mHybResSpectralShape
;
104
FloatInControl
mHybResShapeW1
;
105
FloatInControl
mHybResShapeW2
;
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
116
SDIFIn
mSDIFReader
;
117
SegmentSMSMorphConfig
mConfig
;
118
119
123
Segment
*
mpInput2
;
124
125
bool
mHarmSpectralShapeMorph
;
126
bool
mHaveInternalSegment
;
127
128
Segment
mSegment
;
129
130
Spectrum
mSpectralShape
;
131
Spectrum
mResSpectralShape
;
132
133
136
FrameInterpolator
mPO_FrameInterpolator
;
137
};
138
};
//namespace CLAM
139
140
#endif // _SegmentSMSMorph_
141
Generated by
1.8.1