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
|
#N canvas 267 75 1035 695 12;
#X text 69 15 ARRAYS;
#N canvas 0 0 450 300 (subpatch) 0;
#X array array99 5 float 2;
#X coords 0 1 5 -1 403 199 1 0 0;
#X restore 31 340 graph;
#X msg 630 130 \; array99 resize \$1;
#X floatatom 492 65 4 0 0 0 - - - 0;
#X obj 492 99 / 100;
#X msg 492 129 \; array99 const \$1;
#X msg 804 33 \; array99 print;
#X text 663 96 resize;
#X obj 132 619 tabread;
#X obj 131 593 tabwrite;
#X obj 293 593 tabread4~;
#X obj 366 593 tabwrite~;
#X obj 324 645 tabreceive~;
#X text 243 565 ...and audio signals:;
#X obj 258 645 tabsend~;
#X msg 797 113 \; array99 normalize;
#X msg 798 155 \; array99 normalize 0.5;
#X text 791 91 normalize to 1 or otherwise;
#X obj 263 618 tabosc4~;
#X text 494 184 Fourier synthesis (resizes table);
#X obj 131 645 tabread4;
#X obj 228 593 tabread~;
#X obj 728 473 savepanel;
#X msg 728 500 \; array99 write \$1;
#X text 911 37 print info;
#X obj 509 619 array size array99;
#X obj 652 565 bng 19 250 50 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000;
#X floatatom 509 647 5 0 0 0 - - - 0;
#X obj 699 323 soundfiler;
#X msg 699 270 read -resize ../sound/voice2.wav array99;
#X msg 712 297 read -ascii -resize 15.file.txt array99;
#X text 133 566 control:;
#X text 578 565 get size, f 9;
#X obj 331 618 tabplay~;
#X text 26 587 Objects are provided for reading and writing --->, f 13;
#X floatatom 630 97 4 0 0 0 - - - 0;
#X obj 728 443 bng 19 250 50 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000;
#X text 531 64 <-- set to a constant value;
#X text 686 555 See also [array] for many array operations and [expr] for C-style expressions and functions with array access., f 42;
#X obj 652 619 expr size("array99");
#X floatatom 652 647 5 0 0 0 - - - 0;
#X text 471 274 check [soundfiler] for reading and writing files. The example to the right reads a soundfile or a text file to an array., f 30;
#X text 31 48 Arrays in Pd provide a unified way to deal with lists of numbers \, treating them as either audio samples or control messages. To make an array \, select "Array" on the "Put" menu. Dialogs appear to help you choose the name \, array size and various flags (for instance \, if the contents of the array are saved with the patch or not.) Right click for properties where you can edit these settings as well and also get 'help' for detailed reference information., f 57;
#X text 509 15 Some messgages you can send to an array object:, f 28;
#X text 31 233 Arrays live in graphs. When you make an array you can choose to include it in a new graph or in a 'last' graph \, which allows you to include more than one array in the same graph (as the next example shows.) You can click on arrays and drag to set and change values., f 57;
#X text 31 174 It's also possible to change most of these settings with messages sent to the array name \, like changing the array size with the "resize" message shown to the right., f 57;
#X msg 509 460 \; array99 write ~/test.txt;
#X text 756 435 You can also use these objects, f 16;
#X obj 900 443 bng 19 250 50 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000;
#X msg 900 500 \; array99 read \$1;
#X obj 900 473 openpanel;
#X msg 477 208 \; array99 sinesum 4096 0.2 0.2 0.2 0.2;
#X msg 749 208 \; array99 cosinesum 4096 0.2 0.2 0.2 0.2;
#X msg 803 363 \; array99 read 15.file.txt \, resize 5, f 25;
#X text 470 355 A simpler way to read a text file is with the 'read' message (but it lacks a -resize flag). The write message also exist for writting and both 'read'/'write' expand "~" to the home directory., f 45;
#X connect 3 0 4 0;
#X connect 4 0 5 0;
#X connect 22 0 23 0;
#X connect 25 0 27 0;
#X connect 26 0 25 0;
#X connect 26 0 39 0;
#X connect 29 0 28 0;
#X connect 30 0 28 0;
#X connect 35 0 2 0;
#X connect 36 0 22 0;
#X connect 39 0 40 0;
#X connect 48 0 50 0;
#X connect 50 0 49 0;
|