[PD] waveform question

Lorenzo Sutton via Pd-list pd-list at lists.iem.at
Tue Jul 1 16:05:15 CEST 2014


On 28/06/2014 22:40, Jonathan Wilkes via Pd-list wrote:
> Hi list,
>       If I take a circle, cut it in half horizontally, then move the
> bottom half r*2 units to the right, what is the waveform that results?

You mean something like the attached?

Lorenzo.
-------------- next part --------------
#N canvas 303 92 701 532 10;
#X obj 26 76 until;
#X obj 26 21 t b b;
#X obj 26 110 f 0;
#X obj 63 110 + 1;
#X msg 94 74 0;
#X obj 26 136 t f f;
#X obj 25 -7 bng 15 250 50 0 empty empty empty 17 7 0 10 -4034 -1 -1
;
#X obj 320 13 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#N canvas 0 50 450 250 (subpatch) 0;
#X array osc_tab 4099 float 0;
#X coords 0 1 4098 -1 200 110 1 0 0;
#X restore 29 332 graph;
#N canvas 0 50 450 250 (subpatch) 0;
#X array circle_tab 4099 float 0;
#X coords 0 1 4098 -1 200 110 1 0 0;
#X restore 314 333 graph;
#X obj 26 49 f 4099;
#X obj 320 -15 loadbang;
#X obj 539 54 tabosc4~ array2;
#X obj 540 12 sig~ 220;
#X floatatom 540 -15 5 0 0 0 - - -, f 5;
#X obj 580 119 lop~ 10;
#X obj 580 89 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 540 141 *~;
#X obj 540 173 dac~;
#X obj 28 230 expr if($f1 > 0 \, sqrt($f1) \, -1 * sqrt(abs($f1)))
;
#X text 54 -7 <- click;
#X msg 143 40 \; osc_tab sinesum 4096 1;
#X msg 320 37 \; circle_tab resize 4099;
#X obj 28 271 tabwrite circle_tab;
#X obj 28 179 tabread osc_tab;
#X connect 0 0 2 0;
#X connect 1 0 10 0;
#X connect 1 1 4 0;
#X connect 2 0 3 0;
#X connect 2 0 5 0;
#X connect 3 0 2 1;
#X connect 4 0 2 1;
#X connect 5 0 24 0;
#X connect 5 1 23 1;
#X connect 6 0 1 0;
#X connect 7 0 21 0;
#X connect 7 0 22 0;
#X connect 10 0 0 0;
#X connect 11 0 7 0;
#X connect 12 0 17 0;
#X connect 13 0 12 0;
#X connect 14 0 13 0;
#X connect 15 0 17 1;
#X connect 16 0 15 0;
#X connect 17 0 18 0;
#X connect 17 0 18 1;
#X connect 19 0 23 0;
#X connect 24 0 19 0;
-------------- next part --------------
#N canvas 574 271 717 365 10;
#N canvas 0 50 450 250 (subpatch) 0;
#X array semi_circle 512 float 0;
#X coords 0 128 511 -128 200 110 1 0 0;
#X restore 488 -72 graph;
#X obj 22 13 until;
#X obj 22 49 f 0;
#X obj 62 48 + 1;
#X obj 21 -15 t f b;
#X msg 85 14 0;
#X obj 22 79 t f f;
#X msg 21 -42 512;
#X obj 22 117 - 128;
#X obj 23 160 expr if($f1 < 128 \, sqrt(16384 - (pow($f1 \, 2))) \,
-1 * sqrt(16384 - (pow($f1-256 \, 2))) );
#X text 127 79 this is actually only the firts semi-circle \; negative
semicircle is just * -1 (x shifted of -256 to do it all in one go..
;
#X text 165 -73 In this example the array is 512 points \; diameter
= 256 \; r = 128 \; r^2 = 16384 \; \; y = sqrt ( r^2 - x^2);
#X obj 23 204 tabwrite semi_circle;
#X text 56 -43 <- click;
#X connect 1 0 2 0;
#X connect 2 0 3 0;
#X connect 2 0 6 0;
#X connect 3 0 2 1;
#X connect 4 0 1 0;
#X connect 4 1 5 0;
#X connect 5 0 2 1;
#X connect 6 0 8 0;
#X connect 6 1 12 1;
#X connect 7 0 4 0;
#X connect 8 0 9 0;
#X connect 9 0 12 0;


More information about the Pd-list mailing list