[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sc-users] Event Timing Offset
On Jan 3, 2006, at 5:27 AM, tom tlalim wrote:
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'm not sure what you mean by "how to set the arguments to a playing
routine/task." Routines and tasks don't really have arguments.
If I may hazard a guess, it sounds very close to the central problem
that has animated my coding efforts for the last year and a half. That
is, how to create processes you can change from outside while playing
them. The environment solution is very much in the right direction. I
found that it's risky to keep loose associations of environment
variables and tasks or patterns--also, the risk increases the more
complex the processes become. So I built a container structure so I can
write a prototype that defines all the environment variables that are
needed along with defaults, and then you can make as many instances of
that prototype as you need.
AdhocClass({
~timeisme = 100;
// processes in my system have to be event patterns,
// so a Task should be written as Proutine instead
~asPattern = {
Proutine({
loop {
~timeisme.value.postln;
(play:0, delta:0.2).yield;
}
});
};
}) => PR(\timeisme);
PR(\timeisme) => BP(\time1);
PR(\timeisme) => BP(\time2);
BP(\time1).play;
BP(\time1).v.timeisme = 200;
BP(\time1).stop;
Now you have two separate environments, each with its own ~timeisme
variable that can be changed independently. I don't have to worry about
naming conflicts, and I don't have to worry about forgetting to
initialize the variables in performance (assuming I tested the
prototype thoroughly!).
There are lots of other goodies in there too. One of my projects over
the next few months is to document it so that maybe it will make sense
to someone other than myself :)
hjh
: H. James Harkins
: jamshark70@xxxxxxxxxxxxxxxxx
: http://www.dewdrop-world.net
.::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:
"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal." -- Whitman