aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2006-07-07 04:08:55 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2006-07-07 04:08:55 +0000
commit57fb5b3025d63b4921a56f09a4a7d327ff8f6967 (patch)
treefa3dbc986fa3867d9ab65625856331f96a5f8b08
parent6cb5e0d686c0767ea1d8b374aa5473425f666a0a (diff)
added three inlets: min, max and reset; replaced [oneshot] with [purepd/once] and switched to using [float_argument].
svn path=/trunk/externals/mapping/; revision=5360
-rw-r--r--autoscale.pd159
-rw-r--r--help/autoscale-help.pd58
2 files changed, 111 insertions, 106 deletions
diff --git a/autoscale.pd b/autoscale.pd
index 3a0f92c..5e1563c 100644
--- a/autoscale.pd
+++ b/autoscale.pd
@@ -1,85 +1,82 @@
-#N canvas 206 226 781 550 10;
-#X obj 45 30 inlet;
-#X obj 175 453 outlet;
-#X obj 235 268 f;
-#X text 262 268 min;
-#X text 360 269 max;
-#X obj 454 167 f \$1;
-#X obj 652 167 f \$2;
-#X obj 235 245 moses 0;
-#X obj 320 245 moses 0;
-#X obj 175 102 trigger float float float bang bang;
-#X obj 175 390 expr (($f1 - $f2) * (($f5 - $f4) / ($f3 - $f2))) + $f4
+#N canvas 348 266 816 509 10;
+#X obj 5 20 inlet;
+#X obj 77 433 outlet;
+#X text 135 318 min;
+#X text 262 319 max;
+#X obj 97 295 moses 0;
+#X obj 222 295 moses 0;
+#X obj 77 92 trigger float float float bang bang;
+#X obj 77 380 expr (($f1 - $f2) * (($f5 - $f4) / ($f3 - $f2))) + $f4
;
-#X obj 326 205 oneshot;
-#X obj 364 226 f;
-#X obj 320 178 t f b f;
-#X obj 241 205 oneshot;
-#X obj 279 226 f;
-#X obj 235 178 t f b f;
-#X obj 384 269 + 1e-09;
-#X obj 478 213 ==;
-#X obj 478 233 sel 1;
-#X obj 545 77 loadbang;
-#X obj 478 299 print [autoscale];
-#X obj 545 100 t b b;
-#X obj 478 256 oneshot;
-#X text 2 476 (C) Copyright 2004 Hans-Christoph Steiner <hans@at.or.at>
+#X obj 286 319 + 1e-09;
+#X obj 408 78 loadbang;
+#X text 2 456 (C) Copyright 2004 Hans-Christoph Steiner <hans@at.or.at>
;
-#X text 219 491 released under the GNU GPL;
-#X text 417 475 $Revision: 1.2 $$Date: 2006-02-03 22:34:17 $;
-#X text 417 488 $Author: eighthave $;
-#X obj 45 62 route reset;
-#X obj 45 81 bang;
-#X msg 45 129 0;
-#X msg 114 102 clear;
-#X text 172 47 these [oneshot] bits are just here to get the max/min
-tracking started;
-#X text 8 3 [autoscale];
-#X msg 478 278 using default range (0-1);
-#X obj 454 329 expr if ($f1 == $f2 \, 0 \, $f1) \; if ($f1 == $f2 \,
+#X text 219 471 released under the GNU GPL;
+#X text 417 455 $Revision: 1.3 $$Date: 2006-07-07 04:08:55 $;
+#X text 417 468 $Author: eighthave $;
+#X obj 5 60 route reset;
+#X obj 17 156 bang;
+#X msg 17 219 0;
+#X obj 356 319 expr if ($f1 == $f2 \, 0 \, $f1) \; if ($f1 == $f2 \,
1 \, $f2);
-#X connect 0 0 28 0;
-#X connect 2 0 7 1;
-#X connect 2 0 10 1;
-#X connect 5 0 18 0;
-#X connect 5 0 35 0;
-#X connect 6 0 18 1;
-#X connect 6 0 35 1;
-#X connect 7 0 2 0;
-#X connect 8 1 17 0;
-#X connect 9 0 10 0;
-#X connect 9 1 16 0;
-#X connect 9 2 13 0;
-#X connect 9 3 5 0;
-#X connect 9 4 6 0;
-#X connect 10 0 1 0;
-#X connect 11 0 12 0;
-#X connect 12 0 8 1;
-#X connect 13 0 8 0;
-#X connect 13 1 11 0;
-#X connect 13 2 12 1;
+#X obj 266 276 float;
+#X obj 97 318 float;
+#X obj 141 276 float;
+#X obj 356 20 inlet;
+#X obj 555 20 inlet;
+#X text 396 21 output min;
+#X text 601 20 output max;
+#X text 44 21 data to be scaled;
+#X obj 228 216 purepd/once;
+#X obj 103 216 purepd/once;
+#X obj 222 156 trigger 0 bang 0;
+#X obj 97 156 trigger 0 bang 0;
+#X text 195 407 ^-- these [purepd/once] bits are just here to get the
+max/min tracking started;
+#X obj 695 20 inlet reset;
+#X obj 554 157 purepd/float_argument \$2 1;
+#X obj 408 101 trigger 0 bang;
+#X text 522 100 [float_argument] doesn't output 0 on;
+#X text 522 112 bang \, so send the 0 here.;
+#X obj 356 157 purepd/float_argument \$1 0;
+#X connect 0 0 14 0;
+#X connect 4 0 19 0;
+#X connect 5 1 8 0;
+#X connect 6 0 7 0;
+#X connect 6 1 29 0;
+#X connect 6 2 28 0;
+#X connect 6 3 36 0;
+#X connect 6 4 32 0;
+#X connect 7 0 1 0;
+#X connect 8 0 5 1;
+#X connect 8 0 7 2;
+#X connect 9 0 33 0;
#X connect 14 0 15 0;
-#X connect 15 0 7 1;
-#X connect 16 0 7 0;
-#X connect 16 1 14 0;
-#X connect 16 2 15 1;
-#X connect 17 0 8 1;
-#X connect 17 0 10 2;
-#X connect 18 0 19 0;
-#X connect 19 0 23 0;
-#X connect 20 0 22 0;
-#X connect 22 0 5 0;
-#X connect 22 1 6 0;
-#X connect 23 0 34 0;
-#X connect 28 0 29 0;
-#X connect 28 1 9 0;
-#X connect 29 0 30 0;
-#X connect 29 0 31 0;
-#X connect 30 0 2 0;
-#X connect 30 0 12 0;
-#X connect 31 0 14 0;
-#X connect 31 0 11 0;
-#X connect 34 0 21 0;
-#X connect 35 0 10 3;
-#X connect 35 1 10 4;
+#X connect 14 1 6 0;
+#X connect 15 0 16 0;
+#X connect 15 0 26 1;
+#X connect 15 0 27 1;
+#X connect 16 0 18 0;
+#X connect 16 0 19 0;
+#X connect 17 0 7 3;
+#X connect 17 1 7 4;
+#X connect 18 0 5 1;
+#X connect 19 0 4 1;
+#X connect 19 0 7 1;
+#X connect 20 0 4 1;
+#X connect 21 0 36 0;
+#X connect 22 0 32 0;
+#X connect 26 0 18 0;
+#X connect 27 0 20 0;
+#X connect 28 0 5 0;
+#X connect 28 1 26 0;
+#X connect 28 2 18 1;
+#X connect 29 0 4 0;
+#X connect 29 1 27 0;
+#X connect 29 2 20 1;
+#X connect 31 0 15 0;
+#X connect 32 0 17 1;
+#X connect 33 0 36 0;
+#X connect 33 1 32 0;
+#X connect 36 0 17 0;
diff --git a/help/autoscale-help.pd b/help/autoscale-help.pd
index 65ddaec..7a8a80d 100644
--- a/help/autoscale-help.pd
+++ b/help/autoscale-help.pd
@@ -1,15 +1,14 @@
-#N canvas 229 80 468 541 10;
+#N canvas 229 80 464 532 10;
#X floatatom 26 76 5 0 0 0 - - -;
#X floatatom 26 140 0 0 0 0 - - -;
-#X obj 68 258 autoscale;
#X obj 2 -10 cnv 15 450 20 empty empty [autoscale] 2 11 1 18 -233017
-66577 0;
#X text 18 23 [autoscale] scales a stream of numbers based on an output
range set as arguments \, and an input range which is set dynamically.
;
-#X floatatom 68 237 5 0 0 0 - - -;
-#X obj 71 281 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -262144
--1 -1 17 1;
+#X floatatom 177 244 5 0 0 1 min - -;
+#X obj 161 301 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -262144
+-1 -1 0 1;
#X text 17 441 (C) Copyright 2004 Hans-Christoph Steiner <hans@at.or.at>
;
#X text 234 455 released under the GNU GPL;
@@ -17,28 +16,37 @@ range set as arguments \, and an input range which is set dynamically.
#X floatatom 297 140 0 0 0 0 - - -;
#X obj 213 71 hsl 128 15 0 127 0 0 empty empty empty -2 -6 0 8 -262144
-1 -1 0 1;
-#X text 17 474 $Revision: 1.2 $$Date: 2006-01-29 08:12:33 $;
+#X text 17 474 $Revision: 1.3 $$Date: 2006-07-07 04:08:55 $;
#X text 18 487 $Author: eighthave $;
-#X text 25 324 The [reset( message resets the stored max and min to
-zero.;
-#X floatatom 46 348 5 0 0 0 - - -;
-#X obj 71 401 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -262144
--1 -1 0 1;
-#X msg 96 346 reset;
-#X obj 150 110 autoscale -0.01 0.01;
-#X obj 297 110 autoscale -4095 4095;
-#X obj 68 378 autoscale;
+#X floatatom 136 363 5 0 0 0 - - -;
+#X obj 161 416 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -262144
+-1 -1 12700 1;
+#X msg 186 361 reset;
#X text 13 181 If you use [autoscale] with no arguments \, then the
output range defaults to 0-1.;
+#X text 25 329 The [reset( message or banging the 4th inlet resets
+the stored max and min to zero.;
+#X msg 239 361 bang;
#X obj 26 110 autoscale;
-#X connect 0 0 22 0;
-#X connect 2 0 6 0;
-#X connect 5 0 2 0;
-#X connect 11 0 18 0;
-#X connect 11 0 19 0;
+#X obj 158 393 autoscale;
+#X obj 158 278 autoscale;
+#X obj 150 110 autoscale -0.01 0.01;
+#X obj 297 110 autoscale -4095 4095;
+#X text 14 211 You can also set the output min and max using the 2nd
+and 3rd inlets:;
+#X floatatom 195 260 5 0 0 1 max - -;
+#X floatatom 117 250 5 0 0 0 - - -;
+#X connect 0 0 19 0;
+#X connect 4 0 21 1;
+#X connect 10 0 22 0;
+#X connect 10 0 23 0;
+#X connect 13 0 20 0;
#X connect 15 0 20 0;
-#X connect 17 0 20 0;
-#X connect 18 0 9 0;
-#X connect 19 0 10 0;
-#X connect 20 0 16 0;
-#X connect 22 0 1 0;
+#X connect 18 0 20 3;
+#X connect 19 0 1 0;
+#X connect 20 0 14 0;
+#X connect 21 0 5 0;
+#X connect 22 0 8 0;
+#X connect 23 0 9 0;
+#X connect 25 0 21 2;
+#X connect 26 0 21 0;