feat(vm)!: implement cross-instrument modulation of all voices

The "auto" was misleading, as it meant self modulation when targetting a unit within instrument itself and just voice 0 when cross-instrument modulation. This feature changes the "auto" meaning "self" for instruments self-modulating, and "all" voices for cross-instrument modulations. "all" is implemented by compiling a single send into multiple repeated sends, with only the last popping the stack (if necessary).

Closes #107
This commit is contained in:
5684185+vsariola@users.noreply.github.com
2023-10-07 14:07:39 +03:00
parent 7ee43f199a
commit 8c8232f76e
3 changed files with 57 additions and 18 deletions

View File

@ -177,7 +177,11 @@ func (p Patch) ParamHintString(instrIndex, unitIndex int, param string) string {
return fmt.Sprintf("%.2f", float32(value)/64-1)
case "voice":
if value == 0 {
return "auto"
targetIndex, _, err := p.FindSendTarget(unit.Parameters["target"])
if err == nil && targetIndex != instrIndex {
return "all"
}
return "self"
}
return fmt.Sprintf("%v", value)
case "target":