Prosody-lite for the formant TTS (sound.speech).
Takes the flat phoneme event list (with stress marks and SIL/punct boundaries from G2P + text normalization) and fills in what the synthesizer needs:
dur: per-event duration (ms). Inherent phoneme duration × stress ×
speed knob, with phrase-final lengthening and punctuation pauses;
f0: per-event pitch (Hz). A declining baseline across each phrase
(declination), accent bumps on stressed syllables, a terminal fall
for statements / rise for questions / half-rise at commas — all
scaled by the voice's f0_range knob (0 = monotone).
Events that already carry dur or f0 are left untouched — that is the
inflection/singing hook: hand-set values always win (sound.speech.synth).
Voice knobs consumed here: f0 (base pitch), f0_range, speed.
| Name | Signature |
|---|---|
| apply | apply(events, voice) -> events |
apply(
events,voice) ->events
Assign durations and an F0 contour to a phoneme event list
Mutates and returns events. Each event is { ph, stress, emph?, punct?, dur?, f0? }; dur/f0 already present are preserved. SIL events carry the
punct mark that closes their phrase ("." / "?" / "!" / ",").