diff --git a/docs/pink-trombone-parity.md b/docs/pink-trombone-parity.md index 9413304..22683b5 100644 --- a/docs/pink-trombone-parity.md +++ b/docs/pink-trombone-parity.md @@ -78,6 +78,8 @@ Current AquaSynth can express: ports, and wave-clock policies; - optional acoustic path `AreaControl` fields that turn tongue, constriction, and lip gestures into live diameter/area expressions at graph sample points; +- source-port `transient` control for graph-native release bursts on turbulent + or click-like sources; - graph lowering that splits paths at terminals, injects typed sources, scatters connection groups, and radiates from typed terminal ports; - oscillator/noise sources; @@ -135,7 +137,8 @@ Trombone anatomy: graph paths now attach `AcousticAreaControl`, so tongue, constriction, and lip gestures alter live node areas and therefore scattering along the oral tract. - `glottis` and `tract_injection` own excitation and positioned noise/burst - controls consumed by tract voices. + controls consumed by tract voices; graph injection maps burst into source + `transient` rather than a PT-specific side path. - `nasal_branch` adds a second diameter/area tube and generated oral/nasal connection terminals. Velum owns branch coupling and nasal aperture; the first nasal tube sample is not allowed to masquerade as the velum opening. diff --git a/src/AquaSynth.Core/FaustExport.cs b/src/AquaSynth.Core/FaustExport.cs index 32d84f8..8d53d2c 100644 --- a/src/AquaSynth.Core/FaustExport.cs +++ b/src/AquaSynth.Core/FaustExport.cs @@ -803,9 +803,12 @@ public static class FaustEmitter var tension = $"clip01({parameters.Expression(OwnerField(path, "tension"), port.Tension)})"; var opening = $"max(0.0, {parameters.Expression(OwnerField(path, "opening"), port.Opening)})"; var noise = $"clip01({parameters.Expression(OwnerField(path, "noise"), port.Noise)})"; + var transient = $"clip01({parameters.Expression(OwnerField(path, "transient"), port.Transient)})"; var balance = parameters.Expression(OwnerField(path, "balance"), port.Balance); var detune = port.Kind == AcousticSourceKind.Labial ? $" * (1.0 + ({balance} - 0.5) * 0.018)" : ""; var phase = $"os.phasor(1.0, {frequency}{detune})"; + var closure = $"clip01((0.12 - ({opening})) / 0.12)"; + var release = $"(max(0.0, (({closure}) : mem) - ({closure})) : + ~ *(0.90))"; return port.Kind switch { AcousticSourceKind.Glottal => @@ -815,9 +818,9 @@ public static class FaustEmitter AcousticSourceKind.Reed => $"(ma.tanh(sin(2.0 * ma.PI * {phase}) * (1.0 + {pressure} * 8.0)) * {opening} + no.noise * {noise} * 0.2) * {balance}", AcousticSourceKind.TurbulenceJet => - $"(no.noise : fi.highpass(2, 900.0 + 2600.0 * clip01(1.0 - {opening}))) * {noise} * {pressure} * clip01((0.8 - {opening}) / 0.8) * {balance}", + $"((no.noise : fi.highpass(2, 900.0 + 2600.0 * clip01(1.0 - {opening}))) * {noise} * {pressure} * clip01((0.8 - {opening}) / 0.8) + (no.noise : fi.highpass(1, 450.0)) * {transient} * {pressure} * {release} * (0.8 + 0.8 * clip01({opening} / 0.8))) * {balance}", AcousticSourceKind.Click => - $"no.noise * {pressure} * {opening} * exp(0.0 - age * 120.0) * {balance}", + $"no.noise * {pressure} * max({opening}, {transient}) * exp(0.0 - age * 120.0) * {balance}", AcousticSourceKind.Synthetic => $"sin(2.0 * ma.PI * {phase}) * {pressure} * {opening} * {balance}", _ => "0.0" diff --git a/src/AquaSynth.Core/Model.cs b/src/AquaSynth.Core/Model.cs index 9a6f0f4..30b38d8 100644 --- a/src/AquaSynth.Core/Model.cs +++ b/src/AquaSynth.Core/Model.cs @@ -307,6 +307,7 @@ public sealed record AcousticSourcePort( float Tension = 0.6f, float Opening = 0.5f, float Noise = 0.08f, + float Transient = 0, float Balance = 1, bool Active = true); diff --git a/src/AquaSynth.Core/PatchScript.cs b/src/AquaSynth.Core/PatchScript.cs index b6fed76..4705deb 100644 --- a/src/AquaSynth.Core/PatchScript.cs +++ b/src/AquaSynth.Core/PatchScript.cs @@ -439,7 +439,8 @@ public static class PatchScript injection.Burst, 0, injection.Diameter, - injection.Turbulence)); + injection.Turbulence, + injection.Burst)); } } @@ -572,6 +573,7 @@ public static class PatchScript GetBoundFloat(fields, line, 0.6f, $"/acoustic/sources/{_acousticSourcePorts.Count}/tension", "tension", "tenseness", "tense"), GetBoundFloat(fields, line, 0.5f, $"/acoustic/sources/{_acousticSourcePorts.Count}/opening", "opening", "open"), GetBoundFloat(fields, line, 0.08f, $"/acoustic/sources/{_acousticSourcePorts.Count}/noise", "noise", "aspiration"), + GetBoundFloat(fields, line, 0, $"/acoustic/sources/{_acousticSourcePorts.Count}/transient", "transient", "burst"), GetBoundFloat(fields, line, 1, $"/acoustic/sources/{_acousticSourcePorts.Count}/balance", "balance"), TryGetAny(fields, ["active"], out var active) ? ParseBool(active, line) : true); AddAcousticSourcePortRecord(port); @@ -1350,12 +1352,14 @@ public static class PatchScript Math.Max(injection.Turbulence, injection.Burst), 0, injection.Diameter, - Math.Max(0.001f, injection.Turbulence)); + Math.Max(0.001f, injection.Turbulence), + injection.Burst); var injectionSourceIndex = _acousticSourcePorts.Count; AddAcousticSourcePortRecord(injectionSource); MirrorParameterBinding(OwnerField(tractPath, "turbulence"), $"/acoustic/sources/{injectionSourceIndex}/pressure"); MirrorParameterBinding(OwnerField(tractPath, "constriction_diameter"), $"/acoustic/sources/{injectionSourceIndex}/opening"); MirrorParameterBinding(OwnerField(tractPath, "turbulence"), $"/acoustic/sources/{injectionSourceIndex}/noise"); + MirrorParameterBinding(OwnerField(tractPath, "injection/burst"), $"/acoustic/sources/{injectionSourceIndex}/transient"); AddAcousticTerminalRecord(new AcousticTerminal(injectionSource.Name, injectionSource.Path, injectionSource.Position, AcousticTerminalKind.Source, injectionSource.Name)); sourceNames.Add(injectionName); } diff --git a/state/evidence.jsonl b/state/evidence.jsonl index eba7a99..1f6eec5 100644 --- a/state/evidence.jsonl +++ b/state/evidence.jsonl @@ -167,3 +167,4 @@ {"evidence":"Cut `PinkTromboneParityFixture.GraphAquaScript` and the accepted waveguide utterance test; PT parity tests now render graph candidates only. Focused tests passed with disabled build servers. Latest static graph artifact artifacts/parity/pink-trombone-logmel/20260526T225434227 reports open/front/nasal/ma/sibilant/closure cosine 0.6035/0.6932/0.6814/0.6239/0.3428/0.4135. Latest graph-only utterance artifact artifacts/parity/pink-trombone-utterance-logmel/20260526T225509931 reports mama cosine -0.0657 RMS 1.0484; papa 0.8253 RMS 0.8651; thrombosis 0.2533 RMS 3.2917.","claim":"PT accepted parity must exercise the typed acoustic graph, not the old waveguide path. Generated tract graphs now mirror live tract parameter bindings into acoustic records, use rest morphology instead of baking the first utterance frame into the path, treat velum as branch aperture/coupling rather than nasal tube sample area, and radiate a raw/high-passed pressure blend. Mama remains a concrete graph-parity failure; the next coherent cut is live segment-area modulation and graph-native closure/transient ownership.","timestamp":"2026-05-26T23:50:00+01:00","topic":"pink-trombone-graph-only-parity"} {"evidence":"After adding ordinary internal-node scatter, focused graph parity tests passed. Latest static graph artifact artifacts/parity/pink-trombone-logmel/20260526T225955955 reports open/front/nasal/ma/sibilant/closure cosine 0.6015/0.6358/0.6851/0.5988/0.3836/0.4606. Latest graph utterance artifact artifacts/parity/pink-trombone-utterance-logmel/20260526T230028874 reports mama cosine 0.3365 RMS 1.2421; papa 0.8264 RMS 0.3149; thrombosis 0.3874 RMS 2.0519.","claim":"Internal source/injection terminals in the acoustic graph must transmit pressure between adjacent path segments unless an explicit connection or boundary law says otherwise. Treating an unconnected internal terminal as independent reflective boundaries split the tract and made moving utterances fail. Ordinary multi-port graph nodes now scatter incident pressure across ports, which moved mama from negative cosine to a usable graph-only smoke rung.","timestamp":"2026-05-26T23:02:00+00:00","topic":"acoustic-graph-internal-node-scatter"} {"evidence":"Added `AcousticAreaControl` to acoustic paths, generated neutral oral area terminals for `tract propagation=graph`, and mirrored tract tongue/constriction/lip parameters into path-area fields. Focused graph parity tests passed. Latest static artifact artifacts/parity/pink-trombone-logmel/20260526T232021742 reports open/front/nasal/ma/sibilant/closure cosine 0.6252/0.6576/0.6893/0.6550/0.4166/0.5554. Latest utterance artifact artifacts/parity/pink-trombone-utterance-logmel/20260526T232106458 reports mama cosine 0.3354 RMS 1.0698; papa 0.8162 RMS 0.1815; thrombosis 0.3584 RMS 1.9499.","claim":"The typed acoustic graph now has live sampled morphology. Path rest shape remains the continuous owner, while `AcousticAreaControl` evaluates tongue, constriction, and lip gestures at graph sample terminals so scattering changes over time. This is the missing PT-class moving-tube primitive without preserving a PT-shaped waveguide backend.","timestamp":"2026-05-26T23:20:00+00:00","topic":"acoustic-path-live-area-control"} +{"evidence":"Added `AcousticSourcePort.Transient`, parser support for `transient`/`burst` on source ports, graph lowering for turbulence release bursts, and tract injection mirroring from `tract/injection/burst` to generated source transient. Focused graph utterance and structural tests passed. Boosting the release multiplier worsened papa/thrombosis, so the transient remains a semantic source hook rather than a metric-forced gain hack.","claim":"Closure-release energy belongs to a typed source port, not a PT-specific backend or a hidden utterance compensator. The current transient hook is architecturally correct but not yet the main parity lever; next pressure is timing/normalization rather than brute-force burst gain.","timestamp":"2026-05-27T10:36:00+01:00","topic":"acoustic-source-transient-control"} diff --git a/state/spine.yaml b/state/spine.yaml index 2014321..a45f383 100644 --- a/state/spine.yaml +++ b/state/spine.yaml @@ -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, connection, 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 coupling/aperture, and the first nasal tube sample is no longer allowed to decide the velum opening. Graph radiation now blends raw pressure with high-passed pressure instead of throwing away body energy. Latest static graph evidence: open/front/nasal/ma/sibilant/closure cosine 0.6252/0.6576/0.6893/0.6550/0.4166/0.5554. - - 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; `glottis` owns excitation controls; `tract_injection` owns positioned frication/burst controls; `nasal_branch` owns a second diameter/area tube and branch aperture; `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/20260526T232106458`: mama cosine 0.3354 / RMS 1.0698, papa 0.8162 / 0.1815, thrombosis 0.3584 / 1.9499. The internal-node scatter fix made unconnected injection/source terminals transmit pressure between adjacent segments instead of acting as dead boundaries. Next pressure is graph-native closure/transient ownership and source/radiation level normalization, not reviving the old PT-shaped waveguide path. + - 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; `glottis` owns excitation controls; `tract_injection` owns positioned frication/burst controls; `AcousticSourcePort.Transient` owns graph-native release/click energy; `nasal_branch` owns a second diameter/area tube and branch aperture; `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/20260526T232106458`: mama cosine 0.3354 / RMS 1.0698, papa 0.8162 / 0.1815, thrombosis 0.3584 / 1.9499. The internal-node scatter fix made unconnected injection/source terminals transmit pressure between adjacent segments instead of acting as dead boundaries. Next pressure is source/radiation level normalization and better plosive timing, not reviving the old PT-shaped waveguide path. - 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. - Do not expand into prosody, emotional context, personality, or broad Weksa expressivity until the tiny IPA utterance harness can show useful loss movement. diff --git a/tests/AquaSynth.Dsl.Tests/PatchScriptTests.cs b/tests/AquaSynth.Dsl.Tests/PatchScriptTests.cs index 37c14df..7720a79 100644 --- a/tests/AquaSynth.Dsl.Tests/PatchScriptTests.cs +++ b/tests/AquaSynth.Dsl.Tests/PatchScriptTests.cs @@ -629,6 +629,7 @@ public sealed class PatchScriptTests Assert.NotEmpty(patch.TractMotions); Assert.Equal(TractPropagationMode.Graph, voice.Tract.Propagation); Assert.Contains(patch.AcousticPaths, path => path.Name == "voices_0_oral" && path.AreaControl is not null); + Assert.Contains(patch.AcousticSourcePorts, port => port.Name == "voices_0_inj" && port.Transient > 0); Assert.Contains(patch.AcousticTerminals, terminal => terminal.Name.StartsWith("voices_0_area_", StringComparison.Ordinal)); Assert.Contains("acoustic_graph_radiated", export.Source); Assert.Contains("graph_terminal_area_voices_0_area_", export.Source);