ok, I'll have deeper look at this after your workshop. I want to be able to take a mass and keep it with the mouse.
by the way, i'm working on a new pmpd version including one new object that could help data structure integration in pmpd patch.
well, i'll comit it as soon as I have time...
thanks Cyrille
Frank Barknecht wrote:
Hallo, cyrille henry hat gesagt: // cyrille henry wrote:
next step would be to get position from the data structure and not from the masses : to be able to move all points.
when bang masses : masses position ->link when bang link : link -> masses -> data structure.
when move data structure : data stucture -> masse
I tried this, but I got some kind of feedback and the string went out of its mind. I then connected the data structure positional output to the lia instead, and this works now: You can "pluck" the string in attached version.
Ciao
#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 7.11113 80.2654 ; -11.8937 ; 5.54465 ; 7.02002 ; 15.0479 ; 3.01626 ; 1.48379 ; 4.19993 ; ;; #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 0 1; #X obj 397 253 vsl 15 128 0 127 0 0 empty empty empty 0 -8 0 8 -262144 -1 -1 554 1; #X obj 415 253 vsl 15 128 0 127 0 0 empty empty empty 0 -8 0 8 -262144 -1 -1 702 1; #X obj 433 253 vsl 15 128 0 127 0 0 empty empty empty 0 -8 0 8 -262144 -1 -1 1505 1; #X obj 451 253 vsl 15 128 0 127 0 0 empty empty empty 0 -8 0 8 -262144 -1 -1 302 1; #X obj 469 253 vsl 15 128 0 127 0 0 empty empty empty 0 -8 0 8 -262144 -1 -1 148 1; #X obj 361 253 vsl 15 128 0 127 0 0 empty empty empty 0 -8 0 8 -262144 -1 -1 7700 1; #X obj 9 10 loadbang; #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 255 1; #X obj 505 253 vsl 15 128 0 127 0 0 empty empty empty 0 -8 0 8 -262144 -1 -1 0 1; #X obj 56 91 s $0-link; #X obj 29 115 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 320 174 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 154 150 masse $0-mass 30; #X obj 295 196 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 221 235 pmpd-setter 1; #X obj 278 267 r $0-mass; #X obj 25 175 pmpd-setter 0; #X obj 447 222 pmpd-setter 2; #X obj 588 259 pmpd-setter 3; #X obj 737 264 pmpd-setter 4; #X obj 901 274 pmpd-setter 5; #X obj 1045 147 pmpd-setter 6; #X obj 9 62 t b b; #X obj 1001 227 r $0-mass; #X obj 1131 96 r $0-mass; #X obj 52 149 r $0-mass; #X obj 826 236 r $0-mass; #X obj 670 237 r $0-mass; #X obj 528 247 r $0-mass; #X connect 4 0 39 0; #X connect 5 0 43 0; #X connect 6 0 47 0; #X connect 7 0 51 0; #X connect 8 0 55 0; #X connect 9 0 59 0; #X connect 10 0 77 0; #X connect 11 0 71 0; #X connect 16 0 63 0; #X connect 17 0 82 0; #X connect 22 1 30 0; #X connect 23 0 30 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 30 0 4 0; #X connect 30 0 22 1; #X connect 30 0 23 0; #X connect 31 0 5 0; #X connect 31 0 23 1; #X connect 31 0 24 0; #X connect 31 0 75 0; #X connect 32 0 6 0; #X connect 32 0 24 1; #X connect 32 0 25 0; #X connect 32 0 78 0; #X connect 33 0 7 0; #X connect 33 0 25 1; #X connect 33 0 26 0; #X connect 33 0 79 0; #X connect 34 0 8 0; #X connect 34 0 26 1; #X connect 34 0 27 0; #X connect 34 0 80 0; #X connect 35 0 9 0; #X connect 35 0 27 1; #X connect 35 0 28 0; #X connect 35 0 81 0; #X connect 36 0 16 0; #X connect 36 0 28 1; #X connect 36 0 29 0; #X connect 39 0 41 0; #X connect 40 0 42 0; #X connect 41 0 40 0; #X connect 42 0 68 0; #X connect 43 0 45 0; #X connect 44 0 46 0; #X connect 45 0 44 0; #X connect 46 0 68 0; #X connect 47 0 49 0; #X connect 48 0 50 0; #X connect 49 0 48 0; #X connect 50 0 68 0; #X connect 50 0 69 0; #X connect 51 0 53 0; #X connect 52 0 54 0; #X connect 53 0 52 0; #X connect 54 0 68 0; #X connect 54 0 69 0; #X connect 55 0 57 0; #X connect 56 0 58 0; #X connect 57 0 56 0; #X connect 58 0 68 0; #X connect 58 0 69 0; #X connect 59 0 61 0; #X connect 60 0 62 0; #X connect 61 0 60 0; #X connect 62 0 69 0; #X connect 63 0 65 0; #X connect 64 0 66 0; #X connect 65 0 64 0; #X connect 66 0 69 0; #X connect 68 0 67 0; #X connect 69 0 67 1; #X connect 70 0 71 0; #X connect 71 0 83 0; #X connect 72 0 71 0; #X connect 73 0 71 1; #X connect 74 0 71 1; #X connect 75 0 24 0; #X connect 76 0 75 1; #X connect 77 0 22 0; #X connect 78 0 25 0; #X connect 79 0 26 0; #X connect 80 0 27 0; #X connect 81 0 28 0; #X connect 82 0 36 0; #X connect 83 0 19 0; #X connect 83 1 18 0; #X connect 84 0 81 1; #X connect 85 0 82 1; #X connect 86 0 77 1; #X connect 87 0 80 1; #X connect 88 0 79 1; #X connect 89 0 78 1;
#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 30 222 set mass y; #X obj 92 113 float $1; #X obj 19 31 inlet; #X obj 141 225 get mass y; #X obj 142 272 outlet; #X obj 151 21 inlet; #X obj 136 57 t b b; #X obj 141 192 pointer; #X obj 24 67 t f b; #X obj 88 172 t p p; #X connect 0 0 12 0; #X connect 1 0 2 0; #X connect 2 0 0 1; #X connect 4 0 0 0; #X connect 5 0 11 0; #X connect 6 0 7 0; #X connect 8 0 9 0; #X connect 9 0 4 0; #X connect 9 1 1 0; #X connect 10 0 6 0; #X connect 11 0 3 0; #X connect 11 1 9 0; #X connect 12 0 10 0; #X connect 12 1 3 1;