Hi Julian and James,The latency key in the event would be just another time offset like lag, sendBundle would always use Server,latency..
I think James' priority scheme works something like this: Ptpar(0, Pevent(bassline, (lag:0.2)), 0.2, sopranoline)So the bassline computes its notes 0.2 of a beat early, but play in sync with sopranoline. I am assuming he wants to keep lag available for other purposes; James you old third person, is this right?
There are a number of little niggling details around note timing that might need to be handled different ways, depending on context. They can all be handled by writing different versions of ~schedBundle and ~schedSustainedBundle, so I will definitely make an implementation:
1. strummed chords: in seconds or beats? (SystemClock or thisThread.clock) 2. note duration: in seconds or beats? (SystemClock or thisThread.clock) 3. should strummed notes end together or in succession? (need to have both lag and strumLag as arguments) 4. hasGate -> it is reasonable to have a fixed length envelope AND a gate for early release
RJK On Dec 19, 2007, at 8:08 PM, Julian Rohrhuber wrote:
Hi James, Julian, Alberto,Right now, OSC commands are scheduled both by the language and by the timestamp received by the server. The note ons are all scheduled directly via the timestamp while the note offs use the clock of thisThread. Seems like it would be simpler to schedule everything on the language clock up to the server latency.yes, please, and better too for tempo changes.I also would love to have an ~offset key that offsets the start of the event relative to tempo (unlike ~lag)Then we can reserve any reference to server.latency to scheduling the bundle.Then James can use latency as a field in the Event (where it would default to 0)wouldn't latency of 0 result in late messages?So, here are two functions to take care of the basic OSC commands. (Factoring it into functions will make the implementation of Pattern:asScore simpler and make it possible to write Event:asBundle.)~schedBundle { | time, server, bundle | if (time == 0) { server.sendBundle(server.latency, bundle) } {thisThread.sched ( time, { server.sendBundle(server.latency, bundle) })} }~schedSustainedBundle { |time, server, bundle, sustain, releaseBundle |if (time == 0) { server.sendBundle(server.latency, bundle) } {thisThread.sched ( time, { server.sendBundle(server.latency, bundle) })};thisThread.sched ( time + sustain, { server.sendBundle (server.latency, releaseBundle) });}In the default note routine there would be no reference to Server.latency.Instead you would have: lag = ~lag + ~latency;with ~latency = 0 by default and altered when using James' priority scheme.And, down where the note plays: if (hasGate) { bndl.do {|msgArgs, i| var id, dt; dt = i * strum + lag; id = server.nextNodeID;~schedSustainedBundle.value(dt, server, [\s_new, instrumentName, id, addAction, group] ++ msgArgs, sustain, [\n_set, id, \gate, 0])} } { bndl.do {|msgArgs, i| var id, dt; dt = i * strum + lag; id = server.nextNodeID;~schedBundle.value(dt, server, [\s_new, instrumentName, id, addAction, group] ++ msgArgs)} } _______________________________________________ Sc-devel mailing list Sc-devel@xxxxxxxxxxxxxxx http://www.create.ucsb.edu/mailman/listinfo/sc-devel-- . _______________________________________________ Sc-devel mailing list Sc-devel@xxxxxxxxxxxxxxx http://www.create.ucsb.edu/mailman/listinfo/sc-devel