1 // allows to reproduce enclosed randomized pattern
2 // by setting the random seed of the resulting routine
4 Pseed : FilterPattern {
6 *new { arg randSeed, pattern;
7 ^super.new(pattern).randSeed_(randSeed)
9 storeArgs { ^[randSeed,pattern] }
11 embedInStream { arg inval;
14 seedStream = randSeed.asStream;
17 seed = seedStream.next(inval);
20 thread = Routine { |inval| pattern.embedInStream(inval) };
21 thread.randSeed = seed;
22 inval = thread.embedInStream(inval);