Add Zyn PAD filter Q mapping
This commit is contained in:
parent
98f568cbb2
commit
dac29640c9
10 changed files with 81 additions and 8 deletions
|
|
@ -157,7 +157,10 @@ public static class FaustEmitter
|
|||
List<string> warnings,
|
||||
string? oscillatorOverride = null)
|
||||
{
|
||||
if (voice.Filter.LowPassResonance != 0 || parameters.IsBound(OwnerField(ownerPath, "filter/resonance")))
|
||||
if (voice.Filter.LowPassResonance != 0 ||
|
||||
voice.Filter.LowPassQ != 0 ||
|
||||
parameters.IsBound(OwnerField(ownerPath, "filter/resonance")) ||
|
||||
parameters.IsBound(OwnerField(ownerPath, "filter/lpf_q")))
|
||||
{
|
||||
warnings.Add($"{name}: low-pass resonance is approximated with Faust resonlp");
|
||||
}
|
||||
|
|
@ -226,10 +229,14 @@ public static class FaustEmitter
|
|||
: "";
|
||||
var lpf = $"clip01({parameters.Expression(OwnerField(ownerPath, "filter/lpf"), voice.Filter.LowPass)} * (1.0 + {parameters.Expression(OwnerField(ownerPath, "filter/lpf_ramp"), voice.Filter.LowPassRamp)} * age * 1.8){lpfEnvelope} + patch_mod_lpf + {lpfMod})";
|
||||
var hpf = $"clip01({parameters.Expression(OwnerField(ownerPath, "filter/hpf"), voice.Filter.HighPass)} * (1.0 + {parameters.Expression(OwnerField(ownerPath, "filter/hpf_ramp"), voice.Filter.HighPassRamp)} * age * 2.0) + patch_mod_hpf + {hpfMod})";
|
||||
var hasExplicitQ = voice.Filter.LowPassQ > 0 || parameters.IsBound(OwnerField(ownerPath, "filter/lpf_q"));
|
||||
var hasResonance = voice.Filter.LowPassResonance > 0 || parameters.IsBound(OwnerField(ownerPath, "filter/resonance"));
|
||||
var resonance = parameters.Expression(OwnerField(ownerPath, "filter/resonance"), voice.Filter.LowPassResonance);
|
||||
var lowPassQ = parameters.Expression(OwnerField(ownerPath, "filter/lpf_q"), voice.Filter.LowPassQ);
|
||||
var lowPassOrder = Math.Clamp(voice.Filter.LowPassOrder, 1, 12);
|
||||
var lowpass = hasResonance
|
||||
var lowpass = hasExplicitQ
|
||||
? $"fi.resonlp(max(20.0, {lpf} * 18000.0), max(0.1, {lowPassQ}), 1.0)"
|
||||
: hasResonance
|
||||
? $"fi.resonlp(max(20.0, {lpf} * 18000.0), 0.7 + clip01({resonance}) * 18.0, 1.0)"
|
||||
: $"fi.lowpass({lowPassOrder}, max(20.0, {lpf} * 18000.0))";
|
||||
|
||||
|
|
|
|||
|
|
@ -106,6 +106,7 @@ public sealed record Filter(
|
|||
float LowPass = 1,
|
||||
float LowPassRamp = 0,
|
||||
float LowPassResonance = 0,
|
||||
float LowPassQ = 0,
|
||||
int LowPassOrder = 1,
|
||||
float HighPass = 0,
|
||||
float HighPassRamp = 0,
|
||||
|
|
|
|||
|
|
@ -441,6 +441,7 @@ public static class PatchScript
|
|||
GetBoundFloat(fields, line, 1, OwnerField(ownerPath, "filter/lpf"), "lpf", "l"),
|
||||
GetBoundFloat(fields, line, 0, OwnerField(ownerPath, "filter/lpf_ramp"), "lpf_ramp", "lr"),
|
||||
GetBoundFloat(fields, line, 0, OwnerField(ownerPath, "filter/resonance"), "resonance", "res"),
|
||||
GetBoundFloat(fields, line, 0, OwnerField(ownerPath, "filter/lpf_q"), "lpf_q", "lpq"),
|
||||
GetBoundInt(fields, line, 1, OwnerField(ownerPath, "filter/lpf_order"), "lpf_order", "lpfo"),
|
||||
GetBoundFloat(fields, line, 0, OwnerField(ownerPath, "filter/hpf"), "hpf", "h"),
|
||||
GetBoundFloat(fields, line, 0, OwnerField(ownerPath, "filter/hpf_ramp"), "hpf_ramp", "hr"),
|
||||
|
|
|
|||
|
|
@ -187,6 +187,7 @@ public sealed record SfxrParams
|
|||
Math.Clamp(LpfFreq, 0, 1),
|
||||
Math.Clamp(LpfRamp, -1, 1),
|
||||
Math.Clamp(LpfResonance, 0, 1),
|
||||
0,
|
||||
1,
|
||||
Math.Clamp(HpfFreq, 0, 1),
|
||||
Math.Clamp(HpfRamp, -1, 1)),
|
||||
|
|
|
|||
|
|
@ -263,7 +263,8 @@ public static class ZynInstrumentReader
|
|||
var profile = ZynProfileText(pad.Element("HARMONIC_PROFILE"));
|
||||
var position = ZynPositionText(pad.Element("HARMONIC_POSITION"));
|
||||
var filter = pad.Element("FILTER_PARAMETERS");
|
||||
var lowPass = ZynPadLowPass(filter);
|
||||
var lowPass = ZynPadLowPass(filter, playbackFrequencyHz);
|
||||
var lowPassQ = ZynPadLowPassQ(filter);
|
||||
var lowPassOrder = ZynPadLowPassOrder(filter);
|
||||
var lowPassEnvelope = ZynPadLowPassEnvelope(filter, lowPass);
|
||||
var safeName = includeKitSuffix ? $"{safeBaseName}_{kitId}" : safeBaseName;
|
||||
|
|
@ -283,6 +284,7 @@ public static class ZynInstrumentReader
|
|||
if (lowPass < 1)
|
||||
{
|
||||
matched.Add(new($"{featurePrefix}filter_lpf", F(lowPass), "Mapped static Zyn PAD global low-pass frequency into Aquarium layer filtering."));
|
||||
matched.Add(new($"{featurePrefix}filter_lpf_q", F(lowPassQ), "Mapped Zyn analog low-pass Q into Aquarium filter damping."));
|
||||
matched.Add(new($"{featurePrefix}filter_lpf_order", lowPassOrder.ToString(CultureInfo.InvariantCulture), "Mapped Zyn analog LP1/LP2 and stage count into Aquarium low-pass order."));
|
||||
}
|
||||
if (lowPassEnvelope is not null)
|
||||
|
|
@ -297,7 +299,8 @@ public static class ZynInstrumentReader
|
|||
var filterEnvelopeText = lowPassEnvelope is null
|
||||
? ""
|
||||
: $" lpf_env=rl lpf_start={F(lowPassEnvelope.StartLevel)} lpf_rates={F(lowPassEnvelope.Rate1Seconds)},{F(lowPassEnvelope.Rate2Seconds)},{F(lowPassEnvelope.Rate3Seconds)},{F(lowPassEnvelope.Rate4Seconds)} lpf_levels={F(lowPassEnvelope.Level1)},{F(lowPassEnvelope.Level2)},{F(lowPassEnvelope.Level3)},{F(lowPassEnvelope.Level4)} lpf_curves=lin,lin,lin,lin";
|
||||
script.AppendLine($"layer name={safeName} engine=pad gain={F(layerGain)} lpf={F(lowPass)} lpf_order={lowPassOrder}{filterEnvelopeText} env=rl rates={F(attack)},{F(decay)},1,{F(release)} levels=1,1,1,0 curves=lin,lin,lin,lin gate=1.5");
|
||||
var filterQText = lowPass < 1 ? $" lpf_q={F(lowPassQ)}" : "";
|
||||
script.AppendLine($"layer name={safeName} engine=pad gain={F(layerGain)} lpf={F(lowPass)}{filterQText} lpf_order={lowPassOrder}{filterEnvelopeText} env=rl rates={F(attack)},{F(decay)},1,{F(release)} levels=1,1,1,0 curves=lin,lin,lin,lin gate=1.5");
|
||||
script.AppendLine($"spectrum layer={safeName} root={F(tableRootFrequencyHz)} freq={F(noteFrequencyHz)} spread=0 zyn_mode={mode} zyn_bandwidth={bandwidth} zyn_bwscale={bandwidthScale} zyn_profile={profile} zyn_position={position} partials={partialText}");
|
||||
}
|
||||
|
||||
|
|
@ -823,7 +826,7 @@ public static class ZynInstrumentReader
|
|||
IntParam(position, "parameter3", 0).ToString(CultureInfo.InvariantCulture));
|
||||
}
|
||||
|
||||
private static float ZynPadLowPass(XElement? filter)
|
||||
private static float ZynPadLowPass(XElement? filter, float playbackFrequencyHz)
|
||||
{
|
||||
if (filter is null)
|
||||
{
|
||||
|
|
@ -838,6 +841,8 @@ public static class ZynInstrumentReader
|
|||
}
|
||||
|
||||
var cutoffHz = MathF.Pow(2.0f, (DescendantIntParam(filter, "freq", 127) / 64.0f - 1.0f) * 5.0f + 9.96578428f);
|
||||
var trackingPercent = (DescendantIntParam(filter, "freq_track", 64) - 64.0f) / 64.0f;
|
||||
cutoffHz *= MathF.Pow(2.0f, MathF.Log2(playbackFrequencyHz / 440.0f) * trackingPercent);
|
||||
return Math.Clamp(cutoffHz / 18000.0f, 20.0f / 18000.0f, 1f);
|
||||
}
|
||||
|
||||
|
|
@ -864,6 +869,24 @@ public static class ZynInstrumentReader
|
|||
return Math.Clamp(poles * (DescendantIntParam(filter, "stages", 0) + 1), 1, 12);
|
||||
}
|
||||
|
||||
private static float ZynPadLowPassQ(XElement? filter)
|
||||
{
|
||||
if (filter is null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
var category = DescendantIntParam(filter, "category", 0);
|
||||
var type = DescendantIntParam(filter, "type", 0);
|
||||
if (category != 0 || type is not (1 or 2))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
var q = DescendantIntParam(filter, "q", 64) / 127.0f;
|
||||
return MathF.Exp(q * q * MathF.Log(1000.0f)) - 0.9f;
|
||||
}
|
||||
|
||||
private static RateLevelEnvelope? ZynPadLowPassEnvelope(XElement? filter, float baseLowPass)
|
||||
{
|
||||
var envelope = filter?.Element("FILTER_ENVELOPE");
|
||||
|
|
|
|||
|
|
@ -83,3 +83,4 @@
|
|||
{"date":"2026-05-15","topic":"zyn-pad-detune-and-filter-order","lesson":"Zyn PAD note frequency is not just the requested note plus table root; FREQUENCY_PARAMETERS coarse/fine detune are live playback authority, and analog LP2 needs a steeper low-pass than Aquarium's old one-pole default.","evidence":"DoublePadBass has coarse_detune=15360, which Zyn getdetune wraps from octave 15 to -1 octave. Emitting spectrum freq=130.8128 instead of 261.6256 and lpf_order=2 moved DoublePadBass log-mel from 0.334546 after static cutoff mapping to 0.259298; remaining gap is RMS/envelope."}
|
||||
{"date":"2026-05-15","topic":"zyn-pad-filter-envelope","lesson":"Zyn PAD FILTER_ENVELOPE is audible transient authority. Static cutoff parity can get the tone right while still missing the opening hit; Aquarium needs explicit low-pass cutoff envelopes with nonzero start levels.","evidence":"DoublePadBass sounded tonally right but softer at onset. Mapping Zyn ADSR-filter octave offsets into lpf_env=rl with lpf_start improved log-mel from 0.259298 to 0.241993, envelope distance from 0.631427 to 0.554658, RMS ratio from 0.390177 to 0.456173, and score from 0.370218 to 0.404382."}
|
||||
{"date":"2026-05-15","topic":"zyn-pad-output-calibration","lesson":"After PAD table roots, detune, filter order, filter envelope, and logarithmic envelope times are mapped, remaining Zyn PAD loudness can be a generated-rebuild output calibration rather than another per-layer fixture tweak.","evidence":"Current PAD fixture RMS ratios before calibration were consistently low: DoublePadBass 0.511669, Soft Pad 0.619347, Organ Choir 0.588127, Ghost 0.730155, sin2x 0.775653. Emitting patch gain=1.6 moved DoublePadBass candidate WAV peak to 0.979 against clipped Zyn reference peak 1.0, envelope distance to 0.226563, RMS ratio to 0.818669, and score to 0.631168 while keeping batch RMS plausible."}
|
||||
{"date":"2026-05-15","topic":"zyn-pad-filter-q","lesson":"Zyn PAD analog filter Q is real filter damping authority and belongs as a general Aquarium filter surface (`lpf_q`), not as a fixture-specific cutoff/gain fudge.","evidence":"Ghost Ensemble has FILTER freq_track=97 and q=28. Adding note-tracked cutoff lowered Ghost lpf from 0.369706 to 0.282776 and adding explicit lpf_q=0.499021 moved log-mel from 0.38424 to 0.375637 and RMS ratio from 1.155288 to 1.09995. DoublePadBass remained acceptable and improved to log-mel 0.247729 / score 0.650069 after Q."}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
"ZynAddSubFX .xiz feature extraction with project-authored fixtures",
|
||||
"Zyn additive harmonic-bank DSL surface",
|
||||
"Zyn PAD spectral-cloud DSL surface with explicit Zyn profile/bandwidth/position table semantics",
|
||||
"explicit low-pass Q filter damping",
|
||||
"staged rate/level envelopes for normal voices",
|
||||
"thresholded DX7 rendered parity test",
|
||||
"reference rebuild catalog",
|
||||
|
|
@ -86,7 +87,7 @@
|
|||
"zyn_reference_path": {
|
||||
"status": "Initial ZynInstrumentReader parses plain XML and gzip-compressed .xiz-shaped XML from project-authored fixtures into ZynInstrument records and ReferencePatch features. First Zyn-style Aquarium rebuilds exist for additive lead, PAD texture, and vocal/formant layer. `ZynInstrumentSurvey` can rank .xiz directories by feature pressure. Named `layer` declarations provide the first Zyn-driven DSL abstraction; additive `harmonics`, PAD `spectrum`, and staged `env=rl` voice envelopes now attach to those layers. Zyn PAD `spectrum` banks can now carry explicit `zyn_mode`, `zyn_bandwidth`, `zyn_bwscale`, `zyn_profile`, and `zyn_position` table-generation fields, and `PadSynthWaveform` lowers those through Zyn-style profile/bandwidth math. The pinned Zyn source now builds as a test-only MSYS2/MinGW oracle through `tools/zyn-reference/build-zyn-reference.ps1`, which patches an ignored artifact source copy, proves `PadNoteTest`, and builds `ZynPadReference`.",
|
||||
"lesson": "Start Zyn as structural classification, then move into explicit scoped rebuilds. Upstream Zyn presets live in a nested GPL instrument-bank submodule and may be used as test-only parity/pressure feedstock once provenance is recorded. The ZynAddSubFX engine source is pinned as GPL test/development material under `external/zynaddsubfx` at 3ab608c432996ba4d582176572c0b0f82328c825; use it as a parity oracle only, never as Aquarium runtime or NuGet package content. Zyn build fixes belong in `tools/zyn-reference/patches/` and apply to ignored artifact copies, not the clean pinned submodule. The PAD oracle now renders both generated PAD sample tables and note audio through Zyn `PADnoteParameters`/`PADnote`; optional parity artifacts live under `artifacts/parity/zyn-pad-reference` and `artifacts/parity/zyn-pad-fixtures`. The first project-authored PAD comparison proved the harness and showed Aquarium `spectrum` was not a close Zyn PAD emulation. User listening identified Zyn as pure wineglass and Aquarium as angry bees. Cutting unearned air/noise/drive/soft-clip from the rebuild, adding interpolated wavetable reads, and raising Aquarium spectral tables to Zyn's 131072-frame PAD size improved the report. A later pitch/drone pass split PAD table root from playback note frequency: `spectrum root=...` owns table/base frequency and `freq=...` owns the played note. Using Zyn's reported sample basefreq 77.7813 while playing 261.6256, removing gratuitous spread/vibrato, collapsing two same-note PAD voices into one coherent spectral table, and trimming gain improved the report to log-mel 0.35669, envelope 0.347572, RMS ratio 1.001704, centroid ratio 1.004072, score 0.6211. The first PAD fixture survey shows `pad-pure` and the old `pad-texture` render identically through Zyn, so the filter/category XML in `pad-texture` is not live pressure for this oracle path. `pad-harmonic` changes the source table and note output through explicit OSCIL harmonics, making it the next real PAD reference rung. The remaining gap is source-table/profile and envelope semantics, not more decorative patch layers. The report now also emits source-table WAVs for listening. The hardened reader parses the upstream GPL instrument bank at commit c5c912131b31df5fdf372d2f06a25aaf2375837f: 1318/1318 .xiz files; optional tests write a ranked report and render five upstream PAD listening fixtures under ignored artifacts. `RebuildFirstPadAsAquariumScript` now generates first-pass per-preset PAD `.aqua` candidates from the first enabled PAD kit item, OSCIL harmonic magnitudes, oracle-reported table base frequency, basic volume, and simple rate/level envelope scaffolding while reporting missing bandwidth/profile/filter semantics. The worst target is `olivers-100/0032-Drum Kit.xiz`, with 16 enabled kit items, mixed ADD/SUB/PAD engines, 106 envelopes, 25 free envelopes, 73 LFOs, 37 filters, and 3 formant filters. The first rebuilds show Aquarium can sketch small Zyn fixtures with existing voices/macros/formants/noise, and the upstream survey correctly pushed named kit/layer routing first. `layer` owns name, engine tag, optional key range metadata, default gain, and effect-send labels while lowering to ordinary voices. `harmonics` owns authored ratio/gain partial banks under those layers. `spectrum` owns PAD-style root/spread/partial clouds under named layers and generated table base frequency; playback `freq` remains note authority. Staged `env=rl` now applies to voices as well as operators, preserving Note as gate authority and envelope data as level-shape authority. Aquarium still does not claim Zyn ADDsynth phase/bandwidth details, full Zyn PAD harmonic-profile/randomness/pitch-zone behavior, arbitrary free-envelope point curves, or richer formant morphing.",
|
||||
"next": "Continue Zyn PAD parity from the sampled OscilGen stage-order, multi-kit PAD, Zyn-curve static global-filter, low-pass-order, PAD frequency-detune, low-pass filter-envelope, logarithmic Zyn envelope-time, and generated Zyn PAD output-calibration paths. Ghost Ensemble now expands its power-base multi-harmonic OscilGen source instead of collapsing into a generic two-partial pad. DoublePadBass now rebuilds both enabled PAD kit items, maps Zyn analog LP2 to `lpf_order=2`, applies Zyn `getdetune` semantics so `coarse_detune=15360` plays one octave down (`freq=130.8128` instead of `261.6256`), maps Zyn `FILTER_ENVELOPE` into Aquarium `lpf_env=rl`, decodes Zyn envelope `*_dt` with `(2^(dt/127*12)-1)/100`, and emits `patch gain=1.6` for generated Zyn PAD candidates. Latest DoublePadBass log-mel is 0.211671, envelope distance is 0.226563, RMS ratio is 0.818669, score is 0.631168, and candidate WAV peak is 0.979 against clipped Zyn reference peak 1.0. Remaining pressure is mostly broader OscilGen/filter behavior and any live filter LFOs. Do not claim Zyn PAD parity until broader OscilGen filtering/waveshaping/adaptive-harmonic behavior and note/global filter envelope/LFO ownership are mapped or deliberately excluded."
|
||||
"next": "Continue Zyn PAD parity from the sampled OscilGen stage-order, multi-kit PAD, Zyn-curve static global-filter, low-pass-order, PAD frequency-detune, low-pass filter-envelope, logarithmic Zyn envelope-time, generated Zyn PAD output-calibration, low-pass note tracking, and explicit low-pass Q paths. Ghost Ensemble now expands its power-base multi-harmonic OscilGen source, applies Zyn filter note tracking from `freq_track`, and emits `lpf_q` from the Zyn analog filter `q`; latest Ghost log-mel is 0.375637, envelope distance is 0.363075, RMS ratio is 1.09995, centroid ratio is 1.010727, and score is 0.561458. DoublePadBass is accepted by ear and latest survey after Q reports log-mel 0.247729, envelope distance 0.208429, RMS ratio 0.887621, score 0.650069. Remaining Ghost pressure is a hot higher-partial source-table tail, so look next at OscilGen/PAD harmonic-table shape rather than more static filter knobs. Do not claim Zyn PAD parity until broader OscilGen filtering/waveshaping/adaptive-harmonic behavior and note/global filter envelope/LFO ownership are mapped or deliberately excluded."
|
||||
},
|
||||
"note_and_envelope_model": {
|
||||
"rule": "Notes own frequency, gate duration, and host/MIDI source. Envelopes own ADSR level shape.",
|
||||
|
|
|
|||
|
|
@ -137,6 +137,28 @@ Current user-ear correction:
|
|||
DoublePadBass: WAV peak `0.979` against clipped Zyn reference peak `1.0`,
|
||||
log-mel `0.211671`, envelope distance `0.226563`, RMS ratio `0.818669`,
|
||||
score `0.631168`.
|
||||
- User accepted DoublePadBass and moved the ear target to Ghost Ensemble:
|
||||
Aqua over-emphasized upper harmonics and sounded brighter/tinnier than Zyn.
|
||||
The first missing general authority was Zyn PAD filter note tracking:
|
||||
`freq_track=97` lowers Ghost's cutoff at C4 by the Zyn
|
||||
`log2(note/440) * tracking` rule. Aqua now applies that when importing PAD
|
||||
global filters.
|
||||
- Ghost still had too much upper tail, so the next cut was not a Ghost-only
|
||||
brightness knob. Aquarium now has explicit low-pass Q via `lpf_q`/`lpq` on
|
||||
the filter model. Zyn PAD analog low-pass `q` imports through
|
||||
`exp((q/127)^2 * ln(1000)) - 0.9`; Ghost emits `lpf_q=0.499021`, which Faust
|
||||
lowers through `fi.resonlp(..., max(0.1, lpf_q), 1.0)`.
|
||||
- Latest Ghost after note tracking + Q:
|
||||
artifact `artifacts/parity/zyn-upstream-pad-fixtures/0121-ghost-ensemble-20260515T131053271`,
|
||||
log-mel `0.375637`, envelope distance `0.363075`, RMS ratio `1.09995`,
|
||||
centroid ratio `1.010727`, score `0.561458`. This improves from the
|
||||
post-tracking `0.38424` log-mel / `1.155288` RMS ratio, but a table-harmonic
|
||||
diagnostic still shows candidate h8/h10/higher partials hot against the Zyn
|
||||
table. Remaining Ghost pressure is OscilGen/PAD source-table shape, not
|
||||
static filter ownership.
|
||||
- Latest upstream PAD survey after Q kept the accepted batch intact:
|
||||
DoublePadBass log-mel `0.247729`, envelope `0.208429`, RMS ratio `0.887621`,
|
||||
score `0.650069`; Soft Pad log-mel `0.316754`, score `0.6089`.
|
||||
|
||||
Completed this slice:
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
project: AquariumSynthCSharp
|
||||
spine_version: 1
|
||||
updated: 2026-05-15T08:10:00+01:00
|
||||
updated: 2026-05-15T13:16:00+01:00
|
||||
|
||||
prime_directive: >
|
||||
Build coherent synth machinery. References exist to reveal missing structure,
|
||||
|
|
@ -81,6 +81,7 @@ live_invariants:
|
|||
- Additive `harmonics` declarations own authored ratio/gain partial banks under named layers. They lower to ordinary voices for now; do not pretend this covers Zyn ADDsynth phase, bandwidth, oscillator shaping, or free-envelope semantics.
|
||||
- Normal voices may use staged `env=rl` rate/level envelopes. Notes still own gate timing; envelopes own level shape. This is not arbitrary Zyn free-envelope point editing.
|
||||
- PAD `spectrum` declarations own authored partial clouds under named layers and split table root from playback pitch: `root` is source/base frequency, while `freq` is the note played by the spectral voice. They generate PADsynth-style FFT wavetables with frequency-domain spreading and deterministic random phase, then emit Faust table readers before ordinary voice treatment. Zyn-fed PAD banks may additionally carry `zyn_mode`, `zyn_bandwidth`, `zyn_bwscale`, `zyn_profile`, and `zyn_position`; those fields belong to the spectral table generator, not to parity-test side channels. Do not pretend this covers every Zyn OscilGen modulation/waveshaping/filter/adaptive-harmonic path yet.
|
||||
- Filter damping is first-class: `lpf_q`/`lpq` owns explicit low-pass Q when a reference synth exposes analog filter damping. Do not fake Q by secretly moving cutoff, slope, or layer gain.
|
||||
- Structured `.aqua` stock lives under `patches/` as development source material. Every library patch must parse/export, and the patch library must stay out of the NuGet package unless intentionally promoted.
|
||||
- Project-authored Dexed patches may be generated inside tests for calibration; do not ship them in the NuGet package or treat them as runtime dependencies.
|
||||
- Harsh calibration probes belong in tests and ignored artifacts, not in the patch library unless they are musically useful stock.
|
||||
|
|
@ -102,7 +103,7 @@ reference_targets:
|
|||
priority: 2
|
||||
purpose: "Additive, subtractive, PAD, formant, kit, and layered-instrument pressure test."
|
||||
source: "https://github.com/zynaddsubfx/zynaddsubfx"
|
||||
status: "Initial ZynInstrumentReader reads plain or gzip-compressed .xiz XML from project-authored fixtures and classifies active ADD/SUB/PAD engines, enabled kit items, layering, envelopes, free envelopes, LFOs, filters, formants, and effects as ReferencePatch features. First Aquarium rebuilds exist for additive lead, PAD texture, and vocal/formant layer and now use named `layer` declarations. Additive rebuilds can use `harmonics` banks attached to layers, PAD rebuilds can use `spectrum` PADsynth-style FFT wavetable banks attached to layers, and PAD/vocal rebuilds use staged voice `env=rl` envelopes through layer defaults. `ZynInstrumentReader.RebuildFirstPadAsAquariumScript` now emits first-pass per-preset PAD `.aqua` rebuilds for the first enabled PAD kit item: OSCIL harmonic magnitudes, oracle-reported table base frequency, basic volume, and simple rate/level envelope scaffolding, while reporting missing bandwidth/profile/filter semantics. ZynAddSubFX source is pinned under `external/zynaddsubfx` at 3ab608c432996ba4d582176572c0b0f82328c825 for test-only parity work, and `tools/zyn-reference/build-zyn-reference.ps1` now builds an ignored patched source copy with MSYS2/MinGW, proves `PadNoteTest`, and builds `ZynPadReference`. The optional PAD reports emit note and source-table WAV/listening artifacts. After cutting unearned noise/drive/soft-clip, adding interpolated table reads, raising Aquarium spectral tables to 131072 frames, splitting table root from playback frequency, removing gratuitous spread/vibrato, collapsing same-note PAD voices into one coherent table, and trimming gain, the project-authored PAD report is close by ear and still not formally passing: log-mel 0.35669, envelope 0.347572, RMS ratio 1.001704, centroid ratio 1.004072, score 0.6211. The PAD fixture survey shows `pad-pure` and `pad-texture` render identically through Zyn, while `pad-harmonic` changes the source and becomes the next real rung. The upstream GPL instrument bank is initialized at `external/zynaddsubfx/instruments` commit c5c912131b31df5fdf372d2f06a25aaf2375837f; survey tests parse 1318/1318 .xiz files, write a pressure report, and render a five-patch upstream PAD listening batch under ignored artifacts."
|
||||
status: "Initial ZynInstrumentReader reads plain or gzip-compressed .xiz XML from project-authored fixtures and classifies active ADD/SUB/PAD engines, enabled kit items, layering, envelopes, free envelopes, LFOs, filters, formants, and effects as ReferencePatch features. First Aquarium rebuilds exist for additive lead, PAD texture, and vocal/formant layer and now use named `layer` declarations. Additive rebuilds can use `harmonics` banks attached to layers, PAD rebuilds can use `spectrum` PADsynth-style FFT wavetable banks attached to layers, and PAD/vocal rebuilds use staged voice `env=rl` envelopes through layer defaults. `ZynInstrumentReader.RebuildFirstPadAsAquariumScript` now emits per-preset PAD `.aqua` rebuilds for enabled PAD kit items with OSCIL harmonic expansion, oracle-reported table base frequency, PAD detune, Zyn PAD profile/bandwidth/position semantics, static/filter-envelope low-pass mapping, low-pass note tracking, explicit low-pass Q, logarithmic Zyn envelope times, and calibrated PAD output gain. ZynAddSubFX source is pinned under `external/zynaddsubfx` at 3ab608c432996ba4d582176572c0b0f82328c825 for test-only parity work, and `tools/zyn-reference/build-zyn-reference.ps1` now builds an ignored patched source copy with MSYS2/MinGW, proves `PadNoteTest`, and builds `ZynPadReference`. The optional PAD reports emit note and source-table WAV/listening artifacts. Latest accepted upstream PAD pressure has DoublePadBass close enough by ear with log-mel 0.247729 / score 0.650069 after filter Q, while Ghost Ensemble improves to log-mel 0.375637 / score 0.561458 but still shows a hot higher-partial source-table tail. The upstream GPL instrument bank is initialized at `external/zynaddsubfx/instruments` commit c5c912131b31df5fdf372d2f06a25aaf2375837f; survey tests parse 1318/1318 .xiz files, write a pressure report, and render a five-patch upstream PAD listening batch under ignored artifacts."
|
||||
first_slice:
|
||||
- "Use the Zyn PAD oracle report to isolate source-table, playback/gain, envelope, and fixture-mapping mismatch before further Zyn DSL golf."
|
||||
- "Use named layers as the owner before promoting richer formant morphing syntax."
|
||||
|
|
|
|||
|
|
@ -411,6 +411,21 @@ public sealed class PatchScriptTests
|
|||
Assert.Contains("process =", export.Source);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void LayerLowPassQParsesAndExportsAsExplicitFilterDamping()
|
||||
{
|
||||
var patch = PatchScript.Parse("""
|
||||
layer name=pad engine=pad gain=.08 lpf=.3 lpf_q=.5
|
||||
voice layer=pad freq=220
|
||||
""");
|
||||
var export = FaustEmitter.Emit(patch);
|
||||
|
||||
var voice = Assert.Single(patch.Voices);
|
||||
Assert.Equal(.5f, voice.Filter.LowPassQ, 5);
|
||||
Assert.Contains("fi.resonlp(max(20.0, clip01(0.3", export.Source);
|
||||
Assert.Contains("max(0.1, 0.5)", export.Source);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SpectralBankSeparatesTableRootFromPlaybackFrequency()
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue