forked from Wasted-Audio/heavylib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hv.drunk.pd
156 lines (156 loc) · 4.04 KB
/
hv.drunk.pd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
#N canvas 807 22 809 703 10;
#X obj 123 407 random 2;
#X obj 123 348 t b b f;
#X obj 123 463 sel 0 1;
#X obj 215 525 +;
#X obj 185 524 *;
#X text 39 9 Random walk generator;
#X text 132 445 sign;
#X text 205 382 magnitude;
#X text 281 554 add prev value;
#X text 278 571 to random increment;
#X text 475 481 us back in.;
#X text 446 741 updated for Pd version 0.37-1;
#N canvas 219 245 417 417 coerce 0;
#X obj 41 182 moses 0;
#X obj 41 206 * -1;
#X obj 206 185 * -1;
#X obj 236 162 * 2;
#X obj 115 182 moses 128;
#X obj 41 294 outlet;
#X obj 41 44 inlet;
#X obj 173 48 inlet;
#X obj 206 210 + 256;
#X obj 173 95 t a a;
#X text 234 76 us back in.;
#X text 235 46 coercion to range 0-128 \; if out of range \, reflect
;
#X connect 0 0 1 0;
#X connect 0 1 4 0;
#X connect 1 0 5 0;
#X connect 2 0 8 0;
#X connect 3 0 8 1;
#X connect 4 0 5 0;
#X connect 4 1 2 0;
#X connect 6 0 0 0;
#X connect 7 0 9 0;
#X connect 8 0 5 0;
#X connect 9 0 4 1;
#X connect 9 1 3 0;
#X restore 361 468 pd coerce;
#X obj 439 105 loadbang;
#X obj 419 134 f \$1;
#X text 385 18 upper bound: must be > 0;
#X text 476 451 coercion to range 0-128 \; if out of range \, reflect
;
#X obj 201 408 random \$2;
#X obj 123 40 inlet;
#X obj 587 42 inlet;
#X obj 419 35 inlet;
#X obj 150 491 1;
#X obj 123 491 -1;
#X text 592 19 stepsize;
#X obj 587 127 f \$2;
#X obj 587 151 select 0;
#X obj 587 173 2;
#X obj 596 103 loadbang;
#X obj 587 202 f;
#X obj 361 529 outlet;
#X obj 151 293 * 0.5;
#X msg 419 208 128;
#X obj 419 155 moses 0;
#X obj 463 177 select 0;
#X obj 419 234 f;
#X text 159 312 start at bound/2;
#N canvas 298 277 488 430 router 0;
#X obj 66 43 inlet;
#X obj 231 273 outlet;
#X obj 270 245 outlet;
#X obj 309 215 outlet;
#X obj 66 354 outlet;
#X obj 66 332 b;
#X obj 151 299 outlet;
#X obj 108 326 s \$0-seed;
#X text 286 272 value;
#X text 326 248 bound;
#X text 363 216 stepsize;
#X text 118 356 bang;
#X text 203 298 set value without output.;
#X obj 238 139 unpack f f f;
#X obj 66 92 route bang seed set;
#X connect 0 0 14 0;
#X connect 5 0 4 0;
#X connect 13 0 1 0;
#X connect 13 1 2 0;
#X connect 13 2 3 0;
#X connect 14 0 5 0;
#X connect 14 1 7 0;
#X connect 14 2 6 0;
#X connect 14 3 13 0;
#X restore 123 87 pd router;
#X obj 353 439 clip 0 128;
#X obj 418 418 t a a;
#X text 449 235 bound;
#X text 615 203 stepsize;
#X text 130 636 A random walk is a special case of a Markov chain \,
in which the states are integers and the transitions add or subtract
a small amount (or zero) from the previous state to get a new one.
Here the "f" holds the state. When it gets a bang \, the previous state
is added to a random number (from 0 to $bound) multiplied by a random
sign (-1 or 1). The new value is then coerced into the range from 0
to $bound;
#X obj 123 323 int;
#X msg 41 368 seed \$1;
#X obj 41 338 r \$0-seed;
#N canvas 228 198 627 317 LICENSE-BSD 0;
#X text 121 56 This software is copyrighted by Miller Puckette \, Reality
Jockey Ltd. and others. The terms (the "Standard Improved BSD License")
apply to all files associated with the software unless explicitly disclaimed
in individual files.;
#X text 123 148 See the file LICENSE.txt for the full license text.
;
#X restore 683 80 pd LICENSE-BSD;
#X connect 0 0 2 0;
#X connect 1 0 0 0;
#X connect 1 1 17 0;
#X connect 1 2 3 1;
#X connect 2 0 22 0;
#X connect 2 1 21 0;
#X connect 3 0 12 0;
#X connect 4 0 3 0;
#X connect 12 0 29 0;
#X connect 12 0 42 1;
#X connect 13 0 14 0;
#X connect 14 0 32 0;
#X connect 17 0 4 1;
#X connect 18 0 36 0;
#X connect 19 0 24 0;
#X connect 20 0 14 0;
#X connect 21 0 4 0;
#X connect 22 0 4 0;
#X connect 24 0 25 0;
#X connect 25 0 26 0;
#X connect 25 1 28 0;
#X connect 26 0 28 0;
#X connect 27 0 24 0;
#X connect 28 0 17 1;
#X connect 30 0 42 1;
#X connect 31 0 34 0;
#X connect 32 0 31 0;
#X connect 32 1 33 0;
#X connect 33 0 31 0;
#X connect 33 1 34 0;
#X connect 34 0 30 0;
#X connect 34 0 38 0;
#X connect 36 0 42 0;
#X connect 36 1 42 1;
#X connect 36 2 37 0;
#X connect 36 3 34 0;
#X connect 36 4 28 0;
#X connect 37 0 12 0;
#X connect 38 0 37 2;
#X connect 38 1 12 1;
#X connect 42 0 1 0;
#X connect 43 0 0 0;
#X connect 43 0 17 0;
#X connect 44 0 43 0;