Hi all, Let's call this scheduling lag 'timingOffset'. (I thought about 'priorityOffset', but that seems confusing.) The OSC send functions are now ~schedBundle(time, server, bundle) and ~schedRelease(time, strum, server, bundle) I am going to stash everything in serverEvent: serverEvent: ( server: nil, synthLib: nil, instrument: \default, group: 1, out: 0, addAction: 0, hasGate: nil, msgFunc: nil, defaultMsgFunc: #{|freq = 440, amp = 0.1, pan = 0, out = 0| [\freq, freq, \amp, amp, \pan, pan, \out, out] }, // for \type \set args: #[\freq, \amp, \pan, \trig], timingOffset: 0 , schedBundle: #{ | time, server, bundle | time = time + timingOffset; if (time == 0) { server.sendBundle(server.latency, bundle) } { thisThread.sched ( time, { server.sendBundle(server.latency, bundle) }) } }, // separate function for note release // can be redefined so releasel timing is relative to the start of the 'strum' // or to defeat the release altogether schedRelease: #{ |time, strum, server, bundle | time = time + timingOffset; thisThread.sched ( time + strum, { server.sendBundle(server.latency, bundle) }) } ), I will commit this in a day if there are no objections. RJK
|