[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[sc-users] Event Timing Offset
I'm looking for a way to control timing of events inside a Task. Right
now I'm using wait between every event, as in the below code. What I'm
really after is some way to set an offset in realtime from the
original designated time.
F.ex in the below code, there is an event at -0.05, then the next
happens 1.28 after that. I'm really looking for a way to say: event 1
happens at 1.0 and event happens at 1.5, then have some variable I
could bind a midi controller to and adjust in realtime the offset when
the event will take place, f.ex 0.03 before or 0.04 after the original
designation.
That way, I could fine tune each events, have the offset printed out,
then adjust in the SynthDef.
I guess I can bind wait to controller bus, but then every event would
be affected.
o = Task({
var startCycle;
loop{
startCycle = thisThread.clock.beats;
0.10.wait;
//map variable to the y bus at each run
w = Synth("foo"); w.map(\baz, y.index);
1.28.wait;
z = Synth("bar"); z.map(\baz, y.index);
(startCycle + 8.0 - thisThread.clock.beats).wait;
}
})
--
Esben Stien is b0ef@e s a
http://www. s t n m
irc://irc. b - i . e/%23contact
[sip|iax]: e e
jid:b0ef@ n n