deprecate SCViewHolder-layRight
[supercollider.git] / SCClassLibrary / Common / Streams / Pseed.sc
blob5a67812dd3985987937c1280342090a5834dad92
1 // allows to reproduce enclosed randomized pattern
2 // by setting the random seed of the resulting routine
4 Pseed : FilterPattern {
5         var <>randSeed;
6         *new { arg randSeed, pattern;
7                 ^super.new(pattern).randSeed_(randSeed)
8         }
9         storeArgs { ^[randSeed,pattern] }
11         embedInStream { arg inval;
12                 var seedStream;
13                 var seed, thread;
14                 seedStream = randSeed.asStream;
16                 while {
17                         seed = seedStream.next(inval);
18                         seed.notNil
19                 }{
20                         thread = Routine { |inval| pattern.embedInStream(inval) };
21                         thread.randSeed = seed;
22                         inval = thread.embedInStream(inval);
23                 };
24                 ^inval
25         }