Hi Josh,
I've found a peculiar issue with CtkNoteObjects: arrays of arrays don't work as expected when passed as synth arguments. Compare:
(
SynthDef(\arrarr, {|out = 0, dur = 10|
var freq = \freq.kr([[200, 300]]);
Out.ar(out, SinOsc.ar(freq) * -12.dbamp);
}).add
)
~synth.free; ~synth = Synth(\arrarr); // default args ok
~synth.free; ~synth = Synth(\arrarr, [\freq, [[500, 600]]]); // both args passed as expected
vs
(
~sd = CtkSynthDef(\arrarr, {|out = 0, dur = 10|
var freq = \freq.kr([[200, 300]]);
Out.ar(out, SinOsc.ar(freq) * -12.dbamp);
})
)
~note.free; ~note = ~sd.note.play; // default args ok
~note.free; ~note = ~sd.note.freq_([[500, 600]]).play; // does not pass the args correctly
~note.free; ~note = ~sd.note.freq_([500, 600]).play; // this works however
Of course in this case I don't need to use nested arrays, but I've encountered this when passing Env as an arg to IEnvGen, which returns a nested array for Env().asArrayForInterpolation, i.e. I needed to be able to pass the nested array. (In that case the workaround is to flatten the array when passing before using it with Ctk).
It seems that with plain nodes arrays are flattened when passed to the server. Should Ctk be doing that too?
Hi Josh,
I've found a peculiar issue with CtkNoteObjects: arrays of arrays don't work as expected when passed as synth arguments. Compare:
vs
Of course in this case I don't need to use nested arrays, but I've encountered this when passing
Envas an arg toIEnvGen, which returns a nested array forEnv().asArrayForInterpolation, i.e. I needed to be able to pass the nested array. (In that case the workaround is to flatten the array when passing before using it with Ctk).It seems that with plain nodes arrays are flattened when passed to the server. Should Ctk be doing that too?