fix: clear color instrument via string default

This commit is contained in:
clement
2026-06-28 21:45:26 +02:00
parent 96ea70a645
commit d11addea4a
2 changed files with 10 additions and 1 deletions
+1 -1
View File
@@ -389,7 +389,7 @@ File.exists(~matDir).not.if({ ("mkdir -p " ++ ~matDir.quote).systemCmd });
var ok = true;
var v = value;
(field.asSymbol == \inst).if({
v = ((value == \default) or: { value.isNil }).if({ nil }, { value.asSymbol });
v = ((value.asSymbol == \default) or: { value.isNil }).if({ nil }, { value.asSymbol });
ok = v.isNil or: { (~matInstChoices[name] ? []).includes(v) };
});
((field.asSymbol == \cutoff) or: { field.asSymbol == \pan }).if({
@@ -354,6 +354,15 @@ pass = pass and: { ~matLoad.("cleg") };
pass = pass and: { ~matColorDefs[4][3][\amp] == 1.0 }; // defaulted (color 3 amp default)
File.delete(~matDir +/+ "cleg.matrix");
// REGRESSION: clear a per-color instrument to default via the STRING "default" (web path)
~matColorDefs[6][2][\inst] = \do_strike; // arp, color 2 (do_strike is a valid arp choice)
~matSetColorDef.(6, 2, \inst, "default"); // String, as OSC delivers it
pass = pass and: { ~matColorDefs[6][2][\inst].isNil }; // cleared
// valid inst as a String also works
~matSetColorDef.(6, 2, \inst, "do_strike");
pass = pass and: { ~matColorDefs[6][2][\inst] == \do_strike };
~matColorDefs[6][2][\inst] = nil; // restore
pass.if(
{ "TEST PASS".postln },
{ "TEST FAIL".postln }