# [PD] Yves' Grid and GoP problems

Frank Barknecht fbar at footils.org
Mon Sep 20 17:16:28 CEST 2004

```Hallo,
cyrille henry hat gesagt: // cyrille henry wrote:

> i made a litle try with canvas (you can see it on the 00_pmpd exemple) :

I had a big laugh when I saw that one for the first time. ;)

> the problem was that position was integer and not float, numerical
> imprecision where to important.

Data structures also only handle ints (pixel coordinates) but with
graph on parent you can actually scale the whole picture, so you at
least get the impression, that it's more precise. But then, compared
to Gem the framerate just sucks.

I attached a little pmpd variation to whet your appetite. ;)

Ciao
--
Frank Barknecht                               _ ______footils.org__
-------------- next part --------------
#N canvas 653 526 450 300 10;
#X obj 88 150 element masses m;
#X msg 180 70 traverse pd-paint \, next;
#X obj 181 105 pointer masses;
#X obj 38 194 set mass y;
#X obj 92 113 float \\$1;
#X obj 23 39 inlet;
#X obj 20 61 t f b b;
#X obj 132 198 get mass y;
#X obj 133 227 outlet;
#X obj 167 29 inlet;
#X connect 0 0 3 1;
#X connect 0 0 7 0;
#X connect 1 0 2 0;
#X connect 2 0 0 1;
#X connect 4 0 0 0;
#X connect 5 0 6 0;
#X connect 6 0 3 0;
#X connect 6 1 4 0;
#X connect 6 2 1 0;
#X connect 7 0 8 0;
#X connect 9 0 4 0;
-------------- next part --------------
#N struct masses float x float y array m mass;
#N struct mass float y;
#N canvas 0 0 1242 685 10;
#N canvas 205 651 450 300 paint 0;
#X scalar masses 9.77799 73.2655 \; -4.89997 \; 9.944 \; 15.9104 \;
19.0256 \; 17.6491 \; 10.8315 \; -15.7999 \; \;;
#X coords 0 140 200 0 400 200 1;
#X restore 315 479 pd paint;
#N canvas 280 284 450 300 mass 0;
#X obj 130 90 struct mass float y;
#X restore 132 580 pd mass;
#N canvas 234 220 450 300 masses 0;
#X obj 73 78 struct masses float x float y array m mass;
#X obj 80 165 plot curve m 20 5 0 0 30;
#X restore 132 609 pd masses;
#N canvas 587 472 450 300 build 0;
#X obj 36 115 setsize masses m;
#X msg 111 17 200;
#X msg 230 18 bang;
#X obj 121 74 x-append pd-paint masses;
#X msg 295 47 \; pd-paint clear;
#X msg 35 73 7;
#X connect 1 0 3 0;
#X connect 2 0 3 1;
#X connect 3 0 0 1;
#X connect 5 0 0 0;
#X restore 132 554 pd build;
#X obj 379 253 vsl 15 128 0 127 0 0 empty empty empty 0 -8 0 8 -262144
-1 -1 274 1;
#X obj 397 253 vsl 15 128 0 127 0 0 empty empty empty 0 -8 0 8 -262144
-1 -1 994 1;
#X obj 415 253 vsl 15 128 0 127 0 0 empty empty empty 0 -8 0 8 -262144
-1 -1 1591 1;
#X obj 433 253 vsl 15 128 0 127 0 0 empty empty empty 0 -8 0 8 -262144
-1 -1 1903 1;
#X obj 451 253 vsl 15 128 0 127 0 0 empty empty empty 0 -8 0 8 -262144
-1 -1 1765 1;
#X obj 469 253 vsl 15 128 0 127 0 0 empty empty empty 0 -8 0 8 -262144
-1 -1 1083 1;
#X obj 361 253 vsl 15 128 0 127 0 0 empty empty empty 0 -8 0 8 -262144
-1 -1 3200 1;
#X text 138 362 move the first slider ->;
#X text 570 368 <- or the last one;
#X text 268 11 This is the first exemple of physical modeling;
#X text 268 33 this is an elastic string;
#X obj 487 253 vsl 15 128 0 127 0 0 empty empty empty 0 -8 0 8 -262144
-1 -1 0 1;
#X obj 505 253 vsl 15 128 0 127 0 0 empty empty empty 0 -8 0 8 -262144
-1 -1 1000 1;
#X obj 9 62 t b b;
#X obj 44 87 s \\$0-link;
#X obj 9 113 s \\$0-mass;
#X text 158 95 <- metronome send bangs to mass and link and gives the
general computation speed;
#X text 135 409 all the slider are "link" together with a link. slider
got a mass so they have inertial.;
#X obj 3 196 lia \\$0-link 0 1 1;
#X obj 151 196 lia \\$0-link 0 1 1;
#X obj 300 196 lia \\$0-link 0 1 1;
#X obj 449 196 lia \\$0-link 0 1 1;
#X obj 599 196 lia \\$0-link 0 1 1;
#X obj 747 196 lia \\$0-link 0 1 1;
#X obj 896 196 lia \\$0-link 0 1 1;
#X obj 1045 196 lia \\$0-link 0 1 1;
#X obj 146 172 masse \\$0-mass 30;
#X obj 294 171 masse \\$0-mass 30;
#X obj 444 172 masse \\$0-mass 30;
#X obj 595 172 masse \\$0-mass 30;
#X obj 743 171 masse \\$0-mass 30;
#X obj 894 171 masse \\$0-mass 30;
#X obj 1041 171 masse \\$0-mass 30;
#X text 137 443 You can see the propagation of a wave \, and physical
properties of a kind of elastic string.;
#X text 160 132 masses and link has to be compute one after the other.
;
#X obj 749 384 mtof;
#X obj 749 433 line;
#X msg 749 409 \\$1 15;
#X obj 749 458 osc~;
#X obj 805 384 mtof;
#X obj 805 433 line;
#X msg 805 409 \\$1 15;
#X obj 805 458 osc~;
#X obj 860 384 mtof;
#X obj 860 433 line;
#X msg 860 409 \\$1 15;
#X obj 860 458 osc~;
#X obj 916 383 mtof;
#X obj 916 432 line;
#X msg 916 408 \\$1 15;
#X obj 916 457 osc~;
#X obj 972 382 mtof;
#X obj 972 431 line;
#X msg 972 407 \\$1 15;
#X obj 972 456 osc~;
#X obj 1027 382 mtof;
#X obj 1027 431 line;
#X msg 1027 407 \\$1 15;
#X obj 1027 456 osc~;
#X obj 1083 382 mtof;
#X obj 1083 431 line;
#X msg 1083 407 \\$1 15;
#X obj 1083 456 osc~;
#X obj 880 534 dac~;
#X obj 880 510 *~ 0.1;
#X obj 933 510 *~ 0.1;
#X msg 96 7 1;
#X obj 9 35 metro 100;
#X msg 122 7 0;
#X msg 90 38 10;
#X msg 124 36 100;
#X obj 25 175 pmpd-setter 0;
#X obj 251 229 pmpd-setter 1;
#X obj 437 215 pmpd-setter 2;
#X obj 597 217 pmpd-setter 3;
#X obj 740 215 pmpd-setter 4;
#X obj 883 229 pmpd-setter 5;
#X obj 1045 147 pmpd-setter 6;
#X obj 52 149 r \\$0-link;
#X obj 1133 126 r \\$0-link;
#X connect 4 0 40 0;
#X connect 5 0 44 0;
#X connect 6 0 48 0;
#X connect 7 0 52 0;
#X connect 8 0 56 0;
#X connect 9 0 60 0;
#X connect 10 0 76 0;
#X connect 11 0 72 0;
#X connect 16 0 64 0;
#X connect 17 0 82 0;
#X connect 18 0 20 0;
#X connect 18 1 19 0;
#X connect 23 1 31 0;
#X connect 24 0 31 0;
#X connect 24 1 32 0;
#X connect 25 0 32 0;
#X connect 25 1 33 0;
#X connect 26 0 33 0;
#X connect 26 1 34 0;
#X connect 27 0 34 0;
#X connect 27 1 35 0;
#X connect 28 0 35 0;
#X connect 28 1 36 0;
#X connect 29 0 36 0;
#X connect 29 1 37 0;
#X connect 30 0 37 0;
#X connect 31 0 4 0;
#X connect 31 0 23 1;
#X connect 31 0 24 0;
#X connect 32 0 5 0;
#X connect 32 0 24 1;
#X connect 32 0 25 0;
#X connect 32 0 77 0;
#X connect 33 0 6 0;
#X connect 33 0 25 1;
#X connect 33 0 26 0;
#X connect 33 0 78 0;
#X connect 34 0 7 0;
#X connect 34 0 26 1;
#X connect 34 0 27 0;
#X connect 34 0 79 0;
#X connect 35 0 8 0;
#X connect 35 0 27 1;
#X connect 35 0 28 0;
#X connect 35 0 80 0;
#X connect 36 0 9 0;
#X connect 36 0 28 1;
#X connect 36 0 29 0;
#X connect 36 0 81 0;
#X connect 37 0 16 0;
#X connect 37 0 29 1;
#X connect 37 0 30 0;
#X connect 40 0 42 0;
#X connect 41 0 43 0;
#X connect 42 0 41 0;
#X connect 43 0 69 0;
#X connect 44 0 46 0;
#X connect 45 0 47 0;
#X connect 46 0 45 0;
#X connect 47 0 69 0;
#X connect 48 0 50 0;
#X connect 49 0 51 0;
#X connect 50 0 49 0;
#X connect 51 0 69 0;
#X connect 51 0 70 0;
#X connect 52 0 54 0;
#X connect 53 0 55 0;
#X connect 54 0 53 0;
#X connect 55 0 69 0;
#X connect 55 0 70 0;
#X connect 56 0 58 0;
#X connect 57 0 59 0;
#X connect 58 0 57 0;
#X connect 59 0 69 0;
#X connect 59 0 70 0;
#X connect 60 0 62 0;
#X connect 61 0 63 0;
#X connect 62 0 61 0;
#X connect 63 0 70 0;
#X connect 64 0 66 0;
#X connect 65 0 67 0;
#X connect 66 0 65 0;
#X connect 67 0 70 0;
#X connect 69 0 68 0;
#X connect 70 0 68 1;
#X connect 71 0 72 0;
#X connect 72 0 18 0;
#X connect 73 0 72 0;
#X connect 74 0 72 1;
#X connect 75 0 72 1;
#X connect 76 0 23 0;
#X connect 82 0 30 1;
#X connect 83 0 76 1;
#X connect 84 0 82 1;
```