![View this Page](/schemes/simple/viewie.gif)
![Edit this Page](/schemes/simple/edit.gif)
![Uploads to this Page](/schemes/simple/upload.gif)
![History of this Page](/schemes/simple/history.gif)
![Top of the Swiki](/schemes/simple/top.gif)
![Recent Changes](/schemes/simple/recent.gif)
![Search the Swiki](/schemes/simple/search.gif)
Pfunc/Pfuncn/Prout
Pfunc returns a value obtained from the evaluated function each
call. On reset, the reset function is called.
a = Pfunc({ rrand(8, 10) });
b = a.asStream;
20.do({ b.next.postln });
Pfuncn does that only a certain number of times:
a = Pfuncn({ rrand(8, 10) },4);
c = Pfuncn({ rrand(1.0, 2.0) },4);
b = Pseq([a, c], inf).asStream;
20.do({ b.next.postln });
Prout creates a Routine instead, that will yield values without
restarting and thus no reassignment of any variables:
a = Prout({
4.do({arg i;
55.yield;
i.yield;
Pshuf([1, 2, 3]).embedInStream
})
});
b = a.asStream;
20.do({ b.next.postln });
Links to this Page
- enter. last edited on 29 January 2003 at 10:46 pm by 203.14.169.19
- Pattern Examples (SC2) last edited on 7 April 2004 at 1:45 am by max2-022.dialin.uni-hamburg.de