From d7491bf40ded64fb45ca47a06fef948c398fbd63 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Fri, 29 May 2026 15:04:46 +0100 Subject: [PATCH] Smooth compact tract source placement --- docs/acoustic-graph-dsp-audit.md | 8 ++++++++ src/AquaSynth.Core/FaustExport.cs | 3 ++- state/evidence.jsonl | 1 + state/spine.yaml | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/acoustic-graph-dsp-audit.md b/docs/acoustic-graph-dsp-audit.md index df04c6d..fe54d79 100644 --- a/docs/acoustic-graph-dsp-audit.md +++ b/docs/acoustic-graph-dsp-audit.md @@ -155,6 +155,14 @@ about `1m33s`; `mama/papa/thrombosis` cosine is `0.8324/0.7730/0.3176`. Thrombosis RMS improved to `0.1715`, but active ratio fell to `0.1598` and silence mismatch rose to `0.7811`, so articulation remains the live failure. +Follow-up: source placement now uses a raised-cosine kernel instead of a hard +triangular weight over the compact source bank. It keeps the same graph size +while making moving injection ownership continuous enough for DSP. Artifact +`artifacts/parity/pink-trombone-utterance-logmel/20260529T140038717` nudges +thrombosis active ratio to `0.1826`, silence mismatch to `0.7643`, and +speech-band ratio to `0.2704`; still not accepted, but the improvement came +without restoring discrete source density. + ## Component Audit ### Topology Construction diff --git a/src/AquaSynth.Core/FaustExport.cs b/src/AquaSynth.Core/FaustExport.cs index 12c376b..f8acf46 100644 --- a/src/AquaSynth.Core/FaustExport.cs +++ b/src/AquaSynth.Core/FaustExport.cs @@ -1034,7 +1034,8 @@ public static class FaustEmitter var indexScale = parameters.Expression(OwnerField(path, "position/index_scale"), control.IndexScale); var target = $"clip01(({index}) * max(0.0, {indexScale}))"; var radius = $"max(0.000001, ({width}) * max(0.0, {indexScale}))"; - return $"clip01(1.0 - abs({F(port.Position)} - ({target})) / ({radius}))"; + var distance = $"abs({F(port.Position)} - ({target})) / ({radius})"; + return $"select2(({distance}) < 1.0, 0.0, 0.5 + 0.5 * cos(ma.PI * ({distance})))"; } private static void EmitOperatorGraph(StringBuilder source, Playback playback, OperatorGraph graph, string name, ParameterMap parameters, List warnings) diff --git a/state/evidence.jsonl b/state/evidence.jsonl index 5c0a851..cd5e5e2 100644 --- a/state/evidence.jsonl +++ b/state/evidence.jsonl @@ -222,3 +222,4 @@ {"date":"2026-05-29","area":"acoustic-graph","summary":"Radiation boundaries now feed load back into the graph by filtering reflected boundary waves through a named boundary-load term before the outgoing wave returns to the delay line. The remaining unconnected multi-port node pressure fallback was cut and replaced with area-scattering plus node area-energy probes. Native PT probes still fail accepted utterance articulation, so this is a coherence repair: contact constrained-flow history and source impedance port laws remain the next missing owners.","evidence":"docs/acoustic-graph-dsp-audit.md; artifacts/parity/pink-trombone-graph-thrombosis-probes/20260529T112805836; artifacts/parity/pink-trombone-utterance-logmel/20260529T112806745"} {"date":"2026-05-29","area":"acoustic-graph","summary":"Generated tract area terminals are geometry Junctions again, while generated contact terminals are a sparse four-section overlay that owns closure pressure storage/release. The eight-contact plus inline-occlusion trial overflowed native Faust debug compile; the four-contact release-only owner passes structural graph tests, the opt-in thrombosis graph probe, and accepted-utterance diagnostics. This exposes rather than fixes the remaining gap: only the lip-end contact closes in thrombosis, and accepted utterances still fail articulation/silence metrics.","evidence":"docs/acoustic-graph-dsp-audit.md; artifacts/parity/pink-trombone-graph-thrombosis-probes/20260529T122217729; artifacts/parity/pink-trombone-utterance-logmel/20260529T122409541"} {"date":"2026-05-29","area":"acoustic-graph","summary":"Generated tract lowering now compacts the Faust graph: declared morphology sections remain intact, but generated oral area terminals are capped at 10, generated injection source ports at 8, and generated contacts at 4. The thrombosis debug DSP dropped from 1652 to 532 lines, source graph lines from 687 to 162, and next-state lines from 89 to 27; opt-in native debug compile/render and accepted utterance diagnostics pass faster. Metrics confirm this is a backend coherence cut, not articulation parity: thrombosis RMS improved to 0.1715 but active ratio/silence mismatch remain bad at 0.1598/0.7811.","evidence":"docs/acoustic-graph-dsp-audit.md; artifacts/parity/pink-trombone-graph-thrombosis-probes/20260529T125048965; artifacts/parity/pink-trombone-utterance-logmel/20260529T125227926"} +{"date":"2026-05-29","area":"acoustic-graph","summary":"Moving tract injection source placement now uses a raised-cosine kernel over the compact source bank instead of a hard triangular weight. This keeps graph size fixed while making source ownership more continuous and DSP-friendly. The latest accepted utterance diagnostic still fails articulation, but thrombosis moves in the right direction: active ratio 0.1598->0.1826, silence mismatch 0.7811->0.7643, and speech-band ratio 0.2537->0.2704.","evidence":"docs/acoustic-graph-dsp-audit.md; artifacts/parity/pink-trombone-graph-thrombosis-probes/20260529T135910192; artifacts/parity/pink-trombone-utterance-logmel/20260529T140038717"} diff --git a/state/spine.yaml b/state/spine.yaml index a259896..0437355 100644 --- a/state/spine.yaml +++ b/state/spine.yaml @@ -130,6 +130,7 @@ live_invariants: - 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. - Source ports now have an explicit `impedance`/`load` control and graph lowering uses node incident pressure to make glottal, labial/syrinx, reed, click, synthetic, and turbulence sources load-aware. Generated tract area terminals are `Junction` geometry owners again; generated `voices_0_contact_*` terminals are a sparse contact overlay capped at four interior sections, with named graph-owned `graph_contact_*_closure`, `_reservoir`, and `_release` signals so closure pressure storage is no longer either every area sample or only a turbulence-source trick. Eight generated contacts plus inline occlusion overflowed the native debug Faust compile; four sparse contacts pass the opt-in thrombosis graph probe. `patches/advanced/bird-syrinx.aqua` is the first checked-in differentiable syrinx patch: paired labial source ports, bronchial paths, a tracheal path, an area-scattering merge, and beak radiation, all through `AcousticPortNetwork`. - Generated PT-style `tract` lowering now compacts the Faust graph without changing user-facing morphology resolution: `VocalTract.Sections` and `AcousticPath.AreaFunction.Sections` still preserve the declared tract grid, but generated oral area terminals are capped at 10, generated moving injection source ports at 8, and generated contacts at 4. Source position weighting widens to the compact source spacing so the source bank approximates continuous placement instead of restoring one port per cell. Latest debug evidence `artifacts/parity/pink-trombone-graph-thrombosis-probes/20260529T125048965` drops generated debug DSP size from 1652 to 532 lines, with source graph lines 687->162 and next-state lines 89->27; accepted utterance artifact `artifacts/parity/pink-trombone-utterance-logmel/20260529T125227926` still fails articulation, so this is backend coherence/speed, not parity victory. + - Moving tract injection placement now uses a raised-cosine kernel over the compact source bank instead of a hard triangular source-position weight. Keep this direction: smoother continuous heuristics over fewer generated ports, not more discrete source terminals. Artifact `artifacts/parity/pink-trombone-utterance-logmel/20260529T140038717` still fails articulation but improves thrombosis active ratio/silence/speech-band slightly without increasing graph size. - 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. - `FaustExportOptions.DebugProbeUi` wraps graph probe signals in Faust `vbargraph` UI controls under `/debug/...` without changing audio output arity. Native streaming Faust patches now separate writable controls from read-only probe zones and can read/snapshot probe values after `ProcessBlock`; use this for acoustic graph passivity/radiation inspection, leave it off for normal parity renders.