diff examples/08-PureData/karplusStrong/_main.pd @ 531:ddb86944e138 prerelease

cleaned up all pd examples (and removed some). added polysynth and vangelisiser to instruments examples
author chnrx <chris.heinrichs@gmail.com>
date Thu, 23 Jun 2016 20:40:05 +0100
parents 8fcfbfb32aa0
children
line wrap: on
line diff
--- a/examples/08-PureData/karplusStrong/_main.pd	Thu Jun 23 13:22:59 2016 +0100
+++ b/examples/08-PureData/karplusStrong/_main.pd	Thu Jun 23 20:40:05 2016 +0100
@@ -1,240 +1,71 @@
-#N canvas 440 516 715 490 10;
-#X obj 38 370 dac~ 1 2;
-#X text 470 442 ---------------------------------;
-#X text 470 432 @krighxz / BELA / heavy / 12/2015;
-#X text 494 451 beaglert.cc / enzienaudio.com;
+#N canvas 826 561 694 734 10;
+#X obj 40 660 dac~ 1 2;
 #X text 33 22 Karplus Strong;
 #X text 33 32 ==============;
-#X obj 38 323 vd~ \$0-wg1;
-#X obj 118 345 lop~ 1000;
-#X obj 118 367 *~ 0.99;
-#X obj 118 389 s~ \$0-fb1;
-#X obj 38 94 adc~ 3;
-#X obj 38 116 hip~ 100;
-#X obj 98 176 r~ \$0-fb1;
-#X obj 38 198 delwrite~ \$0-wg1 100;
-#X obj 38 268 *~;
-#X obj 38 290 *~ 10;
-#X text 99 116 <<< centre (i.e. DC block) signal with high-pass filter
+#X obj 40 613 vd~ \$0-wg1;
+#X obj 120 635 lop~ 1000;
+#X obj 120 679 s~ \$0-fb1;
+#X obj 40 286 hip~ 100;
+#X obj 105 345 r~ \$0-fb1;
+#X obj 40 368 delwrite~ \$0-wg1 100;
+#X obj 40 538 *~;
+#X obj 40 560 *~ 10;
+#X text 135 286 <<< centre (i.e. DC block) signal with high-pass filter
 ;
-#X text 100 94 <<< use accelerometer \, piezo or FSR on first analog
-in;
-#X text 105 245 <<< use potentiometer or fader on second analog in
+#X text 126 492 <<< use potentiometer or fader on second analog in
 ;
