tilt_synthesis.cc (speech_tools-2.4-release) | : | tilt_synthesis.cc (speech_tools-2.5.0-release) | ||
---|---|---|---|---|
skipping to change at line 139 | skipping to change at line 139 | |||
fz.resize(n, 1); | fz.resize(n, 1); | |||
fz.set_equal_space(true); | fz.set_equal_space(true); | |||
fz.fill(0.0); | fz.fill(0.0); | |||
fz.fill_time(f_shift); | fz.fill_time(f_shift); | |||
// set default to be break (silence) | // set default to be break (silence) | |||
for (int i = 0; i < fz.num_frames(); ++i) | for (int i = 0; i < fz.num_frames(); ++i) | |||
fz.set_break(i); | fz.set_break(i); | |||
// synthesize events | // synthesize events | |||
for (e = ev.head(); e != 0; e = e->next()) | for (e = ev.head(); e != 0; e = inext(e)) | |||
{ | { | |||
if (event_item(*e)) | if (event_item(*e)) | |||
{ | { | |||
start_pos = e->F("time") - e->F("rfc.rise_dur"); | start_pos = e->F("time") - e->F("rfc.rise_dur"); | |||
end_pos = e->F("time") + e->F("rfc.fall_dur"); | end_pos = e->F("time") + e->F("rfc.fall_dur"); | |||
if ((start_pos / f_shift-(int)start_pos / f_shift)>.5) | if ((start_pos / f_shift-(int)start_pos / f_shift)>.5) | |||
start_index=int(start_pos / f_shift+1); | start_index=int(start_pos / f_shift+1); | |||
else | else | |||
start_index = (int) start_pos / f_shift; | start_index = (int) start_pos / f_shift; | |||
skipping to change at line 170 | skipping to change at line 170 | |||
// cout << "b: " << sub.equal_space() << endl; | // cout << "b: " << sub.equal_space() << endl; | |||
synthesize_rf_event(sub, e->A("rfc"), e->F("ev.f0")); | synthesize_rf_event(sub, e->A("rfc"), e->F("ev.f0")); | |||
} | } | |||
} | } | |||
if (no_conn) | if (no_conn) | |||
return; | return; | |||
// synthesize connections | // synthesize connections | |||
for (e = ev.head(); e->next() != 0; e = e->next()) | for (e = ev.head(); inext(e) != 0; e = inext(e)) | |||
{ | { | |||
if (e->S("name") == "phrase_end") | if (e->S("name") == "phrase_end") | |||
continue; | continue; | |||
nn = e->next(); | nn = inext(e); | |||
// calculate start and stop times, with additional | // calculate start and stop times, with additional | |||
// optional adjustment for rise and falls on events | // optional adjustment for rise and falls on events | |||
start_f0 = e->F("ev.f0") + e->F("rfc.fall_amp", 0.0); | start_f0 = e->F("ev.f0") + e->F("rfc.fall_amp", 0.0); | |||
start_pos= e->F("time") + e->F("rfc.fall_dur", 0.0); | start_pos= e->F("time") + e->F("rfc.fall_dur", 0.0); | |||
end_f0 = nn->F("ev.f0") - nn->F("rfc.rise_amp", 0.0); | end_f0 = nn->F("ev.f0") - nn->F("rfc.rise_amp", 0.0); | |||
end_pos = nn->F("time") - nn->F("rfc.rise_dur", 0.0); | end_pos = nn->F("time") - nn->F("rfc.rise_dur", 0.0); | |||
skipping to change at line 351 | skipping to change at line 351 | |||
fz.resize(n, 1); | fz.resize(n, 1); | |||
fz.fill(0.0); | fz.fill(0.0); | |||
fz.fill_time(f_shift); | fz.fill_time(f_shift); | |||
fill_rfc_types(ev); | fill_rfc_types(ev); | |||
// set default to be break (silence) | // set default to be break (silence) | |||
for (int i = 0; i < fz.num_frames(); ++i) | for (int i = 0; i < fz.num_frames(); ++i) | |||
fz.set_break(i); | fz.set_break(i); | |||
for (e = ev.head(); e != 0; e = e->next()) | for (e = ev.head(); e != 0; e = inext(e)) | |||
{ | { | |||
// cout << "\ntype: " << e->fS("rfc.type") << endl; | // cout << "\ntype: " << e->fS("rfc.type") << endl; | |||
//cout << "\ntype: " << *e << endl; | //cout << "\ntype: " << *e << endl; | |||
if (e->f("rfc.type",1) == "RISEFALL") | if (e->f("rfc.type",1) == "RISEFALL") | |||
{ | { | |||
start_f0 = find_start_f0(e,"RISE"); | start_f0 = find_start_f0(e,"RISE"); | |||
start_pos = find_start_pos(e,"RISE"); | start_pos = find_start_pos(e,"RISE"); | |||
start_index = (int) rint(start_pos / f_shift); | start_index = (int) rint(start_pos / f_shift); | |||
nframes = (int)((e->F("rfc.rise_dur")+ (f_shift /2.0))/f_shift); | nframes = (int)((e->F("rfc.rise_dur")+ (f_shift /2.0))/f_shift); | |||
skipping to change at line 440 | skipping to change at line 440 | |||
fill_connection_values(fz, start_f0 + rfc_amp(pp), | fill_connection_values(fz, start_f0 + rfc_amp(pp), | |||
start_pos | start_pos | |||
+ rfc_dur(pp), e->F("ev.f0"), | + rfc_dur(pp), e->F("ev.f0"), | |||
e->F("position"), f_shift); | e->F("position"), f_shift); | |||
} | } | |||
} | } | |||
else if (e->f("name", 1) == "phrase_start") | else if (e->f("name", 1) == "phrase_start") | |||
{ | { | |||
//cout << "phrase start:\n" << *e << endl; | //cout << "phrase start:\n" << *e << endl; | |||
if ((nn = e->next()) == 0) | if ((nn = inext(e)) == 0) | |||
EST_error("phrase start command occurs as last item " | EST_error("phrase start command occurs as last item " | |||
"in rfc synthesis\n"); | "in rfc synthesis\n"); | |||
else if (event_item(*nn)) | else if (event_item(*nn)) | |||
{ | { | |||
start_f0 = find_start_f0(nn,"RISE"); | start_f0 = find_start_f0(nn,"RISE"); | |||
start_pos = find_start_pos(nn,"RISE"); | start_pos = find_start_pos(nn,"RISE"); | |||
} | } | |||
else | else | |||
{ | { | |||
start_f0 = nn->F("ev.f0"); | start_f0 = nn->F("ev.f0"); | |||
skipping to change at line 466 | skipping to change at line 466 | |||
start_f0,start_pos, f_shift); | start_f0,start_pos, f_shift); | |||
} | } | |||
else if (e->f("name") == "pause") | else if (e->f("name") == "pause") | |||
{} | {} | |||
else | else | |||
EST_error("Unable to synthesis intonation element %s\n", | EST_error("Unable to synthesis intonation element %s\n", | |||
(const char *)(e->fS("name"))); | (const char *)(e->fS("name"))); | |||
continue; | continue; | |||
} | } | |||
if (((nn = e->next()) != 0) && (event_item(*nn))) | if (((nn = inext(e)) != 0) && (event_item(*nn))) | |||
{ | { | |||
float f0 = start_f0+rfc_amp(e); | float f0 = start_f0+rfc_amp(e); | |||
float pos = start_pos + rfc_dur(e); | float pos = start_pos + rfc_dur(e); | |||
float end_f0 = find_start_f0(nn,"RISE"); | float end_f0 = find_start_f0(nn,"RISE"); | |||
float end_pos = find_start_pos(nn,"RISE"); | float end_pos = find_start_pos(nn,"RISE"); | |||
fill_connection_values(fz, f0, pos, end_f0, end_pos, f_shift); | fill_connection_values(fz, f0, pos, end_f0, end_pos, f_shift); | |||
} | } | |||
} | } | |||
} | } | |||
*/ | */ | |||
End of changes. 6 change blocks. | ||||
6 lines changed or deleted | 6 lines changed or added |