aboutsummaryrefslogtreecommitdiff
path: root/examples/16_name_and_interactors.pd
blob: 0818b9476718ea90b118ce5937c0a570bfbb83b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
#N canvas 30 91 877 678 12;
#X declare -lib Gem;
#X obj 9 18 t b b;
#X obj 9 -30 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
;
#X obj 158 -6 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X msg 238 46 0 \, destroy;
#X msg 204 21 reset \, create \, 1;
#N canvas 623 135 504 293 init 0;
#X obj 49 50 loadbang;
#X msg 44 84 Xmin -3.8;
#X msg 58 110 Xmax 3.8;
#X msg 81 131 Ymin -3.8;
#X msg 95 157 Ymax 3.8;
#X obj 47 201 s \$0-mass;
#X connect 0 0 1 0;
#X connect 0 0 2 0;
#X connect 0 0 3 0;
#X connect 0 0 4 0;
#X connect 1 0 5 0;
#X connect 2 0 5 0;
#X connect 3 0 5 0;
#X connect 4 0 5 0;
#X restore 401 -8 pd init;
#X obj 88 -11 loadbang;
#X msg 139 45 reset;
#X msg 113 69 resetL;
#X msg 88 93 resetF;
#X obj 88 18 t b b b;
#X obj 9 -9 metro 50;
#X obj 204 74 gemwin;
#X text 90 152 negative Y force (gravity);
#X text 86 266 positive Y force;
#X obj 23 498 gemhead;
#X obj 43 524 unpack s f f;
#X obj 42 551 translateXYZ 0 0 0;
#X obj 42 583 sphere 0.3;
#X obj 173 498 gemhead;
#X obj 193 524 unpack s f f;
#X obj 192 551 translateXYZ 0 0 0;
#X obj 192 583 sphere 0.3;
#X obj 330 499 gemhead;
#X obj 350 525 unpack s f f;
#X obj 349 552 translateXYZ 0 0 0;
#X obj 349 584 sphere 0.3;
#X obj 479 499 gemhead;
#X obj 499 525 unpack s f f;
#X obj 498 552 translateXYZ 0 0 0;
#X obj 498 584 sphere 0.3;
#X obj 628 499 gemhead;
#X obj 648 525 unpack s f f;
#X obj 647 552 translateXYZ 0 0 0;
#X obj 647 584 sphere 0.3;
#X obj 44 465 mass2D foo 1 -2 3;
#X obj 193 465 mass2D foo2 1 -1 3;
#X obj 350 465 mass2D foo3 1 0 3;
#X obj 499 465 mass2D foo4 1 1 3;
#X obj 648 465 mass2D foo 1 2 3;
#X obj 9 123 s mass;
#X obj 55 437 r mass;
#X obj 193 438 r mass;
#X obj 350 436 r mass;
#X obj 499 436 r mass;
#X obj 648 437 r mass;
#X obj 52 174 iAmbient2D foo 0 -0.1;
#X obj 63 201 iAmbient2D foo2 0 -0.1;
#X obj 76 227 iAmbient2D foo3 0 -0.1;
#X text 268 173 force is apply to mass named foo \, foo2 and foo3;
#X text 344 287 a positive forece is apply to foo2 \, and to foo3 (according
to pd link). this force allows mass 2 and 3 to stay at Y=0.;
#X obj 529 657 iAmbient2D;
#X obj 530 684 iLine2D;
#X obj 530 710 iSeg2D;
#X obj 530 737 iCircle2D;
#X msg 17 406 reset;
#X obj 17 379 sel 1;
#X obj 17 351 tSquare2D -4 4 -10000 -4;
#X text 260 345 tSquare is a test : test if the position of the mass
is in a specific square. This test is used to reset the mass to it's
initial state if the mass go out of the screen.;
#X obj 44 292 iSeg2D foo2 -3 0 3 0 3 0 0 0.5 1;
#X text 398 -34 This patch explain how interactors works;
#X text 283 195 but not to foo4 \, so it will not move.;
#X text 201 -10 <- reset;
#X text 348 50 interactor are design to be a kind of link beetween
masss and a simple object.;
#X text 347 85 interactors can be a link to all mass with the same
name. It's easier to patch than putting a link object for all link.
;
#X text 41 655 for more informations about interactors or test \, see
the help file :;
#X obj 623 683 tLine2D;
#X obj 623 709 tSeg2D;
#X obj 623 736 tCircle2D;
#X obj 622 656 tSquare2D;
#X text 356 20 <- 1 GEM window;
#X text 34 -37 <- 2 begin simulation;
#X obj 466 -8 declare -lib Gem;
#X connect 0 0 40 0;
#X connect 0 1 46 0;
#X connect 0 1 47 0;
#X connect 0 1 48 0;
#X connect 0 1 59 0;
#X connect 1 0 11 0;
#X connect 2 0 10 0;
#X connect 3 0 12 0;
#X connect 4 0 12 0;
#X connect 6 0 10 0;
#X connect 7 0 40 0;
#X connect 10 0 9 0;
#X connect 10 1 8 0;
#X connect 10 2 7 0;
#X connect 11 0 0 0;
#X connect 15 0 17 0;
#X connect 16 1 17 1;
#X connect 16 2 17 2;
#X connect 17 0 18 0;
#X connect 19 0 21 0;
#X connect 20 1 21 1;
#X connect 20 2 21 2;
#X connect 21 0 22 0;
#X connect 23 0 25 0;
#X connect 24 1 25 1;
#X connect 24 2 25 2;
#X connect 25 0 26 0;
#X connect 27 0 29 0;
#X connect 28 1 29 1;
#X connect 28 2 29 2;
#X connect 29 0 30 0;
#X connect 31 0 33 0;
#X connect 32 1 33 1;
#X connect 32 2 33 2;
#X connect 33 0 34 0;
#X connect 35 0 16 0;
#X connect 35 0 57 0;
#X connect 36 0 20 0;
#X connect 37 0 24 0;
#X connect 38 0 28 0;
#X connect 39 0 32 0;
#X connect 41 0 35 0;
#X connect 42 0 36 0;
#X connect 43 0 37 0;
#X connect 44 0 38 0;
#X connect 45 0 39 0;
#X connect 55 0 35 0;
#X connect 56 0 55 0;
#X connect 57 0 56 0;
#X connect 59 0 37 0;