Create an object that behaves like a stream that returns values for a limited (or infinite) number of times.
For a full list of implementing classes, see Methods: loop and Methods: repeat
f = { 3.yield }; x = Routine({ f.loop }); 10.do({ x.next.postln })
x = 5; y = x.repeat(6); y.nextN(8);
x = Prand([1, 2]).repeat(6).asStream; x.nextN(8);
x = Prand([1, 2]).loop.asStream; x.nextN(8);
x = Routine({ 3.do({ arg i; i.yield }) }).repeat(6); x.nextN(8);
x = Routine({ 3.do({ arg i; i.yield }) }).loop; x.nextN(8);