-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest-suite.pd
308 lines (308 loc) · 9.37 KB
/
test-suite.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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
#N struct text float x float y text t;
#N canvas 162 26 1198 861 10;
#X obj 420 70 v global-bpm;
#X obj 420 95 v beat-clock;
#N canvas 564 108 814 718 run-clocks 0;
#X text 10 44 beat clock 0 to 359;
#X text 290 44 Set global bpm;
#X text 460 84 beat_interval_s = 1 / beats_per_s;
#X text 460 109 beat_per_s = bpm / 60;
#X text 460 134 beat_interval_ms = beat_interval_s * 1000;
#X text 460 159 Tharefore... beat_interval_ms = 1 / beats_per_s * 1000
;
#X text 460 184 = 1 / (bpm/60) * 1000;
#X obj 290 138 expr 60 / $f1 * 1000;
#X floatatom 330 163 5 0 0 0 - - -, f 5;
#X obj 290 186 s beat_int_ms;
#X obj 81 120 r beat_int_ms;
#X obj 24 207 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000
#000000;
#X obj 81 149 t f f;
#X obj 100 264 metro 1000;
#X obj 24 182 metro 1000;
#X obj 100 372 f 0;
#X obj 154 383 + 1;
#X obj 100 400 % 360;
#X floatatom 191 452 5 0 0 0 - - -, f 5;
#X obj 157 230 / 360;
#X floatatom 180 264 10 0 0 0 - - -, f 10;
#X obj 100 452 s beat-clock;
#X obj 120 319 f 0;
#X obj 290 100 r global-bpm;
#X obj 24 87 r loadbang-ext;
#X obj 71 230 r loadbang-ext;
#X obj 120 294 r loadbang-ext;
#X connect 7 0 8 0;
#X connect 7 0 9 0;
#X connect 10 0 12 0;
#X connect 12 0 14 1;
#X connect 12 1 19 0;
#X connect 13 0 15 0;
#X connect 14 0 11 0;
#X connect 15 0 17 0;
#X connect 16 0 15 1;
#X connect 17 0 16 0;
#X connect 17 0 21 0;
#X connect 17 0 18 0;
#X connect 19 0 13 1;
#X connect 19 0 20 0;
#X connect 22 0 15 1;
#X connect 23 0 7 0;
#X connect 24 0 14 0;
#X connect 25 0 13 0;
#X connect 26 0 22 0;
#X restore 420 40 pd run-clocks;
#X floatatom 240 183 5 1 270 0 - - -, f 5;
#X obj 240 210 s global-bpm;
#X obj 350 130 r beat-clock;
#X obj 350 155 select 0;
#X obj 350 180 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc
#000000 #000000;
#N canvas 360 133 801 647 synth 0;
#X text 50 50 Just make a sound;
#X obj 76 312 unpack f f;
#X obj 76 407 osc~;
#X obj 76 452 *~;
#X obj 117 413 / 127;
#X obj 76 374 mtof;
#X obj 336 567 dac~;
#X obj 86 102 inlet;
#X obj 128 184 pack f f f;
#X obj 128 209 route 1 2 3 4;
#X obj 128 159 poly 4;
#X obj 230 310 unpack f f;
#X obj 230 405 osc~;
#X obj 230 450 *~;
#X obj 271 411 / 127;
#X obj 230 372 mtof;
#X obj 370 310 unpack f f;
#X obj 370 405 osc~;
#X obj 370 450 *~;
#X obj 411 411 / 127;
#X obj 370 372 mtof;
#X obj 540 310 unpack f f;
#X obj 540 405 osc~;
#X obj 540 450 *~;
#X obj 581 411 / 127;
#X obj 540 372 mtof;
#X connect 1 0 5 0;
#X connect 1 1 4 0;
#X connect 2 0 3 0;
#X connect 3 0 6 0;
#X connect 3 0 6 1;
#X connect 4 0 3 1;
#X connect 5 0 2 0;
#X connect 7 0 10 0;
#X connect 8 0 9 0;
#X connect 9 0 1 0;
#X connect 9 1 11 0;
#X connect 9 2 16 0;
#X connect 9 3 21 0;
#X connect 10 0 8 0;
#X connect 10 1 8 1;
#X connect 10 2 8 2;
#X connect 11 0 15 0;
#X connect 11 1 14 0;
#X connect 12 0 13 0;
#X connect 13 0 6 0;
#X connect 13 0 6 1;
#X connect 14 0 13 1;
#X connect 15 0 12 0;
#X connect 16 0 20 0;
#X connect 16 1 19 0;
#X connect 17 0 18 0;
#X connect 18 0 6 0;
#X connect 18 0 6 1;
#X connect 19 0 18 1;
#X connect 20 0 17 0;
#X connect 21 0 25 0;
#X connect 21 1 24 0;
#X connect 22 0 23 0;
#X connect 23 0 6 0;
#X connect 23 0 6 1;
#X connect 24 0 23 1;
#X connect 25 0 22 0;
#X restore 50 528 pd synth;
#X obj 240 155 f 60;
#X msg 580 206 symbol seq1;
#X obj 600 229 text define -k seq1;
#A set 0 69 100 1000 \; 1300 53 60 500;
#X obj 880 230 text define -k seven-notes;
#A set 0 60 75 1000 \; 1000 61 75 1000 \; 1000 62 75 1000 \; 1000 63
75 1000 \; 1000 64 75 1000 \; 1000 65 75 1000 \; 1000 66 75 1000 \;
;
#X msg 860 206 symbol seven-notes;
#X msg 860 308 symbol fourteen-notes-together;
#X obj 880 332 text define -k fourteen-notes-together;
#A set 0 60 70 1000 \; 0 61 70 1000 \; 0 62 70 1000 \; 0 63 70 1000
\; 0 64 70 1000 \; 0 65 70 1000 \; 0 66 70 1000 \; 0 67 70 1000 \;
0 68 70 1000 \; 0 69 70 1000 \; 0 70 70 1000 \; 0 71 70 1000 \; 0 72
70 1000 \; 0 63 70 1000 \;;
#X obj 600 463 text define -k seven-notes-overlapping;
#A set 0 60 70 1000 \; 100 61 70 1000 \; 100 62 70 1000 \; 100 63 70
1000 \; 100 64 70 1000 \; 100 65 70 1000 \; 100 60 70 1000 \;;
#X msg 580 440 symbol seven-notes-overlapping;
#X text 860 176 To test that tapes are reused;
#X obj 600 605 text define -k slow-then-quick;
#A set 0 63 70 1000 \; 1500 63 70 120;
#X msg 580 578 symbol slow-then-quick;
#X text 580 178 A simple two-note sequence;
#X text 580 690 Double quick click to stop three notes;
#X msg 580 720 symbol stop-three-notes;
#X obj 600 745 text define -k stop-three-notes;
#A set 0 60 70 1000 \; 1500 62 70 1000 \; 1500 64 70 1000 \; 1500 60
70 120 \; 100 62 70 120;
#X text 620 27 Data in these tests are: wait (ms) \, midi note \, vel
\, duration;
#X obj 600 330 text define -k same-two-notes-together;
#A set 0 60 75 1000 \; 0 60 75 1000 \;;
#X msg 580 307 symbol same-two-notes-together;
#X obj 880 745 text define -k any-double-click;
#A set 0 60 70 1000 \; 1500 62 70 1000 \; 1500 64 70 1000 \; 1500 66
70 120 \; 100 68 70 120;
#X msg 860 720 symbol any-double-click;
#X text 860 690 Double quick click anything to stop three notes;
#X obj 620 57 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000
#000000;
#X text 749 57 Bang to stop tapes (when testing);
#X text 827 109 It's ...-1 because we're assuming it's pattern 1;
#X text 580 547 The quick note should stop the same one;
#X text 860 548 The quick note should stop only the same one;
#X obj 880 604 text define -k stop-just-one;
#A set 0 58 70 800 \; 1000 70 70 1000 \; 4000 58 70 120;
#X msg 860 578 symbol stop-just-one;
#X text 130 446 Our module in slot 1 \, sends to notesOut-\$1;
#X text 70 200 For our module;
#X obj 50 240 s loadbang-ext;
#X obj 240 128 r loadbang-ext;
#X obj 50 446 module p1;
#X obj 50 500 r notesOut-p1;
#X obj 647 109 s airport-notes-stop-all-p1;
#X obj 70 176 s loadbang-p1;
#X obj 50 130 t b;
#X obj 50 64 loadbang;
#X obj 110 64 r test-loadbang;
#X obj 580 940 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc
#000000 #000000;
#X text 580 900 Regression: First repeat should be evenly spaced. Problem
was audible about 50% of the time.;
#X obj 620 83 t b b;
#X obj 620 132 s test-loadbang;
#X text 620 940 Remember to reset the state after this test.;
#X text 580 410 Regression: Was the source of a bug;
#X text 860 410 Regression: Notes played together should separate;
#X msg 860 440 symbol two-notes-together;
#X obj 880 463 text define -k two-notes-together;
#A set 0 60 70 700 \; 0 64 70 700;
#X text 60 261 For external to our module;
#N canvas 436 201 650 512 play-seq 0;
#X obj 151 69 inlet;
#X text 200 70 symbol of sequence to play;
#X msg 90 123 line 0 \, auto;
#X obj 150 180 makenote;
#X obj 150 210 pack f f;
#X obj 151 94 t b s;
#X obj 150 153 text sequence dummy -w 1;
#X obj 150 238 outlet;
#X connect 0 0 5 0;
#X connect 2 0 6 0;
#X connect 3 0 4 0;
#X connect 3 1 4 1;
#X connect 4 0 7 0;
#X connect 5 0 2 0;
#X connect 5 1 6 1;
#X connect 6 0 3 0;
#X restore 50 368 pd play-seq;
#X obj 50 340 r play-seq;
#X obj 50 395 s notesIn-p1;
#X obj 580 253 s play-seq;
#X obj 860 256 s play-seq;
#X obj 580 355 s play-seq;
#X obj 860 358 s play-seq;
#X obj 580 488 s play-seq;
#X obj 860 488 s play-seq;
#X obj 580 630 s play-seq;
#X obj 860 630 s play-seq;
#X obj 580 772 s play-seq;
#X obj 860 770 s play-seq;
#X obj 660 57 r test-reset;
#X obj 580 1062 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc
#000000 #000000;
#N canvas 949 182 451 301 different-single-click 0;
#X obj 169 297 s play-seq;
#X obj 189 270 text define -k different-single-click;
#A set 0 60 70 700 \; 2000 62 70 120;
#X msg 169 245 symbol different-single-click;
#X obj 129 70 t b b b;
#X obj 52 117 delay 5000;
#X obj 52 142 t b b;
#X obj 52 207 delay 500;
#X obj 79 172 s test-reset;
#X obj 129 28 inlet;
#X connect 2 0 0 0;
#X connect 3 1 4 0;
#X connect 3 2 2 0;
#X connect 4 0 5 0;
#X connect 5 0 6 0;
#X connect 5 1 7 0;
#X connect 6 0 2 0;
#X connect 8 0 3 0;
#X restore 580 1093 pd different-single-click;
#X obj 780 830 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc
#000000 #000000;
#X obj 781 855 s test-reset;
#X text 813 829 Convenience: Reset for tests;
#N canvas 944 48 450 328 repeat-evenly 0;
#X obj 80 185 text define -k repeat-evenly;
#A set 0 60 70 500 \;;
#X msg 60 162 symbol repeat-evenly;
#X obj 87 125 s tape-duration-init-p1;
#X msg 87 100 7 7;
#X text 128 100 Make tape length long;
#X obj 60 63 t b b;
#X obj 60 210 s play-seq;
#X obj 60 30 inlet;
#X connect 1 0 6 0;
#X connect 3 0 2 0;
#X connect 5 0 1 0;
#X connect 5 1 3 0;
#X connect 7 0 5 0;
#X restore 580 974 pd repeat-evenly;
#X obj 580 1233 s play-seq;
#X obj 600 1208 text define -k long-then-slower;
#A set 0 60 70 1000 \; 1500 60 70 500;
#X msg 580 1181 symbol long-then-slower;
#X text 580 1020 Regression: Quick click of different note shouldn't
stop first. Will run twice \, error occurred after second run.;
#X text 580 1143 A long note \, then again shorter before it's had
time to repeat. Only the shorter version should repeat.;
#X connect 3 0 4 0;
#X connect 5 0 6 0;
#X connect 6 0 7 0;
#X connect 9 0 3 0;
#X connect 10 0 62 0;
#X connect 13 0 63 0;
#X connect 14 0 65 0;
#X connect 17 0 66 0;
#X connect 20 0 68 0;
#X connect 23 0 70 0;
#X connect 27 0 64 0;
#X connect 29 0 71 0;
#X connect 31 0 51 0;
#X connect 37 0 69 0;
#X connect 41 0 9 0;
#X connect 43 0 8 0;
#X connect 46 0 40 0;
#X connect 46 0 45 0;
#X connect 47 0 46 0;
#X connect 48 0 46 0;
#X connect 49 0 78 0;
#X connect 51 0 52 0;
#X connect 51 1 44 0;
#X connect 56 0 67 0;
#X connect 59 0 61 0;
#X connect 60 0 59 0;
#X connect 72 0 51 0;
#X connect 73 0 74 0;
#X connect 75 0 76 0;
#X connect 81 0 79 0;