1
#N canvas 0 0 604 511 12;
2
#X floatatom 113 218 5 0 0 0 - - -;
4
#X obj 104 198 random 4;
5
#X obj 26 197 random 2;
6
#X floatatom 35 219 5 0 0 0 - - -;
7
#X obj 123 138 t b b f;
10
#X obj 123 87 metro 100;
11
#X obj 123 65 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1
14
#X floatatom 242 153 5 0 0 0 - - -;
17
#X obj 242 83 moses 0;
18
#X obj 316 83 moses 100;
23
#X text 39 9 Random walk generator;
24
#X text 143 64 on/off;
25
#X text 298 152 output;
26
#X text 22 375 A random walk is a special case of a Markov chain \,
27
in which the states are integers and the transitions add or subtract
28
a small amount from the previous state to get a new one. Here the "f"
29
holds the state. When it gets a bang \, the previous state is added
30
to a random number (from 1 to 4) multiplied by a random sign (-1 or
31
1). The new value is then coerced into the range from 0 to 100;
33
#X text 113 234 magnitude;
34
#X text 203 313 add prev value;
35
#X text 200 330 to random increment;
36
#X text 256 30 coercion to range 0-100 \; if out of range \, reflect
38
#X text 255 60 us back in.;
39
#X text 323 492 updated for Pd version 0.37-1;