Map Zyn PAD detune and filter order

This commit is contained in:
Meta Vens 2026-05-15 12:19:04 +01:00
commit 01eea5eccf
10 changed files with 145 additions and 4 deletions

View file

@ -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"),
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")),
Phaser = new Phaser(
@ -707,6 +708,24 @@ public static class PatchScript
params string[] keys) =>
TryGetAny(fields, keys, out var value) ? ParseBoundFloat(value, line, fallback, fieldPath) : fallback;
private int GetBoundInt(
IReadOnlyDictionary<string, string> fields,
int line,
int fallback,
string fieldPath,
params string[] keys)
{
if (!TryGetAny(fields, keys, out var value))
{
return fallback;
}
if (value.StartsWith('@'))
{
throw new PatchScriptException(line, $"parameter binding is not supported for integer field `{fieldPath}`");
}
return ParseInt(value, line);
}
private float ParseBoundFloat(string value, int line, float fallback, string fieldPath)
{
if (!value.StartsWith('@'))