I suspect a bug with SuperCollider and DitigalIn. I've created a SynthDef and I making the pin choice for DigitalIn an argument. Then I want to change the pin number later using a OSC n_set command. But it's not working for DigitalIn, though it works fine for AnalogIn. Is this a bug? Should I follow up on the git site for supercollider and bela?
SynthDef('s', {arg pin=0, id=1;
b = DigitalIn.kr(pin);
SendTrig.kr(Changed.kr(b), id, b);
}).send(s);
SynthDef('p1', {arg pin=0, id=1;
i = AnalogIn.ar(pin);
m = Amplitude.kr(i, 0.2, 0.5);
t = m > 0.03;
SendTrig.kr(t, id, m);
}).send(s);
In the example above, I can remotely send a message to create, s_new, and set the pin number during the call. But if use n_set afterwards it doen't work for the DigitalIn "s" synth. But it works either way with teh AnalogIn "p1" synth.
a.sendMsg("/s_new", "s", 2000, 0, 0, "pin", 9); // Works
a.sendMsg("/s_new", "s", 2000); // Doesn't work
a.sendMsg(\n_set, 2000, "pin", 9); // pin never changes
a.sendMsg(\n_set, 2000, "id", 3); // However I can change the id.