-
Notifications
You must be signed in to change notification settings - Fork 4
/
sampler.pd
1423 lines (1423 loc) · 38.2 KB
/
sampler.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
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#N canvas 508 92 1256 819 10;
#X obj 204 109 cnv 5 5 5 empty empty LENGTH 0 0 0 8 -262144 -120682
0;
#X obj 124 126 cnv 5 5 5 empty empty SAMPLER 0 0 0 12 -262144 -66577
0;
#X obj 105 328 cnv 5 5 5 empty empty OUT_L 0 0 0 8 -262144 -66577 0
;
#X obj 185 126 cnv 5 5 5 empty \$0-instance-num 3 0 0 0 12 -262144
-66577 0;
#X obj 252 109 cnv 5 5 5 empty empty START 0 0 0 8 -262144 -120682
0;
#X obj 46 354 cnv 15 400 600 empty empty load_file 20 12 0 14 -233017
-66577 0;
#X obj 457 354 cnv 15 655 955 empty empty sampler 20 12 0 14 -261682
-66577 0;
#X obj 227 400 bng 30 250 50 0 empty empty empty 17 7 0 10 -204800
-1 -1;
#X floatatom 227 474 20 0 0 0 - - -, f 20;
#X obj 227 631 /;
#X obj 227 577 t b f;
#X obj 670 1073 *~;
#X obj 670 930 *~;
#X obj 669 987 +~;
#X obj 107 208 hsl 128 15 -2 2 0 1 \$0-sampler-pitch-s \$0-sampler-pitch-r
PITCH 133 7 0 10 -262144 -1 -1 5325 1;
#X obj 107 223 hsl 128 15 0 127 0 1 \$0-sampler-length-s \$0-sampler-length-r
LENGTH 133 7 0 10 -262144 -1 -1 8700 1;
#X obj 107 238 hsl 128 15 0 127 0 0 \$0-sampler-start-s \$0-sampler-start-r
START 133 7 0 10 -262144 -1 -1 2800 1;
#X obj 670 731 phasor~;
#X text 73 405 Get path to sample;
#X text 510 983 Sample start position;
#X text 560 927 Sample length;
#X text 547 568 Freq adjustment;
#X text 50 608 Calculate freq based;
#X text 74 625 off of sample size;
#X text 518 389 Adjust freq for;
#X text 494 406 new sample length;
#X obj 668 1197 outlet~;
#X obj 104 158 bng 15 250 50 0 \$0-open empty OPEN_FILE 18 7 0 10 -204800
-1 -1;
#X obj 272 405 r \$0-open;
#X obj 671 847 *~;
#X text 530 699 Loop or one shot;
#X obj 222 158 tgl 15 1 \$0-loop-on-off-s \$0-loop-on-off-r LOOP 18
7 0 10 -204800 -1 -1 1 1;
#X obj 521 118 s \$0-bang;
#N canvas 30 510 526 376 open 0;
#X obj 242 56 openpanel;
#X obj 242 289 soundfiler;
#X text 150 290 Load sample;
#X obj 242 22 inlet;
#X obj 242 314 outlet;
#X obj 242 237 pack s s s;
#X obj 242 142 t a b b;
#X msg 242 262 read -resize \$1 \$2 \$3;
#X obj 280 172 symbol \$0-sample-L;
#X obj 319 202 symbol \$0-sample-R;
#X obj 261 76 r \$0-filename-r;
#X obj 261 116 s \$0-filename-s;
#X obj 53 182 s \$0-sample-display-name;
#N canvas 461 141 1318 808 get-file-name 0;
#X obj 468 39 inlet;
#X obj 468 68 list fromsymbol;
#X obj 468 240 list split 1;
#X obj 468 215 list append;
#X text 54 185 First store list \, then start the loop;
#X text 551 156 "until" bangs its output until told to stop by a "bang"
to its right inlet.;
#X text 49 238 third outlet of "split" tells us to stop.;
#X text 49 260 Second outlet of "split" becomes the new list for "list
append" above.;
#X text 50 299 First outlet is the output.;
#X obj 510 541 list prepend;
#X obj 591 507 list;
#X obj 468 104 t b b l;
#X obj 624 723 spigot;
#X msg 705 694 1;
#X msg 669 694 0;
#X obj 624 757 list tosymbol;
#X obj 669 668 t b b b;
#X obj 624 782 outlet;
#X text 36 92 32 is the symbol for space;
#X text 36 110 47 is the symbol for /;
#X msg 429 507 47;
#X obj 468 490 t b;
#X obj 468 466 route 47 32;
#X text 36 145 95 is the symbol for _;
#X text 33 35 This patch substrings a path to only get the name of
the file itself. EX: ../folder/file.wav -> file.wav;
#X text 35 70 Replaces any space with an underscore;
#X obj 689 241 f 0;
#X obj 724 241 + 1;
#X obj 468 179 t b b;
#X obj 671 310 sel 1;
#X msg 707 220 0;
#X obj 689 263 > 20;
#X obj 549 266 t b b;
#X obj 671 290 f;
#X obj 769 358 - 20;
#X obj 751 379 f;
#X obj 584 573 list split 1;
#X msg 703 333 1;
#X obj 671 362 t b b;
#X text 789 230 Count the number of characters;
#X text 790 259 If its greater than the maximum \, we split off the
extra at the beginning \, then place three dots (code 46) at the beginning
of the final filename;
#X text 51 212 Store the remaining list with [list append].;
#X text 816 332 Split off the / at the beginning \, or split off the
number of characters greater than the maximum;
#X text 152 722 When we reach the end of the list \, send the output
converted back to a symbol;
#X text 36 128 46 is the symbol for .;
#N canvas 491 691 398 257 add-three-dots 0;
#X obj 126 168 list prepend 46 46 46;
#X obj 35 15 inlet;
#X obj 35 233 outlet;
#X msg 99 115 1;
#X msg 63 115 0;
#X msg 190 114 1;
#X msg 154 114 0;
#X obj 126 190 t b a;
#X obj 193 14 inlet;
#X obj 35 144 spigot 1;
#X obj 126 143 spigot 0;
#X connect 0 0 7 0;
#X connect 1 0 9 0;
#X connect 1 0 10 0;
#X connect 3 0 9 1;
#X connect 4 0 9 1;
#X connect 5 0 10 1;
#X connect 6 0 10 1;
#X connect 7 0 6 0;
#X connect 7 0 3 0;
#X connect 7 1 2 0;
#X connect 8 0 4 0;
#X connect 8 0 5 0;
#X connect 9 0 2 0;
#X connect 10 0 0 0;
#X restore 624 625 pd add-three-dots;
#X floatatom 729 264 5 0 0 0 - - -, f 5;
#X floatatom 757 405 5 0 0 0 - - -, f 5;
#X floatatom 784 383 5 0 0 0 - - -, f 5;
#X obj 468 157 until;
#X text 792 201 Every time we hit a / we restart the counter;
#X msg 510 491 32;
#X text 11 464 Use route to separate / and spaces from the rest of
the list. You can replace the spaces with _ by changing the 32 message
to a 95;
#X connect 0 0 1 0;
#X connect 1 0 11 0;
#X connect 2 0 22 0;
#X connect 2 1 3 1;
#X connect 2 2 32 0;
#X connect 3 0 2 0;
#X connect 9 0 10 0;
#X connect 9 0 36 0;
#X connect 10 0 9 1;
#X connect 11 0 49 0;
#X connect 11 1 20 0;
#X connect 11 1 30 0;
#X connect 11 2 3 1;
#X connect 12 0 15 0;
#X connect 13 0 12 1;
#X connect 14 0 12 1;
#X connect 15 0 17 0;
#X connect 16 0 14 0;
#X connect 16 1 9 0;
#X connect 16 2 13 0;
#X connect 20 0 10 0;
#X connect 21 0 20 0;
#X connect 21 0 30 0;
#X connect 22 0 21 0;
#X connect 22 1 51 0;
#X connect 22 2 9 0;
#X connect 26 0 27 0;
#X connect 26 0 31 0;
#X connect 26 0 34 0;
#X connect 26 0 46 0;
#X connect 27 0 26 1;
#X connect 28 0 3 0;
#X connect 28 1 26 0;
#X connect 29 0 38 0;
#X connect 29 1 37 0;
#X connect 30 0 26 1;
#X connect 31 0 33 1;
#X connect 32 0 16 0;
#X connect 32 0 49 1;
#X connect 32 1 33 0;
#X connect 33 0 29 0;
#X connect 34 0 35 1;
#X connect 34 0 48 0;
#X connect 35 0 36 1;
#X connect 35 0 47 0;
#X connect 36 1 45 0;
#X connect 37 0 36 1;
#X connect 38 0 45 1;
#X connect 38 1 35 0;
#X connect 45 0 12 0;
#X connect 49 0 28 0;
#X connect 51 0 9 0;
#X restore 53 124 pd get-file-name;
#X msg 53 146 label \$1;
#X connect 0 0 6 0;
#X connect 0 0 11 0;
#X connect 0 0 13 0;
#X connect 1 0 4 0;
#X connect 3 0 0 0;
#X connect 5 0 7 0;
#X connect 6 0 5 0;
#X connect 6 1 8 0;
#X connect 6 2 9 0;
#X connect 7 0 1 0;
#X connect 8 0 5 1;
#X connect 9 0 5 2;
#X connect 10 0 6 0;
#X connect 10 0 11 0;
#X connect 10 0 13 0;
#X connect 13 0 14 0;
#X connect 14 0 12 0;
#X restore 227 447 pd open file;
#X text 466 1074 Scale to length of sample;
#X obj 670 1015 wrap~;
#X obj 227 656 s \$0-normal-freq;
#X obj 687 464 r \$0-normal-freq;
#X obj 259 534 s \$0-file-size;
#X obj 688 1046 r \$0-file-size;
#X obj 736 1196 outlet~;
#N canvas 0 101 1106 875 state-saving-multiple-instances 0;
#X obj 683 25 loadbang;
#X obj 739 399 textfile;
#X msg 979 352 rewind;
#X msg 933 352 bang;
#X obj 368 548 textfile;
#X obj 368 194 f;
#X obj 380 477 f;
#X msg 444 477 clear;
#X obj 761 223 outlet;
#X text 811 224 INSTANCE NUMBER;
#X obj 715 159 f \$1;
#X obj 129 65 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X obj 129 41 r SAVE-S;
#X msg 380 518 write statesave/\$1-sampler-ss.txt;
#X msg 739 254 read statesave/\$1-sampler-ss.txt;
#X obj 747 122 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X obj 386 61 r \$0-sampler-pitch-s;
#X obj 397 83 r \$0-sampler-length-s;
#X obj 407 105 r \$0-sampler-start-s;
#X obj 426 130 r \$0-sampler-pitch-att-s;
#X obj 446 155 r \$0-sampler-length-att-s;
#X obj 465 178 r \$0-sampler-start-att-s;
#X obj 485 201 r \$0-loop-on-off-s;
#X obj 889 694 s \$0-sampler-pitch-r;
#X obj 910 670 s \$0-sampler-length-r;
#X obj 932 646 s \$0-sampler-start-r;
#X obj 953 622 s \$0-sampler-pitch-att-r;
#X obj 975 596 s \$0-sampler-length-att-r;
#X obj 996 572 s \$0-sampler-start-att-r;
#X obj 1018 549 s \$0-loop-on-off-r;
#X obj 174 203 r \$0-filename-s;
#X obj 505 224 r \$0-sample-rate-s;
#X obj 1040 526 s \$0-sample-rate-r;
#X msg 368 305 set \$1 \$2 \$3 \$4 \$5 \$6 \$7 \$8;
#X obj 368 268 pack f f f f f f f f;
#X obj 129 98 t b b b b;
#X msg 149 293 add \$1;
#X obj 149 270 list;
#X obj 739 644 s \$0-filename-r;
#N canvas 640 221 748 742 list-to-symbol 0;
#X obj 85 190 list split 1;
#X obj 85 77 until;
#X obj 85 12 inlet;
#X obj 85 162 list append;
#X obj 56 431 list;
#X obj 85 406 list prepend;
#X obj 85 265 list fromsymbol;
#X obj 56 643 list tosymbol;
#X obj 85 310 spigot;
#X obj 178 310 spigot;
#X obj 85 44 t b a b;
#X msg 152 71 0;
#X obj 85 102 f 0;
#X obj 118 102 + 1;
#X obj 85 127 t b f;
#X obj 271 155 sel 0;
#X msg 271 200 0;
#X msg 411 200 1;
#X msg 371 200 0;
#X msg 308 200 1;
#X obj 56 698 outlet;
#X obj 48 236 t b a;
#X msg 48 265 32;
#X obj 56 563 list split;
#X obj 109 485 print before-split;
#X obj 56 456 t a a a;
#X obj 133 511 list length;
#X obj 133 536 - 1;
#X obj 56 588 t a a;
#X obj 178 376 t a;
#X obj 178 217 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X text 260 257 After each item in the list \, insert a space by using
the keycode 32;
#X text 266 414 After we have looped through all of the items in the
list \, we are left with a space (32) at the end \, so we remove this
by spliting the list at length - 1;
#X text 265 484 <--Connect this print object for debugging;
#X text 241 617 <--Connect this print object for debugging;
#X text 271 116 For the first character \, add it to the right inlet
of prepend \, all other characters go to the left inlet.;
#X text 266 12 This patch will convert a space separated list into
a single symbol.;
#X obj 93 617 print after-split;
#X obj 71 676 print final-symbol;
#X text 241 657 <--Connect this print object for debugging;
#X connect 0 0 21 0;
#X connect 0 1 3 1;
#X connect 0 2 30 0;
#X connect 1 0 12 0;
#X connect 2 0 10 0;
#X connect 3 0 0 0;
#X connect 4 0 25 0;
#X connect 5 0 4 1;
#X connect 5 0 29 0;
#X connect 6 0 8 0;
#X connect 6 0 9 0;
#X connect 7 0 20 0;
#X connect 8 0 5 0;
#X connect 9 0 29 0;
#X connect 10 0 1 0;
#X connect 10 1 3 1;
#X connect 10 2 11 0;
#X connect 11 0 12 1;
#X connect 12 0 13 0;
#X connect 12 0 14 0;
#X connect 13 0 12 1;
#X connect 14 0 3 0;
#X connect 14 1 15 0;
#X connect 15 0 16 0;
#X connect 15 0 17 0;
#X connect 15 1 18 0;
#X connect 15 1 19 0;
#X connect 16 0 8 1;
#X connect 17 0 9 1;
#X connect 18 0 9 1;
#X connect 19 0 8 1;
#X connect 21 0 22 0;
#X connect 21 1 6 0;
#X connect 22 0 5 0;
#X connect 23 0 28 0;
#X connect 25 0 23 0;
#X connect 25 1 26 0;
#X connect 26 0 27 0;
#X connect 27 0 23 1;
#X connect 28 0 7 0;
#X connect 29 0 5 1;
#X connect 30 0 1 1;
#X connect 30 0 4 0;
#X restore 739 621 pd list-to-symbol;
#X obj 889 501 unpack f f f f f f f f;
#X obj 715 195 t f f f;
#X obj 889 480 spigot;
#X msg 956 460 1, f 2;
#X msg 926 460 0, f 2;
#X obj 739 479 spigot;
#X msg 806 459 1, f 2;
#X msg 776 459 0, f 2;
#X msg 774 342 bang;
#X obj 933 317 t b b b;
#X obj 774 317 t b b;
#X obj 683 68 t b b b;
#X text 933 299 Read first line;
#X text 775 297 Read seccond line;
#X text 381 340 Save gui state on first line of file;
#X text 22 349 Save filename on seccond line of file;
#X text 190 617 If the filename has spaces in it \, by default Pure
Data would treat this as a List. We need to convert this list into
a single symbol.;
#X text 638 621 ------->>>>;
#X connect 0 0 51 0;
#X connect 1 0 42 0;
#X connect 1 0 45 0;
#X connect 2 0 1 0;
#X connect 3 0 1 0;
#X connect 5 0 34 0;
#X connect 6 0 13 0;
#X connect 7 0 4 0;
#X connect 10 0 41 0;
#X connect 11 0 35 0;
#X connect 12 0 11 0;
#X connect 13 0 4 0;
#X connect 14 0 1 0;
#X connect 15 0 10 0;
#X connect 16 0 5 1;
#X connect 17 0 34 1;
#X connect 18 0 34 2;
#X connect 19 0 34 3;
#X connect 20 0 34 4;
#X connect 21 0 34 5;
#X connect 22 0 34 6;
#X connect 30 0 37 1;
#X connect 31 0 34 7;
#X connect 33 0 4 0;
#X connect 34 0 33 0;
#X connect 35 0 6 0;
#X connect 35 1 37 0;
#X connect 35 2 5 0;
#X connect 35 3 7 0;
#X connect 36 0 4 0;
#X connect 37 0 36 0;
#X connect 39 0 38 0;
#X connect 40 0 23 0;
#X connect 40 1 24 0;
#X connect 40 2 25 0;
#X connect 40 3 26 0;
#X connect 40 4 27 0;
#X connect 40 5 28 0;
#X connect 40 6 29 0;
#X connect 40 7 32 0;
#X connect 41 0 6 1;
#X connect 41 1 14 0;
#X connect 41 2 8 0;
#X connect 42 0 40 0;
#X connect 43 0 42 1;
#X connect 44 0 42 1;
#X connect 45 0 39 0;
#X connect 46 0 45 1;
#X connect 47 0 45 1;
#X connect 48 0 1 0;
#X connect 49 0 3 0;
#X connect 49 1 43 0;
#X connect 49 1 47 0;
#X connect 49 2 2 0;
#X connect 50 0 48 0;
#X connect 50 1 46 0;
#X connect 50 1 44 0;
#X connect 51 0 50 0;
#X connect 51 1 49 0;
#X connect 51 2 10 0;
#X restore 587 221 pd state-saving-multiple-instances;
#X obj 587 296 s \$0-instance-num;
#X obj 587 248 makefilename %d;
#X msg 587 273 label \$1;
#N canvas 607 137 1205 745 state-saving-via-preset-manager-module 0
;
#X obj 690 337 textfile;
#X msg 931 294 rewind;
#X msg 888 294 bang;
#X obj 357 568 textfile;
#X obj 357 234 f;
#X obj 371 457 f;
#X msg 487 499 clear;
#X obj 357 56 delay 5;
#X obj 263 367 delay 10;
#X msg 263 292 bang;
#X obj 263 26 r STORE-S!;
#X obj 690 128 f;
#X obj 676 49 t b f;
#X obj 735 146 f \$1;
#X obj 690 173 pack f f;
#X obj 735 96 loadbang;
#X obj 371 487 pack f f;
#X obj 424 440 loadbang;
#X obj 424 462 f \$1;
#X obj 844 1086 pack f f;
#X obj 844 1110 line;
#X obj 897 1061 r preset-manager-morph-s;
#X obj 676 26 r preset-manager-scan;
#X obj 866 991 pack f f;
#X obj 866 1015 line;
#X obj 919 966 r preset-manager-morph-s;
#X obj 389 418 r preset-manager-store-slot;
#X obj 889 915 line;
#X obj 942 864 r preset-manager-morph-s;
#X msg 529 865 stop;
#X obj 529 798 r STOP-MORPH!;
#X obj 889 891 pack f f;
#X obj 935 660 pack f f;
#X obj 935 684 line;
#X obj 988 635 r preset-manager-morph-s;
#X obj 912 792 line;
#X obj 965 741 r preset-manager-morph-s;
#X obj 912 768 pack f f;
#X msg 690 202 read statesave/\$1-\$2-sampler-ss.txt;
#X msg 370 528 write statesave/\$1-\$2-sampler-ss.txt;
#X obj 375 78 r \$0-sampler-pitch-s;
#X obj 386 112 r \$0-sampler-length-s;
#X obj 396 138 r \$0-sampler-start-s;
#X obj 415 169 r \$0-sampler-pitch-att-s;
#X obj 434 195 r \$0-sampler-length-att-s;
#X obj 454 220 r \$0-sampler-start-att-s;
#X obj 844 1135 s \$0-sampler-pitch-r;
#X obj 958 550 pack f f;
#X obj 958 574 line;
#X obj 1011 525 r preset-manager-morph-s;
#X obj 958 597 s \$0-sampler-start-att-r;
#X obj 935 707 s \$0-sampler-length-att-r;
#X obj 912 815 s \$0-sampler-pitch-att-r;
#X obj 889 938 s \$0-sampler-start-r;
#X obj 866 1038 s \$0-sampler-length-r;
#X obj 474 246 r \$0-loop-on-off-s;
#X obj 973 496 s \$0-loop-on-off-r;
#X obj 144 432 r \$0-filename-s;
#X obj 494 272 r \$0-sample-rate-s;
#X obj 995 466 s \$0-sample-rate-r;
#X obj 844 439 unpack f f f f f f f f;
#X obj 357 301 pack f f f f f f f f;
#X obj 263 322 t b b b b;
#X obj 119 454 list;
#X msg 119 476 add \$1;
#X msg 357 368 set \$1 \$2 \$3 \$4 \$5 \$6 \$7 \$8;
#X obj 844 418 spigot;
#X msg 911 398 1, f 2;
#X msg 881 398 0, f 2;
#X obj 690 417 spigot;
#X msg 757 397 1, f 2;
#X msg 727 397 0, f 2;
#X obj 690 686 s \$0-filename-r;
#N canvas 640 221 748 742 list-to-symbol 0;
#X obj 85 190 list split 1;
#X obj 85 77 until;
#X obj 85 12 inlet;
#X obj 85 162 list append;
#X obj 56 431 list;
#X obj 85 406 list prepend;
#X obj 85 265 list fromsymbol;
#X obj 56 643 list tosymbol;
#X obj 85 310 spigot;
#X obj 178 310 spigot;
#X obj 85 44 t b a b;
#X msg 152 71 0;
#X obj 85 102 f 0;
#X obj 118 102 + 1;
#X obj 85 127 t b f;
#X obj 271 155 sel 0;
#X msg 271 200 0;
#X msg 411 200 1;
#X msg 371 200 0;
#X msg 308 200 1;
#X obj 56 698 outlet;
#X obj 48 236 t b a;
#X msg 48 265 32;
#X obj 56 563 list split;
#X obj 109 485 print before-split;
#X obj 56 456 t a a a;
#X obj 133 511 list length;
#X obj 133 536 - 1;
#X obj 56 588 t a a;
#X obj 178 376 t a;
#X obj 178 217 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X text 260 257 After each item in the list \, insert a space by using
the keycode 32;
#X text 266 414 After we have looped through all of the items in the
list \, we are left with a space (32) at the end \, so we remove this
by spliting the list at length - 1;
#X text 265 484 <--Connect this print object for debugging;
#X text 241 617 <--Connect this print object for debugging;
#X text 271 116 For the first character \, add it to the right inlet
of prepend \, all other characters go to the left inlet.;
#X text 266 12 This patch will convert a space separated list into
a single symbol.;
#X obj 93 617 print after-split;
#X obj 71 676 print final-symbol;
#X text 241 657 <--Connect this print object for debugging;
#X connect 0 0 21 0;
#X connect 0 1 3 1;
#X connect 0 2 30 0;
#X connect 1 0 12 0;
#X connect 2 0 10 0;
#X connect 3 0 0 0;
#X connect 4 0 25 0;
#X connect 5 0 4 1;
#X connect 5 0 29 0;
#X connect 6 0 8 0;
#X connect 6 0 9 0;
#X connect 7 0 20 0;
#X connect 8 0 5 0;
#X connect 9 0 29 0;
#X connect 10 0 1 0;
#X connect 10 1 3 1;
#X connect 10 2 11 0;
#X connect 11 0 12 1;
#X connect 12 0 13 0;
#X connect 12 0 14 0;
#X connect 13 0 12 1;
#X connect 14 0 3 0;
#X connect 14 1 15 0;
#X connect 15 0 16 0;
#X connect 15 0 17 0;
#X connect 15 1 18 0;
#X connect 15 1 19 0;
#X connect 16 0 8 1;
#X connect 17 0 9 1;
#X connect 18 0 9 1;
#X connect 19 0 8 1;
#X connect 21 0 22 0;
#X connect 21 1 6 0;
#X connect 22 0 5 0;
#X connect 23 0 28 0;
#X connect 25 0 23 0;
#X connect 25 1 26 0;
#X connect 26 0 27 0;
#X connect 27 0 23 1;
#X connect 28 0 7 0;
#X connect 29 0 5 1;
#X connect 30 0 1 1;
#X connect 30 0 4 0;
#X restore 690 663 pd list-to-symbol;
#X obj 888 255 t b b b;
#X msg 725 296 bang;
#X obj 725 257 t b b;
#X obj 644 85 t b b b;
#X text 155 660 If the filename has spaces in it \, by default Pure
Data would treat this as a List. We need to convert this list into
a single symbol.;
#X text 603 664 ------->>>>;
#X connect 0 0 66 0;
#X connect 0 0 69 0;
#X connect 1 0 0 0;
#X connect 2 0 0 0;
#X connect 4 0 61 0;
#X connect 5 0 16 0;
#X connect 6 0 3 0;
#X connect 7 0 4 0;
#X connect 8 0 5 0;
#X connect 9 0 62 0;
#X connect 10 0 9 0;
#X connect 11 0 14 0;
#X connect 12 0 77 0;
#X connect 12 1 11 1;
#X connect 13 0 14 1;
#X connect 14 0 38 0;
#X connect 15 0 13 0;
#X connect 16 0 39 0;
#X connect 17 0 18 0;
#X connect 18 0 16 1;
#X connect 19 0 20 0;
#X connect 20 0 46 0;
#X connect 21 0 19 1;
#X connect 22 0 12 0;
#X connect 23 0 24 0;
#X connect 24 0 54 0;
#X connect 25 0 23 1;
#X connect 26 0 5 1;
#X connect 27 0 53 0;
#X connect 28 0 31 1;
#X connect 29 0 20 0;
#X connect 29 0 24 0;
#X connect 29 0 27 0;
#X connect 29 0 33 0;
#X connect 29 0 48 0;
#X connect 30 0 29 0;
#X connect 31 0 27 0;
#X connect 32 0 33 0;
#X connect 33 0 51 0;
#X connect 34 0 32 1;
#X connect 35 0 52 0;
#X connect 36 0 37 1;
#X connect 37 0 35 0;
#X connect 38 0 0 0;
#X connect 39 0 3 0;
#X connect 40 0 4 1;
#X connect 41 0 61 1;
#X connect 42 0 61 2;
#X connect 43 0 61 3;
#X connect 44 0 61 4;
#X connect 45 0 61 5;
#X connect 47 0 48 0;
#X connect 48 0 50 0;
#X connect 49 0 47 1;
#X connect 55 0 61 6;
#X connect 57 0 63 1;
#X connect 58 0 61 7;
#X connect 60 0 19 0;
#X connect 60 1 23 0;
#X connect 60 2 31 0;
#X connect 60 3 37 0;
#X connect 60 4 32 0;
#X connect 60 5 47 0;
#X connect 60 6 56 0;
#X connect 60 7 59 0;
#X connect 61 0 65 0;
#X connect 62 0 8 0;
#X connect 62 0 63 0;
#X connect 62 2 7 0;
#X connect 62 3 6 0;
#X connect 63 0 64 0;
#X connect 64 0 3 0;
#X connect 65 0 3 0;
#X connect 66 0 60 0;
#X connect 67 0 66 1;
#X connect 68 0 66 1;
#X connect 69 0 73 0;
#X connect 70 0 69 1;
#X connect 71 0 69 1;
#X connect 73 0 72 0;
#X connect 74 0 2 0;
#X connect 74 1 67 0;
#X connect 74 1 71 0;
#X connect 74 2 1 0;
#X connect 75 0 0 0;
#X connect 76 0 75 0;
#X connect 76 1 68 0;
#X connect 76 1 70 0;
#X connect 77 0 76 0;
#X connect 77 1 74 0;
#X connect 77 2 11 0;
#X restore 588 193 pd state-saving-via-preset-manager-module;
#N canvas 1151 367 615 566 parameter-nudging-system 0;
#N canvas 0 50 484 497 param-nudge 0;
#X obj 124 234 random;
#X obj 232 335 f;
#X obj 232 368 +;
#X obj 257 166 random 2;
#X obj 124 275 t f f;
#X obj 124 351 t b f;
#X obj 124 297 *;
#X obj 257 188 sel 0 1;
#X msg 257 280 -1;
#X msg 335 280 1;
#X obj 124 149 t b b b;
#X obj 124 123 r NUDGE!;
#X obj 157 193 r NUDGE-RANGE;
#X obj 247 308 inlet;
#X obj 232 397 outlet;
#X connect 0 0 4 0;
#X connect 1 0 2 0;
#X connect 2 0 14 0;
#X connect 3 0 7 0;
#X connect 4 0 6 0;
#X connect 5 0 2 0;
#X connect 5 1 2 1;
#X connect 6 0 5 0;
#X connect 7 0 8 0;
#X connect 7 1 9 0;
#X connect 8 0 6 1;
#X connect 9 0 6 1;
#X connect 10 0 0 0;
#X connect 10 1 1 0;
#X connect 10 2 3 0;
#X connect 11 0 10 0;
#X connect 12 0 0 1;
#X connect 13 0 1 1;
#X restore 23 125 pd param-nudge;
#N canvas 472 60 484 497 param-nudge 0;
#X obj 124 234 random;
#X obj 232 335 f;
#X obj 232 368 +;
#X obj 257 166 random 2;
#X obj 124 275 t f f;
#X obj 124 351 t b f;
#X obj 124 297 *;
#X obj 257 188 sel 0 1;
#X msg 257 280 -1;
#X msg 335 280 1;
#X obj 124 149 t b b b;
#X obj 124 123 r NUDGE!;
#X obj 157 193 r NUDGE-RANGE;
#X obj 247 308 inlet;
#X obj 232 397 outlet;
#X connect 0 0 4 0;
#X connect 1 0 2 0;
#X connect 2 0 14 0;
#X connect 3 0 7 0;
#X connect 4 0 6 0;
#X connect 5 0 2 0;
#X connect 5 1 2 1;
#X connect 6 0 5 0;
#X connect 7 0 8 0;
#X connect 7 1 9 0;
#X connect 8 0 6 1;
#X connect 9 0 6 1;
#X connect 10 0 0 0;
#X connect 10 1 1 0;
#X connect 10 2 3 0;
#X connect 11 0 10 0;
#X connect 12 0 0 1;
#X connect 13 0 1 1;
#X restore 211 45 pd param-nudge;
#N canvas 0 50 484 497 param-nudge 0;
#X obj 124 234 random;
#X obj 232 335 f;
#X obj 232 368 +;
#X obj 257 166 random 2;
#X obj 124 275 t f f;
#X obj 124 351 t b f;
#X obj 124 297 *;
#X obj 257 188 sel 0 1;
#X msg 257 280 -1;
#X msg 335 280 1;
#X obj 124 149 t b b b;
#X obj 124 123 r NUDGE!;
#X obj 157 193 r NUDGE-RANGE;
#X obj 247 308 inlet;
#X obj 232 397 outlet;
#X connect 0 0 4 0;
#X connect 1 0 2 0;
#X connect 2 0 14 0;
#X connect 3 0 7 0;
#X connect 4 0 6 0;
#X connect 5 0 2 0;
#X connect 5 1 2 1;
#X connect 6 0 5 0;
#X connect 7 0 8 0;
#X connect 7 1 9 0;
#X connect 8 0 6 1;
#X connect 9 0 6 1;
#X connect 10 0 0 0;
#X connect 10 1 1 0;
#X connect 10 2 3 0;
#X connect 11 0 10 0;
#X connect 12 0 0 1;
#X connect 13 0 1 1;
#X restore 413 45 pd param-nudge;
#N canvas 0 50 484 497 param-nudge 0;
#X obj 124 234 random;
#X obj 232 335 f;
#X obj 232 368 +;
#X obj 257 166 random 2;
#X obj 124 275 t f f;
#X obj 124 351 t b f;
#X obj 124 297 *;
#X obj 257 188 sel 0 1;
#X msg 257 280 -1;
#X msg 335 280 1;
#X obj 124 149 t b b b;
#X obj 124 123 r NUDGE!;
#X obj 157 193 r NUDGE-RANGE;
#X obj 247 308 inlet;
#X obj 232 397 outlet;
#X connect 0 0 4 0;
#X connect 1 0 2 0;
#X connect 2 0 14 0;
#X connect 3 0 7 0;
#X connect 4 0 6 0;
#X connect 5 0 2 0;
#X connect 5 1 2 1;
#X connect 6 0 5 0;
#X connect 7 0 8 0;
#X connect 7 1 9 0;
#X connect 8 0 6 1;
#X connect 9 0 6 1;
#X connect 10 0 0 0;
#X connect 10 1 1 0;
#X connect 10 2 3 0;
#X connect 11 0 10 0;
#X connect 12 0 0 1;
#X connect 13 0 1 1;
#X restore 21 326 pd param-nudge;
#X obj 23 157 clip 0 127;
#X obj 211 67 clip 0 127;
#X obj 413 67 clip 0 127;
#X obj 23 249 s \$0-sampler-pitch-r;
#X obj 211 139 s \$0-sampler-length-r;
#X obj 413 139 s \$0-sampler-start-r;
#X obj 21 397 s \$0-sampler-pitch-att-r;
#X obj 21 348 clip 0 127;
#N canvas 0 50 484 497 param-nudge 0;
#X obj 124 234 random;
#X obj 232 335 f;
#X obj 232 368 +;
#X obj 257 166 random 2;
#X obj 124 275 t f f;
#X obj 124 351 t b f;
#X obj 124 297 *;
#X obj 257 188 sel 0 1;
#X msg 257 280 -1;
#X msg 335 280 1;
#X obj 124 149 t b b b;
#X obj 124 123 r NUDGE!;
#X obj 157 193 r NUDGE-RANGE;
#X obj 247 308 inlet;
#X obj 232 397 outlet;
#X connect 0 0 4 0;
#X connect 1 0 2 0;
#X connect 2 0 14 0;
#X connect 3 0 7 0;
#X connect 4 0 6 0;
#X connect 5 0 2 0;
#X connect 5 1 2 1;
#X connect 6 0 5 0;
#X connect 7 0 8 0;
#X connect 7 1 9 0;
#X connect 8 0 6 1;
#X connect 9 0 6 1;
#X connect 10 0 0 0;
#X connect 10 1 1 0;
#X connect 10 2 3 0;
#X connect 11 0 10 0;
#X connect 12 0 0 1;
#X connect 13 0 1 1;
#X restore 211 326 pd param-nudge;
#X obj 211 348 clip 0 127;
#N canvas 0 50 484 497 param-nudge 0;
#X obj 124 234 random;
#X obj 232 335 f;
#X obj 232 368 +;
#X obj 257 166 random 2;
#X obj 124 275 t f f;
#X obj 124 351 t b f;
#X obj 124 297 *;
#X obj 257 188 sel 0 1;
#X msg 257 280 -1;
#X msg 335 280 1;
#X obj 124 149 t b b b;
#X obj 124 123 r NUDGE!;
#X obj 157 193 r NUDGE-RANGE;
#X obj 247 308 inlet;
#X obj 232 397 outlet;
#X connect 0 0 4 0;
#X connect 1 0 2 0;
#X connect 2 0 14 0;
#X connect 3 0 7 0;
#X connect 4 0 6 0;
#X connect 5 0 2 0;
#X connect 5 1 2 1;
#X connect 6 0 5 0;
#X connect 7 0 8 0;
#X connect 7 1 9 0;
#X connect 8 0 6 1;
#X connect 9 0 6 1;
#X connect 10 0 0 0;
#X connect 10 1 1 0;
#X connect 10 2 3 0;
#X connect 11 0 10 0;
#X connect 12 0 0 1;
#X connect 13 0 1 1;
#X restore 411 326 pd param-nudge;
#X obj 411 348 clip 0 127;
#X obj 211 397 s \$0-sampler-length-att-r;
#X obj 411 397 s \$0-sampler-start-att-r;
#X obj 23 22 r \$0-sampler-pitch-s;
#X obj 211 22 r \$0-sampler-length-s;
#X obj 413 22 r \$0-sampler-start-s;
#X obj 21 303 r \$0-sampler-pitch-att-s;
#X obj 211 303 r \$0-sampler-length-att-s;
#X obj 411 303 r \$0-sampler-start-att-s;
#X obj 23 178 / 127;
#X obj 23 200 * 4;
#X obj 23 222 - 2;
#X obj 23 49 + 2;
#X obj 23 71 / 4;
#X obj 23 93 * 127;
#X text 58 221 Scale back to -2 - 2;
#X text 72 92 Scale to 0 - 127;
#X connect 0 0 4 0;
#X connect 1 0 5 0;
#X connect 2 0 6 0;
#X connect 3 0 11 0;
#X connect 4 0 24 0;
#X connect 5 0 8 0;
#X connect 6 0 9 0;
#X connect 11 0 10 0;
#X connect 12 0 13 0;
#X connect 13 0 16 0;
#X connect 14 0 15 0;
#X connect 15 0 17 0;
#X connect 18 0 27 0;
#X connect 19 0 1 0;
#X connect 20 0 2 0;
#X connect 21 0 3 0;
#X connect 22 0 12 0;
#X connect 23 0 14 0;
#X connect 24 0 25 0;
#X connect 25 0 26 0;
#X connect 26 0 7 0;
#X connect 27 0 28 0;
#X connect 28 0 29 0;
#X connect 29 0 0 0;
#X restore 589 165 pd parameter-nudging-system;
#X text 118 448 Open the sample;
#X obj 175 328 cnv 5 5 5 empty empty OUT_R 0 0 0 8 -262144 -66577 0
;
#X obj 107 268 hsl 128 15 0 127 0 1 \$0-sampler-length-att-s \$0-sampler-length-att-r
LENGTH 133 7 0 10 -158136 -1 -1 0 1;
#X obj 107 283 hsl 128 15 0 127 0 1 \$0-sampler-start-att-s \$0-sampler-start-att-r
START 133 7 0 10 -158136 -1 -1 3800 1;
#X obj 107 253 hsl 128 15 0 127 0 1 \$0-sampler-pitch-att-s \$0-sampler-pitch-att-r
PITCH 133 7 0 10 -158136 -1 -1 100 1;
#X obj 670 594 *~;
#X obj 679 76 inlet~ PITCH;
#X obj 679 98 throw~ \$0-sampler-PITCH;
#X obj 670 539 *~;
#X obj 687 513 line~;
#X obj 854 76 inlet~ LENGTH;
#X obj 864 109 throw~ \$0-sampler-LENGTH;
#X text 568 595 Sample pitch;
#X obj 1043 98 throw~ \$0-sample-START;
#X obj 227 496 t f f;
#X obj 1043 76 inlet~ START;
#X obj 855 131 throw~ \$0-sampler-LENGTH2;
#N canvas 693 365 353 379 sample-length 0;
#X obj 30 21 r \$0-sampler-length-s;
#X obj 30 87 line~;
#X obj 30 282 clip~ 0 1;
#X obj 47 119 catch~ \$0-sampler-LENGTH;