Expose graph branch energy probes
This commit is contained in:
parent
ce57a9e235
commit
ef0e603756
5 changed files with 11 additions and 3 deletions
|
|
@ -152,7 +152,10 @@ storage/release and passive multi-port scattering rather than output gain.
|
|||
The live implementation now has a named three-port branch law for connection
|
||||
groups with two same-path ports plus one side-branch port. It is intentionally
|
||||
kept even though it exposes over-radiation, because it moves ownership to the
|
||||
physically correct port.
|
||||
physically correct port. The emitted Faust now also names branch
|
||||
`energy_in`/`energy_out` probes for that junction, so the next pass can inspect
|
||||
whether the scatter law itself is passive or whether downstream radiation is
|
||||
the only loudness fault.
|
||||
|
||||
The next coherent implementation target is to make that law passive and
|
||||
radiation-aware:
|
||||
|
|
|
|||
|
|
@ -1649,6 +1649,8 @@ public static class FaustEmitter
|
|||
var sourceInjection = NodeSourceExpression(voiceName, item.node, sources);
|
||||
source.AppendLine($" {outgoing} = ({voiceName}_graph_connection_pressure_{safeConnection} - {incoming} + ({sourceInjection}) / {F(Math.Max(1, item.nodePortCount))}) * {voiceName}_graph_connection_loss_{safeConnection};");
|
||||
}
|
||||
source.AppendLine($" {voiceName}_graph_connection_energy_in_{safeConnection} = {string.Join(" + ", portItems.Select(item => $"({areaExpressions[item.port]}) * pow({GraphIncoming(voiceName, item.port)}, 2.0)"))};");
|
||||
source.AppendLine($" {voiceName}_graph_connection_energy_out_{safeConnection} = {string.Join(" + ", portItems.Select(item => $"({areaExpressions[item.port]}) * pow({GraphOutgoing(voiceName, item.port)}, 2.0)"))};");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -181,3 +181,4 @@
|
|||
{"evidence":"Added docs/acoustic-graph-flow-audit.md after comparing current Aqua graph lowering with VocalTractLab, Story/TubeTalker, Julius Smith waveguide modeling, ArtiSynth, and PT/SndKit pressure. Restored the physical ownership fix: generated nasal branches keep full connection coupling, put the side-port admittance limit on the nasal terminal, and emit a named three-port branch scatter for two same-path ports plus one side branch. Focused structural/Faust and PT parity tests passed. Latest utterance artifact artifacts/parity/pink-trombone-utterance-logmel/20260527T165339231: mama/papa/thrombosis cosine 0.7973/0.8895/0.5398, rmsRatio 3.7320/4.8039/2.9997, articulation 0.1734/0.1766/0.1410. Latest static artifact artifacts/parity/pink-trombone-logmel/20260527T165305967: open/front/nasal/ma/sibilant/closure cosine 0.6157/0.6879/0.6338/0.6089/0.4868/0.6525. The utterance over-radiation is kept as evidence of downstream passivity/radiation-normalization debt, not grounds to revert the physical ownership fix.","claim":"Aqua's graph records can express the research-backed vocal-tract architecture, but current Faust lowering still mangles samples at multi-port branch junctions because radiation normalization and passivity were leaning on a global connection damper. The next coherent cut is passive/admittance-normalized three-port scattering plus radiation normalization probes, not more PT-shaped source tweaks or reverting the side-port ownership fix.","timestamp":"2026-05-27T16:12:00+01:00","topic":"acoustic-graph-flow-audit"}
|
||||
{"evidence":"Added `ParameterBindingTransform.Square` with scalar binding scale, used generated tract graph lowering to map live velum diameter into nasal side-port terminal area_scale, and stopped mirroring velum to nostril opening or lip opening to terminal area_scale. Focused structural tests and PT graph parity passed. Latest static artifact artifacts/parity/pink-trombone-logmel/20260527T170220540: open/front/nasal/ma/sibilant/closure cosine 0.6157/0.6879/0.6338/0.6089/0.4868/0.6525. Latest utterance artifact artifacts/parity/pink-trombone-utterance-logmel/20260527T170253143: mama/papa/thrombosis cosine 0.7232/0.7947/0.5651, rmsRatio 4.8301/5.0214/5.4566, articulation 0.1668/0.1560/0.1289.","claim":"Live graph controls must preserve physical dimensions at field ownership sites. Velum is a diameter/control gesture that becomes branch admittance through area, while radiation aperture and lip path area are separate owners. The current audio is still over-radiated and poorly articulated, but reverting to raw mirrored controls would reintroduce sample-flow mangling.","timestamp":"2026-05-27T17:05:00+01:00","topic":"acoustic-graph-transformed-bindings"}
|
||||
{"evidence":"Graph radiation now emits named per-terminal radiation flow/admittance signals and weights boundary flow by bounded local terminal admittance instead of a fixed 4x output scalar plus kind gain. Focused structural and PT parity tests passed. Latest static artifact artifacts/parity/pink-trombone-logmel/20260527T170548495: open/front/nasal/ma/sibilant/closure cosine 0.6675/0.7216/0.7251/0.7098/0.4862/0.6513, rmsRatio 0.2590/0.4287/0.3704/0.4017/0.3957/0.5635. Latest utterance artifact artifacts/parity/pink-trombone-utterance-logmel/20260527T170618466: mama/papa/thrombosis cosine 0.7428/0.7830/0.5442, rmsRatio 2.7955/2.4594/2.7397, articulation 0.1288/0.1226/0.1151.","claim":"Radiation is now less of a global loudness patch and more of a local boundary-flow witness. This reduces over-radiation after the side-port fix, but the speech still fails on articulation, so the next coherent work is passive multi-port scattering plus pressure storage/release rather than more output coloring.","timestamp":"2026-05-27T17:10:00+01:00","topic":"acoustic-graph-radiation-admittance"}
|
||||
{"evidence":"Added generated Faust `graph_connection_energy_in_*` and `graph_connection_energy_out_*` probes for the named three-port branch scatter and fenced them with structural tests. Focused structural tests passed.","claim":"Passivity must be inspected where samples are scattered, not inferred from output loudness. The next branch-law pass can now compare local incoming/outgoing area-weighted wave energy before changing more audio behavior.","timestamp":"2026-05-27T17:14:00+01:00","topic":"acoustic-graph-branch-energy-probes"}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
project: AquaSynth
|
||||
spine_version: 1
|
||||
updated: 2026-05-27T17:10:00+01:00
|
||||
updated: 2026-05-27T17:14:00+01:00
|
||||
|
||||
prime_directive: >
|
||||
Build coherent synth machinery. References exist to reveal missing structure,
|
||||
|
|
@ -120,7 +120,7 @@ live_invariants:
|
|||
- 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 now routes accepted parity through `propagation=graph`; the old waveguide parity lane is not a comparison baseline or historical pressure lane.
|
||||
- Pink Trombone log-mel parity now writes graph candidates only. Generated tract graphs mirror live `/pink/...` tract bindings into acoustic source, terminal, radiation, and path-area fields. Graph generation stopped baking first-frame tongue/constriction/lip morphology into the path; `AcousticPath.AreaControl` now turns tongue/constriction/lip controls into live area expressions at graph sample points. Velum owns nasal branch entrance diameter, which lowers through a squared parameter-binding transform into side-port admittance; generated nasal connections keep full connection coupling, and the nasal terminal carries the side-port admittance limit. The first nasal tube sample is no longer allowed to decide the velum opening. Lip opening owns path area and radiation aperture, not terminal area scaling. Graph radiation now uses aperture as a boundary impedance owner: lip/beak opening blends boundary reflection from near-closed termination to declared open-end reflection, names per-port boundary flow (`incoming - outgoing`), and weights output by bounded local terminal admittance rather than a fixed 4x output scalar. Latest static graph evidence after radiation admittance normalization is under `artifacts/parity/pink-trombone-logmel/20260527T170548495`: open/front/nasal/ma/sibilant/closure cosine 0.6675/0.7216/0.7251/0.7098/0.4862/0.6513; latest utterance evidence under `artifacts/parity/pink-trombone-utterance-logmel/20260527T170618466`: mama/papa/thrombosis cosine 0.7428/0.7830/0.5442 with rmsRatio 2.7955/2.4594/2.7397 and articulation 0.1288/0.1226/0.1151. The output is less absurdly loud, but articulation and speech-band motion are still the live failure.
|
||||
- `docs/acoustic-graph-flow-audit.md` compares Aqua's graph to Birkholz/VTL, Story/TubeTalker, Smith waveguides, ArtiSynth, and PT/SndKit. The graph records can name the research-backed architecture, but current Faust lowering still mangles multi-port branch sample flow. The kept physical fix moves nasal coupling from global connection damping into transformed side-port admittance and emits a named three-port branch scatter for two same-path ports plus one side branch. Radiation now has named flow/admittance probes and local terminal-admittance weighting, reducing over-radiation without restoring the old damper. Do not revert that ownership fix just because the next broken subsystem screams; next cut is passive/admittance-normalized three-port scattering plus graph-native pressure storage/release.
|
||||
- `docs/acoustic-graph-flow-audit.md` compares Aqua's graph to Birkholz/VTL, Story/TubeTalker, Smith waveguides, ArtiSynth, and PT/SndKit. The graph records can name the research-backed architecture, but current Faust lowering still mangles multi-port branch sample flow. The kept physical fix moves nasal coupling from global connection damping into transformed side-port admittance and emits a named three-port branch scatter for two same-path ports plus one side branch. Radiation now has named flow/admittance probes and local terminal-admittance weighting, reducing over-radiation without restoring the old damper. The three-port branch law also emits `graph_connection_energy_in_*` and `graph_connection_energy_out_*` probes so passivity can be inspected at the actual scatter site. Do not revert that ownership fix just because the next broken subsystem screams; next cut is passive/admittance-normalized three-port scattering plus graph-native pressure storage/release.
|
||||
- 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; `AcousticAreaControl` owns live sampled morphology controls on a path; `WaveClockPolicy` owns the legal delay floor instead of forcing every segment to one sample; generated graph tracts now use `HalfSampleGrid` to match the PT/Kelly-Lochbaum half-sample regime; ordinary same-path graph interiors now own signed two-port area-discontinuity scattering; `glottis` owns excitation controls with mild harmonic waveshaping and a small higher-harmonic brightness term for graph sources; `tract_injection` owns positioned frication/burst controls; `AcousticSourcePort.Transient` owns graph-native release/click energy as a pressure pulse rather than filtered noise; sustained `TurbulenceJet` lowering owns a narrow-open aperture gate so closed constrictions no longer hiss; `AcousticSourcePositionControl` owns differentiable runtime weights over fixed source terminals so moving articulators can move source energy without recompiling the graph; `AcousticRadiationPort` owns aperture-dependent boundary reflection, flow radiation, and current post-flow normalization; `nasal_branch` owns a second diameter/area tube and branch aperture while `AcousticConnection.Coupling` owns structural max admittance; `tract_motion` owns control slew and obstruction threshold; `AcousticPortNetwork` owns graph lowering. `PinkTromboneReferenceRenderer` ports the pinned MIT `chdh/pink-trombone-mod` DSP source (`external/pink-trombone-mod` at 359c2d3b42b10280404c1650dc601902112b4c90), and reference WAVs before `artifacts/parity/pink-trombone-utterances/20260526T211902375` are invalid. The accepted PT utterance curriculum is mama, papa, and thrombosis; lulek was cut because its control sketch taught a bad artifact. Latest graph-only utterance smoke under `artifacts/parity/pink-trombone-utterance-logmel/20260527T150836912`: mama/papa/thrombosis remain `not-accepted-articulation` with cosine 0.8337/0.8893/0.5317 and articulation scores 0.2118/0.1890/0.2594. `AudioComparison.Articulation` reports envelope cosine, active-frame ratio, silence mismatch, envelope/spectral flux ratios, motor-band ratio, speech-band ratio, and an articulation score so log-mel cannot forge a listening receipt. A direct LF coefficient source was tested and cut because it overdrove the graph and broke static open vowel; a broader harmonic-tail source was tested and cut because it worsened voiced-band behavior. A naive midpoint admittance scatter was tested and cut because it collapsed `mama`; the kept area-discontinuity scatter needed the opposite reflection sign for this graph state convention, and re-testing the literal SndKit sign after the clock fix made `thrombosis` loud/unstable. A long noisy release transient was tested and cut because it turned papa into motor-band energy; deterministic pressure release with PT-scale decay is structurally kept but still not sufficient. Next pressure is true graph pressure storage/release at severe closures; output coloring alone is not allowed to impersonate articulation.
|
||||
- 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.
|
||||
|
|
|
|||
|
|
@ -320,6 +320,8 @@ public sealed class PatchScriptTests
|
|||
|
||||
var export = FaustEmitter.Emit(patch, new FaustExportOptions("tract_graph_boundaries"));
|
||||
Assert.Contains("graph_connection_pressure_voices_0_nose_connection", export.Source);
|
||||
Assert.Contains("graph_connection_energy_in_voices_0_nose_connection", export.Source);
|
||||
Assert.Contains("graph_connection_energy_out_voices_0_nose_connection", export.Source);
|
||||
Assert.Contains("graph_radiation_admittance_voices_0_lip", export.Source);
|
||||
Assert.Contains("graph_radiation_flow_voices_0_lip", export.Source);
|
||||
Assert.Contains("patch_param_0) * (patch_param_0", export.Source);
|
||||
|
|
|
|||
Loading…
Reference in a new issue