aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/xsample
diff options
context:
space:
mode:
Diffstat (limited to 'externals/grill/xsample')
-rw-r--r--externals/grill/xsample/maxmsp/xgroove~.helpbin7572 -> 7251 bytes
-rw-r--r--externals/grill/xsample/maxmsp/xplay~.helpbin4788 -> 4993 bytes
-rw-r--r--externals/grill/xsample/maxmsp/xrecord~.helpbin8271 -> 8522 bytes
-rwxr-xr-xexternals/grill/xsample/maxmsp/xsample.helpbin1147 -> 1256 bytes
-rw-r--r--externals/grill/xsample/pd/xgroove~.pd499
-rw-r--r--externals/grill/xsample/source/groove.cpp235
-rw-r--r--externals/grill/xsample/source/main.h4
-rwxr-xr-xexternals/grill/xsample/xsample.cwbin394881 -> 394881 bytes
8 files changed, 353 insertions, 385 deletions
diff --git a/externals/grill/xsample/maxmsp/xgroove~.help b/externals/grill/xsample/maxmsp/xgroove~.help
index a1cb7bbc..29bcd95f 100644
--- a/externals/grill/xsample/maxmsp/xgroove~.help
+++ b/externals/grill/xsample/maxmsp/xgroove~.help
Binary files differ
diff --git a/externals/grill/xsample/maxmsp/xplay~.help b/externals/grill/xsample/maxmsp/xplay~.help
index 7ef2b1be..d7d8d8b0 100644
--- a/externals/grill/xsample/maxmsp/xplay~.help
+++ b/externals/grill/xsample/maxmsp/xplay~.help
Binary files differ
diff --git a/externals/grill/xsample/maxmsp/xrecord~.help b/externals/grill/xsample/maxmsp/xrecord~.help
index 3d2db8b0..15c932f0 100644
--- a/externals/grill/xsample/maxmsp/xrecord~.help
+++ b/externals/grill/xsample/maxmsp/xrecord~.help
Binary files differ
diff --git a/externals/grill/xsample/maxmsp/xsample.help b/externals/grill/xsample/maxmsp/xsample.help
index aaf99ff6..bb9a5f1a 100755
--- a/externals/grill/xsample/maxmsp/xsample.help
+++ b/externals/grill/xsample/maxmsp/xsample.help
Binary files differ
diff --git a/externals/grill/xsample/pd/xgroove~.pd b/externals/grill/xsample/pd/xgroove~.pd
index b2b84517..e4e33272 100644
--- a/externals/grill/xsample/pd/xgroove~.pd
+++ b/externals/grill/xsample/pd/xgroove~.pd
@@ -1,279 +1,220 @@
-#N canvas 92 110 891 610 12;
-#X obj 258 240 hsl 128 15 0.001 3 1 1 empty empty empty 20 8 0 8 -225271
--1 -1 8500 1;
-#X floatatom 255 261 8 0 0 0 - - -;
-#X floatatom 275 312 8 0 0 0 - - -;
-#X floatatom 350 312 8 0 0 0 - - -;
-#X floatatom 273 372 8 0 0 0 - - -;
-#X floatatom 348 372 8 0 0 0 - - -;
-#X obj 275 419 loadbang;
-#X obj 274 445 metro 30;
-#X obj 275 471 snapshot~;
-#X floatatom 275 495 8 0 0 0 - - -;
-#X msg 258 82 loop \$1;
-#X obj 159 27 bng 15 250 50 0 empty empty empty 20 8 0 8 -258699 -1
--1;
-#X msg 158 47 stop;
-#N canvas 0 0 450 300 graph7 0;
-#X array buf 300 float 1;
-#A 0 0.665266 0.658123 0.65098 0.643838 0.636695 0.629552 0.622409
-0.615266 0.611933 0.6086 0.605266 0.601933 0.5986 0.595266 0.591933
-0.5886 0.585266 0.581933 0.5786 0.575266 0.571933 0.5686 0.565266 0.561933
-0.5586 0.555266 0.551933 0.5486 0.545266 0.541933 0.5386 0.535266 0.531933
-0.5286 0.525266 0.521933 0.5186 0.515267 0.512236 0.509206 0.506176
-0.503145 0.500115 0.497085 0.494054 0.491024 0.487994 0.484964 0.481933
-0.478903 0.475873 0.472842 0.469812 0.466782 0.463751 0.460721 0.457691
-0.454661 0.45163 0.4486 0.44557 0.442539 0.439509 0.436479 0.433448
-0.430418 0.427388 0.424358 0.421327 0.418297 0.415267 0.408449 0.401631
-0.394812 0.387994 0.381176 0.374358 0.36754 0.360722 0.353903 0.347085
-0.340267 0.333449 0.326631 0.319813 0.312994 0.306176 0.299358 0.29254
-0.285722 0.278903 0.272085 0.265267 0.260823 0.256378 0.251934 0.247489
-0.243045 0.238601 0.234156 0.229712 0.225267 0.220823 0.216378 0.211934
-0.20749 0.203045 0.198601 0.194156 0.189712 0.185267 0.180601 0.175934
-0.171267 0.166601 0.161934 0.157267 0.152601 0.147934 0.143267 0.138601
-0.133934 0.129267 0.124601 0.104601 0.104601 0.104601 0.104601 0.104601
-0.0846011 0.0846011 0.0846011 0.0646012 0.0579345 0.0512679 0.0446012
-0.0446012 0.0446012 0.0306011 0.0259344 0.0212678 0.0166011 0.0119345
-0.00726783 0.00260118 -0.00206548 -0.00673213 -0.0113988 -0.0160654
--0.0207321 -0.0253987 -0.0300654 -0.034732 -0.0408859 -0.0470397 -0.0531935
--0.0593474 -0.0655012 -0.071655 -0.0778088 -0.0839627 -0.0901165 -0.0962703
--0.102424 -0.108578 -0.114732 -0.118232 -0.121732 -0.125232 -0.128732
--0.132232 -0.135732 -0.139232 -0.142732 -0.146232 -0.149732 -0.153232
--0.156732 -0.160232 -0.163732 -0.167232 -0.170732 -0.174232 -0.177732
--0.181232 -0.184732 -0.188065 -0.191398 -0.194732 -0.198065 -0.201398
--0.204732 -0.208065 -0.211398 -0.214731 -0.218065 -0.221398 -0.224731
--0.228065 -0.231398 -0.234731 -0.238898 -0.243065 -0.247231 -0.251398
--0.255565 -0.259731 -0.263898 -0.268065 -0.272231 -0.276398 -0.280565
--0.284731 -0.290731 -0.296731 -0.302731 -0.308731 -0.314731 -0.319398
--0.324065 -0.328731 -0.333398 -0.338064 -0.342731 -0.347398 -0.352064
--0.356731 -0.356731 -0.364731 -0.372731 -0.380731 -0.388731 -0.396731
--0.401437 -0.406143 -0.410848 -0.415554 -0.42026 -0.424966 -0.429672
--0.434378 -0.439084 -0.44379 -0.448495 -0.453201 -0.457907 -0.462613
--0.467319 -0.472025 -0.476731 -0.483397 -0.490064 -0.496731 -0.501731
--0.50673 -0.51173 -0.51673 -0.52173 -0.52673 -0.53173 -0.53673 -0.54173
--0.546731 -0.552064 -0.557397 -0.562731 -0.568064 -0.573397 -0.57873
--0.584064 -0.589397 -0.59473 -0.600064 -0.605397 -0.61073 -0.616064
--0.621397 -0.62673 -0.62673 -0.62673 -0.62673 -0.62673 -0.62673 -0.62673
--0.62673 -0.63298 -0.63923 -0.64548 -0.65173 -0.65798 -0.66423 -0.67048
--0.67673 -0.68073 -0.68473 -0.68873 -0.69273 -0.72673 -0.72673 -0.74673
-;
-#X coords 0 1 299 -1 300 200 1;
-#X restore 521 23 graph;
-#X obj 171 574 dac~;
-#X msg 155 88 reset;
-#X text 290 292 min/max points;
-#X text 289 390 min/max points;
-#X text 348 495 position;
-#X text 181 24 start;
-#X text 198 45 stop;
-#X msg 156 113 help;
-#X text 416 234 speed;
-#X text 337 254 (float or signal);
-#X msg 156 169 set buf2;
-#X msg 157 144 set buf;
-#X msg 372 82 interp \$1;
-#X msg 240 312 all;
-#X obj 191 344 xgroove~ buf;
-#X text 255 10 looping mode;
-#X text 370 9 interpolation;
-#X msg 11 114 pos 100;
-#X msg 31 138 pos 200;
-#X obj 172 384 *~;
-#X msg 13 359 xzone \$1;
-#X obj 16 321 hsl 128 15 0 300 0 0 empty empty empty -2 -6 0 8 -262131
--1 -1 1500 1;
-#X floatatom 13 339 5 0 0 0 - - -;
-#X obj 258 32 vdl 15 0 0 3 empty empty empty 0 -6 0 8 -262144 -1 -1
-0;
-#X text 277 29 once;
-#X text 277 45 forward;
-#X text 277 61 bidir;
-#X obj 372 31 vdl 15 0 0 3 empty empty empty 0 -6 0 8 -262144 -1 -1
-0;
-#X text 391 28 none;
-#X text 391 44 linear;
-#X text 391 60 4-point;
-#X obj 256 134 vdl 15 0 0 4 empty empty empty 0 -6 0 8 -262144 -1 -1
-0;
-#X text 255 113 units;
-#X msg 256 199 units \$1;
-#X obj 364 134 vdl 15 0 0 4 empty empty empty 0 -6 0 8 -262144 -1 -1
-0;
-#X text 363 113 scale mode;
-#X msg 364 199 sclmode \$1;
-#X text 275 131 frames;
-#X text 275 147 buffer sz;
-#X text 275 163 ms;
-#X text 275 178 s;
-#X text 383 147 units in loop;
-#X text 383 163 buffer;
-#X text 383 178 loop;
-#X text 383 131 units in buffer;
-#X obj 646 475 osc~ 1000;
-#X obj 646 533 tabwrite~ buf;
-#X obj 658 502 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
--1;
-#X msg 679 503 stop;
-#X obj 319 343 print A;
-#X msg 131 213 getattributes;
-#X msg 177 248 getmax;
-#X msg 120 248 getmin;
-#N canvas 0 0 493 429 ramp 0;
-#X obj 85 248 line~;
-#X obj 84 307 outlet~;
-#X obj 139 61 route pos;
-#X obj 88 98 t b b f;
-#X obj 207 307 outlet;
-#X msg 186 268 pos \$1;
-#X obj 186 241 f;
-#X obj 139 31 inlet;
-#X obj 18 35 loadbang;
-#X obj 17 69 1;
-#X obj 258 31 inlet;
-#X obj 88 124 delay 0;
-#X obj 120 151 pack 0 0;
-#X obj 85 177 pack 1 0;
-#X connect 0 0 1 0;
-#X connect 2 0 3 0;
-#X connect 2 1 4 0;
-#X connect 3 0 11 0;
-#X connect 3 1 12 0;
-#X connect 3 2 6 1;
-#X connect 5 0 4 0;
-#X connect 6 0 5 0;
-#X connect 7 0 2 0;
-#X connect 8 0 9 0;
-#X connect 9 0 0 0;
-#X connect 10 0 11 1;
-#X connect 10 0 12 1;
-#X connect 10 0 13 1;
-#X connect 11 0 6 0;
-#X connect 11 0 13 0;
-#X connect 12 0 0 0;
-#X connect 13 0 0 0;
-#X restore 20 252 pd ramp;
-#X obj 49 199 loadbang;
-#X msg 49 224 10;
-#N canvas 0 0 450 300 graph2 0;
-#X array buf2 300 float 1;
-#A 0 0.0542877 0.0528716 0.0514554 0.0499469 0.0483065 0.0467235 0.0453892
-0.0444954 0.0441347 0.0441533 0.0443594 0.0445614 0.0446597 0.045062
-0.0455113 0.045605 0.0449404 0.043072 0.0400357 0.0364854 0.0330926
-0.0305273 0.0289475 0.0279315 0.027211 0.0265175 0.0256073 0.024616
-0.0236247 0.0226334 0.0216421 0.0206508 0.0196594 0.0186681 0.0176768
-0.0166855 0.0156941 0.0147029 0.0137115 0.0127203 0.0117289 0.0107376
-0.00974629 0.008755 0.00776365 0.0067723 0.00578102 0.00478967 0.00379839
-0.00280704 0.00181576 0.000824409 -0.000166872 -0.00115822 -0.0021495
--0.00314085 -0.00413213 -0.00512348 -0.00611476 -0.00710611 -0.00809747
--0.00908875 -0.0100801 -0.0110714 -0.0120627 -0.013054 -0.0140453 -0.0150366
--0.0160279 -0.0170192 -0.0180106 -0.0190019 -0.0199932 -0.0209845 -0.0219759
--0.0229672 -0.0239585 -0.0249498 -0.0259411 -0.0269325 -0.0279237 -0.0289151
--0.0299064 -0.0308783 -0.0318198 -0.032773 -0.0337804 -0.034885 -0.0361087
--0.0374184 -0.0387711 -0.0401239 -0.0414409 -0.0427481 -0.0440554 -0.0453626
--0.0466698 -0.047977 -0.0492843 -0.0505914 -0.0518987 -0.0532059 -0.0545132
--0.0558204 -0.0571277 -0.058435 -0.0597422 -0.0610494 -0.0623566 -0.0636639
--0.064971 -0.0662783 -0.0675855 -0.0688928 -0.0701999 -0.0715072 -0.0728144
--0.0741216 -0.0754288 -0.0767361 -0.0780434 -0.0793506 -0.0806578 -0.0819651
--0.0832723 -0.0845795 -0.0858868 -0.087194 -0.0885012 -0.0898084 -0.0911157
--0.0924229 -0.0937301 -0.0950373 -0.0963446 -0.0976517 -0.098959 -0.100266
--0.101573 -0.102881 -0.104188 -0.105495 -0.106802 -0.10811 -0.109438
--0.110829 -0.112215 -0.113519 -0.114664 -0.115596 -0.116359 -0.117031
--0.117687 -0.118401 -0.119144 -0.119888 -0.120631 -0.121374 -0.122118
--0.122861 -0.123605 -0.124348 -0.125092 -0.125835 -0.126579 -0.127322
--0.128066 -0.128809 -0.129553 -0.130296 -0.13104 -0.131783 -0.132527
--0.13327 -0.134014 -0.134757 -0.135501 -0.136244 -0.136988 -0.137731
--0.138475 -0.139218 -0.139962 -0.140705 -0.141449 -0.142192 -0.142936
--0.143679 -0.144423 -0.145166 -0.14591 -0.146653 -0.147397 -0.14814
--0.148884 -0.149627 -0.150371 -0.151114 -0.151858 -0.152601 -0.153345
--0.154088 -0.154832 -0.155575 -0.156319 -0.157062 -0.157806 -0.158549
--0.159292 -0.160036 -0.160779 -0.161523 -0.162266 -0.16301 -0.163753
--0.164497 -0.16524 -0.165984 -0.166727 -0.167471 -0.168214 -0.168958
--0.169701 -0.170445 -0.171188 -0.171932 -0.172675 -0.173419 -0.174162
--0.174906 -0.175649 -0.176393 -0.177136 -0.17788 -0.178623 -0.179367
--0.18011 -0.180854 -0.181598 -0.182346 -0.183095 -0.18384 -0.184575
--0.185297 -0.186007 -0.186711 -0.187414 -0.188119 -0.188827 -0.189535
--0.190243 -0.190951 -0.191659 -0.192367 -0.193076 -0.193784 -0.194492
--0.1952 -0.195908 -0.196616 -0.197324 -0.198032 -0.19874 -0.199448
--0.200156 -0.200864 -0.201572 -0.20228 -0.202989 -0.203697 -0.204405
--0.205113 -0.205821 -0.206529 -0.207237 -0.207945 -0.208653 -0.209361
--0.210069 -0.210777 -0.211485 -0.212193 -0.212901 -0.213609 -0.214317
--0.215026 -0.215734 -0.216442 -0.21715 -0.217859 -0.218567 -0.219275
--0.219983 -0.220691 -0.221399 -0.222107 -0.222815 -0.223523 -0.224231
--0.224939;
-#X coords 0 1 299 -1 300 140 1;
-#X restore 521 232 graph;
-#X obj 228 516 tabwrite~ buf2;
-#X obj 211 483 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
--1;
-#X obj 15 421 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -262131
--1 -1 0 1;
-#X msg 12 397 0.5;
-#X obj 172 548 *~;
-#X obj 228 553 hsl 128 15 0.0001 1 1 0 empty empty empty -2 -6 0 8
--261689 -1 -1 8800 1;
-#X obj 226 573 nbx 5 14 -1e+037 1e+037 0 0 empty empty empty 0 -6 0
-10 -261689 -1 -1 0.059109 256;
-#X msg 12 440 xshape 2 \$1;
-#X msg 11 564 xfade \$1;
-#X obj 10 499 vdl 15 0 0 4 empty empty empty 0 -6 0 8 -262144 -1 -1
-0;
-#X text 9 480 loop zone mode;
-#X text 29 498 keep loop pos;
-#X text 29 514 keep loop length;
-#X text 29 530 keep fade length;
-#X text 29 545 inside loop;
-#X connect 0 0 1 0;
-#X connect 1 0 28 0;
-#X connect 2 0 28 1;
-#X connect 3 0 28 2;
-#X connect 6 0 7 0;
-#X connect 7 0 8 0;
-#X connect 7 0 71 0;
-#X connect 8 0 9 0;
-#X connect 10 0 28 0;
-#X connect 11 0 28 0;
-#X connect 12 0 28 0;
-#X connect 15 0 28 0;
-#X connect 21 0 28 0;
-#X connect 24 0 28 0;
-#X connect 25 0 28 0;
-#X connect 26 0 28 0;
-#X connect 27 0 28 0;
-#X connect 28 0 33 1;
-#X connect 28 0 71 0;
-#X connect 28 1 8 0;
-#X connect 28 2 4 0;
-#X connect 28 3 5 0;
-#X connect 28 5 63 0;
-#X connect 31 0 67 0;
-#X connect 32 0 67 0;
-#X connect 33 0 75 0;
-#X connect 34 0 28 0;
-#X connect 35 0 36 0;
-#X connect 36 0 34 0;
-#X connect 37 0 10 0;
-#X connect 41 0 26 0;
-#X connect 45 0 47 0;
-#X connect 47 0 28 0;
-#X connect 48 0 50 0;
-#X connect 50 0 28 0;
-#X connect 59 0 60 0;
-#X connect 61 0 60 0;
-#X connect 62 0 60 0;
-#X connect 64 0 28 0;
-#X connect 65 0 28 0;
-#X connect 66 0 28 0;
-#X connect 67 0 33 0;
-#X connect 67 1 28 0;
-#X connect 68 0 69 0;
-#X connect 69 0 67 1;
-#X connect 72 0 71 0;
-#X connect 73 0 78 0;
-#X connect 74 0 73 0;
-#X connect 75 0 14 0;
-#X connect 75 0 14 1;
-#X connect 76 0 75 1;
-#X connect 76 0 77 0;
-#X connect 78 0 28 0;
-#X connect 79 0 28 0;
-#X connect 80 0 79 0;
+#N canvas 90 37 923 642 12;
+#X obj 225 248 hsl 128 15 0.001 3 1 1 empty empty empty 20 8 0 8 -225271
+-1 -1 9300 1;
+#X floatatom 222 269 8 0 0 0 - - -;
+#X floatatom 291 311 8 0 0 0 - - -;
+#X floatatom 376 311 8 0 0 0 - - -;
+#X floatatom 277 419 8 0 0 0 - - -;
+#X floatatom 362 419 8 0 0 0 - - -;
+#X obj 355 487 loadbang;
+#X obj 271 514 snapshot~;
+#X msg 215 74 loop \$1;
+#X obj 28 9 bng 15 250 50 0 empty empty empty 20 8 0 8 -258699 -1 -1
+;
+#X msg 27 29 stop;
+#N canvas 0 22 450 300 graph7 0;
+#X array buf 300 float 1;
+#A 0 -0.582363 -0.691892 -0.787404 -0.866945 -0.928937 -0.972085 -0.995541
+-0.998834 -0.981862 -0.945015 -0.889003 -0.814977 -0.724451 -0.61922
+-0.501456 -0.373526 -0.238025 -0.0977039 0.0445999 0.185999 0.32363
+0.454698 0.576562 0.686728 0.782985 0.863382 0.926264 0.970396 0.994847
+0.99914 0.983202 0.947311 0.892244 0.819087 0.729329 0.624807 0.507601
+0.380121 0.244937 0.104787 -0.0374852 -0.178997 -0.316882 -0.448349
+-0.570721 -0.681541 -0.778536 -0.859758 -0.92357 -0.968641 -0.994105
+-0.999411 -0.984463 -0.949585 -0.895432 -0.823155 -0.734191 -0.630344
+-0.513736 -0.386701 -0.251839 -0.111872 0.0303626 0.171983 0.310115
+0.441964 0.564863 0.676301 0.774049 0.856099 0.920802 0.966862 0.993299
+0.999629 0.985693 0.951778 0.898595 0.827173 0.739006 0.635861 0.519824
+0.393264 0.258724 0.118945 -0.0232443 -0.164962 -0.30334 -0.435566
+-0.558966 -0.671048 -0.769513 -0.852401 -0.918006 -0.965005 -0.99247
+-0.999788 -0.986869 -0.953946 -0.901683 -0.831168 -0.743785 -0.641342
+-0.525904 -0.3998 -0.265603 -0.126018 0.0161191 0.157931 0.296538 0.429142
+0.553044 0.665739 0.764956 0.848646 0.915158 0.963118 0.991554 0.999919
+0.987988 0.956055 0.904748 0.835094 0.748535 0.646789 0.531944 0.406322
+0.272459 0.13308 -0.00899858 -0.150893 -0.289734 -0.422695 -0.547099
+-0.660411 -0.760337 -0.844873 -0.912259 -0.961177 -0.990614 -0.999967
+-0.989077 -0.958117 -0.907755 -0.839002 -0.753231 -0.652213 -0.537965
+-0.412819 -0.279312 -0.140138 0.00187238 0.143845 0.282902 0.416234
+0.541116 0.655044 0.755694 0.841024 0.909331 0.959182 0.989612 0.99999
+0.990087 0.960142 0.910718 0.842848 0.757905 0.657587 0.543957 0.419296
+0.286139 0.147188 0.00524875 -0.136795 -0.276066 -0.409741 -0.535123
+-0.649643 -0.75101 -0.837158 -0.90633 -0.957157 -0.988561 -0.999946
+-0.991073 -0.962097 -0.913646 -0.846662 -0.762527 -0.662949 -0.549918
+-0.425756 -0.292961 -0.15423 -0.0123749 0.129731 0.26921 0.403233 0.52908
+0.644218 0.746283 0.833235 0.903305 0.955055 0.987472 0.999857 0.991988
+0.964027 0.916507 0.850435 0.767117 0.668254 0.555861 0.432186 0.299763
+0.161263 0.019495 -0.122669 -0.262344 -0.396705 -0.523029 -0.638745
+-0.741533 -0.829275 -0.900221 -0.952932 -0.986312 -0.999726 -0.992864
+-0.965886 -0.919348 -0.854154 -0.771671 -0.673542 -0.561762 -0.438609
+-0.306552 -0.168292 -0.0266195 0.115592 0.255464 0.390152 0.516939
+0.633253 0.736723 0.82528 0.897096 0.950738 0.985126 0.999526 0.993692
+0.967708 0.922114 0.85785 0.776175 0.678789 0.567642 0.444989 0.313328
+0.175306 0.0337374 -0.108516 -0.248569 -0.38359 -0.510829 -0.627721
+-0.731898 -0.821227 -0.893933 -0.948509 -0.983866 -0.999301 -0.994457
+-0.969482 -0.924852 -0.861476 -0.780662 -0.684 -0.573494 -0.451363
+-0.320082 -0.18232 -0.0408586 0.101429 0.241663 0.376994 0.504694 0.622158
+0.727016 0.817152 0.890707 0.946232 0.98257 0.998995 0.995196 0.971196
+0.927537 0.865077 0.785079 0.689188;
+#X coords 0 1 299 -1 300 200 1;
+#X restore 573 199 graph;
+#X obj 22 561 dac~;
+#X msg 27 69 reset;
+#X text 293 291 min/max points;
+#X text 429 515 position;
+#X text 50 6 start;
+#X text 67 27 stop;
+#X msg 26 95 help;
+#X text 383 242 speed;
+#X text 304 262 (float or signal);
+#X msg 25 161 set buf2;
+#X msg 26 136 set buf;
+#X msg 369 71 interp \$1;
+#X msg 249 310 all;
+#X obj 191 344 xgroove~ buf;
+#X text 212 2 looping mode;
+#X text 367 -2 interpolation;
+#X obj 215 24 vdl 15 0 0 3 empty empty empty 0 -6 0 8 -262144 -1 -1
+0;
+#X text 234 21 once;
+#X text 234 37 forward;
+#X obj 368 21 vdl 15 0 0 3 empty empty empty 0 -6 0 8 -262144 -1 -1
+0;
+#X text 388 17 none;
+#X text 389 50 linear;
+#X obj 215 138 vdl 15 0 0 4 empty empty empty 0 -6 0 8 -262144 -1 -1
+0;
+#X text 214 115 units;
+#X msg 215 203 units \$1;
+#X obj 365 138 vdl 15 0 0 4 empty empty empty 0 -6 0 8 -262144 -1 -1
+0;
+#X msg 366 202 sclmode \$1;
+#X text 234 135 frames;
+#X text 234 167 ms;
+#X text 234 182 s;
+#X text 385 150 units in loop;
+#X text 385 166 buffer;
+#X text 385 181 loop;
+#X text 385 134 units in buffer;
+#X obj 769 92 osc~ 1000;
+#X obj 769 150 tabwrite~ buf;
+#X obj 754 70 bng 15 250 50 0 empty empty empty 0 -6 0 8 -225271 -1
+-1;
+#X msg 802 120 stop;
+#X obj 323 345 print A;
+#X msg 24 298 getattributes;
+#X msg 23 325 getmin;
+#N canvas 0 22 450 300 graph2 0;
+#X array buf2 300 float 0;
+#X coords 0 1 299 -1 300 140 1;
+#X restore 573 458 graph;
+#X obj 271 576 tabwrite~ buf2;
+#X obj 23 535 *~;
+#X obj 79 540 hsl 128 15 0.0001 1 1 0 empty empty empty -2 -6 0 8 -261689
+-1 -1 0 1;
+#X obj 77 560 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10
+-261689 -1 -1 0 256;
+#X msg 25 249 pos \$1;
+#X msg 63 220 200;
+#X msg 25 221 100;
+#X text 23 201 set position;
+#X obj 270 488 metro 50;
+#X obj 788 70 nbx 5 14 0 1e+37 0 1 empty empty empty 0 -6 0 10 -225271
+-1 -1 1000 256;
+#X text 718 47 generate oscillation;
+#X text 140 558 volume;
+#N canvas 83 212 459 293 loopzone 0;
+#X obj 29 235 outlet;
+#X msg 30 64 xzone \$1;
+#X obj 33 23 hsl 128 15 0 300 0 0 empty empty empty -2 -6 0 8 -262131
+-1 -1 0 1;
+#X floatatom 30 44 5 0 0 0 - - -;
+#X msg 205 187 xfade \$1;
+#X obj 205 122 vdl 15 0 0 4 empty empty empty 0 -6 0 8 -262144 -1 -1
+0;
+#X text 204 103 loop zone mode;
+#X text 224 121 keep loop pos;
+#X text 224 137 keep loop length;
+#X text 224 153 keep fade length;
+#X msg 49 185 xshape \$1;
+#X obj 50 135 vdl 15 0 0 3 empty empty empty 0 -6 0 8 -262144 -1 -1
+0;
+#X text 47 113 fade zone shape;
+#X text 69 132 linear;
+#X text 69 148 quarter sine;
+#X text 69 164 half sine;
+#X text 127 47 length of the loop zone;
+#X text 125 64 (in units);
+#X text 224 168 zone inside loop;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X connect 3 0 1 0;
+#X connect 4 0 0 0;
+#X connect 5 0 4 0;
+#X connect 10 0 0 0;
+#X connect 11 0 10 0;
+#X restore 21 409 pd loopzone;
+#X text 102 137 set buffer;
+#X text 21 373 settings for;
+#X text 20 390 cross-fading loop zone;
+#X text 387 345 print attributes;
+#X obj 274 391 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X text 294 388 bang on loop end;
+#X text 280 439 min/max points (sample rounded);
+#X text 365 99 scale mode;
+#X text 361 114 (pos message and position outlet);
+#X text 235 52 bidirectional;
+#X text 234 151 buffer size;
+#X obj 574 402 hsl 300 15 0 300 0 0 empty bufpos empty -2 -6 0 8 -262144
+-1 -1 24497 1;
+#X obj 368 519 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10
+-262144 -1 -1 245.785 256;
+#X obj 279 538 s bufpos;
+#X text 389 34 4-point (default);
+#X msg 93 325 getmax;
+#X connect 0 0 1 0;
+#X connect 1 0 25 0;
+#X connect 2 0 25 1;
+#X connect 3 0 25 2;
+#X connect 6 0 62 0;
+#X connect 7 0 79 0;
+#X connect 7 0 80 0;
+#X connect 8 0 25 0;
+#X connect 9 0 25 0;
+#X connect 10 0 25 0;
+#X connect 13 0 25 0;
+#X connect 18 0 25 0;
+#X connect 21 0 25 0;
+#X connect 22 0 25 0;
+#X connect 23 0 25 0;
+#X connect 24 0 25 0;
+#X connect 25 0 54 0;
+#X connect 25 0 55 0;
+#X connect 25 1 7 0;
+#X connect 25 2 4 0;
+#X connect 25 3 5 0;
+#X connect 25 4 71 0;
+#X connect 25 5 50 0;
+#X connect 28 0 8 0;
+#X connect 31 0 23 0;
+#X connect 34 0 36 0;
+#X connect 36 0 25 0;
+#X connect 37 0 38 0;
+#X connect 38 0 25 0;
+#X connect 46 0 47 0;
+#X connect 48 0 47 0;
+#X connect 49 0 47 0;
+#X connect 51 0 25 0;
+#X connect 52 0 25 0;
+#X connect 55 0 12 0;
+#X connect 55 0 12 1;
+#X connect 56 0 55 1;
+#X connect 56 0 57 0;
+#X connect 58 0 25 0;
+#X connect 59 0 58 0;
+#X connect 60 0 58 0;
+#X connect 62 0 7 0;
+#X connect 62 0 54 0;
+#X connect 63 0 46 1;
+#X connect 66 0 25 0;
+#X connect 82 0 25 0;
diff --git a/externals/grill/xsample/source/groove.cpp b/externals/grill/xsample/source/groove.cpp
index 0da9087c..f96b33bb 100644
--- a/externals/grill/xsample/source/groove.cpp
+++ b/externals/grill/xsample/source/groove.cpp
@@ -17,7 +17,7 @@ WARRANTIES, see the file, "license.txt," in this distribution.
#endif
-#define XZONE_TABLE 512
+#define XZONE_TABLE 64
class xgroove:
@@ -45,14 +45,11 @@ public:
virtual V m_max(F mx);
V ms_xfade(I xf);
+ V ms_xshape(I sh);
V ms_xzone(F xz);
V mg_xzone(F &xz) { xz = _xzone*s2u; }
- V m_xshape(I argc = 0,const t_atom *argv = NULL);
- inline V ms_xshape(const AtomList &ret) { m_xshape(ret.Count(),ret.Atoms()); }
- V mg_xshape(AtomList &ret) const;
-
enum xs_loop {
xsl__ = -1, // don't change
xsl_once = 0,xsl_loop,xsl_bidir
@@ -63,6 +60,11 @@ public:
xsf_keeplooppos = 0,xsf_keeplooplen,xsf_keepfade,xsf_inside
};
+ enum xs_shape {
+ xss__ = -1, // don't change
+ xss_lin = 0,xss_qsine,xss_hsine
+ };
+
V m_loop(xs_loop lp = xsl__);
protected:
@@ -75,8 +77,6 @@ protected:
L znsmin,znsmax;
xs_fade xfade;
I xshape;
- F xshparam;
- D znmin,znmax;
S **znbuf;
S *znpos,*znmul,*znidx;
I pblksz;
@@ -129,6 +129,8 @@ private:
zerofun(n,in,out);
}
+ static S fade_lin[],fade_qsine[],fade_hsine[];
+
FLEXT_CALLBACK_F(m_pos)
FLEXT_CALLBACK_F(m_posmod)
FLEXT_CALLBACK_F(m_min)
@@ -137,9 +139,10 @@ private:
FLEXT_CALLSET_I(ms_xfade)
FLEXT_ATTRGET_I(xfade)
+ FLEXT_CALLSET_I(ms_xshape)
+ FLEXT_ATTRGET_I(xshape)
FLEXT_CALLSET_F(ms_xzone)
FLEXT_CALLGET_F(mg_xzone)
- FLEXT_CALLVAR_V(mg_xshape,ms_xshape)
FLEXT_CALLVAR_F(mg_pos,m_pos)
FLEXT_CALLSET_F(m_min)
@@ -152,6 +155,14 @@ private:
FLEXT_LIB_DSP_V("xgroove~",xgroove)
+S xgroove::fade_lin[XZONE_TABLE+1];
+S xgroove::fade_qsine[XZONE_TABLE+1];
+S xgroove::fade_hsine[XZONE_TABLE+1];
+
+#ifndef PI
+#define PI 3.14159265358979f
+#endif
+
V xgroove::setup(t_classid c)
{
DefineHelp(c,"xgroove~");
@@ -169,14 +180,27 @@ V xgroove::setup(t_classid c)
FLEXT_CADDATTR_VAR(c,"xfade",xfade,ms_xfade);
FLEXT_CADDATTR_VAR(c,"xzone",mg_xzone,ms_xzone);
- FLEXT_CADDATTR_VAR(c,"xshape",mg_xshape,ms_xshape);
+ FLEXT_CADDATTR_VAR(c,"xshape",xshape,ms_xshape);
+
+ // initialize fade tables
+ for(int i = 0; i <= XZONE_TABLE; ++i) {
+ const float x = i*(1.f/XZONE_TABLE);
+ // linear
+ fade_lin[i] = x;
+
+ // quarter sine wave
+ fade_qsine[i] = sin(x*(PI/2));
+
+ // half sine wave
+ fade_hsine[i] = (sin(x*PI-PI/2)+1.f)*0.5f;
+ }
}
xgroove::xgroove(I argc,const t_atom *argv):
loopmode(xsl_loop),curpos(0),
_xzone(0),xzone(0),pblksz(0),
- xfade(xsf_keeplooppos),xshape(0),xshparam(1),
- znbuf(NULL),znmul(NULL),znidx(NULL),znpos(NULL),
+ xfade(xsf_keeplooppos),xshape(xss_lin),
+ znidx(NULL),znpos(NULL),
bidir(1)
{
I argi = 0;
@@ -195,7 +219,7 @@ xgroove::xgroove(I argc,const t_atom *argv):
argi++;
#if FLEXT_SYS == FLEXT_SYS_MAX
- // oldstyle command line?
+ // old-style command line?
if(argi == 1 && argc == 2 && CanbeInt(argv[argi])) {
outchns = GetAInt(argv[argi]);
argi++;
@@ -222,23 +246,19 @@ xgroove::xgroove(I argc,const t_atom *argv):
// don't know vector size yet -> wait for m_dsp
znbuf = new S *[outchns];
for(I i = 0; i < outchns; ++i) znbuf[i] = NULL;
- znpos = NULL;
- znidx = NULL;
- znmul = new S[XZONE_TABLE+1];
- m_xshape();
+ ms_xshape(xshape);
}
xgroove::~xgroove()
{
if(znbuf) {
- for(I i = 0; i < outchns; ++i) if(znbuf[i]) delete[] znbuf[i];
+ for(I i = 0; i < outchns; ++i) if(znbuf[i]) FreeAligned(znbuf[i]);
delete[] znbuf;
}
- if(znpos) delete[] znpos;
- if(znidx) delete[] znidx;
- delete[] znmul;
+ if(znpos) FreeAligned(znpos);
+ if(znidx) FreeAligned(znidx);
}
BL xgroove::Init()
@@ -314,56 +334,32 @@ V xgroove::ms_xzone(F xz)
s_dsp();
}
-V xgroove::m_xshape(I argc,const t_atom *argv)
+V xgroove::ms_xshape(I sh)
{
- const F pi = 3.14159265358979f;
- xshape = 0;
- xshparam = 1;
- if(argc >= 1 && CanbeInt(argv[0])) xshape = GetAInt(argv[0]);
- if(argc >= 2 && CanbeFloat(argv[1])) {
- xshparam = GetAFloat(argv[1]);
-/*
- // clip to 0..1
- if(xshparam < 0) xshparam = 0;
- else if(xshparam > 1) xshparam = 1;
-*/
- }
-
- I i;
+ xshape = (xs_shape)sh;
switch(xshape) {
- case 1:
- // sine half wave
- for(i = 0; i <= XZONE_TABLE; ++i)
- znmul[i] = sin(i*pi/(XZONE_TABLE*2))*xshparam+i*(1.f/XZONE_TABLE)*(1.f-xshparam);
- break;
- case 2:
- // sine full wave
- for(i = 0; i <= XZONE_TABLE; ++i)
- znmul[i] = ((sin(i*(pi/XZONE_TABLE)-pi*0.5f)+1.f)*0.5f)*xshparam+i*(1.f/XZONE_TABLE)*(1.f-xshparam);
- break;
- case 0:
- default:
- // linear
- for(i = 0; i <= XZONE_TABLE; ++i)
- znmul[i] = i*(1.f/XZONE_TABLE);
+ case xss_qsine: znmul = fade_qsine; break;
+ case xss_hsine: znmul = fade_hsine; break;
+ default:
+ post("%s - shape parameter invalid, set to linear",thisName());
+ case xss_lin:
+ znmul = fade_lin; break;
}
-}
-V xgroove::mg_xshape(AtomList &ret) const
-{
- ret(2);
- SetInt(ret[0],xshape);
- SetFloat(ret[1],xshparam);
+ // no need to recalc the fade zone here
}
-
V xgroove::do_xzone()
{
- if(!s2u) return; // this can happen if DSP is off
+ // \todo do we really need this?
+ if(!s2u) return; // this can happen if DSP is off
xzone = _xzone; // make a copy for changing it
- if(xfade == xsf_inside) { // fade zone goes inside the loop -> loop gets shorter
+ if(xfade == xsf_inside) {
+ // fade zone goes inside the loop -> loop becomes shorter
+
+ // \todo what about round-off?
const L maxfd = (curmax-curmin)/2;
if(xzone > maxfd) xzone = maxfd;
@@ -371,14 +367,20 @@ V xgroove::do_xzone()
}
else if(xfade == xsf_keepfade) {
// try to keep fade zone
- // shifting of loop bounds may happen
+ // change of loop bounds may happen
// restrict xzone to half of buffer
const L maxfd = buf->Frames()/2;
if(xzone > maxfd) xzone = maxfd;
- znsmin = curmin-xzone/2;
- znsmax = curmax+xzone/2;
+ // \todo what about round-off?
+ znsmin = curmin-(L)(xzone/2);
+ znsmax = curmax+(L)(xzone/2);
+
+ // widen loop if xzone doesn't fit into it
+ // \todo check formula
+ L lack = (L)ceil((xzone*2-(znsmax-znsmin))/2);
+ if(lack > 0) znsmin -= lack,znsmax += lack;
// check buffer limits and shift bounds if necessary
if(znsmin < 0) {
@@ -392,11 +394,14 @@ V xgroove::do_xzone()
// try to keep loop length
// shifting of loop bounds may happen
- const L maxfd = buf->Frames()-(curmax-curmin);
+ const L plen = curmax-curmin;
+ if(xzone > plen) xzone = plen;
+ const L maxfd = buf->Frames()-plen;
if(xzone > maxfd) xzone = maxfd;
- znsmin = curmin-xzone/2;
- znsmax = curmax+xzone/2;
+ // \todo what about round-off?
+ znsmin = curmin-(L)(xzone/2);
+ znsmax = curmax+(L)(xzone/2);
// check buffer limits and shift bounds if necessary
// both cases can't happen because of xzone having been limited above
@@ -412,8 +417,13 @@ V xgroove::do_xzone()
else if(xfade == xsf_keeplooppos) {
// try to keep loop position and length
- znsmin = curmin-xzone/2;
- znsmax = curmax+xzone/2;
+ // restrict fade zone to maximum length
+ const L plen = curmax-curmin;
+ if(xzone > plen) xzone = plen;
+
+ // \todo what about round-off?
+ znsmin = curmin-(L)(xzone/2);
+ znsmax = curmax+(L)(xzone/2);
L ovr = znsmax-buf->Frames();
if(-znsmin > ovr) ovr = -znsmin;
@@ -424,9 +434,6 @@ V xgroove::do_xzone()
}
}
- znmin = znsmin+xzone;
- znmax = znsmax-xzone;
-
FLEXT_ASSERT(znsmin <= znsmax && (znsmax-znsmin) >= xzone*2);
}
@@ -631,7 +638,6 @@ V xgroove::s_pos_loopzn(I n,S *const *invecs,S *const *outvecs)
FLEXT_ASSERT(xzone);
const F xz = xzone,xf = (F)XZONE_TABLE/xz;
- const D lmin = znmin,lmax = znmax,lsh = lmax-lmin+xz;
// adapt the playing bounds to the current cross-fade zone
const L smin = znsmin,smax = znsmax,plen = smax-smin;
@@ -640,30 +646,53 @@ V xgroove::s_pos_loopzn(I n,S *const *invecs,S *const *outvecs)
BL inzn = false;
register D o = curpos;
+ // calculate inner cross-fade boundaries
+ const D lmin = smin+xz,lmax = smax-xz,lsh = lmax-lmin+xz;
+ const D lmin2 = lmin-xz/2,lmax2 = lmax+xz/2;
+
for(I i = 0; i < n; ++i) {
- // \TODO: exploit relationships: smin <= lmin, smax >= lmax
-
// normalize offset
- if(!(o < smax)) {
- o = fmod(o-smin,plen)+smin;
- lpbang = true;
- }
- else if(o < smin) {
+ if(o < smin) {
o = fmod(o-smin,plen)+smax;
lpbang = true;
}
-
- if(o >= lmax) {
- // in late cross-fade zone
- o -= lsh;
+ else if(!(o < smax)) {
+ o = fmod(o-smin,plen)+smin;
+ lpbang = true;
}
- // now: smin <= o < smax
if(o < lmin) {
- // in early cross-fade zone
- register F inp = xz+(F)(o-lmin); // 0 <= inp < xz
+ register F inp;
+ if(o < lmin2) {
+ o += lsh;
+ lpbang = true;
+ // now lmax <= o <= lmax2
+
+ inp = xz-(F)(o-lmax); // 0 <= inp < xz
+ znpos[i] = lmin-inp;
+ }
+ else { // in early cross-fade zone
+ inp = xz+(F)(o-lmin); // 0 <= inp < xz
+ znpos[i] = lmax+inp;
+ }
+ znidx[i] = inp*xf;
+ inzn = true;
+ }
+ else if(!(o < lmax)) {
+ register F inp;
+ if(!(o < lmax2)) {
+ o -= lsh;
+ lpbang = true;
+ // now lmin2 <= o <= lmin
+
+ inp = xz+(F)(o-lmin); // 0 <= inp < xz
+ znpos[i] = lmax+inp;
+ }
+ else { // in late cross-fade zone
+ inp = xz-(F)(o-lmax); // 0 <= inp < xz
+ znpos[i] = lmin-inp;
+ }
znidx[i] = inp*xf;
- znpos[i] = lmax+inp;
inzn = true;
}
else
@@ -675,14 +704,16 @@ V xgroove::s_pos_loopzn(I n,S *const *invecs,S *const *outvecs)
}
// normalize and store current playing position
- if(o < znsmin) o += plen;
setpos(o);
// calculate samples (1st voice)
playfun(n,&pos,outvecs);
+ // rescale position vector
+ arrscale(n,pos,pos);
+
if(inzn) {
- // only if we are in cross-fade zone
+ // only if we have touched the cross-fade zone
// calculate samples in loop zone (2nd voice)
playfun(n,&znpos,znbuf);
@@ -690,20 +721,17 @@ V xgroove::s_pos_loopzn(I n,S *const *invecs,S *const *outvecs)
// calculate counterpart in loop fade
arrscale(n,znidx,znpos,XZONE_TABLE,-1);
- // calculate fade coefficients
+ // calculate fade coefficients by sampling from the fade curve
zonefun(znmul,0,XZONE_TABLE+1,n,1,1,&znidx,&znidx);
zonefun(znmul,0,XZONE_TABLE+1,n,1,1,&znpos,&znpos);
// mix voices for all channels
for(I o = 0; o < outchns; ++o) {
- F *ov = outvecs[o],*ob = znbuf[o];
- for(I i = 0; i < n; ++i,ov++,ob++)
- *ov = (*ov)*znidx[i]+(*ob)*znpos[i];
+ MulSamples(outvecs[o],outvecs[o],znidx,n);
+ MulSamples(znbuf[o],znbuf[o],znpos,n);
+ AddSamples(outvecs[o],outvecs[o],znbuf[o],n);
}
}
-
- // rescale position vector
- arrscale(n,pos,pos);
}
else
s_pos_off(n,invecs,outvecs);
@@ -770,14 +798,14 @@ V xgroove::s_dsp()
if(pblksz != blksz) {
for(I o = 0; o < outchns; ++o) {
- if(znbuf[o]) delete[] znbuf[o];
- znbuf[o] = new S[blksz];
+ if(znbuf[o]) FreeAligned(znbuf[o]);
+ znbuf[o] = (S *)NewAligned(blksz*sizeof(S));
}
- if(znpos) delete[] znpos;
- znpos = new S[blksz];
- if(znidx) delete[] znidx;
- znidx = new S[blksz];
+ if(znpos) FreeAligned(znpos);
+ znpos = (S *)NewAligned(blksz*sizeof(S));
+ if(znidx) FreeAligned(znidx);
+ znidx = (S *)NewAligned(blksz*sizeof(S));
pblksz = blksz;
}
@@ -838,9 +866,8 @@ V xgroove::m_help()
post("\t@units 0/1/2/3: set units to frames/buffer size/ms/s");
post("\t@sclmode 0/1/2/3: set range of position to units/units in loop/buffer/loop");
post("\t@xzone {unit}: length of loop crossfade zone");
- post("\t@xsymm -1,0...1: symmetry of crossfade zone inside/outside point");
- post("\t@xshape 0/1 [param 0...1]: shape of crossfading (linear/trig)");
- post("\t@xkeep 0/1: try to preserve xzone/loop length");
+ post("\t@xfade 0/1/2/3: fade mode (keep loop/keep loop length/keep fade/inside loop)");
+ post("\t@xshape 0/1/2: shape of crossfade (linear/quarter sine/half sine)");
post("");
}
diff --git a/externals/grill/xsample/source/main.h b/externals/grill/xsample/source/main.h
index f19dce45..056550b9 100644
--- a/externals/grill/xsample/source/main.h
+++ b/externals/grill/xsample/source/main.h
@@ -12,7 +12,7 @@ WARRANTIES, see the file, "license.txt," in this distribution.
#define __XSAMPLE_H
-#define XSAMPLE_VERSION "0.3.0pre19"
+#define XSAMPLE_VERSION "0.3.0pre20"
#define FLEXT_ATTRIBUTES 1
@@ -113,7 +113,7 @@ public:
enum xs_intp {
xsi__ = -1, // don't change
- xsi_none = 0,xsi_lin,xsi_4p
+ xsi_none = 0,xsi_4p,xsi_lin
};
enum xs_sclmd {
diff --git a/externals/grill/xsample/xsample.cw b/externals/grill/xsample/xsample.cw
index a4e4df80..6d855465 100755
--- a/externals/grill/xsample/xsample.cw
+++ b/externals/grill/xsample/xsample.cw
Binary files differ