Improve side branch graph admittance

This commit is contained in:
Meta Vens 2026-05-26 20:13:26 +01:00
commit 4216eaec25
4 changed files with 34 additions and 12 deletions

View file

@ -226,16 +226,17 @@ the generated graph path did not materially move the report; the useful levers
so far are source semantics, radiation impedance, and transient/frication
injection.
The nasal branch pressure exposed a real graph-law blocker. The graph now uses
The nasal branch pressure exposed the next graph-law issue. The graph now uses
terminal-specific admittance in connection pressure instead of collapsing every
co-located terminal into one node area, but log-mel parity did not move. Two
tempting compensators failed: per-port outgoing coupling made supposedly oral
fixtures nearly silent, and squaring the generated velum opening reduced nasal
leakage while revealing that oral radiation was still too weak. The next
architectural cut is not a gain trim. Closed and partially open side branches
need a power/flow-consistent port law that separates junction admittance from
outgoing wave normalization, so a weak nasal port can stop drawing/radiating
energy without becoming the accidental loudness path for the oral tract.
co-located terminal into one node area, and branch output uses a floored
area-ratio pressure normalization so weak side ports no longer receive full
junction pressure. That moved nasal graph cosine to 0.5159 and RMS ratio to
1.4815 while keeping open/front graph cosine slightly above the waveguide lane
at 0.6202/0.6417. Two tempting compensators were cut: raw per-port outgoing
coupling made supposedly oral fixtures nearly silent, and lip/beak radiation
gain did not restore oral vowel RMS. The remaining issue is oral energy: the
side-branch law is less wrong, but the graph still needs better power/flow
normalization before RMS parity becomes honest.
## Cut Line

View file

