Sorry - I always switch the min and max.
// converts time (in cnt) between start and complete into
// a value between 0 and 1
// (Keeping comments outside of macro saves a small amount of code parsing
// and speeds things up depending on the number of macro calls)
#macro Subclock2 (Start, End)
#local CurrentClock = clock;
#local NormalizedClock = min (max ( ((CurrentClock - Start) / (End - Start)),
0), 1);
NormalizedClock
#end // subclock2
Post a reply to this message
|