aboutsummaryrefslogtreecommitdiff
path: root/shmem-help.pd
blob: 7999463f31202680a829ec7677584dd977ef36ff (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
#N canvas 120 82 1232 469 10;
#N canvas 1 89 450 300 (subpatch) 0;
#X array array2 100 float 3;
#A 0 -0.857141 -0.799998 -0.72857 -0.657141 -0.585713 -0.542856 -0.499999
-0.457142 -0.414285 -0.342856 -0.271428 -0.228571 -0.171428 -0.0857141
-0.0285714 0.0142857 0.0571427 0.0999998 0.171428 0.257142 0.314285
0.342856 0.371428 0.399999 0.414285 0.442856 0.457142 0.485713 0.514285
0.52857 0.542856 0.571427 0.585713 0.614284 0.657141 0.685713 0.714284
0.72857 0.742856 0.771427 0.771427 0.771427 0.785713 0.799998 0.799998
0.799998 0.799998 0.799998 0.799998 0.799998 0.799998 0.799998 0.799998
0.799998 0.799998 0.799998 0.785713 0.785713 0.77857 0.771427 0.757141
0.742856 0.72857 0.707141 0.685713 0.671427 0.657141 0.62857 0.607142
0.585713 0.542856 0.521427 0.499999 0.457142 0.428571 0.357142 0.242857
0.157143 0.0999998 0.0285714 -0.0285714 -0.0571427 -0.142857 -0.185714
-0.242857 -0.285714 -0.342856 -0.371428 -0.428571 -0.485713 -0.52857
-0.585713 -0.671427 -0.785713 -0.814284 -0.899998 -0.999998 -1.04285
-1.02857 -1.04285;
#X coords 0 1 99 -1 200 140 1;
#X restore 680 26 graph;
#X msg 53 288 memset 0 1 1 1 1 1;
#X text 185 282 write a list (or a float) to the shared memory : 1st
value is index \, other are data to store;
#X msg 22 223 memset 0 array1;
#N canvas 0 50 450 300 (subpatch) 0;
#X array array1 100 float 3;
#A 0 -0.87857 -0.864284 -0.849998 -0.835713 -0.835713 -0.807141 -0.792856
-0.77857 -0.749998 -0.749998 -0.735713 -0.707141 -0.692856 -0.67857
-0.664284 -0.649999 -0.621427 -0.592856 -0.592856 -0.564285 -0.549999
-0.535713 -0.521428 -0.492856 -0.47857 -0.464285 -0.449999 -0.435713
-0.421428 -0.407142 -0.378571 -0.349999 -0.349999 -0.335714 -0.307142
-0.307142 -0.278571 -0.278571 -0.264285 -0.235714 -0.221428 -0.207142
-0.192857 -0.178571 -0.15 -0.135714 -0.121428 -0.107143 -0.092857 -0.05
-0.0357143 -0.0214286 -0.0071429 0.0214285 0.0357141 0.0499998 0.0499998
0.0785712 0.0928569 0.121428 0.135714 0.164285 0.164285 0.192857 0.207142
0.235714 0.249999 0.264285 0.292856 0.307142 0.335714 0.349999 0.378571
0.392856 0.421428 0.435713 0.47857 0.492856 0.521427 0.549999 0.592856
0.592856 0.607141 0.635713 0.649999 0.664284 0.692856 0.707141 0.749998
0.749998 0.77857 0.807141 0.821427 0.849998 0.878569 0.878569 0.907141
0.907141 0.921427 0.964284;
#X coords 0 1 99 -1 200 140 1;
#X restore 475 26 graph;
#X text 136 223 set shared memory from index 0 with array1;
#X msg 38 245 memset 0 array1 50;
#X text 166 245 set shared memory from index 0 with array1 from index
50;
#X obj 22 405 shmem 1214 250;
#X text 132 405 1st argument : Identifiant of the memory segment;
#X text 21 15 shmem - shared memory manipulation;
#X text 22 37 The shmem object allow to use shared memory in Pd. It
is useful for example to exchange array between two instances of Pd.
Every shmem object can read and write to a shared memory segment that
is identified by its Id.;
#X text 21 95 When you create a shmem object \, it checks its Id. If
the id is not used \, it allows a new segment \, otherwise it address
the exisiting segment.;
#X floatatom 584 318 5 0 0 0 - - -;
#X obj 568 371 shmem 1214 250;
#X text 655 343 read one float of the table send value to the outlet
;
#X msg 568 252 memdump 0 array2;
#X text 567 214 READING MEMORY;
#X floatatom 568 395 5 0 0 0 - - -;
#X text 688 252 dump shared memory from index 0 to array2;
#X text 21 146 Work only on Linux / and Unix.;
#X text 132 421 2nd argument : size of the segment (number of float)
;
#X msg 584 343 memread \$1;
#X msg 76 365 memclear;
#X text 139 367 reset memory to 0;
#X text 475 168 array1 and array 2 are size 100;
#X msg 69 318 memset 50 5 5 5 1 1 0.1 0.2 0.3 0.4 0.5 0.6 0.7;
#X text 21 192 WRITING INTO MEMORY;
#X msg 578 274 memdump 0 array2 50;
#X text 698 274 dump shared memory from index 0 to array2 from index
50;
#X msg 588 294 memdump 0 array2 50 10;
#X text 738 294 dump shared memory from index 0 to array2 from index
50 to index 60 (50 + 10);
#X connect 1 0 8 0;
#X connect 3 0 8 0;
#X connect 6 0 8 0;
#X connect 13 0 22 0;
#X connect 14 0 18 0;
#X connect 16 0 14 0;
#X connect 22 0 14 0;
#X connect 23 0 8 0;
#X connect 26 0 8 0;
#X connect 28 0 14 0;
#X connect 30 0 14 0;