#N canvas 433 23 572 697 10;
#X declare -stdpath ./;
#X obj 12 669 cnv 15 552 21 empty empty empty 20 12 0 14 #e0e0e0 #202020 0;
#X obj 12 453 cnv 3 550 3 empty empty outlets 8 12 0 13 #dcdcdc #000000 0;
#X obj 12 490 cnv 3 550 3 empty empty arguments 8 12 0 13 #dcdcdc #000000 0;
#X obj 12 614 cnv 3 550 3 empty empty more_info 8 12 0 13 #dcdcdc #000000 0;
#X obj 99 306 cnv 17 3 35 empty empty 0 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 100 464 cnv 17 3 17 empty empty 0 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 12 297 cnv 3 550 3 empty empty inlets 8 12 0 13 #dcdcdc #000000 0;
#X obj 12 572 cnv 3 550 3 empty empty attributes 8 12 0 13 #dcdcdc #000000 0;
#X obj 184 151 hsl 128 15 -1 1 0 0 empty empty empty -2 -8 0 10 #dcdcdc #000000 #000000 0 1;
#X text 152 510 2) float - input high (default 127);
#X text 152 497 1) float - input low (default 0);
#X text 152 522 3) float - output low (default 0);
#X obj 99 346 cnv 17 3 17 empty empty 1 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 99 366 cnv 17 3 17 empty empty 2 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 99 386 cnv 17 3 17 empty empty 3 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 99 406 cnv 17 3 17 empty empty 4 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 99 426 cnv 17 3 17 empty empty 5 5 9 0 16 #dcdcdc #9c9c9c 0;
#X text 114 584 @classic <int>;
#X text 152 535 4) float - output high (default 1);
#X text 136 621 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 152 548 5) float - exponential factor (default 1 - linear);
#X text 132 327 classic <f> -;
#X obj 181 180 sig~;
#X text 162 308 signal - value to perform the scaling function on;
#X text 128 347 float/signal - sets the low end of the input range;
#X text 128 367 float/signal - sets the high end of the input range;
#X text 128 387 float/signal - sets the low end of the output range;
#X text 128 406 float/signal - sets the high end of the output range;
#X text 128 427 float/signal - sets the exponential factor;
#X text 216 327 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 473 234 pd advanced;
#X obj 181 206 cyclone/scale~ -1 1 0 127;
#X obj 118 181 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#N canvas 695 23 432 346 crossfade 0;
#X obj 178 192 cyclone/scale~ 0 1;
#X obj 178 164 line~;
#X obj 178 118 nbx 4 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X msg 178 141 \$1 20;
#X obj 181 93 hsl 128 15 0 1 0 0 empty empty empty -2 -8 0 10 #dcdcdc #000000 #000000 0 1;
#X obj 241 136 osc~ 440;
#X obj 262 165 osc~ 660;
#X text 296 136 A;
#X text 318 166 B;
#X text 163 92 A;
#X text 314 93 B;
#X text 46 20 [scale~] can also act as a linear crossfader at signal rate between two mono sound sources \, though this is not its purpose.;
#X obj 178 235 output~;
#X obj 34 240 declare -stdpath ./;
#X connect 0 0 12 0;
#X connect 1 0 0 0;
#X connect 2 0 3 0;
#X connect 3 0 1 0;
#X connect 4 0 2 0;
#X connect 5 0 0 3;
#X connect 6 0 0 4;
#X restore 467 256 pd crossfade;
#X text 164 465 signal - the scaled values according to output range;
#X text 64 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 697 78 418 455 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 obj 48 221 cyclone/scope~ 214 135 34 3 128 0 1 0 0 2 0.5 205 229 232 74 79 77 96 98 102 0 empty;
#X text 276 347 0;
#X text 272 219 1;
#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 494 160 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 221 339 modern mode (default);
#X text 221 367 classic mode;
#X text 436 48 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 floatatom 636 223 0 1 1.2 0 - - - 0;
#X obj 639 199 hsl 128 15 1 1.2 0 0 empty empty empty -2 -8 0 10 #dcdcdc #000000 #000000 0 1;
#X text 647 199 exponential factor;
#X obj 495 296 cyclone/scope~ 214 135 34 3 128 0 1 0 0 2 0.95 205 229 232 74 79 77 96 98 102 0 empty;
#X text 719 422 0;
#X text 719 294 1;
#X obj 495 192 phasor~ 10;
#X obj 495 222 *~ 127;
#X obj 106 340 scale~ @classic 0;
#X obj 106 368 scale~ @classic 1;
#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 obj 495 250 cyclone/scale~ 0 127 0 1 @classic 1, f 24;
#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 connect 5 0 17 5;
#X connect 6 0 5 0;
#X connect 11 0 12 0;
#X connect 12 0 17 0;
#X connect 17 0 8 0;
#X restore 97 390 pd backwards compatibility \; classic mode and inconsistencies;
#X connect 0 0 3 5;
#X connect 1 0 0 0;
#X connect 3 0 5 0;
#X connect 4 0 3 0;
#X restore 457 210 pd exponential;
#X text 210 584 - 0 loads "modern" \, 1 loads "classic" (default 0 \, modern);
#X text 322 150 <= input;
#X text 257 263 <= scaled value;
#X obj 505 69 cyclone/dsponoff~;
#X obj 7 5 ./header scale~;
#X text 30 59 Map signals to an output range;
#X obj 181 236 cyclone/snapshot~ 1;
#X obj 181 263 nbx 7 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X connect 8 0 32 0;
#X connect 8 0 22 0;
#X connect 22 0 31 0;
#X connect 31 0 43 0;
#X connect 43 0 44 0;
