-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsampler-for-extended.pd
1132 lines (1132 loc) · 31.8 KB
/
sampler-for-extended.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 1 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 - - -;
#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 11100 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 9313 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 4100 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 11 518 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 149 s \$0-sample-display-name;
#N canvas 1160 437 580 264 get-file-name 0;
#X obj 296 28 inlet;
#X obj 296 183 outlet;
#X text -73 142 This patch should also convert any spaces to underscores
;
#X text -74 74 I'm not sure how to split strings in pd-extended \,
but this is where the patch where that would go.;
#X text -73 106 This patch should substring a path to only get the
name of the file itself. EX: ../folder/file.wav -> file.wav;
#X connect 0 0 1 0;
#X restore 53 124 pd get-file-name;
#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 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 768 807 620 156 list-to-symbol 0;
#X obj 85 12 inlet;
#X obj 85 75 outlet;
#X text 193 15 This patch will convert a space separated list into
a single symbol.;
#X obj 85 45 tosymbol;
#X text 191 50 This is pretty easy to do in extended!;
#X connect 0 0 3 0;
#X connect 3 0 1 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;
#X msg 926 460 0;
#X obj 739 479 spigot;
#X msg 806 459 1;
#X msg 776 459 0;
#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;
#X msg 881 398 0;
#X obj 690 417 spigot;
#X msg 757 397 1;
#X msg 727 397 0;
#X obj 690 686 s \$0-filename-r;
#N canvas 744 830 644 133 list-to-symbol 0;
#X obj 85 12 inlet;
#X obj 85 64 outlet;
#X text 208 8 This patch will convert a space separated list into a
single symbol.;
#X obj 85 39 tosymbol;
#X connect 0 0 3 0;
#X connect 3 0 1 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 6300 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 4100 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 2400 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;
#X obj 29 260 +~;
#X obj 65 144 r \$0-sampler-length-att-s;
#X obj 47 233 *~;
#X obj 65 210 line~;
#X obj 30 315 outlet~;
#X obj 65 166 / 127;
#X obj 30 43 / 127;
#X obj 65 188 pack 0 50;
#X obj 30 65 pack 0 50;
#X connect 0 0 10 0;
#X connect 1 0 4 0;
#X connect 2 0 8 0;
#X connect 3 0 6 0;
#X connect 4 0 2 0;
#X connect 5 0 9 0;
#X connect 6 0 4 1;
#X connect 7 0 6 1;
#X connect 9 0 11 0;
#X connect 10 0 12 0;
#X connect 11 0 7 0;
#X connect 12 0 1 0;
#X restore 688 388 pd sample-length;
#N canvas 186 336 428 589 sample-pitch 0;
#X obj 47 27 r \$0-sampler-pitch-s;
#X obj 47 123 line~;
#X obj 46 364 +~;
#X obj 65 175 catch~ \$0-sampler-PITCH;
#X obj 45 457 outlet~;
#X obj 65 332 *~;
#X obj 82 309 line~;
#X obj 82 236 r \$0-sampler-pitch-att-s;
#X obj 82 263 / 127;
#X obj 93 399 snapshot~;
#X obj 109 374 metro 100;
#X floatatom 93 421 10 0 0 0 - - -;
#X obj 109 351 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 65 197 *~ 127;
#X obj 82 287 pack 0 50;
#X obj 47 101 pack 0 50;
#X connect 0 0 15 0;
#X connect 1 0 2 0;
#X connect 2 0 4 0;
#X connect 2 0 9 0;
#X connect 3 0 13 0;
#X connect 5 0 2 1;
#X connect 6 0 5 1;
#X connect 7 0 8 0;
#X connect 8 0 14 0;
#X connect 9 0 11 0;
#X connect 10 0 9 0;
#X connect 12 0 10 0;
#X connect 13 0 5 0;
#X connect 14 0 6 0;
#X connect 15 0 1 0;
#X restore 689 568 pd sample-pitch;
#X obj 635 408 sig~ 1;
#X obj 671 435 /~;
#N canvas 693 365 353 379 sample-length2 0;
#X obj 23 11 r \$0-sampler-length-s;
#X obj 23 77 line~;
#X obj 23 282 clip~ 0 1;
#X obj 22 260 +~;
#X obj 58 146 r \$0-sampler-length-att-s;
#X obj 40 233 *~;
#X obj 58 210 line~;
#X obj 23 315 outlet~;
#X obj 40 121 catch~ \$0-sampler-LENGTH2;
#X obj 58 167 / 127;
#X obj 23 34 / 127;
#X obj 58 188 pack 0 50;
#X obj 23 55 pack 0 50;
#X connect 0 0 10 0;
#X connect 1 0 3 0;
#X connect 2 0 7 0;
#X connect 3 0 2 0;
#X connect 4 0 9 0;
#X connect 5 0 3 1;
#X connect 6 0 5 1;
#X connect 8 0 5 0;
#X connect 9 0 11 0;
#X connect 10 0 12 0;
#X connect 11 0 6 0;
#X connect 12 0 1 0;
#X restore 689 897 pd sample-length2;
#N canvas 786 589 394 334 sample-start 0;
#X obj 24 18 r \$0-sampler-start-s;
#X obj 24 89 line~;
#X obj 24 241 +~;
#X obj 24 263 clip~ 0 1;
#X obj 42 115 catch~ \$0-sample-START;
#X obj 42 207 *~;
#X obj 60 140 r \$0-sampler-start-att-s;
#X obj 24 285 outlet~;
#X obj 60 161 / 127;
#X obj 24 44 / 127;
#X obj 24 67 pack 0 50;
#X connect 0 0 9 0;
#X connect 1 0 2 0;
#X connect 2 0 3 0;
#X connect 3 0 7 0;
#X connect 4 0 5 0;
#X connect 5 0 2 1;
#X connect 6 0 8 0;
#X connect 8 0 5 1;
#X connect 9 0 10 0;
#X connect 10 0 1 0;
#X restore 688 959 pd sample-start;
#X obj 669 1103 tabread4~ \$0-sample-L;
#X obj 737 1132 tabread4~ \$0-sample-R;
#X obj 726 597 r \$0-bang;
#X msg 726 685 0;
#X obj 849 689 sel 1;
#X msg 849 716 1;
#X text 518 791 Detect end of sample;
#X obj 807 620 t f f;
#N canvas 65 231 809 734 detect-end-of-sample 0;
#X obj 128 641 outlet bang-on-end;
#X msg 28 515 0;
#X obj 27 617 spigot;
#X obj 27 641 outlet;
#X obj 98 20 inlet~ pitch;
#X msg 98 100 1;
#X obj 98 126 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1
1;
#X msg 298 97 0;
#X obj 98 73 threshold~ 0.0001 0 -0.0001 0;
#X obj 98 168 == 0;
#X obj 73 197 *~ 1;
#X obj 27 197 *~ 1;
#X text 250 270 Reversed;
#X text 250 246 Normal;
#X text 359 35 Bang when the sample has ended. We detect the end of
the sample with [threshold~ 0.9999] \, however \, when the sample is
played in reverse \, it would trigger this instantly. We need to detect
when the sample is playing in reverse so that we can use [threshold~
0.0001] to bang the end of the sample. We detect if the sample is reversed
by checking if the pitch of the phasor~ is negative.;
#X text 367 192 If loop is set to off \, we also need to mute the audio
from the phasor when the sample has ended.;
#X obj 73 401 t b b;
#X obj 27 401 t b b;
#X obj 43 424 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X obj 112 423 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X obj 27 352 spigot;
#X obj 73 373 spigot;
#X obj 112 318 r \$0-required-hack;
#X obj 28 579 t f f;
#X obj 128 619 spigot;
#X obj 195 534 sel 1;
#X msg 195 556 1;
#X obj 195 488 f;
#X floatatom 202 512 5 0 0 0 - - -;
#X obj 145 526 == 0;
#X obj 246 510 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X obj 150 422 sel 0;
#X obj 162 443 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X text 356 415 We also piggy back off of \$0-required-hack to get
a bang whenver a new trigger is recieved \, so we can reset the spigots
at the bottom.;
#X text 253 318 <-------------;
#X obj 195 19 inlet loop-on-off;
#X obj 26 18 inlet~;
#X floatatom 145 548 5 0 0 0 - - -;
#X text 359 503 This is a mess of spigots \, but since we are using
a phasor~ object \, we are constanly cycling from 0 to 1 (or 1 to 0
if reversed). When loop is set to OFF \, we need to send the bang -on-end
\, send a 0 out of the left outlet \, then finally turn off both the
left and right outlet. The phasor~ will keep cycling \, but the patch
won't be outputting anything anymore.;
#X text 360 594 When loop is ON \, we need to turn both outlet back
on \, and disable them from being turned off. This is controlled using
spigots after the 0 message box.;
#X text 253 418 <-------------;
#X text 253 538 <-------------;
#X text 356 319 When the phase is reset to 0 this causes the threshold~
to trigger if the sample is being played in reverse. I tried setting
the phasor~ to 1 if the sample is in reverse \, but it still had this
problem. All this does is turn off the theshold~ outputs when the phasor~
is being reset \, then 5ms later it turns them back on.;
#X obj 28 553 spigot;
#X obj 67 535 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X obj 27 240 threshold~ 0.999 0 0.5 0;
#X obj 73 271 threshold~ 0.001 0 0.5 0;
#X connect 1 0 43 0;
#X connect 1 0 44 0;
#X connect 2 0 3 0;
#X connect 4 0 8 0;
#X connect 5 0 6 0;
#X connect 6 0 9 0;
#X connect 6 0 11 1;
#X connect 7 0 6 0;
#X connect 8 0 5 0;
#X connect 8 1 7 0;
#X connect 9 0 10 1;
#X connect 10 0 46 0;
#X connect 11 0 45 0;
#X connect 16 0 1 0;
#X connect 16 1 19 0;
#X connect 16 1 24 0;
#X connect 17 0 1 0;
#X connect 17 1 18 0;
#X connect 17 1 24 0;
#X connect 20 0 17 0;
#X connect 21 0 16 0;
#X connect 22 0 20 1;
#X connect 22 0 21 1;
#X connect 22 0 31 0;
#X connect 23 0 24 1;
#X connect 23 0 2 1;
#X connect 23 1 2 0;
#X connect 24 0 0 0;
#X connect 25 0 26 0;
#X connect 26 0 24 1;
#X connect 26 0 2 1;
#X connect 27 0 25 0;
#X connect 27 0 28 0;
#X connect 27 0 29 0;
#X connect 27 0 30 0;
#X connect 29 0 37 0;
#X connect 29 0 43 1;
#X connect 31 0 26 0;
#X connect 31 0 32 0;
#X connect 35 0 27 0;
#X connect 36 0 11 0;
#X connect 36 0 10 0;
#X connect 43 0 23 0;
#X connect 45 0 20 0;
#X connect 46 0 21 0;
#X restore 689 797 pd detect-end-of-sample;
#X obj 932 731 s \$0-required-hack;
#X obj 726 641 t b b b;
#X msg 957 684 0;
#X msg 913 705 1;
#X text 894 656 Used in detect-end-of-sample;
#X obj 913 685 del 5;
#X obj 726 619 t b b;
#X text 460 1017 Wrap around if we go past end;
#X text 498 1125 Finally play the sample;
#X text 318 120 Bang resets the phasor~ to 0;
#X obj 807 598 r \$0-loop-on-off-s;
#X text 63 994 This is a stereo sample player designed for AUTOMATONISM.
;
#X obj 521 96 threshold~ 0.99 0 1 0;
#X obj 521 74 inlet~ trig;
#X obj 104 109 cnv 5 5 5 empty empty TRIG 0 0 0 8 -262144 -226533 0
;
#X obj 149 109 cnv 5 5 5 empty empty PITCH 0 0 0 8 -262144 -120682
0;
#X msg 847 820 1 0 \, 0 1 1;
#X obj 847 842 vline~;
#X obj 847 864 outlet~;
#X text 906 865 Output trig on end;
#X obj 452 92 loadbang;
#X obj 134 188 bng 15 250 50 0 \$0-pitch-presets-1-s \$0-pitch-presets-1-r
-1 0 -6 0 10 -204800 -1 -1;
#X obj 149 188 bng 15 250 50 0 \$0-pitch-presets-2-s \$0-pitch-presets-1-r
empty -5 -6 0 10 -204800 -1 -1;
#X obj 164 188 bng 15 250 50 0 \$0-pitch-presets-3-s \$0-pitch-presets-1-r
0 5 -6 0 10 -204800 -1 -1;
#X obj 179 188 bng 15 250 50 0 \$0-pitch-presets-4-s \$0-pitch-presets-1-r
empty -1 -6 0 10 -204800 -1 -1;
#X obj 194 188 bng 15 250 50 0 \$0-pitch-presets-5-s \$0-pitch-presets-1-r
1 5 -6 0 10 -204800 -1 -1;
#X obj 209 188 bng 15 250 50 0 \$0-pitch-presets-5-s \$0-pitch-presets-1-r
empty 30 7 0 10 -204800 -1 -1;
#X obj 119 188 bng 15 250 50 0 \$0-pitch-presets--2-s \$0-pitch-presets--2-s
empty 0 -6 0 10 -204800 -1 -1;
#X obj 224 188 bng 15 250 50 0 \$0-pitch-presets-5-s \$0-pitch-presets-1-r
2 5 -6 0 10 -204800 -1 -1;
#X obj 104 188 bng 15 250 50 0 \$0-pitch-presets-1-s \$0-pitch-presets-1-r
-2 0 -6 0 10 -204800 -1 -1;
#N canvas 591 509 450 351 apply-pitch-presets 0;
#X obj 191 232 f;
#X obj 191 255 s \$0-sampler-pitch-r;
#X obj 48 43 inlet;
#X obj 87 43 inlet;
#X obj 126 43 inlet;
#X obj 165 43 inlet;
#X obj 204 43 inlet;
#X obj 243 43 inlet;
#X obj 282 43 inlet;
#X obj 321 43 inlet;
#X obj 360 43 inlet;
#X msg 48 135 -2;
#X msg 87 110 -1.5;
#X msg 126 135 -1;
#X msg 165 109 -0.5;
#X msg 204 134 0;
#X msg 243 109 0.5;
#X msg 282 133 1;