fadecurve-help.pd 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. #N canvas 320 22 929 656 10;
  2. #X obj 269 84 vsl 15 128 -3 3 0 0 empty empty empty 0 -9 0 10 -262130
  3. -1 -1 0 1;
  4. #X obj 381 84 vsl 15 128 0 1 0 0 empty empty empty 0 -9 0 10 -262130
  5. -1 -1 0 1;
  6. #X msg 269 242 shape \$1;
  7. #X msg 381 242 weight \$1;
  8. #X floatatom 381 291 7 0 0 1 10...10000 - -;
  9. #X msg 381 312 resolution \$1;
  10. #X text 319 29 creation arguments:;
  11. #X text 449 29 1st: name;
  12. #X floatatom 269 220 5 0 0 1 --inf...inf - -;
  13. #X floatatom 381 220 5 0 0 1 0...1 - -;
  14. #X text 528 188 SHAPE:;
  15. #X text 571 248 abs(shape) >= 2: f(x) = x^abs(shape);
  16. #X text 570 468 2 --> x^2;
  17. #X text 570 488 5 --> x^5;
  18. #X floatatom 64 548 5 0 99 1 0...(N-1) - -;
  19. #X floatatom 64 611 5 0 0 0 - - -;
  20. #X obj 64 589 tabread4 \$0-curve;
  21. #X text 570 408 EXAMPLES:;
  22. #X msg 164 242 quality \$1;
  23. #X floatatom 194 548 5 0 99 1 0...(N-1) - -;
  24. #X floatatom 194 611 5 0 0 0 - - -;
  25. #X obj 194 589 tabread \$0-curve;
  26. #X text 19 29 fadecurve <name> <resolution> <quality>;
  27. #X text 449 66 3rd (optional): init quality:;
  28. #X obj 64 567 + 1;
  29. #X obj 194 567 + 1;
  30. #X text 45 496 The table can also be addressed directly via [tabread].
  31. ;
  32. #X text 570 428 -1 --> standard cosine fade;
  33. #X text 571 298 shape < 0: output = 1-f(1-x);
  34. #X text 571 283 shape > 0: output = f(x);
  35. #X text 571 357 0 < abs(shape) < 1 && 1 <abs(shape) < 2;
  36. #X text 571 370 --> linear interpolation;
  37. #X text 571 188 MATHEMATICAL EXPLANATION:;
  38. #X text 570 448 -1.67 --> mix between "cosine" and "1-(1-x)^2";
  39. #X obj 164 220 hradio 15 1 0 4 empty empty 0..1..2 0 -8 0 10 -262144
  40. -1 -1 0;
  41. #X obj 164 364 t b a;
  42. #X text 45 516 (size=N+3 \, N=resolution);
  43. #X text 449 47 2nd (optional): init resolution N (default=100);
  44. #X text 571 208 abs(shape) = 0: f(x) = sin^2(x*pi/2);
  45. #X text 392 539 alternatively set parameters via send/receive:;
  46. #X text 571 328 input: 0 <= x <= 1;
  47. #X text 571 228 abs(shape) = 1: f(x) = 1-cos(x*pi/2);
  48. #X obj 42 416 cnv 15 170 30 empty empty empty 20 12 0 14 -204786 -66577
  49. 0;
  50. #X floatatom 50 455 9 0 1 1 0...1 - -;
  51. #X floatatom 50 330 7 0 1 1 0...1 - -;
  52. #X obj 50 389 f;
  53. #X obj 50 422 fadecurve \$0-curve 100 3;
  54. #X obj 119 115 bng 15 250 50 0 empty empty empty 17 7 0 10 -257985
  55. -1 -1;
  56. #X text 107 98 click to see table;
  57. #X msg 119 143 vis;
  58. #X text 302 400 (c)2012 Marian Weger;
  59. #X obj 414 561 s \$0-curve/quality;
  60. #X obj 414 581 s \$0-curve/shape;
  61. #X obj 534 561 s \$0-curve/weight;
  62. #X obj 534 581 s \$0-curve/resolution;
  63. #X obj 414 601 s \$0-curve/vis;
  64. #X obj 534 601 s \$0-curve/loadbang;
  65. #X text 631 67 0: no interpolation;
  66. #X text 631 81 1: linear interpolation;
  67. #X text 631 95 2: tabread4 4-point polynomianl interpolation;
  68. #X text 448 137 If weight=0 \, the abstraction is bypassed.;
  69. #X connect 0 0 8 0;
  70. #X connect 1 0 9 0;
  71. #X connect 2 0 35 0;
  72. #X connect 3 0 35 0;
  73. #X connect 4 0 5 0;
  74. #X connect 5 0 35 0;
  75. #X connect 8 0 2 0;
  76. #X connect 9 0 3 0;
  77. #X connect 14 0 24 0;
  78. #X connect 16 0 15 0;
  79. #X connect 18 0 35 0;
  80. #X connect 19 0 25 0;
  81. #X connect 21 0 20 0;
  82. #X connect 24 0 16 0;
  83. #X connect 25 0 21 0;
  84. #X connect 34 0 18 0;
  85. #X connect 35 0 45 0;
  86. #X connect 35 1 46 1;
  87. #X connect 44 0 45 0;
  88. #X connect 45 0 46 0;
  89. #X connect 46 0 43 0;
  90. #X connect 47 0 49 0;
  91. #X connect 49 0 35 0;