-#X text 100 75 EXCITATION INPUT:;
-#X text 100 225 DELAY PERIOD:;
-#X text 182 365 <<< and decay here [0-0.9999];
-#X text 182 345 <<< set damping here [~100-20000];
-#N canvas 335 566 461 274 gate 0;
-#N canvas 0 22 450 278 (subpatch) 0;
-#X array \$0-xfer 1024 float 3;
-#A 0 0 -0.808242 -0.804734 -0.801234 -0.797741 -0.794256 -0.790778
--0.787309 -0.783846 -0.780392 -0.776945 -0.773506 -0.770074 -0.76665
--0.763233 -0.759824 -0.756423 -0.75303 -0.749644 -0.746266 -0.742895
--0.739532 -0.736176 -0.732829 -0.729488 -0.726156 -0.722831 -0.719514
--0.716204 -0.712902 -0.709608 -0.706321 -0.703042 -0.69977 -0.696507
--0.69325 -0.690002 -0.686761 -0.683527 -0.680302 -0.677084 -0.673873
--0.67067 -0.667475 -0.664288 -0.661108 -0.657935 -0.654771 -0.651614
--0.648464 -0.645323 -0.642188 -0.639062 -0.635943 -0.632832 -0.629728
--0.626632 -0.623544 -0.620463 -0.61739 -0.614324 -0.611266 -0.608216
--0.605174 -0.602139 -0.599111 -0.596092 -0.59308 -0.590075 -0.587078
--0.584089 -0.581107 -0.578134 -0.575167 -0.572209 -0.569257 -0.566314
--0.563378 -0.56045 -0.55753 -0.554617 -0.551711 -0.548814 -0.545924
--0.543041 -0.540167 -0.537299 -0.53444 -0.531588 -0.528744 -0.525907
--0.523078 -0.520257 -0.517443 -0.514637 -0.511839 -0.509048 -0.506265
--0.503489 -0.500721 -0.497961 -0.495208 -0.492463 -0.489726 -0.486996
--0.484274 -0.481559 -0.478852 -0.476153 -0.473461 -0.470777 -0.468101
--0.465432 -0.462771 -0.460117 -0.457472 -0.454833 -0.452203 -0.44958
--0.446964 -0.444357 -0.441757 -0.439164 -0.436579 -0.434002 -0.431432
--0.42887 -0.426316 -0.42377 -0.42123 -0.418699 -0.416175 -0.413659
--0.41115 -0.40865 -0.406156 -0.403671 -0.401193 -0.398722 -0.396259
--0.393804 -0.391357 -0.388917 -0.386485 -0.38406 -0.381643 -0.379234
--0.376832 -0.374438 -0.372051 -0.369673 -0.367301 -0.364938 -0.362582
--0.360233 -0.357893 -0.35556 -0.353234 -0.350916 -0.348606 -0.346304
--0.344009 -0.341721 -0.339442 -0.33717 -0.334905 -0.332649 -0.330399
--0.328158 -0.325924 -0.323698 -0.321479 -0.319268 -0.317065 -0.314869
--0.312681 -0.3105 -0.308328 -0.306162 -0.304005 -0.301855 -0.299713
--0.297578 -0.295451 -0.293331 -0.291219 -0.289115 -0.287019 -0.28493
--0.282848 -0.280775 -0.278709 -0.27665 -0.2746 -0.272556 -0.270521
--0.268493 -0.266473 -0.26446 -0.262455 -0.260458 -0.258468 -0.256486
--0.254511 -0.252545 -0.250585 -0.248634 -0.24669 -0.244753 -0.242825
--0.240904 -0.23899 -0.237084 -0.235186 -0.233296 -0.231413 -0.229537
--0.22767 -0.22581 -0.223957 -0.222112 -0.220275 -0.218446 -0.216624
--0.21481 -0.213003 -0.211204 -0.209413 -0.207629 -0.205853 -0.204084
--0.202323 -0.20057 -0.198824 -0.197086 -0.195356 -0.193633 -0.191918
--0.190211 -0.188511 -0.186819 -0.185134 -0.183457 -0.181788 -0.180126
--0.178472 -0.176826 -0.175187 -0.173556 -0.171932 -0.170316 -0.168708
--0.167108 -0.165515 -0.163929 -0.162351 -0.160781 -0.159219 -0.157664
--0.156117 -0.154577 -0.153045 -0.151521 -0.150004 -0.148495 -0.146993
--0.1455 -0.144013 -0.142535 -0.141064 -0.139601 -0.138145 -0.136697
--0.135256 -0.133824 -0.132398 -0.130981 -0.129571 -0.128169 -0.126774
--0.125387 -0.124008 -0.122636 -0.121272 -0.119915 -0.118566 -0.117225
--0.115891 -0.114565 -0.113247 -0.111936 -0.110633 -0.109338 -0.10805
--0.10677 -0.105497 -0.104232 -0.102975 -0.101725 -0.100483 -0.0992487
--0.0980219 -0.0968027 -0.0955911 -0.0943872 -0.0931909 -0.0920023 -0.0908212
--0.0896478 -0.0884821 -0.0873239 -0.0861734 -0.0850305 -0.0838953 -0.0827676
--0.0816476 -0.0805353 -0.0794305 -0.0783334 -0.077244 -0.0761621 -0.0750879
--0.0740213 -0.0729623 -0.071911 -0.0708673 -0.0698312 -0.0688028 -0.067782
--0.0667688 -0.0657632 -0.0647653 -0.063775 -0.0627924 -0.0618173 -0.0608499
--0.0598901 -0.058938 -0.0579935 -0.0570566 -0.0561273 -0.0552057 -0.0542917
--0.0533853 -0.0524866 -0.0515955 -0.050712 -0.0498361 -0.0489679 -0.0481073
--0.0472543 -0.046409 -0.0455713 -0.0447412 -0.0439188 -0.0431039 -0.0422968
--0.0414972 -0.0407053 -0.039921 -0.0391443 -0.0383752 -0.0376138 -0.03686
--0.0361139 -0.0353754 -0.0346445 -0.0339212 -0.0332056 -0.0324976 -0.0317972
--0.0311044 -0.0304193 -0.0297418 -0.029072 -0.0284097 -0.0277551 -0.0271082
--0.0264688 -0.0258371 -0.025213 -0.0245966 -0.0239877 -0.0233865 -0.022793
--0.022207 -0.0216287 -0.021058 -0.020495 -0.0199396 -0.0193918 -0.0188516
--0.0183191 -0.0177942 -0.0172769 -0.0167673 -0.0162653 -0.0157709 -0.0152841
--0.014805 -0.0143335 -0.0138696 -0.0134134 -0.0129648 -0.0125238 -0.0120905
--0.0116647 -0.0112466 -0.0108362 -0.0104333 -0.0100381 -0.00965057
--0.00927063 -0.00889832 -0.00853363 -0.00817657 -0.00782715 -0.00748535
--0.00715118 -0.00682465 -0.00650574 -0.00619446 -0.00589081 -0.00559479
--0.0053064 -0.00502563 -0.0047525 -0.004487 -0.00422913 -0.00397888
--0.00373627 -0.00350128 -0.00327393 -0.0030542 -0.0028421 -0.00263763
--0.0024408 -0.00225159 -0.00207001 -0.00189606 -0.00172974 -0.00157104
--0.00141998 -0.00127655 -0.00114075 -0.00101257 -0.000892029 -0.000779114
--0.000673828 -0.000576172 -0.000486145 -0.000403747 -0.000328979 -0.000261841
--0.000202332 -0.000150452 -0.000106201 -6.95801e-05 -4.05884e-05 -1.92261e-05
--5.49316e-06 0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0
--0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0
--0 -0 -0 -0 -0 -0 -0 -0 -0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
-0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5.49316e-06
-1.92261e-05 4.05884e-05 6.95801e-05 0.000106201 0.000150452 0.000202332
-0.000261841 0.000328979 0.000403747 0.000486145 0.000576172 0.000673828
-0.000779114 0.000892029 0.00101257 0.00114075 0.00127655 0.00141998
-0.00157104 0.00172974 0.00189606 0.00207001 0.00225159 0.0024408 0.00263763
-0.0028421 0.0030542 0.00327393 0.00350128 0.00373627 0.00397888 0.00422913
-0.004487 0.0047525 0.00502563 0.0053064 0.00559479 0.00589081 0.00619446
-0.00650574 0.00682465 0.00715118 0.00748535 0.00782715 0.00817657 0.00853363
-0.00889832 0.00927063 0.00965057 0.0100381 0.0104333 0.0108362 0.0112466
-0.0116647 0.0120905 0.0125238 0.0129648 0.0134134 0.0138696 0.0143335
-0.014805 0.0152841 0.0157709 0.0162653 0.0167673 0.0172769 0.0177942
-0.0183191 0.0188516 0.0193918 0.0199396 0.020495 0.021058 0.0216287
-0.022207 0.022793 0.0233865 0.0239877 0.0245966 0.025213 0.0258371
-0.0264688 0.0271082 0.0277551 0.0284097 0.029072 0.0297418 0.0304193
-0.0311044 0.0317972 0.0324976 0.0332056 0.0339212 0.0346445 0.0353754
-0.0361139 0.03686 0.0376138 0.0383752 0.0391443 0.039921 0.0407053
-0.0414972 0.0422968 0.0431039 0.0439188 0.0447412 0.0455713 0.046409
-0.0472543 0.0481073 0.0489679 0.0498361 0.050712 0.0515955 0.0524866
-0.0533853 0.0542917 0.0552057 0.0561273 0.0570566 0.0579935 0.058938
-0.0598901 0.0608499 0.0618173 0.0627924 0.063775 0.0647653 0.0657632
-0.0667688 0.067782 0.0688028 0.0698312 0.0708673 0.071911 0.0729623
-0.0740213 0.0750879 0.0761621 0.077244 0.0783334 0.0794305 0.0805353
-0.0816476 0.0827676 0.0838953 0.0850305 0.0861734 0.0873239 0.0884821
-0.0896478 0.0908212 0.0920023 0.0931909 0.0943872 0.0955911 0.0968027
-0.0980219 0.0992487 0.100483 0.101725 0.102975 0.104232 0.105497 0.10677
-0.10805 0.109338 0.110633 0.111936 0.113247 0.114565 0.115891 0.117225
-0.118566 0.119915 0.121272 0.122636 0.124008 0.125387 0.126774 0.128169
-0.129571 0.130981 0.132398 0.133824 0.135256 0.136697 0.138145 0.139601
-0.141064 0.142535 0.144013 0.1455 0.146993 0.148495 0.150004 0.151521
-0.153045 0.154577 0.156117 0.157664 0.159219 0.160781 0.162351 0.163929
-0.165515 0.167108 0.168708 0.170316 0.171932 0.173556 0.175187 0.176826
-0.178472 0.180126 0.181788 0.183457 0.185134 0.186819 0.188511 0.190211
-0.191918 0.193633 0.195356 0.197086 0.198824 0.20057 0.202323 0.204084
-0.205853 0.207629 0.209413 0.211204 0.213003 0.21481 0.216624 0.218446
-0.220275 0.222112 0.223957 0.22581 0.22767 0.229537 0.231413 0.233296
-0.235186 0.237084 0.23899 0.240904 0.242825 0.244753 0.24669 0.248634
-0.250585 0.252545 0.254511 0.256486 0.258468 0.260458 0.262455 0.26446
-0.266473 0.268493 0.270521 0.272556 0.2746 0.27665 0.278709 0.280775
-0.282848 0.28493 0.287019 0.289115 0.291219 0.293331 0.295451 0.297578
-0.299713 0.301855 0.304005 0.306162 0.308328 0.3105 0.312681 0.314869
-0.317065 0.319268 0.321479 0.323698 0.325924 0.328158 0.330399 0.332649
-0.334905 0.33717 0.339442 0.341721 0.344009 0.346304 0.348606 0.350916
-0.353234 0.35556 0.357893 0.360233 0.362582 0.364938 0.367301 0.369673
-0.372051 0.374438 0.376832 0.379234 0.381643 0.38406 0.386485 0.388917
-0.391357 0.393804 0.396259 0.398722 0.401193 0.403671 0.406156 0.40865
-0.41115 0.413659 0.416175 0.418699 0.42123 0.42377 0.426316 0.42887
-0.431432 0.434002 0.436579 0.439164 0.441757 0.444357 0.446964 0.44958
-0.452203 0.454833 0.457472 0.460117 0.462771 0.465432 0.468101 0.470777
-0.473461 0.476153 0.478852 0.481559 0.484274 0.486996 0.489726 0.492463
-0.495208 0.497961 0.500721 0.503489 0.506265 0.509048 0.511839 0.514637
-0.517443 0.520257 0.523078 0.525907 0.528744 0.531588 0.53444 0.537299
-0.540167 0.543041 0.545924 0.548814 0.551711 0.554617 0.55753 0.56045
-0.563378 0.566314 0.569257 0.572209 0.575167 0.578134 0.581107 0.584089
-0.587078 0.590075 0.59308 0.596092 0.599111 0.602139 0.605174 0.608216
-0.611266 0.614324 0.61739 0.620463 0.623544 0.626632 0.629728 0.632832
-0.635943 0.639062 0.642188 0.645323 0.648464 0.651614 0.654771 0.657935
-0.661108 0.664288 0.667475 0.67067 0.673873 0.677084 0.680302 0.683527
-0.686761 0.690002 0.69325 0.696507 0.69977 0.703042 0.706321 0.709608
-0.712902 0.716204 0.719514 0.722831;
-#A 1000 0.726156 0.729488 0.732829 0.736176 0.739532 0.742895 0.746266
-0.749644 0.75303 0.756423 0.759824 0.763233 0.76665 0.770074 0.773506
-0.776945 0.780392 0.783846 0.787309 0.790778 0.794256 0.797741 0.801234
-0.804734;
-#X coords 0 1 1023 -1 200 200 1 0 0;
-#X restore 230 34 graph;
-#X obj 25 27 inlet~;
-#X obj 25 49 clip~ -1 1;
-#X obj 25 71 *~ 512;
-#X obj 25 93 +~ 512;
-#X obj 25 115 tabread4~ \$0-xfer;
-#X obj 25 137 outlet~;
-#N canvas 0 22 334 332 generate-xfer 0;
-#X obj 8 290 tabwrite \$0-xfer;
-#X obj 8 109 / 1024;
-#X obj 8 129 * 2;
-#X obj 8 149 - 1;
-#X obj 8 169 moses 0;
-#X obj 8 191 + 0.1;
-#X obj 8 213 clip -1 0;
-#X obj 68 191 - 0.1;
-#X obj 68 213 clip 0 1;
-#X obj 101 16 inlet threshold;
-#X obj 101 78 count 1024;
-#X obj 128 58 s \$0-thresh;
-#X obj 95 169 r \$0-thresh;
-#X obj 101 38 t b f;
-#X obj 68 236 *;
-#X obj 8 236 *;
-#X obj 8 258 * -1;
-#X text 140 203 <<< deadzone;
-#X text 140 253 <<< smooth by taking exponent;
-#X connect 1 0 2 0;
-#X connect 2 0 3 0;
+#X text 37 190 EXCITATION INPUT:;
+#X text 37 418 DELAY PERIOD:;
+#X text 214 655 <<< and decay here [0-0.9999];
+#X text 155 307 <<< thresholding to remove any consistent noise in
+the excitation signal;
+#X obj 40 234 adc~ 1;
+#X obj 40 466 sig~ 1;
+#X obj 40 515 -~;
+#X obj 55 491 adc~ 3;
+#X obj 40 582 +~ 2;
+#X text 214 635 <<< set damping here [100-20000];
+#X obj 120 657 *~ 0.99;
+#X text 126 573 <<< period range between 2-12ms;
+#X text 151 505 to set period (or 'length of string');
+#X text 36 55 This is an example of simple 'Karplus Strong' synthesis
+;
+#X text 36 69 which produces a sound resembling a plucked string by
+;
+#X text 36 84 feeding the filtered output of a delay line back into
+;
+#X text 36 98 itself. Here we use the left audio input as an excitation
+;
+#X text 36 112 mechanism for the string. Try connecting a piezo to
+bela's;
+#X text 36 126 audio input and tapping against it. The first analog
+input;
+#X text 36 140 sets the length of the string.;
+#X text 485 15 ............................;
+#X text 485 25 . ____ ._____ _ .......___ .;
+#X text 485 35 .| __ )| ____| |....../ _ |.;
+#X text 485 55 .| |_) | |___| |___ / ___ |.;
+#X text 485 65 .|____/|_____|_____/_/..._|.io;
+#X text 485 75 ............................;
+#X text 485 45 .| __ || __|.| |...../ _| |.;
+#X obj 40 307 gate-xfer 0.1;
+#X text 116 234 <<< use piezo or microphone on left audio channel;
+#X text 140 248 (you can even try hooking up an accelerometer...);
+#X text 37 200 ----------------;
+#X text 37 429 ------------;
 #X connect 3 0 4 0;
