aboutsummaryrefslogtreecommitdiff
path: root/externals/grill
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2003-03-04 04:40:14 +0000
committerThomas Grill <xovo@users.sourceforge.net>2003-03-04 04:40:14 +0000
commit69f7f0c33559cf90e7d6ce7c0ddbd5501af7b1de (patch)
tree634c832e0e85566965ed8e0f489c7f7af7cf95d6 /externals/grill
parentc3ae6e7ab08db709ffa1975eea70bfc9461f1d6a (diff)
""
svn path=/trunk/; revision=452
Diffstat (limited to 'externals/grill')
-rwxr-xr-xexternals/grill/fftease/fftease.cwbin207912 -> 207912 bytes
-rw-r--r--externals/grill/vasp/pd-ex/wedit.pd1407
-rw-r--r--externals/grill/vasp/todo/marius.txt25
-rw-r--r--externals/grill/vasp/todo/neue-objekte.txt9
-rw-r--r--externals/grill/vasp/vasp.cwbin172574 -> 172574 bytes
-rw-r--r--externals/grill/vst/pd/vst~.pd19
-rw-r--r--externals/grill/vst/readme.txt115
-rw-r--r--externals/grill/vst/src/VstHost.cpp1108
-rw-r--r--externals/grill/vst/src/VstHost.h2
-rw-r--r--externals/grill/vst/src/main.cpp1429
-rw-r--r--externals/grill/vst/vst.dsp420
-rw-r--r--externals/grill/xsample/source/groove.cpp43
-rw-r--r--externals/grill/xsample/source/main.h2
-rwxr-xr-xexternals/grill/xsample/xsample.cwbin155147 -> 213671 bytes
-rw-r--r--externals/grill/xsample/xsample.dsp2
15 files changed, 2501 insertions, 2080 deletions
diff --git a/externals/grill/fftease/fftease.cw b/externals/grill/fftease/fftease.cw
index f31bf361..a3b9fc51 100755
--- a/externals/grill/fftease/fftease.cw
+++ b/externals/grill/fftease/fftease.cw
Binary files differ
diff --git a/externals/grill/vasp/pd-ex/wedit.pd b/externals/grill/vasp/pd-ex/wedit.pd
index f38ab513..ce3ab56b 100644
--- a/externals/grill/vasp/pd-ex/wedit.pd
+++ b/externals/grill/vasp/pd-ex/wedit.pd
@@ -1,387 +1,10 @@
-#N canvas 2 4 744 344 10;
+#N canvas 52 39 754 360 10;
#X obj 73 100 hsl 401 100 0 400 0 0 \$0-slider1snd \$0-slider1rcv empty
--2 -6 1728 8 -262144 -1 -1 40000 0;
+-2 -6 1728 8 -262144 -1 -1 0 0;
#X obj 37 90 cnv 15 600 220 empty empty empty 20 12 0 14 -233017 -66577
0;
-#N canvas 54 0 535 518 inside 0;
-#X floatatom 166 34 5 0 0 0 - - -;
-#N canvas 207 450 363 320 s-key-handling 0;
-#X floatatom 111 119 5 0 0 0 - - -;
-#N canvas 83 38 598 549 keyinput_s 0;
-#X obj 186 25 keyname;
-#X obj 84 446 spigot;
-#X obj 179 172 0;
-#X obj 179 116 symbol;
-#X msg 179 88 bang;
-#X obj 179 369 sel 1;
-#X msg 179 393 1;
-#X msg 152 393 0;
-#X obj 152 414 s \$0-spig1;
-#X obj 227 415 s \$0-spig1;
-#X msg 227 394 1;
-#X msg 254 394 0;
-#X obj 179 345 change;
-#X obj 84 67 inlet;
-#X obj 84 472 outlet;
-#X obj 179 144 sel s;
-#X text 276 67 if key "s" is down \, then input is let through;
-#X text 332 85 shifts display;
-#X obj 243 473 outlet;
-#X obj 179 223 t b b 0;
-#X obj 201 266 delay 100;
-#X msg 201 245 stop;
-#X obj 179 201 sel 0 1;
-#X obj 179 313 0;
-#X msg 179 289 1;
-#X text 255 242 linux and win have different up/down behaviour...;
-#X text 232 297 only if there is no new input for 100 ms after 0 \,
-0 is sent out;
-#X floatatom 273 365 5 0 0 0 - - -;
-#X obj 360 475 outlet;
-#X obj 442 479 s \$0-res;
-#X connect 0 0 2 1;
-#X connect 0 0 4 0;
-#X connect 0 1 3 1;
-#X connect 1 0 14 0;
-#X connect 2 0 22 0;
-#X connect 3 0 15 0;
-#X connect 4 0 3 0;
-#X connect 5 0 6 0;
-#X connect 5 0 7 0;
-#X connect 5 0 18 0;
-#X connect 5 0 29 0;
-#X connect 5 1 10 0;
-#X connect 5 1 11 0;
-#X connect 6 0 1 1;
-#X connect 6 0 28 0;
-#X connect 7 0 8 0;
-#X connect 10 0 9 0;
-#X connect 11 0 1 1;
-#X connect 11 0 28 0;
-#X connect 12 0 5 0;
-#X connect 12 0 27 0;
-#X connect 13 0 1 0;
-#X connect 15 0 2 0;
-#X connect 19 0 20 0;
-#X connect 19 1 21 0;
-#X connect 19 2 23 1;
-#X connect 20 0 23 0;
-#X connect 21 0 20 0;
-#X connect 22 0 19 0;
-#X connect 22 1 24 0;
-#X connect 23 0 12 0;
-#X connect 24 0 23 0;
-#X restore 97 93 pd keyinput_s;
-#N canvas 271 177 488 456 s_handling 0;
-#X obj 85 27 inlet;
-#X msg 85 272 set \$1;
-#X obj 85 249 0;
-#X obj 85 202 -;
-#X obj 85 225 t b f;
-#X obj 185 302 s \$0-shiftsel;
-#X obj 204 28 inlet;
-#X text 255 82 first position after hit is ref;
-#X obj 173 116 spigot;
-#X msg 204 82 1;
-#X obj 173 145 t f b;
-#X msg 178 82 0;
-#X text 203 12 down;
-#X obj 85 84 t f f;
-#X obj 85 302 s \$0-slider1rcv;
-#X obj 272 127 inlet;
-#X floatatom 272 164 1 0 1 0 - - -;
-#X msg 272 206 \; \$2-slider1rcv steady \$1;
-#X obj 272 184 pack 0 \$0;
-#X text 289 161 0 ist jump;
-#X connect 0 0 13 0;
-#X connect 1 0 14 0;
-#X connect 2 0 1 0;
-#X connect 3 0 4 0;
-#X connect 4 0 2 0;
-#X connect 4 1 5 0;
-#X connect 6 0 9 0;
-#X connect 8 0 10 0;
-#X connect 9 0 8 1;
-#X connect 10 0 3 1;
-#X connect 10 0 2 1;
-#X connect 10 1 11 0;
-#X connect 11 0 8 1;
-#X connect 13 0 3 0;
-#X connect 13 1 8 0;
-#X connect 15 0 16 0;
-#X connect 16 0 18 0;
-#X connect 18 0 17 0;
-#X restore 97 155 pd s_handling;
-#X obj 97 66 r \$0-slider1snd;
-#X connect 1 0 0 0;
-#X connect 1 0 2 0;
-#X connect 1 1 2 1;
-#X connect 1 2 2 2;
-#X connect 3 0 1 0;
-#X restore 220 133 pd s-key-handling;
-#X obj 57 33 r \$0-slider1snd;
-#X obj 88 61 r \$0-spig1;
-#X obj 57 109 spigot;
-#X text 104 108 from s-key-handler;
-#X obj 157 61 loadbang;
-#X msg 157 82 1;
-#X obj 220 155 r \$0-shiftsel;
-#N canvas 0 8 978 613 sliderhandling_with_s_key 0;
-#X obj 57 197 pack 0 0;
-#X obj 57 172 0;
-#X obj 70 150 r \$0-focus;
-#X obj 332 312 s \$0-focus;
-#X msg 345 197 1;
-#X msg 409 197 2;
-#X obj 57 130 t b f;
-#X obj 133 369 max 0;
-#X obj 170 368 - 1;
-#X obj 330 348 + 1;
-#X obj 293 394 min 400;
-#X obj 133 391 min 399;
-#X obj 57 219 route 1 2;
-#X obj 332 288 0;
-#X obj 345 264 spigot;
-#X obj 57 479 400;
-#X obj 57 504 - 1;
-#X obj 312 108 moses 201;
-#X obj 57 93 t f b f;
-#X msg 388 264 1;
-#X obj 388 242 loadbang;
-#X obj 429 392 s \$0-allblack;
-#X msg 429 349 stop \, bang;
-#X obj 429 370 delay 200;
-#X msg 376 197 0;
-#X msg 374 63 0.1;
-#X obj 361 86 + 0;
-#X msg 402 63 -0.1;
-#X obj 375 132 t f b b b;
-#X obj 312 132 t f b b b;
-#X obj 277 193 400;
-#X obj 277 215 - 0;
-#X obj 277 236 * 0.5;
-#X obj 277 257 +;
-#X obj 277 169 t b f f;
-#X text 365 28 wenn rechter bewegt wird \, muss mitte leicht nach links
-verschoben werden / links umgekehrt.;
-#X text 206 167 find middle;
-#X obj 184 424 s \$0-lb;
-#X obj 344 414 s \$0-rb;
-#N canvas 109 66 445 354 lb_graphics 0;
-#X msg 233 182 18;
-#X msg 277 178 -1;
-#X obj 233 205 change;
-#X obj 53 230 pack 0 \$0;
-#X obj 233 227 pack 0 \$0;
-#X obj 277 151 r \$0-allblack;
-#X obj 112 197 pack 0 \$0;
-#X obj 266 98 inlet;
-#X obj 219 127 inlet;
-#X obj 77 99 inlet;
-#X msg 53 254 \; \$2-p1 pos \$1 100;
-#X msg 233 250 \; \$2-p1 color \$1 100;
-#X obj 114 173 + 73;
-#X obj 53 206 + 72;
-#X msg 112 221 \; \$2-p1b pos \$1 100;
-#X connect 0 0 2 0;
-#X connect 1 0 2 0;
-#X connect 2 0 4 0;
-#X connect 3 0 10 0;
-#X connect 4 0 11 0;
-#X connect 5 0 1 0;
-#X connect 6 0 14 0;
-#X connect 7 0 1 0;
-#X connect 8 0 0 0;
-#X connect 9 0 12 0;
-#X connect 9 0 13 0;
-#X connect 12 0 6 0;
-#X connect 13 0 3 0;
-#X restore 132 498 pd lb_graphics;
-#N canvas 0 0 522 353 rb_graphics 0;
-#X msg 134 149 18;
-#X msg 106 149 -1;
-#X obj 106 173 change;
-#X obj 213 183 pack 0 \$0;
-#X obj 106 195 pack 0 \$0;
-#X msg 106 218 \; \$2-p2 color \$1 0;
-#X obj 106 123 r \$0-allblack;
-#X obj 285 161 pack 0 \$0;
-#X obj 91 79 inlet;
-#X obj 304 57 inlet;
-#X obj 213 117 inlet;
-#X obj 213 161 + 72;
-#X obj 285 137 + 73;
-#X msg 213 218 \; \$2-p2 pos \$1 100;
-#X msg 285 185 \; \$2-p2b pos \$1 100;
-#X connect 0 0 2 0;
-#X connect 1 0 2 0;
-#X connect 2 0 4 0;
-#X connect 3 0 13 0;
-#X connect 4 0 5 0;
-#X connect 6 0 1 0;
-#X connect 7 0 14 0;
-#X connect 8 0 1 0;
-#X connect 9 0 0 0;
-#X connect 10 0 11 0;
-#X connect 10 0 12 0;
-#X connect 11 0 3 0;
-#X connect 12 0 7 0;
-#X restore 272 505 pd rb_graphics;
-#X obj 57 280 t b b;
-#N canvas 133 97 348 231 selcnv_graphics 0;
-#X obj 40 25 inlet;
-#X floatatom 158 29 5 0 0 0 - - -;
-#X obj 40 83 pack 0 \$0;
-#X text 164 45 rchte border - linke;
-#X msg 40 113 \; \$2-p1b vis_size \$1 100;
-#X connect 0 0 2 0;
-#X connect 1 0 2 0;
-#X connect 2 0 4 0;
-#X restore 57 528 pd selcnv_graphics;
-#X text 370 330 after 200 ms without moving focus reset;
-#X obj 537 79 inlet;
-#X obj 582 136 r \$0-lb;
-#X obj 664 138 r \$0-rb;
-#X obj 584 268 max 0;
-#X text 629 238 wenns links oder rechts ansteht \, darfst nicht mehr
-verrueckt werden;
-#X msg 664 191 400;
-#X obj 664 168 t b f;
-#X obj 752 344 +;
-#X obj 582 174 * -1;
-#X obj 664 214 - 0;
-#X obj 584 244 min 0;
-#X obj 765 323 - 0;
-#X obj 765 300 t b f;
-#X obj 628 293 + 0;
-#X text 790 325 range;
-#X obj 537 185 + 0;
-#X obj 537 210 0;
-#X text 629 266 range in der sich delta lb bewegen darf;
-#X obj 679 424 * 0.5;
-#X obj 666 449 +;
-#X obj 666 471 s \$0-mid;
-#X obj 293 56 r \$0-mid;
-#X obj 184 444 r \$0-lb;
-#X obj 344 434 r \$0-rb;
-#X obj 628 385 s \$0-lb;
-#X obj 752 368 s \$0-rb;
-#X obj 628 359 t f f f;
-#X obj 57 52 inlet;
-#X obj 499 145 r \$0-res;
-#X msg 500 168 0;
-#X obj 133 413 t b f;
-#X obj 293 416 t b f;
-#X text 39 26 normal input;
-#X text 575 78 input if s-key is pressed \, only delta-values are received!
-;
-#X obj 41 404 r \$0-redraw;
-#X obj 293 371 max 1;
-#X obj 123 465 t f f f b;
-#X obj 275 464 t f f f b;
-#X obj 81 244 t b f;
-#X obj 45 244 t b f;
-#X connect 0 0 12 0;
-#X connect 1 0 0 0;
-#X connect 2 0 1 1;
-#X connect 4 0 14 0;
-#X connect 5 0 14 0;
-#X connect 6 0 1 0;
-#X connect 6 1 0 1;
-#X connect 7 0 11 0;
-#X connect 8 0 11 1;
-#X connect 9 0 79 1;
-#X connect 10 0 75 0;
-#X connect 11 0 74 0;
-#X connect 12 0 83 0;
-#X connect 12 1 82 0;
-#X connect 13 0 3 0;
-#X connect 14 0 13 1;
-#X connect 15 0 16 0;
-#X connect 16 0 42 0;
-#X connect 17 0 29 0;
-#X connect 17 1 28 0;
-#X connect 18 0 6 0;
-#X connect 18 1 13 0;
-#X connect 18 2 17 0;
-#X connect 19 0 14 1;
-#X connect 20 0 19 0;
-#X connect 22 0 23 0;
-#X connect 23 0 19 0;
-#X connect 23 0 21 0;
-#X connect 24 0 14 1;
-#X connect 25 0 26 1;
-#X connect 26 0 17 1;
-#X connect 27 0 26 1;
-#X connect 28 0 30 0;
-#X connect 28 1 24 0;
-#X connect 28 2 5 0;
-#X connect 28 3 27 0;
-#X connect 29 0 34 0;
-#X connect 29 1 24 0;
-#X connect 29 2 4 0;
-#X connect 29 3 25 0;
-#X connect 30 0 31 0;
-#X connect 31 0 32 0;
-#X connect 32 0 33 0;
-#X connect 33 0 26 0;
-#X connect 34 0 30 0;
-#X connect 34 1 31 1;
-#X connect 34 2 33 1;
-#X connect 41 0 15 0;
-#X connect 41 1 22 0;
-#X connect 44 0 59 0;
-#X connect 45 0 52 0;
-#X connect 45 0 56 0;
-#X connect 45 0 57 1;
-#X connect 46 0 50 0;
-#X connect 46 0 55 0;
-#X connect 47 0 57 0;
-#X connect 49 0 53 0;
-#X connect 50 0 49 0;
-#X connect 50 1 53 1;
-#X connect 51 0 69 0;
-#X connect 52 0 47 1;
-#X connect 53 0 54 1;
-#X connect 54 0 47 0;
-#X connect 55 0 51 1;
-#X connect 55 0 62 0;
-#X connect 56 0 55 0;
-#X connect 56 1 55 1;
-#X connect 57 0 70 0;
-#X connect 59 0 60 0;
-#X connect 60 0 54 0;
-#X connect 62 0 63 1;
-#X connect 63 0 64 0;
-#X connect 65 0 26 0;
-#X connect 66 0 80 0;
-#X connect 67 0 81 0;
-#X connect 70 0 68 0;
-#X connect 70 1 63 0;
-#X connect 70 2 51 0;
-#X connect 71 0 18 0;
-#X connect 72 0 73 0;
-#X connect 73 0 59 1;
-#X connect 74 0 39 1;
-#X connect 74 1 37 0;
-#X connect 75 0 40 2;
-#X connect 75 1 38 0;
-#X connect 78 0 15 0;
-#X connect 79 0 10 0;
-#X connect 80 0 39 0;
-#X connect 80 1 16 1;
-#X connect 80 2 9 0;
-#X connect 80 3 40 0;
-#X connect 81 0 8 0;
-#X connect 81 1 15 1;
-#X connect 81 2 40 1;
-#X connect 81 3 39 2;
-#X connect 82 0 41 0;
-#X connect 82 1 79 0;
-#X connect 83 0 41 0;
-#X connect 83 1 7 0;
-#X restore 57 182 pd sliderhandling_with_s_key;
-#N canvas 184 311 651 338 todo 0;
+#N canvas 389 97 591 525 inside 0;
+#N canvas 184 311 671 358 todo 0;
#X floatatom 60 136 5 0 0 0 - - -;
#X msg 60 173 \; \$2-p1b size \$1;
#X obj 60 153 pack 0 \$0;
@@ -394,7 +17,7 @@ klickt) dann:;
#X text 211 115 2 other border gets black;
#X text 211 136 3 middle is calculated;
#X text 211 156 4 range min/max is set and tested;
-#N canvas 0 0 454 304 todo 0;
+#N canvas 0 0 687 526 todo 0;
#X text 51 126 noch kein scrollen und vergroessern;
#X text 52 78 beim prototyp noch kein cursor (wird nicht so schnell
kommen...;
@@ -402,9 +25,13 @@ kommen...;
#X text 44 190 laengenanzeige in samples;
#X text 78 12 todo;
#X text 49 36 fuer das gop-tool muss die groesse variabel sein;
+#X text 53 220 record-moeglichkeit;
+#X text 47 246 preferences abspeichern: welches fileformat \, temporaere
+aufnahmedatei \, ab welcher groesse schreiben auf disk...;
+#X text 49 294 stereo-files...;
#X restore 65 247 pd todo;
#X text 79 13 only for testin \, debugging and todo list;
-#N canvas 0 0 474 324 reset 0;
+#N canvas 0 0 476 326 reset 0;
#X obj 183 177 s \$0-sm;
#X obj 171 233 s \$0-rb;
#X obj 123 230 s \$0-lb;
@@ -434,15 +61,15 @@ kommen...;
#X connect 4 0 5 0;
#X connect 5 0 3 0;
#X connect 14 0 13 0;
-#X restore 57 208 pd todo;
-#N canvas 154 197 719 348 play 0;
+#X restore 373 70 pd todo;
+#N canvas 154 197 727 356 play 0;
#X obj 266 115 r \$0-o;
#X obj 309 87 r \$0-f;
#X obj 266 156 pack 0 0;
#X obj 51 197 outlet~;
#X msg 370 100 stop;
#X msg 266 177 set \$1 \$2;
-#X msg 51 123 0 400;
+#X msg 51 123;
#X msg 69 98 set bang;
#X msg 149 69 set;
#X obj 149 49 loadbang;
@@ -518,8 +145,8 @@ kommen...;
#X connect 32 0 31 0;
#X connect 33 0 6 0;
#X connect 34 0 33 0;
-#X restore 102 360 pd play;
-#N canvas 0 0 474 324 zu_vasp 0;
+#X restore 87 242 pd play;
+#N canvas 0 0 484 334 zu_vasp 0;
#X obj 73 96 r \$0-lb;
#X obj 173 97 r \$0-rb;
#X obj 138 177 -;
@@ -544,8 +171,8 @@ kommen...;
#X connect 8 0 3 0;
#X connect 9 0 2 0;
#X connect 9 0 11 0;
-#X restore 103 315 pd zu_vasp;
-#N canvas 105 284 496 275 zu_sampledisplay 0;
+#X restore 88 197 pd zu_vasp;
+#N canvas 105 284 510 289 zu_sampledisplay 0;
#X obj 63 46 r \$0-lb;
#X obj 163 47 r \$0-rb;
#X obj 128 127 -;
@@ -554,10 +181,10 @@ kommen...;
#X obj 110 46 r \$0-sm;
#X obj 63 74 * 1;
#X obj 163 70 * 1;
-#X obj 64 151 div;
+#X obj 63 156 div;
#X obj 185 161 div;
#X obj 275 161 div;
-#X obj 64 176 s \$0-lbs_displ;
+#X obj 63 181 s \$0-lbs_displ;
#X obj 185 183 s \$0-rs_displ;
#X obj 275 183 s \$0-rbs_displ;
#X msg 293 66 400;
@@ -578,8 +205,9 @@ kommen...;
#X connect 10 0 13 0;
#X connect 14 0 7 0;
#X connect 15 0 14 0;
-#X restore 103 336 pd zu_sampledisplay;
-#N canvas 191 164 666 513 playbuttons 0;
+#X restore 88 218 pd zu_sampledisplay;
+#N canvas 78 106 492 180 playbuttons 0;
+#N canvas 0 0 443 463 playbutton 0;
#X obj 41 72 tgl 12 0 \$0-playselection \$0-playselection_r empty 16
6 1728 8 -262144 -1 -1 0 1;
#X text 67 68 playselection;
@@ -592,53 +220,131 @@ kommen...;
;
#X msg 137 168 \; \$1-playbutton1 color 18;
#X msg 116 267 \; \$1-playbutton1 color 16;
-#X obj 328 124 \$0;
-#X obj 346 214 \$0;
-#X obj 328 50 r \$0-loopbutton;
-#X msg 424 145 \; \$1-loop_white color 11 \; \$1-loop_dark color 0
-;
-#X msg 424 193 \; \$1-loopbutton1 color 18;
-#X msg 404 244 \; \$1-loop_white color 0 \; \$1-loop_dark color 11
-;
-#X msg 403 292 \; \$1-loopbutton1 color 16;
#X obj 41 99 sel 1 0;
#X obj 160 90 s \$0-playbutton;
#X msg 160 68 set \$1;
-#X text 347 70 playselection loop;
-#X obj 328 74 tgl 12 0 \$0-playselection_loop \$0-playselection_r_loop
-empty 16 6 1728 8 -262144 -1 -1 0 1;
-#X msg 512 94 set \$1;
-#X obj 512 116 s \$0-loopbutton;
-#X obj 328 92 sel 1 0;
#X obj 81 392 s \$0-playbuttonr;
#X obj 81 342 r \$0-stopped;
#X msg 81 365 set 0;
#X msg 48 366 0;
-#X connect 0 0 16 0;
-#X connect 0 0 18 0;
+#X connect 0 0 9 0;
+#X connect 0 0 11 0;
#X connect 2 0 0 0;
#X connect 3 0 5 0;
#X connect 3 0 7 0;
#X connect 4 0 6 0;
#X connect 4 0 8 0;
-#X connect 9 0 12 0;
-#X connect 9 0 13 0;
-#X connect 10 0 14 0;
-#X connect 10 0 15 0;
-#X connect 11 0 20 0;
-#X connect 16 0 3 0;
-#X connect 16 1 4 0;
+#X connect 9 0 3 0;
+#X connect 9 1 4 0;
+#X connect 11 0 10 0;
+#X connect 13 0 14 0;
+#X connect 13 0 15 0;
+#X connect 14 0 12 0;
+#X connect 15 0 0 0;
+#X restore 46 76 pd playbutton;
+#N canvas 0 0 490 451 loopbutton 0;
+#X obj 71 109 \$0;
+#X obj 89 199 \$0;
+#X obj 71 35 r \$0-loopbutton;
+#X msg 167 130 \; \$1-loop_white color 11 \; \$1-loop_dark color 0
+;
+#X msg 167 178 \; \$1-loopbutton1 color 18;
+#X msg 147 229 \; \$1-loop_white color 0 \; \$1-loop_dark color 11
+;
+#X msg 146 277 \; \$1-loopbutton1 color 16;
+#X text 90 55 playselection loop;
+#X obj 71 59 tgl 12 0 \$0-playselection_loop \$0-playselection_r_loop
+empty 16 6 1728 8 -262144 -1 -1 0 1;
+#X msg 255 79 set \$1;
+#X obj 255 101 s \$0-loopbutton;
+#X obj 71 77 sel 1 0;
+#X connect 0 0 3 0;
+#X connect 0 0 4 0;
+#X connect 1 0 5 0;
+#X connect 1 0 6 0;
+#X connect 2 0 8 0;
+#X connect 8 0 9 0;
+#X connect 8 0 11 0;
+#X connect 9 0 10 0;
+#X connect 11 0 0 0;
+#X connect 11 1 1 0;
+#X restore 138 76 pd loopbutton;
+#N canvas 54 27 582 413 recbutton 0;
+#X obj 61 148 tgl 12 0 \$0-playselection \$0-playselection_r empty
+16 6 1728 8 -262144 -1 -1 0 1;
+#X obj 73 260 \$0;
+#X obj 256 272 \$0;
+#X obj 61 175 sel 1 0;
+#X msg 142 187 set \$1;
+#X msg 380 224 set 0;
+#X msg 347 225 0;
+#X text 86 139 recselection;
+#X msg 95 289 \; \$1-rec_white color 11 \; \$1-rec_dark color 0;
+#X obj 380 251 s \$0-recbuttonr;
+#X obj 380 201 r \$0-recstopped;
+#X obj 41 42 r \$0-recbuttons;
+#X obj 142 209 s \$0-recbuttonr;
+#X msg 279 293 \; \$1-rec_white color 0 \; \$1-rec_dark color 11;
+#X msg 95 337 \; \$1-recbutton1 color 13;
+#X msg 278 342 \; \$1-recbutton1 color 23;
+#X obj 61 203 t b b;
+#X msg 41 67 \; pd-record_window vis 1;
+#X connect 0 0 3 0;
+#X connect 0 0 4 0;
+#X connect 1 0 8 0;
+#X connect 1 0 14 0;
+#X connect 2 0 13 0;
+#X connect 2 0 15 0;
+#X connect 3 0 16 0;
+#X connect 3 1 2 0;
+#X connect 4 0 12 0;
+#X connect 5 0 9 0;
+#X connect 6 0 0 0;
+#X connect 10 0 5 0;
+#X connect 10 0 6 0;
+#X connect 11 0 17 0;
+#X connect 16 1 1 0;
+#X restore 225 76 pd recbutton;
+#N canvas 54 27 586 417 recbutton2 0;
+#X obj 41 71 tgl 12 0 \$0-playselection \$0-playselection_r empty 16
+6 1728 8 -262144 -1 -1 0 1;
+#X obj 61 175 \$0;
+#X obj 236 196 \$0;
+#X obj 59 137 sel 1 0;
+#X msg 122 111 set \$1;
+#X msg 360 148 set 0;
+#X msg 327 149 0;
+#X text 60 59 recselection;
+#X obj 360 175 s \$0-recbuttonr;
+#X obj 360 125 r \$0-recstopped;
+#X obj 41 42 r \$0-recbutton2s;
+#X obj 122 133 s \$0-recbutton2r;
+#X msg 83 204 \; \$1-rec2_white color 11 \; \$1-rec2_dark color 0;
+#X msg 259 217 \; \$1-rec2_white color 0 \; \$1-rec2_dark color 11
+;
+#X msg 258 266 \; \$1-recbutton2 color 23;
+#X msg 83 252 \; \$1-recbutton2 color 13;
+#X text 215 35 this is the recbutton inside the rec_window;
+#X obj 41 304 s \$0-rec_1_0;
+#X obj 41 88 t f f f;
+#X connect 0 0 18 0;
+#X connect 1 0 12 0;
+#X connect 1 0 15 0;
+#X connect 2 0 13 0;
+#X connect 2 0 14 0;
+#X connect 3 0 1 0;
+#X connect 3 1 2 0;
+#X connect 4 0 11 0;
+#X connect 5 0 8 0;
+#X connect 6 0 0 0;
+#X connect 9 0 5 0;
+#X connect 9 0 6 0;
+#X connect 10 0 0 0;
#X connect 18 0 17 0;
-#X connect 20 0 21 0;
-#X connect 20 0 23 0;
-#X connect 21 0 22 0;
-#X connect 23 0 9 0;
-#X connect 23 1 10 0;
-#X connect 25 0 26 0;
-#X connect 25 0 27 0;
-#X connect 26 0 24 0;
-#X connect 27 0 0 0;
-#X restore 103 294 pd playbuttons;
+#X connect 18 1 3 0;
+#X connect 18 2 4 0;
+#X restore 306 76 pd recbutton2;
+#X restore 88 176 pd playbuttons;
#N canvas 0 0 467 508 reduce 0;
#X obj 166 199 vasp.!;
#X text 192 70 reduce to selection;
@@ -724,7 +430,7 @@ empty 16 6 1728 8 -262144 -1 -1 0 1;
#X connect 7 0 2 0;
#X connect 8 0 6 0;
#X restore 392 401 pd noise;
-#N canvas 420 161 452 466 open 0;
+#N canvas 420 161 466 480 open 0;
#X obj 68 61 openpanel;
#X obj 68 159 soundfiler;
#X obj 68 214 * 0.0025;
@@ -932,7 +638,7 @@ empty 16 6 1728 8 -262144 -1 -1 0 1;
#X connect 7 0 4 0;
#X connect 8 0 6 0;
#X restore 391 233 pd fade_out;
-#N canvas 150 120 483 442 send_array 0;
+#N canvas 150 120 487 446 send_array 0;
#X obj 120 212 vasp.s;
#X obj 191 187 r \$0-sm;
#X obj 191 208 * 400;
@@ -973,62 +679,23 @@ empty 16 6 1728 8 -262144 -1 -1 0 1;
#X connect 17 0 0 0;
#X connect 18 0 4 0;
#X restore 392 423 pd send_array;
-#N canvas 159 26 503 274 output 0;
-#X obj 338 160 t b;
-#X obj 338 110 f;
-#X obj 338 60 inlet;
-#X text 344 29 mute;
-#X obj 338 185 f;
-#X msg 425 178 0;
-#X msg 338 85 bang;
-#X obj 338 135 moses 1;
-#X obj 425 153 t b f;
-#X obj 397 117 moses 1;
-#X obj 83 148 dbtorms;
-#X obj 397 92 r master-lvl;
-#X obj 83 42 r master-lvl;
-#X obj 338 210 s master-lvl;
+#N canvas 159 26 253 308 output 0;
#X obj 22 181 inlet~;
-#X obj 199 41 inlet;
-#X text 199 18 level;
-#X obj 199 100 s master-lvl;
-#X msg 96 65 set \$1;
-#X obj 96 89 outlet;
-#X msg 214 64 \; pd dsp 1;
+#X obj 83 78 inlet;
+#X msg 98 104 \; pd dsp 1;
#X obj 83 194 line~;
#X obj 22 212 *~;
#X obj 22 241 dac~;
#X obj 83 171 pack 0 50;
-#X text 20 158 audio;
-#X text 93 110 show level;
#X connect 0 0 4 0;
-#X connect 1 0 7 0;
-#X connect 2 0 6 0;
-#X connect 4 0 13 0;
-#X connect 5 0 13 0;
-#X connect 6 0 1 0;
-#X connect 7 0 0 0;
-#X connect 7 1 8 0;
-#X connect 8 0 5 0;
-#X connect 9 1 4 1;
-#X connect 10 0 24 0;
-#X connect 11 0 1 1;
-#X connect 11 0 9 0;
-#X connect 12 0 10 0;
-#X connect 12 0 18 0;
-#X connect 14 0 22 0;
-#X connect 15 0 17 0;
-#X connect 15 0 20 0;
-#X connect 18 0 19 0;
-#X connect 21 0 22 1;
-#X connect 22 0 23 0;
-#X connect 22 0 23 1;
-#X connect 24 0 21 0;
-#X restore 102 408 pd output;
-#X obj 102 429 s \$0-volr;
-#X obj 126 384 r \$0-vols;
-#X obj 151 361 r \$0-mutevol;
-#N canvas 150 120 766 521 reload_array 0;
+#X connect 1 0 2 0;
+#X connect 1 0 6 0;
+#X connect 3 0 4 1;
+#X connect 4 0 5 0;
+#X connect 4 0 5 1;
+#X connect 6 0 3 0;
+#X restore 87 290 pd output;
+#N canvas 150 120 772 527 reload_array 0;
#X obj 361 93 symbol \$1;
#X obj 348 44 loadbang;
#X obj 361 116 makefilename test%s;
@@ -1125,6 +792,512 @@ empty 16 6 1728 8 -262144 -1 -1 0 1;
#X connect 7 0 1 0;
#X connect 8 0 5 0;
#X restore 391 381 pd normalize;
+#N canvas 99 249 567 524 volume 0;
+#X obj 133 164 dbtopow;
+#X obj 77 137 0;
+#X obj 133 139 + 100;
+#X obj 77 113 t b;
+#X obj 77 84 route 0;
+#X msg 134 221 -50;
+#X obj 357 314 + 950;
+#X obj 412 315 moses -50;
+#X obj 357 415 0;
+#X msg 461 372 -1000;
+#X msg 357 441 set \$1;
+#X obj 357 292 moses -500;
+#X obj 357 341 min 0;
+#X obj 296 268 moses -1000;
+#X msg 296 291 -1000;
+#X msg 412 341 -1000;
+#X obj 247 244 sel -1000;
+#X obj 461 343 sel -50;
+#X obj 239 394 max -50;
+#X msg 239 435 set \$1;
+#X obj 239 415 + 50;
+#X obj 357 464 s \$0-voldisplr;
+#X obj 77 221 outlet;
+#X obj 239 456 s \$0-volr;
+#X obj 133 112 - 50;
+#X obj 77 60 r \$0-vols;
+#X obj 247 200 r \$0-voldispls;
+#X obj 202 151 dbtopow;
+#X obj 202 126 + 100;
+#X connect 0 0 22 0;
+#X connect 1 0 5 0;
+#X connect 1 0 22 0;
+#X connect 2 0 0 0;
+#X connect 3 0 1 0;
+#X connect 4 0 3 0;
+#X connect 4 1 24 0;
+#X connect 5 0 16 0;
+#X connect 6 0 12 0;
+#X connect 7 0 15 0;
+#X connect 7 1 17 0;
+#X connect 8 0 10 0;
+#X connect 8 0 18 0;
+#X connect 9 0 8 0;
+#X connect 10 0 21 0;
+#X connect 11 0 6 0;
+#X connect 11 1 7 0;
+#X connect 12 0 8 0;
+#X connect 13 0 14 0;
+#X connect 13 1 11 0;
+#X connect 14 0 8 0;
+#X connect 15 0 8 0;
+#X connect 16 0 14 0;
+#X connect 16 1 13 0;
+#X connect 17 0 9 0;
+#X connect 17 1 8 0;
+#X connect 18 0 20 0;
+#X connect 19 0 23 0;
+#X connect 20 0 19 0;
+#X connect 24 0 2 0;
+#X connect 24 0 16 0;
+#X connect 25 0 4 0;
+#X connect 26 0 16 0;
+#X connect 28 0 27 0;
+#X restore 136 242 pd volume;
+#N canvas 424 244 323 150 record_window 0;
+#X obj 17 15 cnv 15 280 120 empty empty empty 20 12 0 14 -233017 -66577
+0;
+#X obj 157 33 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
+;
+#X text 181 30 record into RAM;
+#X obj 157 57 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
+;
+#X text 180 55 record to harddisk;
+#X obj 34 51 tgl 18 0 \$0-recbutton2s \$0-recbutton2r empty 0 -6 1728
+8 -262144 -1 -1 0 1;
+#X obj 29 47 cnv 15 28 25 empty empty empty 0 -10 1 10 -233017 -1 0
+;
+#X obj 32 51 cnv 15 20 15 empty \$0-rec2_white empty 20 12 576 14 -262144
+-262144 0;
+#X obj 34 53 cnv 15 20 15 empty \$0-rec2_dark empty 20 12 576 14 -128992
+-262144 0;
+#X obj 33 52 cnv 15 20 15 empty \$0-rec2_normal empty 20 12 576 14
+-233017 -66577 0;
+#X obj 40 56 cnv 1 1 1 empty \$0-recbutton2 empty 20 12 576 14 -143491
+-262144 0;
+#X obj 42 56 cnv 1 1 1 empty \$0-recbutton2 empty 20 12 576 14 -143491
+-262144 0;
+#X obj 44 56 cnv 1 1 1 empty \$0-recbutton2 empty 20 12 576 14 -143491
+-262144 0;
+#X obj 39 57 cnv 1 1 1 empty \$0-recbutton2 empty 20 12 576 14 -143491
+-262144 0;
+#X obj 41 57 cnv 1 1 1 empty \$0-recbutton2 empty 20 12 576 14 -143491
+-262144 0;
+#X obj 43 57 cnv 1 1 1 empty \$0-recbutton2 empty 20 12 576 14 -143491
+-262144 0;
+#X obj 41 60 cnv 1 1 1 empty \$0-recbutton2 empty 20 12 576 14 -143491
+-262144 0;
+#X obj 45 60 cnv 1 1 1 empty \$0-recbutton2 empty 20 12 576 14 -143491
+-262144 0;
+#X obj 45 57 cnv 1 1 1 empty \$0-recbutton2 empty 20 12 576 14 -143491
+-262144 0;
+#X obj 43 60 cnv 1 1 1 empty \$0-recbutton2 empty 20 12 576 14 -143491
+-262144 0;
+#X obj 42 61 cnv 1 1 1 empty \$0-recbutton2 empty 20 12 576 14 -143491
+-262144 0;
+#X obj 39 59 cnv 1 1 1 empty \$0-recbutton2 empty 20 12 576 14 -143491
+-262144 0;
+#X obj 39 60 cnv 1 1 1 empty \$0-recbutton2 empty 20 12 576 14 -143491
+-262144 0;
+#X obj 40 61 cnv 1 1 1 empty \$0-recbutton2 empty 20 12 576 14 -143491
+-262144 0;
+#X obj 43 59 cnv 1 1 1 empty \$0-recbutton2 empty 20 12 576 14 -143491
+-262144 0;
+#X obj 44 61 cnv 1 1 1 empty \$0-recbutton2 empty 20 12 576 14 -143491
+-262144 0;
+#X obj 41 58 cnv 1 1 1 empty \$0-recbutton2 empty 20 12 576 14 -143491
+-262144 0;
+#X obj 45 59 cnv 1 1 1 empty \$0-recbutton2 empty 20 12 576 14 -143491
+-262144 0;
+#X obj 100 34 vu 15 80 \$0-vu1 empty -1 -8 576 8 -66577 -1 1 0;
+#X text 181 97 monitor;
+#X obj 158 99 tgl 15 0 \$0-monis empty empty 0 -6 1152 8 -262144 -1
+-1 0 1;
+#X text 29 72 start/;
+#X text 29 83 stop;
+#X restore 391 133 pd record_window;
+#X obj 391 155 inlet~;
+#N canvas 179 201 394 282 range_main 0;
+#X floatatom 166 34 5 0 0 0 - - -;
+#N canvas 207 450 365 322 s-key-handling 0;
+#X floatatom 111 119 5 0 0 0 - - -;
+#N canvas 83 38 600 551 keyinput_s 0;
+#X obj 186 25 keyname;
+#X obj 84 446 spigot;
+#X obj 179 172 0;
+#X obj 179 116 symbol;
+#X msg 179 88 bang;
+#X obj 179 369 sel 1;
+#X msg 179 393 1;
+#X msg 152 393 0;
+#X obj 152 414 s \$0-spig1;
+#X obj 227 415 s \$0-spig1;
+#X msg 227 394 1;
+#X msg 254 394 0;
+#X obj 179 345 change;
+#X obj 84 67 inlet;
+#X obj 84 472 outlet;
+#X obj 179 144 sel s;
+#X text 276 67 if key "s" is down \, then input is let through;
+#X text 332 85 shifts display;
+#X obj 243 473 outlet;
+#X obj 179 223 t b b 0;
+#X obj 201 266 delay 100;
+#X msg 201 245 stop;
+#X obj 179 201 sel 0 1;
+#X obj 179 313 0;
+#X msg 179 289 1;
+#X text 255 242 linux and win have different up/down behaviour...;
+#X text 232 297 only if there is no new input for 100 ms after 0 \,
+0 is sent out;
+#X floatatom 273 365 5 0 0 0 - - -;
+#X obj 360 475 outlet;
+#X obj 442 479 s \$0-res;
+#X connect 0 0 2 1;
+#X connect 0 0 4 0;
+#X connect 0 1 3 1;
+#X connect 1 0 14 0;
+#X connect 2 0 22 0;
+#X connect 3 0 15 0;
+#X connect 4 0 3 0;
+#X connect 5 0 6 0;
+#X connect 5 0 7 0;
+#X connect 5 0 18 0;
+#X connect 5 0 29 0;
+#X connect 5 1 10 0;
+#X connect 5 1 11 0;
+#X connect 6 0 1 1;
+#X connect 6 0 28 0;
+#X connect 7 0 8 0;
+#X connect 10 0 9 0;
+#X connect 11 0 1 1;
+#X connect 11 0 28 0;
+#X connect 12 0 5 0;
+#X connect 12 0 27 0;
+#X connect 13 0 1 0;
+#X connect 15 0 2 0;
+#X connect 19 0 20 0;
+#X connect 19 1 21 0;
+#X connect 19 2 23 1;
+#X connect 20 0 23 0;
+#X connect 21 0 20 0;
+#X connect 22 0 19 0;
+#X connect 22 1 24 0;
+#X connect 23 0 12 0;
+#X connect 24 0 23 0;
+#X restore 97 93 pd keyinput_s;
+#N canvas 271 177 490 458 s_handling 0;
+#X obj 85 27 inlet;
+#X msg 85 272 set \$1;
+#X obj 85 249 0;
+#X obj 85 202 -;
+#X obj 85 225 t b f;
+#X obj 185 302 s \$0-shiftsel;
+#X obj 204 28 inlet;
+#X text 255 82 first position after hit is ref;
+#X obj 173 116 spigot;
+#X msg 204 82 1;
+#X obj 173 145 t f b;
+#X msg 178 82 0;
+#X text 203 12 down;
+#X obj 85 84 t f f;
+#X obj 85 302 s \$0-slider1rcv;
+#X obj 272 127 inlet;
+#X floatatom 272 164 1 0 1 0 - - -;
+#X msg 272 206 \; \$2-slider1rcv steady \$1;
+#X obj 272 184 pack 0 \$0;
+#X text 289 161 0 ist jump;
+#X connect 0 0 13 0;
+#X connect 1 0 14 0;
+#X connect 2 0 1 0;
+#X connect 3 0 4 0;
+#X connect 4 0 2 0;
+#X connect 4 1 5 0;
+#X connect 6 0 9 0;
+#X connect 8 0 10 0;
+#X connect 9 0 8 1;
+#X connect 10 0 3 1;
+#X connect 10 0 2 1;
+#X connect 10 1 11 0;
+#X connect 11 0 8 1;
+#X connect 13 0 3 0;
+#X connect 13 1 8 0;
+#X connect 15 0 16 0;
+#X connect 16 0 18 0;
+#X connect 18 0 17 0;
+#X restore 97 155 pd s_handling;
+#X obj 97 66 r \$0-slider1snd;
+#X connect 1 0 0 0;
+#X connect 1 0 2 0;
+#X connect 1 1 2 1;
+#X connect 1 2 2 2;
+#X connect 3 0 1 0;
+#X restore 220 133 pd s-key-handling;
+#X obj 57 33 r \$0-slider1snd;
+#X obj 88 61 r \$0-spig1;
+#X obj 57 109 spigot;
+#X text 104 108 from s-key-handler;
+#X obj 157 61 loadbang;
+#X msg 157 82 1;
+#X obj 220 155 r \$0-shiftsel;
+#N canvas 0 8 984 619 sliderhandling_with_s_key 0;
+#X obj 57 197 pack 0 0;
+#X obj 57 172 0;
+#X obj 70 150 r \$0-focus;
+#X obj 332 312 s \$0-focus;
+#X msg 345 197 1;
+#X msg 409 197 2;
+#X obj 57 130 t b f;
+#X obj 133 369 max 0;
+#X obj 170 368 - 1;
+#X obj 330 348 + 1;
+#X obj 293 394 min 400;
+#X obj 133 391 min 399;
+#X obj 57 219 route 1 2;
+#X obj 332 288 0;
+#X obj 345 264 spigot;
+#X obj 57 479 400;
+#X obj 57 504 - 1;
+#X obj 312 108 moses 201;
+#X obj 57 93 t f b f;
+#X msg 388 264 1;
+#X obj 388 242 loadbang;
+#X obj 429 392 s \$0-allblack;
+#X msg 429 349 stop \, bang;
+#X obj 429 370 delay 200;
+#X msg 376 197 0;
+#X msg 374 63 0.1;
+#X obj 361 86 + 0;
+#X msg 402 63 -0.1;
+#X obj 375 132 t f b b b;
+#X obj 312 132 t f b b b;
+#X obj 277 193 400;
+#X obj 277 215 - 0;
+#X obj 277 236 * 0.5;
+#X obj 277 257 +;
+#X obj 277 169 t b f f;
+#X text 365 28 wenn rechter bewegt wird \, muss mitte leicht nach links
+verschoben werden / links umgekehrt.;
+#X text 206 167 find middle;
+#X obj 184 424 s \$0-lb;
+#X obj 344 414 s \$0-rb;
+#N canvas 109 66 445 354 lb_graphics 0;
+#X msg 233 182 18;
+#X msg 277 178 -1;
+#X obj 233 205 change;
+#X obj 53 230 pack 0 \$0;
+#X obj 233 227 pack 0 \$0;
+#X obj 277 151 r \$0-allblack;
+#X obj 112 197 pack 0 \$0;
+#X obj 266 98 inlet;
+#X obj 219 127 inlet;
+#X obj 77 99 inlet;
+#X msg 53 254 \; \$2-p1 pos \$1 100;
+#X msg 233 250 \; \$2-p1 color \$1 100;
+#X obj 114 173 + 73;
+#X obj 53 206 + 72;
+#X msg 112 221 \; \$2-p1b pos \$1 100;
+#X connect 0 0 2 0;
+#X connect 1 0 2 0;
+#X connect 2 0 4 0;
+#X connect 3 0 10 0;
+#X connect 4 0 11 0;
+#X connect 5 0 1 0;
+#X connect 6 0 14 0;
+#X connect 7 0 1 0;
+#X connect 8 0 0 0;
+#X connect 9 0 12 0;
+#X connect 9 0 13 0;
+#X connect 12 0 6 0;
+#X connect 13 0 3 0;
+#X restore 132 498 pd lb_graphics;
+#N canvas 0 0 522 353 rb_graphics 0;
+#X msg 134 149 18;
+#X msg 106 149 -1;
+#X obj 106 173 change;
+#X obj 213 183 pack 0 \$0;
+#X obj 106 195 pack 0 \$0;
+#X msg 106 218 \; \$2-p2 color \$1 0;
+#X obj 106 123 r \$0-allblack;
+#X obj 285 161 pack 0 \$0;
+#X obj 91 79 inlet;
+#X obj 304 57 inlet;
+#X obj 213 117 inlet;
+#X obj 213 161 + 72;
+#X obj 285 137 + 73;
+#X msg 213 218 \; \$2-p2 pos \$1 100;
+#X msg 285 185 \; \$2-p2b pos \$1 100;
+#X connect 0 0 2 0;
+#X connect 1 0 2 0;
+#X connect 2 0 4 0;
+#X connect 3 0 13 0;
+#X connect 4 0 5 0;
+#X connect 6 0 1 0;
+#X connect 7 0 14 0;
+#X connect 8 0 1 0;
+#X connect 9 0 0 0;
+#X connect 10 0 11 0;
+#X connect 10 0 12 0;
+#X connect 11 0 3 0;
+#X connect 12 0 7 0;
+#X restore 272 505 pd rb_graphics;
+#X obj 57 280 t b b;
+#N canvas 133 97 350 233 selcnv_graphics 0;
+#X obj 40 25 inlet;
+#X floatatom 158 29 5 0 0 0 - - -;
+#X obj 40 83 pack 0 \$0;
+#X text 164 45 rchte border - linke;
+#X msg 40 113 \; \$2-p1b vis_size \$1 100;
+#X connect 0 0 2 0;
+#X connect 1 0 2 0;
+#X connect 2 0 4 0;
+#X restore 57 528 pd selcnv_graphics;
+#X text 370 330 after 200 ms without moving focus reset;
+#X obj 537 79 inlet;
+#X obj 582 136 r \$0-lb;
+#X obj 664 138 r \$0-rb;
+#X obj 584 268 max 0;
+#X text 629 238 wenns links oder rechts ansteht \, darfst nicht mehr
+verrueckt werden;
+#X msg 664 191 400;
+#X obj 664 168 t b f;
+#X obj 752 344 +;
+#X obj 582 174 * -1;
+#X obj 664 214 - 0;
+#X obj 584 244 min 0;
+#X obj 765 323 - 0;
+#X obj 765 300 t b f;
+#X obj 628 293 + 0;
+#X text 790 325 range;
+#X obj 537 185 + 0;
+#X obj 537 210 0;
+#X text 629 266 range in der sich delta lb bewegen darf;
+#X obj 679 424 * 0.5;
+#X obj 666 449 +;
+#X obj 666 471 s \$0-mid;
+#X obj 293 56 r \$0-mid;
+#X obj 184 444 r \$0-lb;
+#X obj 344 434 r \$0-rb;
+#X obj 628 385 s \$0-lb;
+#X obj 752 368 s \$0-rb;
+#X obj 628 359 t f f f;
+#X obj 57 52 inlet;
+#X obj 499 145 r \$0-res;
+#X msg 500 168 0;
+#X obj 133 413 t b f;
+#X obj 293 416 t b f;
+#X text 39 26 normal input;
+#X text 575 78 input if s-key is pressed \, only delta-values are received!
+;
+#X obj 41 404 r \$0-redraw;
+#X obj 293 371 max 1;
+#X obj 123 465 t f f f b;
+#X obj 275 464 t f f f b;
+#X obj 81 244 t b f;
+#X obj 45 244 t b f;
+#X connect 0 0 12 0;
+#X connect 1 0 0 0;
+#X connect 2 0 1 1;
+#X connect 4 0 14 0;
+#X connect 5 0 14 0;
+#X connect 6 0 1 0;
+#X connect 6 1 0 1;
+#X connect 7 0 11 0;
+#X connect 8 0 11 1;
+#X connect 9 0 79 1;
+#X connect 10 0 75 0;
+#X connect 11 0 74 0;
+#X connect 12 0 83 0;
+#X connect 12 1 82 0;
+#X connect 13 0 3 0;
+#X connect 14 0 13 1;
+#X connect 15 0 16 0;
+#X connect 16 0 42 0;
+#X connect 17 0 29 0;
+#X connect 17 1 28 0;
+#X connect 18 0 6 0;
+#X connect 18 1 13 0;
+#X connect 18 2 17 0;
+#X connect 19 0 14 1;
+#X connect 20 0 19 0;
+#X connect 22 0 23 0;
+#X connect 23 0 19 0;
+#X connect 23 0 21 0;
+#X connect 24 0 14 1;
+#X connect 25 0 26 1;
+#X connect 26 0 17 1;
+#X connect 27 0 26 1;
+#X connect 28 0 30 0;
+#X connect 28 1 24 0;
+#X connect 28 2 5 0;
+#X connect 28 3 27 0;
+#X connect 29 0 34 0;
+#X connect 29 1 24 0;
+#X connect 29 2 4 0;
+#X connect 29 3 25 0;
+#X connect 30 0 31 0;
+#X connect 31 0 32 0;
+#X connect 32 0 33 0;
+#X connect 33 0 26 0;
+#X connect 34 0 30 0;
+#X connect 34 1 31 1;
+#X connect 34 2 33 1;
+#X connect 41 0 15 0;
+#X connect 41 1 22 0;
+#X connect 44 0 59 0;
+#X connect 45 0 52 0;
+#X connect 45 0 56 0;
+#X connect 45 0 57 1;
+#X connect 46 0 50 0;
+#X connect 46 0 55 0;
+#X connect 47 0 57 0;
+#X connect 49 0 53 0;
+#X connect 50 0 49 0;
+#X connect 50 1 53 1;
+#X connect 51 0 69 0;
+#X connect 52 0 47 1;
+#X connect 53 0 54 1;
+#X connect 54 0 47 0;
+#X connect 55 0 51 1;
+#X connect 55 0 62 0;
+#X connect 56 0 55 0;
+#X connect 56 1 55 1;
+#X connect 57 0 70 0;
+#X connect 59 0 60 0;
+#X connect 60 0 54 0;
+#X connect 62 0 63 1;
+#X connect 63 0 64 0;
+#X connect 65 0 26 0;
+#X connect 66 0 80 0;
+#X connect 67 0 81 0;
+#X connect 70 0 68 0;
+#X connect 70 1 63 0;
+#X connect 70 2 51 0;
+#X connect 71 0 18 0;
+#X connect 72 0 73 0;
+#X connect 73 0 59 1;
+#X connect 74 0 39 1;
+#X connect 74 1 37 0;
+#X connect 75 0 40 2;
+#X connect 75 1 38 0;
+#X connect 78 0 15 0;
+#X connect 79 0 10 0;
+#X connect 80 0 39 0;
+#X connect 80 1 16 1;
+#X connect 80 2 9 0;
+#X connect 80 3 40 0;
+#X connect 81 0 8 0;
+#X connect 81 1 15 1;
+#X connect 81 2 40 1;
+#X connect 81 3 39 2;
+#X connect 82 0 41 0;
+#X connect 82 1 79 0;
+#X connect 83 0 41 0;
+#X connect 83 1 7 0;
+#X restore 57 182 pd sliderhandling_with_s_key;
#X connect 2 0 0 0;
#X connect 2 0 4 0;
#X connect 3 0 4 1;
@@ -1132,11 +1305,213 @@ empty 16 6 1728 8 -262144 -1 -1 0 1;
#X connect 6 0 7 0;
#X connect 7 0 4 1;
#X connect 8 0 9 1;
-#X connect 11 0 25 0;
-#X connect 25 0 26 0;
-#X connect 27 0 25 1;
-#X connect 28 0 25 2;
-#X restore 650 289 pd inside;
+#X restore 88 155 pd range_main;
+#N canvas 219 194 434 292 record 0;
+#N canvas 216 56 684 582 record_RAM 0;
+#N canvas 222 74 668 589 interna 0;
+#X text 64 78 es gibt ein bisserl ein problem mit dem join. nachdem
+ich beim ersten durchlauf nur einen channel haben will \, links aber
+eine vasp message reinschicken muss kann ich nicht den alten vasp links
+reinschicken und den neuen rechts dazujoinen...;
+#X text 64 151 deshalb schicke ich immer das neueste links rein und
+die referenz auf den alten rechts. letztendlich brockt mir das seitenverkehrte
+ordnungszahlen ein. ist aber nicht weiter tragisch. nur umstaendlich
+;
+#X text 65 231 am schluss stueckle ich das ergebnis aus den channels
+zusammen:;
+#X text 63 265 teilstueck 1 hat offset 0*64 und daten im channel n=k-1
+\, wobei k die anzahl der aufgenommenen kanaele ist.;
+#X text 63 295 teilstueck 2: o=1*64 \, n=k-2;
+#X text 63 312 teilstueck k: o=(k-1)*64 \, n=0;
+#X text 65 345 wenn start gedrueckt wird \, wird der erste table geschrieben
+(mit tabwrite~) am ende wird dann mit bang~ getriggert...;
+#X text 67 382 switch~ 0 darf erst gesetzt werden \, nachdem das letzte~
+bang abgearbeitet wurde.;
+#X text 69 428 beim letzten record-stueck werden zwar alle samples
+geschrieben (mit tabwrite~) aber nur mehr ein teil ausgelesen. das
+bestimmt der timer.;
+#X text 74 494 tabsend~ und switch~ laufen nicht parallel...;
+#X restore 521 187 pd interna;
+#X text 374 227 spaeter direkt in \$0-temp schreiben;
+#X obj 84 66 inlet~;
+#X obj 207 208 s \$0-recstop;
+#X obj 207 185 sel 0;
+#X obj 79 459 vasp;
+#X text 199 391 reset;
+#X obj 79 360 \$0;
+#X obj 79 398 vasp.!;
+#X msg 79 377 vasp \$1-rec_temp;
+#X obj 79 429 vasp.join 2;
+#X msg 198 408 vasp;
+#X text 159 431 adds a channel;
+#X obj 79 276 0;
+#X obj 79 302 + 1;
+#X msg 116 277 0;
+#X text 126 262 reset;
+#X obj 79 326 t b f;
+#X obj 229 408 r \$0-reset_rec;
+#X obj 141 277 r \$0-reset_rec;
+#X obj 79 169 bang~;
+#N canvas 171 0 610 665 write_multi_channel_to_ergebnis 0;
+#X obj 412 264 inlet;
+#X obj 270 414 vasp.n 0;
+#X obj 241 222 vasp.s;
+#X obj 241 103 0;
+#X obj 270 390 vasp;
+#X obj 318 359 - 1;
+#X text 193 54 am ende;
+#X obj 208 547 vasp.o;
+#X text 265 103 k (=number of slices);
+#X obj 208 574 vasp.=;
+#X obj 400 389 0;
+#X obj 413 368 + 1;
+#X msg 438 368 0;
+#X text 468 368 reset;
+#X obj 241 289 moses 1;
+#X obj 318 381 t f f;
+#X text 36 300 ganz am schluss;
+#X text 36 314 kopieren und schick resets;
+#X obj 278 313 t b b f b;
+#X obj 438 346 r \$0-reset_rec;
+#X obj 106 373 s \$0-reset_rec;
+#X msg 241 246 bang;
+#X obj 241 267 0;
+#X msg 208 596 bang;
+#X text 271 613 ohne das delay haengt sichs auf...;
+#X obj 254 81 r \$0-number_of_slices;
+#X obj 241 129 t b f f;
+#X obj 208 435 \$0;
+#X obj 208 500 t a b;
+#X obj 241 53 r \$0-recstop;
+#X obj 241 154 \$0;
+#X obj 278 154 * 8192;
+#X obj 400 412 * 8192;
+#X obj 208 478 vasp.f 8192;
+#X obj 81 348 t b b;
+#X obj 208 617 delay;
+#X msg 241 201 vasp \$1-;
+#X msg 209 458 vasp \$1-;
+#X obj 137 479 s \$0-sm;
+#X obj 135 540 s \$0-rb;
+#X obj 83 538 s \$0-lb;
+#X msg 83 516 0;
+#X msg 135 519 400;
+#X obj 53 567 s \$0-redraw;
+#X obj 81 429 * 0.0025;
+#X obj 81 406 0;
+#X obj 278 177 t f f;
+#X obj 96 632 vasp.u;
+#X obj 96 588 \$0;
+#X msg 96 610 vasp \$1-;
+#X obj 81 452 t b b b b f;
+#X connect 0 0 4 1;
+#X connect 1 0 9 1;
+#X connect 2 0 21 0;
+#X connect 3 0 26 0;
+#X connect 4 0 1 0;
+#X connect 5 0 15 0;
+#X connect 7 0 9 0;
+#X connect 9 0 23 0;
+#X connect 10 0 11 0;
+#X connect 10 0 32 0;
+#X connect 11 0 10 1;
+#X connect 12 0 10 1;
+#X connect 14 0 34 0;
+#X connect 14 1 18 0;
+#X connect 15 0 22 1;
+#X connect 15 1 1 1;
+#X connect 18 0 27 0;
+#X connect 18 1 4 0;
+#X connect 18 2 5 0;
+#X connect 18 3 10 0;
+#X connect 19 0 12 0;
+#X connect 21 0 22 0;
+#X connect 22 0 14 0;
+#X connect 23 0 35 0;
+#X connect 25 0 3 1;
+#X connect 26 0 30 0;
+#X connect 26 1 22 1;
+#X connect 26 2 31 0;
+#X connect 27 0 37 0;
+#X connect 28 0 7 0;
+#X connect 29 0 3 0;
+#X connect 30 0 36 0;
+#X connect 31 0 46 0;
+#X connect 32 0 7 1;
+#X connect 33 0 28 0;
+#X connect 34 0 45 0;
+#X connect 34 1 20 0;
+#X connect 35 0 22 0;
+#X connect 36 0 2 0;
+#X connect 37 0 33 0;
+#X connect 41 0 40 0;
+#X connect 42 0 39 0;
+#X connect 44 0 50 0;
+#X connect 45 0 44 0;
+#X connect 46 0 45 1;
+#X connect 46 1 2 1;
+#X connect 48 0 49 0;
+#X connect 49 0 47 0;
+#X connect 50 0 43 0;
+#X connect 50 1 48 0;
+#X connect 50 2 41 0;
+#X connect 50 3 42 0;
+#X connect 50 4 38 0;
+#X restore 79 489 pd write_multi_channel_to_ergebnis;
+#X obj 150 340 s \$0-number_of_slices;
+#X obj 79 238 t b b b;
+#X obj 84 93 tabsend~ \$0-rec_temp;
+#X obj 79 208 spigot;
+#X obj 207 158 t f f;
+#X obj 468 317 table \$0-rec_temp 8192;
+#X obj 468 350 block~ 8192;
+#X obj 207 138 r \$0-rec_1_0;
+#X connect 2 0 24 0;
+#X connect 4 0 3 0;
+#X connect 5 0 10 1;
+#X connect 5 0 21 0;
+#X connect 7 0 9 0;
+#X connect 8 0 10 0;
+#X connect 9 0 8 0;
+#X connect 10 0 5 0;
+#X connect 11 0 10 1;
+#X connect 13 0 14 0;
+#X connect 14 0 13 1;
+#X connect 14 0 17 0;
+#X connect 15 0 13 1;
+#X connect 17 0 7 0;
+#X connect 17 1 22 0;
+#X connect 18 0 11 0;
+#X connect 19 0 15 0;
+#X connect 20 0 25 0;
+#X connect 23 0 13 0;
+#X connect 25 0 23 0;
+#X connect 26 0 4 0;
+#X connect 26 1 25 1;
+#X connect 29 0 26 0;
+#X restore 46 99 pd record_RAM;
+#X obj 47 62 inlet~;
+#X obj 147 150 - 100;
+#X obj 147 77 env~ 16384;
+#X obj 147 171 s \$0-vu1;
+#X obj 147 116 spigot;
+#X obj 217 76 r \$0-monis;
+#X msg 193 150 -100;
+#X obj 217 97 t b f;
+#X connect 1 0 0 0;
+#X connect 1 0 3 0;
+#X connect 2 0 4 0;
+#X connect 3 0 5 0;
+#X connect 5 0 2 0;
+#X connect 6 0 8 0;
+#X connect 7 0 4 0;
+#X connect 8 0 7 0;
+#X connect 8 1 5 1;
+#X restore 391 177 pd record;
+#X connect 1 0 15 0;
+#X connect 18 0 15 1;
+#X connect 20 0 22 0;
+#X restore 650 290 pd inside;
#X obj 72 100 cnv 2 2 100 empty \$0-p1 empty 20 12 576 14 -1 -233017
0;
#X obj 73 100 cnv 1 400 100 empty \$0-p1b empty 20 12 576 14 -257472
@@ -1278,16 +1653,13 @@ shift selection;
#X obj 484 273 bng 15 250 50 0 \$0-reloadarray \$0-nixr reload_from_array
18 6 1729 8 -44926 -1 -1;
#X text 535 212 (wave-format);
-#X obj 71 257 nbx 5 14 0 100 0 0 \$0-vols \$0-volr empty 0 -6 1729
-8 -262144 -1 -1 0 256;
-#X obj 117 256 bng 15 250 50 0 \$0-mutevol \$0-nixr empty 0 -6 1728
-8 -262144 -1 -1;
-#X obj 74 238 hsl 101 15 0 100 0 0 \$0-vols \$0-volr volume 6 7 1729
+#X obj 71 257 nbx 5 14 -1000 0 0 1 \$0-voldispls \$0-voldisplr empty
+0 -6 1729 8 -262144 -1 -1 -1000 256;
+#X obj 74 238 hsl 101 15 0 50 0 0 \$0-vols \$0-volr volume 6 7 1729
8 -262144 -1 -1 0 1;
-#X text 140 256 mute;
#X obj 213 254 bng 15 250 50 0 \$0-normalize \$0-nixr normalize 0 -6
1729 8 -62784 -1 -1;
-#N canvas 0 0 543 350 help 0;
+#N canvas 0 0 551 358 help 0;
#X text 67 47 help:;
#X text 69 69 this is a very basic wave editor \, kind of prototype...
;
@@ -1302,5 +1674,54 @@ array is then loaded by default. but needs to be updated \, if the
array is changed outside the editor. by clicking "send to array" the
edited sample is sent to the (default) array outside.;
#X text 279 305 marius.schebella@chello.at;
-#X restore 650 266 pd help;
+#X restore 649 240 pd help;
+#X text 116 257 -50dB to 0dB;
+#X obj 125 210 tgl 18 0 \$0-recbuttons \$0-recbuttonr empty 0 -6 1728
+8 -262144 -1 -1 0 1;
+#X obj 120 206 cnv 15 28 25 empty empty empty 20 12 0 14 -233017 -262144
+0;
+#X obj 123 210 cnv 15 20 15 empty \$0-rec_white empty 20 12 576 14
+-262144 -262144 0;
+#X obj 125 212 cnv 15 20 15 empty \$0-rec_dark empty 20 12 576 14 -128992
+-262144 0;
+#X obj 124 211 cnv 15 20 15 empty \$0-rec_normal empty 20 12 576 14
+-233017 -66577 0;
+#X obj 131 215 cnv 1 1 1 empty \$0-recbutton1 empty 20 12 576 14 -143491
+-262144 0;
+#X obj 133 215 cnv 1 1 1 empty \$0-recbutton1 empty 20 12 576 14 -143491
+-262144 0;
+#X obj 135 215 cnv 1 1 1 empty \$0-recbutton1 empty 20 12 576 14 -143491
+-262144 0;
+#X obj 130 216 cnv 1 1 1 empty \$0-recbutton1 empty 20 12 576 14 -143491
+-262144 0;
+#X obj 132 216 cnv 1 1 1 empty \$0-recbutton1 empty 20 12 576 14 -143491
+-262144 0;
+#X obj 134 216 cnv 1 1 1 empty \$0-recbutton1 empty 20 12 576 14 -143491
+-262144 0;
+#X obj 132 219 cnv 1 1 1 empty \$0-recbutton1 empty 20 12 576 14 -143491
+-262144 0;
+#X obj 136 219 cnv 1 1 1 empty \$0-recbutton1 empty 20 12 576 14 -143491
+-262144 0;
+#X obj 136 216 cnv 1 1 1 empty \$0-recbutton1 empty 20 12 576 14 -143491
+-262144 0;
+#X obj 134 219 cnv 1 1 1 empty \$0-recbutton1 empty 20 12 576 14 -143491
+-262144 0;
+#X obj 133 220 cnv 1 1 1 empty \$0-recbutton1 empty 20 12 576 14 -143491
+-262144 0;
+#X obj 130 218 cnv 1 1 1 empty \$0-recbutton1 empty 20 12 576 14 -143491
+-262144 0;
+#X obj 130 219 cnv 1 1 1 empty \$0-recbutton1 empty 20 12 576 14 -143491
+-262144 0;
+#X obj 131 220 cnv 1 1 1 empty \$0-recbutton1 empty 20 12 576 14 -143491
+-262144 0;
+#X obj 134 218 cnv 1 1 1 empty \$0-recbutton1 empty 20 12 576 14 -143491
+-262144 0;
+#X obj 135 220 cnv 1 1 1 empty \$0-recbutton1 empty 20 12 576 14 -143491
+-262144 0;
+#X obj 132 217 cnv 1 1 1 empty \$0-recbutton1 empty 20 12 576 14 -143491
+-262144 0;
+#X obj 136 218 cnv 1 1 1 empty \$0-recbutton1 empty 20 12 576 14 -143491
+-262144 0;
+#X obj 650 267 inlet~;
+#X connect 102 0 2 0;
#X coords 0 0 1 1 200 140 0;
diff --git a/externals/grill/vasp/todo/marius.txt b/externals/grill/vasp/todo/marius.txt
index 15b2fdef..735fa5f9 100644
--- a/externals/grill/vasp/todo/marius.txt
+++ b/externals/grill/vasp/todo/marius.txt
@@ -1,20 +1,5 @@
-Thomas' Änderungen:
-
-- vasp.frames: der Ausdruck "framesize" ist eigentlich irreführend
- ... die kann bei verschiedenen Buffern in MaxMSP tatsächlich verschieden sein
- framesize = sample-Länge*Bufferkanäle !!
- besser ist frame count
- Ich frage mich auch, ob wir die Nummernboxen bei Periodenlängen nicht durch ein
- paar Standard-float-messages ersetzen sollten (die meisten werden wohl zu kurbeln versuchen....)
-
-- vasp.join / vasp.split.... man sollte vielleicht sagen, dass es sich um EInzelvektoren der vasps handelt=======
-
-- wavedisplay-select überprüfen.
-
-- die default-längen und resize einstellungen noch einmal überprüfen
-
-- vasp.cpowi, vasp.csqr und vasp.rpow vorläufig noch mit resize, ...
-
-- alle unnötigen objekte aus der hilfe rausnehemen.
-
-- schauen ob alle abkürzungen angeführt sind... \ No newline at end of file
+vasp.copy besser die offsets erklären
+genauso bei vasp.= nicht so komplizierte sachen...
+bei den peaks muss man erklären, was die density genau aussagt
+bei vasp.! zeigen, dass man einfach aus einem normalen einen immediate machen kann...
+phase bei den oscillatoren??
diff --git a/externals/grill/vasp/todo/neue-objekte.txt b/externals/grill/vasp/todo/neue-objekte.txt
index 34519619..e7000804 100644
--- a/externals/grill/vasp/todo/neue-objekte.txt
+++ b/externals/grill/vasp/todo/neue-objekte.txt
@@ -1,10 +1,3 @@
liste aller objekte, die noch in die hilfe aufgenommen werden müssen
-envelopes
-immediate vasps
-vasp.->
-NAN-behandlung (vasp.fix)
-threads
-vasp.tilt, vasp.xtilt
-vasp.offset=,vasp.frames=
-vasp.window
+die argumente \ No newline at end of file
diff --git a/externals/grill/vasp/vasp.cw b/externals/grill/vasp/vasp.cw
index 81b9dd56..77e952b0 100644
--- a/externals/grill/vasp/vasp.cw
+++ b/externals/grill/vasp/vasp.cw
Binary files differ
diff --git a/externals/grill/vst/pd/vst~.pd b/externals/grill/vst/pd/vst~.pd
index 56b795ef..0900c359 100644
--- a/externals/grill/vst/pd/vst~.pd
+++ b/externals/grill/vst/pd/vst~.pd
@@ -1,4 +1,4 @@
-#N canvas 108 26 866 648 12;
+#N canvas 108 26 868 650 12;
#X obj 26 207 dac~;
#X obj 26 107 noise~;
#X obj 444 172 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -225271
@@ -13,7 +13,7 @@
#X msg 26 389 edit \$1;
#X msg 94 389 getedit;
#X msg 89 473 getvis;
-#N canvas 367 122 542 449 info 0;
+#N canvas 367 122 544 451 info 0;
#X msg 94 130 getversion;
#X msg 94 75 getname;
#X msg 95 153 getvendor;
@@ -51,16 +51,16 @@
#X connect 11 0 7 0;
#X connect 19 0 7 0;
#X connect 21 0 7 0;
-#X restore 414 537 pd info;
+#X restore 414 561 pd info;
#X obj 96 109 r \$0-vst;
#X obj 25 416 s \$0-vst;
#X obj 25 499 s \$0-vst;
#X text 52 366 display edit window;
#X text 50 449 make edit window (in)visible;
#X obj 413 353 s \$0-vst;
-#X obj 414 493 s \$0-vst;
-#X msg 443 447 program 2;
-#X msg 529 446 getprogram;
+#X obj 414 517 s \$0-vst;
+#X msg 443 471 program 2;
+#X msg 529 470 getprogram;
#X msg 413 109 getparams;
#X text 498 108 get number of parameters;
#X text 509 414 get number of programs;
@@ -69,7 +69,7 @@
#X msg 105 295 getplug;
#X obj 26 323 s \$0-vst;
#X text 175 294 set/get plugin;
-#X text 480 537 further information;
+#X text 480 561 further information;
#X obj 23 15 cnv 15 550 58 empty empty vst~ 10 32 0 24 -260818 -1 0
;
#X text 134 53 http://www.parasitaere-kapazitaeten.net;
@@ -123,7 +123,7 @@
#X text 455 310 get value in textual representation;
#X msg 440 283 getptext 2;
#X text 466 211 set/get parameter (0-based);
-#X text 469 472 set/get program (0-based);
+#X text 469 496 set/get program (0-based);
#X text 487 251 NOT IMPLEMENTED;
#X text 544 270 NOT IMPLEMENTED;
#X obj 26 153 vst~ 1 2 reson;
@@ -156,6 +156,8 @@
#X connect 12 0 0 0;
#X restore 25 581 pd midi;
#X text 93 582 midi messages for vst synths;
+#X msg 414 442 getprogcats;
+#X text 509 439 get number of program categories;
#X connect 1 0 48 0;
#X connect 2 0 3 0;
#X connect 3 0 17 0;
@@ -183,3 +185,4 @@
#X connect 50 0 27 0;
#X connect 51 0 52 0;
#X connect 52 0 50 0;
+#X connect 55 0 18 0;
diff --git a/externals/grill/vst/readme.txt b/externals/grill/vst/readme.txt
index 3918a7b2..6af5edc3 100644
--- a/externals/grill/vst/readme.txt
+++ b/externals/grill/vst/readme.txt
@@ -1,56 +1,59 @@
-vst~ - VST plugin external for PD
-based on the work of Jarno Seppänen and Mark Williamson
-
-Copyright (c)2003 Thomas Grill (xovo@gmx.net)
-For information on usage and redistribution, and for a DISCLAIMER OF ALL
-WARRANTIES, see the file, "license.txt," in this distribution.
-
-Donations for further development of the package are highly appreciated.
-
-----------------------------------------------------------------------------
-
-You will need the flext C++ layer for PD and Max/MSP externals to compile this.
-see http://www.parasitaere-kapazitaeten.net/ext
-
-----------------------------------------------------------------------------
-
-
-BUILDING:
-=========
-
-
-pd - Windows:
--------------
-o Microsoft Visual C++ 6: edit the project file "vst.dsp" & build
-
-pd - darwin (MacOSX):
----------------------
-o GCC: edit "config-pd-darwin.txt" & run "sh build-pd-darwin.sh"
-
-Max/MSP - MacOS9/X:
--------------------
-o CodeWarrior: edit "vst.cw" and build
-
-
-----------------------------------------------------------------------------
-
-Version history:
-
-0.1.0:
-- fixed crash when there's no "VST_PATH" environment string found
-- included pd path into VST search path
-- made thread of editor window low priority
-- introduced A LOT of attributes to get info about the plugin
-- make editor window closable by patch
-- plugin can be changed with plug attribute
-
-0.0.0:
-- version of mark@junklight.com
-
----------------------------------------------------------------------------
-
-features:
-- allow various window styles and window moving & titling
-- include necessary Steinberg license stuff
-
-
+vst~ - VST plugin external for PD
+based on the work of Jarno Seppänen and Mark Williamson
+
+Copyright (c)2003 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+Donations for further development of the package are highly appreciated.
+
+----------------------------------------------------------------------------
+
+You will need the flext C++ layer for PD and Max/MSP externals to compile this.
+see http://www.parasitaere-kapazitaeten.net/ext
+
+----------------------------------------------------------------------------
+
+
+BUILDING:
+=========
+
+
+pd - Windows:
+-------------
+o Microsoft Visual C++ 6: edit the project file "vst.dsp" & build
+
+pd - darwin (MacOSX):
+---------------------
+o GCC: edit "config-pd-darwin.txt" & run "sh build-pd-darwin.sh"
+
+Max/MSP - MacOS9/X:
+-------------------
+o CodeWarrior: edit "vst.cw" and build
+
+
+----------------------------------------------------------------------------
+
+Version history:
+
+0.1.0:
+- fixed crash when there's no "VST_PATH" environment string found
+- included pd path into VST search path
+- made thread of editor window low priority
+- introduced A LOT of attributes to get info about the plugin
+- make editor window closable by patch
+- plugin can be changed with plug attribute
+
+0.0.0:
+- version of mark@junklight.com
+
+---------------------------------------------------------------------------
+
+features:
+- allow various window styles and window moving & titling
+- include necessary Steinberg license stuff
+
+BUGS:
+- strange: GRM reson stutters when GUI is edited with the mouse (mousedown)
+ -> plug sends (a lot of) idle messages
+ -> no stuttering when a message is posted to the console... ähem
diff --git a/externals/grill/vst/src/VstHost.cpp b/externals/grill/vst/src/VstHost.cpp
index 8e6f2eb4..57a67c52 100644
--- a/externals/grill/vst/src/VstHost.cpp
+++ b/externals/grill/vst/src/VstHost.cpp
@@ -1,541 +1,567 @@
-#include "stdafx.h"
-#include "EditorThread.h"
-#include "VstHost.h"
-#include "PopupWindow.h"
-#include "vst\aeffeditor.h"
-#include "vst\aeffectx.h"
-
-
-VstTimeInfo VSTPlugin::_timeInfo;
-
-float VSTPlugin::sample_rate = 44100;
-
-
-extern "C" void post(char *fmt, ...);
-
-////////////////////
-//
-/////////////////////
-VSTPlugin::VSTPlugin():
- posx(0),posy(0),
- _editor(false)
-{
- queue_size=0;
- _sDllName = NULL;
- h_dll=NULL;
- instantiated=false; // Constructin' with no instance
- overwrite = false;
- w = GetForegroundWindow();
-// show_params = false;
- _midichannel = 0;
- edited = false;
-}
-
-VSTPlugin::~VSTPlugin()
-{
- Free(); // Call free
- delete _sDllName; // if _sDllName = NULL , the operation does nothing -> it's safe.
-}
-
-int VSTPlugin::Instance( const char *dllname)
-{
- h_dll=LoadLibrary(dllname);
-
- if(h_dll==NULL)
- {
- return VSTINSTANCE_ERR_NO_VALID_FILE;
- }
-// post("Loaded library %s" , dllname);
- PVSTMAIN main = (PVSTMAIN)GetProcAddress(h_dll,"main");
- if(!main)
- {
- FreeLibrary(h_dll);
- _pEffect=NULL;
- instantiated=false;
- return VSTINSTANCE_ERR_NO_VST_PLUGIN;
- }
- //post("Found main function - about to call it");
- //This calls the "main" function and receives the pointer to the AEffect structure.
- _pEffect = main((audioMasterCallback)&(this->Master));
-
- if(!_pEffect)
- {
- post("VST plugin : unable to create effect");
- FreeLibrary(h_dll);
- _pEffect=NULL;
- instantiated=false;
- return VSTINSTANCE_ERR_REJECTED;
- }
-
- if( _pEffect->magic!=kEffectMagic)
- {
- post("VST plugin : Instance query rejected by 0x%.8X\n",(int)_pEffect);
- FreeLibrary(h_dll);
- _pEffect=NULL;
- instantiated=false;
- return VSTINSTANCE_ERR_REJECTED;
- }
-
- //post("VST plugin : Instanced at (Effect*): %.8X\n",(int)_pEffect);
-
- //init plugin
- _pEffect->user = this;
- Dispatch( effOpen , 0, 0, NULL, 0.0f);
- Dispatch( effSetProgram , 0, 0, NULL, 0.0f);
-// Dispatch( effMainsChanged, 0, 1, NULL, 0.0f);
-
- //************************************set samplerate and stream size here
- // we get it when we init our DSP
-
-// Dispatch( effSetSampleRate, 0, 0, NULL, (float)Global::pConfig->_pOutputDriver->_samplesPerSec);
-// Dispatch( effSetBlockSize, 0, STREAM_SIZE, NULL, 0.0f);
-
-
- if (!Dispatch( effGetProductString, 0, 0, &_sProductName, 0.0f))
- {
- CString str1(dllname);
- CString str2 = str1.Mid(str1.ReverseFind('\\')+1);
- int snip = str2.Find('.');
- if ( snip != -1 )
- {
- str1 = str2.Left( snip );
- }
- else
- {
- str1 = str2;
- }
- strcpy(_sProductName,str1);
-
- }
-
- if (!_pEffect->dispatcher(_pEffect, effGetVendorString, 0, 0, &_sVendorName, 0.0f))
- {
- strcpy(_sVendorName, "Unknown vendor");
- }
- _version = _pEffect->version;
- _isSynth = (_pEffect->flags & effFlagsIsSynth)?true:false;
- overwrite = (_pEffect->flags & effFlagsCanReplacing)?true:false;
- _editor = (_pEffect->flags & effFlagsHasEditor)?true:false;
-
- if ( _sDllName != NULL ) delete _sDllName;
- _sDllName = new char[strlen(dllname)+1];
- sprintf(_sDllName,dllname);
-
-
-
-
- //keep plugin name
- instantiated=true;
-
- return VSTINSTANCE_NO_ERROR;
-}
-
-int VSTPlugin::getNumInputs( void )
-{
- return _pEffect->numInputs;
-}
-
-int VSTPlugin::getNumOutputs( void )
-{
- return _pEffect->numOutputs;
-}
-
-
-void VSTPlugin::Create(VSTPlugin *plug)
-{
- h_dll=plug->h_dll;
- _pEffect=plug->_pEffect;
- _pEffect->user=this;
- Dispatch( effMainsChanged, 0, 1, NULL, 0.0f);
-// strcpy(_editName,plug->_editName); On current implementation, this replaces the right one.
- strcpy(_sProductName,plug->_sProductName);
- strcpy(_sVendorName,plug->_sVendorName);
-
- _sDllName = new char[strlen(plug->_sDllName)+1];
- strcpy(_sDllName,plug->_sDllName);
-
- _isSynth=plug->_isSynth;
- _version=plug->_version;
-
- plug->instantiated=false; // We are "stoling" the plugin from the "plug" object so this
- // is just a "trick" so that when destructing the "plug", it
- // doesn't unload the Dll.
- instantiated=true;
-}
-
-void VSTPlugin::Free() // Called also in destruction
-{
- if(instantiated)
- {
- instantiated=false;
- post("VST plugin : Free query 0x%.8X\n",(int)_pEffect);
- _pEffect->user = NULL;
- Dispatch( effMainsChanged, 0, 0, NULL, 0.0f);
- Dispatch( effClose, 0, 0, NULL, 0.0f);
-// delete _pEffect; // <- Should check for the necessity of this command.
- _pEffect=NULL;
- FreeLibrary(h_dll);
- }
-}
-
-void VSTPlugin::Init( float samplerate , float blocksize )
-{
- sample_rate = samplerate;
- Dispatch(effOpen , 0, 0, NULL, 0.f);
- Dispatch(effMainsChanged, 0, 1, NULL, 0.f);
- Dispatch(effSetSampleRate, 0, 0, 0, (float) sample_rate );
- Dispatch(effSetBlockSize, 0, blocksize, NULL, 0.f );
-}
-
-
-bool VSTPlugin::DescribeValue(int p,char* psTxt)
-{
- int parameter = p;
- if(instantiated)
- {
- if(parameter<_pEffect->numParams)
- {
-// char par_name[64];
- char par_display[64];
- char par_label[64];
-
-// Dispatch(effGetParamName,parameter,0,par_name,0.0f);
- Dispatch(effGetParamDisplay,parameter,0,par_display,0.0f);
- Dispatch(effGetParamLabel,parameter,0,par_label,0.0f);
-// sprintf(psTxt,"%s:%s%s",par_name,par_display,par_label);
- sprintf(psTxt,"%s%s",par_display,par_label);
- return true;
- }
- else sprintf(psTxt,"NumParams Exeeded");
- }
- else sprintf(psTxt,"Not loaded");
-
- return false;
-}
-
-bool VSTPlugin::SetParameter(int parameter, float value)
-{
- if(instantiated)
- {
- if (( parameter >= 0 ) && (parameter<=_pEffect->numParams))
- {
- _pEffect->setParameter(_pEffect,parameter,value);
- return true;
- }
- }
-
- return false;
-}
-
-bool VSTPlugin::SetParameter(int parameter, int value)
-{
- return SetParameter(parameter,value/65535.0f);
-}
-
-int VSTPlugin::GetCurrentProgram()
-{
- if(instantiated)
- return Dispatch(effGetProgram,0,0,NULL,0.0f);
- else
- return 0;
-}
-
-void VSTPlugin::SetCurrentProgram(int prg)
-{
- if(instantiated)
- Dispatch(effSetProgram,0,prg,NULL,0.0f);
-}
-
-bool VSTPlugin::AddMIDI(unsigned char data0,unsigned char data1,unsigned char data2)
-{
- if (instantiated)
- {
- VstMidiEvent* pevent=&midievent[queue_size];
-
- pevent->type = kVstMidiType;
- pevent->byteSize = 24;
- pevent->deltaFrames = 0;
- pevent->flags = 0;
- pevent->detune = 0;
- pevent->noteLength = 0;
- pevent->noteOffset = 0;
- pevent->reserved1 = 0;
- pevent->reserved2 = 0;
- pevent->noteOffVelocity = 0;
- pevent->midiData[0] = data0;
- pevent->midiData[1] = data1;
- pevent->midiData[2] = data2;
- pevent->midiData[3] = 0;
-
- if ( queue_size < MAX_EVENTS ) queue_size++;
- SendMidi();
- return true;
- }
- else return false;
-}
-
-
-void VSTPlugin::SendMidi()
-{
- if(/*instantiated &&*/ queue_size>0)
- {
- // Prepare MIDI events and free queue dispatching all events
- events.numEvents = queue_size;
- events.reserved = 0;
- for(int q=0;q<queue_size;q++) events.events[q] = (VstEvent*)&midievent[q];
-
- Dispatch(effProcessEvents, 0, 0, &events, 0.0f);
- queue_size=0;
- }
-}
-
-
-void VSTPlugin::processReplacing( float **inputs, float **outputs, long sampleframes )
-{
- _pEffect->processReplacing( _pEffect , inputs , outputs , sampleframes );
-
-}
-
-void VSTPlugin::process( float **inputs, float **outputs, long sampleframes )
-{
- _pEffect->process( _pEffect , inputs , outputs , sampleframes );
-}
-
-
-// Host callback dispatcher
-long VSTPlugin::Master(AEffect *effect, long opcode, long index, long value, void *ptr, float opt)
-{
- post("VST plugin call to host dispatcher: Eff: 0x%.8X, Opcode = %d, Index = %d, Value = %d, PTR = %.8X, OPT = %.3f\n",(int)effect, opcode,index,value,(int)ptr,opt);
- //st( "audioMasterWantMidi %d " , audioMasterWantMidi);
-
- // Support opcodes
- switch(opcode)
- {
- case audioMasterAutomate:
- return 0; // index, value, returns 0
-
- case audioMasterVersion:
- return 9; // vst version, currently 7 (0 for older)
-
- case audioMasterCurrentId:
- return 'AASH'; // returns the unique id of a plug that's currently loading
-
- case audioMasterIdle:
- effect->dispatcher(effect, effEditIdle, 0, 0, NULL, 0.0f);
- return 0; // call application idle routine (this will call effEditIdle for all open editors too)
-
- case audioMasterPinConnected:
- return false; // inquire if an input or output is beeing connected;
-
- case audioMasterWantMidi:
- return 0;
-
- case audioMasterProcessEvents:
- return 0; // Support of vst events to host is not available
-
- case audioMasterGetTime:
- memset(&_timeInfo, 0, sizeof(_timeInfo));
- _timeInfo.samplePos = 0;
- _timeInfo.sampleRate = sample_rate;
- return (long)&_timeInfo;
-
-
- case audioMasterTempoAt:
- return 0;
-
- case audioMasterNeedIdle:
- effect->dispatcher(effect, effIdle, 0, 0, NULL, 0.0f);
- return 1;
-
- case audioMasterGetSampleRate:
- return sample_rate;
-
- case audioMasterGetVendorString: // Just fooling version string
- strcpy((char*)ptr,"Steinberg");
- return 0;
-
- case audioMasterGetVendorVersion:
- return 5000; // HOST version 5000
-
- case audioMasterGetProductString: // Just fooling product string
- strcpy((char*)ptr,"Cubase 5.0");
- return 0;
-
- case audioMasterVendorSpecific:
- {
- return 0;
- }
-
-
- case audioMasterGetLanguage:
- return kVstLangEnglish;
-
- case audioMasterUpdateDisplay:
- post("audioMasterUpdateDisplay");
- effect->dispatcher(effect, effEditIdle, 0, 0, NULL, 0.0f);
- return 0;
-
-
- case audioMasterSetTime: post("VST master dispatcher: Set Time");break;
- case audioMasterGetNumAutomatableParameters: post("VST master dispatcher: GetNumAutPar");break;
- case audioMasterGetParameterQuantization: post("VST master dispatcher: ParamQuant");break;
- case audioMasterIOChanged: post("VST master dispatcher: IOchanged");break;
- case audioMasterSizeWindow: post("VST master dispatcher: Size Window");break;
- case audioMasterGetBlockSize: post("VST master dispatcher: GetBlockSize");break;
- case audioMasterGetInputLatency: post("VST master dispatcher: GetInLatency");break;
- case audioMasterGetOutputLatency: post("VST master dispatcher: GetOutLatency");break;
- case audioMasterGetPreviousPlug: post("VST master dispatcher: PrevPlug");break;
- case audioMasterGetNextPlug: post("VST master dispatcher: NextPlug");break;
- case audioMasterWillReplaceOrAccumulate: post("VST master dispatcher: WillReplace"); break;
- case audioMasterGetCurrentProcessLevel: return 0; break;
- case audioMasterGetAutomationState: post("VST master dispatcher: GetAutState");break;
- case audioMasterOfflineStart: post("VST master dispatcher: Offlinestart");break;
- case audioMasterOfflineRead: post("VST master dispatcher: Offlineread");break;
- case audioMasterOfflineWrite: post("VST master dispatcher: Offlinewrite");break;
- case audioMasterOfflineGetCurrentPass: post("VST master dispatcher: OfflineGetcurrentpass");break;
- case audioMasterOfflineGetCurrentMetaPass: post("VST master dispatcher: GetGetCurrentMetapass");break;
- case audioMasterSetOutputSampleRate: post("VST master dispatcher: Setsamplerate");break;
- case audioMasterGetSpeakerArrangement: post("VST master dispatcher: Getspeaker");break;
- case audioMasterSetIcon: post("VST master dispatcher: seticon");break;
- case audioMasterCanDo: post("VST master dispatcher: Can Do");break;
- case audioMasterOpenWindow: post("VST master dispatcher: OpenWindow");break;
- case audioMasterCloseWindow: post("VST master dispatcher: CloseWindow");break;
- case audioMasterGetDirectory: post("VST master dispatcher: GetDirectory");break;
-// case audioMasterUpdateDisplay: post("VST master dispatcher: audioMasterUpdateDisplay");break;
-
- default: post("VST master dispatcher: undefed: %d , %d",opcode , effKeysRequired ) ;break;
- }
-
- return 0;
-}
-
-bool VSTPlugin::AddNoteOn( unsigned char note,unsigned char speed,unsigned char midichannel)
-{
- return AddMIDI((char)MIDI_NOTEON | midichannel,note,speed);
-}
-
-bool VSTPlugin::AddNoteOff( unsigned char note,unsigned char midichannel)
-{
- return AddMIDI((char)MIDI_NOTEOFF | midichannel,note,0);
-}
-
-
-bool VSTPlugin::replace()
-{
- return overwrite;
-}
-
-
-void VSTPlugin::edit(bool open)
-{
- if(instantiated) {
- if(open) {
- if ( HasEditor() && !edited) {
- edited = true;
- b = new CEditorThread();
- b->SetPlugin( this);
- b->CreateThread();
- }
- }
- else {
- if (HasEditor() && edited) b->Close();
- }
- }
-}
-
-void VSTPlugin::visible(bool vis)
-{
- if(instantiated && edited) b->Show(vis);
-}
-
-void VSTPlugin::EditorIdle()
-{
- Dispatch(effEditIdle,0,0, w,0.0f);
-}
-
-RECT VSTPlugin::GetEditorRect()
-{
- RECT ret;
- ERect *r;
- Dispatch(effEditGetRect,0,0, &r,0.0f);
- ret.top = r->top;
- ret.bottom = r->bottom;
- ret.left = r->left;
- ret.right = r->right;
- return ret;
-}
-
-void VSTPlugin::SetEditWindow(HWND h)
-{
- w = h;
- Dispatch(effEditOpen,0,0, w,0.0f);
-}
-
-void VSTPlugin::OnEditorClose()
-{
- Dispatch(effEditClose,0,0, w,0.0f);
-}
-
-/*
-void VSTPlugin::SetShowParameters(bool s)
-{
- show_params = s;
-}
-
-bool VSTPlugin::ShowParams()
-{
- return show_params;
-}
-*/
-
-void VSTPlugin::AddAftertouch(int value)
-{
- if (value < 0) value = 0; else if (value > 127) value = 127;
- AddMIDI( (char)MIDI_NOTEOFF | _midichannel , value );
-}
-
-void VSTPlugin::AddPitchBend(int value)
-{
- AddMIDI( MIDI_PITCHBEND + (_midichannel & 0xf) , ((value>>7) & 127), (value & 127));
-}
-
-void VSTPlugin::AddProgramChange(int value)
-{
- if (value < 0) value = 0; else if (value > 127) value = 127;
- AddMIDI( MIDI_PROGRAMCHANGE + (_midichannel & 0xf), value, 0);
-}
-
-void VSTPlugin::AddControlChange(int control, int value)
-{
- if (control < 0) control = 0; else if (control > 127) control = 127;
- if (value < 0) value = 0; else if (value > 127) value = 127;
- AddMIDI( MIDI_CONTROLCHANGE + (_midichannel & 0xf), control, value);
-}
-
-
-bool VSTPlugin::GetProgramName( int cat , int p, char *buf)
-{
- int parameter = p;
- if(instantiated)
- {
- if(parameter<NumPrograms())
- {
- Dispatch(effGetProgramNameIndexed,parameter,cat,buf,0.0f);
- return true;
- }
- }
- return false;
-}
-
-int VSTPlugin::GetNumCategories()
-{
- if(instantiated)
- return Dispatch(effGetNumProgramCategories,0,0,NULL,0.0f);
- else
- return 0;
-}
-
-void VSTPlugin::StopEditing()
-{
- edited = false;
-}
+#include "stdafx.h"
+#include "EditorThread.h"
+#include "VstHost.h"
+#include "PopupWindow.h"
+#include "vst\aeffeditor.h"
+#include "vst\aeffectx.h"
+#include <flext.h>
+
+VstTimeInfo VSTPlugin::_timeInfo;
+
+float VSTPlugin::sample_rate = 44100;
+
+
+////////////////////
+//
+/////////////////////
+VSTPlugin::VSTPlugin():
+ posx(0),posy(0),
+ _editor(false)
+{
+ queue_size=0;
+ _sDllName = NULL;
+ h_dll=NULL;
+ instantiated=false; // Constructin' with no instance
+ overwrite = false;
+// wantidle = false;
+ w = GetForegroundWindow();
+// show_params = false;
+ _midichannel = 0;
+ edited = false;
+}
+
+VSTPlugin::~VSTPlugin()
+{
+ Free(); // Call free
+ delete _sDllName; // if _sDllName = NULL , the operation does nothing -> it's safe.
+}
+
+int VSTPlugin::Instance( const char *dllname)
+{
+ h_dll=LoadLibrary(dllname);
+
+ if(h_dll==NULL)
+ {
+ return VSTINSTANCE_ERR_NO_VALID_FILE;
+ }
+// post("Loaded library %s" , dllname);
+ PVSTMAIN main = (PVSTMAIN)GetProcAddress(h_dll,"main");
+ if(!main)
+ {
+ FreeLibrary(h_dll);
+ _pEffect=NULL;
+ instantiated=false;
+ return VSTINSTANCE_ERR_NO_VST_PLUGIN;
+ }
+ //post("Found main function - about to call it");
+ //This calls the "main" function and receives the pointer to the AEffect structure.
+ _pEffect = main((audioMasterCallback)&(this->Master));
+
+ if(!_pEffect)
+ {
+ post("VST plugin : unable to create effect");
+ FreeLibrary(h_dll);
+ _pEffect=NULL;
+ instantiated=false;
+ return VSTINSTANCE_ERR_REJECTED;
+ }
+
+ if( _pEffect->magic!=kEffectMagic)
+ {
+ post("VST plugin : Instance query rejected by 0x%.8X\n",(int)_pEffect);
+ FreeLibrary(h_dll);
+ _pEffect=NULL;
+ instantiated=false;
+ return VSTINSTANCE_ERR_REJECTED;
+ }
+
+ //post("VST plugin : Instanced at (Effect*): %.8X\n",(int)_pEffect);
+
+ //init plugin
+ _pEffect->user = this;
+ Dispatch( effOpen , 0, 0, NULL, 0.0f);
+ Dispatch( effSetProgram , 0, 0, NULL, 0.0f);
+// Dispatch( effMainsChanged, 0, 1, NULL, 0.0f);
+
+ //************************************set samplerate and stream size here
+ // we get it when we init our DSP
+
+// Dispatch( effSetSampleRate, 0, 0, NULL, (float)Global::pConfig->_pOutputDriver->_samplesPerSec);
+// Dispatch( effSetBlockSize, 0, STREAM_SIZE, NULL, 0.0f);
+
+
+ if (!Dispatch( effGetProductString, 0, 0, &_sProductName, 0.0f))
+ {
+ CString str1(dllname);
+ CString str2 = str1.Mid(str1.ReverseFind('\\')+1);
+ int snip = str2.Find('.');
+ if ( snip != -1 )
+ {
+ str1 = str2.Left( snip );
+ }
+ else
+ {
+ str1 = str2;
+ }
+ strcpy(_sProductName,str1);
+
+ }
+
+ if (!_pEffect->dispatcher(_pEffect, effGetVendorString, 0, 0, &_sVendorName, 0.0f))
+ {
+ strcpy(_sVendorName, "Unknown vendor");
+ }
+ _version = _pEffect->version;
+ _isSynth = (_pEffect->flags & effFlagsIsSynth)?true:false;
+ overwrite = (_pEffect->flags & effFlagsCanReplacing)?true:false;
+ _editor = (_pEffect->flags & effFlagsHasEditor)?true:false;
+
+ if ( _sDllName != NULL ) delete _sDllName;
+ _sDllName = new char[strlen(dllname)+1];
+ sprintf(_sDllName,dllname);
+
+
+
+
+ //keep plugin name
+ instantiated=true;
+
+ return VSTINSTANCE_NO_ERROR;
+}
+
+int VSTPlugin::getNumInputs( void )
+{
+ return _pEffect->numInputs;
+}
+
+int VSTPlugin::getNumOutputs( void )
+{
+ return _pEffect->numOutputs;
+}
+
+
+void VSTPlugin::Create(VSTPlugin *plug)
+{
+ h_dll=plug->h_dll;
+ _pEffect=plug->_pEffect;
+ _pEffect->user=this;
+ Dispatch( effMainsChanged, 0, 1, NULL, 0.0f);
+// strcpy(_editName,plug->_editName); On current implementation, this replaces the right one.
+ strcpy(_sProductName,plug->_sProductName);
+ strcpy(_sVendorName,plug->_sVendorName);
+
+ _sDllName = new char[strlen(plug->_sDllName)+1];
+ strcpy(_sDllName,plug->_sDllName);
+
+ _isSynth=plug->_isSynth;
+ _version=plug->_version;
+
+ plug->instantiated=false; // We are "stoling" the plugin from the "plug" object so this
+ // is just a "trick" so that when destructing the "plug", it
+ // doesn't unload the Dll.
+ instantiated=true;
+}
+
+void VSTPlugin::Free() // Called also in destruction
+{
+ if(instantiated)
+ {
+ instantiated=false;
+ post("VST plugin : Free query 0x%.8X\n",(int)_pEffect);
+ _pEffect->user = NULL;
+ Dispatch( effMainsChanged, 0, 0, NULL, 0.0f);
+ Dispatch( effClose, 0, 0, NULL, 0.0f);
+// delete _pEffect; // <- Should check for the necessity of this command.
+ _pEffect=NULL;
+ FreeLibrary(h_dll);
+ }
+}
+
+void VSTPlugin::Init( float samplerate , float blocksize )
+{
+ sample_rate = samplerate;
+ Dispatch(effOpen , 0, 0, NULL, 0.f);
+ Dispatch(effMainsChanged, 0, 1, NULL, 0.f);
+ Dispatch(effSetSampleRate, 0, 0, 0, (float) sample_rate );
+ Dispatch(effSetBlockSize, 0, blocksize, NULL, 0.f );
+}
+
+
+bool VSTPlugin::DescribeValue(int p,char* psTxt)
+{
+ int parameter = p;
+ if(instantiated)
+ {
+ if(parameter<_pEffect->numParams)
+ {
+// char par_name[64];
+ char par_display[64];
+ char par_label[64];
+
+// Dispatch(effGetParamName,parameter,0,par_name,0.0f);
+ Dispatch(effGetParamDisplay,parameter,0,par_display,0.0f);
+ Dispatch(effGetParamLabel,parameter,0,par_label,0.0f);
+// sprintf(psTxt,"%s:%s%s",par_name,par_display,par_label);
+ sprintf(psTxt,"%s%s",par_display,par_label);
+ return true;
+ }
+ else sprintf(psTxt,"NumParams Exeeded");
+ }
+ else sprintf(psTxt,"Not loaded");
+
+ return false;
+}
+
+bool VSTPlugin::SetParameter(int parameter, float value)
+{
+ if(instantiated)
+ {
+ if (( parameter >= 0 ) && (parameter<=_pEffect->numParams))
+ {
+ _pEffect->setParameter(_pEffect,parameter,value);
+ return true;
+ }
+ }
+
+ return false;
+}
+
+bool VSTPlugin::SetParameter(int parameter, int value)
+{
+ return SetParameter(parameter,value/65535.0f);
+}
+
+int VSTPlugin::GetCurrentProgram()
+{
+ if(instantiated)
+ return Dispatch(effGetProgram,0,0,NULL,0.0f);
+ else
+ return 0;
+}
+
+void VSTPlugin::SetCurrentProgram(int prg)
+{
+ if(instantiated)
+ Dispatch(effSetProgram,0,prg,NULL,0.0f);
+}
+
+bool VSTPlugin::AddMIDI(unsigned char data0,unsigned char data1,unsigned char data2)
+{
+ if (instantiated)
+ {
+ VstMidiEvent* pevent=&midievent[queue_size];
+
+ pevent->type = kVstMidiType;
+ pevent->byteSize = 24;
+ pevent->deltaFrames = 0;
+ pevent->flags = 0;
+ pevent->detune = 0;
+ pevent->noteLength = 0;
+ pevent->noteOffset = 0;
+ pevent->reserved1 = 0;
+ pevent->reserved2 = 0;
+ pevent->noteOffVelocity = 0;
+ pevent->midiData[0] = data0;
+ pevent->midiData[1] = data1;
+ pevent->midiData[2] = data2;
+ pevent->midiData[3] = 0;
+
+ if ( queue_size < MAX_EVENTS ) queue_size++;
+ SendMidi();
+ return true;
+ }
+ else return false;
+}
+
+
+void VSTPlugin::SendMidi()
+{
+ if(/*instantiated &&*/ queue_size>0)
+ {
+ // Prepare MIDI events and free queue dispatching all events
+ events.numEvents = queue_size;
+ events.reserved = 0;
+ for(int q=0;q<queue_size;q++) events.events[q] = (VstEvent*)&midievent[q];
+
+ Dispatch(effProcessEvents, 0, 0, &events, 0.0f);
+ queue_size=0;
+ }
+}
+
+
+void VSTPlugin::processReplacing( float **inputs, float **outputs, long sampleframes )
+{
+ _pEffect->processReplacing( _pEffect , inputs , outputs , sampleframes );
+
+}
+
+void VSTPlugin::process( float **inputs, float **outputs, long sampleframes )
+{
+ _pEffect->process( _pEffect , inputs , outputs , sampleframes );
+}
+
+
+// Host callback dispatcher
+long VSTPlugin::Master(AEffect *effect, long opcode, long index, long value, void *ptr, float opt)
+{
+#if 0 //def FLEXT_DEBUG
+ if(opcode != audioMasterGetTime)
+ post("VST plugin call to host dispatcher: Eff: 0x%.8X, Opcode = %d, Index = %d, Value = %d, PTR = %.8X, OPT = %.3f\n",(int)effect, opcode,index,value,(int)ptr,opt);
+ //st( "audioMasterWantMidi %d " , audioMasterWantMidi);
+#endif
+
+ // Support opcodes
+ switch(opcode)
+ {
+ case audioMasterAutomate:
+ return 0; // index, value, returns 0
+
+ case audioMasterVersion:
+ return 2; // vst version, currently 7 (0 for older)
+
+ case audioMasterCurrentId:
+ return 'AASH'; // returns the unique id of a plug that's currently loading
+
+ case audioMasterIdle:
+ effect->dispatcher(effect, effEditIdle, 0, 0, NULL, 0.0f);
+ return 0; // call application idle routine (this will call effEditIdle for all open editors too)
+
+ case audioMasterPinConnected:
+ if (value == 0) //input
+ {
+ if ( index < 2) return 0;
+ else return 1;
+ }
+ else //output
+ {
+ if ( index < 2) return 0;
+ else return 1;
+ }
+ return 0; // inquire if an input or output is beeing connected;
+
+ case audioMasterWantMidi:
+ return 0;
+
+ case audioMasterProcessEvents:
+ return 0; // Support of vst events to host is not available
+
+ case audioMasterGetTime:
+ memset(&_timeInfo, 0, sizeof(_timeInfo));
+ _timeInfo.samplePos = 0;
+ _timeInfo.sampleRate = sample_rate;
+ return (long)&_timeInfo;
+
+
+ case audioMasterTempoAt:
+ return 0;
+
+ case audioMasterNeedIdle:
+// effect->dispatcher(effect, effIdle, 0, 0, NULL, 0.0f);
+ return 1;
+
+ case audioMasterGetSampleRate:
+ return sample_rate;
+
+ case audioMasterGetVendorString: // Just fooling version string
+ strcpy((char*)ptr,"Steinberg");
+ return 0;
+
+ case audioMasterGetVendorVersion:
+ return 5000; // HOST version 5000
+
+ case audioMasterGetProductString: // Just fooling product string
+ strcpy((char*)ptr,"Cubase 5.0");
+ return 0;
+
+ case audioMasterVendorSpecific:
+ {
+ return 0;
+ }
+
+
+ case audioMasterGetLanguage:
+ return kVstLangEnglish;
+
+ case audioMasterUpdateDisplay:
+#ifdef FLEXT_DEBUG
+ post("audioMasterUpdateDisplay");
+#endif
+ effect->dispatcher(effect, effEditIdle, 0, 0, NULL, 0.0f);
+ return 0;
+
+ case audioMasterCanDo:
+ if (!strcmp((char*)ptr,"sendVstEvents")) return 1;
+ if (!strcmp((char*)ptr,"sendVstMidiEvent")) return 1;
+ if (!strcmp((char*)ptr,"sendVstTimeInfo")) return 1;
+// "receiveVstEvents",
+// "receiveVstMidiEvent",
+// "receiveVstTimeInfo",
+
+// "reportConnectionChanges",
+// "acceptIOChanges",
+ if (!strcmp((char*)ptr,"sizeWindow")) return 1;
+ if (!strcmp((char*)ptr,"supplyIdle")) return 1;
+ return -1;
+
+ case audioMasterSetTime: FLEXT_LOG("VST master dispatcher: Set Time");break;
+ case audioMasterGetNumAutomatableParameters: FLEXT_LOG("VST master dispatcher: GetNumAutPar");break;
+ case audioMasterGetParameterQuantization: FLEXT_LOG("VST master dispatcher: ParamQuant");break;
+ case audioMasterIOChanged: FLEXT_LOG("VST master dispatcher: IOchanged");break;
+ case audioMasterSizeWindow: FLEXT_LOG("VST master dispatcher: Size Window");break;
+ case audioMasterGetBlockSize: FLEXT_LOG("VST master dispatcher: GetBlockSize");break;
+ case audioMasterGetInputLatency: FLEXT_LOG("VST master dispatcher: GetInLatency");break;
+ case audioMasterGetOutputLatency: FLEXT_LOG("VST master dispatcher: GetOutLatency");break;
+ case audioMasterGetPreviousPlug: FLEXT_LOG("VST master dispatcher: PrevPlug");break;
+ case audioMasterGetNextPlug: FLEXT_LOG("VST master dispatcher: NextPlug");break;
+ case audioMasterWillReplaceOrAccumulate: FLEXT_LOG("VST master dispatcher: WillReplace"); break;
+ case audioMasterGetCurrentProcessLevel: return 0; break;
+ case audioMasterGetAutomationState: FLEXT_LOG("VST master dispatcher: GetAutState");break;
+ case audioMasterOfflineStart: FLEXT_LOG("VST master dispatcher: Offlinestart");break;
+ case audioMasterOfflineRead: FLEXT_LOG("VST master dispatcher: Offlineread");break;
+ case audioMasterOfflineWrite: FLEXT_LOG("VST master dispatcher: Offlinewrite");break;
+ case audioMasterOfflineGetCurrentPass: FLEXT_LOG("VST master dispatcher: OfflineGetcurrentpass");break;
+ case audioMasterOfflineGetCurrentMetaPass: FLEXT_LOG("VST master dispatcher: GetGetCurrentMetapass");break;
+ case audioMasterSetOutputSampleRate: FLEXT_LOG("VST master dispatcher: Setsamplerate");break;
+ case audioMasterGetSpeakerArrangement: FLEXT_LOG("VST master dispatcher: Getspeaker");break;
+ case audioMasterSetIcon: FLEXT_LOG("VST master dispatcher: seticon");break;
+ case audioMasterOpenWindow: FLEXT_LOG("VST master dispatcher: OpenWindow");break;
+ case audioMasterCloseWindow: FLEXT_LOG("VST master dispatcher: CloseWindow");break;
+ case audioMasterGetDirectory: FLEXT_LOG("VST master dispatcher: GetDirectory");break;
+// case audioMasterUpdateDisplay: post("VST master dispatcher: audioMasterUpdateDisplay");break;
+
+ default: post("VST master dispatcher: undefed: %d , %d",opcode , effKeysRequired ) ;break;
+ }
+
+ return 0;
+}
+
+bool VSTPlugin::AddNoteOn( unsigned char note,unsigned char speed,unsigned char midichannel)
+{
+ return AddMIDI((char)MIDI_NOTEON | midichannel,note,speed);
+}
+
+bool VSTPlugin::AddNoteOff( unsigned char note,unsigned char midichannel)
+{
+ return AddMIDI((char)MIDI_NOTEOFF | midichannel,note,0);
+}
+
+
+bool VSTPlugin::replace()
+{
+ return overwrite;
+}
+
+
+void VSTPlugin::edit(bool open)
+{
+ if(instantiated) {
+ if(open) {
+ if ( HasEditor() && !edited) {
+ edited = true;
+ b = new CEditorThread();
+ b->SetPlugin( this);
+ b->CreateThread();
+ }
+ }
+ else {
+ if (HasEditor() && edited) b->Close();
+ }
+ }
+}
+
+void VSTPlugin::visible(bool vis)
+{
+ if(instantiated && edited) b->Show(vis);
+}
+
+void VSTPlugin::EditorIdle()
+{
+ Dispatch(effEditIdle,0,0, w,0.0f);
+}
+
+RECT VSTPlugin::GetEditorRect()
+{
+ RECT ret;
+ ERect *r;
+ Dispatch(effEditGetRect,0,0, &r,0.0f);
+ ret.top = r->top;
+ ret.bottom = r->bottom;
+ ret.left = r->left;
+ ret.right = r->right;
+ return ret;
+}
+
+void VSTPlugin::SetEditWindow(HWND h)
+{
+ w = h;
+ Dispatch(effEditOpen,0,0, w,0.0f);
+}
+
+void VSTPlugin::OnEditorClose()
+{
+ Dispatch(effEditClose,0,0, w,0.0f);
+}
+
+/*
+void VSTPlugin::SetShowParameters(bool s)
+{
+ show_params = s;
+}
+
+bool VSTPlugin::ShowParams()
+{
+ return show_params;
+}
+*/
+
+void VSTPlugin::AddAftertouch(int value)
+{
+ if (value < 0) value = 0; else if (value > 127) value = 127;
+ AddMIDI( (char)MIDI_NOTEOFF | _midichannel , value );
+}
+
+void VSTPlugin::AddPitchBend(int value)
+{
+ AddMIDI( MIDI_PITCHBEND + (_midichannel & 0xf) , ((value>>7) & 127), (value & 127));
+}
+
+void VSTPlugin::AddProgramChange(int value)
+{
+ if (value < 0) value = 0; else if (value > 127) value = 127;
+ AddMIDI( MIDI_PROGRAMCHANGE + (_midichannel & 0xf), value, 0);
+}
+
+void VSTPlugin::AddControlChange(int control, int value)
+{
+ if (control < 0) control = 0; else if (control > 127) control = 127;
+ if (value < 0) value = 0; else if (value > 127) value = 127;
+ AddMIDI( MIDI_CONTROLCHANGE + (_midichannel & 0xf), control, value);
+}
+
+
+bool VSTPlugin::GetProgramName( int cat , int p, char *buf)
+{
+ int parameter = p;
+ if(instantiated)
+ {
+ if(parameter<NumPrograms())
+ {
+ Dispatch(effGetProgramNameIndexed,parameter,cat,buf,0.0f);
+ return true;
+ }
+ }
+ return false;
+}
+
+int VSTPlugin::GetNumCategories()
+{
+ if(instantiated)
+ return Dispatch(effGetNumProgramCategories,0,0,NULL,0.0f);
+ else
+ return 0;
+}
+
+void VSTPlugin::StopEditing()
+{
+ edited = false;
+}
diff --git a/externals/grill/vst/src/VstHost.h b/externals/grill/vst/src/VstHost.h
index 1ad9cede..8b272e97 100644
--- a/externals/grill/vst/src/VstHost.h
+++ b/externals/grill/vst/src/VstHost.h
@@ -149,7 +149,7 @@ protected:
private:
int posx,posy;
- bool edited;
+ bool edited; //,wantidle;
bool show_params;
static float sample_rate;
};
diff --git a/externals/grill/vst/src/main.cpp b/externals/grill/vst/src/main.cpp
index 7854aa8f..328f318a 100644
--- a/externals/grill/vst/src/main.cpp
+++ b/externals/grill/vst/src/main.cpp
@@ -1,713 +1,716 @@
-/*
-
-vst - VST plugin object for PD
-based on the work of Jarno Seppänen and Mark Williamson
-
-Copyright (c)2003 Thomas Grill (xovo@gmx.net)
-For information on usage and redistribution, and for a DISCLAIMER OF ALL
-WARRANTIES, see the file, "license.txt," in this distribution.
-
-*/
-
-#include "main.h"
-#include "vst.h"
-
-#include "EditorThread.h"
-#include "VstHost.h"
-
-#include <stdlib.h>
-#include <direct.h>
-#include <io.h>
-
-#define VST_VERSION "0.1.0pre5"
-
-#if 0
-/* ----- MFC stuff ------------- */
-
-BEGIN_MESSAGE_MAP(CVstApp, CWinApp)
- //{{AFX_MSG_MAP(CVstApp)
- // NOTE - the ClassWizard will add and remove mapping macros here.
- // DO NOT EDIT what you see in these blocks of generated code!
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-CVstApp::CVstApp() {}
-
-CVstApp theApp;
-
-/* ----- MFC stuff ------------- */
-#endif
-
-
-class vst:
- public flext_dsp
-{
- FLEXT_HEADER_S(vst,flext_dsp,Setup)
-
-public:
- vst(I argc,const A *argv);
- ~vst();
-
-protected:
- virtual V m_dsp(I n,t_signalvec const *insigs,t_signalvec const *outsigs);
- virtual V m_signal(I n,R *const *insigs,R *const *outsigs);
-
- BL ms_plug(I argc,const A *argv);
- BL ms_plug(const AtomList &args) { return ms_plug(args.Count(),args.Atoms()); }
- V mg_plug(AtomList &sym) const { sym(1); SetString(sym[0],plugname); }
-
- V ms_edit(BL on);
- V mg_edit(BL &ed) { ed = plug && plug->Edited(); }
- V mg_editor(BL &ed) { ed = plug && plug->HasEditor(); }
- V ms_vis(BL vis);
-
- V mg_winx(I &x) const { x = plug?plug->getX():0; }
- V mg_winy(I &y) const { y = plug?plug->getY():0; }
- V ms_winx(I x) { if(plug) plug->setX(x); }
- V ms_winy(I y) { if(plug) plug->setY(y); }
-
- V mg_chnsin(I &c) const { c = plug?plug->getNumInputs():0; }
- V mg_chnsout(I &c) const { c = plug?plug->getNumOutputs():0; }
- V mg_params(I &p) const { p = plug?plug->GetNumParams():0; }
- V mg_programs(I &p) const { p = plug?plug->NumPrograms():0; }
- V mg_plugname(const S *&s) const { s = MakeSymbol(plug?plug->GetName():""); }
- V mg_plugvendor(const S *&s) const { s = MakeSymbol(plug?plug->GetVendorName():""); }
- V mg_plugdll(const S *&s) const { s = MakeSymbol(plug?plug->GetDllName():""); }
- V mg_plugversion(I &v) const { v = plug?plug->GetVersion():0; }
- V mg_issynth(BL &s) const { s = plug && plug->IsSynth(); }
-
- V m_print(I ac,const A *av);
-
- V ms_program(I p);
- V mg_program(I &p) const { p = plug?plug->GetCurrentProgram():0; }
-
-// V m_control(const S *ctrl_name,I ctrl_value);
- V m_pitchbend(I ctrl_value);
- V m_programchange(I ctrl_value);
- V m_aftertouch(I ctrl_value);
- V m_ctrlchange(I control,I ctrl_value);
- V m_note(I note,I vel);
- inline V m_noteoff(I note) { m_note(note,0); }
-
- V ms_param(I pnum,F val);
- V mg_param(I pnum);
- V m_pname(I pnum);
- V m_ptext(I pnum);
-
-private:
- V display_parameter(I param,BL showparams);
-
- VSTPlugin *plug;
- CString plugname;
- BL echoparam,visible;
-
- I blsz;
- V (VSTPlugin::*vstfun)(R **insigs,R **outsigs,L n);
- BL sigmatch;
- R **vstin,**vstout,**tmpin,**tmpout;
-
- V InitPlug();
- V ClearPlug();
- V InitBuf();
- V ClearBuf();
- static V Setup(t_classid);
-
-
- FLEXT_CALLBACK_V(m_print)
-
- FLEXT_CALLVAR_V(mg_plug,ms_plug)
-
- FLEXT_CALLVAR_B(mg_edit,ms_edit)
- FLEXT_CALLGET_B(mg_editor)
- FLEXT_CALLSET_B(ms_vis)
- FLEXT_ATTRGET_B(visible)
-
-// FLEXT_CALLBACK_2(m_control,t_symptr,int)
- FLEXT_CALLBACK_I(m_pitchbend)
- FLEXT_CALLBACK_I(m_aftertouch)
- FLEXT_CALLBACK_I(m_programchange)
- FLEXT_CALLBACK_II(m_ctrlchange)
-
- FLEXT_CALLVAR_I(mg_program,ms_program)
- FLEXT_CALLBACK_2(ms_param,int,float)
- FLEXT_CALLBACK_I(mg_param)
- FLEXT_CALLBACK_I(m_pname)
- FLEXT_CALLBACK_I(m_ptext)
-
- FLEXT_CALLBACK_II(m_note)
- FLEXT_CALLBACK_I(m_noteoff)
-
- FLEXT_ATTRVAR_B(echoparam)
- FLEXT_CALLVAR_I(mg_winx,ms_winx)
- FLEXT_CALLVAR_I(mg_winy,ms_winy)
-
- FLEXT_CALLGET_I(mg_chnsin)
- FLEXT_CALLGET_I(mg_chnsout)
- FLEXT_CALLGET_I(mg_params)
- FLEXT_CALLGET_I(mg_programs)
- FLEXT_CALLGET_S(mg_plugname)
- FLEXT_CALLGET_S(mg_plugvendor)
- FLEXT_CALLGET_S(mg_plugdll)
- FLEXT_CALLGET_I(mg_plugversion)
- FLEXT_CALLGET_B(mg_issynth)
-};
-
-FLEXT_NEW_DSP_V("vst~",vst);
-
-
-V vst::Setup(t_classid c)
-{
-#if FLEXT_OS == FLEXT_OS_WIN
- AFX_MANAGE_STATE(AfxGetStaticModuleState());
- AfxOleInit( );
-#endif
-
- post("");
- post("vst~ %s - VST plugin object, (C)2003 Thomas Grill",VST_VERSION);
- post("based on the work of Jarno Seppänen and Mark Williamson");
- post("");
-
- FLEXT_CADDATTR_VAR(c,"plug",mg_plug,ms_plug);
- FLEXT_CADDATTR_VAR(c,"edit",mg_edit,ms_edit);
- FLEXT_CADDATTR_GET(c,"editor",mg_editor);
- FLEXT_CADDATTR_VAR(c,"vis",visible,ms_vis);
- FLEXT_CADDMETHOD_(c,0,"print",m_print);
-
- FLEXT_CADDMETHOD_II(c,0,"note",m_note);
- FLEXT_CADDMETHOD_I(c,0,"noteoff",m_noteoff);
-// FLEXT_CADDMETHOD_2(c,0,"control",m_control,t_symptr,int);
- FLEXT_CADDMETHOD_(c,0,"pbend",m_pitchbend);
- FLEXT_CADDMETHOD_(c,0,"atouch",m_aftertouch);
- FLEXT_CADDMETHOD_II(c,0,"ctlchg",m_ctrlchange);
-
- FLEXT_CADDMETHOD_(c,0,"progchg",m_programchange);
- FLEXT_CADDATTR_VAR(c,"program",mg_program,ms_program);
-
- FLEXT_CADDMETHOD_2(c,0,"param",ms_param,int,float);
- FLEXT_CADDMETHOD_(c,0,"getparam",mg_param);
- FLEXT_CADDMETHOD_I(c,0,"getpname",m_pname);
- FLEXT_CADDMETHOD_I(c,0,"getptext",m_ptext);
-
- FLEXT_CADDATTR_VAR1(c,"echo",echoparam);
- FLEXT_CADDATTR_VAR(c,"x",mg_winx,ms_winx);
- FLEXT_CADDATTR_VAR(c,"y",mg_winy,ms_winy);
-
- FLEXT_CADDATTR_GET(c,"ins",mg_chnsin);
- FLEXT_CADDATTR_GET(c,"outs",mg_chnsout);
- FLEXT_CADDATTR_GET(c,"params",mg_params);
- FLEXT_CADDATTR_GET(c,"programs",mg_programs);
- FLEXT_CADDATTR_GET(c,"name",mg_plugname);
- FLEXT_CADDATTR_GET(c,"vendor",mg_plugvendor);
- FLEXT_CADDATTR_GET(c,"dll",mg_plugdll);
- FLEXT_CADDATTR_GET(c,"version",mg_plugversion);
- FLEXT_CADDATTR_GET(c,"synth",mg_issynth);
-}
-
-
-vst::vst(I argc,const A *argv):
- plug(NULL),visible(false),
- blsz(0),
- vstfun(NULL),vstin(NULL),vstout(NULL),tmpin(NULL),tmpout(NULL),
- echoparam(false)
-{
- if(argc >= 2 && CanbeInt(argv[0]) && CanbeInt(argv[1])) {
- AddInSignal(GetAInt(argv[0]));
- AddOutSignal(GetAInt(argv[1]));
-
- if(!ms_plug(argc-2,argv+2)) InitProblem();
- }
- else {
- post("%s - syntax: vst~ inputs outputs [plug]",thisName());
- InitProblem();
- }
-}
-
-vst::~vst()
-{
- ClearPlug();
-}
-
-V vst::ClearPlug()
-{
- if(plug) {
- ClearBuf();
- delete plug; plug = NULL;
- }
-}
-
-V vst::InitPlug()
-{
- FLEXT_ASSERT(plug);
-
- vstfun = plug->replace()?plug->processReplacing:plug->process;
- sigmatch = plug->getNumInputs() == CntInSig() && plug->getNumOutputs() == CntOutSig();
-
- InitBuf();
-}
-
-V vst::ClearBuf()
-{
- if(!plug) return;
-
- if(vstin) {
- for(I i = 0; i < plug->getNumInputs(); ++i) delete[] vstin[i];
- delete[] vstin; vstin = NULL;
- delete[] tmpin; tmpin = NULL;
- }
- if(vstout) {
- for(I i = 0; i < plug->getNumOutputs(); ++i) delete[] vstout[i];
- delete[] vstout; vstout = NULL;
- delete[] tmpout; tmpout = NULL;
- }
-}
-
-V vst::InitBuf()
-{
- FLEXT_ASSERT(!vstin && !tmpin && !vstout && !tmpout);
-
- I i;
-
- vstin = new R *[plug->getNumInputs()];
- tmpin = new R *[plug->getNumInputs()];
- for(i = 0; i < plug->getNumInputs(); ++i) vstin[i] = new R[Blocksize()];
-
- vstout = new R *[plug->getNumOutputs()];
- tmpout = new R *[plug->getNumOutputs()];
- for(i = 0; i < plug->getNumOutputs(); ++i) vstout[i] = new R[Blocksize()];
-}
-
-static const C *findFilePath(const C *path,const C *dllname)
-{
- CFileFind finder;
- _chdir( path );
-
- if(finder.FindFile( dllname ))
- return path;
- else {
- finder.FindFile();
- while(finder.FindNextFile()) {
- if(finder.IsDirectory()) {
- if(!finder.IsDots()) {
- CString *npath = new CString( finder.GetFilePath());
- const C *ret = findFilePath( *npath , dllname );
- if(ret) {
- CString *retstr = new CString(ret);
- return *retstr;
- }
- }
- }
- }
- }
- return NULL;
-}
-
-
-BL vst::ms_plug(I argc,const A *argv)
-{
- ClearPlug();
-
- plugname.Empty();
- C buf[255];
- for(I i = 0; i < argc; i++) {
- if(i > 0) plugname += ' ';
- GetAString(argv[i],buf,sizeof buf);
- plugname += buf;
- }
- plugname.MakeLower();
- if(!plugname.GetLength()) return false;
-
- plug = new VSTPlugin;
-
- // now try to load plugin
-
- // to help deal with spaces we assume ALL of the args make
- // up the filename
- bool lf = false;
- int loaderr = VSTINSTANCE_NO_ERROR;
-
- // try loading the dll from the raw filename
- if ((loaderr = plug->Instance(plugname)) == VSTINSTANCE_NO_ERROR) {
- FLEXT_LOG("raw filename loaded fine");
- lf = true;
- }
-
- if(!lf) { // try finding it on the PD path
- C *name,dir[1024];
- I fd = open_via_path("",plugname,".dll",dir,&name,sizeof(dir)-1,0);
- if(fd > 0) close(fd);
- else name = NULL;
-
- if(name) {
- FLEXT_LOG("found VST dll on the PD path");
- // if dir is current working directory... name points to dir
- if(dir == name) strcpy(dir,".");
-
- CString dllname(dir);
- dllname += "\\";
- dllname += name;
-
- lf = (loaderr = plug->Instance(dllname)) == VSTINSTANCE_NO_ERROR;
- }
- }
-
- if(!lf) { // try finding it on the VST path
- C *vst_path = getenv ("VST_PATH");
-
- CString dllname(plugname);
- if(dllname.Find(".dll") == -1) dllname += ".dll";
-
- if(vst_path) {
- FLEXT_LOG("found VST_PATH env variable");
- char* tok_path = new C[strlen( vst_path)+1];
- strcpy( tok_path , vst_path);
- char *tok = strtok( tok_path , ";" );
- while( tok != NULL ) {
- CString abpath( tok );
- if( abpath.Right( 1 ) != _T("\\") ) abpath += "\\";
-
- FLEXT_LOG1("trying VST_PATH %s",(const C *)abpath);
-
- const char * realpath = findFilePath( abpath , dllname );
- //post( "findFilePath( %s , %s ) = %s\n" , abpath , dllname , realpath );
- if ( realpath != NULL ) {
- CString rpath( realpath );
- rpath += plugname;
- FLEXT_LOG1("trying %s",(const C *)rpath);
- if((loaderr = plug->Instance( rpath )) == VSTINSTANCE_NO_ERROR ) {
- FLEXT_LOG("plugin loaded via VST_PATH");
- lf = true;
- break;
- }
- }
-
- tok = strtok( NULL , ";" );
- if(!tok) post("%s - couldn't find plugin",thisName());
- }
-
- delete[] tok_path;
- }
- }
-
- if(!lf) { // failed - don't make any ins or outs
- post("%s - unable to load plugin '%s', load error %i",thisName(),plugname,loaderr);
- ClearPlug();
- }
-
- // re-init dsp stuff
- if(plug) InitPlug();
-
- return lf;
-}
-
-V vst::m_dsp(I n,t_signalvec const *,t_signalvec const *)
-{
- if(plug) {
- plug->Init(Samplerate(),(F)Blocksize());
- FLEXT_ASSERT(vstfun);
-
- if(blsz != Blocksize()) {
- blsz = Blocksize();
- ClearBuf();
- InitBuf();
- }
- }
-}
-
-V vst::m_signal(I n,R *const *insigs,R *const *outsigs)
-{
- if(plug) {
- if(sigmatch)
- (plug->*vstfun)(const_cast<R **>(insigs),const_cast<R **>(outsigs),n);
- else {
- R **inv,**outv;
-
- if(plug->getNumInputs() <= CntInSig())
- inv = const_cast<R **>(insigs);
- else { // more plug inputs than inlets
- I i;
- for(i = 0; i < CntInSig(); ++i) tmpin[i] = const_cast<R *>(insigs[i]);
-
- // set dangling inputs to zero
- // according to mode... (e.g. set zero)
- for(; i < plug->getNumInputs(); ++i) ZeroSamples(tmpin[i] = vstin[i],n);
-
- inv = tmpin;
- }
-
- const BL more = plug->getNumOutputs() <= CntOutSig();
- if(more) // more outlets than plug outputs
- outv = const_cast<R **>(outsigs);
- else {
- I i;
- for(i = 0; i < CntOutSig(); ++i) tmpout[i] = outsigs[i];
- for(; i < plug->getNumOutputs(); ++i) tmpout[i] = vstout[i];
-
- outv = tmpout;
- }
-
- (plug->*vstfun)(inv,outv,n);
-
- if(more) {
- // according to mode set dangling output vectors
- }
- }
- }
- else
- flext_dsp::m_signal(n,insigs,outsigs);
-}
-
-
-#if 0
-
-V vst::m_control(const S *ctrl_name,I ctrl_value)
-{
- if(!plug) return;
-
- I parm_num = 0;
-
- if (!*GetString(ctrl_name) || !strlen(GetString(ctrl_name))) {
- error ("plugin~: control messages must have a name and a value");
- return;
- }
- //parm_num = vst_tilde_get_parm_number (x, ctrl_name->s_name);
- //if (parm_num)
- //{
- //vst_tilde_set_control_input_by_index (x, parm_num - 1, ctrl_value);
- //}
- //else
- //{
- //vst_tilde_set_control_input_by_name (x, ctrl_name->s_name, ctrl_value);
- //}
-}
-
-#endif
-
-V vst::m_pitchbend(I ctrl_value)
-{
- if(plug) plug->AddPitchBend(ctrl_value );
-}
-
-V vst::m_aftertouch(I ctrl_value)
-{
- if(plug) plug->AddAftertouch(ctrl_value );
-}
-
-V vst::m_programchange(I ctrl_value)
-{
- if(plug) plug->AddProgramChange(ctrl_value );
-}
-
-V vst::ms_program(I p)
-{
- if(plug && p >= 0) plug->SetCurrentProgram(p);
-}
-
-V vst::m_ctrlchange(I control,I ctrl_value)
-{
- if(plug) plug->AddControlChange(control,ctrl_value );
-}
-
-
- /**
- * display the parameters names and values and some other bits and pieces that
- * may be of use
- */
-
-V vst::m_print(I ac,const A *av)
-{
- if(!plug) return;
-
- int i;
- bool params = false;
- bool header = true;
- bool programs = false;
- bool parameters = true;
- int specific = -1;
- if( ac > 0 ) {
- for( i = 0 ; i < ac ; i++) {
- if(IsString(av[i])) {
- const C *buf = GetString(av[i]);
- if ( strcmp( buf , "-params" ) == 0 ) {
- params = true;
- }
- else if ( strcmp( buf , "-noheader" ) == 0 ) {
- header = false;
- }
- else if ( strcmp( buf , "-programs" ) == 0 ) {
- programs = true;
- parameters = false;
- }
- else if ( strcmp( buf , "-parameters" ) == 0 ) {
- parameters = false;
- }
- else if ( strcmp( buf , "-help" ) == 0 ) {
- post("print options:");
- post("-help \t\tprint this");
- post("-programs \tshow the programs");
- post("-parameters \tshow the parameters");
- post("-params \tshow the parameter display values");
- post("-noheader \tdo not display the header");
- return;
- }
- }
- else if(CanbeInt(av[i])) {
- int p = GetAInt(av[i]);
- if (( p > 0 ) && ( p <= plug->GetNumParams())) {
- specific = p - 1;
- }
- }
- }
- }
-
- if ( header ) {
- post("VST~ plugin: %s " , plug->GetName() );
- post("made by: %s " , plug->GetVendorName() );
- post("parameterss %d\naudio: %d in(s)/%d out(s) \nLoaded from library \"%s\".\n",
- plug->GetNumParams(),
- CntInSig(),
- CntOutSig(),
- plug->GetDllName());
-
- post("Flags");
- if ( plug->_pEffect->flags & effFlagsHasEditor ) {
- post("Has editor");
- }
- if ( plug->_pEffect->flags & effFlagsCanReplacing ) {
- post("Can do replacing");
- }
- }
-
- if ( parameters ) {
- if ( specific == -1) {
- for (i = 0; i < plug->GetNumParams(); i++)
- display_parameter( i , params );
- }
- else
- display_parameter( specific , params);
- }
-
- if( programs ) {
- for( int j = 0; j < plug->GetNumCategories() ; j++ ) {
- for( i = 0 ; i < plug->GetNumParams() ; i++ ) {
- char buf[64];
- plug->GetProgramName( j , i , buf );
- post("Program %d: %s ", i , buf );
- }
- }
- }
-}
-
-
-//! display an editor
-V vst::ms_edit(BL on)
-{
-#if FLEXT_OS == FLEXT_OS_WIN
- AFX_MANAGE_STATE(AfxGetStaticModuleState());
-#endif
-
- if(plug) plug->edit(on);
-}
-
-V vst::ms_vis(BL vis)
-{
-#if FLEXT_OS == FLEXT_OS_WIN
- AFX_MANAGE_STATE(AfxGetStaticModuleState());
-#endif
-
- if(plug) plug->visible(vis);
-}
-
-
-V vst::display_parameter(I param,BL showparams)
-{
- int j = param;
- /* the Steinberg(tm) way... */
- char name[109];
- char display[164];
- float val;
-
-// if(j == 0) post ("Control input/output(s):");
-
- memset (name, 0, sizeof(name));
- memset( display, 0 ,sizeof(display));
- plug->GetParamName( j , name );
-
- if(*name) {
- if (showparams) {
- plug->DescribeValue( j , display );
- val = plug->GetParamValue( j );
- post ("parameter[#%d], \"%s\" value=%f (%s) ", j, name, val,display);
- }
- else {
- val = plug->GetParamValue( j );
- post ("parameter[#%d], \"%s\" value=%f ", j, name, val);
- }
- }
-}
-
-
-// set the value of a parameter
-V vst::ms_param(I pnum,F val)
-{
- if(!plug || pnum < 0 || pnum >= plug->GetNumParams()) return;
-
- F xval = plug->GetParamValue( pnum );
-// if(xval <= 1.0f) // What's that????
- if(true)
- {
- plug->SetParameter( pnum, val );
- if(echoparam) display_parameter(pnum , true );
- }
- else
- FLEXT_ASSERT(false);
-}
-
-V vst::mg_param(I pnum)
-{
- if(!plug || pnum < 0 || pnum >= plug->GetNumParams()) return;
-
- A at[2];
- SetInt(at[0],pnum);
- SetFloat(at[1],plug->GetParamValue(pnum));
- ToOutAnything(GetOutAttr(),MakeSymbol("param"),2,at);
-}
-
-V vst::m_pname(I pnum)
-{
- if(!plug || pnum < 0 || pnum >= plug->GetNumParams()) return;
-
- C name[109]; /* the Steinberg(tm) way... */
-
- memset(name,0,sizeof(name));
- plug->GetParamName(pnum,name);
-
- A at[2];
- SetInt(at[0],pnum);
- SetString(at[1],name);
- ToOutAnything(GetOutAttr(),MakeSymbol("pname"),2,at);
-}
-
-V vst::m_ptext(I pnum)
-{
- if(!plug || pnum < 0 || pnum >= plug->GetNumParams()) return;
-
- C display[164]; /* the Steinberg(tm) way... */
-
- memset(display,0,sizeof(display));
- plug->DescribeValue(pnum,display);
-
- A at[2];
- SetInt(at[0],pnum);
- SetString(at[1],display);
- ToOutAnything(GetOutAttr(),MakeSymbol("ptext"),2,at);
-}
-
-V vst::m_note(I note,I velocity)
-{
- if(!plug) return;
-
- if(velocity > 0)
- plug->AddNoteOn(note,velocity);
- else
- plug->AddNoteOff(note);
-}
+/*
+
+vst - VST plugin object for PD
+based on the work of Jarno Seppänen and Mark Williamson
+
+Copyright (c)2003 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#include "main.h"
+#include "vst.h"
+
+#include "EditorThread.h"
+#include "VstHost.h"
+
+#include <stdlib.h>
+#include <direct.h>
+#include <io.h>
+
+#define VST_VERSION "0.1.0pre5"
+
+#if 0
+/* ----- MFC stuff ------------- */
+
+BEGIN_MESSAGE_MAP(CVstApp, CWinApp)
+ //{{AFX_MSG_MAP(CVstApp)
+ // NOTE - the ClassWizard will add and remove mapping macros here.
+ // DO NOT EDIT what you see in these blocks of generated code!
+ //}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+CVstApp::CVstApp() {}
+
+CVstApp theApp;
+
+/* ----- MFC stuff ------------- */
+#endif
+
+
+class vst:
+ public flext_dsp
+{
+ FLEXT_HEADER_S(vst,flext_dsp,Setup)
+
+public:
+ vst(I argc,const A *argv);
+ ~vst();
+
+protected:
+ virtual V m_dsp(I n,t_signalvec const *insigs,t_signalvec const *outsigs);
+ virtual V m_signal(I n,R *const *insigs,R *const *outsigs);
+
+ BL ms_plug(I argc,const A *argv);
+ BL ms_plug(const AtomList &args) { return ms_plug(args.Count(),args.Atoms()); }
+ V mg_plug(AtomList &sym) const { sym(1); SetString(sym[0],plugname); }
+
+ V ms_edit(BL on);
+ V mg_edit(BL &ed) { ed = plug && plug->Edited(); }
+ V mg_editor(BL &ed) { ed = plug && plug->HasEditor(); }
+ V ms_vis(BL vis);
+
+ V mg_winx(I &x) const { x = plug?plug->getX():0; }
+ V mg_winy(I &y) const { y = plug?plug->getY():0; }
+ V ms_winx(I x) { if(plug) plug->setX(x); }
+ V ms_winy(I y) { if(plug) plug->setY(y); }
+
+ V mg_chnsin(I &c) const { c = plug?plug->getNumInputs():0; }
+ V mg_chnsout(I &c) const { c = plug?plug->getNumOutputs():0; }
+ V mg_params(I &p) const { p = plug?plug->GetNumParams():0; }
+ V mg_programs(I &p) const { p = plug?plug->NumPrograms():0; }
+ V mg_progcats(I &p) const { p = plug?plug->GetNumCategories():0; }
+ V mg_plugname(const S *&s) const { s = MakeSymbol(plug?plug->GetName():""); }
+ V mg_plugvendor(const S *&s) const { s = MakeSymbol(plug?plug->GetVendorName():""); }
+ V mg_plugdll(const S *&s) const { s = MakeSymbol(plug?plug->GetDllName():""); }
+ V mg_plugversion(I &v) const { v = plug?plug->GetVersion():0; }
+ V mg_issynth(BL &s) const { s = plug && plug->IsSynth(); }
+
+ V m_print(I ac,const A *av);
+
+ V ms_program(I p);
+ V mg_program(I &p) const { p = plug?plug->GetCurrentProgram():0; }
+
+// V m_control(const S *ctrl_name,I ctrl_value);
+ V m_pitchbend(I ctrl_value);
+ V m_programchange(I ctrl_value);
+ V m_aftertouch(I ctrl_value);
+ V m_ctrlchange(I control,I ctrl_value);
+ V m_note(I note,I vel);
+ inline V m_noteoff(I note) { m_note(note,0); }
+
+ V ms_param(I pnum,F val);
+ V mg_param(I pnum);
+ V m_pname(I pnum);
+ V m_ptext(I pnum);
+
+private:
+ V display_parameter(I param,BL showparams);
+
+ VSTPlugin *plug;
+ CString plugname;
+ BL echoparam,visible;
+
+ I blsz;
+ V (VSTPlugin::*vstfun)(R **insigs,R **outsigs,L n);
+ BL sigmatch;
+ R **vstin,**vstout,**tmpin,**tmpout;
+
+ V InitPlug();
+ V ClearPlug();
+ V InitBuf();
+ V ClearBuf();
+ static V Setup(t_classid);
+
+
+ FLEXT_CALLBACK_V(m_print)
+
+ FLEXT_CALLVAR_V(mg_plug,ms_plug)
+
+ FLEXT_CALLVAR_B(mg_edit,ms_edit)
+ FLEXT_CALLGET_B(mg_editor)
+ FLEXT_CALLSET_B(ms_vis)
+ FLEXT_ATTRGET_B(visible)
+
+// FLEXT_CALLBACK_2(m_control,t_symptr,int)
+ FLEXT_CALLBACK_I(m_pitchbend)
+ FLEXT_CALLBACK_I(m_aftertouch)
+ FLEXT_CALLBACK_I(m_programchange)
+ FLEXT_CALLBACK_II(m_ctrlchange)
+
+ FLEXT_CALLVAR_I(mg_program,ms_program)
+ FLEXT_CALLBACK_2(ms_param,int,float)
+ FLEXT_CALLBACK_I(mg_param)
+ FLEXT_CALLBACK_I(m_pname)
+ FLEXT_CALLBACK_I(m_ptext)
+
+ FLEXT_CALLBACK_II(m_note)
+ FLEXT_CALLBACK_I(m_noteoff)
+
+ FLEXT_ATTRVAR_B(echoparam)
+ FLEXT_CALLVAR_I(mg_winx,ms_winx)
+ FLEXT_CALLVAR_I(mg_winy,ms_winy)
+
+ FLEXT_CALLGET_I(mg_chnsin)
+ FLEXT_CALLGET_I(mg_chnsout)
+ FLEXT_CALLGET_I(mg_params)
+ FLEXT_CALLGET_I(mg_programs)
+ FLEXT_CALLGET_I(mg_progcats)
+ FLEXT_CALLGET_S(mg_plugname)
+ FLEXT_CALLGET_S(mg_plugvendor)
+ FLEXT_CALLGET_S(mg_plugdll)
+ FLEXT_CALLGET_I(mg_plugversion)
+ FLEXT_CALLGET_B(mg_issynth)
+};
+
+FLEXT_NEW_DSP_V("vst~",vst);
+
+
+V vst::Setup(t_classid c)
+{
+#if FLEXT_OS == FLEXT_OS_WIN
+ AFX_MANAGE_STATE(AfxGetStaticModuleState());
+ AfxOleInit( );
+#endif
+
+ post("");
+ post("vst~ %s - VST plugin object, (C)2003 Thomas Grill",VST_VERSION);
+ post("based on the work of Jarno Seppänen and Mark Williamson");
+ post("");
+
+ FLEXT_CADDATTR_VAR(c,"plug",mg_plug,ms_plug);
+ FLEXT_CADDATTR_VAR(c,"edit",mg_edit,ms_edit);
+ FLEXT_CADDATTR_GET(c,"editor",mg_editor);
+ FLEXT_CADDATTR_VAR(c,"vis",visible,ms_vis);
+ FLEXT_CADDMETHOD_(c,0,"print",m_print);
+
+ FLEXT_CADDMETHOD_II(c,0,"note",m_note);
+ FLEXT_CADDMETHOD_I(c,0,"noteoff",m_noteoff);
+// FLEXT_CADDMETHOD_2(c,0,"control",m_control,t_symptr,int);
+ FLEXT_CADDMETHOD_(c,0,"pbend",m_pitchbend);
+ FLEXT_CADDMETHOD_(c,0,"atouch",m_aftertouch);
+ FLEXT_CADDMETHOD_II(c,0,"ctlchg",m_ctrlchange);
+
+ FLEXT_CADDMETHOD_(c,0,"progchg",m_programchange);
+ FLEXT_CADDATTR_VAR(c,"program",mg_program,ms_program);
+
+ FLEXT_CADDMETHOD_2(c,0,"param",ms_param,int,float);
+ FLEXT_CADDMETHOD_(c,0,"getparam",mg_param);
+ FLEXT_CADDMETHOD_I(c,0,"getpname",m_pname);
+ FLEXT_CADDMETHOD_I(c,0,"getptext",m_ptext);
+
+ FLEXT_CADDATTR_VAR1(c,"echo",echoparam);
+ FLEXT_CADDATTR_VAR(c,"x",mg_winx,ms_winx);
+ FLEXT_CADDATTR_VAR(c,"y",mg_winy,ms_winy);
+
+ FLEXT_CADDATTR_GET(c,"ins",mg_chnsin);
+ FLEXT_CADDATTR_GET(c,"outs",mg_chnsout);
+ FLEXT_CADDATTR_GET(c,"params",mg_params);
+ FLEXT_CADDATTR_GET(c,"programs",mg_programs);
+ FLEXT_CADDATTR_GET(c,"progcats",mg_progcats);
+ FLEXT_CADDATTR_GET(c,"name",mg_plugname);
+ FLEXT_CADDATTR_GET(c,"vendor",mg_plugvendor);
+ FLEXT_CADDATTR_GET(c,"dll",mg_plugdll);
+ FLEXT_CADDATTR_GET(c,"version",mg_plugversion);
+ FLEXT_CADDATTR_GET(c,"synth",mg_issynth);
+}
+
+
+vst::vst(I argc,const A *argv):
+ plug(NULL),visible(false),
+ blsz(0),
+ vstfun(NULL),vstin(NULL),vstout(NULL),tmpin(NULL),tmpout(NULL),
+ echoparam(false)
+{
+ if(argc >= 2 && CanbeInt(argv[0]) && CanbeInt(argv[1])) {
+ AddInSignal(GetAInt(argv[0]));
+ AddOutSignal(GetAInt(argv[1]));
+
+ if(!ms_plug(argc-2,argv+2)) InitProblem();
+ }
+ else {
+ post("%s - syntax: vst~ inputs outputs [plug]",thisName());
+ InitProblem();
+ }
+}
+
+vst::~vst()
+{
+ ClearPlug();
+}
+
+V vst::ClearPlug()
+{
+ if(plug) {
+ ClearBuf();
+ delete plug; plug = NULL;
+ }
+}
+
+V vst::InitPlug()
+{
+ FLEXT_ASSERT(plug);
+
+ vstfun = plug->replace()?plug->processReplacing:plug->process;
+ sigmatch = plug->getNumInputs() == CntInSig() && plug->getNumOutputs() == CntOutSig();
+
+ InitBuf();
+}
+
+V vst::ClearBuf()
+{
+ if(!plug) return;
+
+ if(vstin) {
+ for(I i = 0; i < plug->getNumInputs(); ++i) delete[] vstin[i];
+ delete[] vstin; vstin = NULL;
+ delete[] tmpin; tmpin = NULL;
+ }
+ if(vstout) {
+ for(I i = 0; i < plug->getNumOutputs(); ++i) delete[] vstout[i];
+ delete[] vstout; vstout = NULL;
+ delete[] tmpout; tmpout = NULL;
+ }
+}
+
+V vst::InitBuf()
+{
+ FLEXT_ASSERT(!vstin && !tmpin && !vstout && !tmpout);
+
+ I i;
+
+ vstin = new R *[plug->getNumInputs()];
+ tmpin = new R *[plug->getNumInputs()];
+ for(i = 0; i < plug->getNumInputs(); ++i) vstin[i] = new R[Blocksize()];
+
+ vstout = new R *[plug->getNumOutputs()];
+ tmpout = new R *[plug->getNumOutputs()];
+ for(i = 0; i < plug->getNumOutputs(); ++i) vstout[i] = new R[Blocksize()];
+}
+
+static const C *findFilePath(const C *path,const C *dllname)
+{
+ CFileFind finder;
+ _chdir( path );
+
+ if(finder.FindFile( dllname ))
+ return path;
+ else {
+ finder.FindFile();
+ while(finder.FindNextFile()) {
+ if(finder.IsDirectory()) {
+ if(!finder.IsDots()) {
+ CString *npath = new CString( finder.GetFilePath());
+ const C *ret = findFilePath( *npath , dllname );
+ if(ret) {
+ CString *retstr = new CString(ret);
+ return *retstr;
+ }
+ }
+ }
+ }
+ }
+ return NULL;
+}
+
+
+BL vst::ms_plug(I argc,const A *argv)
+{
+ ClearPlug();
+
+ plugname.Empty();
+ C buf[255];
+ for(I i = 0; i < argc; i++) {
+ if(i > 0) plugname += ' ';
+ GetAString(argv[i],buf,sizeof buf);
+ plugname += buf;
+ }
+ plugname.MakeLower();
+ if(!plugname.GetLength()) return false;
+
+ plug = new VSTPlugin;
+
+ // now try to load plugin
+
+ // to help deal with spaces we assume ALL of the args make
+ // up the filename
+ bool lf = false;
+ int loaderr = VSTINSTANCE_NO_ERROR;
+
+ // try loading the dll from the raw filename
+ if ((loaderr = plug->Instance(plugname)) == VSTINSTANCE_NO_ERROR) {
+ FLEXT_LOG("raw filename loaded fine");
+ lf = true;
+ }
+
+ if(!lf) { // try finding it on the PD path
+ C *name,dir[1024];
+ I fd = open_via_path("",plugname,".dll",dir,&name,sizeof(dir)-1,0);
+ if(fd > 0) close(fd);
+ else name = NULL;
+
+ if(name) {
+ FLEXT_LOG("found VST dll on the PD path");
+ // if dir is current working directory... name points to dir
+ if(dir == name) strcpy(dir,".");
+
+ CString dllname(dir);
+ dllname += "\\";
+ dllname += name;
+
+ lf = (loaderr = plug->Instance(dllname)) == VSTINSTANCE_NO_ERROR;
+ }
+ }
+
+ if(!lf) { // try finding it on the VST path
+ C *vst_path = getenv ("VST_PATH");
+
+ CString dllname(plugname);
+ if(dllname.Find(".dll") == -1) dllname += ".dll";
+
+ if(vst_path) {
+ FLEXT_LOG("found VST_PATH env variable");
+ char* tok_path = new C[strlen( vst_path)+1];
+ strcpy( tok_path , vst_path);
+ char *tok = strtok( tok_path , ";" );
+ while( tok != NULL ) {
+ CString abpath( tok );
+ if( abpath.Right( 1 ) != _T("\\") ) abpath += "\\";
+
+ FLEXT_LOG1("trying VST_PATH %s",(const C *)abpath);
+
+ const char * realpath = findFilePath( abpath , dllname );
+ //post( "findFilePath( %s , %s ) = %s\n" , abpath , dllname , realpath );
+ if ( realpath != NULL ) {
+ CString rpath( realpath );
+ rpath += plugname;
+ FLEXT_LOG1("trying %s",(const C *)rpath);
+ if((loaderr = plug->Instance( rpath )) == VSTINSTANCE_NO_ERROR ) {
+ FLEXT_LOG("plugin loaded via VST_PATH");
+ lf = true;
+ break;
+ }
+ }
+
+ tok = strtok( NULL , ";" );
+ if(!tok) post("%s - couldn't find plugin",thisName());
+ }
+
+ delete[] tok_path;
+ }
+ }
+
+ if(!lf) { // failed - don't make any ins or outs
+ post("%s - unable to load plugin '%s', load error %i",thisName(),plugname,loaderr);
+ ClearPlug();
+ }
+
+ // re-init dsp stuff
+ if(plug) InitPlug();
+
+ return lf;
+}
+
+V vst::m_dsp(I n,t_signalvec const *,t_signalvec const *)
+{
+ if(plug) {
+ plug->Init(Samplerate(),(F)Blocksize());
+ FLEXT_ASSERT(vstfun);
+
+ if(blsz != Blocksize()) {
+ blsz = Blocksize();
+ ClearBuf();
+ InitBuf();
+ }
+ }
+}
+
+V vst::m_signal(I n,R *const *insigs,R *const *outsigs)
+{
+ if(plug) {
+ if(sigmatch)
+ (plug->*vstfun)(const_cast<R **>(insigs),const_cast<R **>(outsigs),n);
+ else {
+ R **inv,**outv;
+
+ if(plug->getNumInputs() <= CntInSig())
+ inv = const_cast<R **>(insigs);
+ else { // more plug inputs than inlets
+ I i;
+ for(i = 0; i < CntInSig(); ++i) tmpin[i] = const_cast<R *>(insigs[i]);
+
+ // set dangling inputs to zero
+ // according to mode... (e.g. set zero)
+ for(; i < plug->getNumInputs(); ++i) ZeroSamples(tmpin[i] = vstin[i],n);
+
+ inv = tmpin;
+ }
+
+ const BL more = plug->getNumOutputs() <= CntOutSig();
+ if(more) // more outlets than plug outputs
+ outv = const_cast<R **>(outsigs);
+ else {
+ I i;
+ for(i = 0; i < CntOutSig(); ++i) tmpout[i] = outsigs[i];
+ for(; i < plug->getNumOutputs(); ++i) tmpout[i] = vstout[i];
+
+ outv = tmpout;
+ }
+
+ (plug->*vstfun)(inv,outv,n);
+
+ if(more) {
+ // according to mode set dangling output vectors
+ }
+ }
+ }
+ else
+ flext_dsp::m_signal(n,insigs,outsigs);
+}
+
+
+#if 0
+
+V vst::m_control(const S *ctrl_name,I ctrl_value)
+{
+ if(!plug) return;
+
+ I parm_num = 0;
+
+ if (!*GetString(ctrl_name) || !strlen(GetString(ctrl_name))) {
+ error ("plugin~: control messages must have a name and a value");
+ return;
+ }
+ //parm_num = vst_tilde_get_parm_number (x, ctrl_name->s_name);
+ //if (parm_num)
+ //{
+ //vst_tilde_set_control_input_by_index (x, parm_num - 1, ctrl_value);
+ //}
+ //else
+ //{
+ //vst_tilde_set_control_input_by_name (x, ctrl_name->s_name, ctrl_value);
+ //}
+}
+
+#endif
+
+V vst::m_pitchbend(I ctrl_value)
+{
+ if(plug) plug->AddPitchBend(ctrl_value );
+}
+
+V vst::m_aftertouch(I ctrl_value)
+{
+ if(plug) plug->AddAftertouch(ctrl_value );
+}
+
+V vst::m_programchange(I ctrl_value)
+{
+ if(plug) plug->AddProgramChange(ctrl_value );
+}
+
+V vst::ms_program(I p)
+{
+ if(plug && p >= 0) plug->SetCurrentProgram(p);
+}
+
+V vst::m_ctrlchange(I control,I ctrl_value)
+{
+ if(plug) plug->AddControlChange(control,ctrl_value );
+}
+
+
+ /**
+ * display the parameters names and values and some other bits and pieces that
+ * may be of use
+ */
+
+V vst::m_print(I ac,const A *av)
+{
+ if(!plug) return;
+
+ int i;
+ bool params = false;
+ bool header = true;
+ bool programs = false;
+ bool parameters = true;
+ int specific = -1;
+ if( ac > 0 ) {
+ for( i = 0 ; i < ac ; i++) {
+ if(IsString(av[i])) {
+ const C *buf = GetString(av[i]);
+ if ( strcmp( buf , "-params" ) == 0 ) {
+ params = true;
+ }
+ else if ( strcmp( buf , "-noheader" ) == 0 ) {
+ header = false;
+ }
+ else if ( strcmp( buf , "-programs" ) == 0 ) {
+ programs = true;
+ parameters = false;
+ }
+ else if ( strcmp( buf , "-parameters" ) == 0 ) {
+ parameters = false;
+ }
+ else if ( strcmp( buf , "-help" ) == 0 ) {
+ post("print options:");
+ post("-help \t\tprint this");
+ post("-programs \tshow the programs");
+ post("-parameters \tshow the parameters");
+ post("-params \tshow the parameter display values");
+ post("-noheader \tdo not display the header");
+ return;
+ }
+ }
+ else if(CanbeInt(av[i])) {
+ int p = GetAInt(av[i]);
+ if (( p > 0 ) && ( p <= plug->GetNumParams())) {
+ specific = p - 1;
+ }
+ }
+ }
+ }
+
+ if ( header ) {
+ post("VST~ plugin: %s " , plug->GetName() );
+ post("made by: %s " , plug->GetVendorName() );
+ post("parameterss %d\naudio: %d in(s)/%d out(s) \nLoaded from library \"%s\".\n",
+ plug->GetNumParams(),
+ CntInSig(),
+ CntOutSig(),
+ plug->GetDllName());
+
+ post("Flags");
+ if ( plug->_pEffect->flags & effFlagsHasEditor ) {
+ post("Has editor");
+ }
+ if ( plug->_pEffect->flags & effFlagsCanReplacing ) {
+ post("Can do replacing");
+ }
+ }
+
+ if ( parameters ) {
+ if ( specific == -1) {
+ for (i = 0; i < plug->GetNumParams(); i++)
+ display_parameter( i , params );
+ }
+ else
+ display_parameter( specific , params);
+ }
+
+ if( programs ) {
+ for( int j = 0; j < plug->GetNumCategories() ; j++ ) {
+ for( i = 0 ; i < plug->GetNumParams() ; i++ ) {
+ char buf[64];
+ plug->GetProgramName( j , i , buf );
+ post("Program %d: %s ", i , buf );
+ }
+ }
+ }
+}
+
+
+//! display an editor
+V vst::ms_edit(BL on)
+{
+#if FLEXT_OS == FLEXT_OS_WIN
+ AFX_MANAGE_STATE(AfxGetStaticModuleState());
+#endif
+
+ if(plug) plug->edit(on);
+}
+
+V vst::ms_vis(BL vis)
+{
+#if FLEXT_OS == FLEXT_OS_WIN
+ AFX_MANAGE_STATE(AfxGetStaticModuleState());
+#endif
+
+ if(plug) plug->visible(vis);
+}
+
+
+V vst::display_parameter(I param,BL showparams)
+{
+ int j = param;
+ /* the Steinberg(tm) way... */
+ char name[109];
+ char display[164];
+ float val;
+
+// if(j == 0) post ("Control input/output(s):");
+
+ memset (name, 0, sizeof(name));
+ memset( display, 0 ,sizeof(display));
+ plug->GetParamName( j , name );
+
+ if(*name) {
+ if (showparams) {
+ plug->DescribeValue( j , display );
+ val = plug->GetParamValue( j );
+ post ("parameter[#%d], \"%s\" value=%f (%s) ", j, name, val,display);
+ }
+ else {
+ val = plug->GetParamValue( j );
+ post ("parameter[#%d], \"%s\" value=%f ", j, name, val);
+ }
+ }
+}
+
+
+// set the value of a parameter
+V vst::ms_param(I pnum,F val)
+{
+ if(!plug || pnum < 0 || pnum >= plug->GetNumParams()) return;
+
+ F xval = plug->GetParamValue( pnum );
+// if(xval <= 1.0f) // What's that????
+ if(true)
+ {
+ plug->SetParameter( pnum, val );
+ if(echoparam) display_parameter(pnum , true );
+ }
+ else
+ FLEXT_ASSERT(false);
+}
+
+V vst::mg_param(I pnum)
+{
+ if(!plug || pnum < 0 || pnum >= plug->GetNumParams()) return;
+
+ A at[2];
+ SetInt(at[0],pnum);
+ SetFloat(at[1],plug->GetParamValue(pnum));
+ ToOutAnything(GetOutAttr(),MakeSymbol("param"),2,at);
+}
+
+V vst::m_pname(I pnum)
+{
+ if(!plug || pnum < 0 || pnum >= plug->GetNumParams()) return;
+
+ C name[109]; /* the Steinberg(tm) way... */
+
+ memset(name,0,sizeof(name));
+ plug->GetParamName(pnum,name);
+
+ A at[2];
+ SetInt(at[0],pnum);
+ SetString(at[1],name);
+ ToOutAnything(GetOutAttr(),MakeSymbol("pname"),2,at);
+}
+
+V vst::m_ptext(I pnum)
+{
+ if(!plug || pnum < 0 || pnum >= plug->GetNumParams()) return;
+
+ C display[164]; /* the Steinberg(tm) way... */
+
+ memset(display,0,sizeof(display));
+ plug->DescribeValue(pnum,display);
+
+ A at[2];
+ SetInt(at[0],pnum);
+ SetString(at[1],display);
+ ToOutAnything(GetOutAttr(),MakeSymbol("ptext"),2,at);
+}
+
+V vst::m_note(I note,I velocity)
+{
+ if(!plug) return;
+
+ if(velocity > 0)
+ plug->AddNoteOn(note,velocity);
+ else
+ plug->AddNoteOff(note);
+}
diff --git a/externals/grill/vst/vst.dsp b/externals/grill/vst/vst.dsp
index 180f9542..db4d1633 100644
--- a/externals/grill/vst/vst.dsp
+++ b/externals/grill/vst/vst.dsp
@@ -1,210 +1,210 @@
-# Microsoft Developer Studio Project File - Name="vst" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** NICHT BEARBEITEN **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=vst - Win32 Debug
-!MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE
-!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl
-!MESSAGE
-!MESSAGE NMAKE /f "vst.mak".
-!MESSAGE
-!MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben
-!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:
-!MESSAGE
-!MESSAGE NMAKE /f "vst.mak" CFG="vst - Win32 Debug"
-!MESSAGE
-!MESSAGE Für die Konfiguration stehen zur Auswahl:
-!MESSAGE
-!MESSAGE "vst - Win32 Release" (basierend auf "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "vst - Win32 Debug" (basierend auf "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName "max/vst"
-# PROP Scc_LocalPath "."
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "vst - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 1
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "pd-msvc/r"
-# PROP Intermediate_Dir "pd-msvc/r"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "c:\programme\audio\pd\src" /I "f:\prog\max\flext\source" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D FLEXT_SYS=2 /D "FLEXT_THREADS" /D "_WINDLL" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0xc07 /d "NDEBUG"
-# ADD RSC /l 0xc07 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 pd.lib flext_t-pdwin.lib pthreadVC.lib /nologo /dll /machine:I386 /out:"pd-msvc/vst~.dll" /libpath:"c:\programme\audio\pd\bin" /libpath:"f:\prog\max\flext\pd-msvc"
-
-!ELSEIF "$(CFG)" == "vst - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 2
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "pd-msvc/d"
-# PROP Intermediate_Dir "pd-msvc/d"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /I "c:\programme\audio\pd\src" /I "f:\prog\max\flext\source" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D FLEXT_SYS=2 /D "FLEXT_THREADS" /D "_WINDLL" /D "_AFXDLL" /D "FLEXT_LOGGING" /FR /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0xc07 /d "_DEBUG"
-# ADD RSC /l 0xc07 /d "_DEBUG" /d "_AFXDLL"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 pd.lib flext_td-pdwin.lib pthreadVC.lib /nologo /dll /debug /machine:I386 /out:"pd-msvc/d/vst~.dll" /pdbtype:sept /libpath:"c:\programme\audio\pd\bin" /libpath:"f:\prog\max\flext\pd-msvc"
-
-!ENDIF
-
-# Begin Target
-
-# Name "vst - Win32 Release"
-# Name "vst - Win32 Debug"
-# Begin Group "vst"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=.\src\vst\AEffect.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\src\vst\AEffectx.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\src\vst\AEffEditor.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\src\vst\AudioEffect.hpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\src\vst\audioeffectx.h
-# End Source File
-# End Group
-# Begin Group "alt"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=.\src\vst.cpp
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=.\src\vst~.cpp
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=.\src\vst~.h
-# PROP Exclude_From_Build 1
-# End Source File
-# End Group
-# Begin Group "mfc"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=.\src\Resource.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\src\StdAfx.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\src\StdAfx.h
-# End Source File
-# End Group
-# Begin Group "host"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=.\src\EditorThread.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\src\EditorThread.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\src\PopupWindow.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\src\PopupWindow.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\src\vst.rc
-# End Source File
-# Begin Source File
-
-SOURCE=.\src\VstHost.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\src\VstHost.h
-# End Source File
-# End Group
-# Begin Group "doc"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=.\gpl.txt
-# End Source File
-# Begin Source File
-
-SOURCE=.\license.txt
-# End Source File
-# Begin Source File
-
-SOURCE=.\readme.txt
-# End Source File
-# End Group
-# Begin Source File
-
-SOURCE=.\src\main.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\src\main.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\src\vst.h
-# End Source File
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="vst" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** NICHT BEARBEITEN **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=vst - Win32 Debug
+!MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE
+!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl
+!MESSAGE
+!MESSAGE NMAKE /f "vst.mak".
+!MESSAGE
+!MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben
+!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:
+!MESSAGE
+!MESSAGE NMAKE /f "vst.mak" CFG="vst - Win32 Debug"
+!MESSAGE
+!MESSAGE Für die Konfiguration stehen zur Auswahl:
+!MESSAGE
+!MESSAGE "vst - Win32 Release" (basierend auf "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "vst - Win32 Debug" (basierend auf "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName "max/vst"
+# PROP Scc_LocalPath "."
+CPP=xicl6.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "vst - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 1
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "pd-msvc/r"
+# PROP Intermediate_Dir "pd-msvc/r"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "c:\programme\audio\pd\src" /I "f:\prog\max\flext\source" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D FLEXT_SYS=2 /D "FLEXT_THREADS" /D "_WINDLL" /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0xc07 /d "NDEBUG"
+# ADD RSC /l 0xc07 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
+# ADD LINK32 pd.lib flext_t-pdwin.lib pthreadVC.lib /nologo /dll /machine:I386 /out:"pd-msvc/vst~.dll" /libpath:"c:\programme\audio\pd\bin" /libpath:"f:\prog\max\flext\pd-msvc"
+
+!ELSEIF "$(CFG)" == "vst - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 2
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "pd-msvc/d"
+# PROP Intermediate_Dir "pd-msvc/d"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /I "c:\programme\audio\pd\src" /I "f:\prog\max\flext\source" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D FLEXT_SYS=2 /D "FLEXT_THREADS" /D "_WINDLL" /D "_AFXDLL" /D "FLEXT_LOGGING" /FR /YX /FD /GZ /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0xc07 /d "_DEBUG"
+# ADD RSC /l 0xc07 /d "_DEBUG" /d "_AFXDLL"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 pd.lib flext_td-pdwin.lib pthreadVC.lib /nologo /dll /debug /machine:I386 /out:"pd-msvc/d/vst~.dll" /pdbtype:sept /libpath:"c:\programme\audio\pd\bin" /libpath:"f:\prog\max\flext\pd-msvc"
+
+!ENDIF
+
+# Begin Target
+
+# Name "vst - Win32 Release"
+# Name "vst - Win32 Debug"
+# Begin Group "vst"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\src\vst\AEffect.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\vst\AEffectx.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\vst\AEffEditor.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\vst\AudioEffect.hpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\vst\audioeffectx.h
+# End Source File
+# End Group
+# Begin Group "alt"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\src\vst.cpp
+# PROP Exclude_From_Build 1
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\vst~.cpp
+# PROP Exclude_From_Build 1
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\vst~.h
+# PROP Exclude_From_Build 1
+# End Source File
+# End Group
+# Begin Group "mfc"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\src\Resource.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\StdAfx.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\StdAfx.h
+# End Source File
+# End Group
+# Begin Group "host"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\src\EditorThread.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\EditorThread.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\PopupWindow.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\PopupWindow.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\vst.rc
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\VstHost.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\VstHost.h
+# End Source File
+# End Group
+# Begin Group "doc"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\gpl.txt
+# End Source File
+# Begin Source File
+
+SOURCE=.\license.txt
+# End Source File
+# Begin Source File
+
+SOURCE=.\readme.txt
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\src\main.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\main.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\vst.h
+# End Source File
+# End Target
+# End Project
diff --git a/externals/grill/xsample/source/groove.cpp b/externals/grill/xsample/source/groove.cpp
index 60bf617b..6355b1a0 100644
--- a/externals/grill/xsample/source/groove.cpp
+++ b/externals/grill/xsample/source/groove.cpp
@@ -276,7 +276,7 @@ V xgroove::m_xzone(F xz)
{
bufchk();
_xzone = xz < 0?0:xz;
- do_xzone();
+// do_xzone();
s_dsp();
}
@@ -335,6 +335,8 @@ V xgroove::m_xkeep(BL k)
V xgroove::do_xzone()
{
+ if(!s2u) return; // this can happen if DSP is off
+
xzone = _xzone/s2u;
I smin = curmin,smax = curmax,plen = smax-smin; //curlen;
if(xsymm < 0) {
@@ -346,7 +348,7 @@ V xgroove::do_xzone()
// desired crossfade points
znmin = smin+xzone*xsymm,znmax = smax+xzone*(xsymm-1);
// extra space at beginning and end
- F o1 = znmin-xzone,o2 = buf->Frames()-(znmax+xzone);
+ F o1 = znmin-xzone,o2 = buf->Frames()-(znmax+xzone);
if(o1 < 0 || o2 < 0) { // or (o1*o2 < 0)
if(o1+o2 < 0) {
@@ -595,7 +597,9 @@ V xgroove::s_dsp()
switch(loopmode) {
case xsl_once: SETSIGFUN(posfun,SIGFUN(s_pos_once)); break;
case xsl_loop:
- if(xzone > 0) {
+ if(_xzone > 0) {
+ // xzone might not be set yet (is done in do_xzone() )
+
const I blksz = Blocksize();
if(pblksz != blksz) {
@@ -610,34 +614,17 @@ V xgroove::s_dsp()
pblksz = blksz;
}
+ do_xzone(); // recalculate (s2u may have been 0 before)
+
SETSIGFUN(posfun,SIGFUN(s_pos_loopzn));
// linear interpolation should be just ok for fade zone, no?
-/*
- if(interp == xsi_4p)
- switch(outchns) {
- case 1: SETSTFUN(zonefun,TMPLSTF(st_play4,1,1)); break;
- case 2: SETSTFUN(zonefun,TMPLSTF(st_play4,1,2)); break;
- case 4: SETSTFUN(zonefun,TMPLSTF(st_play4,1,4)); break;
- default: SETSTFUN(zonefun,TMPLSTF(st_play4,1,-1));
- }
- else if(interp == xsi_lin)
-*/
- switch(outchns) {
- case 1: SETSTFUN(zonefun,TMPLSTF(st_play2,1,1)); break;
- case 2: SETSTFUN(zonefun,TMPLSTF(st_play2,1,2)); break;
- case 4: SETSTFUN(zonefun,TMPLSTF(st_play2,1,4)); break;
- default: SETSTFUN(zonefun,TMPLSTF(st_play2,1,-1));
- }
-/*
- else
- switch(outchns) {
- case 1: SETSTFUN(zonefun,TMPLSTF(st_play1,1,1)); break;
- case 2: SETSTFUN(zonefun,TMPLSTF(st_play1,1,2)); break;
- case 4: SETSTFUN(zonefun,TMPLSTF(st_play1,1,4)); break;
- default: SETSTFUN(zonefun,TMPLSTF(st_play1,1,-1));
- }
-*/
+ switch(outchns) {
+ case 1: SETSTFUN(zonefun,TMPLSTF(st_play2,1,1)); break;
+ case 2: SETSTFUN(zonefun,TMPLSTF(st_play2,1,2)); break;
+ case 4: SETSTFUN(zonefun,TMPLSTF(st_play2,1,4)); break;
+ default: SETSTFUN(zonefun,TMPLSTF(st_play2,1,-1));
+ }
}
else
SETSIGFUN(posfun,SIGFUN(s_pos_loop));
diff --git a/externals/grill/xsample/source/main.h b/externals/grill/xsample/source/main.h
index 03d5d261..fbbb693b 100644
--- a/externals/grill/xsample/source/main.h
+++ b/externals/grill/xsample/source/main.h
@@ -11,7 +11,7 @@ WARRANTIES, see the file, "license.txt," in this distribution.
#ifndef __XSAMPLE_H
#define __XSAMPLE_H
-#define XSAMPLE_VERSION "0.3.0pre4"
+#define XSAMPLE_VERSION "0.3.0pre5"
#define FLEXT_ATTRIBUTES 1
diff --git a/externals/grill/xsample/xsample.cw b/externals/grill/xsample/xsample.cw
index 71f32471..88c1e049 100755
--- a/externals/grill/xsample/xsample.cw
+++ b/externals/grill/xsample/xsample.cw
Binary files differ
diff --git a/externals/grill/xsample/xsample.dsp b/externals/grill/xsample/xsample.dsp
index 18119476..e92f5bdb 100644
--- a/externals/grill/xsample/xsample.dsp
+++ b/externals/grill/xsample/xsample.dsp
@@ -79,7 +79,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib pd.lib flext_d-pdwin.lib /nologo /dll /debug /machine:I386 /pdbtype:sept /libpath:"c:\programme\audio\pd\bin\\" /libpath:"..\flext\pd-msvc\\"
+# ADD LINK32 kernel32.lib user32.lib pd.lib flext_d-pdwin.lib ippsa6l.lib /nologo /dll /debug /machine:I386 /pdbtype:sept /libpath:"c:\programme\audio\pd\bin\\" /libpath:"..\flext\pd-msvc\\"
!ENDIF