[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] Event Timing Offset



hi esben,

i'd recommend reading "Streams-Patterns-Events" (you can find reference in Streams help) it would also be nice if someone could shed some more light here about how to set the arguments to a playing routine/task.

i would either use the currentEnvironment to store values and call them from within the Task:

~timeisme = 100;
(
t = Task({
	loop{
		~timeisme.value.postln;
		0.2.wait;
	}
})
)

t.play
~timeisme = {10.rand};


or define an Event for my Tasks

e = Event.new
e.timeisme = 100;
(
e.task = Task({
	loop{
		e.timeisme.value.postln;
		0.2.wait
	}
})
)

e.task.play
e.timeisme = { 120.0.rand }
e.task.stop

in both cases you can set those values from your MIDI routine or responders

cheerz,
tom


On 2 Jan 2006, at 19:23, Esben Stien wrote:

Esben Stien <b0ef@xxxxxxxxxxxxxxxx> writes:

control timing of events inside a Task

I guess this can be:

k = Task({
	arg timeisme;
	var startCycle, baseTime;
	loop{
		startCycle = thisThread.clock.beats;
		baseTime = thisThread.clock.beats.roundUp(1);
		thisThread.clock.schedAbs(baseTime + timeisme,{Synth("foo");});
		(startCycle + 8.0 - thisThread.clock.beats).wait;
	}
})

set an offset

In the code above, I provided an arg to the task.

have some variable I could bind a midi controller

~timeonme = Bus.control(s,1);
~timeonme.set(1.0)
k.map(\timeisme, ~timeonme.index);

This won't work, of course. I guess the problem is that I can't figure
out how to control an arg that is provided to a task.

--
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
_______________________________________________
sc-users mailing list
sc-users@xxxxxxxxxxxxxxx
http://www.create.ucsb.edu/mailman/listinfo/sc-users

....................
 www.tomtlalim.tk
  www.club-mtk.tk
 www.tangiercluj.tk
....................