annotate projects/heavy/pd/karplusStrong/_main.pd @ 168:eb62ed0d67e3

- edited karplusStrong pd example
author chnrx <chris.heinrichs@gmail.com>
date Thu, 03 Dec 2015 19:13:14 +0000
parents 40badaff5729
children
rev   line source
chris@164 1 #N canvas 440 516 715 490 10;
chris@164 2 #X obj 38 370 dac~ 1 2;
chris@164 3 #X text 470 442 ---------------------------------;
chris@164 4 #X text 470 432 @krighxz / BELA / heavy / 12/2015;
chris@164 5 #X text 494 451 beaglert.cc / enzienaudio.com;
chris@164 6 #X text 33 22 Karplus Strong;
chris@164 7 #X text 33 32 ==============;
chris@164 8 #X obj 38 323 vd~ \$0-wg1;
chris@164 9 #X obj 118 345 lop~ 1000;
chris@164 10 #X obj 118 367 *~ 0.99;
chris@164 11 #X obj 118 389 s~ \$0-fb1;
chris@164 12 #X obj 38 94 adc~ 3;
chris@164 13 #X obj 38 116 hip~ 100;
chris@168 14 #X obj 98 176 r~ \$0-fb1;
chris@168 15 #X obj 38 198 delwrite~ \$0-wg1 100;
chris@164 16 #X obj 38 268 *~;
chris@164 17 #X obj 38 290 *~ 10;
chris@164 18 #X text 99 116 <<< centre (i.e. DC block) signal with high-pass filter
chris@164 19 ;
chris@164 20 #X text 100 94 <<< use accelerometer \, piezo or FSR on first analog
chris@164 21 in;
chris@164 22 #X text 105 245 <<< use potentiometer or fader on second analog in
chris@164 23 ;
chris@164 24 #X text 100 75 EXCITATION INPUT:;
chris@164 25 #X text 100 225 DELAY PERIOD:;
chris@164 26 #X text 182 365 <<< and decay here [0-0.9999];
chris@164 27 #X text 182 345 <<< set damping here [~100-20000];
chris@168 28 #N canvas 335 566 461 274 gate 0;
chris@168 29 #N canvas 0 22 450 278 (subpatch) 0;
chris@168 30 #X array \$0-xfer 1024 float 3;
chris@168 31 #A 0 0 -0.808242 -0.804734 -0.801234 -0.797741 -0.794256 -0.790778
chris@168 32 -0.787309 -0.783846 -0.780392 -0.776945 -0.773506 -0.770074 -0.76665
chris@168 33 -0.763233 -0.759824 -0.756423 -0.75303 -0.749644 -0.746266 -0.742895
chris@168 34 -0.739532 -0.736176 -0.732829 -0.729488 -0.726156 -0.722831 -0.719514
chris@168 35 -0.716204 -0.712902 -0.709608 -0.706321 -0.703042 -0.69977 -0.696507
chris@168 36 -0.69325 -0.690002 -0.686761 -0.683527 -0.680302 -0.677084 -0.673873
chris@168 37 -0.67067 -0.667475 -0.664288 -0.661108 -0.657935 -0.654771 -0.651614
chris@168 38 -0.648464 -0.645323 -0.642188 -0.639062 -0.635943 -0.632832 -0.629728
chris@168 39 -0.626632 -0.623544 -0.620463 -0.61739 -0.614324 -0.611266 -0.608216
chris@168 40 -0.605174 -0.602139 -0.599111 -0.596092 -0.59308 -0.590075 -0.587078
chris@168 41 -0.584089 -0.581107 -0.578134 -0.575167 -0.572209 -0.569257 -0.566314
chris@168 42 -0.563378 -0.56045 -0.55753 -0.554617 -0.551711 -0.548814 -0.545924
chris@168 43 -0.543041 -0.540167 -0.537299 -0.53444 -0.531588 -0.528744 -0.525907
chris@168 44 -0.523078 -0.520257 -0.517443 -0.514637 -0.511839 -0.509048 -0.506265
chris@168 45 -0.503489 -0.500721 -0.497961 -0.495208 -0.492463 -0.489726 -0.486996
chris@168 46 -0.484274 -0.481559 -0.478852 -0.476153 -0.473461 -0.470777 -0.468101
chris@168 47 -0.465432 -0.462771 -0.460117 -0.457472 -0.454833 -0.452203 -0.44958
chris@168 48 -0.446964 -0.444357 -0.441757 -0.439164 -0.436579 -0.434002 -0.431432
chris@168 49 -0.42887 -0.426316 -0.42377 -0.42123 -0.418699 -0.416175 -0.413659
chris@168 50 -0.41115 -0.40865 -0.406156 -0.403671 -0.401193 -0.398722 -0.396259
chris@168 51 -0.393804 -0.391357 -0.388917 -0.386485 -0.38406 -0.381643 -0.379234
chris@168 52 -0.376832 -0.374438 -0.372051 -0.369673 -0.367301 -0.364938 -0.362582
chris@168 53 -0.360233 -0.357893 -0.35556 -0.353234 -0.350916 -0.348606 -0.346304
chris@168 54 -0.344009 -0.341721 -0.339442 -0.33717 -0.334905 -0.332649 -0.330399
chris@168 55 -0.328158 -0.325924 -0.323698 -0.321479 -0.319268 -0.317065 -0.314869
chris@168 56 -0.312681 -0.3105 -0.308328 -0.306162 -0.304005 -0.301855 -0.299713
chris@168 57 -0.297578 -0.295451 -0.293331 -0.291219 -0.289115 -0.287019 -0.28493
chris@168 58 -0.282848 -0.280775 -0.278709 -0.27665 -0.2746 -0.272556 -0.270521
chris@168 59 -0.268493 -0.266473 -0.26446 -0.262455 -0.260458 -0.258468 -0.256486
chris@168 60 -0.254511 -0.252545 -0.250585 -0.248634 -0.24669 -0.244753 -0.242825
chris@168 61 -0.240904 -0.23899 -0.237084 -0.235186 -0.233296 -0.231413 -0.229537
chris@168 62 -0.22767 -0.22581 -0.223957 -0.222112 -0.220275 -0.218446 -0.216624
chris@168 63 -0.21481 -0.213003 -0.211204 -0.209413 -0.207629 -0.205853 -0.204084
chris@168 64 -0.202323 -0.20057 -0.198824 -0.197086 -0.195356 -0.193633 -0.191918
chris@168 65 -0.190211 -0.188511 -0.186819 -0.185134 -0.183457 -0.181788 -0.180126
chris@168 66 -0.178472 -0.176826 -0.175187 -0.173556 -0.171932 -0.170316 -0.168708
chris@168 67 -0.167108 -0.165515 -0.163929 -0.162351 -0.160781 -0.159219 -0.157664
chris@168 68 -0.156117 -0.154577 -0.153045 -0.151521 -0.150004 -0.148495 -0.146993
chris@168 69 -0.1455 -0.144013 -0.142535 -0.141064 -0.139601 -0.138145 -0.136697
chris@168 70 -0.135256 -0.133824 -0.132398 -0.130981 -0.129571 -0.128169 -0.126774
chris@168 71 -0.125387 -0.124008 -0.122636 -0.121272 -0.119915 -0.118566 -0.117225
chris@168 72 -0.115891 -0.114565 -0.113247 -0.111936 -0.110633 -0.109338 -0.10805
chris@168 73 -0.10677 -0.105497 -0.104232 -0.102975 -0.101725 -0.100483 -0.0992487
chris@168 74 -0.0980219 -0.0968027 -0.0955911 -0.0943872 -0.0931909 -0.0920023 -0.0908212
chris@168 75 -0.0896478 -0.0884821 -0.0873239 -0.0861734 -0.0850305 -0.0838953 -0.0827676
chris@168 76 -0.0816476 -0.0805353 -0.0794305 -0.0783334 -0.077244 -0.0761621 -0.0750879
chris@168 77 -0.0740213 -0.0729623 -0.071911 -0.0708673 -0.0698312 -0.0688028 -0.067782
chris@168 78 -0.0667688 -0.0657632 -0.0647653 -0.063775 -0.0627924 -0.0618173 -0.0608499
chris@168 79 -0.0598901 -0.058938 -0.0579935 -0.0570566 -0.0561273 -0.0552057 -0.0542917
chris@168 80 -0.0533853 -0.0524866 -0.0515955 -0.050712 -0.0498361 -0.0489679 -0.0481073
chris@168 81 -0.0472543 -0.046409 -0.0455713 -0.0447412 -0.0439188 -0.0431039 -0.0422968
chris@168 82 -0.0414972 -0.0407053 -0.039921 -0.0391443 -0.0383752 -0.0376138 -0.03686
chris@168 83 -0.0361139 -0.0353754 -0.0346445 -0.0339212 -0.0332056 -0.0324976 -0.0317972
chris@168 84 -0.0311044 -0.0304193 -0.0297418 -0.029072 -0.0284097 -0.0277551 -0.0271082
chris@168 85 -0.0264688 -0.0258371 -0.025213 -0.0245966 -0.0239877 -0.0233865 -0.022793
chris@168 86 -0.022207 -0.0216287 -0.021058 -0.020495 -0.0199396 -0.0193918 -0.0188516
chris@168 87 -0.0183191 -0.0177942 -0.0172769 -0.0167673 -0.0162653 -0.0157709 -0.0152841
chris@168 88 -0.014805 -0.0143335 -0.0138696 -0.0134134 -0.0129648 -0.0125238 -0.0120905
chris@168 89 -0.0116647 -0.0112466 -0.0108362 -0.0104333 -0.0100381 -0.00965057
chris@168 90 -0.00927063 -0.00889832 -0.00853363 -0.00817657 -0.00782715 -0.00748535
chris@168 91 -0.00715118 -0.00682465 -0.00650574 -0.00619446 -0.00589081 -0.00559479
chris@168 92 -0.0053064 -0.00502563 -0.0047525 -0.004487 -0.00422913 -0.00397888
chris@168 93 -0.00373627 -0.00350128 -0.00327393 -0.0030542 -0.0028421 -0.00263763
chris@168 94 -0.0024408 -0.00225159 -0.00207001 -0.00189606 -0.00172974 -0.00157104
chris@168 95 -0.00141998 -0.00127655 -0.00114075 -0.00101257 -0.000892029 -0.000779114
chris@168 96 -0.000673828 -0.000576172 -0.000486145 -0.000403747 -0.000328979 -0.000261841
chris@168 97 -0.000202332 -0.000150452 -0.000106201 -6.95801e-05 -4.05884e-05 -1.92261e-05
chris@168 98 -5.49316e-06 0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0
chris@168 99 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0
chris@168 100 -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
chris@168 101 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
chris@168 102 1.92261e-05 4.05884e-05 6.95801e-05 0.000106201 0.000150452 0.000202332
chris@168 103 0.000261841 0.000328979 0.000403747 0.000486145 0.000576172 0.000673828
chris@168 104 0.000779114 0.000892029 0.00101257 0.00114075 0.00127655 0.00141998
chris@168 105 0.00157104 0.00172974 0.00189606 0.00207001 0.00225159 0.0024408 0.00263763
chris@168 106 0.0028421 0.0030542 0.00327393 0.00350128 0.00373627 0.00397888 0.00422913
chris@168 107 0.004487 0.0047525 0.00502563 0.0053064 0.00559479 0.00589081 0.00619446
chris@168 108 0.00650574 0.00682465 0.00715118 0.00748535 0.00782715 0.00817657 0.00853363
chris@168 109 0.00889832 0.00927063 0.00965057 0.0100381 0.0104333 0.0108362 0.0112466
chris@168 110 0.0116647 0.0120905 0.0125238 0.0129648 0.0134134 0.0138696 0.0143335
chris@168 111 0.014805 0.0152841 0.0157709 0.0162653 0.0167673 0.0172769 0.0177942
chris@168 112 0.0183191 0.0188516 0.0193918 0.0199396 0.020495 0.021058 0.0216287
chris@168 113 0.022207 0.022793 0.0233865 0.0239877 0.0245966 0.025213 0.0258371
chris@168 114 0.0264688 0.0271082 0.0277551 0.0284097 0.029072 0.0297418 0.0304193
chris@168 115 0.0311044 0.0317972 0.0324976 0.0332056 0.0339212 0.0346445 0.0353754
chris@168 116 0.0361139 0.03686 0.0376138 0.0383752 0.0391443 0.039921 0.0407053
chris@168 117 0.0414972 0.0422968 0.0431039 0.0439188 0.0447412 0.0455713 0.046409
chris@168 118 0.0472543 0.0481073 0.0489679 0.0498361 0.050712 0.0515955 0.0524866
chris@168 119 0.0533853 0.0542917 0.0552057 0.0561273 0.0570566 0.0579935 0.058938
chris@168 120 0.0598901 0.0608499 0.0618173 0.0627924 0.063775 0.0647653 0.0657632
chris@168 121 0.0667688 0.067782 0.0688028 0.0698312 0.0708673 0.071911 0.0729623
chris@168 122 0.0740213 0.0750879 0.0761621 0.077244 0.0783334 0.0794305 0.0805353
chris@168 123 0.0816476 0.0827676 0.0838953 0.0850305 0.0861734 0.0873239 0.0884821
chris@168 124 0.0896478 0.0908212 0.0920023 0.0931909 0.0943872 0.0955911 0.0968027
chris@168 125 0.0980219 0.0992487 0.100483 0.101725 0.102975 0.104232 0.105497 0.10677
chris@168 126 0.10805 0.109338 0.110633 0.111936 0.113247 0.114565 0.115891 0.117225
chris@168 127 0.118566 0.119915 0.121272 0.122636 0.124008 0.125387 0.126774 0.128169
chris@168 128 0.129571 0.130981 0.132398 0.133824 0.135256 0.136697 0.138145 0.139601
chris@168 129 0.141064 0.142535 0.144013 0.1455 0.146993 0.148495 0.150004 0.151521
chris@168 130 0.153045 0.154577 0.156117 0.157664 0.159219 0.160781 0.162351 0.163929
chris@168 131 0.165515 0.167108 0.168708 0.170316 0.171932 0.173556 0.175187 0.176826
chris@168 132 0.178472 0.180126 0.181788 0.183457 0.185134 0.186819 0.188511 0.190211
chris@168 133 0.191918 0.193633 0.195356 0.197086 0.198824 0.20057 0.202323 0.204084
chris@168 134 0.205853 0.207629 0.209413 0.211204 0.213003 0.21481 0.216624 0.218446
chris@168 135 0.220275 0.222112 0.223957 0.22581 0.22767 0.229537 0.231413 0.233296
chris@168 136 0.235186 0.237084 0.23899 0.240904 0.242825 0.244753 0.24669 0.248634
chris@168 137 0.250585 0.252545 0.254511 0.256486 0.258468 0.260458 0.262455 0.26446
chris@168 138 0.266473 0.268493 0.270521 0.272556 0.2746 0.27665 0.278709 0.280775
chris@168 139 0.282848 0.28493 0.287019 0.289115 0.291219 0.293331 0.295451 0.297578
chris@168 140 0.299713 0.301855 0.304005 0.306162 0.308328 0.3105 0.312681 0.314869
chris@168 141 0.317065 0.319268 0.321479 0.323698 0.325924 0.328158 0.330399 0.332649
chris@168 142 0.334905 0.33717 0.339442 0.341721 0.344009 0.346304 0.348606 0.350916
chris@168 143 0.353234 0.35556 0.357893 0.360233 0.362582 0.364938 0.367301 0.369673
chris@168 144 0.372051 0.374438 0.376832 0.379234 0.381643 0.38406 0.386485 0.388917
chris@168 145 0.391357 0.393804 0.396259 0.398722 0.401193 0.403671 0.406156 0.40865
chris@168 146 0.41115 0.413659 0.416175 0.418699 0.42123 0.42377 0.426316 0.42887
chris@168 147 0.431432 0.434002 0.436579 0.439164 0.441757 0.444357 0.446964 0.44958
chris@168 148 0.452203 0.454833 0.457472 0.460117 0.462771 0.465432 0.468101 0.470777
chris@168 149 0.473461 0.476153 0.478852 0.481559 0.484274 0.486996 0.489726 0.492463
chris@168 150 0.495208 0.497961 0.500721 0.503489 0.506265 0.509048 0.511839 0.514637
chris@168 151 0.517443 0.520257 0.523078 0.525907 0.528744 0.531588 0.53444 0.537299
chris@168 152 0.540167 0.543041 0.545924 0.548814 0.551711 0.554617 0.55753 0.56045
chris@168 153 0.563378 0.566314 0.569257 0.572209 0.575167 0.578134 0.581107 0.584089
chris@168 154 0.587078 0.590075 0.59308 0.596092 0.599111 0.602139 0.605174 0.608216
chris@168 155 0.611266 0.614324 0.61739 0.620463 0.623544 0.626632 0.629728 0.632832
chris@168 156 0.635943 0.639062 0.642188 0.645323 0.648464 0.651614 0.654771 0.657935
chris@168 157 0.661108 0.664288 0.667475 0.67067 0.673873 0.677084 0.680302 0.683527
chris@168 158 0.686761 0.690002 0.69325 0.696507 0.69977 0.703042 0.706321 0.709608
chris@168 159 0.712902 0.716204 0.719514 0.722831;
chris@168 160 #A 1000 0.726156 0.729488 0.732829 0.736176 0.739532 0.742895 0.746266
chris@168 161 0.749644 0.75303 0.756423 0.759824 0.763233 0.76665 0.770074 0.773506
chris@168 162 0.776945 0.780392 0.783846 0.787309 0.790778 0.794256 0.797741 0.801234
chris@168 163 0.804734;
chris@168 164 #X coords 0 1 1023 -1 200 200 1 0 0;
chris@168 165 #X restore 230 34 graph;
chris@168 166 #X obj 25 27 inlet~;
chris@168 167 #X obj 25 49 clip~ -1 1;
chris@168 168 #X obj 25 71 *~ 512;
chris@168 169 #X obj 25 93 +~ 512;
chris@168 170 #X obj 25 115 tabread4~ \$0-xfer;
chris@168 171 #X obj 25 137 outlet~;
chris@168 172 #N canvas 0 22 334 332 generate-xfer 0;
chris@168 173 #X obj 8 290 tabwrite \$0-xfer;
chris@168 174 #X obj 8 109 / 1024;
chris@168 175 #X obj 8 129 * 2;
chris@168 176 #X obj 8 149 - 1;
chris@168 177 #X obj 8 169 moses 0;
chris@168 178 #X obj 8 191 + 0.1;
chris@168 179 #X obj 8 213 clip -1 0;
chris@168 180 #X obj 68 191 - 0.1;
chris@168 181 #X obj 68 213 clip 0 1;
chris@168 182 #X obj 101 16 inlet threshold;
chris@168 183 #X obj 101 78 count 1024;
chris@168 184 #X obj 128 58 s \$0-thresh;
chris@168 185 #X obj 95 169 r \$0-thresh;
chris@168 186 #X obj 101 38 t b f;
chris@168 187 #X obj 68 236 *;
chris@168 188 #X obj 8 236 *;
chris@168 189 #X obj 8 258 * -1;
chris@168 190 #X text 140 203 <<< deadzone;
chris@168 191 #X text 140 253 <<< smooth by taking exponent;
chris@168 192 #X connect 1 0 2 0;
chris@168 193 #X connect 2 0 3 0;
chris@168 194 #X connect 3 0 4 0;
chris@168 195 #X connect 4 0 5 0;
chris@168 196 #X connect 4 1 7 0;
chris@168 197 #X connect 5 0 6 0;
chris@168 198 #X connect 6 0 15 0;
chris@168 199 #X connect 6 0 15 1;
chris@168 200 #X connect 7 0 8 0;
chris@168 201 #X connect 8 0 14 0;
chris@168 202 #X connect 8 0 14 1;
chris@168 203 #X connect 9 0 13 0;
chris@168 204 #X connect 10 0 0 1;
chris@168 205 #X connect 10 0 1 0;
chris@168 206 #X connect 12 0 5 1;
chris@168 207 #X connect 12 0 7 1;
chris@168 208 #X connect 13 0 10 0;
chris@168 209 #X connect 13 1 11 0;
chris@168 210 #X connect 14 0 0 0;
chris@168 211 #X connect 15 0 16 0;
chris@168 212 #X connect 16 0 0 0;
chris@168 213 #X restore 26 217 pd generate-xfer;
chris@168 214 #X text 58 196 <<< threshold;
chris@168 215 #X obj 26 173 loadbang;
chris@168 216 #X msg 26 195 0.1;
chris@168 217 #X connect 1 0 2 0;
chris@168 218 #X connect 2 0 3 0;
chris@168 219 #X connect 3 0 4 0;
chris@168 220 #X connect 4 0 5 0;
chris@168 221 #X connect 5 0 6 0;
chris@168 222 #X connect 9 0 10 0;
chris@168 223 #X connect 10 0 7 0;
chris@168 224 #X restore 38 137 pd gate;
chris@168 225 #X obj 38 246 adc~ 10;
chris@168 226 #X text 98 137 <<< thresholding to remove any consistent noise in the
chris@168 227 excitation signal;
chris@164 228 #X connect 6 0 7 0;
chris@164 229 #X connect 6 0 0 0;
chris@164 230 #X connect 6 0 0 1;
chris@164 231 #X connect 7 0 8 0;
chris@164 232 #X connect 8 0 9 0;
chris@164 233 #X connect 10 0 11 0;
chris@168 234 #X connect 11 0 23 0;
chris@164 235 #X connect 12 0 13 0;
chris@164 236 #X connect 14 0 15 0;
chris@164 237 #X connect 15 0 6 0;
chris@168 238 #X connect 23 0 13 0;
chris@168 239 #X connect 24 0 14 0;
chris@168 240 #X connect 24 0 14 1;