#N canvas 433 23 563 723 10;
#X obj 7 694 cnv 15 552 21 empty empty empty 20 12 0 14 #e0e0e0 #202020 0;
#X obj 7 483 cnv 3 550 3 empty empty outlets 8 12 0 13 #dcdcdc #000000 0;
#X obj 7 520 cnv 3 550 3 empty empty arguments 8 12 0 13 #dcdcdc #000000 0;
#X obj 7 644 cnv 3 550 3 empty empty more_info 8 12 0 13 #dcdcdc #000000 0;
#X obj 94 336 cnv 17 3 35 empty empty 0 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 95 494 cnv 17 3 17 empty empty 0 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 7 327 cnv 3 550 3 empty empty inlets 8 12 0 13 #dcdcdc #000000 0;
#X obj 7 602 cnv 3 550 3 empty empty attributes 8 12 0 13 #dcdcdc #000000 0;
#X obj 187 143 hsl 128 15 -1 1 0 0 empty empty empty -2 -8 0 10 #dcdcdc #000000 #000000 0 1;
#X text 147 540 2) float - input high (default 127);
#X text 147 527 1) float - input low (default 0);
#X text 147 552 3) float - output low (default 0);
#X obj 94 376 cnv 17 3 17 empty empty 1 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 94 396 cnv 17 3 17 empty empty 2 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 94 416 cnv 17 3 17 empty empty 3 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 94 436 cnv 17 3 17 empty empty 4 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 94 456 cnv 17 3 17 empty empty 5 5 9 0 16 #dcdcdc #9c9c9c 0;
#X text 109 614 @classic <int>;
#X text 147 565 4) float - output high (default 1);
#X text 131 651 Originally in Max/MSP \, "classic mode" is buggy as hell and cycling 74 is aware. We have a reasonably good version \, but you shouldn't really bother to use it \, just saying...;
#X text 147 578 5) float - exponential factor (default 1 - linear);
#X text 127 357 classic <f> -;
#X obj 184 168 sig~;
#X text 157 338 signal - value to perform the scaling function on;
#X text 123 377 float/signal - sets the low end of the input range;
#X text 123 397 float/signal - sets the high end of the input range;
#X text 123 417 float/signal - sets the low end of the output range;
#X text 123 436 float/signal - sets the high end of the output range;
#X text 123 457 float/signal - sets the exponential factor;
#X text 211 357 sets to classic mode <classic 1> or modern <classic 0>;
#N canvas 695 23 453 677 advanced 0;
#X obj 140 91 hsl 128 15 0 127 0 0 empty empty empty -2 -8 0 10 #dcdcdc #000000 #000000 0 1;
#X obj 245 136 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X text 321 370 Inverted;
#X obj 168 488 hsl 128 15 0 127 0 0 empty empty empty -2 -8 0 10 #dcdcdc #000000 #000000 0 1;
#X obj 165 516 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X text 50 417 If the input value is outside the input range \, [scale] will not clip the values to the output range but keep scaling outside that boundary with the same conversion parameters.;
#X text 59 31 The scaling can be inverted by reversing one of the ranges (input or output);
#X obj 71 218 cyclone/scale~ 0 127 -1 1;
#X obj 261 187 cyclone/scale~ 0 127 1 -1;
#X obj 245 305 cyclone/scale~ 127 0 -1 1;
#X obj 71 164 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 71 190 sig~;
#X obj 165 564 cyclone/scale~ 53.5 73.5 -1 1;
#X obj 165 539 sig~;
#X text 335 256 Inverted;
#X obj 245 158 sig~;
#X obj 71 249 cyclone/snapshot~ 1;
#X obj 71 276 nbx 7 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 165 593 cyclone/snapshot~ 1;
#X obj 165 620 nbx 7 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 245 343 cyclone/snapshot~ 1;
#X obj 245 370 nbx 7 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 261 229 cyclone/snapshot~ 1;
#X obj 261 256 nbx 7 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X connect 0 0 1 0;
#X connect 0 0 10 0;
#X connect 1 0 15 0;
#X connect 3 0 4 0;
#X connect 4 0 13 0;
#X connect 7 0 16 0;
#X connect 8 0 22 0;
#X connect 9 0 20 0;
#X connect 10 0 11 0;
#X connect 11 0 7 0;
#X connect 12 0 18 0;
#X connect 13 0 12 0;
#X connect 15 0 9 0;
#X connect 15 0 8 0;
#X connect 16 0 17 0;
#X connect 18 0 19 0;
#X connect 20 0 21 0;
#X connect 22 0 23 0;
#X restore 468 211 pd advanced;
#X obj 184 194 cyclone/scale~ -1 1 0 127;
#X obj 121 174 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X text 159 495 signal - the scaled values according to output range;
#X text 59 87 [scale~] maps an input range to an output range. Values larger or smaller than the input range will not be clipped to the output range. The mapping can be inverted and/or exponential.;
#N canvas 460 125 453 468 exponential 0;
#X floatatom 255 145 5 1 1.2 0 - - - 0;
#X obj 258 118 hsl 128 15 0.1 10 1 0 empty empty empty -2 -8 0 10 #dcdcdc #000000 #000000 0 1;
#X text 266 118 exponential factor;
#X obj 48 174 cyclone/scale~ 0 1 0 1 1 @classic 0;
#X obj 48 125 phasor~ 10;
#X text 27 19 Fifth argument or sixth inlet specifies the exponential factor. In modern mode (default) \, exponential values must be greater than 0 \, where 1 also gives you linear scaling (no exponential). It's like raising to the power of the given exponential \, try it below (with values from 0.1 to 10).;
#N canvas 366 171 813 506 backwards 0;
#X text 37 274 You can set the exponential mode with the @classic attribute \, "@classic 1" is classic mode and "@classic 0" is "modern mode".;
#X text 241 339 modern mode (default);
#X text 241 367 classic mode;
#X text 436 38 For the classic mode \, the exponential must be greater than "1". A value of "1" gives you a linear mapping (no exponential). Values greater than one gives you an exponential curve \, with larger values leading to steeper exponential curves. A typical value for this mode is "1.06". Below we have classic mode with expnential values from "1" (linear) to "1.2".;
#X text 42 420 BEWARE: let's state it clear again \, "classic mode" in Max/MSP is buggy as hell (and cycling 74 is aware of it). We have a reasonably good version \, but you shouldn't really bother to use it \, just saying...;
#X text 33 16 The [scale~] object first appeared in Max 6 \, but it's control counterpart ([scale]) was there since Max 4.2!;
#X text 34 156 In Max \, modern mode had the exponent inverted in relation to current Max and cyclone prior to Max 6.0.4! Thus \, with an exponent of 2 \, the object behaved like it had an exponent of 0.5 (and vice versa). Max/MSP patches from versions prior to 6.0.4 may require updating to work properly in modern mode. But since this is the first version of this object in cyclone \, it doesn't have backwards compatibility issues in Pd!;
#X text 34 50 In Max \, even though [scale] has classic by default \, [scale~] has a modern exponential mode by default \, but also offers a classic mode \, using a function compatible with old IRCAM patchers like [scale]. This is very buggy in Max and we encourage not to use it. To avoid inconsistencies \, we've made both [scale] and [scale~] have a modern mode by default.;
#X obj 76 340 cyclone/scale~ @classic 0;
#X obj 76 368 cyclone/scale~ @classic 1;
#X floatatom 631 181 13 1 1.2 0 - - - 0;
#X obj 634 157 hsl 128 15 1 1.2 0 0 empty empty empty -2 -8 0 10 #dcdcdc #000000 #000000 0 1;
#X text 642 157 exponential factor;
#X obj 490 150 phasor~ 10;
#X obj 490 180 *~ 127;
#X obj 490 208 cyclone/scale~ 0 127 0 1 @classic 1, f 24;
#X text 712 453 0;
#X text 711 359 1;
#X obj 508 364 cnv 19 198 98 empty empty empty 20 12 0 12 #e0e0e0 #404040 0;
#N canvas 0 50 450 250 (subpatch) 0;
#X array \$0-classic 4410 float 0;
#X coords 0 1 4409 0 200 100 1 0 0;
#X restore 507 363 graph;
#X obj 506 253 loadbang;
#X obj 506 278 metro 100;
#X obj 490 306 tabwrite~ \$0-classic;
#X connect 10 0 15 5;
#X connect 11 0 10 0;
#X connect 13 0 14 0;
#X connect 14 0 15 0;
#X connect 15 0 22 0;
#X connect 20 0 21 0;
#X connect 21 0 22 0;
#X restore 97 390 pd backwards compatibility \; classic mode and inconsistencies;
#X text 160 320 0;
#X text 161 226 1;
#X obj 177 231 cnv 19 198 98 empty empty empty 20 12 0 12 #e0e0e0 #404040 0;
#N canvas 0 50 450 250 (subpatch) 0;
#X array \$0-exp 4410 float 0;
#X coords 0 1 4409 0 200 100 1 0 0;
#X restore 176 230 graph;
#X obj 64 206 loadbang;
#X obj 64 231 metro 100;
#X obj 48 259 tabwrite~ \$0-exp;
#X connect 0 0 3 5;
#X connect 1 0 0 0;
#X connect 3 0 13 0;
#X connect 4 0 3 0;
#X connect 11 0 12 0;
#X connect 12 0 13 0;
#X restore 452 187 pd exponential;
#X text 205 614 - 0 loads "modern" \, 1 loads "classic" (default 0 \, modern);
#X text 325 142 <= input;
#X text 260 246 <= scaled value;
#X obj 500 69 cyclone/dsponoff~;
#X obj 2 5 ./header scale~;
#X text 25 59 Map signals to an output range;
#X obj 184 221 cyclone/snapshot~ 1;
#X obj 184 246 nbx 7 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X text 57 272 see also:;
#X obj 428 305 open-else;
#X text 484 276 click;
#X obj 47 292 cyclone/scale;
#X msg 428 277 rescale~;
#X text 154 277 Plugdata users or those with ELSE can also use the much simpler and more powerful [else/rescale~] as an alternative., f 42;
#X connect 8 0 32 0;
#X connect 8 0 22 0;
#X connect 22 0 31 0;
#X connect 31 0 42 0;
#X connect 42 0 43 0;
#X connect 48 0 45 0;
