aboutsummaryrefslogtreecommitdiff
path: root/doc/pddp/all_about_data_types.pd
blob: b0293e8808c17364f5a96ee1e4118ab53e9f8e19 (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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
#N canvas 246 35 862 651 10;
#X obj 453 446 route;
#X floatatom 93 115 5 0 0 1 "float" - -;
#X symbolatom 184 115 10 0 0 1 "symbol" - -;
#X obj 96 211 symbol;
#X symbolatom 96 258 0 0 0 0 - - -;
#X msg 105 235 word;
#X msg 96 193 test;
#X msg 79 171 symbol this;
#X text 170 170 set type directly;
#X text 144 236 does not work (check console messages);
#X floatatom 15 233 5 0 0 0 - - -;
#X msg 20 212 12;
#X msg 3 192 float 83;
#N canvas 770 126 490 340 Related_Objects 0;
#X obj 32 54 ftos;
#X obj 68 54 list2symbol;
#X text 23 22 data type conversion;
#X obj 155 55 tosymbol;
#X obj 219 55 fromsymbol;
#X obj 36 252 lister;
#X obj 34 98 atoi;
#X obj 30 138 list2int;
#X obj 94 137 l2i;
#X obj 96 163 a2l;
#X obj 29 164 any2list;
#X obj 158 138 list2symbol;
#X obj 158 159 symbol2list;
#X obj 247 138 l2s;
#X obj 247 158 s2l;
#X obj 123 252 list;
#X restore 467 591 pd Related_Objects;
#X text 427 232 Many objects cast the data they receive when they output
it:;
#X text 546 313 Some objects do not cast the data:;
#X obj 444 284 trigger anything;
#X msg 444 259 this is a list without a cast;
#X obj 444 307 print;
#X text 430 347 Some objects need to have the data explicitly declared
in order to handle it. These are mostly symbol handling objects.;
#X text 430 413 Objects which route data generally can handle explicitly
or implicitly defined data.;
#X obj 500 446 trigger;
#X obj 558 446 niagara;
#X obj 446 390 select;
#X obj -5 -2 cnv 15 850 20 empty empty all_about_data_types 20 10 1
18 -233017 -66577 0;
#X obj 811 -1 pddp;
#X text -9 291 "anything";
#X text -9 407 "list";
#X text -9 393 "float";
#X text -9 434 "symbol";
#X text -9 380 "bang";
#X msg 91 339 anything 1 two three;
#X msg 242 339 one 2 3;
#X obj 147 422 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 151 396 t a b f l p s;
#X obj 181 423 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X msg 244 373 list one 2 3;
#X msg 283 403 1 2 3;
#X text -3 35 atoms (basic data types):;
#X text -3 60 The basic data types are known as 'atoms' in Pd. "float"
and "symbol" atoms have 'atom boxes' for realtime display and control
from within a patch. "pointer" atoms are used for accessing data stored
in graphical data structures.;
#X obj 441 184 int;
#X obj 449 164 / 5.23;
#X floatatom 449 136 5 0 0 0 - - -;
#X floatatom 482 204 5 0 0 0 - - -;
#X floatatom 441 204 5 0 0 0 - - -;
#X obj 531 134 tosymbol;
#X obj 595 135 fromsymbol;
#X obj 678 134 list2symbol;
#X obj 682 176 ftos;
#X obj 637 43 symbol;
#X obj 600 87 int;
#X obj 719 43 pointer;
#X obj 460 87 bang;
#X obj 498 88 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 519 43 float;
#X text 1 527 There a number of objects which are used for storing
messages \, or casting messages as a specific data type \, sometimes
converting from one data type to another. The right inlet on these
objects is stores that value \, which can be later output using a bang.
;
#X obj 628 87 lister;
#X text 560 44 aka;
#X obj 586 43 f;
#X text 22 613 (C) Copyright 2004 Hans-Christoph Steiner <hans@at.or.at>
;
#X text 239 627 released under the GNU GPL;
#X text 435 614 $Revision: 1.5 $$Date: 2005-07-28 19:45:58 $;
#X text 436 627 $Author: eighthave $;
#X obj 490 518 pddp_open all_about_lists_vs_anythings;
#X obj 490 539 pddp_open all_about_symbol_construction;
#X obj 490 560 pddp_open all_about_data_structures;
#X text 515 88 (aka [bng]);
#X text 3 304 "anything" allows anything to pass through unchanged.
It is not a data type tho.;
#X text -6 143 "symbols" need to be declared explicitly. "floats" do
not need to be declared explicitly \, but can be:;
#X text 153 212 casting as a "symbol";
#X text 1 509 CASTING AND STORAGE OBJECTS;
#X text 431 474 FOR MORE INFO:;
#X text 430 114 EXAMPLES OF CASTING;
#X text 425 43 atom objects:;
#X text 432 65 other data types:;
#X text -9 420 "pointer";
#X obj 24 460 trigger anything bang float list pointer symbol;
#X obj 24 480 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 88 480 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 152 479 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 218 480 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 283 479 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 348 480 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X text 193 35 "float" \, "symbol" \, "pointer";
#N canvas 0 22 505 381 float/list 0;
#X msg 75 133 float 1 2 3;
#X text 34 22 FLOAT CONVERSION;
#X msg 95 187 list 1 2 3;
#X text 92 164 A list with multiple elements remains a list.;
#X text 43 59 A float with one element remains a float.;
#X text 72 106 A float with multiple elements remains a float but is
cut to one element.;
#X text 99 218 A list with one float element is converted to a float.
;
#X obj 58 308 bng 15 250 50 0 empty empty bang 0 20 1 9 -262144 -1
-1;
#X obj 105 308 bng 15 250 50 0 empty empty float 0 21 1 9 -262144 -1
-1;
#X obj 152 308 bng 15 250 50 0 empty empty symbol 0 21 1 9 -262144
-1 -1;
#X obj 200 308 bng 15 250 50 0 empty empty list 0 21 1 9 -262144 -1
-1;
#X obj 248 308 bng 15 250 50 0 empty empty UNDEFINED 0 21 1 9 -262144
-1 -1;
#X obj 57 286 route bang float symbol list;
#X obj 92 349 print FLOAT;
#X msg 50 81 float 3;
#X msg 106 239 list 2;
#X obj 188 349 print LIST;
#X connect 0 0 12 0;
#X connect 2 0 12 0;
#X connect 12 0 7 0;
#X connect 12 1 8 0;
#X connect 12 1 13 0;
#X connect 12 2 9 0;
#X connect 12 3 10 0;
#X connect 12 3 16 0;
#X connect 12 4 11 0;
#X connect 14 0 12 0;
#X connect 15 0 12 0;
#X restore 465 493 pd float/list conversion;
#N canvas 0 22 479 361 empty 0;
#X obj 78 268 bng 15 250 50 0 empty empty bang 0 20 1 9 -262144 -1
-1;
#X obj 125 268 bng 15 250 50 0 empty empty float 0 21 1 9 -262144 -1
-1;
#X obj 172 268 bng 15 250 50 0 empty empty symbol 0 21 1 9 -262144
-1 -1;
#X obj 220 268 bng 15 250 50 0 empty empty list 0 21 1 9 -262144 -1
-1;
#X obj 268 268 bng 15 250 50 0 empty empty UNDEFINED 0 21 1 9 -262144
-1 -1;
#X msg 127 205 list;
#X msg 50 75 float;
#X msg 97 134 symbol;
#X text 31 21 EMPTY DATA TYPES;
#X obj 77 246 route bang float symbol list;
#X obj 73 326 print FLOAT;
#X obj 155 326 print SYMBOL;
#X text 120 184 An empty list is converted to a bang;
#X text 85 114 An empty "symbol" remains a empty "symbol".;
#X text 46 55 An empty "float" remains a "float" and is initialized
to 0;
#X connect 5 0 9 0;
#X connect 6 0 9 0;
#X connect 7 0 9 0;
#X connect 9 0 0 0;
#X connect 9 1 1 0;
#X connect 9 1 10 0;
#X connect 9 2 2 0;
#X connect 9 2 11 0;
#X connect 9 3 3 0;
#X connect 9 4 4 0;
#X restore 656 493 pd empty data types;
#X text 635 597 updated for Pd version 0.38.4;
#X connect 3 0 4 0;
#X connect 5 0 4 0;
#X connect 6 0 3 0;
#X connect 7 0 4 0;
#X connect 11 0 10 0;
#X connect 12 0 10 0;
#X connect 16 0 18 0;
#X connect 17 0 16 0;
#X connect 31 0 34 0;
#X connect 32 0 34 0;
#X connect 34 0 33 0;
#X connect 34 3 35 0;
#X connect 36 0 34 0;
#X connect 37 0 34 0;
#X connect 40 0 44 0;
#X connect 41 0 40 0;
#X connect 41 0 43 0;
#X connect 42 0 41 0;
#X connect 76 0 77 0;
#X connect 76 1 78 0;
#X connect 76 2 79 0;
#X connect 76 3 80 0;
#X connect 76 4 81 0;
#X connect 76 5 82 0;