diff --git a/docs/acoustic-graph-flow-audit.md b/docs/acoustic-graph-flow-audit.md index 8927a6f..c811df5 100644 --- a/docs/acoustic-graph-flow-audit.md +++ b/docs/acoustic-graph-flow-audit.md @@ -164,7 +164,9 @@ kept even though it exposes over-radiation, because it moves ownership to the 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 only loudness fault. Ordinary two-port area discontinuities now expose the +same area-weighted energy probes, so vowel-body scattering can be inspected at +the layer where tract resonances should actually form. The next coherent implementation target is to make that law passive and radiation-aware: diff --git a/src/AquaSynth.Core/FaustExport.cs b/src/AquaSynth.Core/FaustExport.cs index 158e7ca..4851e76 100644 --- a/src/AquaSynth.Core/FaustExport.cs +++ b/src/AquaSynth.Core/FaustExport.cs @@ -1697,6 +1697,8 @@ public static class FaustEmitter source.AppendLine($" {voiceName}_graph_area_reflection_{node.Name} = {reflection};"); source.AppendLine($" {firstOutgoing} = {secondIncoming} + {voiceName}_graph_area_reflection_{node.Name} * ({firstIncoming} + {secondIncoming}) + ({sourceInjection}) / 2;"); source.AppendLine($" {secondOutgoing} = {firstIncoming} - {voiceName}_graph_area_reflection_{node.Name} * ({firstIncoming} + {secondIncoming}) + ({sourceInjection}) / 2;"); + source.AppendLine($" {voiceName}_graph_area_energy_in_{node.Name} = ({firstArea}) * pow({firstIncoming}, 2.0) + ({secondArea}) * pow({secondIncoming}, 2.0);"); + source.AppendLine($" {voiceName}_graph_area_energy_out_{node.Name} = ({firstArea}) * pow({firstOutgoing}, 2.0) + ({secondArea}) * pow({secondOutgoing}, 2.0);"); return true; } diff --git a/state/evidence.jsonl b/state/evidence.jsonl index 37c6215..b3b8d3a 100644 --- a/state/evidence.jsonl +++ b/state/evidence.jsonl @@ -184,3 +184,4 @@ {"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"} {"evidence":"Moved graph source evaluation into recursive node context by emitting per-node incident pressure and node-local source sums, and moved generated tract injection source banks from graph nodes to cell centers with `1 / sections` index scaling. Focused structural and PT parity tests passed. Latest utterance artifact artifacts/parity/pink-trombone-utterance-logmel/20260527T172949293: mama/papa/thrombosis cosine 0.6654/0.7746/0.5522, rmsRatio 3.0010/2.5712/2.4943, articulation 0.1444/0.1177/0.1193. Latest static artifact artifacts/parity/pink-trombone-logmel/20260527T172843945: closure-release rmsRatio 1.0078, cosine 0.6505.","claim":"Moving turbulence/release sources into graph node context and cell-centered geometry is architecturally correct even though papa articulation still worsens. PT-class source injection is cell-local wave excitation, not a click born on the radiation terminal; the remaining plosive failure points to missing upstream pressure storage rather than source placement.","timestamp":"2026-05-27T17:32:00+01:00","topic":"acoustic-graph-cell-centered-sources"} {"evidence":"Added a release-timed burst-noise term to `TurbulenceJet` and softened radiation from an over-bright 15/85 raw/highpassed boundary-flow blend to 30/70 after local admittance weighting. Focused PT parity tests passed. Latest utterance artifact artifacts/parity/pink-trombone-utterance-logmel/20260527T174236049: mama/papa/thrombosis cosine 0.6578/0.7692/0.5585, rmsRatio 3.0006/2.6153/2.3488, articulation 0.1437/0.1173/0.1191. Latest static artifact artifacts/parity/pink-trombone-logmel/20260527T174139661: closure-release rmsRatio 0.9900, speechBandRatio 0.0842.","claim":"Plosive release should include turbulent burst energy, and radiation should not be an almost pure differentiator when tract body is weak. The kept change is modest because stronger source burst did not solve papa; remaining speech failure is tract resonance/scattering and pressure storage, not source loudness.","timestamp":"2026-05-27T17:45:00+01:00","topic":"acoustic-graph-release-burst-radiation-slope"} +{"evidence":"Added generated Faust `graph_area_energy_in_*` and `graph_area_energy_out_*` probes for ordinary same-path two-port area discontinuities and fenced them with structural tests.","claim":"Vowel-body failures need observability at the tract scatter sites, not only at radiation output. Area-weighted energy probes now exist for both same-path discontinuities and three-port branches before changing the scattering law again.","timestamp":"2026-05-27T17:50:00+01:00","topic":"acoustic-graph-area-energy-probes"} diff --git a/state/spine.yaml b/state/spine.yaml index 52cf75f..03d71c5 100644 --- a/state/spine.yaml +++ b/state/spine.yaml @@ -1,6 +1,6 @@ project: AquaSynth spine_version: 1 -updated: 2026-05-27T17:45:00+01:00 +updated: 2026-05-27T17:50:00+01:00 prime_directive: > Build coherent synth machinery. References exist to reveal missing structure, @@ -123,6 +123,7 @@ live_invariants: - `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. - Graph source lowering now names per-node incident pressure and node-local source sums inside the recursive graph loop. Generated tract injection source banks now use cell-centered positions and `1 / sections` index scaling, so turbulence/release energy is born inside tube cells rather than directly on graph/radiation nodes. Latest source-position artifact under `artifacts/parity/pink-trombone-utterance-logmel/20260527T172949293`: mama/papa/thrombosis cosine 0.6654/0.7746/0.5522, rmsRatio 3.0010/2.5712/2.4943, articulation 0.1444/0.1177/0.1193. Static closure-release RMS improved to 1.0078 under `artifacts/parity/pink-trombone-logmel/20260527T172843945`, but papa articulation worsened; keep the cell-centered source placement because it is the correct graph-level source geometry, not because metrics liked it. - TurbulenceJet now includes a release-timed burst-noise component in addition to the deterministic pressure pulse, but a stronger trial barely moved papa; the source is not the main remaining articulation bottleneck. Graph radiation now mixes 30% raw boundary flow with 70% high-passed flow after local admittance weighting, down from the over-bright 15/85 blend. Latest radiation/source artifact under `artifacts/parity/pink-trombone-utterance-logmel/20260527T174236049`: mama/papa/thrombosis cosine 0.6578/0.7692/0.5585, rmsRatio 3.0006/2.6153/2.3488, articulation 0.1437/0.1173/0.1191. Static `closure-release` under `artifacts/parity/pink-trombone-logmel/20260527T174139661` has rmsRatio 0.9900 and speechBandRatio 0.0842. This is still not speaking; next pressure is true tract resonance/passive scattering and pressure storage, not more burst gain. + - Same-path two-port area discontinuities now emit `graph_area_energy_in_*` and `graph_area_energy_out_*` probes alongside the three-port branch `graph_connection_energy_*` probes. Use these to inspect passivity and formant-body failures at the scatter sites rather than judging only final output loudness. - 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. diff --git a/tests/AquaSynth.Dsl.Tests/PatchScriptTests.cs b/tests/AquaSynth.Dsl.Tests/PatchScriptTests.cs index 88d6c68..7de9fbd 100644 --- a/tests/AquaSynth.Dsl.Tests/PatchScriptTests.cs +++ b/tests/AquaSynth.Dsl.Tests/PatchScriptTests.cs @@ -324,6 +324,8 @@ public sealed class PatchScriptTests Assert.Contains("graph_connection_energy_out_voices_0_nose_connection", export.Source); Assert.Contains("graph_node_incident_pressure_", export.Source); Assert.Contains("graph_node_source_", export.Source); + Assert.Contains("graph_area_energy_in_", export.Source); + Assert.Contains("graph_area_energy_out_", 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);