hi,
Im getting back into supercollider after a bit of time off, and I think im missing something pretty simple,
perhaps someone can point me back on track 
DigitalIO is a custom ugen, which sends out digital signals for bela, (but its not really the issue), and i want it to change it value when a midi note is received so something like:
~gate = 0;
DigitalIO.kr(~led1,0,~gate);
MIDIdef.noteOn(\noteon, {
arg vel, note;
~gate = 1;
});
MIDIdef.noteOff(\noteoff, {
arg vel, note;
~gate = 0;
});
this fails 
ok, I remember this is because ~gate will be a client side var, but Im struggling to remember how id get something similar to this on the server side,
the only things i can think of is using something like Ndef to replace the ugen, but that seems overly complex - no?
e.g.
MIDIdef.noteOn(\noteon, {
arg vel, note;
Ndef(\t1led, { DigitalIO.kr(~led1,0,1) });
});
MIDIdef.noteOff(\noteoff, {
arg vel, note;
Ndef(\t1led, { DigitalIO.kr(~led1,0,0) });
});
EDIT:
ok, memories are coming back so i think i should be able to do something like
(but still not working
)
Ndef(\t1led, {
arg g;
DigitalIO.kr(~led1,0,DC.kr(g));
});
MIDIdef.noteOn(\noteon, {
arg vel, note;
Ndef(\t1led).set(\g,1);
});
MIDIdef.noteOff(\noteoff, {
arg vel, note;
Ndef(\t1led).set(\g,0);
});
EDIT 2:
ok fixed , without the DC.kr works 
Ndef(\t1led, {
arg g;
DigitalIO.kr(~led1,0,g);
});
MIDIdef.noteOn(\noteon, {
arg vel, note;
Ndef(\t1led).set(\g,1);
});
MIDIdef.noteOff(\noteoff, {
arg vel, note;
Ndef(\t1led).set(\g,0);
});
not sure its the best way, but I think is workable for my needsā¦