aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2006-12-24 06:06:41 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2006-12-24 06:06:41 +0000
commitc68540d494272de1baabdae875e95fbd02e7ea60 (patch)
tree4fa30eec901aa6ada759aef39a406797e4f66d27
parent45d50493ba307fa71cdf29bb919948ce8d396cea (diff)
added state saving, modifying Cyrille's idea
svn path=/trunk/externals/mapping/; revision=7054
-rw-r--r--autoscale.pd204
-rw-r--r--help/autoscale-help.pd93
-rw-r--r--track_max.pd16
3 files changed, 142 insertions, 171 deletions
diff --git a/autoscale.pd b/autoscale.pd
index c354417..20af1c5 100644
--- a/autoscale.pd
+++ b/autoscale.pd
@@ -1,19 +1,20 @@
-#N canvas 133 257 749 460 10;
+#N canvas 411 85 761 507 10;
+#X obj 634 5 import mapping;
#X obj 5 20 inlet;
-#X obj 77 373 outlet;
-#X obj 77 152 trigger float float float bang bang;
-#X obj 77 320 expr (($f1 - $f2) * (($f5 - $f4) / ($f3 - $f2))) + $f4
+#X obj 112 424 outlet;
+#X obj 112 153 trigger float float float bang bang;
+#X obj 112 321 expr (($f1 - $f2) * (($f5 - $f4) / ($f3 - $f2))) + $f4
;
-#X text 2 406 (C) Copyright 2004 Hans-Christoph Steiner <hans@at.or.at>
+#X text 2 446 (C) Copyright 2004 Hans-Christoph Steiner <hans@at.or.at>
;
-#X text 219 421 released under the GNU GPL;
-#X text 417 418 $Author: nusmuk $;
-#X obj 355 20 inlet;
-#X obj 456 20 inlet;
-#X text 362 36 output min;
-#X text 463 36 output max;
+#X text 219 461 released under the GNU GPL;
+#X text 417 458 $Author: eighthave $;
+#X obj 368 20 inlet;
+#X obj 469 20 inlet;
+#X text 335 6 output min;
+#X text 436 6 output max;
#X text 44 21 data to be scaled;
-#X obj 589 20 inlet reset;
+#X obj 522 20 inlet reset;
#N canvas 0 22 454 304 output 0;
#X obj 32 24 inlet;
#X obj 334 24 inlet;
@@ -40,57 +41,24 @@
#X connect 11 0 14 0;
#X connect 11 1 10 0;
#X connect 14 0 9 0;
-#X restore 356 292 pd output range;
-#N canvas 463 201 461 355 track 0;
-#X obj 161 31 inlet;
-#X obj 38 285 outlet;
-#X text 75 239 min;
-#X text 202 240 max;
-#X obj 37 216 moses 0;
-#X obj 162 216 moses 0;
-#X obj 226 240 + 1e-09;
-#X obj 317 76 bang;
-#X msg 317 139 0;
-#X obj 206 197 float;
-#X obj 37 239 float;
-#X obj 81 197 float;
-#X obj 168 137 purepd/once;
-#X obj 43 137 purepd/once;
-#X obj 162 77 trigger 0 bang 0;
-#X obj 37 77 trigger 0 bang 0;
-#X obj 369 24 inlet;
-#X obj 225 284 outlet;
-#X obj 34 31 inlet;
-#X text 25 309 ^-- these [purepd/once] bits are just here to get the
-max/min tracking started;
-#X connect 0 0 14 0;
-#X connect 4 0 10 0;
-#X connect 5 1 6 0;
-#X connect 6 0 5 1;
-#X connect 6 0 17 0;
-#X connect 7 0 8 0;
-#X connect 7 0 12 1;
-#X connect 7 0 13 1;
-#X connect 8 0 9 0;
-#X connect 8 0 10 0;
-#X connect 9 0 5 1;
-#X connect 10 0 4 1;
-#X connect 10 0 1 0;
-#X connect 11 0 4 1;
-#X connect 12 0 9 0;
-#X connect 13 0 11 0;
-#X connect 14 0 5 0;
-#X connect 14 1 12 0;
-#X connect 14 2 9 1;
-#X connect 15 0 4 0;
-#X connect 15 1 13 0;
-#X connect 15 2 11 1;
-#X connect 16 0 7 0;
-#X connect 18 0 15 0;
-#X restore 156 292 pd track changes;
-#X obj 335 152 trigger float bang bang;
-#N canvas 634 182 462 312 gate 0;
-#X obj 76 39 inlet;
+#X restore 391 283 pd output range;
+#N canvas 463 201 389 220 track 0;
+#X obj 168 22 inlet;
+#X obj 38 135 outlet;
+#X obj 279 22 inlet;
+#X obj 168 135 outlet;
+#X obj 38 22 inlet;
+#X obj 38 108 track_min;
+#X obj 168 108 track_max;
+#X connect 0 0 6 0;
+#X connect 2 0 6 2;
+#X connect 2 0 5 2;
+#X connect 4 0 5 0;
+#X connect 5 0 1 0;
+#X connect 6 0 3 0;
+#X restore 191 290 pd track changes;
+#X obj 370 153 trigger float bang bang;
+#N canvas 634 182 466 316 gate 0;
#X obj 74 268 outlet;
#X obj 316 266 outlet;
#X obj 323 37 inlet;
@@ -101,53 +69,67 @@ max/min tracking started;
#X msg 105 175 0;
#X msg 134 175 1;
#X obj 243 70 select 1 0;
-#X connect 0 0 6 0;
-#X connect 0 0 7 0;
-#X connect 3 0 10 0;
-#X connect 4 0 7 1;
-#X connect 5 0 7 1;
+#X obj 76 39 route float;
+#X obj 76 15 inlet;
+#X connect 2 0 9 0;
+#X connect 3 0 6 1;
+#X connect 4 0 6 1;
+#X connect 5 0 0 0;
#X connect 6 0 1 0;
-#X connect 7 0 2 0;
-#X connect 8 0 6 1;
-#X connect 9 0 6 1;
-#X connect 10 0 4 0;
-#X connect 10 0 9 0;
-#X connect 10 1 5 0;
-#X connect 10 1 8 0;
-#X restore 77 110 pd gate;
-#X obj 589 39 route float bang;
-#X obj 166 371 outlet;
-#X obj 263 375 outlet;
-#X obj 166 345 f;
-#X obj 263 350 f;
-#X obj 5 60 route reset dump;
-#X text 417 405 $Revision: 1.5 $$Date: 2006-12-23 10:32:41 $;
-#X connect 0 0 22 0;
-#X connect 2 0 3 0;
-#X connect 2 1 14 0;
-#X connect 2 2 14 1;
-#X connect 2 3 13 0;
-#X connect 2 4 13 1;
-#X connect 3 0 1 0;
-#X connect 7 0 13 0;
-#X connect 8 0 13 1;
-#X connect 12 0 17 0;
-#X connect 13 0 3 3;
-#X connect 13 1 3 4;
-#X connect 14 0 3 1;
-#X connect 14 0 20 1;
-#X connect 14 1 3 2;
-#X connect 14 1 21 1;
-#X connect 15 0 3 0;
-#X connect 15 1 13 0;
-#X connect 15 2 13 1;
-#X connect 16 0 2 0;
-#X connect 16 1 15 0;
-#X connect 17 0 16 1;
-#X connect 17 1 14 2;
-#X connect 20 0 18 0;
+#X connect 7 0 5 1;
+#X connect 8 0 5 1;
+#X connect 9 0 3 0;
+#X connect 9 0 8 0;
+#X connect 9 1 4 0;
+#X connect 9 1 7 0;
+#X connect 10 0 5 0;
+#X connect 10 0 6 0;
+#X connect 11 0 10 0;
+#X restore 154 81 pd gate;
+#X obj 522 39 route float bang;
+#X obj 175 424 outlet;
+#X obj 238 424 outlet;
+#X obj 175 398 f;
+#X obj 238 399 f;
+#X text 417 445 $Revision: 1.6 $$Date: 2006-12-24 06:06:41 $;
+#X text 192 135 track mode;
+#X text 396 136 run mode;
+#X obj 16 224 unpack float float;
+#X obj 16 198 trigger list bang;
+#X obj 5 347 trigger bang bang;
+#X obj 5 60 route save load reset;
+#X connect 1 0 29 0;
+#X connect 3 0 4 0;
+#X connect 3 1 15 0;
+#X connect 3 2 15 1;
+#X connect 3 3 14 0;
+#X connect 3 4 14 1;
+#X connect 4 0 2 0;
+#X connect 8 0 14 0;
+#X connect 9 0 14 1;
+#X connect 13 0 18 0;
+#X connect 14 0 4 3;
+#X connect 14 1 4 4;
+#X connect 15 0 4 1;
+#X connect 15 0 21 1;
+#X connect 15 1 4 2;
+#X connect 15 1 22 1;
+#X connect 16 0 4 0;
+#X connect 16 1 14 0;
+#X connect 16 2 14 1;
+#X connect 17 0 3 0;
+#X connect 17 1 16 0;
+#X connect 18 0 17 1;
+#X connect 18 1 15 2;
#X connect 21 0 19 0;
-#X connect 22 0 14 2;
-#X connect 22 1 20 0;
-#X connect 22 1 21 0;
-#X connect 22 2 16 0;
+#X connect 22 0 20 0;
+#X connect 26 0 15 0;
+#X connect 26 1 15 1;
+#X connect 27 0 26 0;
+#X connect 27 1 15 2;
+#X connect 28 0 21 0;
+#X connect 28 1 22 0;
+#X connect 29 0 28 0;
+#X connect 29 1 27 0;
+#X connect 29 2 15 2;
+#X connect 29 3 17 0;
diff --git a/help/autoscale-help.pd b/help/autoscale-help.pd
index 2be0e32..a50750a 100644
--- a/help/autoscale-help.pd
+++ b/help/autoscale-help.pd
@@ -1,4 +1,4 @@
-#N canvas 248 54 487 774 10;
+#N canvas 139 22 451 673 10;
#X floatatom 26 76 5 0 0 0 - - -;
#X floatatom 26 140 0 0 0 0 - - -;
#X obj 2 -10 cnv 15 450 20 empty empty [autoscale] 2 11 1 18 -233017
@@ -8,16 +8,14 @@ range set as arguments \, and an input range which is set dynamically.
;
#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 219 707 released under the GNU GPL;
+-1 -1 10391 1;
#X floatatom 150 140 0 0 0 0 - - -;
#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 7300 1;
-#X text 314 726 $Author: nusmuk $;
+-1 -1 0 1;
#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 4233 1;
+-1 -1 5443 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.;
@@ -26,59 +24,52 @@ output range defaults to 0-1.;
and 3rd inlets:;
#X floatatom 195 260 5 0 0 1 max - -;
#X floatatom 117 250 5 0 0 0 - - -;
-#X obj 295 361 tgl 15 1 empty empty empty 0 -6 0 8 -262144 -1 -1 0
+#X obj 295 361 tgl 15 1 empty empty empty 0 -6 0 8 -262144 -1 -1 1
1;
-#X text 2 693 (C) Copyright 2006 Hans-Christoph Steiner <hans@at.or.at>
-;
#X text 14 322 The [reset( message or banging the 4th inlet resets
the stored max and min to zero. 0 disables the auto-tracking \, 1 re-enables
it:;
-#X floatatom 127 517 5 0 0 0 - - -;
-#X obj 130 662 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -262144
--1 -1 7109 1;
-#X msg 215 580 set \$1;
-#X msg 215 627 2.89;
-#X msg 304 579 set \$1;
-#X msg 304 628 3.83;
-#X obj 323 598 loadbang;
-#X msg 169 517 dump;
+#X floatatom 81 505 5 0 0 0 - - -;
+#X obj 130 630 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -262144
+-1 -1 5292 1;
#X text 16 453 The dump message allow "autoscale" to output the min
and max of the input data. this allow user to save this data in order
to load the same callibration with a loadbang :;
-#X obj 127 556 autoscale 0 1 ____________;
-#X msg 304 532 0;
-#X obj 304 509 loadbang;
-#X text 2 726 $Revision: 1.5 $$Date: 2006-12-23 10:32:41 $;
+#X obj 300 532 tgl 15 1 empty empty empty 0 -6 0 8 -262144 -1 -1 1
+1;
+#X obj 215 579 pack float float;
+#X msg 148 500 save;
+#X msg 215 600 set load \$1 \$2;
+#X msg 150 523 load 1 11;
+#X obj 150 110 autoscale -0.01 0.01;
#X obj 158 393 autoscale;
#X obj 26 110 autoscale;
#X obj 158 278 autoscale;
-#X obj 150 110 autoscale -0.01 0.01;
#X obj 297 110 autoscale -4095 4095;
-#X connect 0 0 36 0;
-#X connect 4 0 37 1;
-#X connect 9 0 38 0;
-#X connect 9 0 39 0;
-#X connect 11 0 35 0;
-#X connect 13 0 35 0;
-#X connect 15 0 35 3;
-#X connect 17 0 37 2;
-#X connect 18 0 37 0;
-#X connect 19 0 35 3;
-#X connect 22 0 31 0;
-#X connect 24 0 25 0;
-#X connect 25 0 31 1;
-#X connect 26 0 27 0;
-#X connect 27 0 31 2;
-#X connect 28 0 27 0;
-#X connect 28 0 25 0;
-#X connect 29 0 31 0;
-#X connect 31 0 23 0;
-#X connect 31 1 24 0;
-#X connect 31 2 26 0;
-#X connect 32 0 31 3;
-#X connect 33 0 32 0;
-#X connect 35 0 12 0;
-#X connect 36 0 1 0;
-#X connect 37 0 5 0;
-#X connect 38 0 7 0;
-#X connect 39 0 8 0;
+#X obj 127 556 autoscale 0 1 ______________;
+#X msg 323 531 bang;
+#X connect 0 0 29 0;
+#X connect 4 0 30 1;
+#X connect 8 0 27 0;
+#X connect 8 0 31 0;
+#X connect 9 0 28 0;
+#X connect 11 0 28 0;
+#X connect 13 0 28 3;
+#X connect 15 0 30 2;
+#X connect 16 0 30 0;
+#X connect 17 0 28 3;
+#X connect 19 0 32 0;
+#X connect 22 0 32 3;
+#X connect 23 0 25 0;
+#X connect 24 0 32 0;
+#X connect 25 0 26 0;
+#X connect 26 0 32 0;
+#X connect 27 0 6 0;
+#X connect 28 0 10 0;
+#X connect 29 0 1 0;
+#X connect 30 0 5 0;
+#X connect 31 0 7 0;
+#X connect 32 0 20 0;
+#X connect 32 1 23 0;
+#X connect 32 2 23 1;
+#X connect 33 0 32 3;
diff --git a/track_max.pd b/track_max.pd
index b929d35..b9dd3e0 100644
--- a/track_max.pd
+++ b/track_max.pd
@@ -1,4 +1,4 @@
-#N canvas 353 201 457 385 10;
+#N canvas 353 201 461 389 10;
#X obj 83 269 outlet;
#X obj 294 7 inlet;
#X obj 37 7 inlet;
@@ -11,7 +11,6 @@
#X obj 37 207 moses;
#X obj 37 143 spigot 1;
#X text 59 235 max;
-#X obj 173 200 print ARG;
#X obj 177 164 purepd/float_argument \$1 -9.99e+37;
#X obj 83 234 + 1e-09;
#X text 33 292 1e-09 is added so [moses] doesn't output the current
@@ -22,16 +21,15 @@ maximum value again.;
#X connect 1 0 3 0;
#X connect 2 0 10 0;
#X connect 3 0 4 0;
-#X connect 3 1 13 0;
+#X connect 3 1 12 0;
#X connect 4 0 5 0;
#X connect 4 1 6 0;
#X connect 5 0 10 1;
#X connect 6 0 10 1;
-#X connect 7 0 13 0;
-#X connect 8 0 13 0;
-#X connect 9 1 14 0;
+#X connect 7 0 12 0;
+#X connect 8 0 12 0;
+#X connect 9 1 13 0;
#X connect 10 0 9 0;
+#X connect 12 0 9 1;
+#X connect 13 0 0 0;
#X connect 13 0 9 1;
-#X connect 13 0 12 0;
-#X connect 14 0 0 0;
-#X connect 14 0 9 1;