really is this necessary: (from bind doc)
(
s.bind {
a = { |freq=100| SinOsc.ar(freq, LFTri.ar(freq)) * 0.2 }.play;
s.sync;
a.set(\freq, 400);
}
)
this seems ludicrous if its required…
I guess I could put the OSCdef callback code in a bind, but having the users have to litter around s.sync if they call set, seems pretty horrible.
e.g. what I’m thinking is:
OSCdef( \OrganelleKeys,
{
arg msg, time, addr, recvPort;
s.bind({
if ( msg[1]>0,
{~notes.key_hit(msg[1],msg[2]);},
{~aux.key_hit(msg[1],msg[2]);}
);
s.sync;
}
);
},
"/key",
recvPort:4000
);
what Im concerned about though, is this will only sync, between osc callbacks, which will probably solve this particular issue, but not if in the callback the user has to do sync between multiple calls to set… and what is this going to do to performance.
also there is something still a bit odd here… in my particular case, the synth creation, and set of gate (to zero) , are coming form different OSC messages, i.e. multiple invocations of the OSDdef function, surely SC, would sync between them?
Im guessing… possibly the issues is, in the case of ‘mashing the keyboard’, perhaps two messages turn up in the same udp packet, so perhaps the OSCdef is done multiple times with no sync in between… might explain why its uncommon but still happens.
(I will note though, in this case… these messages (/key) are not in an OSC bundle, though I dont think thats relevant)
I quite like the trig solution, as it could be slow, to just recover ‘lost’ synths, but my fear is… if this is a sync issue, is this the only time this occurs, or can it occur with things other than gate.
I’ll have to play with it… but feels ‘wrong’, whilst as a programmer I’m ok with technicalities like this (thread sync is bread n butter for me) , its not really for musicians/patch makers…
Does anyone know of a doc which explain when sync is necessary, and when its not?
(bind/makebundle say how to do it , rather than why… as far as i could see)
BTW: sorry if this is all off-topic, Im new to SC, so dont really know where the ‘support channels’ are , so came here, as you guys are very knowledgeable, thanks for your input.