Skip to content

the ultimate vocal synthesizer - sing, speak, beatbox, and more

Rust

Hill climb 19: the labiodental geometry hands over without a step; no click before /f/ and /v/

Jameson Hodgecede0542c389
diff --git a/crates/chimera/src/anatomy/human.rs b/crates/chimera/src/anatomy/human.rs
index f5db33d..32ecb7e 100644
--- a/crates/chimera/src/anatomy/human.rs
+++ b/crates/chimera/src/anatomy/human.rs
@@ -505,6 +505,13 @@ pub struct HumanFrame {
}
const DEG: f64 = PI / 180.0;
+/// labiodental value by which the lips' own contact has handed over to the incisor constriction
+const LAB_HANDOVER: f64 = 0.5;
+/// how fast the lip-to-lip gap opens over that handover (cm, body-scaled): it grows as
+/// `LAB_GAP·s/(1−s)`, `s` the smoothstep of the handover, so it leaves without a step
+const LAB_GAP: f64 = 0.3;
+/// labiodental value from which the space in front of the tucked lower lip opens out
+const LAB_FRONT_OPENS: f64 = 0.7;
/// points on the tongue body's arc
const ARC_POINTS: usize = 32;
const MAX_CROSS: usize = 64;
@@ -1036,7 +1043,19 @@ impl HumanVocalTract {
teeth_idx = grid.len();
for i in 0..n_fr {
let x = lerp(x_start, x_end, i as f64 / (n_fr as f64 - 1.0));
- if let Some(m) = measure(v(x, 4.0 * k), v(0.0, 1.0), 8.0 * k, false) {
+ if let Some(mut m) = measure(v(x, 4.0 * k), v(0.0, 1.0), 8.0 * k, false) {
+ // in front of the lower lip's edge (tucked under the incisors for /f v/) the ray
+ // meets no lower lip, and the fallback floor 3.5 cm down jumped the gap by ~2 cm
+ // and the tract's length by ~1 cm as the edge passed it: a click on every /f/.
+ // The floor there starts as the lip's outer face, leaving the edge down and
+ // forward as its outline does (tangent 0.3 : −0.4), and opens to the old depth
+ // as the tuck completes, so a held /f/ keeps its open front.
+ if x > ll_edge.x {
+ let face = js_min(ll_edge.y - (x - ll_edge.x) * 4.0 / 3.0, m.outer.y);
+ let y_in = lerp(face, m.outer.y - 3.5 * k, smoothstep(LAB_FRONT_OPENS, 1.0, lab));
+ m.inner = v(x, y_in);
+ m.d = m.outer.y - y_in;
+ }
grid.push(sample(m, 3));
}
}
@@ -1131,7 +1150,12 @@ impl HumanVocalTract {
{
let edge_x = js_min(ul_edge.x, ll_edge.x);
let rl = 0.6 * k;
- let ap_eff = if lab > 0.5 { f64::INFINITY } else { ap }; // labiodental uses its own geometry
+ // labiodental uses its own geometry: as the lower lip tucks under the incisors it leaves
+ // the upper lip, so the lip-to-lip gap stops constraining. It hands over gradually: a
+ // switch at lab 0.5 opened the near-closed lips of an /f/ in one control step, a [b]-like
+ // release before every /f/ and /v/
+ let lab_open = smoothstep(0.0, LAB_HANDOVER, lab);
+ let ap_eff = if lab_open >= 1.0 { f64::INFINITY } else { ap + LAB_GAP * k * lab_open / (1.0 - lab_open) };
let px = self.palate[self.palate.len() - 1].x;
for g in grid.iter_mut() {
if g.region != 3 || g.mid.x < px {
diff --git a/crates/chimera/tests/consonant_artifacts.rs b/crates/chimera/tests/consonant_artifacts.rs
index ff701b4..4980bdf 100644
--- a/crates/chimera/tests/consonant_artifacts.rs
+++ b/crates/chimera/tests/consonant_artifacts.rs
@@ -122,7 +122,6 @@ fn peaks_2ms(x: &[f32], t0: f64, t1: f64, re: f64) -> Vec<f64> {
}
#[test]
-#[ignore = "target for the pronunciation batch: run with --ignored to measure it"]
fn an_f_does_not_click() {
// The lips nearly closed, then sprang open as the lower lip tucked under the incisors (two
// steps in the labiodental geometry): a 2-4 ms [b]-like click about 16 ms before every /f/ and