Teach music agents retriggered 808 drums

This commit is contained in:
Meta Vens 2026-06-01 12:07:51 +01:00
commit fd6aa863a7
9 changed files with 125 additions and 66 deletions

View file

@ -1801,6 +1801,9 @@ public static class PatchScript
sustainLevel = 1 / gainScale;
}
var noteSource = ParseNoteSource(GetAny(fields, ["note_source", "source"], "oneshot"), line);
var triggerInterval = TryGetAny(fields, ["trigger", "retrigger", "trigger_every", "repeat_every", "hit_step"], out var triggerText)
? ParseFloat(triggerText, line)
: 0;
if (TryGetAny(fields, ["midi"], out var midi) && ParseBool(midi, line))
{
noteSource = NoteSource.Host;
@ -1842,7 +1845,7 @@ public static class PatchScript
frequency,
GetBoundFloat(fields, line, 0.5f, OwnerField(ownerPath, "osc/duty"), "duty", "du"),
GetBoundFloat(fields, line, 0, OwnerField(ownerPath, "osc/phase"), "phase", "pa")),
Note = new Note(frequency, gateSeconds, noteSource),
Note = new Note(frequency, gateSeconds, noteSource, triggerInterval),
Envelope = envelopeSpec?.Envelope ?? new Envelope(
GetBoundFloat(fields, line, 0, OwnerField(ownerPath, "env/attack"), "attack", "a"),
GetBoundFloat(fields, line, 0, OwnerField(ownerPath, "env/decay"), "env_decay", "ed"),