File: 11.array.pd

package info (click to toggle)
pd 0.32p1-5
  • links: PTS
  • area: main
  • in suites: woody
  • size: 4,704 kB
  • ctags: 5,418
  • sloc: ansic: 38,382; tcl: 1,036; makefile: 612; sh: 265
file content (48 lines) | stat: -rw-r--r-- 2,595 bytes parent folder | download
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
#N canvas 8 0 939 667 12;
#X text 170 16 ARRAYS;
#X graph graph1 0 -1 66 1 500 349 900 49;
#X array array99 67 float;
#X pop;
#X msg 150 301 \; array99 resize \$1;
#X floatatom 150 273 0 0 0;
#X floatatom 18 247 0 0 0;
#X obj 18 275 / 100;
#X msg 18 300 \; array99 const \$1;
#X text 19 224 You can send messages to an array object:;
#X msg 285 301 \; array99 print;
#X text 54 248 <-- set to a constant value;
#X text 185 272 resize;
#X text 286 268 print size;
#X text 19 436 read a text file;
#X text 24 498 write a text file;
#X msg 8 518 \; array99 write /tmp/file.txt;
#X msg 214 463 \; array99 read16 ../sound/beat.aiff 106 b;
#X msg 215 518 \; array99 write16 /tmp/file.wav;
#X text 212 496 write a WAV format soundfile;
#X text 214 441 read a 16-bit signed binary file;
#X obj 110 625 tabread;
#X obj 167 625 tabwrite;
#X text 17 585 Objects are provided for reading and writing the contents of arrays via control messages:;
#X obj 456 583 tabread4~;
#X obj 456 604 tabwrite~;
#X obj 536 605 tabreceive~;
#X text 451 561 ...and audio signals:;
#X obj 536 585 tabsend~;
#X text 505 399 The "read16" message at left takes two optional arguments. The first one specifies a number of bytes to skip (the "header") and the second allows you to specify little endian or big endian data. (If you don't specify it \, your machine's native byte order is assumend.);
#X text 17 130 Arrays created by menu always get 100 elements. You can change this using the "resize" message shown below. Arrays live in graphs and graphs may hold more than one array \; however \, graphs containing more than one array won't know how to readjust themselves correctly when the arrays are resized.;
#X text 16 39 Arrays in Pd provide a unified way to deal with lists of numbers \, treating them as either audio samples or for "control" uses. To make one \, select "array" on the "new" menu. It is given a name like "array99". (if you want to change the name \, you can type "array99 rename myname" to the "message" dialog in the File manu.);
#X msg 8 461 \; array99 read 11.file.txt;
#X msg 318 363 \; array99 normalize;
#X msg 319 398 \; array99 normalize 0.5;
#X text 313 345 normalize to 1 or otherwise;
#X text 624 493 A better mechanism for reading;
#X text 623 509 and writing soundfiles:;
#X obj 678 531 soundfiler;
#X text 708 630 last updated for release 0.33.;
#X obj 635 584 tabosc4~;
#X msg 17 365 \; array99 sinesum 64 0.2 0.2 0.2 0.2;
#X msg 17 400 \; array99 cosinesum 64 0.2 0.2 0.2 0.2;
#X text 20 345 Fourier synthesis (resizes table);
#X connect 3 0 2 0;
#X connect 4 0 5 0;
#X connect 5 0 6 0;