Is there a way to set a ControlSpec for an array inside of a SynthDef?
For example, this throws an error:
SynthDef(\specTest, { |test = #[0.1, 0.1]| test.spec = \amp.asSpec; Out.ar(0, test * SinOsc.ar(440)) }).add
// error message:
ERROR: Message 'spec_' not understood.
Perhaps you misspelled 'sect', or meant to call 'spec_' on another receiver?
RECEIVER:
Instance of Array { (0x7fad18fc4b48, gc=1C, fmt=01, flg=00, set=02)
indexed slots [2]
0 : instance of OutputProxy (0x7fad0832ea18, size=11, set=4)
1 : instance of OutputProxy (0x7fad19e285f8, size=11, set=4)
}
.....
This evaluates, and sees a spec, but throws an error when trying to makeWindow
:
// this works
(
z = SynthDef(\specTest, { |test = #[0.1, 0.1]| test[0].spec = \amp.asSpec; Out.ar(0, test * SinOsc.ar(440)) }).add;
z.specs // -> ( 'test': a ControlSpec(0, 1, 'amp', 0, 0, "") )
)
// this doesn't
SynthDescLib.global.at(\specTest).makeWindow
// error message:
ERROR: Message 'isNaN' not understood.
Perhaps you misspelled 'isNil', or meant to call 'isNaN' on another receiver?
RECEIVER:
Instance of Array { (0x7fad29549448, gc=20, fmt=01, flg=00, set=02)
indexed slots [2]
0 : Float 0.100000 9999999A 3FB99999
1 : Float 0.100000 9999999A 3FB99999
}
......
This gives an error, though does seem to compile the SynthDef, but it still doesn’t work:
(
z = SynthDef(\specTest, { |test = #[0.1, 0.1]|
test[0].spec = \amp.asSpec;
test[1].spec = \amp.asSpec;
Out.ar(0, test * SinOsc.ar(440))
}).add;
)
// post window:
ERROR: Cannot set spec on a non-Control
-> SynthDef:specTest
//////
// evaluating this:
z.specs
-> ( 'test': a ControlSpec(0, 1, 'amp', 0, 0, "") )
// this errors out in the same way as the previous example:
SynthDescLib.global.at(\specTest).makeWindow
edit:
this also doesn’t work:
(
z = SynthDef(\specTest, { |test = #[0.1, 0.1]|
test.spec = [\amp.asSpec, \amp.asSpec];
Out.ar(0, test * SinOsc.ar(440))
}).add
)
// ERROR: Message 'spec_' not understood.