2 summary:: brownian motion pattern
3 related:: Classes/BrownNoise, Classes/Pgbrown
4 categories:: Streams-Patterns-Events>Patterns>Random
8 Returns a stream that behaves like a brownian motion.
15 lower boundary of values.
18 upper boundary of values.
21 maximum change per step - the distribution is xrand2.
24 number of values produced.
31 a = Pbrown(0.0, 1.0, 0.1, inf);
32 c = a.asStream.nextN(500);
33 w = Window.new("Pbrown", Rect(10, 10, 540, 800));
35 c.plot(bounds: Rect(10, 10, 520, 380), discrete: true, parent: w);
36 // a histogram of the values
37 c.histo(500).plot(bounds: Rect(10, 410, 520, 380), parent: w);
42 a = Pbrown(0.0, 1.0, 0.2, inf);
43 a.asStream.nextN(1000).plot2;
50 SynthDef(\help_sinegrain,
51 { arg out=0, freq=440, sustain=0.05;
53 env = EnvGen.kr(Env.perc(0.01, sustain, 0.2), doneAction:2);
54 Out.ar(out, SinOsc.ar(freq, 0, env))
61 a = Pbrown(0.0, 1.0, 0.1, inf).asStream;
64 Synth(\help_sinegrain, [\freq, a.next * 600 + 300]);
72 // parallel browninan motions
75 a = Pbrown(0.0, 1.0, 0.1, inf);
77 f = { |pattern, dt=0.02, min=300, max=900|
79 var x = pattern.asStream;
81 Synth.grain(\help_sinegrain, [\freq, x.next.linexp(0, 1, min, max), \sustain, dt]);
88 f.(a, [0.02, 0.08, 0.16]);