supercollider-quarks / JITLibExtensions

Some extensions to the common JITLib classes
GNU General Public License v2.0
11 stars 9 forks source link

ProxyPreset.setRand fails when a control is set to a Ndef.asControlInput #25

Closed bgola closed 1 year ago

bgola commented 1 year ago

Test case:

Ndef(\a, {SinOsc.ar(\freq.kr())}).play;
p = NdefPreset(\a);

Ndef(\b, {LFNoise2.ar(1).exprange(100,400)});
Ndef(\a).set(\freq, Ndef(\b).asControlInput);
p.setRand(1.0);

results in

^^ ERROR: Message 'round' not understood.
Perhaps you misspelled 'rank', or meant to call 'round' on another receiver?
RECEIVER: a

The problems seems to be happen in ProxyPreset.randSet method. For now I patched it (for my use case) so that it either ignores controls that are assigned that way or sets a new random value following the spec for that control (ignoring the rand amount). But i am not really sure what would be the ideal general solution here.

Something even stranger happens if I assign the control directly to the Ndef(\b).

Ndef(\b, {LFNoise2.ar(1).exprange(100,400)});
Ndef(\a).set(\freq, Ndef(\b));
p.setRand(1.0);

When I call .setRand in this case my server crashes after a second or so.