59 float t, amp, f_shift, a=0, start_f0;
65 dur = ev.
F(
"rise_dur");
66 amp = ev.
F(
"rise_amp");
67 start_f0 = peak_f0 - amp;
69 for (j = 0, t = 0.0; t < dur; t += f_shift, ++j)
77 dur = ev.
F(
"fall_dur");
78 amp = ev.
F(
"fall_amp");
80 for (t = 0.0; t < dur; t += f_shift, ++j)
93 float end_f0,
float end_pos)
98 if ((end_pos - start_pos) == 0)
101 m = (end_f0 - start_f0) / (end_pos - start_pos);
104 fz.
a(j) = (m * (float) j * f_shift) + start_f0;
120 float start_pos=0, start_f0=0;
121 int start_index, end_index;
122 float end_pos, end_f0;
126 n = (
int)(ceil((ev.
tail()->
F(
"time") +
127 ev.
tail()->
F(
"rfc.fall_dur",0)) / f_shift)) + 1;
129 n = (
int)(ceil(ev.
tail()->
F(
"time")/ f_shift)) + 1;
141 for (e = ev.
head(); e != 0; e = e->
next())
145 start_pos = e->
F(
"time") - e->
F(
"rfc.rise_dur");
146 end_pos = e->
F(
"time") + e->
F(
"rfc.fall_dur");
148 if ((start_pos / f_shift-(
int)start_pos / f_shift)>.5)
149 start_index=
int(start_pos / f_shift+1);
151 start_index = (
int) start_pos / f_shift;
152 if(end_pos / f_shift-(
int)end_pos / f_shift>.5)
153 end_index =
int( end_pos / f_shift+1);
155 end_index = (
int) end_pos / f_shift;
158 fz.
sub_track(sub, start_index, (end_index - start_index) + 1,
174 if (e->
S(
"name") ==
"phrase_end")
181 start_f0 = e->
F(
"ev.f0") + e->
F(
"rfc.fall_amp", 0.0);
182 start_pos= e->
F(
"time") + e->
F(
"rfc.fall_dur", 0.0);
184 end_f0 = nn->
F(
"ev.f0") - nn->
F(
"rfc.rise_amp", 0.0);
185 end_pos = nn->
F(
"time") - nn->
F(
"rfc.rise_dur", 0.0);
187 if ((start_pos / f_shift-(
int)start_pos / f_shift)>.5)
188 start_index=
int(start_pos / f_shift+1);
190 start_index = (
int) start_pos / f_shift;
191 if(end_pos / f_shift-(
int)end_pos / f_shift>.5)
192 end_index =
int( end_pos / f_shift+1);
194 end_index = (
int) end_pos / f_shift;
197 if (start_index >= end_index)
float unit_curve(float amp, float dur, float t)
void set_value(ssize_t i)
set frame i to be a value
void set_break(ssize_t i)
set frame i to be a break
void resize(ssize_t num_frames, int num_channels, bool preserve=1)
void sub_track(EST_Track &st, int start_frame=0, int nframes=EST_ALL, int start_chan=0, int nchans=EST_ALL)
void rfc_synthesis(EST_Track &fz, EST_Relation &ev, float f_shift, int no_conn)
Generate an F0 contour given a list RFC events.
float & a(ssize_t i, int c=0)
void tilt_to_rfc(EST_Features &tilt, EST_Features &rfc)
Convert a single set of local tilt parameters to local RFC parameters.
EST_FMatrix sub(const EST_FMatrix &a, ssize_t row, ssize_t col)
float F(const EST_String &name) const
void fill_connection_values(EST_Track &fz, float start_f0, float start_pos, float end_f0, float end_pos)
void tilt_synthesis(EST_Track &fz, EST_Relation &ev, float f_shift, int no_conn)
Generate an F0 contour given a list Tilt events.
ssize_t num_frames() const
return number of frames in track
EST_Features & A(const EST_String &name) const
int event_item(EST_Item &e)
const EST_String S(const EST_String &name) const
void remove_item_feature(const EST_String &name)
void synthesize_rf_event(EST_Track &fz, EST_Features &ev, float peak_f0)
void set_equal_space(bool t)
void fill_time(float t, int start=1)
float F(const EST_String &path) const