diff options
Diffstat (limited to 'tbext')
44 files changed, 3398 insertions, 0 deletions
diff --git a/tbext/bufline~.pd b/tbext/bufline~.pd new file mode 100644 index 0000000..66d35c0 --- /dev/null +++ b/tbext/bufline~.pd @@ -0,0 +1,323 @@ +#N canvas 221 141 714 505 10; +#N canvas 0 0 450 300 graph1 0; +#X array from1 1024 float 1; +#A 0 0 0 0 0 0 0 0.0285714 0.0357143 0.0428571 0.0714286 0.0857143 +0.114286 0.128571 0.142857 0.142857 0.157143 0.171429 0.185714 0.2 +0.214286 0.242857 0.242857 0.242857 0.242857 0.242857 0.214286 0.2 +0.15 0.0714286 0.0714286 1.86265e-09 -0.0142857 -0.0285714 0 0 0 0 +0 0 0 0 -0.0142857 -0.0285714 -0.0428571 -0.0571429 -0.0571429 -0.0571429 +-0.0571429 -0.0571429 -0.0571429 -0.0571429 0.00714286 0.0714286 0.142857 +0.242857 0.314286 0.457143 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.0142857 -0.0190476 +-0.0238095 -0.0285714 -0.0333333 -0.0380952 -0.0428571 -0.0476191 -0.052381 +-0.0571429 -0.0619048 -0.0666667 -0.0714286 -0.0761905 -0.0809524 -0.0857141 +-0.0884919 -0.0912697 -0.0940475 -0.0968252 -0.099603 -0.102381 -0.105159 +-0.107936 -0.110714 -0.113492 -0.11627 -0.119047 -0.121825 -0.124603 +-0.127381 -0.130159 -0.132936 -0.135714 -0.138492 -0.14127 -0.144048 +-0.146825 -0.149603 -0.152381 -0.155159 -0.157936 -0.160714 -0.163492 +-0.16627 -0.169048 -0.171825 -0.174603 -0.177381 -0.180159 -0.182937 +-0.185714 -0.189796 -0.193877 -0.197959 -0.202041 -0.206122 -0.210204 +-0.214286 -0.218367 -0.222449 -0.226531 -0.230612 -0.234694 -0.238775 +-0.242857 -0.246939 -0.25102 -0.255102 -0.259184 -0.263265 -0.267347 +-0.271429 -0.27551 -0.279592 -0.283673 -0.287755 -0.291837 -0.295918 +-0.3 -0.304082 -0.308163 -0.312245 -0.316327 -0.320408 -0.32449 -0.328571 +-0.330494 -0.332417 -0.33434 -0.336263 -0.338186 -0.34011 -0.342033 +-0.343956 -0.345879 -0.347802 -0.349725 -0.351648 -0.353571 -0.355494 +-0.357417 -0.35934 -0.361263 -0.363187 -0.36511 -0.367033 -0.368956 +-0.370879 -0.372802 -0.374725 -0.376648 -0.378571 -0.380494 -0.382417 +-0.38434 -0.386264 -0.388187 -0.39011 -0.392033 -0.393956 -0.395879 +-0.397802 -0.399725 -0.401648 -0.403571 -0.405494 -0.407418 -0.409341 +-0.411264 -0.413187 -0.41511 -0.417033 -0.418956 -0.420879 -0.422802 +-0.424725 -0.426648 -0.428572 -0.432056 -0.435541 -0.439025 -0.442509 +-0.445993 -0.449478 -0.452962 -0.456446 -0.459931 -0.463415 -0.466899 +-0.470384 -0.473868 -0.477352 -0.480837 -0.484321 -0.487805 -0.491289 +-0.494774 -0.498258 -0.501742 -0.505227 -0.508711 -0.512195 -0.51568 +-0.519164 -0.522648 -0.526133 -0.529617 -0.533101 -0.536586 -0.54007 +-0.543554 -0.547038 -0.550523 -0.554007 -0.557491 -0.560976 -0.56446 +-0.567944 -0.571429 -0.573669 -0.57591 -0.578151 -0.580392 -0.582633 +-0.584874 -0.587115 -0.589356 -0.591597 -0.593838 -0.596078 -0.598319 +-0.60056 -0.602801 -0.605042 -0.607283 -0.609524 -0.611765 -0.614006 +-0.616247 -0.618487 -0.620728 -0.622969 -0.62521 -0.627451 -0.629692 +-0.631933 -0.634174 -0.636415 -0.638655 -0.640896 -0.643137 -0.645378 +-0.647619 -0.64986 -0.652101 -0.654342 -0.656583 -0.658824 -0.661064 +-0.663305 -0.665546 -0.667787 -0.670028 -0.672269 -0.67451 -0.676751 +-0.678992 -0.681233 -0.683473 -0.685714 -0.687143 -0.688571 -0.69 -0.691428 +-0.692857 -0.694286 -0.695714 -0.697143 -0.698571 -0.7 -0.702286 -0.704571 +-0.706857 -0.709143 -0.711429 -0.713714 -0.716 -0.718286 -0.720571 +-0.722857 -0.725143 -0.727429 -0.729714 -0.732 -0.734286 -0.736571 +-0.738857 -0.741143 -0.743429 -0.745714 -0.748 -0.750286 -0.752571 +-0.754857 -0.757143 -0.757143 -0.757143 -0.757143 -0.757143 -0.757143 +-0.757143 -0.758571 -0.76 -0.761428 -0.762857 -0.764286 -0.765714 -0.767143 +-0.768571 -0.77 -0.771429 -0.771429 -0.771429 -0.771429 -0.771429 -0.771429 +-0.774286 -0.777143 -0.78 -0.782857 -0.8 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 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 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 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 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 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; +#A 1000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0; +#X coords 0 1 1023 -1 200 140 1; +#X restore 80 20 graph; +#N canvas 0 0 450 300 graph1 0; +#X array from2 1024 float 1; +#A 0 0 0 0 0 0 0 0 0 0 0.0285714 0.0571429 0.0761905 0.0952381 0.114286 +0.12381 0.133333 0.142857 0.2 0.207143 0.228571 0.228571 0.257143 0.257143 +0.257143 0.242857 -0.0142857 0 0 0 0 0 0 0 0 0 -0.471429 -0.628572 +-0.685714 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 1.86265e-10 0.00428571 0.00857143 0.0128571 +0.0171429 0.0214286 0.0257143 0.03 0.0342857 0.0385714 0.0428572 0.0457143 +0.0485715 0.0514286 0.0542857 0.0571429 0.06 0.0628572 0.0657143 0.0685714 +0.0714286 0.0742857 0.0771429 0.08 0.0828571 0.0857144 0.0884794 0.0912443 +0.0940093 0.0967743 0.0995393 0.102304 0.105069 0.107834 0.110599 0.113364 +0.116129 0.118894 0.121659 0.124424 0.127189 0.129954 0.132719 0.135484 +0.138249 0.141014 0.143779 0.146544 0.149309 0.152074 0.154839 0.157604 +0.160369 0.163134 0.165899 0.168664 0.171428 0.174286 0.177143 0.18 +0.182857 0.185714 0.188571 0.191429 0.194286 0.197143 0.2 0.202857 +0.205714 0.208571 0.211429 0.214286 0.216527 0.218768 0.221008 0.223249 +0.22549 0.227731 0.229972 0.232213 0.234454 0.236695 0.238936 0.241176 +0.243417 0.245658 0.247899 0.25014 0.252381 0.254622 0.256863 0.259104 +0.261345 0.263585 0.265826 0.268067 0.270308 0.272549 0.27479 0.277031 +0.279272 0.281513 0.283754 0.285994 0.288235 0.290476 0.292717 0.294958 +0.297199 0.29944 0.301681 0.303922 0.306162 0.308403 0.310644 0.312885 +0.315126 0.317367 0.319608 0.321849 0.32409 0.326331 0.328571 0.330952 +0.333333 0.335714 0.338095 0.340476 0.342857 0.345238 0.347619 0.35 +0.352381 0.354762 0.357143 0.359523 0.361904 0.364285 0.366666 0.369047 +0.371428 0.373809 0.37619 0.378571 0.380952 0.383333 0.385714 0.388095 +0.390476 0.392857 0.395238 0.397619 0.4 0.402381 0.404762 0.407143 +0.409524 0.411905 0.414286 0.416484 0.418681 0.420879 0.423077 0.425275 +0.427473 0.42967 0.431868 0.434066 0.436264 0.438462 0.440659 0.442857 +0.445055 0.447253 0.449451 0.451648 0.453846 0.456044 0.458242 0.46044 +0.462637 0.464835 0.467033 0.469231 0.471429 0.472 0.472571 0.473143 +0.473714 0.474286 0.474857 0.475429 0.476 0.476571 0.477143 0.477714 +0.478286 0.478857 0.479429 0.48 0.480571 0.481143 0.481714 0.482286 +0.482857 0.483429 0.484 0.484571 0.485143 0.485715 0.486412 0.487108 +0.487805 0.488502 0.489199 0.489896 0.490593 0.49129 0.491987 0.492683 +0.49338 0.494077 0.494774 0.495471 0.496168 0.496865 0.497562 0.498258 +0.498955 0.499652 0.500349 0.501046 0.501743 0.502439 0.503136 0.503833 +0.50453 0.505227 0.505924 0.506621 0.507317 0.508014 0.508711 0.509408 +0.510105 0.510802 0.511498 0.512195 0.512892 0.513589 0.514287 0.515385 +0.516484 0.517583 0.518682 0.519781 0.52088 0.521979 0.523077 0.524176 +0.525275 0.526374 0.527473 0.528572 0.529671 0.53077 0.531868 0.532967 +0.534066 0.535165 0.536264 0.537363 0.538462 0.539561 0.540659 0.541758 +0.542857 0.544 0.545143 0.546286 0.547429 0.548571 0.549714 0.550857 +0.552 0.553143 0.554286 0.555429 0.556571 0.557714 0.558857 0.56 0.561143 +0.562286 0.563429 0.564571 0.565714 0.566857 0.568 0.569143 0.570286 +0.571429 0.571429 0.571429 0.571429 0.571429 0.571429 0.571429 0.571429 +0.571429 0.571429 0.571429 0.571429 0.571429 0.571429 0.571429 0.571429 +0.571428 0.570476 0.569524 0.568571 0.567619 0.566666 0.565714 0.564762 +0.563809 0.562857 0.561905 0.560952 0.56 0.559048 0.558095 0.557143 +0.555714 0.554286 0.552857 0.551429 0.55 0.548571 0.547143 0.545714 +0.544286 0.542857 0.54 0.537143 0.534286 0.531429 0.528571 0.525714 +0.522857 0.52 0.517143 0.514286 0.511429 0.508571 0.505714 0.502857 +0.5 0.498701 0.497403 0.496104 0.494805 0.493506 0.492208 0.490909 +0.48961 0.488312 0.487013 0.485714 0.483429 0.481143 0.478857 0.476572 +0.474286 0.472 0.469714 0.467429 0.465143 0.462857 0.460571 0.458286 +0.456 0.453714 0.451429 0.449143 0.446857 0.444571 0.442286 0.44 0.437714 +0.435429 0.433143 0.430857 0.428571 0.425893 0.423214 0.420536 0.417857 +0.415179 0.4125 0.409821 0.407143 0.404464 0.401786 0.399107 0.396429 +0.39375 0.391071 0.388393 0.385714 0.382143 0.378571 0.375 0.371428 +0.367857 0.364286 0.360714 0.357143 0.353571 0.35 0.346428 0.342857 +0.339286 0.335714 0.332143 0.328571 0.325 0.321429 0.317857 0.314286 +0.31 0.305714 0.301429 0.297143 0.292857 0.288571 0.284286 0.28 0.275714 +0.271429 0.270046 0.268664 0.267281 0.265899 0.264516 0.263134 0.261751 +0.260369 0.258986 0.257604 0.256221 0.254839 0.253456 0.252074 0.250691 +0.249309 0.247926 0.246544 0.245161 0.243779 0.242396 0.241014 0.239631 +0.238249 0.236866 0.235484 0.234101 0.232719 0.231336 0.229954 0.228572 +0.225714 0.222857 0.22 0.217143 0.214286 0.211429 0.208571 0.205714 +0.202857 0.2 0.197143 0.194286 0.191429 0.188571 0.185714 0.177143 +0.168571 0.16 0.151429 0.142857 0.141558 0.14026 0.138961 0.137662 +0.136364 0.135065 0.133766 0.132468 0.131169 0.12987 0.128571 0.128571 +0.128571 0.128571 0.128571 0.128571 0.125714 0.122857 0.12 0.117143 +0.1 0.1 0.1 0.1 0.1 0.1 0.0914286 0.0828571 0.0742857 0.0657143 0.0571428 +0.0542857 0.0514286 0.0485714 0.0457143 0.0285714 0.0285714 0.0285714 +0.0285714 0.0285714 0.0285714 0.0285714 0.0285714 0.0285714 0.0285714 +0.0285714 0.0285714 0.0285714 0.0285714 0.0285714 0.0285714 0.0285714 +0.0285714 0.0285714 0.0285714 0.0285714 0.0285714 0.0285714 0.0285714 +0.0285714 0.0285714 0.0285714 0.0257143 0.0228571 0.02 0.0171429 0.0142857 +0.0114286 0.00857142 0.00571428 0.00285714 -5.58794e-09 -5.58794e-09 +-5.58794e-09 -5.58794e-09 -5.58794e-09 -5.58794e-09 -5.58794e-09 -5.58794e-09 +-5.58794e-09 -5.58794e-09 -5.58794e-09 -5.58794e-09 -5.58794e-09 -5.58794e-09 +-5.58794e-09 -5.58794e-09 0.563636 0.562338 0.561039 0.55974 0.558442 +0.557143 0.555429 0.553714 0.552 0.550286 0.548571 0.546857 0.545143 +0.543429 0.541714 0.54 0.538286 0.536571 0.534857 0.533143 0.531429 +0.529714 0.528 0.526286 0.524571 0.522857 0.521143 0.519429 0.517714 +0.516 0.514285 0.512857 0.511428 0.51 0.508571 0.507143 0.505714 0.504286 +0.502857 0.501429 0.5 0.497222 0.494445 0.491667 0.488889 0.486111 +0.483334 0.480556 0.477778 0.475 0.472222 0.469445 0.466667 0.463889 +0.461111 0.458333 0.455556 0.452778 0.45 0.447222 0.444445 0.441667 +0.438889 0.436111 0.433333 0.430556 0.427778 0.425 0.422222 0.419444 +0.416667 0.413889 0.411111 0.408333 0.405556 0.402778 0.4 0.398352 +0.396704 0.395055 0.393407 0.391759 0.39011 0.388462 0.386813 0.385165 +0.383517 0.381868 0.38022 0.378572 0.376923 0.375275 0.373626 0.371978 +0.37033 0.368681 0.367033 0.365385 0.363736 0.362088 0.36044 0.358791 +0.357143 0.354286 0.351429 0.348571 0.345714 0.342857 0.34 0.337143 +0.334286 0.331429 0.328571 0.325714 0.322857 0.32 0.317143 0.314286 +0.308571 0.302857 0.297143 0.291429 0.285714 0.282857 0.28 0.277143 +0.274286 0.271429 0.268571 0.265714 0.262857 0.26 0.242857 0.240476 +0.238095 0.235714 0.233333 0.230952 0.214286 0.214286 0.214286 0.214286 +0.214286 0.214286 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 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; +#A 1000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0; +#X coords 0 1 1023 -1 200 140 1; +#X restore 335 23 graph; +#N canvas 0 0 450 300 graph1 0; +#X array to 1024 float 1; +#A 0 0 0 0 0 0 0 1.39698e-08 -1.33878e-09 -1.57743e-08 0.0285713 0.0571426 +0.0761908 0.095238 0.114286 0.12381 0.133332 0.142856 0.2 0.207142 +0.228571 0.228571 0.257142 0.257142 0.257142 0.242857 -0.0142856 -9.49949e-08 +3.05008e-08 -2.67755e-09 -2.67755e-09 -1.8735e-15 -6.98492e-09 -1.39698e-08 +0 0 -0.471429 -0.628572 -0.685714 0 0 0 -6.98492e-09 -1.39698e-08 1.57743e-08 +-4.42378e-08 -4.42378e-08 -4.42378e-08 -4.42378e-08 -4.42378e-08 -4.42378e-08 +-4.42378e-08 4.64206e-09 -2.67755e-09 -5.51809e-08 -2.07219e-07 2.25846e-07 +3.8743e-07 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 -9.28412e-09 -1.87138e-08 -1.97324e-08 +-2.52039e-08 -1.04774e-08 -3.05008e-08 1.18162e-08 -2.88128e-08 3.52156e-08 +-4.79631e-08 5.58794e-08 -1.38534e-08 0.00428565 0.00857141 0.0128571 +0.0171429 0.0214285 0.0257142 0.03 0.0342858 0.0385715 0.0428572 0.0457143 +0.0485715 0.0514285 0.0542857 0.0571429 0.0600001 0.0628572 0.0657144 +0.0685714 0.0714285 0.0742857 0.0771428 0.08 0.0828572 0.0857145 0.0884794 +0.0912442 0.0940094 0.0967743 0.0995392 0.102304 0.105069 0.107834 +0.110599 0.113364 0.116129 0.118894 0.121659 0.124424 0.127189 0.129954 +0.132719 0.135484 0.138249 0.141014 0.143779 0.146544 0.149309 0.152074 +0.154839 0.157604 0.160369 0.163134 0.165898 0.168663 0.171428 0.174285 +0.177143 0.18 0.182857 0.185714 0.188571 0.191429 0.194286 0.197143 +0.2 0.202857 0.205714 0.208571 0.211429 0.214286 0.216527 0.218767 +0.221008 0.22325 0.22549 0.227731 0.229972 0.232213 0.234454 0.236695 +0.238935 0.241176 0.243417 0.245658 0.247899 0.25014 0.252381 0.254622 +0.256863 0.259104 0.261344 0.263586 0.265826 0.268068 0.270308 0.272549 +0.27479 0.277031 0.279272 0.281512 0.283754 0.285994 0.288236 0.290476 +0.292717 0.294958 0.297199 0.299439 0.301681 0.303921 0.306163 0.308403 +0.310644 0.312885 0.315126 0.317367 0.319608 0.321849 0.32409 0.32633 +0.328571 0.330952 0.333333 0.335714 0.338095 0.340476 0.342856 0.345238 +0.347618 0.35 0.352381 0.354761 0.357143 0.359523 0.361905 0.364286 +0.366666 0.369048 0.371428 0.373809 0.376191 0.378571 0.380952 0.383333 +0.385714 0.388095 0.390476 0.392857 0.395238 0.397619 0.4 0.40238 0.404762 +0.407142 0.409524 0.411905 0.414285 0.416484 0.418681 0.420879 0.423077 +0.425274 0.427472 0.429671 0.431868 0.434066 0.436263 0.438461 0.440659 +0.442857 0.445055 0.447253 0.44945 0.451648 0.453846 0.456044 0.458242 +0.46044 0.462637 0.464835 0.467033 0.469231 0.471429 0.472 0.472572 +0.473143 0.473715 0.474285 0.474858 0.475429 0.476 0.476571 0.477143 +0.477714 0.478286 0.478857 0.479429 0.48 0.480572 0.481143 0.481715 +0.482286 0.482857 0.483428 0.484001 0.484572 0.485143 0.485714 0.486412 +0.487109 0.487806 0.488502 0.489199 0.489896 0.490593 0.49129 0.491986 +0.492683 0.49338 0.494078 0.494774 0.495471 0.496167 0.496864 0.497562 +0.498259 0.498955 0.499652 0.500349 0.501046 0.501742 0.50244 0.503137 +0.503833 0.50453 0.505227 0.505924 0.506621 0.507317 0.508015 0.508712 +0.509407 0.510105 0.510801 0.511498 0.512196 0.512892 0.513588 0.514287 +0.515385 0.516484 0.517584 0.518682 0.519781 0.52088 0.521979 0.523078 +0.524176 0.525276 0.526374 0.527473 0.528571 0.529671 0.530769 0.531869 +0.532967 0.534066 0.535165 0.536263 0.537363 0.538462 0.539561 0.54066 +0.541759 0.542858 0.544 0.545143 0.546286 0.547428 0.548572 0.549715 +0.550857 0.552 0.553143 0.554286 0.555429 0.556571 0.557715 0.558857 +0.56 0.561143 0.562286 0.563429 0.564571 0.565715 0.566857 0.568 0.569144 +0.570285 0.571429 0.571429 0.571429 0.571429 0.571429 0.571429 0.571429 +0.571429 0.571429 0.571429 0.571429 0.571429 0.571429 0.571429 0.571429 +0.571429 0.571428 0.570476 0.569524 0.568571 0.567619 0.566667 0.565714 +0.564761 0.563809 0.562857 0.561905 0.560952 0.56 0.559047 0.558095 +0.557143 0.555714 0.554286 0.552857 0.551429 0.55 0.548572 0.547143 +0.545715 0.544285 0.542857 0.54 0.537143 0.534286 0.531428 0.528572 +0.525714 0.522857 0.519999 0.517143 0.514286 0.511428 0.508572 0.505714 +0.502858 0.5 0.498701 0.497403 0.496104 0.494805 0.493507 0.492207 +0.490908 0.489611 0.488311 0.487013 0.485715 0.483429 0.481143 0.478857 +0.476571 0.474286 0.472 0.469715 0.467429 0.465142 0.462857 0.460571 +0.458286 0.456001 0.453714 0.451428 0.449143 0.446857 0.444572 0.442286 +0.44 0.437714 0.435428 0.433143 0.430858 0.428572 0.425893 0.423214 +0.420535 0.417857 0.415179 0.4125 0.409822 0.407143 0.404464 0.401785 +0.399107 0.396429 0.39375 0.391071 0.388392 0.385715 0.382142 0.378571 +0.375 0.371428 0.367857 0.364285 0.360714 0.357143 0.353572 0.35 0.346429 +0.342857 0.339286 0.335714 0.332143 0.328571 0.325 0.321428 0.317857 +0.314286 0.31 0.305714 0.301429 0.297143 0.292857 0.288572 0.284286 +0.28 0.275715 0.271428 0.270046 0.268664 0.267281 0.265899 0.264516 +0.263133 0.261751 0.260369 0.258986 0.257604 0.256221 0.254838 0.253456 +0.252074 0.250691 0.249308 0.247926 0.246544 0.245161 0.243779 0.242396 +0.241013 0.239632 0.238249 0.236866 0.235484 0.234101 0.232719 0.231337 +0.229954 0.228571 0.225714 0.222857 0.22 0.217143 0.214286 0.211429 +0.208572 0.205714 0.202857 0.2 0.197143 0.194286 0.191428 0.188571 +0.185714 0.177143 0.168571 0.16 0.151428 0.142857 0.141558 0.14026 +0.138961 0.137662 0.136364 0.135065 0.133766 0.132467 0.131169 0.12987 +0.128571 0.128571 0.128571 0.128571 0.128571 0.128571 0.125714 0.122857 +0.12 0.117143 0.1 0.1 0.1 0.1 0.1 0.1 0.0914285 0.0828572 0.0742856 +0.0657142 0.0571428 0.0542856 0.0514286 0.0485714 0.0457143 0.0285714 +0.0285714 0.0285714 0.0285714 0.0285714 0.0285714 0.0285714 0.0285714 +0.0285714 0.0285714 0.0285714 0.0285714 0.0285714 0.0285714 0.0285714 +0.0285714 0.0285714 0.0285714 0.0285714 0.0285714 0.0285714 0.0285714 +0.0285714 0.0285714 0.0285714 0.0285714 0.0285714 0.0257143 0.0228571 +0.02 0.0171428 0.0142857 0.0114286 0.00857142 0.00571428 0.00285713 +-5.58793e-09 -5.58793e-09 -5.58793e-09 -5.58793e-09 -5.58793e-09 -5.58793e-09 +-5.58793e-09 -5.58793e-09 -5.58793e-09 -5.58793e-09 -5.58793e-09 -5.58793e-09 +-5.58793e-09 -5.58793e-09 -5.58793e-09 -5.58793e-09 0.563637 0.562338 +0.561039 0.559741 0.558441 0.557143 0.555429 0.553714 0.552 0.550286 +0.548572 0.546857 0.545143 0.543428 0.541715 0.54 0.538286 0.536572 +0.534857 0.533143 0.531428 0.529714 0.528001 0.526286 0.524572 0.522857 +0.521143 0.519428 0.517714 0.516 0.514285 0.512857 0.511428 0.51 0.508572 +0.507142 0.505714 0.504286 0.502858 0.501428 0.5 0.497223 0.494444 +0.491667 0.488889 0.486112 0.483333 0.480556 0.477778 0.475001 0.472222 +0.469445 0.466667 0.463889 0.461111 0.458334 0.455555 0.452778 0.45 +0.447223 0.444444 0.441667 0.438889 0.436112 0.433333 0.430556 0.427778 +0.425001 0.422222 0.419445 0.416667 0.413888 0.411111 0.408333 0.405556 +0.402777 0.4 0.398352 0.396703 0.395056 0.393407 0.391759 0.39011 0.388462 +0.386814 0.385165 0.383517 0.381868 0.38022 0.378572 0.376923 0.375275 +0.373626 0.371978 0.370329 0.368682 0.367033 0.365385 0.363736 0.362088 +0.36044 0.358792 0.357143 0.354286 0.351428 0.348572 0.345714 0.342857 +0.34 0.337143 0.334286 0.331429 0.328571 0.325714 0.322857 0.32 0.317143 +0.314286 0.308571 0.302857 0.297143 0.291429 0.285714 0.282857 0.28 +0.277143 0.274286 0.271428 0.268571 0.265714 0.262857 0.26 0.242857 +0.240476 0.238095 0.235715 0.233333 0.230953 0.214286 0.214286 0.214286 +0.214286 0.214286 0.214286 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 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; +#A 1000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0; +#X coords 0 1 1023 -1 200 140 1; +#X restore 456 301 graph; +#X obj 144 412 tabwrite~ to; +#X obj 208 373 metro 50; +#X obj 208 349 loadbang; +#X obj 83 280 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X msg 212 269 set from1; +#X msg 212 292 set from2; +#X msg 133 271 line 5000; +#X obj 63 385 print~; +#X obj 26 332 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X msg 119 239 line 400; +#X obj 88 321 bufline~ 1024; +#X obj 607 14 block~ 2048; +#X obj 341 332 delay; +#X obj 341 355 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X msg 338 287 5000; +#X connect 4 0 3 0; +#X connect 5 0 4 0; +#X connect 6 0 13 0; +#X connect 6 0 17 0; +#X connect 7 0 13 0; +#X connect 8 0 13 0; +#X connect 9 0 13 0; +#X connect 11 0 10 0; +#X connect 12 0 13 0; +#X connect 13 0 10 0; +#X connect 13 0 3 0; +#X connect 15 0 16 0; +#X connect 17 0 15 0; diff --git a/tbext/build-max-msvc.bat b/tbext/build-max-msvc.bat new file mode 100644 index 0000000..130a3bc --- /dev/null +++ b/tbext/build-max-msvc.bat @@ -0,0 +1,4 @@ +@echo --- Building with MS Visual C++ --- + +nmake -f makefile.max-msvc clean +nmake -f makefile.max-msvc diff --git a/tbext/build-pd-bcc.bat b/tbext/build-pd-bcc.bat new file mode 100644 index 0000000..3dd2132 --- /dev/null +++ b/tbext/build-pd-bcc.bat @@ -0,0 +1,3 @@ +@echo --- Building with BorlandC++ --- + +make -f makefile.pd-bcc diff --git a/tbext/build-pd-cygwin.sh b/tbext/build-pd-cygwin.sh new file mode 100644 index 0000000..9477844 --- /dev/null +++ b/tbext/build-pd-cygwin.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +SYS=pd-cygwin + +. config-${SYS}.txt + +make -f makefile.${SYS} && +{ + if [ $INSTDIR != "" ]; then + make -f makefile.${SYS} install + fi + if [ $HELPDIR != "" ]; then + make -f makefile.${SYS} install-help + fi +} diff --git a/tbext/build-pd-darwin.sh b/tbext/build-pd-darwin.sh new file mode 100755 index 0000000..38814a9 --- /dev/null +++ b/tbext/build-pd-darwin.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +SYS=pd-darwin + +. config-${SYS}.txt + +make -f makefile.${SYS} && +{ + if [ $INSTDIR != "" ]; then + echo Now install as root + sudo make -f makefile.${SYS} install + fi + if [ $HELPDIR != "" ]; then + echo Now install help as root + sudo make -f makefile.${SYS} install-help + fi +} diff --git a/tbext/build-pd-linux.sh b/tbext/build-pd-linux.sh new file mode 100755 index 0000000..77c6e3f --- /dev/null +++ b/tbext/build-pd-linux.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +SYS=pd-linux + +. config-${SYS}.txt + +make -f makefile.${SYS} && +{ + if [ $INSTDIR != "" ]; then + echo Now install as root + su -c "make -f makefile.${SYS} install" + fi + if [ $HELPDIR != "" ]; then + echo Now install help as root + su -c "make -f makefile.${SYS} install-help" + fi +} diff --git a/tbext/build-pd-mingw.bat b/tbext/build-pd-mingw.bat new file mode 100644 index 0000000..fa8919a --- /dev/null +++ b/tbext/build-pd-mingw.bat @@ -0,0 +1,3 @@ +mingw32-make -f makefile.pd-mingw +mingw32-make -f makefile.pd-mingw install +mingw32-make -f makefile.pd-mingw install-help diff --git a/tbext/build-pd-msvc.bat b/tbext/build-pd-msvc.bat new file mode 100644 index 0000000..d6187f0 --- /dev/null +++ b/tbext/build-pd-msvc.bat @@ -0,0 +1,4 @@ +@echo --- Building with MS Visual C++ --- + +nmake -f makefile.pd-msvc clean +nmake -f makefile.pd-msvc diff --git a/tbext/config-max-msvc.txt b/tbext/config-max-msvc.txt new file mode 100644 index 0000000..e2a0477 --- /dev/null +++ b/tbext/config-max-msvc.txt @@ -0,0 +1,27 @@ +# config file for tbext, adapted from Thomas Grill's xsample makefile +# + +# where is the Max SDK? +# you should have the latest version! +MAXSDKPATH="F:\prog\audio\MaxWinSDK\c74support" + +# where do the flext libraries reside? +FLEXTPATH="%CommonProgramFiles%\Cycling '74\flext" + +# where is MS VC++? +# (need not be defined if the build is started with the compiler environment set) +# MSVCPATH="c:\programme\prog\microsoft visual studio\VC98" + + +# where should the external be built? +# (path for temporary files) +OUTPATH=max-msvc + +# where should the external be installed? +# (leave blank to omit installation) +INSTPATH="%CommonProgramFiles%\Cycling '74\externals\flext" + + +# some user-definable flags +# (check if they match your system!) +UFLAGS=/G6 /arch:SSE diff --git a/tbext/config-pd-bcc.txt b/tbext/config-pd-bcc.txt new file mode 100644 index 0000000..3b9eb52 --- /dev/null +++ b/tbext/config-pd-bcc.txt @@ -0,0 +1,23 @@ +# config file for tbext, adapted from Thomas Grill's xsample makefile +# + +# where is PD? +PDPATH=c:\programme\audio\pd + +# where do the flext libraries reside? +FLEXTPATH=$(PDPATH)\flext + +# where is BorlandC++? +BCCPATH=c:\programme\prog\bcc55 + +# where should the external(s) be built? +OUTPATH=.\pd-bcc + +# should the external be installed? (yes/no) +INSTALL=yes + +# where should the external be installed? +INSTDIR=$(PDPATH)\extra + +# additional compiler flags +UFLAGS=-6 -O2 -OS -ff diff --git a/tbext/config-pd-cygwin.txt b/tbext/config-pd-cygwin.txt new file mode 100644 index 0000000..17af1b9 --- /dev/null +++ b/tbext/config-pd-cygwin.txt @@ -0,0 +1,35 @@ +# config file for tbext, adapted from Thomas Grill's xsample makefile +# + +# your c++ compiler (define only if it's different than g++) +# CXX=g++ + +# where does the PD installation reside? +PD=/cygdrive/c/programme/audio/pd + +# where are the PD header files? +# leave it blank if it is a system directory (like /usr/local/include), +# since gcc 3.2 complains about it +PDINC=${PD}/src + +# where do the flext libraries reside? +FLEXTPATH=${PD}/flext + +# where should tbext objects be built? +TARGDIR=./pd-cygwin + +# where should tbext be installed? +# (leave blank to omit installation) +INSTDIR=${PD}/extra + +# where should the tbext help be installed? +# (leave blank to omit installation) +HELPDIR=${PD}/doc/5.reference + +# additional compiler flags +# (check whether they fit to your system!) +UFLAGS=-mcpu=pentium4 -msse -mfpmath=sse # gcc 3.2 +# UFLAGS=-mcpu=pentiumpro # gcc 2.95 + +# define to build with shared flext library +#FLEXT_SHARED=1 diff --git a/tbext/config-pd-darwin.txt b/tbext/config-pd-darwin.txt new file mode 100644 index 0000000..2a5441f --- /dev/null +++ b/tbext/config-pd-darwin.txt @@ -0,0 +1,35 @@ +# config file for tbext, adapted from Thomas Grill's xsample makefile +# + +# your c++ compiler (if not g++) +#CXX=g++-3.3 + +# where does the PD installation reside? +PD=/usr/local/lib/pd + +# where are the PD header files? +# leave it blank if it is a system directory (like /usr/local/include), +# since gcc 3.2 complains about it +PDINC=${PD}/src + +# where is the PD executable? +PDBIN=/usr/local/bin/pd + +# where do the flext libraries reside? +FLEXTPATH=${PD}/flext + +# where should the tbext objects be built? +TARGDIR=./pd-darwin + +# where should tbext be installed? +# (leave blank to omit installation) +INSTDIR=${PD}/extra + +# where should the tbext help be installed? +# (leave blank to omit installation) +HELPDIR=${PD}/doc/5.reference + +# additional compiler flags +# (check whether they fit your system!) +UFLAGS=-malign-power -maltivec -faltivec + diff --git a/tbext/config-pd-linux.txt b/tbext/config-pd-linux.txt new file mode 100644 index 0000000..48f327a --- /dev/null +++ b/tbext/config-pd-linux.txt @@ -0,0 +1,37 @@ +# config file for tbext, adapted from Thomas Grill's xsample makefile + +# your c++ compiler (if not g++) + CXX=icc + + +# where does the PD installation reside? +PD=/usr/lib/pd + +# where are the PD header files? +# leave it blank if it is a system directory (like /usr/local/include), +# since gcc 3.2 complains about it +PDINC=/home/tim/pd/pd-0.37-1test3/src +#PDINC=/home/tim/pd/devel_0_36/pd/src + +# where do the flext libraries reside? +FLEXTPATH=/usr/lib/flext + +# where should tbext objects be built? +TARGDIR=./pd-linux + +# where should tbext be installed? +# (leave blank to omit installation) +INSTDIR=${PD}/externs + +# where should the tbext help be installed? +# (leave blank to omit installation) +HELPDIR=${PD}/doc/5.reference + +# additional compiler flags +# (check whether they fit to your system!) +UFLAGS=-xN -tpp7 -ip -ipo_obj # icc +# UFLAGS=-mcpu=pentium4 -mmmx -msse2 -msse -mfpmath=sse # gcc 3.2 + +# define to link against shared flext library (flext version >= 0.5.0) +FLEXT_SHARED=1 + diff --git a/tbext/config-pd-mingw.txt b/tbext/config-pd-mingw.txt new file mode 100644 index 0000000..cbe445c --- /dev/null +++ b/tbext/config-pd-mingw.txt @@ -0,0 +1,35 @@ +# config file for tbext, adapted from Thomas Grill's xsample makefile +# + +# your c++ compiler (define only if it's different than g++) +# CXX=g++ + +# where does the PD installation reside? +PD=c:/programme/audio/pd + +# where are the PD header files? +# leave it blank if it is a system directory (like /usr/local/include), +# since gcc 3.2 complains about it +PDINC=${PD}/src + +# where do the flext libraries reside? +FLEXTPATH=${PD}/flext + +# where should tbext objects be built? +TARGDIR=./pd-mingw + +# where should tbext be installed? +# (leave blank to omit installation) +INSTDIR=${PD}/extra + +# where should the tbext help be installed? +# (leave blank to omit installation) +HELPDIR=${PD}/doc/5.reference + +# additional compiler flags +# (check whether they fit to your system!) +UFLAGS=-mcpu=pentium4 -msse -mfpmath=sse # gcc 3.2 +# UFLAGS=-mcpu=pentiumpro # gcc 2.95 + +# define to build with shared flext library +# FLEXT_SHARED=1
\ No newline at end of file diff --git a/tbext/config-pd-msvc.txt b/tbext/config-pd-msvc.txt new file mode 100644 index 0000000..fb48585 --- /dev/null +++ b/tbext/config-pd-msvc.txt @@ -0,0 +1,19 @@ +# config file for tbext, adapted from Thomas Grill's xsample makefile +# + +# where is PD? +PDPATH=c:\programme\audio\pd + +# where do the flext libraries reside? +FLEXTPATH=$(PDPATH)\flext + +# where is MS VC++? +# (not necessary if the build started with the compiler environment) +# MSVCPATH=c:\programme\prog\microsoft visual studio\VC98 + +# where should the external be built? +OUTPATH=pd-msvc + +# where should the external be installed? +# (leave blank to omit installation) +INSTDIR=$(PDPATH)\extra diff --git a/tbext/him.pd b/tbext/him.pd new file mode 100644 index 0000000..f287cdd --- /dev/null +++ b/tbext/him.pd @@ -0,0 +1,66 @@ +#N canvas 0 0 680 378 10; +#X obj 48 338 dac~; +#X msg 125 144 regtime \$1; +#X obj 125 122 tgl 15 1 empty empty empty 0 -6 0 8 -262144 -1 -1 1 +1; +#X obj 51 15 hsl 128 15 1e-04 1 1 0 empty empty dt -2 -6 0 8 -262144 +-1 -1 5100 0; +#X msg 48 37 dt \$1; +#X msg 80 84 e \$1; +#X obj 83 65 hsl 128 15 -1 0 0 0 empty empty etilde -2 -6 0 8 -262144 +-1 -1 7800 0; +#X floatatom 122 85 5 0 0 0 - - -; +#X floatatom 106 40 5 0 0 0 - - -; +#X msg 158 177 reset; +#X msg 179 211 state; +#X obj 48 309 him~ -0.3; +#X text 194 13 set the timesteps for the 4th order runge-kutta approximation +; +#X text 215 143 use the real or the regulated time; +#X text 218 176 randomize new values (warning! this may click!!!); +#X text 231 210 returns the state of the system; +#X text 224 66 set the etilde of the system if it's positive \, the +electron will leave the atom (if you change it during dsp computation +\, it will click); +#X text 128 308 the optional argument is the etilde of the system returns +mu \, mu velocity \, nu \, nu velocity \, x and y. Based on physical +models of an atom in a magnetic field...; +#X obj 608 207 loadbang; +#X msg 608 271 muv 1.22293; +#X msg 608 292 nu -0.065661 \;; +#X msg 607 252 mu -1.43572 \;; +#X obj 608 228 t b b; +#X msg 608 318 \; pd dsp 1; +#X obj 14 347 print~; +#X obj 14 292 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 262 236 fiddle~; +#X floatatom 263 273 5 0 0 0 - - -; +#X connect 1 0 11 0; +#X connect 2 0 1 0; +#X connect 3 0 4 0; +#X connect 3 0 8 0; +#X connect 4 0 11 0; +#X connect 5 0 11 0; +#X connect 6 0 5 0; +#X connect 6 0 7 0; +#X connect 9 0 11 0; +#X connect 10 0 11 0; +#X connect 11 0 0 0; +#X connect 11 0 24 0; +#X connect 11 0 26 0; +#X connect 11 1 0 1; +#X connect 11 2 0 0; +#X connect 11 3 0 1; +#X connect 11 4 0 0; +#X connect 11 5 0 1; +#X connect 18 0 22 0; +#X connect 19 0 11 0; +#X connect 20 0 11 0; +#X connect 21 0 11 0; +#X connect 22 0 23 0; +#X connect 22 1 21 0; +#X connect 22 1 19 0; +#X connect 22 1 20 0; +#X connect 25 0 24 0; +#X connect 26 3 27 0; diff --git a/tbext/make-files.txt b/tbext/make-files.txt new file mode 100644 index 0000000..6140f01 --- /dev/null +++ b/tbext/make-files.txt @@ -0,0 +1,9 @@ +# all the source files from the package +SRCDIR = source +SRCS= \ + main.cpp tbroute.cpp tbsig~.cpp tbsroute~.cpp \ + tbpow~.cpp tbfft1.cpp tbfft2.cpp fftbuf.cpp fftgrsort.cpp \ + fftgrshuf.cpp fftgrrev.cpp him.cpp + +#HDRS= \ + main.h diff --git a/tbext/makefile.pd-cygwin b/tbext/makefile.pd-cygwin new file mode 100644 index 0000000..9b8a9f8 --- /dev/null +++ b/tbext/makefile.pd-cygwin @@ -0,0 +1,86 @@ +# makefile adapted from thomas grill's xsample makefile +# +# Makefile for gcc @ cygwin +# +# usage: +# to build run "make -f makefile.pd-cygwin" +# to install (as root), do "make -f makefile.pd-cygwin install" +# + +CONFIG=config-pd-cygwin.txt +MAKEFILE=makefile.pd-cygwin + +include ${CONFIG} + + +# compiler stuff +# /usr/include holds the cygwin pthread headers and must be first! +INCLUDES=/usr/include $(PDINC) ./headers/plugin_interface ./headers/common ./headers/server ./headers/app ./headers/lang + +FLAGS=-DFLEXT_SYS=2 +CFLAGS=-O2 -funroll-loops -fmove-all-movables -frerun-loop-opt -finline-functions -fno-rtti -fno-exceptions ${UFLAGS} + +PDLIBS=$(PD)/bin/pd.dll $(PD)/bin/pthreadVC.dll + + +ifdef FLEXT_SHARED + +CFLAGS+=-DFLEXT_SHARED +FLEXTLIB=$(FLEXTPATH)/flext.dll + +else + +FLEXTLIB=$(FLEXTPATH)/flext-pdwin.lib + +endif + + +# ---------------------------------------------- +# the rest can stay untouched +# ---------------------------------------------- + +NAME=tbext + +include make-files.txt + +TARGET=$(TARGDIR)/$(NAME).dll + +# default target +all: $(TARGDIR) $(TARGET) + +$(patsubst %,$(SRCDIR)/%,$(SRCS)): $(patsubst %,$(SRCDIR)/%,$(HDRS)) $(MAKEFILE) $(CONFIG) + touch $(patsubst %,$(SRCDIR)/%,$(SRCS)) + +$(TARGDIR): + -mkdir $(TARGDIR) + +$(TARGDIR)/%.o : $(SRCDIR)/%.cpp + $(CXX) -c $(CFLAGS) $(FLAGS) $(patsubst %,-I%,$(INCLUDES) $(FLEXTPATH)) $< -o $@ + +$(TARGET) : $(patsubst %.cpp,$(TARGDIR)/%.o,$(SRCS)) $(FLEXTLIB) + $(CXX) -shared $(LDFLAGS) $^ ${PDLIBS} $(patsubst %,-l%,$(LIBS)) -o $@ + strip --strip-unneeded $@ + chmod 755 $@ + +$(INSTDIR): + -mkdir $(INSTDIR) + +install:: $(INSTDIR) + +install:: $(TARGET) + cp $^ $(INSTDIR) +# chown root.root $(patsubst %,$(INSTDIR)/%,$(notdir $^)) + +$(HELPDIR): + -mkdir $(HELPDIR) + +install-help:: $(HELPDIR) + +install-help:: ./pd + chmod 644 $^/*.* + cp $^/*.* $(HELPDIR) + + +.PHONY: clean +clean: + rm -f $(TARGDIR)/*.o $(TARGET) diff --git a/tbext/makefile.pd-darwin b/tbext/makefile.pd-darwin new file mode 100755 index 0000000..9b6af4e --- /dev/null +++ b/tbext/makefile.pd-darwin @@ -0,0 +1,77 @@ +# makefile adapted from thomas grill's xsample makefile +# +# Makefile for gcc @ OSX (darwin) +# +# usage: +# to build run "make -f makefile.pd-darwin" +# to install (as root), do "make -f makefile.pd-darwin install" +# to install help, do "make -f makefile.pd-darwin install-help" +# + +CONFIG=config-pd-darwin.txt + +include ${CONFIG} + +FLEXTLIB=$(FLEXTPATH)/libflext.a + +# compiler stuff +INCLUDES=$(PDINC) ./headers/plugin_interface ./headers/common ./headers/server ./headers/app ./headers/lang +FLAGS=-DFLEXT_SYS=2 +CFLAGS=${UFLAGS} -dynamic -O2 -Wno-unused -Wno-parentheses -Wno-switch -Wstrict-prototypes -funroll-loops -fmove-all-movables -frerun-loop-opt -fno-rtti -fno-exceptions +LIBS=m gcc +LDFLAGS=$(FLEXTLIB) -bundle -bundle_loader $(PDBIN) +FRAMEWORKS=Carbon veclib + +# ---------------------------------------------- +# the rest can stay untouched +# ---------------------------------------------- + +NAME=tbext + +include make-files.txt + +MAKEFILE=makefile.pd-darwin +TARGET=$(TARGDIR)/$(NAME).pd_darwin + + +# default target +all: $(TARGDIR) $(TARGET) + +$(patsubst %,$(SRCDIR)/%,$(SRCS)): $(patsubst %,$(SRCDIR)/%,$(HDRS)) $(MAKEFILE) $(CONFIG) + touch $(patsubst %,$(SRCDIR)/%,$(SRCS)) + +$(TARGDIR): + -mkdir $(TARGDIR) + +$(TARGDIR)/%.o : $(SRCDIR)/%.cpp + $(CXX) -c $(CFLAGS) $(FLAGS) $(patsubst %,-I%,$(INCLUDES) $(FLEXTPATH)) $< -o $@ + +$(TARGET) : $(patsubst %.cpp,$(TARGDIR)/%.o,$(SRCS)) + $(CXX) $(LDFLAGS) $^ $(patsubst %,-framework %,$(FRAMEWORKS)) $(patsubst %,-L%,$(LIBPATH)) $(patsubst %,-l%,$(LIBS)) -o $@ + chmod 755 $@ + + +$(INSTDIR): + -mkdir $(INSTDIR) + +install:: $(INSTDIR) + +install:: $(TARGET) + cp -R $^ $(INSTDIR) +# chown -R root.root $(INSTDIR) + + +$(HELPDIR): + -mkdir $(HELPDIR) + +install-help:: $(HELPDIR) + +install-help:: ./pd + cp $^/*.* $(HELPDIR) +# chown -R root.root $(HELPDIR) + + +.PHONY: clean +clean: + rm -f $(TARGDIR)/*.o $(TARGET) + diff --git a/tbext/makefile.pd-linux b/tbext/makefile.pd-linux new file mode 100644 index 0000000..3546d99 --- /dev/null +++ b/tbext/makefile.pd-linux @@ -0,0 +1,96 @@ +# makefile adapted from thomas grill's xsample makefile +# +# Makefile for gcc @ linux +# +# usage: +# to build run "make -f makefile.pd-linux" +# to install (as root), do "make -f makefile.pd-linux install" +# + +CONFIG=config-pd-linux.txt + +include ${CONFIG} + +FLEXTLIB=$(FLEXTPATH)/flext.a + +# compiler stuff +INCLUDES=$(PDINC) +FLAGS=-DFLEXT_SYS=2 +CFLAGS=${UFLAGS} -O3 -I/home/tim/pd/externals/grill/flext/source -funroll-loops -fmove-all-movables -frerun-loop-opt -finline-functions -fno-rtti -fno-exceptions +LIBS=m + +ifdef FLEXT_SHARED +CFLAGS+=-DFLEXT_SHARED -DFLEXT_THREADS +LDFLAGS+=-Bdynamic +LINKFLEXT=-lflext #-L/usr/lib/flext/libflext.so +else +LINKFLEXT=$(FLEXTLIB) +endif + +ifdef FFTW +LDFLAGS+=-lfftw3f +CFLAGS+=-DFFTW +endif + +# ---------------------------------------------- +# the rest can stay untouched +# ---------------------------------------------- + +NAME=tbext + +include make-files.txt + +MAKEFILE=makefile.pd-linux +TARGET=$(TARGDIR)/$(NAME).pd_linux + +# default target +all: $(TARGDIR) $(TARGET) + +$(patsubst %,$(SRCDIR)/%,$(SRCS)): $(patsubst %,$(SRCDIR)/%,$(HDRS)) $(MAKEFILE) $(CONFIG) + touch $(patsubst %,$(SRCDIR)/%,$(SRCS)) + +$(TARGDIR): + -mkdir $(TARGDIR) + +$(TARGDIR)/%.o : $(SRCDIR)/%.cpp + $(CXX) -c $(CFLAGS) $(FLAGS) $(patsubst %,-I%,$(INCLUDES) $(FLEXTPATH)) $< -o $@ + +$(TARGET) : $(patsubst %.cpp,$(TARGDIR)/%.o,$(SRCS)) + $(CXX) $(LDFLAGS) -shared $^ $(patsubst %,-l%,$(LIBS)) -L$(FLEXTPATH) $(LINKFLEXT) -o $@ + strip --strip-unneeded $@ + chmod 755 $@ + +$(INSTDIR): + -mkdir $(INSTDIR) + +install:: $(INSTDIR) + +install:: $(TARGET) + cp $^ $(INSTDIR) + chown root.root $(patsubst %,$(INSTDIR)/%,$(notdir $^)) + +$(HELPDIR): + -mkdir $(HELPDIR) + +install-help:: $(HELPDIR) + +install-help:: ./pd + chmod 644 $^/*.* + cp $^/*.* $(HELPDIR) + + +.PHONY: clean +clean: + rm -f $(TARGDIR)/*.o $(TARGET) + + + + + + + + + + + + diff --git a/tbext/makefile.pd-mingw b/tbext/makefile.pd-mingw new file mode 100644 index 0000000..065930e --- /dev/null +++ b/tbext/makefile.pd-mingw @@ -0,0 +1,85 @@ +# makefile adapted from thomas grill's xsample makefile +# +# Makefile for gcc @ minGW +# +# usage: +# to build run "make -f makefile.pd-mingw" +# to install (as root), do "make -f makefile.pd-mingw install" +# + +CONFIG=config-pd-mingw.txt +MAKEFILE=makefile.pd-mingw + +include ${CONFIG} + + +# compiler stuff +INCLUDES=$(PDINC) ./headers/plugin_interface ./headers/common ./headers/server ./headers/app ./headers/lang + +FLAGS=-DFLEXT_SYS=2 +CFLAGS=-O2 -funroll-loops -fmove-all-movables -frerun-loop-opt -finline-functions -fno-rtti -fno-exceptions ${UFLAGS} + +PDLIBS=$(PD)/bin/pd.dll $(PD)/bin/pthreadVC.dll + + +ifdef FLEXT_SHARED + +CFLAGS+=-DFLEXT_SHARED +FLEXTLIB=$(FLEXTPATH)/flext.dll + +else + +FLEXTLIB=$(FLEXTPATH)/flext-pdwin.lib + +endif + + +# ---------------------------------------------- +# the rest can stay untouched +# ---------------------------------------------- + +NAME=tbext + +include make-files.txt + +TARGET=$(TARGDIR)/$(NAME).dll + +# default target +all: $(TARGDIR) $(TARGET) + +$(patsubst %,$(SRCDIR)/%,$(SRCS)): $(patsubst %,$(SRCDIR)/%,$(HDRS)) $(MAKEFILE) $(CONFIG) +# echo touch $(patsubst %,$(SRCDIR)/%,$(SRCS)) # minGW has no touch + +$(TARGDIR): + -mkdir $(TARGDIR) + +$(TARGDIR)/%.o : $(SRCDIR)/%.cpp + $(CXX) -c $(CFLAGS) $(FLAGS) $(patsubst %,-I%,$(INCLUDES) $(FLEXTPATH)) $< -o $@ + +$(TARGET) : $(patsubst %.cpp,$(TARGDIR)/%.o,$(SRCS)) $(FLEXTLIB) + $(CXX) -shared $(LDFLAGS) $^ ${PDLIBS} $(patsubst %,-l%,$(LIBS)) -o $@ + strip --strip-unneeded $@ + chmod 755 $@ + +$(INSTDIR): + -mkdir $(INSTDIR) + +install:: $(INSTDIR) + +install:: $(TARGET) + cp $^ $(INSTDIR) +# chown root.root $(patsubst %,$(INSTDIR)/%,$(notdir $^)) + +$(HELPDIR): + -mkdir $(HELPDIR) + +install-help:: $(HELPDIR) + +install-help:: ./pd + chmod 644 $^/*.* + cp $^/*.* $(HELPDIR) + + +.PHONY: clean +clean: + rm -f $(TARGDIR)/*.o $(TARGET) diff --git a/tbext/makefile.pd-msvc b/tbext/makefile.pd-msvc new file mode 100644 index 0000000..776ab09 --- /dev/null +++ b/tbext/makefile.pd-msvc @@ -0,0 +1,53 @@ +# makefile adapted from thomas grill's xsample makefile +# +# Makefile for MSVC++ 6 +# +# usage: +# to build run "make -f makefile.pd-msvc" +# + +!include config-pd-msvc.txt + +# includes +INCPATH=/I"$(MSVCPATH)\include" /I"$(PDPATH)\src" /I"$(FLEXTPATH)" /I"./headers/plugin_interface" /I"./headers/common" /I"/headers/server" /I"./headers/app" /I"./headers/lang +LIBPATH=/LIBPATH:"$(MSVCPATH)\lib" /LIBPATH:"$(PDPATH)\bin" /LIBPATH:"$(FLEXTPATH)" +LIBS=pd.lib pthreadVC.lib flext-pdwin.lib + +# compiler definitions and flags +DEFS=/DFLEXT_SYS=2 + +CFLAGS=/GR- /GX- /GD /G6 /Ox /EHsc /ML + +# the rest can stay untouched +# ---------------------------------------------- + +NAME=tbext + +!include make-files.txt + + +all: $(OUTPATH) $(OUTPATH)\$(NAME).dll + +# remove build +clean: + -del /q $(OUTPATH) > nul + -rmdir $(OUTPATH) > nul + +OBJS= $(SRCS:.cpp=.obj) + +$(OUTPATH): + -mkdir $(OUTPATH) > nul + +{$(SRCDIR)}.cpp{}.obj: + cl /c /LD $(CFLAGS) $(DEFS) $(INCPATH) $** /Fo$(OUTPATH)\$@ + +$(OUTPATH)\$(NAME).dll: $(OBJS) + cd $(OUTPATH) + link /DLL /out:$(NAME).dll /INCREMENTAL:NO $** $(LIBS) $(LIBPATH) + @-del *.exp + @-del *.lib + cd .. +!ifdef INSTPATH + @-if not exist $(INSTPATH) mkdir $(INSTPATH) + copy $@ $(INSTPATH) > nul +!endif diff --git a/tbext/reverse.pd b/tbext/reverse.pd new file mode 100644 index 0000000..34ac6d4 --- /dev/null +++ b/tbext/reverse.pd @@ -0,0 +1,49 @@ +#N canvas 245 106 453 369 10; +#N canvas 0 0 450 300 graph2 0; +#X array array1 63 float 1; +#A 0 0 0 0 0 0 0 0 0 -0.0142857 -0.0428571 -0.0714286 -0.0857143 -0.128571 +-0.214286 -0.285714 -0.357143 -0.4 -0.428571 -0.428571 -0.428571 -0.428571 +-0.428571 -0.414286 -0.414286 -0.4 -0.371429 -0.328571 -0.328571 -0.314286 +-0.3 -0.271429 -0.242857 -0.228571 -0.214286 -0.157143 -0.128571 -0.0714286 +-0.0571429 -0.0285715 0.0571428 0.1 0.128571 0.135714 0.142857 0.171429 +0.214286 0.228571 0.242857 0.271429 0.271429 0.3 0.3 -0.0571429 -0.0857143 +0.0214285 0.0285714 0.0571428 0.0714285 0.0714285 0.057143 0.0428573 +0.0428573 0; +#X coords 0 1 62 -1 200 140 1; +#X restore -67 3 graph; +#N canvas 0 0 450 300 graph3 0; +#X array array2 64 float 1; +#A 0 0 0 0 0 0 0 0 0 -0.0142857 -0.0428571 -0.0714286 -0.0857143 -0.128571 +-0.214286 -0.285714 -0.357143 -0.4 -0.428571 -0.428571 -0.428571 -0.428571 +-0.414286 -0.428571 -0.4 -0.414286 -0.328571 -0.371429 -0.314286 -0.328571 +-0.271429 -0.3 -0.228571 -0.242857 -0.157143 -0.214286 -0.0714286 -0.128571 +-0.0285715 -0.0571429 0.1 0.0571428 0.135714 0.128571 0.3 0.3 0.271429 +0.271429 0.242857 0.228571 0.214286 0.171429 0.142857 0.0714285 0.0714285 +0.057143 0.0571428 0.0428573 0.0428573 0.0285714 0.0214285 0 0 0 -0.0571429 +; +#X coords 0 1 63 -1 200 140 1; +#X restore 159 1 graph; +#X obj 30 234 tabplay~ array1; +#X obj -28 270 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 30 323 tabwrite~ array2; +#X floatatom 229 240 5 0 0 0 - - -; +#X obj -68 307 metro 50; +#X obj -81 275 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 267 183 block~ 128; +#X msg 229 259 grains \$1; +#X obj 209 291 hsl 128 15 -64 64 0 0 empty empty empty -2 -6 0 8 -262144 +-1 -1 0 1; +#X msg 206 315 offset \$1; +#X obj 29 276 fftgrrev~ 128; +#X connect 2 0 12 0; +#X connect 3 0 2 0; +#X connect 3 0 4 0; +#X connect 5 0 9 0; +#X connect 6 0 3 0; +#X connect 7 0 6 0; +#X connect 9 0 12 0; +#X connect 10 0 11 0; +#X connect 11 0 12 0; +#X connect 12 0 4 0; diff --git a/tbext/shuf.pd b/tbext/shuf.pd new file mode 100644 index 0000000..1144ffe --- /dev/null +++ b/tbext/shuf.pd @@ -0,0 +1,49 @@ +#N canvas 245 106 453 369 10; +#N canvas 0 0 450 300 graph2 0; +#X array array1 63 float 1; +#A 0 0 0 0 0 0 0 0 0 -0.0142857 -0.0428571 -0.0714286 -0.0857143 -0.128571 +-0.214286 -0.285714 -0.357143 -0.4 -0.428571 -0.428571 -0.428571 -0.428571 +-0.428571 -0.414286 -0.414286 -0.4 -0.371429 -0.328571 -0.328571 -0.314286 +-0.3 -0.271429 -0.242857 -0.228571 -0.214286 -0.157143 -0.128571 -0.0714286 +-0.0571429 -0.0285715 0.0571428 0.1 0.128571 0.135714 0.142857 0.171429 +0.214286 0.228571 0.242857 0.271429 0.271429 0.3 0.3 -0.0571429 -0.0857143 +0.0214285 0.0285714 0.0571428 0.0714285 0.0714285 0.057143 0.0428573 +0.0428573 0; +#X coords 0 1 62 -1 200 140 1; +#X restore -67 3 graph; +#N canvas 0 0 450 300 graph3 0; +#X array array2 64 float 1; +#A 0 0 0.0214285 -0.371429 -0.0571429 -0.0857143 0.128571 0.0571428 +0.0285714 0 0.0714285 -0.314286 0.0571428 -0.128571 -0.428571 -0.214286 +0.1 -0.328571 -0.271429 -0.428571 0 0.142857 -0.157143 0.228571 0 -0.128571 +-0.428571 0 -0.228571 0 0.0428573 0 -0.0714286 -0.428571 -0.414286 +0.271429 0.057143 -0.328571 0.0714285 -0.0285715 -0.428571 -0.0142857 +-0.242857 -0.285714 -0.0714286 0.242857 -0.4 -0.3 -0.0857143 0.3 0.214286 +-0.0428571 -0.414286 0.135714 0.3 -0.214286 -0.357143 -0.0571429 0 +0 0.171429 0 0.0428573 0.271429 -0.4; +#X coords 0 1 63 -1 200 140 1; +#X restore 159 1 graph; +#X obj 30 234 tabplay~ array1; +#X obj -28 270 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 30 323 tabwrite~ array2; +#X floatatom 229 240 5 0 0 0 - - -; +#X obj -68 307 metro 50; +#X obj -81 275 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 267 183 block~ 128; +#X msg 229 259 grains \$1; +#X obj 209 291 hsl 128 15 -64 64 0 0 empty empty empty -2 -6 0 8 -262144 +-1 -1 0 1; +#X msg 206 315 offset \$1; +#X obj 29 276 fftgrshuf~ 128; +#X connect 2 0 12 0; +#X connect 3 0 2 0; +#X connect 3 0 4 0; +#X connect 5 0 9 0; +#X connect 6 0 3 0; +#X connect 7 0 6 0; +#X connect 9 0 12 0; +#X connect 10 0 11 0; +#X connect 11 0 12 0; +#X connect 12 0 4 0; diff --git a/tbext/sort.pd b/tbext/sort.pd new file mode 100644 index 0000000..482cf31 --- /dev/null +++ b/tbext/sort.pd @@ -0,0 +1,51 @@ +#N canvas 245 106 453 369 10; +#N canvas 0 0 450 300 graph2 0; +#X array array1 63 float 1; +#A 0 0 0 0 0 0 0 0 0 -0.0142857 -0.0428571 -0.0714286 -0.0857143 -0.128571 +-0.214286 -0.285714 -0.357143 -0.4 -0.428571 -0.428571 -0.428571 -0.428571 +-0.428571 -0.414286 -0.414286 -0.4 -0.371429 -0.328571 -0.328571 -0.314286 +-0.3 -0.271429 -0.242857 -0.228571 -0.214286 -0.157143 -0.128571 -0.0714286 +-0.0571429 -0.0285715 0.0571428 0.1 0.128571 0.135714 0.142857 0.171429 +0.214286 0.228571 0.242857 0.271429 0.271429 0.3 0.3 -0.0571429 -0.0857143 +0.0214285 0.0285714 0.0571428 0.0714285 0.0714285 0.057143 0.0428573 +0.0428573 0; +#X coords 0 1 62 -1 200 140 1; +#X restore -67 3 graph; +#N canvas 0 0 450 300 graph3 0; +#X array array2 64 float 1; +#A 0 0 0 0 0 0 0 0 0 -0.0142857 -0.0428571 -0.0714286 -0.0857143 -0.128571 +-0.214286 -0.285714 -0.357143 -0.4 -0.428571 -0.428571 -0.428571 -0.428571 +-0.414286 -0.428571 -0.4 -0.414286 -0.328571 -0.371429 -0.314286 -0.328571 +-0.271429 -0.3 -0.228571 -0.242857 -0.157143 -0.214286 -0.0714286 -0.128571 +-0.0285715 -0.0571429 0.1 0.0571428 0.135714 0.128571 0.3 0.3 0.271429 +0.271429 0.242857 0.228571 0.214286 0.171429 0.142857 0.0714285 0.0714285 +0.057143 0.0571428 0.0428573 0.0428573 0.0285714 0.0214285 0 0 0 -0.0571429 +; +#X coords 0 1 63 -1 200 140 1; +#X restore 159 1 graph; +#X obj 30 234 tabplay~ array1; +#X obj -28 270 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 30 323 tabwrite~ array2; +#X floatatom 229 240 5 0 0 0 - - -; +#X obj -68 307 metro 50; +#X obj -81 275 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 267 183 block~ 128; +#X msg 229 259 grains \$1; +#X obj 209 291 hsl 128 15 -64 64 0 0 empty empty empty -2 -6 0 8 -262144 +-1 -1 6300 1; +#X msg 206 315 offset \$1; +#X obj 29 276 fftgrsort~ 128; +#X msg 168 203 reverse; +#X connect 2 0 12 0; +#X connect 3 0 2 0; +#X connect 3 0 4 0; +#X connect 5 0 9 0; +#X connect 6 0 3 0; +#X connect 7 0 6 0; +#X connect 9 0 12 0; +#X connect 10 0 11 0; +#X connect 11 0 12 0; +#X connect 12 0 4 0; +#X connect 13 0 12 0; diff --git a/tbext/source/fftbuf.cpp b/tbext/source/fftbuf.cpp new file mode 100644 index 0000000..13f0b9e --- /dev/null +++ b/tbext/source/fftbuf.cpp @@ -0,0 +1,259 @@ +/* Copyright (c) 2003 Tim Blechmann. */ +/* For information on usage and redistribution, and for a DISCLAIMER OF ALL */ +/* WARRANTIES, see the file, "COPYING" in this distribution. */ +/* */ +/* */ +/* fftbuf~ fades between two buffers. it is intended to be used as fft */ +/* synthesis tool... */ +/* */ +/* */ +/* fftbuf~ uses the flext C++ layer for Max/MSP and PD externals. */ +/* get it at http://www.parasitaere-kapazitaeten.de/PD/ext */ +/* thanks to Thomas Grill */ +/* */ +/* */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* See file LICENSE for further informations on licensing terms. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software */ +/* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* */ +/* Based on PureData by Miller Puckette and others. */ +/* */ +/* */ +/* */ +/* coded while listening to: Jérôme Noetinger/ErikM: What a Wonderful World */ +/* Cosmos: Tears */ +/* Burkhard Stangl/Dieb13: eh */ +/* */ + + + +#include <flext.h> + +#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 401) +#error upgrade your flext version!!!!!! +#endif + + +class fftbuf: public flext_dsp +{ + FLEXT_HEADER(fftbuf,flext_dsp); + +public: // constructor + + fftbuf(int); + ~fftbuf(); + +protected: + virtual void m_signal (int n, float *const *in, float *const *out); + bool check(buffer *); + + + void set_buf(int argc, t_atom *argv); //selects a new buffer + void set_line(int argc, t_atom *argv); //sets the time for the transformance + + template<typename T> + void clear(T *); //destroys an object + + void perform(); //starts transformation + + int blknumber(); //number of blocks that a performance needs + +private: + FLEXT_CALLBACK_V(set_buf); + FLEXT_CALLBACK_V(set_line); + FLEXT_CALLBACK(perform); + + float *ins; + float *outs; + + t_symbol * bufname; + buffer * buf; + + int delay; //delay for fading from local buffer to new one + t_sample * data; // pointer to array of samples + t_sample * offset; // pointer to array of samples + + int bs; //blocksize+1 + int sr; //samplerate + int counter; +}; + + +FLEXT_LIB_DSP_1("bufline~",fftbuf,int); + +fftbuf::fftbuf(int arg): + buf(NULL),data(NULL),sr(Samplerate()),delay(0),counter(0) +{ + bs=arg+1; + AddInAnything(); + AddOutSignal(); + FLEXT_ADDMETHOD_(0,"set",set_buf); + FLEXT_ADDMETHOD_(0,"line",set_line); + FLEXT_ADDBANG(0,perform); + + + data= new t_sample[bs]; + offset= new t_sample[bs]; + ZeroSamples(data,bs); + ZeroSamples(offset,bs); +} + + +fftbuf::~fftbuf() +{ + delete data; + delete offset; +} + + +void fftbuf::m_signal(int n, t_float *const *in, t_float *const *out) +{ + if (check(buf)) + { + outs = out[0]; + + if (counter!=0) + { + n=n/2+1; + while (--n) + data[n] = data[n] - offset[n]; + + + /* for(int i=0;i!=bs;++i) + { + data[i] = data[i] - offset[i]; + } + */ + + --counter; + } + + CopySamples(out[0],data,bs); + } + else + CopySamples(out[0],data,bs); + +} + +//perform und dsp gleichzeitig?!? + + +void fftbuf::perform() +{ + counter=blknumber(); + if (counter) + { + for(int i=0;i!=bs;++i) + { + offset[i]=(data[i]-*(buf->Data()+i))/counter; + } + + } + else + { + CopySamples(data,buf->Data(),bs); + } +} + +void fftbuf::set_buf(int argc, t_atom *argv) +{ + if(argc == 0) + { + post("No buffer selected!!!"); + return; + } + if (argc == 1 && IsSymbol(argv[0])) + { + clear(buf); + bufname=GetSymbol(argv[0]); + + buf= new buffer(bufname); + + if(!buf->Ok()) + { + post("buffer %s is currently not valid",bufname); + } + } + else if ((argc == 2 && IsSymbol(argv[0]) && + (IsInt(argv[1]) || IsFloat(argv[1])))) + { + clear(buf); + bufname=GetSymbol(argv[0]); + + buf= new buffer(bufname); + + if(!buf->Ok()) + { + post("buffer %s is currently not valid",bufname); + return; + } + delay=GetInt(argv[1]); + } +} + +template<typename T> +inline void fftbuf::clear(T* buf) +{ + if (buf) + { + delete buf; + buf=NULL; + } +} + +inline bool fftbuf::check(buffer * buf) +{ + if (buf==NULL) + return false; +//code taken from the flext tutorial (buffer 1) by thomas grill + + if(buf->Update()) + { + // buffer parameters have been updated + if(buf->Valid()) + { + post("%s (%s) - updated buffer reference", + thisName(),GetString(thisTag())); + return true; + } + else + { + post("%s (%s) - buffer has become invalid", + thisName(),GetString(thisTag())); + return false; + } + } + else + return true; +} + +void fftbuf::set_line(int argc, t_atom *argv) +{ + if(argc==1 && (IsInt(argv[0]) || IsFloat(argv[0]))) + { + delay=GetInt(argv[0]); + } + else + post("syntax incorrect"); +} + +inline int fftbuf::blknumber() +{ + post("%i %i %i",delay,bs,sr); + post("blknumber: %i",delay*bs/sr); + + return delay*bs/sr; //ms/sample +} diff --git a/tbext/source/fftgrrev.cpp b/tbext/source/fftgrrev.cpp new file mode 100644 index 0000000..fd844f0 --- /dev/null +++ b/tbext/source/fftgrrev.cpp @@ -0,0 +1,160 @@ +/* Copyright (c) 2003 Tim Blechmann. */ +/* For information on usage and redistribution, and for a DISCLAIMER OF ALL */ +/* WARRANTIES, see the file, "COPYING" in this distribution. */ +/* */ +/* */ +/* fftgrshuf divides the incoming fft signal into single grains and reverses */ +/* the samples in every grain */ +/* */ +/* fftgrrev uses the flext C++ layer for Max/MSP and PD externals. */ +/* get it at http://www.parasitaere-kapazitaeten.de/PD/ext */ +/* thanks to Thomas Grill */ +/* */ +/* */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* See file LICENSE for further informations on licensing terms. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software */ +/* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* */ +/* Based on PureData by Miller Puckette and others. */ +/* */ +/* */ +/* */ +/* coded while listening to: Howard Skempton/John Tilbury: Well, well, Cornelius*/ +/* */ +/* */ + + + +#include <flext.h> +#include <algorithm> + +#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 401) +#error upgrade your flext version!!!!!! +#endif + +class fftgrrev: public flext_dsp +{ + FLEXT_HEADER(fftgrrev,flext_dsp); + +public: // constructor + fftgrrev(int); + +protected: + virtual void m_signal (int n, float *const *in, float *const *out); + void set_grains(t_int); + void set_offset(t_int); + void set_reverse(); + +private: + FLEXT_CALLBACK_1(set_grains,t_int) + FLEXT_CALLBACK_1(set_offset,t_int) + + t_int grains; + t_int grainsize; + t_int offset; + + t_int bs; //blocksize + t_int bs1; //bs+1 + + t_sample * data; //array with data + t_sample * d1; //1. element in array with data + t_sample * dend; //1 element after the last element + + + bool reverse; + +}; + + +FLEXT_LIB_DSP_1("fftgrrev~",fftgrrev,int) + +fftgrrev::fftgrrev(int arg): + grains(1),offset(0) +{ + bs=arg/2; + grainsize=bs; + bs1=bs+1; + post("blocksize: %i",bs); + + data = new t_sample[bs+1]; + + data[0]=0; + d1=data+1; + dend=data+bs+1; + + AddInSignal(); + AddOutSignal(); + FLEXT_ADDMETHOD_I(0,"grains",set_grains); + FLEXT_ADDMETHOD_I(0,"offset",set_offset); +} + +void fftgrrev::m_signal(int n, t_float * const *in, t_float *const *out) +{ + t_sample * ins = in[0]; + t_sample * outs = out[0]; + + if (offset>0) + { + CopySamples(d1+bs-offset,ins,offset); + CopySamples(d1,ins+offset,bs-offset); + } + else if (offset<0) + { + CopySamples(d1-offset,ins,bs+offset); + CopySamples(d1,ins+bs+offset,-offset); + } + else + CopySamples(data,ins,bs1); + + + //grains + + int counter=1; + + while (counter!=grains) + { + std::reverse(d1+grainsize*(counter-1),d1+grainsize*counter); + ++counter; + } + + std::reverse(d1+grainsize*(counter-1),dend); + + CopySamples(outs,data,bs1); +} + +void fftgrrev::set_offset(t_int o) +{ + if (o-bs<0 && o+bs>0) + { + offset=-o; + } + else + post("Offset out of range!"); +} + + +void fftgrrev::set_grains(t_int g) +{ + if ( (g > 0) ) + { + grains=g; + grainsize=(bs)/grains; + } +} + + + + diff --git a/tbext/source/fftgrshuf.cpp b/tbext/source/fftgrshuf.cpp new file mode 100644 index 0000000..d9ecdfb --- /dev/null +++ b/tbext/source/fftgrshuf.cpp @@ -0,0 +1,153 @@ +/* Copyright (c) 2003 Tim Blechmann. */ +/* For information on usage and redistribution, and for a DISCLAIMER OF ALL */ +/* WARRANTIES, see the file, "COPYING" in this distribution. */ +/* */ +/* */ +/* fftgrshuf divides the incoming fft signal into single grains and */ +/* random_shuffles the samples in every grain */ +/* */ +/* fftgrshuf uses the flext C++ layer for Max/MSP and PD externals. */ +/* get it at http://www.parasitaere-kapazitaeten.de/PD/ext */ +/* thanks to Thomas Grill */ +/* */ +/* */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* See file LICENSE for further informations on licensing terms. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software */ +/* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* */ +/* Based on PureData by Miller Puckette and others. */ +/* */ +/* */ +/* */ +/* coded while listening to: New York Underground Orchestra: The Labyrinth */ +/* */ +/* */ + + + +#include <flext.h> +#include <algorithm> + +#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 401) +#error upgrade your flext version!!!!!! +#endif + +class fftgrshuf: public flext_dsp +{ + FLEXT_HEADER(fftgrshuf,flext_dsp); + +public: // constructor + fftgrshuf(int); + +protected: + virtual void m_signal (int n, float *const *in, float *const *out); + void set_grains(t_int); + void set_offset(t_int); + +private: + FLEXT_CALLBACK_1(set_grains,t_int) + FLEXT_CALLBACK_1(set_offset,t_int) + + t_int grains; + t_int grainsize; + t_int offset; + + t_int bs; //blocksize + t_int bs1; //bs+1 + + t_sample * data; //array with data + t_sample * d1; //1. element in array with data + t_sample * dend; //1 element after the last element +}; + + +FLEXT_LIB_DSP_1("fftgrshuf~",fftgrshuf,int) + +fftgrshuf::fftgrshuf(int arg): + grains(1),offset(0) +{ + bs=arg/2; + grainsize=bs; + bs1=bs+1; + post("blocksize: %i",bs); + + data = new t_sample[bs+1]; + + data[0]=0; + d1=data+1; + dend=data+bs+1; + + AddInSignal(); + AddOutSignal(); + FLEXT_ADDMETHOD_I(0,"grains",set_grains); + FLEXT_ADDMETHOD_I(0,"offset",set_offset); +} + +void fftgrshuf::m_signal(int n, t_float * const *in, t_float *const *out) +{ + t_sample * ins = in[0]; + t_sample * outs = out[0]; + + if (offset>0) + { + CopySamples(d1+bs-offset,ins,offset); + CopySamples(d1,ins+offset,bs-offset); + } + else if (offset<0) + { + CopySamples(d1-offset,ins,bs+offset); + CopySamples(d1,ins+bs+offset,-offset); + } + else + CopySamples(data,ins,bs1); + + + //grains + + int counter=1; + + while (counter!=grains) + { + std::random_shuffle(d1+grainsize*(counter-1),d1+grainsize*counter); + ++counter; + } + + std::random_shuffle(d1+grainsize*(counter-1),dend); + + + CopySamples(outs,data,bs1); +} + +void fftgrshuf::set_offset(t_int o) +{ + if (o-bs<0 && o+bs>0) + { + offset=o; + } + else + post("offset out of range!"); +} + + +void fftgrshuf::set_grains(t_int g) +{ + if ( (g > 0) ) + { + grains=g; + grainsize=(bs)/grains; + } +} + diff --git a/tbext/source/fftgrsort.cpp b/tbext/source/fftgrsort.cpp new file mode 100644 index 0000000..1764c02 --- /dev/null +++ b/tbext/source/fftgrsort.cpp @@ -0,0 +1,173 @@ +/* Copyright (c) 2003-2004 Tim Blechmann. */ +/* For information on usage and redistribution, and for a DISCLAIMER OF ALL */ +/* WARRANTIES, see the file, "COPYING" in this distribution. */ +/* */ +/* */ +/* fftgrsort divides the incoming fft signal into single grains and sorts the */ +/* samples in every grain */ +/* */ +/* fftgrsort uses the flext C++ layer for Max/MSP and PD externals. */ +/* get it at http://www.parasitaere-kapazitaeten.de/PD/ext */ +/* thanks to Thomas Grill */ +/* */ +/* */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* See file LICENSE for further informations on licensing terms. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software */ +/* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* */ +/* Based on PureData by Miller Puckette and others. */ +/* */ +/* */ +/* */ +/* coded while listening to: William Parker: Posium Pendasem */ +/* Rowe/Lehn/Schmickler: Rabbit Run */ +/* Derek Bailey: Ballads */ +/* */ + + + +#include <flext.h> +#include <algorithm> + +#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 401) +#error upgrade your flext version!!!!!! +#endif + +class fftgrsort: public flext_dsp +{ + FLEXT_HEADER(fftgrsort,flext_dsp); + +public: // constructor + fftgrsort(int); + +protected: + virtual void m_signal (int n, float *const *in, float *const *out); + void set_grains(t_int); + void set_offset(t_int); + void set_reverse(); + +private: + FLEXT_CALLBACK_1(set_grains,t_int) + FLEXT_CALLBACK_1(set_offset,t_int) + FLEXT_CALLBACK(set_reverse) + + t_int grains; + t_int grainsize; + t_int offset; + + t_int bs; //blocksize + t_int bs1; //bs+1 + + t_sample * data; //array with data + t_sample * d1; //1. element in array with data + t_sample * dend; //1 element after the last element + + + bool reverse; + +}; + + +FLEXT_LIB_DSP_1("fftgrsort~",fftgrsort,int) + +fftgrsort::fftgrsort(int arg): + grains(1),offset(0),reverse(0) +{ + bs=arg/2; + grainsize=bs; + bs1=bs+1; + post("blocksize: %i",bs); + + data = new t_sample[bs+1]; + + data[0]=0; + d1=data+1; + dend=data+bs+1; + + AddInSignal(); + AddOutSignal(); + FLEXT_ADDMETHOD_I(0,"grains",set_grains); + FLEXT_ADDMETHOD_I(0,"offset",set_offset); + FLEXT_ADDMETHOD_(0,"reverse",set_reverse); +} + +void fftgrsort::m_signal(int n, t_float * const *in, t_float *const *out) +{ + t_sample * ins = in[0]; + t_sample * outs = out[0]; + + + if (offset>0) + { + CopySamples(d1+bs-offset,ins,offset); + CopySamples(d1,ins+offset,bs-offset); + } + else if (offset<0) + { + CopySamples(d1-offset,ins,bs+offset); + CopySamples(d1,ins+bs+offset,-offset); + } + else + CopySamples(data,ins,bs1); + + + //grains + + int counter=1; + + while (counter!=grains) + { + std::sort(d1+grainsize*(counter-1),d1+grainsize*counter); + if (reverse) + std::reverse(d1+grainsize*(counter-1),d1+grainsize*counter); + ++counter; + } + + std::sort(d1+grainsize*(counter-1),dend); + if (reverse) + std::reverse(d1+grainsize*(counter-1),dend); + + + CopySamples(outs,data,bs1); +} + +void fftgrsort::set_offset(t_int o) +{ + if (o-bs<0 && o+bs>0) + { + offset=-o; + // post("offset %i",o); + } + else + post("offset out of range!"); +} + + +void fftgrsort::set_grains(t_int g) +{ + if ( (g > 0) ) + { + grains=g; + grainsize=(bs)/grains; + } +} + +void fftgrsort::set_reverse() +{ + reverse=!reverse; +} + + diff --git a/tbext/source/him.cpp b/tbext/source/him.cpp new file mode 100644 index 0000000..56872df --- /dev/null +++ b/tbext/source/him.cpp @@ -0,0 +1,427 @@ +/* Copyright (c) 2004 Tim Blechmann. */ +/* For information on usage and redistribution, and for a DISCLAIMER OF ALL */ +/* WARRANTIES, see the file, "COPYING" in this distribution. */ +/* */ +/* */ +/* him~ is a semi-classicical simulation of an hydrogen atom in a magnetic field*/ +/* */ +/* him~ uses the flext C++ layer for Max/MSP and PD externals. */ +/* get it at http://www.parasitaere-kapazitaeten.de/PD/ext */ +/* thanks to Thomas Grill */ +/* */ +/* him~ is based on code provided in the lecture "physik auf dem computer 1" */ +/* held by joerg main during the winter semester 2003/04 at the university */ +/* stuttgart ... many thanks to him and his assistant ralf habel */ +/* */ +/* */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* See file LICENSE for further informations on licensing terms. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software */ +/* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* */ +/* Based on PureData by Miller Puckette and others. */ +/* */ +/* */ +/* */ +/* coded while listening to: Elliott Sharp: The Velocity Of Hue */ +/* Fred Frith: Traffic Continues */ +/* Nmperign: Twisted Village */ +/* Frank Lowe: Black Beings */ +/* */ + + + +#include <flext.h> +#include <cstdlib> +#include <cmath> + +#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 401) +#error upgrade your flext version!!!!!! +#endif + +#define NUMB_EQ 4 + +class him: public flext_dsp +{ + FLEXT_HEADER(him,flext_dsp); + +public: + him(int argc, t_atom *argv); + +protected: + virtual void m_signal (int n, float *const *in, float *const *out); + virtual void m_dsp (int n, float *const *in, float *const *out); + + void set_mu(t_float); + void set_muv(t_float); + void set_nu(t_float); + void set_nuv(t_float); + void set_etilde(t_float); + void set_dt(t_float); + void set_regtime(bool); + void state(); + void reset(); + +private: + // contains DGL-System + t_float deriv(t_float x[],int eq); + + // 4th order Runge Kutta update of the dynamical variables + void runge_kutta_4(t_float dt); + + //these are our data + t_float data[4]; //mu, muv, nu, nuv (semi-parabolische koordinaten) + t_float E; + + //and these our settings + t_float dt; + bool regtime; //if true "regularisierte zeit" + + bool xfade; + t_float newE; + t_float newdt; + bool newsystem; + bool newregtime; + + t_float * m_fader; + + //Callbacks + FLEXT_CALLBACK_1(set_mu,t_float); + FLEXT_CALLBACK_1(set_muv,t_float); + FLEXT_CALLBACK_1(set_nu,t_float); + FLEXT_CALLBACK_1(set_nuv,t_float); + FLEXT_CALLBACK_1(set_etilde,t_float); + FLEXT_CALLBACK_1(set_dt,t_float); + FLEXT_CALLBACK_1(set_regtime,bool); + FLEXT_CALLBACK(state); + FLEXT_CALLBACK(reset); + + //reset mus / nus + void reset_nuv() + { + data[3]= 0.5*sqrt( - (4*data[1]*data[1]) - + ( data[0]*data[0]*data[1]*data[1]*data[1]*data[1]) + + (8*E*data[0]) - (8*E*data[2]) - + (data[0]*data[0]*data[0]*data[0]*data[1]*data[1]) + + 16); + if (fabs((data[3]))<1e-5) + data[3]=0; + } + + void reset_muv() + { + data[1]= 0.5*sqrt( - (4*data[3]*data[3]) - + ( data[0]*data[0]*data[1]*data[1]*data[1]*data[1]) + + (8*E*data[0]) - (8*E*data[2]) - + (data[0]*data[0]*data[0]*data[0]*data[1]*data[1]) + + 16); + if (fabs((data[1]))<1e-5) + data[1]=0; + } + +}; + + +FLEXT_LIB_DSP_V("him~",him) + +him::him(int argc, t_atom *argv) +{ + AddInAnything(); + AddOutSignal(); + AddOutSignal(); + AddOutSignal(); + AddOutSignal(); + AddOutSignal(); + AddOutSignal(); + FLEXT_ADDMETHOD_F(0,"mu",set_mu); + FLEXT_ADDMETHOD_F(0,"muv",set_muv); + FLEXT_ADDMETHOD_F(0,"nu",set_nu); + FLEXT_ADDMETHOD_F(0,"nuv",set_nuv); + FLEXT_ADDMETHOD_F(0,"e",set_etilde); + FLEXT_ADDMETHOD_F(0,"dt",set_dt); + FLEXT_ADDMETHOD_B(0,"regtime",set_regtime); + FLEXT_ADDMETHOD_(0,"state",state); + FLEXT_ADDMETHOD_(0,"reset",reset); + + + //beginning values + if (argc==1) + E=atom_getfloat(argv); + else + E= -float(rand())/float(RAND_MAX); + + reset(); + + state(); + + //default mode + regtime=true; + dt=0.01; +} + +inline t_float him::deriv(t_float * x, int eq) +{ + t_float result; + // set DGL-System here + if (eq == 0) result = x[1]; + if (eq == 1) result = 2*E*x[0]-0.25*x[0]*x[2]*x[2]*(2*x[0]*x[0]+x[2]*x[2]); + if (eq == 2) result = x[3]; + if (eq == 3) result = 2*E*x[2]-0.25*x[2]*x[0]*x[0]*(2*x[2]*x[2]+x[0]*x[0]); + + return result; +} + +inline void him::runge_kutta_4(t_float dt) +{ + t_float k1[NUMB_EQ],k2[NUMB_EQ],k3[NUMB_EQ],k4[NUMB_EQ]; + t_float temp1[NUMB_EQ], temp2[NUMB_EQ], temp3[NUMB_EQ]; + + for(int i=0;i<=NUMB_EQ-1;i++) // iterate over equations + { + k1[i] = dt * deriv(data,i); + temp1[i] = data[i] + 0.5*k1[i]; + } + + for(int i=0;i<=NUMB_EQ-1;i++) + { + k2[i] = dt * deriv(temp1,i); + temp2[i] = data[i] + 0.5*k2[i]; + } + + for(int i=0;i<=NUMB_EQ-1;i++) + { + k3[i] = dt * deriv(temp2,i); + temp3[i] = data[i] + k3[i]; + } + + for(int i=0;i<=NUMB_EQ-1;i++) + { + k4[i] = dt * deriv(temp3,i); + data[i] = data[i] + (k1[i] + (2.*(k2[i]+k3[i])) + k4[i])/6.; + + // we don't want to experience denormals in the next step */ + if(fabs((data[i]))<1e-5) + data[i]=0; + } + + + /* + the system might become unstable ... in this case, we'll request a new system + */ + + for(int i=0;i<=NUMB_EQ-1;i++) + { + if(data[i]>2) + { + xfade = newsystem = true; + data[i] = 2; + } + if(data[i]<-2) + { + xfade = newsystem = true; + data[i] = -2; + } + } +} + + + +void him::m_signal(int n, t_float *const *in, t_float *const *out) +{ + t_float * out0 = out[0]; + t_float * out1 = out[1]; + t_float * out2 = out[2]; + t_float * out3 = out[3]; + t_float * out4 = out[4]; + t_float * out5 = out[5]; + + + if (regtime) + { + for (int i=0;i!=n;++i) + { + runge_kutta_4(dt); + (*(out0)++)=data[0]; + (*(out1)++)=data[1]; + (*(out2)++)=data[2]; + (*(out3)++)=data[3]; + (*(out4)++)=data[0]*data[2]; + (*(out5)++)=(data[0]*data[0]-data[2]*data[2])*0.5; + } + } + else + { + for (int i=0;i!=n;++i) + { + runge_kutta_4(dt/(2*sqrt(data[0]*data[0]+data[2]*data[2]))); + (*(out0)++)=data[0]; + (*(out1)++)=data[1]; + (*(out2)++)=data[2]; + (*(out3)++)=data[3]; + (*(out4)++)=data[0]*data[2]; + (*(out5)++)=(data[0]*data[0]-data[2]*data[2])*0.5; + } + } + + if (xfade) + { + /* fading */ + out0 = out[0]; + out1 = out[1]; + out2 = out[2]; + out3 = out[3]; + out4 = out[4]; + out5 = out[5]; + + t_float * fader = m_fader + n - 1; + for (int i=0;i!=n;++i) + { + (*(out0)++) *= *fader; + (*(out1)++) *= *fader; + (*(out2)++) *= *fader; + (*(out3)++) *= *fader; + (*(out4)++) *= *fader; + (*(out5)++) *= *fader--; + } + + if (newsystem) + { + reset(); + newsystem = false; + } + + E = newE; + dt = newdt; + regtime = newregtime; + + out0 = out[0]; + out1 = out[1]; + out2 = out[2]; + out3 = out[3]; + out4 = out[4]; + out5 = out[5]; + + fader = m_fader; + if (regtime) + { + for (int i=0;i!=n;++i) + { + runge_kutta_4(dt); + (*(out0)++)+= data[0]* *fader; + (*(out1)++)+= data[1]* *fader; + (*(out2)++)+= data[2]* *fader; + (*(out3)++)+= data[3]* *fader; + (*(out4)++)+= data[0]*data[2]* *fader; + (*(out5)++)+= (data[0]*data[0]-data[2]*data[2])*0.5* *fader++; + } + } + else + { + for (int i=0;i!=n;++i) + { + runge_kutta_4(dt/(2*sqrt(data[0]*data[0]+data[2]*data[2]))); + (*(out0)++)+= data[0]* *fader; + (*(out1)++)+= data[1]* *fader; + (*(out2)++)+= data[2]* *fader; + (*(out3)++)+= data[3]* *fader; + (*(out4)++)+= data[0]*data[2]* *fader; + (*(out5)++)+= (data[0]*data[0]-data[2]*data[2])*0.5* *fader++; + } + } + + xfade = false; + } + +} + +void him::m_dsp(int n, t_float *const *in, t_float *const *out) +{ + m_fader = new t_float[n]; + t_float on = 1.f/(n-1); + + t_float value = 0; + + t_float* localfader = m_fader; + + while (n--) + { + *localfader = value; + value += on; + ++localfader; + } + xfade = false; +} + + +void him::set_mu(t_float f) +{ + data[0]=f; + reset_nuv(); +} + +void him::set_muv(t_float f) +{ + data[1]=f; + reset_nuv(); +} + +void him::set_nu(t_float f) +{ + data[3]=f; + reset_nuv(); +} + +void him::set_nuv(t_float f) +{ + data[3]=f; + reset_muv(); +} + +void him::set_etilde(t_float f) +{ + newE=f; + xfade = true; + //reset_nuv(); +} + +void him::set_dt(t_float f) +{ + newdt=f; + xfade = true; +} + +void him::set_regtime(bool b) +{ + newregtime=b; + xfade = true; +} + + +void him::state() +{ + post("mu %f",data[0]); + post("mus %f",data[1]); + post("nu %f",data[2]); + post("nus %f",data[3]); + post("etilde %f",E); +} + +void him::reset() +{ + data[0]=float(rand())/float(RAND_MAX); + data[1]=float(rand())/float(RAND_MAX); + data[2]=float(rand())/float(RAND_MAX); + reset_nuv(); +} diff --git a/tbext/source/main.cpp b/tbext/source/main.cpp new file mode 100644 index 0000000..0c9285d --- /dev/null +++ b/tbext/source/main.cpp @@ -0,0 +1,74 @@ +/* Copyright (c) 2003-2004 Tim Blechmann. */ +/* For information on usage and redistribution, and for a DISCLAIMER OF ALL */ +/* WARRANTIES, see the file, "COPYING" in this distribution. */ +/* */ +/* */ +/* tbext is the collection of some external i wrote. */ +/* some are useful, others aren't... */ +/* */ +/* */ +/* tbext uses the flext C++ layer for Max/MSP and PD externals. */ +/* get it at http://www.parasitaere-kapazitaeten.de/PD/ext */ +/* thanks to Thomas Grill */ +/* */ +/* */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* See file LICENSE for further informations on licensing terms. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software */ +/* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* */ +/* Based on PureData by Miller Puckette and others. */ +/* */ +/* */ +/* */ +/* coded while listening to: Hamid Drake & Assif Tsahar: Soul Bodies, Vol. 1 */ +/* I.S.O.: I.S.O */ +/* */ + + + +#include <flext.h> +#define TBEXT_VERSION "0.05" + +#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 400) +#error upgrade your flext version!!!!!! +#endif + +void ttbext_setup() +{ + post("\nTBEXT: by tim blechmann"); + post("version "TBEXT_VERSION); + post("compiled on "__DATE__); + post("contains: tbroute(~), tbfft1~, tbfft2~, bufline~, fftgrrev~"); + post(" fftgrsort~, fftgrshuf~, him~, sym2num\n"); + + FLEXT_SETUP(tbroute); + FLEXT_DSP_SETUP(tbsroute); + /* obsolete: FLEXT_DSP_SETUP(tbsig); */ + /* obsolete: FLEXT_DSP_SETUP(tbpow); */ + FLEXT_DSP_SETUP(tbfft1); + FLEXT_DSP_SETUP(tbfft2); + FLEXT_DSP_SETUP(fftbuf); + FLEXT_DSP_SETUP(fftgrsort); + FLEXT_DSP_SETUP(fftgrshuf); + FLEXT_DSP_SETUP(fftgrrev); + FLEXT_DSP_SETUP(him); + FLEXT_SETUP(sym2num); + + + +} + +FLEXT_LIB_SETUP(tbext,ttbext_setup) diff --git a/tbext/source/sym2num.cpp b/tbext/source/sym2num.cpp new file mode 100644 index 0000000..8f7bece --- /dev/null +++ b/tbext/source/sym2num.cpp @@ -0,0 +1,90 @@ +/* Copyright (c) 2004 Tim Blechmann. */ +/* For information on usage and redistribution, and for a DISCLAIMER OF ALL */ +/* WARRANTIES, see the file, "COPYING" in this distribution. */ +/* */ +/* sym2num interpretes a symbol as decimal number that is related to the ascii */ +/* representation. */ +/* */ +/* */ +/* sym2num uses the flext C++ layer for Max/MSP and PD externals. */ +/* get it at http://www.parasitaere-kapazitaeten.de/PD/ext */ +/* thanks to Thomas Grill */ +/* */ +/* */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* See file LICENSE for further informations on licensing terms. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software */ +/* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* */ +/* Based on PureData by Miller Puckette and others. */ +/* */ +/* */ +/* */ +/* coded while listening to: Phil Minton & Veryan Weston: Ways */ +/* */ +/* */ +/* */ + + + +#include <flext.h> + +#include <cstring> +#include <cmath> + + +#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 400) +#error upgrade your flext version!!!!!! +#endif + +class sym2num: public flext_base +{ + FLEXT_HEADER(sym2num,flext_base); + +public: + sym2num(); + +protected: + void m_symbol(t_symbol *s); + +private: + + FLEXT_CALLBACK_S(m_symbol); +}; + +FLEXT_LIB("sym2num",sym2num); + +sym2num::sym2num() +{ + AddInSymbol(); + + FLEXT_ADDMETHOD(0,m_symbol); + + AddOutFloat(); +} + +void sym2num::m_symbol(t_symbol * s) +{ + const char* str = GetString(s); + + int length = strlen(str); + + int ret(0); + while (length--) + { + ret+=str[length]*pow(2,length); + } + ToOutFloat(0,ret); +} diff --git a/tbext/source/tbfft1.cpp b/tbext/source/tbfft1.cpp new file mode 100644 index 0000000..e941bfd --- /dev/null +++ b/tbext/source/tbfft1.cpp @@ -0,0 +1,134 @@ +/* Copyright (c) 2003 Tim Blechmann. */ +/* For information on usage and redistribution, and for a DISCLAIMER OF ALL */ +/* WARRANTIES, see the file, "COPYING" in this distribution. */ +/* */ +/* */ +/* tbfft1~ transforms the fft spectrum */ +/* */ +/* tbfft1~ uses the flext C++ layer for Max/MSP and PD externals. */ +/* get it at http://www.parasitaere-kapazitaeten.de/PD/ext */ +/* thanks to Thomas Grill */ +/* */ +/* */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* See file LICENSE for further informations on licensing terms. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software */ +/* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* */ +/* Based on PureData by Miller Puckette and others. */ +/* */ +/* */ +/* */ +/* coded while listening to: John Zorn / Mike Patton / Ikue Mori: Hemophiliac */ +/* Rashied Ali / Frank Lowe: Duo Exchange */ +/* Keith Rowe / John Tilbury: Duos For Doris */ +/* */ + + + +#include <flext.h> + +#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 401) +#error upgrade your flext version!!!!!! +#endif + + +class tbfft1: public flext_dsp +{ + FLEXT_HEADER(tbfft1,flext_dsp); + +public: // constructor + tbfft1(); + +protected: + virtual void m_signal (int n, float *const *in, float *const *out); + void set_freq(t_float); + void set_fact(t_float); + +private: + FLEXT_CALLBACK_1(set_freq,t_float) + FLEXT_CALLBACK_1(set_fact,t_float) + + t_int center; + t_float factor; + + t_float pos; + t_int posi; + + float *ins; + float *outs; + + t_float s; + t_float b; + + +}; + + +FLEXT_LIB_DSP("tbfft1~",tbfft1) + +tbfft1::tbfft1() +{ + AddInSignal(); + AddOutSignal(); + FLEXT_ADDMETHOD_F(0,"center",set_freq); + FLEXT_ADDMETHOD_F(0,"factor",set_fact); +} + + +void tbfft1::m_signal(int n, t_float *const *in, t_float *const *out) +{ + ins = in[0]; + outs = out[0]; + + n=n/2+1; + while(n!=0) + { + pos= n + factor * (center-n); + posi=t_int(pos); + + + if (n < t_int(center)) + { + *(outs+n) = ((pos-t_float(posi)) * (*(ins+posi)))/2 + +((1-pos+t_float(posi)) * (*(ins+posi+1)))/2; + } + else + { + *(outs+n) = ((pos-t_float(posi)) * (*(ins+posi-1)))/2 + +((1-pos+t_float(posi)) * (*(ins+posi)))/2; + } + + --n; + } + + +} + +void tbfft1::set_freq(t_float freq) +{ + s=Samplerate(); + + b=Blocksize(); + + center=freq/(s/b); +} + + +void tbfft1::set_fact(t_float f) +{ + if (f<2) + factor=f; +} diff --git a/tbext/source/tbfft2.cpp b/tbext/source/tbfft2.cpp new file mode 100644 index 0000000..1ab08db --- /dev/null +++ b/tbext/source/tbfft2.cpp @@ -0,0 +1,152 @@ +/* Copyright (c) 2003 Tim Blechmann. */ +/* For information on usage and redistribution, and for a DISCLAIMER OF ALL */ +/* WARRANTIES, see the file, "COPYING" in this distribution. */ +/* */ +/* */ +/* tbfft2~ transforms the fft spectrum. it reverses the order of the samples in */ +/* the fft spectrum. see the help file for further instruction... */ +/* */ +/* */ +/* tbfft2~ uses the flext C++ layer for Max/MSP and PD externals. */ +/* get it at http://www.parasitaere-kapazitaeten.de/PD/ext */ +/* thanks to Thomas Grill */ +/* */ +/* */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* See file LICENSE for further informations on licensing terms. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software */ +/* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* */ +/* Based on PureData by Miller Puckette and others. */ +/* */ +/* */ +/* */ +/* coded while listening to: Naked City: Heretic, Jeux Des Dames Cruelles */ +/* Bob Ostertag: Attention Span */ +/* */ +/* */ + + + +#include <flext.h> + +#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 401) +#error upgrade your flext version!!!!!! +#endif + + +class tbfft2: public flext_dsp +{ + FLEXT_HEADER(tbfft2,flext_dsp); + +public: // constructor + tbfft2(); + ~tbfft2(); + +protected: + virtual void m_signal (int n, float *const *in, float *const *out); + virtual void m_dsp (int n, float *const *in, float *const *out); + void set_freq(t_float); + void set_width(t_float); + +private: + FLEXT_CALLBACK_1(set_freq,t_float); + FLEXT_CALLBACK_1(set_width,t_float); + + t_int center; + t_int width; + + t_float * tmp; + + t_int n0; +}; + + +FLEXT_LIB_DSP("tbfft2~",tbfft2) + +tbfft2::tbfft2() +{ + AddInSignal(); + AddOutSignal(); + FLEXT_ADDMETHOD_F(0,"center",set_freq); + FLEXT_ADDMETHOD_F(0,"width",set_width); +} + +tbfft2::~tbfft2() +{ + free(tmp); +} + +void tbfft2::m_dsp(int n, t_float *const *in, t_float *const *out) +{ + free(tmp); + tmp=(t_float*)malloc(n*sizeof(t_float)); +} + + + +void tbfft2::m_signal(int n, t_float *const *in, t_float *const *out) +{ + t_float * ins = in[0]; + t_float * outs = out[0]; + + CopySamples(tmp,ins,n); + + n0=n/2; + + if (center-width>0) + { + n=center-width; + } + else + n=0; + + while (n<center+width) + { + tmp[n]=*(ins+2*center-n); + ++n; + } + + + + //memcpy + CopySamples(outs,tmp,n0*2); + +} + +void tbfft2::set_freq(t_float freq) +{ + center=freq; + set_width(width); +} + +void tbfft2::set_width(t_float w) +{ + + if (w+center>n0) + { + width=n0-center; + return; + } + if (center-w<0) + { + width=center; + return; + } + + width=w; +} + + diff --git a/tbext/source/tbroute.cpp b/tbext/source/tbroute.cpp new file mode 100644 index 0000000..3218886 --- /dev/null +++ b/tbext/source/tbroute.cpp @@ -0,0 +1,112 @@ +/* Copyright (c) 2003 Tim Blechmann. */ +/* For information on usage and redistribution, and for a DISCLAIMER OF ALL */ +/* WARRANTIES, see the file, "COPYING" in this distribution. */ +/* */ +/* */ +/* tbroute is an advanced router. */ +/* the signal to the first inlet is being routed to the outlet specified */ +/* by the second inlet. */ +/* the number of outlets is specified by the creation argument */ +/* */ +/* */ +/* tbroute uses the flext C++ layer for Max/MSP and PD externals. */ +/* get it at http://www.parasitaere-kapazitaeten.de/PD/ext */ +/* thanks to Thomas Grill */ +/* */ +/* */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* See file LICENSE for further informations on licensing terms. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software */ +/* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* */ +/* Based on PureData by Miller Puckette and others. */ +/* */ +/* */ +/* */ +/* coded while listening to: Hamid Drake & Assif Tsahar: Soul Bodies, Vol. 1 */ +/* I.S.O.: I.S.O */ +/* */ +/* */ + +#include <flext.h> + +#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 400) +#error upgrade your flext version!!!!!! +#endif + +class tbroute: public flext_base +{ + FLEXT_HEADER(tbroute,flext_base); + +public: // constructor + tbroute(int chan); + +protected: + void route(t_float f); + + void routebang(); + void set_route(int i); + +private: + FLEXT_CALLBACK_1(route,t_float); + + FLEXT_CALLBACK(routebang); + FLEXT_CALLBACK_1(set_route,int); + + int dest; +}; + + +FLEXT_LIB_1("tbroute",tbroute,int); + +tbroute::tbroute(int chan) +{ + AddInAnything(); + AddInInt(); + + for (int i=0; i!=chan;++i) + { + AddOutAnything(); + } + + FLEXT_ADDMETHOD(0,route); + FLEXT_ADDBANG(0,routebang); + FLEXT_ADDMETHOD(1,set_route); + dest=0; +} + +void tbroute::route(t_float f) +{ + ToOutFloat(dest,f); +} + + +void tbroute::routebang() +{ + ToOutBang(dest); +} + +void tbroute::set_route(int i) +{ + --i; + if ((i>-1) && (i<CntOut())) + { + dest=i; + } + else + { + post("no such outlet"); + } +} diff --git a/tbext/source/tbsroute~.cpp b/tbext/source/tbsroute~.cpp new file mode 100644 index 0000000..d18d264 --- /dev/null +++ b/tbext/source/tbsroute~.cpp @@ -0,0 +1,109 @@ +/* Copyright (c) 2003 Tim Blechmann. */ +/* For information on usage and redistribution, and for a DISCLAIMER OF ALL */ +/* WARRANTIES, see the file, "COPYING" in this distribution. */ +/* */ +/* */ +/* tbsroute~ is an advanced signal router. */ +/* the signal to the first inlet is being routed to the outlet specified */ +/* by the second inlet. */ +/* the number of outlets is specified by the creation argument */ +/* */ +/* */ +/* tbsroute~ uses the flext C++ layer for Max/MSP and PD externals. */ +/* get it at http://www.parasitaere-kapazitaeten.de/PD/ext */ +/* thanks to Thomas Grill */ +/* */ +/* */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* See file LICENSE for further informations on licensing terms. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software */ +/* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* */ +/* Based on PureData by Miller Puckette and others. */ +/* */ +/* */ +/* */ +/* coded while listening to: AMM: AMMMUSIC 1966 */ +/* Sun Ra: Dancing Shadows */ +/* */ + + +#include <flext.h> + +#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 401) +#error upgrade your flext version!!!!!! +#endif + +class tbsroute: public flext_dsp +{ + FLEXT_HEADER(tbsroute,flext_dsp) + +public: // constructor + tbsroute(t_int chan); + +protected: + virtual void m_signal (int n, float *const *in, float *const *out); + void set_route(int i); + +private: + FLEXT_CALLBACK_1(set_route,int) + t_int dest; +}; + + +FLEXT_LIB_DSP_1("tbroute~",tbsroute,int); + +tbsroute::tbsroute (t_int chan): + dest(0) +{ + AddInSignal(); + AddInInt(); + + for (t_int i=0; i!=chan;++i) + { + AddOutSignal(); + } + + FLEXT_ADDMETHOD(1,set_route); +} + + +void tbsroute::m_signal(int n, float *const *in, float *const *out) +{ + + CopySamples(out[dest],in[0],n); + + for (int i = 0; i != CntOutSig(); i++) + if (i!=dest) ZeroSamples(out[i],n); + + + + +} + +void tbsroute::set_route(int i) +{ + --i; + if ((i>-1) && (i<CntOutSig())) + { + dest=i; + post("routing to outlet %i",i+1); + } + else + { + post("no such outlet"); + } + +} diff --git a/tbext/source/tbssel~.cpp b/tbext/source/tbssel~.cpp new file mode 100644 index 0000000..f9111aa --- /dev/null +++ b/tbext/source/tbssel~.cpp @@ -0,0 +1,100 @@ +/* Copyright (c) 2003 Tim Blechmann. */ +/* For information on usage and redistribution, and for a DISCLAIMER OF ALL */ +/* WARRANTIES, see the file, "COPYING" in this distribution. */ +/* */ +/* */ +/* tbssel~ selects one signal from the incoming signals */ +/* the number of inlets is specified by the creation argument */ +/* */ +/* */ +/* tbssel~ uses the flext C++ layer for Max/MSP and PD externals. */ +/* get it at http://www.parasitaere-kapazitaeten.de/PD/ext */ +/* thanks to Thomas Grill */ +/* */ +/* */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* See file LICENSE for further informations on licensing terms. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software */ +/* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* */ +/* Based on PureData by Miller Puckette and others. */ +/* */ +/* */ +/* */ +/* coded while listening to: AMM: AMMMUSIC 1966 */ +/* Sun Ra: Dancing Shadows */ +/* */ + + +#include <flext.h> + +#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 401) +#error upgrade your flext version!!!!!! +#endif + +class tbssel: public flext_dsp +{ + FLEXT_HEADER(tbssel,flext_dsp) + +public: // constructor + tbssel(t_int chan); + +protected: + virtual void m_signal (int n, float *const *in, float *const *out); + void set_source(int i); + +private: + FLEXT_CALLBACK_1(set_source,int) + t_int source; +}; + + +FLEXT_LIB_DSP_1("tbroute~",tbssel,int); + +tbssel::tbssel (t_int chan): + source(0) +{ + for (t_int i=0; i!=chan;++i) + { + AddInSignal(); + } + + AddOutSignal(); + + FLEXT_ADDMETHOD(1,set_source); +} + + +void tbssel::m_signal(int n, float *const *in, float *const *out) +{ + + CopySamples(out[0],in[source],n); + + +} + +void tbssel::set_source(int i) +{ + if ((i>-1) && (i<CntInSig())) + { + source=i; + post("selecting inlet %i",i); + } + else + { + post("no such inlet"); + } + +} diff --git a/tbext/source/tbstrg.cpp b/tbext/source/tbstrg.cpp new file mode 100644 index 0000000..a999e2f --- /dev/null +++ b/tbext/source/tbstrg.cpp @@ -0,0 +1,95 @@ +/* Copyright (c) 2003 Tim Blechmann. */ +/* For information on usage and redistribution, and for a DISCLAIMER OF ALL */ +/* WARRANTIES, see the file, "COPYING" in this distribution. */ +/* */ +/* tbstrg can be used to switch between several modules. it requires a creation */ +/* argument (number of outlets). */ +/* if you send an integer to the inlet this outlet will get the message 1, the */ +/* outlet, that was active earlier, will get the message 0. */ +/* */ +/* */ +/* tbstrg uses the flext C++ layer for Max/MSP and PD externals. */ +/* get it at http://www.parasitaere-kapazitaeten.de/PD/ext */ +/* thanks to Thomas Grill */ +/* */ +/* */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* See file LICENSE for further informations on licensing terms. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software */ +/* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* */ +/* Based on PureData by Miller Puckette and others. */ +/* */ +/* */ +/* */ +/* coded while listening to: Bob Ostertag - DJ Of The Month */ +/* John Zorn's Cobra: Tokyo Operations '94 */ +/* */ +/* */ + + + +#include <flext.h> + +#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 400) +#error upgrade your flext version!!!!!! +#endif + +class tbstrg: public flext_base +{ + FLEXT_HEADER(tbstrg,flext_base); + +public: // constructor + tbstrg(t_int chan); + +protected: + void set_route(t_int i); + +private: + + FLEXT_CALLBACK(set_route,t_int); + t_int dest; +}; + + +FLEXT_LIB_1("tbstrg",tbstrg,int); + +tbstrg::tbstrg(t_int chan) +{ + AddInInt(); + + for (t_int i=0; i!=chan;++i) + { + AddOutAnything(); + } + + + FLEXT_ADDMETHOD(0,set_route); + dest=0; +} + +void tbstrg::set_route(t_int i) +{ + if (i != dest) + { + --i; + if ((i>-1) && (i<CntOut())) + { + ToOutInt(dest,0); + dest=i; + ToOutInt(dest,1); + } + } +} diff --git a/tbext/tbfft1.pd b/tbext/tbfft1.pd new file mode 100644 index 0000000..c9ced88 --- /dev/null +++ b/tbext/tbfft1.pd @@ -0,0 +1,44 @@ +#N canvas 245 106 453 369 10; +#N canvas 0 0 450 300 graph2 0; +#X array array1 63 float 1; +#A 0 0 0 0 0 0 0 0 0 0 -1 -1.24286 -1.45714 -1.61429 -1.7 -1.82857 +-1.88571 -1.92857 -2.04286 -2.17143 -2.18571 -2.2 -2.21429 -2.27143 +-2.28571 -2.28571 -2.3 -2.31429 -2.31429 -2.32857 -0.528571 -0.528571 +-0.542857 -0.514286 -0.485714 -0.4 -0.357143 -0.314286 -0.185714 -0.114286 +-0.0142857 0.185714 0.214286 0.314286 0.342857 0.4 0.5 0.514286 0.557143 +0.571429 0.628572 0.642857 0.671429 1.14286 0.428572 0.3 0.228572 0.157143 +0.114286 0.057143 0.057143 0.0428573 0.0428573 0; +#X coords 0 1 62 -1 200 140 1; +#X restore -67 3 graph; +#N canvas 0 0 450 300 graph3 0; +#X array array2 64 float 1; +#A 0 0 0 0 0 0 0 0 0 0 -0.4 -0.585 -0.685714 -0.767857 -0.824286 -0.869286 +-0.92 -0.945 -0.154551 -0.309103 -0.445624 -0.567631 -0.678947 -0.786968 +-0.876442 -0.953638 -1.02425 -1.04246 -0.02064 -0.031224 -0.04128 -0.0648 +-0.087 -0.147857 -0.191429 -0.4 -0.357143 -0.314286 -0.185714 -0.114286 +-0.0142857 0.185714 0.214286 0.314286 0.342857 0.4 0.5 0.514286 0.557143 +0.571429 0.628572 0.642857 0.671429 1.14286 0.428572 0.3 0.228572 0.157143 +0.114286 0.057143 0.057143 0.0428573 0.0428573 0 0; +#X coords 0 1 63 -1 200 140 1; +#X restore 159 1 graph; +#X obj -20 153 tabplay~ array1; +#X obj -78 189 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj -20 242 tabwrite~ array2; +#X obj -21 195 tbfft1~; +#X obj 164 152 hsl 128 15 -0.1 0.1 0 0 empty empty empty -2 -6 0 8 +-262144 -1 -1 0 1; +#X obj 150 216 hsl 128 15 0 44100 0 0 empty empty empty -2 -6 0 8 -262144 +-1 -1 1400 1; +#X msg 161 176 factor \$1; +#X msg 147 235 center \$1; +#X floatatom 272 188 5 0 0 0 - - -; +#X connect 2 0 5 0; +#X connect 3 0 2 0; +#X connect 3 0 4 0; +#X connect 5 0 4 0; +#X connect 6 0 8 0; +#X connect 6 0 10 0; +#X connect 7 0 9 0; +#X connect 8 0 5 0; +#X connect 9 0 5 0; diff --git a/tbext/tbfft2.pd b/tbext/tbfft2.pd new file mode 100644 index 0000000..044b4aa --- /dev/null +++ b/tbext/tbfft2.pd @@ -0,0 +1,50 @@ +#N canvas 245 106 453 369 10; +#N canvas 0 0 450 300 graph2 0; +#X array array1 63 float 1; +#A 0 0 0 0 0 0 0 0.0571429 0.142857 0.171429 0.228571 0.314286 0.385714 +0.457143 0.542857 0.628572 0.714286 0.757143 0.742857 0.714286 0.671429 +0.628571 0.6 0 0 0 0.00714286 0.0142857 0.0142857 0.0142857 0.0142857 +0.0142857 0.0142857 0.0142857 0.0142857 0.0142857 0.0142857 0.0142857 +0.0142857 0.0142857 0.0142857 0.0142857 0.0142857 0.0285714 0.0714286 +0.121429 0.171429 0.192857 0.214286 0.257143 0.328571 0.342857 0.385714 +0.414286 0.442857 1.86265e-09 0.0142857 0.0142857 0.0142857 0.0142857 +0.0142857 0.0142857 0.0142857 0.0142857; +#X coords 0 1 62 -1 200 140 1; +#X restore -67 3 graph; +#N canvas 444 250 450 300 graph3 0; +#X array array2 64 float 1; +#A 0 0 0 0 0 0 0 0.0571429 0.142857 0.171429 0.228571 0.314286 0.385714 +0.457143 0.542857 0.628572 0.714286 0.757143 0.742857 0.714286 0.671429 +0.628571 0.6 0 0 0 0.00714286 0.0142857 0.0142857 0.0142857 0.0142857 +0.0142857 0.0142857 0.0142857 0.0142857 0.0142857 0.0142857 0.0142857 +0.0142857 0.0142857 0.0142857 0.0142857 0.0142857 0.0285714 0.0714286 +0 0 0.0142857 0.0142857 0.0142857 0.0142857 0.0142857 0.0142857 0.0142857 +0.0142857 1.86265e-09 0.442857 0.414286 0.385714 0.342857 0.328571 +0.257143 0.214286 0.192857 0.171429; +#X coords 0 1 63 -1 200 140 1; +#X restore 148 4 graph; +#X obj -20 153 tabplay~ array1; +#X obj -78 189 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj -20 242 tabwrite~ array2; +#X obj 164 152 hsl 128 15 0 64 0 0 empty empty empty -2 -6 0 8 -262144 +-1 -1 2800 1; +#X obj 150 216 hsl 128 15 0 64 0 0 empty empty empty -2 -6 0 8 -262144 +-1 -1 10900 1; +#X msg 147 235 center \$1; +#X floatatom 272 188 5 0 0 0 - - -; +#X obj -21 195 tbfft2~; +#X msg 161 176 width \$1; +#X obj -20 329 print~; +#X obj 140 308 block~ 128; +#X connect 2 0 9 0; +#X connect 3 0 2 0; +#X connect 3 0 4 0; +#X connect 3 0 11 0; +#X connect 5 0 10 0; +#X connect 5 0 8 0; +#X connect 6 0 7 0; +#X connect 7 0 9 0; +#X connect 9 0 4 0; +#X connect 9 0 11 0; +#X connect 10 0 9 0; diff --git a/tbext/tbroute.pd b/tbext/tbroute.pd new file mode 100644 index 0000000..67d2003 --- /dev/null +++ b/tbext/tbroute.pd @@ -0,0 +1,13 @@ +#N canvas 234 137 450 300 10; +#X floatatom 135 43 5 0 0 0 - - -; +#X floatatom 135 141 5 0 0 0 - - -; +#X floatatom 164 159 5 0 0 0 - - -; +#X floatatom 193 188 5 0 0 0 - - -; +#X obj 135 111 tbroute 3; +#X floatatom 193 75 5 0 0 0 - - -; +#X text 236 74 destination; +#X connect 0 0 4 0; +#X connect 4 0 1 0; +#X connect 4 1 2 0; +#X connect 4 2 3 0; +#X connect 5 0 4 1; diff --git a/tbext/tbroute~.pd b/tbext/tbroute~.pd new file mode 100644 index 0000000..2f26dc3 --- /dev/null +++ b/tbext/tbroute~.pd @@ -0,0 +1,9 @@ +#N canvas 0 0 450 300 10; +#X obj 135 111 tbroute~ 2; +#X floatatom 222 69 5 0 0 0 - - -; +#X obj 136 63 osc~ 333; +#X obj 149 154 dac~; +#X connect 0 0 3 0; +#X connect 0 1 3 1; +#X connect 1 0 0 1; +#X connect 2 0 0 0; diff --git a/tbext/tbsig~.pd b/tbext/tbsig~.pd new file mode 100644 index 0000000..754e53b --- /dev/null +++ b/tbext/tbsig~.pd @@ -0,0 +1,16 @@ +#N canvas 189 120 631 300 10; +#X obj 102 42 osc~ 444; +#X obj 103 79 tbsig~; +#X msg 186 79 bang; +#N canvas 0 0 450 300 graph1 0; +#X array tmp 100 float 0; +#X coords 0 2 100 -2 150 100 1; +#X restore 460 135 graph; +#X msg 186 101 stop; +#X msg 183 129 set tmp; +#X obj 166 159 tabwrite~ tmp; +#X connect 0 0 1 0; +#X connect 1 0 6 0; +#X connect 2 0 6 0; +#X connect 4 0 6 0; +#X connect 5 0 6 0; diff --git a/tbext/tbstrg.pd b/tbext/tbstrg.pd new file mode 100644 index 0000000..e00ee0d --- /dev/null +++ b/tbext/tbstrg.pd @@ -0,0 +1,10 @@ +#N canvas 234 137 450 300 10; +#X floatatom 135 43 5 0 0 0 - - -; +#X floatatom 135 141 5 0 0 0 - - -; +#X floatatom 160 159 5 0 0 0 - - -; +#X floatatom 186 188 5 0 0 0 - - -; +#X obj 135 111 tbstrg 3; +#X connect 0 0 4 0; +#X connect 4 0 1 0; +#X connect 4 1 2 0; +#X connect 4 2 3 0; |