[PD] triangle with modulation

Frank Barknecht fbar at footils.org
Tue Feb 13 12:20:32 CET 2007


Hallo,
guillaume rabusseau hat gesagt: // guillaume rabusseau wrote:

> Thx for the direction, i gonna look for a solution to keep always the same 
> amplitude (the signal should work for vco and lfo...).

The formulas for achieving constant amplitude (or constant DC) are
also in that patch, so it shouldn't be to hard to change it for this.
(If you find it too hard, just take a peek at attached variation of
the help-file.)

Ciao
-- 
 Frank Barknecht                 _ ______footils.org_ __goto10.org__
-------------- next part --------------
#N canvas 111 30 865 606 12;
#N canvas 0 0 450 300 (subpatch) 0;
#X array \$0-sum 882 float 0;
#X coords 0 0.5 881 -0.5 200 130 1;
#X restore 637 359 graph;
#X text 636 497 ---- 0.02 seconds ----;
#X text 350 505 updated for Pd version 0.39;
#X obj 46 242 output~;
#X obj 140 276 tabwrite~ \$0-sum;
#X obj 130 107 / 100;
#X floatatom 130 86 4 0 100 0 - - -;
#X obj 206 108 / 100;
#X floatatom 206 87 4 0 100 0 - - -;
#X obj 151 228 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1
1;
#X obj 151 250 metro 193;
#X obj 19 95 phasor~;
#X floatatom 19 74 5 0 0 0 - - -;
#X text 11 51 frequency;
#X text 126 50 SLOPES (percent);
#X obj 108 137 *~;
#X obj 19 129 *~ -1;
#X obj 19 154 +~ 1;
#X obj 184 156 *~;
#X obj 108 189 min~;
#X text 596 358 0.5;
#X text 593 477 -0.5;
#X text 30 6 Making waveforms with corners by specifying line segment
slopes;
#X text 136 67 up;
#X text 209 68 down;
#X text 29 317 Occasionally a second method for making corners is more
convenient. Here we specify the slopes of the rising and falling segments
(as always \, in units per cycle). We then make a triangle wave with
a corner at (0 \, 0) and another one \, placed somewhere within the
cycle. The slopes of the two lines determine the second point \, which
will have an x value of t/(s+t) (if we let s denote the rising slope
and t the falling one \, both as positive numbers). The y value is
st/(s+t). If we wish instead to specify the corner location (x \, y)
(with x in cycles \, 0<x<1) we set s = y/x and t = y/(1-x). The DC
value is y/2.;
#X floatatom 325 83 5 1 99 0 x - -;
#X obj 326 101 / 100;
#X floatatom 404 83 5 0 100 0 y - -;
#X obj 405 101 / 100;
#X obj 326 150 t b a;
#X floatatom 325 250 5 0 0 3 s - -;
#X floatatom 390 251 5 0 0 3 t - -;
#X obj 325 180 expr $f1 / $f2 \; $f1 / (1-$f2) \; $f1/2;
#X floatatom 455 252 5 0 0 3 DC - -;
#X msg 404 59 50;
#X obj 404 34 loadbang;
#X text 491 176 s=y/x;
#X text 490 195 t=y/(1-x);
#X text 481 216 DC=y/2;
#X connect 5 0 15 1;
#X connect 6 0 5 0;
#X connect 7 0 18 1;
#X connect 8 0 7 0;
#X connect 9 0 10 0;
#X connect 10 0 4 0;
#X connect 11 0 15 0;
#X connect 11 0 16 0;
#X connect 12 0 11 0;
#X connect 15 0 19 0;
#X connect 16 0 17 0;
#X connect 17 0 18 0;
#X connect 18 0 19 1;
#X connect 19 0 3 0;
#X connect 19 0 4 0;
#X connect 26 0 27 0;
#X connect 27 0 30 0;
#X connect 28 0 29 0;
#X connect 29 0 33 0;
#X connect 30 0 33 0;
#X connect 30 1 33 1;
#X connect 33 0 31 0;
#X connect 33 0 15 1;
#X connect 33 1 32 0;
#X connect 33 1 18 1;
#X connect 33 2 34 0;
#X connect 35 0 28 0;
#X connect 36 0 35 0;


More information about the Pd-list mailing list