Fix graph tissue valve pitch ownership
This commit is contained in:
parent
fc44464b2b
commit
c37af981a6
4 changed files with 40 additions and 4 deletions
|
|
@ -267,6 +267,14 @@ Hard PT thresholds return only after the shared physical primitives have passed
|
|||
structural, passivity, and render-smoke checks; otherwise the test suite rewards
|
||||
parity whack-a-mole over a coherent voice machine.
|
||||
|
||||
For graph vocal sources, `freq=` is not pitch authority. It is only a stiffness
|
||||
initializer when the source has no explicit or parameter-bound stiffness. Once a
|
||||
tissue valve exposes `stiffness`, authored curves, realtime controls, or learned
|
||||
controllers own that degree of freedom, and the lowering must not reintroduce a
|
||||
fixed-frequency floor underneath it. Valve displacement shapes aperture; it is
|
||||
not a second hidden audio oscillator. Source flow comes from pressure through
|
||||
dynamic aperture, modal tissue motion, and acoustic load.
|
||||
|
||||
## Source Distillations
|
||||
|
||||
- PortAudio callback guidance: callbacks are delicate realtime contexts; avoid
|
||||
|
|
|
|||
|
|
@ -1633,13 +1633,17 @@ public static class FaustEmitter
|
|||
var verticalPhase = $"clip01({parameters.Expression(OwnerField(path, "vertical_phase"), port.VerticalPhase)})";
|
||||
var reservoirPressure = $"max(0.0, {parameters.Expression(OwnerField(path, "reservoir_pressure"), port.ReservoirPressure)})";
|
||||
var downstreamPressure = $"max(0.0, {parameters.Expression(OwnerField(path, "downstream_pressure"), port.DownstreamPressure)})";
|
||||
var hasExplicitStiffness = port.Stiffness > 0 || parameters.IsBound(OwnerField(path, "stiffness"));
|
||||
var effectiveStiffness = hasExplicitStiffness
|
||||
? $"max(0.00002, ({stiffness}) * (0.55 + 1.10 * ({tension})))"
|
||||
: $"{prefix}_stiffness_hint * (0.35 + 1.65 * ({tension}))";
|
||||
|
||||
source.AppendLine($" {prefix}_stiffness_hint = max(0.00002, min(0.16, pow(2.0 * ma.PI * max(20.0, {frequency}) / ma.SR, 2.0)));");
|
||||
source.AppendLine($" {prefix}_reservoir_pressure = ({pressure}) * ({drive}) * ({reservoirPressure});");
|
||||
source.AppendLine($" {prefix}_downstream_pressure = ({downstreamPressure}) + ({loadCoupling}) * ma.tanh({prefix}_load_pressure);");
|
||||
source.AppendLine($" {prefix}_pressure_drive = max(0.0, {prefix}_reservoir_pressure - {prefix}_downstream_pressure);");
|
||||
source.AppendLine($" {prefix}_stiffness = max(({stiffness}), {prefix}_stiffness_hint * (0.35 + 1.65 * ({tension})));");
|
||||
source.AppendLine($" {prefix}_modal_frequency = max(45.0, min(5200.0, (ma.SR / (2.0 * ma.PI)) * sqrt(max(0.00002, {prefix}_stiffness) / ({mass}))));");
|
||||
source.AppendLine($" {prefix}_stiffness = {effectiveStiffness};");
|
||||
source.AppendLine($" {prefix}_modal_frequency = max(45.0, min(10000.0, (ma.SR / (2.0 * ma.PI)) * sqrt(max(0.00002, {prefix}_stiffness) / ({mass}))));");
|
||||
source.AppendLine($" {prefix}_load_detune = 1.0 - 0.035 * ma.tanh({prefix}_load_pressure * ({loadCoupling}));");
|
||||
source.AppendLine($" {prefix}_oscillation_gate = clip01(({prefix}_pressure_drive - 0.035 - 0.18 * clip01({opening})) * (2.4 + 2.6 * ({drive})));");
|
||||
source.AppendLine($" {prefix}_modal_q = 3.0 + 24.0 * clip01(({pressure}) * (1.0 - 0.45 * ({damping})) + 0.35 * ({tension}));");
|
||||
|
|
@ -1675,8 +1679,8 @@ public static class FaustEmitter
|
|||
}
|
||||
source.AppendLine($" {prefix}_aperture = max(0.0, ({restOpening}) + ({opening}) + {prefix}_displacement - ({saturation}) * pow({prefix}_displacement, 3.0));");
|
||||
source.AppendLine($" {prefix}_turbulence = no.noise : fi.highpass(2, 1200.0 + 2800.0 * clip01(1.0 - {prefix}_aperture));");
|
||||
source.AppendLine($" {prefix}_voicing = {prefix}_modal_tissue * (0.65 + 5.5 * ({tension})) + {prefix}_displacement * (0.35 + 1.8 * ({drive}));");
|
||||
source.AppendLine($" {prefix}_flow = ma.tanh(({prefix}_pressure_drive * {prefix}_aperture * (1.5 + 8.0 * ({drive}))) + ({prefix}_voicing * {prefix}_pressure_drive * (2.0 + 8.0 * ({drive}))));");
|
||||
source.AppendLine($" {prefix}_voicing = {prefix}_modal_tissue * (0.18 + 1.45 * ({tension})) + {prefix}_displacement * (0.03 + 0.18 * ({drive}));");
|
||||
source.AppendLine($" {prefix}_flow = ma.tanh(({prefix}_pressure_drive * {prefix}_aperture * (1.2 + 5.0 * ({drive}))) + ({prefix}_voicing * {prefix}_pressure_drive * (0.55 + 2.6 * ({drive}))));");
|
||||
source.AppendLine($" {prefix}_noise = {prefix}_turbulence * ({noise}) * {prefix}_pressure_drive * clip01({prefix}_aperture) * (1.0 - 0.55 * ({tension}));");
|
||||
source.AppendLine($" {prefix}_out = ({prefix}_flow * (0.55 + 2.6 * {prefix}_pressure_drive) + {prefix}_noise) * ({balance});");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -211,3 +211,4 @@
|
|||
{"evidence":"Expanded the graph vocal DSL with layered tissue-valve laws, named continuous `area_curve` morphology, loss/radiation model selection, and `gesture` groups over existing parameter curves. `kind=glottal` and `glottis path=...` now lower as tissue-valve graph source ports by default, while generated Faust emits reservoir/downstream pressure, upper/lower valve state for layered laws, named segment loss, and radiation model locals. Added canonical human larynx, bird syrinx, and alien multivalve graph patches.","claim":"The live vocal architecture is now a graph-native reusable physical core. Human larynxes, bird syrinxes, and alien morphologies are presets over shared valves, paths, branches, losses, radiation, and realtime parameter gestures; parity golf should wait until this structural surface has been validated by Faust and render smoke tests.","timestamp":"2026-05-28T20:10:00+01:00","topic":"perfect-machine-vocal-dsl"}
|
||||
{"evidence":"Demoted Pink Trombone log-mel parity tests from hard acceptance thresholds to diagnostic artifact generation plus bounded/nonzero render checks. Full-suite parity still reports weak articulation for the graph voice after glottal lowering moved onto tissue valves, but those scores now live in artifacts instead of pretending PT parity is the current gate.","claim":"Pink Trombone parity is no longer the owner of this architecture phase. It remains a diagnostic lane to inspect artifacts after structural source/morphology/loss/radiation work, and hard acceptance should return only after the generalized graph model has its render smoke and passivity behavior under control.","timestamp":"2026-05-28T20:25:00+01:00","topic":"parity-test-authority"}
|
||||
{"evidence":"Listening/spectrogram audit showed the first tissue-valve batches were mostly faint noise and DC-like startup energy. Replaced the non-self-sustaining noise-resonator seed with a pressure-gated tissue oscillator whose frequency is derived from stiffness/mass/tension and bounded load detune, and bounded source-load pressure feedback with `tanh` so the tract can perturb instead of fully quench the source. Added an explicit subglottal wall terminal to `human-larynx-graph.aqua` so folds at the larynx junction have an upstream trachea segment instead of a source node with no incident wave port. Human modal, bird, and alien graph patches now render sustained harmonic stacks in spectrograms under `artifacts/listening/vocal-core-squawk-20260528T211222944`.","claim":"The graph machine can now produce audible vocalizations through reusable tissue-valve semantics. The next work is no longer basic audibility; it is shaping morphology, gestures, and source coupling into credible speech and bird articulation.","timestamp":"2026-05-28T21:16:00+01:00","topic":"tissue-valve-squawk-audit"}
|
||||
{"evidence":"Warbling White-eye visual audition exposed two source-ownership errors: graph tissue-valve lowering still let `freq=` impose a stiffness floor even when stiffness was explicit/parameter-bound, and direct displacement voicing injected low-frequency junk instead of only shaping aperture. Fixed graph lowering so explicit stiffness owns effective stiffness, lifted the graph tissue modal ceiling to 10 kHz for small syrinx/alien sources, and reduced modal/displacement flow drive to avoid square-wave broadband saturation. New audition artifacts under `artifacts/listening/warbling-white-eye-20260528T220500961` include five WAVs plus reference/candidate spectrogram comparisons; `05-single-trace.wav` is the clearest Warbling White-eye-shaped candidate by eye.","claim":"Bird-like graph vocalization now depends on visible phrase gestures, realtime stiffness/pressure/opening curves, and source-flow ownership rather than metrics or a fixed `freq=` rail. Future syrinx fitting should start from single-dominant-labium traces, then add bilateral behavior only when the spectrogram needs it.","timestamp":"2026-05-28T22:32:00+01:00","topic":"warbling-white-eye-visual-audition"}
|
||||
|
|
|
|||
|
|
@ -664,6 +664,29 @@ public sealed class PatchScriptTests
|
|||
Assert.DoesNotContain("os.phasor(1.0, layered_voice_freq", export.Source);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void GraphTissueValveExplicitStiffnessOwnsPitch()
|
||||
{
|
||||
var export = FaustEmitter.EmitScript("""
|
||||
patch gain=.2
|
||||
param path=/voice/stiffness default=.04 min=0 max=.16 step=.001
|
||||
param path=/voice/pressure default=.8 min=0 max=1 step=.001
|
||||
curve name=stiffness_sweep path=/voice/stiffness points=0:.03,.2:.12 depth=1
|
||||
path name=trachea length_cm=6 diameters=.3,.35,.32,.28
|
||||
source_port name=folds path=trachea model=tissue_valve position=0 pressure=@/voice/pressure tension=.8 opening=.08 stiffness=@/voice/stiffness mass=.12 damping=.12
|
||||
radiation_port name=mouth path=trachea position=1 opening=.9 reflection=-.6
|
||||
acoustic_network name=voice_graph path=trachea sources=folds radiation=mouth
|
||||
acoustic network=voice_graph freq=4200 gain=.5 sustain=.3
|
||||
""", new FaustExportOptions("explicit_stiffness"));
|
||||
|
||||
Assert.Contains("_stiffness_hint", export.Source);
|
||||
Assert.Contains("_stiffness = max(0.00002", export.Source);
|
||||
Assert.Contains("(0.55 + 1.10 *", export.Source);
|
||||
Assert.Contains("min(10000.0", export.Source);
|
||||
Assert.DoesNotContain("_stiffness = max((max(0.0, param_0)", export.Source);
|
||||
Assert.DoesNotContain("_stiffness_hint * (0.35 + 1.65", export.Source);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ParserRejectsUnknownParameterReferences()
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue