diff options
author | N.N. <electrickery@users.sourceforge.net> | 2015-06-24 10:29:57 +0000 |
---|---|---|
committer | N.N. <electrickery@users.sourceforge.net> | 2015-06-24 10:29:57 +0000 |
commit | 06fb067d0566054f9b9c9fc088903d12fcf653ec (patch) | |
tree | 487b5b477f875bd6ba7b91f642127a8f1992b62e | |
parent | 0a678b130f9e7de04e0476248f4f93f1cb8d85a4 (diff) |
Fixed [lookup~] behaviour, now like Max5
svn path=/trunk/externals/miXed/; revision=17495
-rw-r--r-- | cyclone/sickle/lookup.c | 4 | ||||
-rw-r--r-- | doc/help/cyclone/lookup~-help.pd | 128 |
2 files changed, 70 insertions, 62 deletions
diff --git a/cyclone/sickle/lookup.c b/cyclone/sickle/lookup.c index 3f51e69..e6fd142 100644 --- a/cyclone/sickle/lookup.c +++ b/cyclone/sickle/lookup.c @@ -36,7 +36,9 @@ static t_int *lookup_perform(t_int *w) { float off = *oin++; /* msp: converted to int (if not a signal) */ int siz = (int)*sin++ - 1; /* msp: converted to int (signal too) */ - float pos = (siz > 0 ? off + siz * (*xin++ + 1.0) * 0.5 : off); + float pos; +// pos = (siz > 0 ? off + siz * (*xin++ + 1.0) * 0.5 : off); // range: off - (off + siz) + pos = (siz > 0 ? off + (siz - off) * (*xin++ + 1.0) * 0.5 : off); // range: off - siz int ndx = (int)pos; int ndx1 = ndx + 1; if (ndx1 > 0 && ndx1 < vecsize) diff --git a/doc/help/cyclone/lookup~-help.pd b/doc/help/cyclone/lookup~-help.pd index 215dac1..4dfaf69 100644 --- a/doc/help/cyclone/lookup~-help.pd +++ b/doc/help/cyclone/lookup~-help.pd @@ -1,5 +1,5 @@ -#N canvas 618 84 568 529 10; -#X obj 0 544 cnv 15 552 21 empty empty empty 20 12 0 14 -233017 -33289 +#N canvas 521 82 568 529 10; +#X obj 0 577 cnv 15 552 21 empty empty empty 20 12 0 14 -233017 -33289 0; #X obj 0 345 cnv 3 550 3 empty empty inlets 8 12 0 13 -228856 -1 0 ; @@ -21,40 +21,35 @@ Wilkes for Pd-extended 0.42 to conform to the PDDP template. Alex Cleveland updated this patch for Pd-l2ork version 2013.05.28. Fred Jan Kraan adapted the patch to pd-extended 2015-02-02; -#X restore 503 546 pd META; -#X obj 0 446 cnv 3 550 3 empty empty outlets 8 12 0 13 -228856 -1 0 +#X restore 503 579 pd META; +#X obj 0 466 cnv 3 550 3 empty empty outlets 8 12 0 13 -228856 -1 0 ; -#X obj 0 483 cnv 3 550 3 empty empty arguments 8 12 0 13 -228856 -1 +#X obj 0 503 cnv 3 550 3 empty empty arguments 8 12 0 13 -228856 -1 0; #N canvas 305 422 428 109 Related_objects 0; #X obj 0 0 cnv 15 425 20 empty empty empty 3 12 0 14 -204280 -1 0; #X text 6 1 Related Objects; -#X restore 209 546 pd Related_objects; -#X obj 87 354 cnv 17 3 17 empty empty 0 5 9 0 16 -228856 -162280 0 +#X restore 209 579 pd Related_objects; +#X obj 87 354 cnv 17 3 35 empty empty 0 5 9 0 16 -228856 -162280 0 ; -#X obj 87 384 cnv 17 3 17 empty empty 1 5 9 0 16 -228856 -162280 0 +#X obj 87 404 cnv 17 3 17 empty empty 1 5 9 0 16 -228856 -162280 0 ; #X obj 0 0 cnv 15 552 40 empty empty lookup~ 3 12 0 18 -204280 -1 0 ; #X obj 500 5 lookup~; #X text 12 23 transfer function lookup table; -#X floatatom 180 165 5 0 0 0 - - -; -#X floatatom 271 164 5 0 0 0 - - -; #X text 258 42 play with it a little:; #X text 118 353 signal; #X text 183 353 - signal to do transfer function lookup; -#X obj 87 415 cnv 17 3 17 empty empty 2 5 9 0 16 -228856 -162280 0 +#X obj 87 435 cnv 17 3 17 empty empty 2 5 9 0 16 -228856 -162280 0 ; -#X obj 87 456 cnv 17 3 17 empty empty 0 5 9 0 16 -228856 -162280 0 +#X obj 87 476 cnv 17 3 17 empty empty 0 5 9 0 16 -228856 -162280 0 ; -#X text 118 384 float; -#X text 118 415 float; -#X text 183 384 - offset; -#X text 183 415 - scale input; -#X text 101 515 2) float; -#X text 183 515 - initial offset in sample; -#X text 118 456 signal; -#X text 183 456 - ouput of transfer function lookup; +#X text 118 404 float; +#X text 118 435 float; +#X text 101 535 2) float; +#X text 118 476 signal; +#X text 183 476 - ouput of transfer function lookup; #X obj 97 297 output~; #N canvas 576 630 430 300 mux 0; #X obj 88 73 inlet~; @@ -66,7 +61,7 @@ adapted the patch to pd-extended 2015-02-02; #X obj 191 114 == 0; #X msg 253 54 0; #X msg 253 82 1; -#X floatatom 207 163 5 0 0 0 - - -; +#X floatatom 207 163 5 0 0 0 - - -, f 5; #X obj 0 0 cnv 15 425 20 empty empty empty 3 12 0 14 -204280 -1 0; #X text 2 1 Signal selector; #X connect 0 0 4 0; @@ -81,16 +76,13 @@ adapted the patch to pd-extended 2015-02-02; #X connect 8 0 6 0; #X restore 97 165 pd mux; #X obj 158 126 vradio 15 1 0 2 empty empty empty 0 -8 0 10 -262144 --1 -1 0; +-1 -1 1; #X text 175 122 osc~; #X text 175 141 phasor~; -#X obj 155 101 phasor~ 1; -#X obj 380 114 vsl 15 128 0 1 0 0 empty \$0-slider empty 0 -9 0 10 --262144 -1 -1 2717 1; -#X obj 97 123 +~ 1; -#X obj 97 144 *~ 0.5; -#X obj 97 101 osc~ 0.5; -#N canvas 542 423 431 275 visualise 0; +#X obj 157 98 phasor~ 1; +#X obj 380 104 vsl 15 128 -1 1 0 0 empty \$0-slider empty 0 -9 0 10 +-262144 -1 -1 4241 1; +#N canvas 540 424 431 275 visualise 0; #X obj 159 121 cyclone/Snapshot~ 100; #X obj 159 157 s \$0-slider; #X obj 159 81 inlet~; @@ -98,44 +90,58 @@ adapted the patch to pd-extended 2015-02-02; #X text 5 0 Convert signal to messages; #X connect 0 0 1 0; #X connect 2 0 0 0; -#X restore 380 248 pd visualise; -#X floatatom 97 76 5 0 0 0 - - -; -#X obj 98 236 cyclone/lookup~ \$0-voice 111; -#X text 101 497 1) symbol; -#X text 183 497 - table/array name; -#N canvas 1099 393 433 286 load 0; -#X obj 129 158 soundfiler; -#X obj 129 109 f \$0; -#X obj 129 87 loadbang; -#X msg 129 130 read -resize voice.wav \$1-voice; -#X obj 129 200 table \$0-voice; -#X floatatom 129 179 8 0 0 0 - - -; +#X restore 380 238 pd visualise; +#X floatatom 97 76 5 0 0 0 - - -, f 5; +#X text 101 517 1) symbol; +#N canvas 395 679 433 286 load 0; +#X obj 120 98 soundfiler; +#X obj 120 49 f \$0; +#X obj 120 27 loadbang; +#X msg 120 70 read -resize voice.wav \$1-voice; +#X floatatom 120 119 8 0 0 0 - - -, f 8; #X obj 1 2 cnv 15 425 20 empty empty empty 3 12 0 14 -204280 -1 0; #X text 4 3 Load the voice.wav file; -#X connect 0 0 5 0; +#X obj 120 138 table \$0-voice; +#X connect 0 0 4 0; #X connect 1 0 3 0; #X connect 2 0 1 0; #X connect 3 0 0 0; -#X restore 480 249 pd load; -#X obj 263 120 loadbang; -#X msg 263 145 62079; +#X restore 480 238 pd load; +#X msg 287 162 62079; #X obj 100 57 hsl 128 15 0 2 0 0 empty empty empty -2 -8 0 10 -262144 -1 -1 0 1; #X text 222 41 2; #X text 95 41 0; -#X connect 11 0 38 1; -#X connect 12 0 38 2; -#X connect 27 0 36 0; -#X connect 27 0 38 0; -#X connect 28 0 27 2; -#X connect 31 0 27 1; -#X connect 33 0 34 0; -#X connect 34 0 27 0; -#X connect 35 0 33 0; -#X connect 37 0 31 0; -#X connect 37 0 35 0; -#X connect 38 0 26 0; -#X connect 38 0 26 1; -#X connect 42 0 43 0; -#X connect 43 0 38 2; -#X connect 44 0 37 0; +#X obj 98 236 cyclone/lookup~ \$0-voice 0 62079; +#X obj 111 122 *~ 2; +#X obj 112 144 -~ 1; +#X msg 293 183 42079; +#X text 118 374 set; +#X text 183 374 - sets the array/table used; +#X msg 198 183 20000; +#X msg 192 162 0; +#X text 101 553 3) float; +#X obj 97 98 osc~ 0.5; +#X obj 157 76 * 2; +#X text 183 517 - array/table name; +#X text 183 435 - end-point in the array/table; +#X text 182 534 - initial offset in array/table (default 0); +#X text 183 552 - initial end-point array/table (default 512); +#X text 183 404 - offset in the array/table; +#X connect 22 0 28 0; +#X connect 22 0 36 0; +#X connect 23 0 22 2; +#X connect 26 0 37 0; +#X connect 29 0 45 0; +#X connect 32 0 36 2; +#X connect 33 0 29 0; +#X connect 33 0 46 0; +#X connect 36 0 21 0; +#X connect 36 0 21 1; +#X connect 37 0 38 0; +#X connect 38 0 22 1; +#X connect 39 0 36 2; +#X connect 42 0 36 1; +#X connect 43 0 36 1; +#X connect 45 0 22 0; +#X connect 46 0 26 0; |