aboutsummaryrefslogtreecommitdiff
path: root/doc/pddp/all_about_arrays.pd
diff options
context:
space:
mode:
authorJonathan Wilkes <jancsika1@users.sourceforge.net>2010-08-25 00:12:22 +0000
committerJonathan Wilkes <jancsika1@users.sourceforge.net>2010-08-25 00:12:22 +0000
commit2f615ffbf13571a928856b8207d1ea215e857e3f (patch)
treefba96137a8474e9dce1555095a52990d5cece732 /doc/pddp/all_about_arrays.pd
parentb98e2bc00355aae29d3e67ca41eda8cedfe0100d (diff)
Revised and added to all_about help patches
svn path=/trunk/; revision=13941
Diffstat (limited to 'doc/pddp/all_about_arrays.pd')
-rw-r--r--doc/pddp/all_about_arrays.pd920
1 files changed, 514 insertions, 406 deletions
diff --git a/doc/pddp/all_about_arrays.pd b/doc/pddp/all_about_arrays.pd
index d44033cb..e4892920 100644
--- a/doc/pddp/all_about_arrays.pd
+++ b/doc/pddp/all_about_arrays.pd
@@ -1,158 +1,340 @@
-#N canvas 299 68 516 572 10;
-#N canvas 132 22 591 609 What_is_an_array_in_PD 0;
-#X text 27 17 WHAT IS AN ARRAY IN PURE DATA?;
-#X text 45 42 Arrays \, in most programming environments \, are considered
+#N struct ds-array-ex float x float y array circles circle;
+#N struct circle float y symbol a;
+#N canvas 0 0 448 312 10;
+#N canvas 12 67 428 377 Common_uses_for_arrays_in_PD 0;
+#X text 20 37 Arrays are versatile. Their simple structure make them
+useful in countless situations. This page discusses perhaps the most
+common applications.;
+#X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 20 10
+1 18 -261106 -33289 0;
+#X text 7 1 Common Uses for Arrays in Pd;
+#X text 20 81 1) Audio sample data: when an array's values are limited
+to a range between -1 and 1 \, the numbers are suitable for conversion
+to analog audio signal. These arrays are typically many thousands of
+elements and stored on hard disk in the form of aiff \, wav or pure
+text.;
+#X text 20 149 2) MIDI Sequencers: array values limited to a range
+between 0 and 127 are suitable for MIDI output to be used as pitch
+\, velocity \, or controller numbers. Some MIDI information requires
+a much larger range \, such as pitch benders.;
+#X text 20 207 3) Envelopes: an array with four elements can be used
+effectively as an ADSR enveloper. There are numerous examples of this
+in other Pd help documents.;
+#X text 20 253 4) Math and conversion tables: arrays are an excellent
+visual tool when performing Fourier analysis and other higher mathematic
+functions.;
+#X text 20 300 5) Wave editing: with proper manipulation of array data
+\, Pd can be a fully functional wave editor \, complete with mouse-clickable
+cut-n-paste \, pitch-shift \, time expansion \, down/upsampling \,
+and other tools typically found in commercial wave editors.;
+#X restore 43 135 pd Common_uses_for_arrays_in_PD;
+#X text 40 180 This document is meant to supplement the help documentation
+for [table] \, [tabread] \, [tabwrite] \, [soundfiler] \, [tabsend~]
+\, [tabreceive~] \, [tabplay~] \, etc.;
+#X obj 1 1 cnv 15 445 20 empty \$0-pddp.cnv.header arrays 20 10 1 18
+-261106 -33289 0;
+#X obj 407 2 pddp/pddplink http://puredata.info/dev/pddp -text pddp
+;
+#X obj 1 290 cnv 15 445 20 empty \$0-pddp.cnv.footer empty 20 12 0
+14 -233017 -33289 0;
+#N canvas 44 246 494 284 META 0;
+#X text 12 95 LIBRARY PDDP;
+#X text 12 115 HELP_PATCH_AUTHORS Updated for Pd 0.38-2. Jonathan Wilkes
+revised the patch to conform to the PDDP template for Pd version 0.42.
+;
+#X text 12 5 GENRE all_about_pd;
+#X text 12 45 KEYWORDS array storage;
+#X text 12 25 NAME table struct;
+#X text 12 65 DESCRIPTION description of arrays and related objects
+for creating and managing them;
+#X restore 392 292 pd META;
+#N canvas 13 162 428 183 Related_objects 0;
+#X obj 22 41 struct;
+#X obj 76 41 plot;
+#X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 3 12 0
+14 -261106 -33289 0;
+#X text 7 2 Arrays- Related Objects;
+#X obj 121 41 list;
+#X obj 20 120 pddplink all_about_expr_functions.pd;
+#X text 20 76 The [expr] family objects have some limited functionality
+for dealing with arrays. See heading "Array/Table Functions" in:;
+#X restore 103 292 pd Related_objects;
+#X obj 6 292 pddp/pddplink pddp/help.pd -text help;
+#N canvas 14 48 428 287 What_is_an_array_in_PD 0;
+#X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 20 10
+1 18 -261106 -33289 0;
+#X text 7 1 What is an Array in Pure Data?;
+#X text 19 36 Arrays \, in most programming environments \, are considered
to be "a sequence of objects all of which have the same variable type"
wherein each object is called an element and the elements are numbered
-in a row 0 \, 1 \, 2 \, 3 \, etc. These numbers are called indices.
+in a row: 0 \, 1 \, 2 \, 3 \, etc. These numbers are called indices.
Each index holds a corresponding value.;
-#X text 46 222 Arrays in Pd look like this:;
-#N canvas 0 22 450 300 graph18 0;
-#X array example_array 100 float 0;
-#X coords 0 1 99 -1 200 140 1;
-#X restore 277 225 graph;
-#X text 63 486 1 Right-click on the array and select "Properties" from
-the menu. Two dialogue boxes will open - one called "graph" and one
-called "array".;
-#X text 64 543 2 Then right-click again on the array and select "Help"
-from the menu. The window that opens is the table.pd help document.
+#X text 19 119 All of this is true in Pd \, although the word "array"
+is often used loosely to refer to three different concepts:;
+#X text 19 228 3) an array defined (and possibly represented graphically)
+as part of a data structure.;
+#X text 19 146 1) an array as defined above.;
+#X text 19 161 2) a graphical representation of an array \, or "garray"
+\, created by:;
+#X text 37 186 a) choosing "Array" from the "Put" menu \, or;
+#X text 37 201 b) creating a [table] object (in which case it's hidden
+inside a subpatch).;
+#X restore 43 42 pd What_is_an_array_in_PD;
+#N canvas 0 0 428 403 The_Put_menu_array 0;
+#N canvas 0 0 450 300 (subpatch) 0;
+#X array \$0-pddp-garray-ex1 100 float 2;
+#X coords 0 1 99 -1 200 140 1 0 0;
+#X restore 22 73 graph;
+#X text 233 149 the black line to change;
+#X text 227 134 (You can click-drag the;
+#X text 233 164 the values of the array);
+#X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 20 10
+1 18 -261106 -33289 0;
+#X text 19 331 An explanation of how to create a "Put" menu garray
+\, as well as what all the properties mean \, is outlined below:;
+#X text 7 1 The Put Menu Graphical Array;
+#X text 19 288 Right-click on the graph and select "Properties" from
+the menu. Two dialogue boxes will open-- one for the graph (titled
+"canvas") and one for the array (titled "array").;
+#X text 19 37 Below is a graphical array created with the "Put" menu:
+;
+#X text 19 222 The array above is actually only the horizontal line!
+The rectangle surrounding it is called a "graph". By default \, Pd
+automatically creates a new graph to house a garray when you choose
+"Array" from the "Put" menu \, although you can put several arrays
+in one graph. (See subpatch below.);
+#N canvas 4 71 428 439 How_to_create_a_Put_menu_array 0;
+#X text 19 272 4) If you want Pd to create a new graph for this array
+\, then select "in new graph". If you have another location in mind
+-- for example if you want to overlap two arrays in a single graph
+\, then select "in last graph".;
+#X text 19 366 6) Note: if you do not want to see the graph in this
+window \, then you can use the [table] object instead...the array will
+then be created inside the [table] object and will be seen only if
+you manually open the table.;
+#X text 19 178 3) The "Save contents" checkbox will inform Pure Data
+that you want the array saved within the source code of this patch.
+This way \, you can ensure that the array will maintain its values
+each time you open this patch. This is recommended only for relatively
+small arrays-- larger arrays should be saved to either a text file
+\, or an audio file.;
+#X text 19 330 5) Click "OK" and place the new array anywhere in this
+window.;
+#X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 20 10
+1 18 -261106 -33289 0;
+#X text 7 1 How to Create a Garray in PD;
+#X text 20 37 1) In a new/existing patch window \, select "Array" from
+the "Put" menu.;
+#X text 20 72 2) A dialogue window will pop up \; type a name for the
+array and the desired size. If you want a localized array \, then name
+it something like \$0-dave (the "\$0" indicates that part of the name
+is a variable which is unique to this patch). The size of the array
+can be anything greater than 0 (zero). At a sample rate of 441000 khz
+\, an array of 882000 will provide you with 2 seconds of audio data.
;
-#X text 45 148 All of this is true in Pd \, except that arrays in Pd
-can only hold floating point data. (other data types in Pd are called
-"lists" or "anythings" and require different tools to manipulate them.)
+#X restore 22 366 pd How_to_create_a_Put_menu_array;
+#X restore 63 64 pd The_Put_menu_array;
+#N canvas 0 0 428 388 The_[table]_object 0;
+#X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 20 10
+1 18 -261106 -33289 0;
+#X text 7 1 The [table] object;
+#X text 19 37 The [table] object is another way to create a graphical
+array.;
+#X obj 22 73 table myTable;
+#X text 19 96 If you click the [table] object in runmode you can see
+it's just a subcanvas \, inside which is a graph containing an array.
;
-#X text 45 378 The array above is actually only the horizontal line!
-The rectangle surrounding the array is called a "graph". These two
-objects are separate \, but Pd creates both simoultaneously for purposes
-of convenience. These two objects together are called a "table". To
-see what I mean by all of this:;
-#X restore 43 42 pd What_is_an_array_in_PD;
-#N canvas 148 160 612 619 How_to_manipulate_arrays_in_PD 0;
-#X text 13 5 HOW TO MANIPULATE ARRAYS IN Pd;
-#N canvas 0 22 452 302 graph28 0;
-#X array exampleArray 67 float 0;
-#X coords 0 2 67 -2 200 140 1;
-#X restore 369 451 graph;
-#N canvas 2 29 722 269 Setting_the_size_of_an_array 0;
-#X msg 44 88 \; exampleArray resize \$1;
-#X floatatom 44 66 5 0 0 0 - - -;
-#X text 16 18 1 The size of an array can be set using the array's dialogue
-box. Or with a [send] message like below.;
-#X text 15 65 2;
-#X text 231 91 same as;
-#X floatatom 305 66 5 0 0 0 - - -;
-#X obj 305 114 s exampleArray;
-#X msg 305 88 resize \$1;
-#X text 19 158 Note that new elements always have a default value of
-zero when you make an array larger. Also note that if you make arrays
+#X text 19 209 * when using the [table] object \, you can't save any
+changes you make to the properites of the garray \, graph \, or the
+[table] subpatch itself.;
+#X text 19 140 At first glance \, this might look strikingly similar
+to the "Put" menu array. There are \, however \, some important differences:
+;
+#X text 19 179 * with the [table] object \, you can use the arguments
+to set the name and size of the array.;
+#X text 19 249 * with the [table] object \, you cannot save the contents
+of the array with the patch. (Note: this is true even if you open [table]
+and check "save contents" in the garray properties.);
+#X text 19 309 If you're not interested in seeing the array data within
+your PD patch \, you can use the [table] object to store the array
+and corresponding table in a sub-window. Note that [table]s are more
+CPU friendly than their graphical counterpart.;
+#X restore 63 86 pd The_[table]_object;
+#X obj 201 87 pddp/pddplink table-help.pd;
+#X obj 201 65 pddp/pddplink array-help.pd;
+#N canvas 0 0 428 410 Data_structure_arrays 0;
+#X scalar ds-array-ex 26 195 \; 5 Jan \; 3 Feb \; 6 Mar \; 13 Apr \;
+23 May \; 36 Jun \; 52 Jul \; 68 Aug \; 74 Sep \; 75 Oct \; 76 Nov
+\; 76 Dec \; \;;
+#X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 20 10
+1 18 -261106 -33289 0;
+#X text 7 1 Arrays in Data Structures;
+#X text 20 137 For more about using arrays with data structures \,
+see the help patches in doc/4.data.structures/ \, especially 05.array.pd.
+;
+#N canvas 19 76 425 300 ds-array-ex 0;
+#N canvas 15 209 450 300 circle 0;
+#X obj 25 56 filledcurve 800 509 1 -5 5 5 5 5 -5 -5 -5;
+#X obj 25 29 struct circle float y symbol a;
+#X text 283 83 (hack to anchor labels;
+#X text 284 99 at the bottom of x-axis);
+#X obj 25 83 drawsymbol a -10 y(-1000:1000)(1105:-895) 0;
+#X restore 55 111 pd circle;
+#X obj 171 215 pointer;
+#X obj 55 20 struct ds-array-ex float x float y array circles circle
+;
+#X obj 12 242 setsize ds-array-ex circles;
+#X floatatom 35 216 5 0 0 0 - - -;
+#X msg 171 188 traverse pd-Data_structure_arrays \, next;
+#X obj 55 47 plot circles 759 3 15 0 25;
+#X obj 55 74 drawpolygon 666 1 0 0 0 100 310 100;
+#X text 121 111 <- template for array elements;
+#X obj 171 161 loadbang;
+#X obj 12 190 inlet;
+#X connect 1 0 3 1;
+#X connect 5 0 1 0;
+#X connect 9 0 5 0;
+#X connect 10 0 3 0;
+#X connect 10 0 4 0;
+#X restore 305 371 pd ds-array-ex;
+#X text 20 91 However \, data structure arrays have a big drawback--
+their array data cannot currently be accessed directly by objects like
+[tabread] or [soundfiler].;
+#X text 20 36 Arrays can be used in data structures \, with or without
+graphical representation. They provide more flexibility than "Put"
+menu arrays (both graphically and in their structure).;
+#X text 90 371 see subpatch for ds definition ->;
+#X text 20 343 click here to change the size of the array ->;
+#X floatatom 305 345 5 0 0 0 - - -;
+#X connect 9 0 4 0;
+#X restore 63 108 pd Data_structure_arrays;
+#X obj 216 109 pddp/pddplink struct-help.pd;
+#N canvas 14 32 428 532 How_to_manipulate_arrays_in_PD 0;
+#N canvas 0 22 452 302 (subpatch) 0;
+#X array exampleArray 14 float 0;
+#X coords 0 2 13 -2 200 140 1 0 0;
+#X restore 214 378 graph;
+#N canvas 9 24 434 213 Setting_the_size_of_an_array 0;
+#X msg 214 88 \; exampleArray resize \$1;
+#X floatatom 214 66 5 0 0 0 - - -;
+#X text 151 100 same as;
+#X floatatom 48 66 5 0 0 0 - - -;
+#X obj 48 114 s exampleArray;
+#X msg 48 88 resize \$1;
+#X text 15 8 For "Put" menu arrays \, you can right-click and use the
+"Properties" menu to change the size. For both "Put" menu arrays and
+[table] objects \, you can also send messages to the array by name:
+;
+#X text 15 145 Note that when you make an array larger \, new elements
+always have a default value of zero. Also note that if you make arrays
smaller \, you may lose data as each element is deleted from the end
of the array.;
#X connect 1 0 0 0;
-#X connect 5 0 7 0;
-#X connect 7 0 6 0;
-#X restore 24 270 pd Setting_the_size_of_an_array;
-#N canvas 4 30 720 447 Concatenate_two_arrays 0;
+#X connect 3 0 5 0;
+#X connect 5 0 4 0;
+#X restore 23 206 pd Setting_the_size_of_an_array;
+#N canvas 4 16 720 375 Concatenate_two_arrays 0;
#X text 19 10 This example assumes that we already know the size of
the two arrays which will be concatenated. This process will fill NewArray
with the contents of exampleArray and concatArray.;
-#N canvas 0 22 450 300 graph33 0;
+#N canvas 0 22 450 300 (subpatch) 0;
#X array concatArray 15 float 1;
#A 0 -0.700355 -0.371783 -0.443212 -0.700355 -0.714641 -0.386069 0.0425035
0.399647 0.513933 0.399647 0.128218 -0.128925 -0.21464 -0.0289252 -0.700355
;
-#X coords 0 1 14 -1 200 140 1;
+#X coords 0 1 14 -1 200 120 1;
#X restore 492 25 graph;
-#N canvas 0 22 450 300 graph34 0;
-#X array NewArray 82 float 0;
-#X coords 0 1 81 -1 300 140 1;
-#X restore 389 267 graph;
-#X obj 125 66 bng 15 250 50 0 empty empty Bang_me 18 7 0 8 -262144
+#N canvas 0 22 450 300 (subpatch) 0;
+#X array NewArray 29 float 0;
+#X coords 0 1 28 -1 300 140 1;
+#X restore 389 225 graph;
+#X obj 125 57 bng 15 250 50 0 empty empty Bang_me 18 7 0 8 -262144
-1 -1;
-#X obj 28 96 until;
-#X obj 28 171 f;
-#X obj 58 171 + 1;
-#X obj 28 286 tabread exampleArray;
-#X obj 28 340 tabwrite NewArray;
-#X obj 141 311 tabread concatArray;
-#X text 372 194 This example is much more interesting if;
-#X text 373 212 you draw new values into each array with;
-#X text 373 230 your mouse - then reset and bang again.;
-#X obj 150 134 arraysize exampleArray;
-#X obj 125 163 arraysize concatArray;
-#X obj 125 188 +;
-#X msg 178 241 \; NewArray resize \$1;
-#X text 28 75 loop;
-#X obj 28 219 moses;
-#X obj 141 254 -;
-#X obj 125 85 t b b b;
-#X obj 125 212 t f f;
-#X msg 47 144 0;
-#X obj 176 109 s clr1;
-#X obj 47 119 r clr1;
-#X connect 3 0 20 0;
+#X obj 28 87 until;
+#X obj 28 162 f;
+#X obj 58 162 + 1;
+#X obj 28 277 tabread exampleArray;
+#X obj 28 331 tabwrite NewArray;
+#X obj 141 302 tabread concatArray;
+#X text 372 152 This example is much more interesting if;
+#X text 373 170 you draw new values into each array with;
+#X text 373 188 your mouse - then reset and bang again.;
+#X obj 125 179 +;
+#X msg 178 232 \; NewArray resize \$1;
+#X text 28 66 loop;
+#X obj 28 210 moses;
+#X obj 141 245 -;
+#X obj 125 76 t b b b;
+#X obj 125 203 t f f;
+#X msg 47 135 0;
+#X obj 176 100 s clr1;
+#X obj 47 110 r clr1;
+#X obj 125 154 expr size("concatArray");
+#X obj 150 125 expr size("exampleArray");
+#X connect 3 0 18 0;
#X connect 4 0 5 0;
#X connect 5 0 6 0;
-#X connect 5 0 18 0;
+#X connect 5 0 16 0;
#X connect 5 0 8 1;
#X connect 6 0 5 1;
#X connect 7 0 8 0;
#X connect 9 0 8 0;
-#X connect 13 0 15 1;
-#X connect 13 0 19 1;
-#X connect 13 0 18 1;
-#X connect 14 0 15 0;
-#X connect 15 0 21 0;
-#X connect 18 0 7 0;
-#X connect 18 1 19 0;
-#X connect 19 0 9 0;
-#X connect 20 0 14 0;
-#X connect 20 1 13 0;
-#X connect 20 2 23 0;
-#X connect 21 0 4 0;
-#X connect 21 1 16 0;
-#X connect 22 0 5 1;
-#X connect 24 0 22 0;
-#X restore 24 371 pd Concatenate_two_arrays;
-#N canvas 4 30 735 395 Join_array_elements_into_a_list 0;
+#X connect 13 0 19 0;
+#X connect 16 0 7 0;
+#X connect 16 1 17 0;
+#X connect 17 0 9 0;
+#X connect 18 0 23 0;
+#X connect 18 1 24 0;
+#X connect 18 2 21 0;
+#X connect 19 0 4 0;
+#X connect 19 1 14 0;
+#X connect 20 0 5 1;
+#X connect 22 0 20 0;
+#X connect 23 0 13 0;
+#X connect 24 0 13 1;
+#X connect 24 0 17 1;
+#X connect 24 0 16 1;
+#X restore 23 316 pd Concatenate_two_arrays;
+#N canvas 4 23 678 354 Join_array_elements_into_a_list 0;
#X text 16 12 JOIN ARRAY ELEMENTS INTO A LIST;
-#X obj 22 163 bng 15 250 50 0 empty empty Bang_me 18 7 0 8 -24198 -1
+#X obj 23 133 bng 15 250 50 0 empty empty Bang_me 18 7 0 8 -24198 -1
-1;
-#X obj 23 241 until;
-#X obj 24 320 tabread exampleArray;
-#X obj 216 235 pack s f;
-#X obj 216 183 t b f;
-#X obj 24 292 f;
-#X obj 58 292 + 1;
-#X obj 24 348 s \$1-value;
-#X obj 216 157 r \$1-value;
-#X obj 216 261 route list;
-#X obj 519 210 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+#X obj 23 211 until;
+#X obj 23 284 tabread exampleArray;
+#X obj 216 205 pack s f;
+#X obj 216 153 t b f;
+#X obj 23 256 f;
+#X obj 57 256 + 1;
+#X obj 23 312 s \$1-value;
+#X obj 216 127 r \$1-value;
+#X obj 216 231 route list;
+#X obj 509 170 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
-#X obj 519 229 savepanel;
-#X msg 519 252 \; exampleArray write \$1;
-#X obj 283 353 print;
-#X text 289 330 store the list;
-#X obj 283 312 textfile;
-#X msg 345 285 rewind;
-#X obj 216 209 symbol add2;
-#X obj 310 240 bng 15 250 50 0 empty empty THEN_Print_the_list 18 7
+#X obj 509 189 savepanel;
+#X msg 509 212 \; exampleArray write \$1;
+#X obj 283 323 print;
+#X text 289 300 store the list;
+#X obj 283 282 textfile;
+#X msg 345 255 rewind;
+#X obj 216 179 symbol add2;
+#X obj 310 210 bng 15 250 50 0 empty empty THEN_Print_the_list 18 7
0 8 -24198 -1 -1;
-#X text 451 308 can be achieved by saving the;
-#X text 451 324 array elements to a text file;
-#X text 452 341 using the savepanel and write;
-#X text 453 357 message.;
-#X text 452 292 Alternatively \, a similar result;
-#X obj 22 183 arraysize exampleArray;
-#X msg 129 261 clear;
-#X obj 310 261 t b b;
-#X msg 74 260 0;
-#X text 29 37 In some other programming environments \, including Visual
+#X text 441 268 can be achieved by saving the;
+#X text 441 284 array elements to a text file;
+#X text 442 301 using the savepanel and write;
+#X text 443 317 message.;
+#X text 442 252 Alternatively \, a similar result;
+#X obj 23 153 arraysize exampleArray;
+#X msg 129 231 clear;
+#X obj 310 231 t b b;
+#X msg 74 230 0;
+#X text 20 37 In some other programming environments \, including Visual
Basic and Java (among others) \, there are functions which join all
elements of an array into a list. This example shows how this functionality
can be duplicated in Pd. This example uses the elements of exampleArray
from the previous help window. The list can either be printed to the
terminal window \, or it can be saved to a text file.;
-#X obj 23 214 t f b;
+#X obj 23 184 t f b;
#X connect 1 0 25 0;
#X connect 2 0 6 0;
#X connect 3 0 8 0;
@@ -178,69 +360,84 @@ terminal window \, or it can be saved to a text file.;
#X connect 30 0 2 0;
#X connect 30 1 28 0;
#X connect 30 1 26 0;
-#X restore 24 397 pd Join_array_elements_into_a_list;
-#N canvas 2 29 719 337 Getting_the_size_of_an_array 0;
-#X text 15 11 GETTING THE SIZE OF AN ARRAY;
-#X text 34 34 If you deal with arrays often \, you will want to download
-the [arraysize] external written by PIX. Pd lacks a native object for
-this purpose and I'm afraid that without this external this functionality
-is impossible in Pd.;
-#X obj 38 127 arraysize exampleArray;
-#X obj 38 107 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+#X restore 23 338 pd Join_array_elements_into_a_list;
+#N canvas 1 2 418 389 Getting_the_size_of_an_array 0;
+#X obj 18 69 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
-#X floatatom 38 152 5 0 0 0 - - -;
-#X text 35 183 Having said that...PD arrays accept a "print" command
-which will output important array information to the terminal window.
-Like below:;
-#X msg 40 258 \; exampleArray print;
-#X connect 2 0 4 0;
-#X connect 3 0 2 0;
-#X restore 24 320 pd Getting_the_size_of_an_array;
-#N canvas 0 31 721 390 Reversing_an_array 0;
+#X floatatom 18 114 5 0 0 0 - - -;
+#X msg 148 336 \; exampleArray print;
+#X text 15 11 If you deal with arrays often \, you will want have a
+look at the [expr] object \, which offers several functions for manipulating
+arrays. The [expr] \, [expr~] \, and [fexpr~] objects are included
+in most Pd distributions.;
+#X obj 18 89 expr size("exampleArray");
+#X text 182 89 (Notice the quotes around the;
+#X text 185 104 array name.);
+#X floatatom 18 244 5 0 0 0 - - -;
+#X text 15 138 You can use the special dollarsign variables of [expr]
+to dynamically change the array name:;
+#X obj 18 219 expr size("$s1");
+#X msg 18 172 symbol exampleArray;
+#X msg 36 194 symbol someOtherArray;
+#X text 15 300 Arrays accept a "print" command which will output important
+array information to the terminal window. Like below:;
+#N canvas 0 0 450 300 (subpatch) 0;
+#X array someOtherArray 4 float 2;
+#X coords 0 1 4 -1 75 50 1;
+#X restore 235 201 graph;
+#X text 15 266 See the [expr] help patch for other array functions.
+;
+#X connect 0 0 4 0;
+#X connect 4 0 1 0;
+#X connect 9 0 7 0;
+#X connect 10 0 9 0;
+#X connect 11 0 9 0;
+#X restore 23 250 pd Getting_the_size_of_an_array;
+#N canvas 0 31 721 355 Reversing_an_array 0;
#X text 20 15 REVERSING AN ARRAY;
#X text 23 35 When an array is reversed \, as the name implies the
first element becomes the last and the last becomes the first. When
viewing this example \, please be sure you can see the "exampleArray"
in the previous window.;
-#X obj 110 109 bng 15 250 50 0 empty empty Reverse_me 18 7 0 8 -262144
+#X obj 110 99 bng 15 250 50 0 empty empty Reverse_me 18 7 0 8 -262144
-1 -1;
-#X obj 110 128 arraysize exampleArray;
-#X obj 110 200 until;
-#X obj 176 228 + 1;
-#X obj 144 228 f;
-#X obj 135 176 s \$1-length;
-#X obj 169 281 tabread exampleArray;
-#X obj 313 342 table tempArray;
-#X obj 110 152 t f f f;
-#X obj 234 196 s tempArray;
-#X msg 234 172 resize \$1;
-#X obj 65 308 tabwrite tempArray;
+#X obj 110 118 arraysize exampleArray;
+#X obj 110 190 until;
+#X obj 176 218 + 1;
+#X obj 144 218 f;
+#X obj 135 166 s \$1-length;
+#X obj 169 271 tabread exampleArray;
+#X obj 313 325 table tempArray;
+#X obj 110 142 t f f f;
+#X obj 234 186 s tempArray;
+#X msg 234 162 resize \$1;
+#X obj 65 298 tabwrite tempArray;
#X obj 510 41 sel;
#X obj 586 31 - 1;
#X obj 586 7 r \$1-length;
-#X obj 144 254 t f f f;
-#X obj 57 278 s \$1-eof;
+#X obj 144 244 t f f f;
+#X obj 57 268 s \$1-eof;
#X obj 510 8 r \$1-eof;
#X obj 510 113 until;
#X obj 510 88 f;
-#X obj 510 161 f;
-#X obj 542 161 - 1;
-#X obj 561 108 r \$1-length;
+#X obj 510 146 f;
+#X obj 542 146 - 1;
+#X obj 561 93 r \$1-length;
#X obj 529 64 r \$1-length;
-#X obj 510 213 tabread tempArray;
-#X obj 510 345 tabwrite exampleArray;
-#X obj 574 265 f;
-#X obj 593 241 r \$1-length;
-#X obj 574 314 mod;
-#X obj 593 289 r \$1-length;
-#X obj 604 265 + 1;
-#X obj 510 186 t f b;
-#X obj 561 131 - 1;
-#X text 13 346 Copies array to a temporary location.;
-#X msg 327 124 0;
-#X obj 327 148 s clr2;
-#X obj 443 150 r clr2;
-#X obj 163 200 r clr2;
+#X obj 510 198 tabread tempArray;
+#X obj 510 325 tabwrite exampleArray;
+#X obj 574 245 f;
+#X obj 593 221 r \$1-length;
+#X obj 574 294 mod;
+#X obj 593 269 r \$1-length;
+#X obj 604 245 + 1;
+#X obj 510 171 t f b;
+#X obj 561 116 - 1;
+#X text 43 325 Copies array to a temporary location.;
+#X msg 327 114 0;
+#X obj 327 138 s clr2;
+#X obj 453 100 r clr2;
+#X obj 163 190 r clr2;
#X connect 2 0 3 0;
#X connect 2 0 36 0;
#X connect 3 0 10 0;
@@ -280,19 +477,19 @@ in the previous window.;
#X connect 36 0 37 0;
#X connect 38 0 22 1;
#X connect 39 0 6 1;
-#X restore 24 474 pd Reversing_an_array;
-#N canvas 2 30 719 390 Popping_and_Pushing_arrays 0;
-#X obj 62 181 bng 15 250 50 0 empty empty Pop_me -18 -6 0 8 -262144
+#X restore 23 404 pd Reversing_an_array;
+#N canvas 2 30 522 357 Popping_and_Pushing_arrays 0;
+#X obj 53 151 bng 15 250 50 0 empty empty Pop_me -18 -6 0 8 -262144
-1 -1;
-#X obj 134 199 arraysize exampleArray;
-#X obj 134 294 tabread exampleArray;
-#X floatatom 134 318 0 0 0 0 - - -;
-#X obj 99 173 t b b;
-#X obj 51 320 - 1;
-#X msg 51 346 \; exampleArray resize \$1;
-#X floatatom 158 223 0 0 0 0 - - -;
-#X text 175 318 value of last element;
-#X obj 458 188 bng 15 250 50 0 empty empty Push_me 18 7 0 8 -262144
+#X obj 125 169 arraysize exampleArray;
+#X obj 125 264 tabread exampleArray;
+#X floatatom 125 288 0 0 0 0 - - -;
+#X obj 90 143 t b b;
+#X obj 42 290 - 1;
+#X msg 42 316 \; exampleArray resize \$1;
+#X floatatom 149 193 0 0 0 0 - - -;
+#X text 166 288 value of last element;
+#X obj 349 151 bng 15 250 50 0 empty empty Push_me 18 7 0 8 -262144
-1 -1;
#X text 31 33 I got this idea from Java \, which provides a method
to "pop" an array. The "pop" method will remove the last element in
@@ -302,16 +499,16 @@ PD is that we need to know the length of the array before we start
is the opposite effect and also a tool provided in Java. When an array
is pushed \, an element is added to the array and the new size is returned.
;
-#X obj 458 208 arraysize exampleArray;
-#X obj 458 232 + 1;
-#X msg 458 292 \; exampleArray resize \$1;
-#X floatatom 476 258 0 0 0 0 - - -;
-#X text 521 258 new size;
+#X obj 349 171 arraysize exampleArray;
+#X obj 349 195 + 1;
+#X msg 349 255 \; exampleArray resize \$1;
+#X floatatom 367 221 0 0 0 0 - - -;
+#X text 412 221 new size;
#X text 16 12 POPPING AND PUSHING AN ARRAY;
-#X obj 158 246 - 1;
-#X text 197 223 # of total elements;
-#X floatatom 158 271 0 0 0 0 - - -;
-#X text 198 273 new size;
+#X obj 149 216 - 1;
+#X text 188 193 # of total elements;
+#X floatatom 149 241 0 0 0 0 - - -;
+#X text 189 243 new size;
#X connect 0 0 4 0;
#X connect 1 0 2 0;
#X connect 1 0 5 0;
@@ -326,8 +523,8 @@ is pushed \, an element is added to the array and the new size is returned.
#X connect 12 0 13 0;
#X connect 12 0 14 0;
#X connect 17 0 19 0;
-#X restore 24 423 pd Popping_and_Pushing_arrays;
-#N canvas 2 30 722 391 Shifting_an_array 0;
+#X restore 23 360 pd Popping_and_Pushing_arrays;
+#N canvas 5 2 669 391 Shifting_an_array 0;
#X obj 30 90 bng 15 250 50 0 empty empty Shift_me 18 7 0 8 -24198 -1
-1;
#X text 16 12 SHIFTING AN ARRAY;
@@ -424,61 +621,47 @@ element of the array and return its value. This is opposite of the
#X connect 43 0 35 1;
#X connect 45 0 43 0;
#X connect 46 0 9 1;
-#X restore 24 449 pd Shifting_an_array;
-#X text 25 32 Arrays in Pd are different than the arrays in other languages
-primarily because \, in Pd \, they are designed to be displayed graphically
-on screen. This is due to the nature of audio synthesis - we want to
-see our wave forms and visually understand the data. That's why arrays
-in Pd are complicated by other objects like tables \, graphs and widgets.
-PD uses these objects to provide a graphic representation of the array
-data. If you're not interested in seeing the array data within your
-PD patch \, you can use the [table] object to store the array and corresponding
-table in a sub-window. Note that [table]s are more CPU friendly than
-their graphical counterpart.;
-#X text 26 230 Like all programming languages \, Pd provides numerous
-tools to manipulate arrays and their data.;
-#N canvas 3 32 718 310 Setting_a_constant_array_value 0;
-#X floatatom 26 151 0 0 0 0 - - -;
-#X obj 26 185 / 100;
-#X msg 26 215 \; exampleArray const \$1;
-#X text 18 16 SETTING A CONSTANT ARRAY VALUE;
-#X text 27 46 By default \, all array element values are zero. However
-\, Pd allows you to change that using the "CONST" message.;
-#X text 26 88 This feature is useful to reset all values in an array
+#X restore 23 382 pd Shifting_an_array;
+#N canvas 21 125 413 203 Setting_a_constant_array_value 0;
+#X floatatom 226 99 0 0 0 0 - - -;
+#X obj 226 123 / 100;
+#X msg 226 153 \; exampleArray const \$1;
+#X text 16 50 This feature is useful to reset all values in an array
\, or with a little creativity can be used to "delete" a slice \, or
create silence in audio samples.;
+#X text 17 13 By default \, all array element values are zero. However
+\, Pd allows you to change that using the "const" message.;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
-#X restore 24 345 pd Setting_a_constant_array_value;
-#N canvas 3 26 727 395 Higher_math_using_arrays 0;
+#X restore 23 294 pd Setting_a_constant_array_value;
+#N canvas 3 26 727 298 Higher_math_using_arrays 0;
#X text -7 12 HIGHER MATH USING ARRAYS;
-#X text -3 226 Normalize;
-#X text 78 227 (arg: renormer...a number by which all array values
+#X text -3 176 Normalize;
+#X text 78 177 (arg: renormer...a number by which all array values
will be normalized);
-#X msg 6 278 \; exampleArray normalize \$1;
-#X floatatom 6 256 5 0 0 0 - - -;
-#N canvas 5 55 710 432 sine_waves 0;
-#X text 34 188 Sinesum;
-#X text 98 190 (arg 1: Number of Points - arg 2: list of partial strengths)
+#X msg 6 228 \; exampleArray normalize \$1;
+#X floatatom 6 206 5 0 0 0 - - -;
+#N canvas 9 28 710 366 sine_waves 0;
+#X text 34 160 Sinesum;
+#X text 98 162 (arg 1: Number of Points - arg 2: list of partial strengths)
;
-#X msg 40 293 \; exampleArray sinesum 64 1 0 0.5 0 0.2 0 0.15;
-#X msg 40 251 \; exampleArray sinesum 64 1 0.5 0.38 0.3 0.28 0.25 0.2
+#X msg 40 265 \; exampleArray sinesum 64 1 0 0.5 0 0.2 0 0.15;
+#X msg 40 223 \; exampleArray sinesum 64 1 0.5 0.38 0.3 0.28 0.25 0.2
;
-#X msg 40 210 \; exampleArray sinesum 64 1;
+#X msg 40 182 \; exampleArray sinesum 64 1;
#X text 26 7 SINE WAVES;
-#X text 29 30 comment;
-#X text 45 29 When the "sinesum" message is sent to the array \, Pd
+#X text 45 26 When the "sinesum" message is sent to the array \, Pd
will want to know two things:;
-#X text 58 65 1 How many samples (array elements) should be used? The
+#X text 58 57 1 How many samples (array elements) should be used? The
higher the number is \, the higher the resolution of the wave form.
;
-#X text 58 122 2 What is the relative strength of each "partial" or
+#X text 58 104 2 What is the relative strength of each "partial" or
"overtone" in the sound? For more info about this \, please lookup
"overtones" or "harmonics" or "partials" on the internet.;
-#X text 250 220 a pure sine wave!;
-#X text 479 259 a triangle wave;
-#X text 412 303 a square wave;
-#X text 33 346 Note that these waves aren't exactly triangular or square...instead
+#X text 250 192 a pure sine wave!;
+#X text 369 231 a triangle wave;
+#X text 331 274 a square wave;
+#X text 33 309 Note that these waves aren't exactly triangular or square...instead
they are "smoothed" by the sinesum function to more accurately produce
these wave forms as analog instruments do.;
#X restore 7 42 pd sine_waves;
@@ -491,7 +674,7 @@ similar to those of our electronic and mechanical predecessors. The
first and one of the most important mathematic functions in digital
synthesis is undoubtebly "sinesum". Pd provides an easy method for
us to integrate these higher math functions in our arrays.;
-#N canvas 0 195 750 302 cosine_waves 0;
+#N canvas 3 29 750 302 cosine_waves 0;
#X text 11 22 Cosinesum;
#X text 91 22 (arg 1: Number of Points - arg 2: list of partial strengths)
;
@@ -501,15 +684,15 @@ us to integrate these higher math functions in our arrays.;
#X msg 22 159 \; exampleArray cosinesum 64 -0.15 0.2 0.15 -0.15 0.1
0.1 0.2 -0.2 0.35 -0.25 -0.1 0.1 0.199;
#X restore 6 73 pd cosine_waves;
-#X text 222 257 To normalize an audio signal means to alter the average
+#X text 222 207 To normalize an audio signal means to alter the average
amplitude of the signal. For the sake of clear \, undistored sounds
\, Pd would like all of your audio signals to never exceed 1 or -1
The first step in achieving this is "normalization" \, but can be assisted
by more drastic tools like compressors \, limiters \, gain multipliers
\, etc.;
#X connect 4 0 3 0;
-#X restore 24 499 pd Higher_math_using_arrays;
-#N canvas 2 31 727 416 Files_and_arrays 0;
+#X restore 23 426 pd Higher_math_using_arrays;
+#N canvas 4 16 727 320 Files_and_arrays 0;
#X text 24 14 OTHER IMPORTANT STUFF;
#X obj 225 91 savepanel;
#X obj 225 70 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
@@ -529,198 +712,123 @@ of formats.;
#X obj 77 231 openpanel;
#X obj 52 232 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
-#X obj 4 280 symbol read;
-#X obj 54 380 soundfiler;
-#X obj 54 355 route list;
-#X obj 54 332 pack s s s s;
-#X obj 100 280 symbol -resize;
-#X obj 78 254 t b b s b;
-#X obj 145 305 symbol exampleArray;
+#X obj 77 285 soundfiler;
#X obj 373 231 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
-#X obj 375 378 soundfiler;
-#X obj 375 353 route list;
-#X obj 375 330 pack s s s s;
-#X obj 399 253 t b b s b;
-#X obj 466 303 symbol exampleArray;
+#X obj 398 284 soundfiler;
#X obj 398 230 savepanel;
-#X obj 317 278 symbol write;
-#X obj 421 278 symbol -aiff;
+#X msg 77 258 read -resize \$1 exampleArray;
+#X msg 398 257 write -aiff \$1 exampleArray;
#X connect 1 0 3 0;
#X connect 2 0 1 0;
#X connect 4 0 5 0;
#X connect 5 0 6 0;
-#X connect 9 0 16 0;
+#X connect 9 0 15 0;
#X connect 10 0 9 0;
-#X connect 11 0 14 0;
-#X connect 13 0 12 0;
-#X connect 14 0 13 0;
-#X connect 15 0 14 1;
-#X connect 16 0 11 0;
-#X connect 16 1 15 0;
-#X connect 16 2 14 2;
-#X connect 16 3 17 0;
-#X connect 17 0 14 3;
-#X connect 18 0 24 0;
-#X connect 20 0 19 0;
-#X connect 21 0 20 0;
-#X connect 22 0 25 0;
-#X connect 22 1 26 0;
-#X connect 22 2 21 2;
-#X connect 22 3 23 0;
-#X connect 23 0 21 3;
-#X connect 24 0 22 0;
-#X connect 25 0 21 0;
-#X connect 26 0 21 1;
-#X restore 24 526 pd Files_and_arrays;
-#N canvas 0 22 719 423 Additional_tools 0;
-#X text 18 14 ADDITIONAL TOOLS;
-#X text 29 38 The "array" object in Pd accepts special messages to
+#X connect 12 0 14 0;
+#X connect 14 0 16 0;
+#X connect 15 0 11 0;
+#X connect 16 0 13 0;
+#X restore 23 448 pd Files_and_arrays;
+#N canvas 0 22 719 367 Additional_tools 0;
+#X text 18 9 ADDITIONAL TOOLS;
+#X text 29 28 The "array" object in Pd accepts special messages to
alter the appearance of the array on screen.;
-#X text 19 81 Arrays can be renamed:;
-#X msg 203 78 \; exampleArray rename george;
-#X msg 431 78 \; george rename exampleArray;
-#X msg 303 173 \; exampleArray bounds 0 1 67 -1;
-#X text 20 129 You can set the bounds of the rectangle: (the arguments
+#X text 19 71 Arrays can be renamed:;
+#X msg 203 68 \; exampleArray rename george;
+#X msg 431 68 \; george rename exampleArray;
+#X msg 303 153 \; exampleArray bounds 0 1 67 -1;
+#X text 20 109 You can set the bounds of the rectangle: (the arguments
are:;
-#X text 353 146 low x \, high y \, high x \, low y);
-#X msg 58 173 \; exampleArray bounds 0 2 67 -2;
-#X text 18 219 Array graphs can be given "ticks" on both the x and
+#X text 353 126 low x \, high y \, high x \, low y);
+#X msg 58 153 \; exampleArray bounds 0 2 67 -2;
+#X text 18 199 Array graphs can be given "ticks" on both the x and
y axis to help you visually measure your data. The tick messages require
3 values: (the index or value of the FIRST large tick \, then the interval
between ticks \, then finally the number of ticks overall per large
tick).;
-#X msg 488 243 \; exampleArray xticks 0 5 3;
-#X msg 471 290 \; exampleArray yticks 0 0.5 4;
-#X msg 354 369 \; exampleArray ylabel -5 -2 -1.5 -1 1 1.5 2;
-#X msg 26 369 \; exampleArray xlabel 0 10 20 30 40 50 60;
-#X text 17 325 Arrays can be given labels to describe the x and y axis.
+#X msg 395 203 \; exampleArray xticks 0 5 3;
+#X msg 378 250 \; exampleArray yticks 0 0.5 4;
+#X msg 354 329 \; exampleArray ylabel -5 -2 -1.5 -1 1 1.5 2;
+#X msg 26 329 \; exampleArray xlabel 0 10 20 30 40 50 60;
+#X text 17 285 Arrays can be given labels to describe the x and y axis.
Give a y value and a bunch of x values or vice versa:;
-#X restore 24 553 pd Additional_tools;
-#N canvas 375 65 671 598 Populating_an_array 0;
-#X text 27 12 POPULATING AN ARRAY;
-#X text 41 37 An array in Pd is primarily a storage device for numbers.
+#X restore 23 470 pd Additional_tools;
+#N canvas 2 2 433 386 Populating_an_array 0;
+#X text 19 21 An array in Pd is primarily a storage device for numbers.
The result is a series of numbers that you can do with whatever you
wish...but how does one populate an array?;
-#X msg 39 333 \; exampleArray 0 -1 1 -1 0.5 -0.5 0.5 -0.2 0.2 -0.2
+#X msg 22 232 \; exampleArray 0 -1 1 -1 0.5 -0.5 0.5 -0.2 0.2 -0.2
0.1 -0.1 0;
-#X text 39 522 Note that if your array is larger than your list \,
+#X text 19 340 Note that if your array is larger than your list \,
then only the first elements will be effected. If your array is smaller
than your list \, then your list will be truncated.;
-#X msg 38 381 \; exampleArray 9 -1 1 -1 0.5 -0.5 0.5 -0.2 0.2 -0.2
+#X msg 22 267 \; exampleArray 9 -1 1 -1 0.5 -0.5 0.5 -0.2 0.2 -0.2
0.1 -0.1 0;
-#X msg 38 430 \; exampleArray 55 -1 1 -1 0.5 -0.5 0.5 -0.2 0.2 0.2
+#X msg 22 302 \; exampleArray 55 -1 1 -1 0.5 -0.5 0.5 -0.2 0.2 0.2
0.1 -0.1 0;
-#N canvas 225 194 487 361 clearExampleArray 0;
-#X obj 199 91 arraysize exampleArray;
-#X obj 153 189 moses;
-#X obj 124 149 +;
-#X obj 162 149 f;
-#X msg 162 123 0;
-#X msg 123 123 1;
-#X obj 153 220 t b b f;
-#X obj 184 276 tabwrite exampleArray;
-#X msg 184 248 0;
-#X obj 55 170 bang;
-#X msg 33 92 0;
-#X obj 33 67 trigger bang bang;
-#X obj 234 168 bang;
-#X obj 33 26 inlet;
-#X connect 0 0 1 1;
-#X connect 1 0 6 0;
-#X connect 1 1 12 0;
-#X connect 2 0 3 0;
-#X connect 2 0 1 0;
-#X connect 3 0 2 1;
-#X connect 4 0 3 0;
-#X connect 5 0 2 0;
-#X connect 6 0 9 0;
-#X connect 6 1 8 0;
-#X connect 6 2 7 1;
-#X connect 8 0 7 0;
-#X connect 9 0 5 0;
-#X connect 10 0 2 0;
-#X connect 11 0 10 0;
-#X connect 11 1 0 0;
-#X connect 12 0 4 0;
-#X connect 13 0 11 0;
-#X restore 441 483 pd clearExampleArray;
-#X obj 419 483 bng 19 250 50 0 empty empty empty 0 -6 0 8 -62784 -1
--1;
-#X text 39 94 Advanced techniques using text or audio files is described
+#X text 19 60 Advanced techniques using text or audio files is described
later \, but for now it's important to know that you can send an array
a list. Each element in the list will be assigned to the corresponding
element in the array. Note that the first position in an array is always
zero!;
-#X text 39 235 These messages below populate exampleArray on the parent
+#X text 19 164 These messages below populate exampleArray on the parent
patch with some values. The first element is the name of the array
to populate. The second element is the position to start at. The rest
of the elements are values to add to the array sequentially.;
-#X text 53 185 first position in array = array[0];
-#X text 53 201 second position in array = array[1];
-#X connect 7 0 6 0;
-#X restore 24 295 pd Populating_an_array;
-#X restore 41 173 pd How_to_manipulate_arrays_in_PD;
-#N canvas 132 22 587 609 How_to_create_an_array_in_PD 0;
-#X text 22 9 1 Select "array" from the "Put" menu above.;
-#X text 21 288 4 If you want Pd to create a new graph for this array
-\, then select "in new graph". If you have another location in mind
--- for example if you want to overlap two arrays in a single graph
-\, then select "in last graph".;
-#X text 19 361 5 Then click "OK" and place the new array anywhere in
-this window.;
-#X text 19 403 6 Note: if you do not want to see the graph in this
-window \, then you can use the [table] object instead...the array will
-then be created inside the [table] object and will be seen only if
-you manually open the table.;
-#X text 22 31 2 A dialogue box appears where you can type the name
-of the array and the desired size. Names can be anything you want -
-if you want a localized array \, then name it something like \$1-dave
-(the dollar sign indicates that part of the name is a variable which
-is unique to this patch). The size of the array can be anything greater
-than 0 (zero). At a sample rate of 441000 khz \, an array of 882000
-will provide you with 2 seconds of audio data.;
-#X text 21 167 3 The "Save contents" checkbox will inform Pure Data
-that you want the array saved within the source code of this patch.
-This way \, you can ensure that the array will maintain its values
-each time you open this patch. This is recommended only for relatively
-small arrays...larger arrays should be saved to either a text file
-\, or an audio file.;
-#X restore 42 106 pd How_to_create_an_array_in_PD;
-#N canvas 133 22 646 607 Common_uses_for_arrays_in_PD 0;
-#X text 27 26 COMMON USES FOR ARRAYS IN Pd;
-#X text 49 60 Arrays are versatile. Their simple structure make them
-useful in countless situations. This page discusses perhaps the most
-common applications.;
-#X text 50 225 2 MIDI Sequencers: array values limited to a range between
-0 and 127 are suitable for MIDI output to be used as pitch \, velocity
-\, or controller numbers. Some MIDI information requires a much larger
-range \, such as pitch benders.;
-#X text 50 306 3 Envelopes: an array with four elements can be used
-effectively as an ADSR enveloper. There are numerous examples of this
-in other Pd help documents.;
-#X text 53 377 4 Math and conversion tables: arrays are an excellent
-visual tool when performing fourier analysis and other higher mathematic
-functions.;
-#X text 54 450 5 Wave editing: with proper manipulation of array data
-\, Pd can be fully functional wave editor \, complete with mouse-clickable
-cut-n-paste \, pitch-shift \, time expansion \, down/upsampling \,
-and other tools typically found in commercial wave editors.;
-#X text 49 128 1 Audio sample data: when an array's values are limited
-to a range between -1 and 1 \, the numbers are suitable for conversion
-to analog audio signal. These arrays are typically many thousands of
-elements and stored on hard disk in the form of aiff \, wav or pure
-text.;
-#X restore 40 239 pd Common_uses_for_arrays_in_PD;
-#X text 39 309 NOTE: I strongly recommend that you download the [arraysize]
-external to your "pd/extra" folder before continuing. Some of these
-examples are impossible without it -- I personally feel that [arraysize]
-should be considered for permanent inclusion in future Pd distributions.
-Check the CVS Repository or Pure-data.org for [arraysize].;
-#X text 40 459 This document is meant to supplement the help documentation
-for [table] \, [tabread] \, [tabwrite] \, [soundfiler] \, [tabsend~]
-\, [tabreceive~] \, [tabplay~] \, etc.;
-#X obj 4 4 cnv 15 500 20 empty empty all_about_arrays 20 10 1 18 -233017
--66577 0;
-#X obj 471 5 pddp/pddplink http://puredata.info/dev/pddp -text pddp;
-#X text 316 528 updated for Pd 0.38-2;
+#X text 33 127 first position in array = array[0];
+#X text 33 143 second position in array = array[1];
+#X restore 23 228 pd Populating_an_array;
+#X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 20 10
+1 18 -261106 -33289 0;
+#X text 7 1 Manipulate Arrays in Pd;
+#X text 19 37 Arrays in Pd are different than the arrays in other languages
+primarily because \, in Pd \, they are designed to be displayed graphically
+on screen. This is due to the nature of audio synthesis - we want to
+see our wave forms and visually understand the data. That's why arrays
+in Pd are complicated by other objects like tables \, graphs and widgets.
+PD uses these objects to provide a graphic representation of the array
+data.;
+#X text 20 139 Like all programming languages \, Pd provides numerous
+tools to manipulate arrays and their data. The follow examples may
+be used with "Put" menu arrays and with the [table] object (but \,
+unfortunately \, not with data structure arrays):;
+#N canvas 1 41 433 307 Clearing_an_array 0;
+#X obj 38 209 tabwrite exampleArray;
+#X obj 38 69 expr size("exampleArray");
+#X obj 38 187 0;
+#X obj 38 143 f;
+#X obj 66 143 + 1;
+#X obj 38 113 until;
+#X obj 38 91 t float bang;
+#X obj 107 113 0;
+#X obj 38 165 t b f;
+#X msg 38 42 bang;
+#X text 242 17 The Easy Way;
+#X msg 261 42 const 0;
+#X obj 261 69 s exampleArray;
+#X text 52 17 The Long \, Didactic Way;
+#X text 35 239 There's no "clear" message for arrays \, but you can
+just set a constant value of 0;
+#X text 35 273 See the next subpatch for more on setting constants.
+;
+#X connect 1 0 6 0;
+#X connect 2 0 0 0;
+#X connect 3 0 4 0;
+#X connect 3 0 8 0;
+#X connect 4 0 3 1;
+#X connect 5 0 3 0;
+#X connect 6 0 5 0;
+#X connect 6 1 7 0;
+#X connect 7 0 3 1;
+#X connect 8 0 2 0;
+#X connect 8 1 0 1;
+#X connect 9 0 1 0;
+#X connect 11 0 12 0;
+#X restore 23 272 pd Clearing_an_array;
+#X restore 43 157 pd How_to_manipulate_arrays_in_PD;
+#X text 40 226 For more discussion about arrays and tables \, please
+see:;
+#X obj 40 241 pddp/pddplink ../2.control.examples/15.array.pd;
+#X obj 40 256 pddp/pddplink ../2.control.examples/16.more.arrays.pd
+;