@ -700,20 +700,23 @@ public static class FaustEmitter
var safeConnection = SafeIdentifier(connection.Name);
var connectionPressure = ConnectionPressureExpression(name, connection, ports);
var connectionMaxArea = MaxExpression(ports.Select(item => ConnectionPortAreaExpression(name, item.terminal, item.nodePortCount)));
source.AppendLine($" {name}_graph_connection_pressure_{safeConnection} = {connectionPressure};");
foreach (var (node, _, port, _) in ports)
foreach (var (node, terminal, port, nodePortCount) in ports)
{
var incoming = GraphIncoming(name, port);
var outgoing = GraphOutgoing(name, port);
var sourceInjection = NodeSourceExpression(name, node, sources);
var portCoupling = $"{name}_graph_connection_coupling_{safeConnection}";
var portArea = ConnectionPortAreaExpression(name, terminal, nodePortCount);
var portAdmittance = $"(0.6 + 0.4 * sqrt(clip01({portArea} / max(0.000001, {connectionMaxArea}))))";
var bypassInput = ports.Count == 1
? incoming
: $"(({string.Join(" + ", ports.Where(item => item.port != port).Select(item => GraphIncoming(name, item.port)))}) / {F(ports.Count - 1)})";
var scattered = connection.Law == AcousticConnectionLaw.Bypass
? bypassInput
: $"({name}_graph_connection_pressure_{safeConnection} - {incoming})";
source.AppendLine($" {outgoing} = (({scattered}) * ({portCoupling}) + {incoming} * (1.0 - ({portCoupling})) + ({sourceInjection}) / {F(Math.Max(1, incident[node.Name].Count))}) * {name}_graph_connection_loss_{safeConnection};");
source.AppendLine($" {outgoing} = (({scattered}) * ({portCoupling}) * {portAdmittance} + {incoming} * (1.0 - ({portCoupling}) * {portAdmittance}) + ({sourceInjection}) / {F(Math.Max(1, incident[node.Name].Count))}) * {name}_graph_connection_loss_{safeConnection};");
}
}
@ -1418,6 +1421,23 @@ public static class FaustEmitter
private static string ConnectionPortAreaExpression(string voiceName, AcousticTerminal terminal, int nodePortCount) =>
$"({voiceName}_graph_terminal_area_{SafeIdentifier(terminal.Name)} / {F(Math.Max(1, nodePortCount))})";
private static string MaxExpression(IEnumerable<string> expressions)
{
using var enumerator = expressions.GetEnumerator();
if (!enumerator.MoveNext())
{
return "0.000001";
}
var expression = enumerator.Current;
while (enumerator.MoveNext())
{
expression = $"max({expression}, {enumerator.Current})";
}
return expression;
}
private static string NodeSourceExpression(
string voiceName,
AcousticGraphNode node,

View file

@ -154,3 +154,4 @@
{"timestamp":"2026-05-26T19:55:00+01:00","topic":"pink-trombone-graph-logmel-evidence","claim":"Pink Trombone parity reporting now renders both legacy waveguide and graph-propagation candidates. Graph output is Faust-valid and audible, but open/front vowel log-mel cosine remains below legacy; nasal graph is near legacy, sibilant score improves while cosine remains low, and closure-release graph cosine becomes positive. Static tongue/constriction/lip baking into graph path did not materially move the latest report, pointing next pressure at source/scattering/radiation/transient behavior.","evidence":"Updated `PinkTromboneParityFixture` with `GraphAquaScript`, parity artifacts now include `candidate-graph.*` and per-lane reports. Latest run under `artifacts/parity/pink-trombone-logmel/20260526T182050731`: open graph cosine 0.3736 vs legacy 0.6143, front 0.3889 vs 0.6349, nasal 0.5318 vs 0.5425, sibilant 0.2102 vs 0.3744, closure 0.1168 vs -0.0820."}
{"timestamp":"2026-05-26T20:25:00+01:00","topic":"pink-trombone-graph-source-radiation-evidence","claim":"Graph source and radiation semantics are now the live parity levers. LF-style glottal flow with a small harmonic pressure blend, graph radiation high-pass leakage, and aperture-weighted high-passed `TurbulenceJet` sources raise graph open/front vowel cosine above the legacy waveguide lane and make closure-release positive. Nasal remains over-loud and sibilant cosine remains weak, so the next pressure is nasal branch/radiation gain or junction coupling plus frication/transient detail.","evidence":"Latest optional PT log-mel run under `artifacts/parity/pink-trombone-logmel`: graph open 0.6393 vs legacy 0.6143, graph front 0.6596 vs legacy 0.6349, graph nasal 0.4607 with RMS ratio 1.6914 vs legacy nasal 0.5425, graph sibilant 0.2320 vs legacy 0.3744, graph closure 0.1170 vs legacy -0.0820."}
{"timestamp":"2026-05-26T20:55:00+01:00","topic":"physical-voice-side-branch-scattering-blocker","claim":"Nasal graph parity is blocked by the side-branch port law, not by a missing scalar gain. Terminal-specific admittance in connection pressure is structurally cleaner but does not move PT log-mel metrics. Per-port outgoing coupling and squared generated velum opening both suppress nasal leakage only by making oral fixtures nearly silent, showing that the current pressure-wave normalization lets a weak side branch become an accidental loudness path. The next architecture needs power/flow-consistent branch-port scattering that separates junction admittance from outgoing wave normalization.","evidence":"Focused optional PT log-mel runs after per-port outgoing coupling produced open/front graph RMS ratios near 0.0017 with nasal cosine 0.5338; squared generated velum opening produced open/front RMS ratios near 0.0038/0.0039 and nasal RMS 1.5729. Both were cut. The retained terminal-admittance pressure solve preserves the previous source/radiation metrics."}
{"timestamp":"2026-05-26T21:20:00+01:00","topic":"physical-voice-side-branch-admittance-progress","claim":"Side-branch graph scattering now uses terminal-specific admittance plus a floored area-ratio pressure normalization for outgoing branch waves. This is not final power parity, but it improves nasal cosine/RMS without erasing the oral vowel cosine win. Raw per-port coupling, squared velum mapping, and lip/beak radiation gain were tested and cut.","evidence":"Latest optional PT log-mel run: graph open 0.6202 RMS 0.1703, graph front 0.6417 RMS 0.1752, graph nasal 0.5159 RMS 1.4815, graph sibilant 0.2268 RMS 1.0643, graph closure 0.1117 RMS 1.8085. Previous source/radiation baseline was open 0.6393 RMS 0.3559, front 0.6596 RMS 0.3661, nasal 0.4607 RMS 1.6914, sibilant 0.2320 RMS 0.9158, closure 0.1170 RMS 1.6650."}

View file

@ -118,7 +118,7 @@ live_invariants:
- The physical voice research packet now includes a practical implementation/researcher map (`research/physical-voice-modeling/PEOPLE.md`) and talk/transcript ledger (`research/physical-voice-modeling/talks/TALKS.md`). Birkholz/VocalTractLab pressures multi-level articulatory control and gestures; Story/TubeTalker pressures continuous parametric area functions and length/coupling; Smith pressures bidirectional delay-line scattering and fractional-delay waveguides; Fels/ArtiSynth pressures separation between biomechanics, acoustics, timeline controls, and diagnostics. These are reusable DSL semantics, not modules to clone.
- Physical voice implementation has started moving PT pressure into neutral acoustic owners: `AcousticPath`, `AcousticTerminal`, `AcousticConnection`, `AcousticSourcePort`, `AcousticBranch`, `AcousticRadiationPort`, `WaveClockPolicy`, and `AcousticPortNetwork`. Parser commands `path`, `terminal`, `connect`, `source_port`, `branch`, `radiation_port`, `wave_clock`, and `acoustic_network` now exist. Existing `tract_shape`, `glottis`, `tract_injection`, `nasal_branch`, and `tract` commands populate acoustic records as compatibility aliases while the current `Voice.Tract` Faust renderer still owns audio.
- `acoustic` / `acoustic_voice` can now render an `AcousticPortNetwork` through a compact Faust response proxy or, when typed terminals are present, a compiled bidirectional Faust segment graph. Graph lowering splits paths at terminal positions, aggregates co-located terminals into graph nodes, orders connection ports deterministically, scatters area-weighted/pressure/bypass connection groups, injects source terminals even at connected nodes, and sums radiation terminals. Segment delay follows physical segment length and the network `wave_clock` strategy through unit-grid, half-sample, linear fractional, Lagrange, or Thiran/allpass Faust delay primitives. Source, branch, radiation, terminal, and connection controls can bind through ordinary Aqua parameters into emitted Faust. PT-shaped `tract` authoring can opt into graph audio with `propagation=graph`; legacy `propagation=waveguide` remains the comparison baseline. Remaining pressure: deepen connection-law semantics and run log-mel parity against the graph renderer. Do not expand the proxy into a second fake synthesizer.
- Pink Trombone log-mel parity now writes both legacy waveguide and graph candidates. Latest graph evidence after source/radiation cuts: graph open/front cosine reaches 0.6393/0.6596, now above the legacy waveguide lane at 0.6143/0.6349 for those fixtures. The useful changes were LF-style glottal shaping with a modest harmonic pressure blend, graph radiation high-pass leakage by radiation kind, and aperture-weighted high-passed `TurbulenceJet` source semantics instead of multiplying jet pressure by source opening. Nasal graph cosine is 0.4607 with RMS ratio 1.6914, so nasal branch/radiation gain or junction coupling is still wrong; sibilant graph cosine remains weak at 0.2320; closure-release graph cosine is positive at 0.1170 and beats the old negative waveguide baseline. Terminal-specific admittance is now used in connection pressure, but parity did not move; per-port outgoing coupling and squared generated velum opening both suppressed nasal leak by making oral fixtures nearly silent, proving the graph currently relies on the nasal side path for too much loudness. The next blocker is a power/flow-consistent side-branch port law that separates junction admittance from outgoing wave normalization; do not solve this with radiation gain trim.
- Pink Trombone log-mel parity now writes both legacy waveguide and graph candidates. Latest graph evidence after source/radiation/side-branch cuts: graph open/front cosine is 0.6202/0.6417, still slightly above the legacy waveguide lane at 0.6143/0.6349; nasal graph cosine improved to 0.5159 and RMS ratio dropped from 1.6914 to 1.4815; sibilant graph cosine remains weak at 0.2268; closure-release graph cosine stays positive at 0.1117 and beats the old negative waveguide baseline. The useful changes were LF-style glottal shaping with a modest harmonic pressure blend, graph radiation high-pass leakage by radiation kind, aperture-weighted high-passed `TurbulenceJet` source semantics, terminal-specific admittance in connection pressure, and floored area-ratio pressure normalization for branch outputs. Raw per-port outgoing coupling, squared generated velum opening, and lip/beak radiation gain were cut as compensators. Remaining pressure is oral RMS/energy normalization and better frication/transient behavior, not more static shape paperwork.
- PT expressive parity should decompose into reusable Aqua primitives before audio golf: `tract_shape` owns continuous diameter/area geometry over normalized position, physical length (`length_cm`), interpolation/resampling, derived reflection coefficients, and per-cell acoustic delay; `tract` may resample that geometry to a chosen compiled `sections` grid without making authoring sample count anatomy; `glottis` owns excitation controls; `tract_injection` owns positioned frication/burst controls and now distributes frication pressure into waveguide section updates; `nasal_branch` owns a second diameter/area tube; `tract_motion` owns control slew and obstruction threshold; `propagation=waveguide` lowers tract voices into a Faust-friendly `wg_loop ~ si.bus(...)` feedback component with compiled right/left traveling-wave state, live per-section diameter/area/reflection fields, obstruction-history burst pressure, and legacy substep clock intent. Waveguide tracts now default to an acoustic unit-delay grid from physical length at the current 44.1 kHz target, so a 17 cm oral tract emits about 22 sections instead of treating PT's 44 half-sample cells as anatomy; `VocalTract.IndexScale` maps runtime PT-index controls onto that emitted grid. PT's 44 oral and 28 nasal cells are reference discretization, not Aqua morphology authority. `PinkTromboneParityFixtures` defines fixed Aqua DSL workouts, `PinkTromboneReferenceRenderer` renders deterministic PT-style fixture references, and `AudioComparison` includes log-mel cosine similarity. Current waveguide baseline is weak but measured: cosine about 0.61 open vowel, 0.63 front vowel, 0.54 nasal, 0.37 sibilant, and -0.08 closure-release. Remaining low-level gap is fractional-delay waveguide lowering whose clock derives from physical length, propagation speed, and sample rate so runtime morphology motion does not require recompilation; closure/release timing is still badly wrong.
- If dotnet builds hang in this workspace, stop orphan dotnet workers and retry with `--disable-build-servers -p:UseSharedCompilation=false -p:BuildInParallel=false`; plain parallel/shared builds can stall without useful diagnostics.
- eSpeak NG is an early parity reference for timing, IPA coverage, and log-mel pressure, not an anatomy oracle or final target.