-#X connect 4 0 5 0;
-#X connect 4 1 7 0;
-#X connect 5 0 6 0;
-#X connect 6 0 15 0;
-#X connect 6 0 15 1;
+#X connect 3 0 0 0;
+#X connect 3 0 0 1;
+#X connect 4 0 23 0;
+#X connect 6 0 40 0;
 #X connect 7 0 8 0;
-#X connect 8 0 14 0;
-#X connect 8 0 14 1;
-#X connect 9 0 13 0;
-#X connect 10 0 0 1;
-#X connect 10 0 1 0;
-#X connect 12 0 5 1;
-#X connect 12 0 7 1;
-#X connect 13 0 10 0;
-#X connect 13 1 11 0;
-#X connect 14 0 0 0;
-#X connect 15 0 16 0;
-#X connect 16 0 0 0;
-#X restore 26 217 pd generate-xfer;
-#X text 58 196 <<< threshold;
-#X obj 26 173 loadbang;
-#X msg 26 195 0.1;
-#X connect 1 0 2 0;
-#X connect 2 0 3 0;
-#X connect 3 0 4 0;
-#X connect 4 0 5 0;
-#X connect 5 0 6 0;
 #X connect 9 0 10 0;
-#X connect 10 0 7 0;
-#X restore 38 137 pd gate;
-#X obj 38 246 adc~ 10;
-#X text 98 137 <<< thresholding to remove any consistent noise in the
-excitation signal;
-#X connect 6 0 7 0;
-#X connect 6 0 0 0;
-#X connect 6 0 0 1;
-#X connect 7 0 8 0;
-#X connect 8 0 9 0;
-#X connect 10 0 11 0;
-#X connect 11 0 23 0;
-#X connect 12 0 13 0;
-#X connect 14 0 15 0;
-#X connect 15 0 6 0;
-#X connect 23 0 13 0;
-#X connect 24 0 14 0;
-#X connect 24 0 14 1;
+#X connect 10 0 21 0;
+#X connect 17 0 6 0;
+#X connect 18 0 19 0;
+#X connect 19 0 9 1;
+#X connect 19 0 9 0;
+#X connect 20 0 19 1;
+#X connect 21 0 3 0;
+#X connect 23 0 5 0;
+#X connect 40 0 8 0;