Neither branch modifies the time
variable, so the wait will always be for the same time.
A side-effect-free expression by itself makes sense at the end of a function, as a return value. Otherwise it’s not useful.
Perhaps:
(
var time = 4;
var ar = [$x, $y, $x, $x];
Routine {
ar.do{ |char|
var thisTime;
switch( char,
$x, { thisTime = time; "pickle x".postln },
$y, { thisTime = time/4; "pepper y".postln }
);
thisTime.wait;
};
}.play;
)
hjh