Update of /cvsroot/pure-data/doc/tutorials/intro In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20932
Added Files: 0.all_just_data.pd 0.bang.pd 0.connections.pd 0.controlling_dsp_processing.pd 0.execution_order.pd 0.exercise-template.pd 0.hello_world.pd 0.hot_and_cold_inlets.pd 0.init_to_0.pd 0.inlets_and_outlets.pd 0.pure_data_files.pd 0.right_to_left_order.pd 0.shell_sketch.pd 0.storage_objects.pd TODO Log Message: sketches for newbie tutorials. these will need to be renamed to be put in a better order
--- NEW FILE: 0.execution_order.pd --- #N canvas 0 22 458 308 10; #X text 150 11 execution order; #X obj 77 78 trigger b f a; #X text 58 140 audio is simultaneous; #X obj 69 186 osc~ 500; #X obj 91 229 *~; #X obj 78 255 dac~; #X obj 108 208 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1; #X text 63 33 execution order is "undefined".; #X text 41 54 If you need to specify execution order , using [trigger]: ; #X connect 3 0 4 0; #X connect 4 0 5 1; #X connect 4 0 5 0; #X connect 6 0 4 1;
--- NEW FILE: 0.right_to_left_order.pd --- #N canvas 427 300 455 442 10; #X text 19 12 In Pd , you read a patch from right to left , from top to bottom.; #X text 18 47 The [trigger] object is used to enforce execution order. If you need things to run in a certain order , then you use a [trigger]. ; #X obj 74 117 bng 25 250 50 0 empty empty empty -2 -8 1 10 -24198 -1 -1; #X obj 74 151 trigger bang bang bang; #X obj 85 257 +; #X obj 136 233 +; #X msg 197 198 1; #X msg 127 197 2; #X msg 78 196 3; #X floatatom 86 280 5 0 0 0 - - -; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 3 1 7 0; #X connect 3 2 6 0; #X connect 4 0 9 0; #X connect 5 0 4 1; #X connect 6 0 5 1; #X connect 7 0 5 0; #X connect 8 0 4 0;
--- NEW FILE: 0.storage_objects.pd --- #N canvas 277 67 501 498 10; #X text 157 15 storage objects; #X obj 159 66 symbol; #X obj 117 66 bang; #X obj 280 66 f; #X obj 215 66 float; #X text 255 66 aka; #X text 88 35 A storage object stores a value.; #X text 26 361 If a storage object receives a value on the left inlet , then it outputs that value immediately in addition to storing it. ; #X text 25 231 If a storage object receives a value on the right inlet , then it stores that value.; #X text 18 100 If you bang the left inlet of a storage object , it outputs its stored value.; #X obj 177 142 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 177 192 pddp_print; #X obj 177 165 float; #X obj 166 274 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 180 325 pddp_print; #X obj 180 298 float; #X msg 193 274 123; #X obj 180 455 pddp_print; #X obj 180 428 float; #X msg 210 403 123; #X msg 180 403 432; #X obj 159 404 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 225 274 321; #X connect 10 0 12 0; #X connect 12 0 11 0; #X connect 13 0 15 0; #X connect 15 0 14 0; #X connect 16 0 15 1; #X connect 18 0 17 0; #X connect 19 0 18 1; #X connect 20 0 18 0; #X connect 21 0 18 0; #X connect 22 0 15 1;
--- NEW FILE: 0.bang.pd --- #N canvas 435 180 493 371 10; #X text 164 19 bang; #X text 27 47 In Pd , "bang" means "do something". What that "something" is depends on the object receiving the bang.; #X obj 34 121 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 36 283 bng 25 250 50 0 empty empty do_it! -2 -8 1 10 -24198 -1 -1; #X obj 38 318 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 ; #X obj 34 150 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 ; #X msg 35 196 bang; #X obj 35 221 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 ; #X text 56 119 <--bang button; #X text 79 197 <--you can also send "bang" using a message box; #X text 77 282 <-- bang buttons have configurable properties , like color , labels , fonts , size , etc.; #X connect 2 0 5 0; #X connect 3 0 4 0; #X connect 6 0 7 0;
--- NEW FILE: 0.connections.pd --- #N canvas 505 182 454 304 10; #X text 41 27 Pd patches are always running and changes take effect immediately.; #X obj 364 241 dac~; #X obj 373 186 osc~ 500; #X floatatom 67 181 5 0 0 0 - - -; #X floatatom 67 245 5 0 0 0 - - -; #X obj 107 64 tgl 30 0 empty empty start 2 15 1 12 -24198 -1 -1 1 1 ; #X msg 141 106 ; pd dsp $1; #X obj 66 106 metro 100; #X obj 66 127 random 100; #X text 97 214 <-- connect these , then disconnect -->; #X connect 5 0 6 0; #X connect 5 0 7 0; #X connect 7 0 8 0; #X connect 8 0 3 0;
--- NEW FILE: 0.init_to_0.pd --- #N canvas 707 44 458 308 10; #X text 41 16 float values are automatically initialized to 0 in Pd. ; #X obj 4 114 +; #X obj 5 81 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1 -1 ; #X obj 118 114 *; #X obj 227 113 float; #X obj 347 113 trigger f; #X obj 178 151 bng 15 250 50 0 empty empty reset 0 -6 0 8 -262144 -1 -1; #X obj 4 188 pddp_print; #X obj 117 187 pddp_print; #X obj 227 187 pddp_print; #X obj 347 187 pddp_print; #X obj 117 81 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1 -1; #X obj 226 81 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1 -1; #X obj 346 81 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1 -1; #X connect 1 0 7 0; #X connect 2 0 1 0; #X connect 3 0 8 0; #X connect 4 0 9 0; #X connect 5 0 10 0; #X connect 6 0 7 0; #X connect 6 0 8 0; #X connect 6 0 9 0; #X connect 6 0 10 0; #X connect 11 0 3 0; #X connect 12 0 4 0; #X connect 13 0 5 0;
--- NEW FILE: 0.exercise-template.pd --- #N canvas 552 273 483 299 10; #N canvas 414 102 546 555 guts 0; #X msg 280 45 ; pd filename exercise-patch.pd /tmp ; #N canvas ; #X pop 1 ;; #X obj 300 328 s pd-exercise-patch.pd; #X msg 329 216 obj 50 103 osc~; #X msg 330 240 obj 50 153 dac~; #X obj 103 17 inlet; #X msg 320 155 clear; #X obj 276 7 loadbang; #X obj 259 108 delay 1000; #X obj 259 129 t b b b b; #X msg 52 155 connect 0 0 1 0; #X msg 37 216 connect 1 0 2 0; #X msg 31 266 connect 1 0 2 1; #X msg 292 27 ; pd dsp 1; #X obj 112 108 t b b; #X msg 87 52 bang; #X obj 34 134 delay 2000; #X obj 21 187 delay 2000; #X obj 10 245 delay 2000; #N canvas 261 307 459 387 connection-effect 0; #X obj 186 312 dac~; #X obj 72 233 osc~ 1000; #X obj 138 266 *~; #X obj 253 259 *~; #X obj 204 236 osc~ 800; #X obj 153 236 line~; #X obj 183 7 inlet; #X msg 184 31 bang; #X obj 187 61 t b b; #X obj 168 95 delay 10; #X msg 201 125 0 10; #X obj 276 218 line~; #X obj 276 191 pipe 30; #X msg 241 125 1 10; #X connect 1 0 2 0; #X connect 2 0 0 0; #X connect 3 0 0 1; #X connect 4 0 3 0; #X connect 5 0 2 1; #X connect 6 0 7 0; #X connect 7 0 8 0; #X connect 8 0 9 0; #X connect 8 1 13 0; #X connect 9 0 10 0; #X connect 10 0 5 0; #X connect 10 0 12 0; #X connect 11 0 3 1; #X connect 12 0 11 0; #X connect 13 0 5 0; #X connect 13 0 12 0; #X restore 22 365 pd connection-effect; #X msg 256 453 floatatom 50 50 5 0 0 0; #X msg 327 184 obj 50 50 hsl; #X obj 197 18 inlet; #X msg 205 50 bang; #X connect 2 0 1 0; #X connect 3 0 1 0; #X connect 4 0 14 0; #X connect 5 0 1 0; #X connect 6 0 0 0; #X connect 6 0 7 0; #X connect 6 0 12 0; #X connect 7 0 8 0; #X connect 8 0 3 0; #X connect 8 1 2 0; #X connect 8 2 20 0; #X connect 8 3 5 0; #X connect 9 0 1 0; #X connect 10 0 1 0; #X connect 11 0 1 0; #X connect 13 0 15 0; #X connect 13 1 8 0; #X connect 14 0 13 0; #X connect 15 0 16 0; #X connect 15 0 9 0; #X connect 15 0 18 0; #X connect 16 0 17 0; #X connect 16 0 10 0; #X connect 16 0 18 0; #X connect 17 0 11 0; #X connect 17 0 18 0; #X connect 20 0 1 0; #X connect 21 0 22 0; #X connect 22 0 8 0; #X restore 290 216 pd guts; #X msg 290 185 solve; #X text 53 28 In the exercise patch , connect the existing objects so that you can control the frequency of the oscillator and hear the resulting sound.; #X text 84 88 If you want help , click the solve message below.; #X msg 346 184 try again; #X connect 1 0 0 0; #X connect 4 0 0 1;
--- NEW FILE: 0.hot_and_cold_inlets.pd --- #N canvas 631 161 491 539 10; #X text 123 18 "hot" and "cold" inlets; #X obj 28 222 +; #X floatatom 28 251 5 0 0 0 - - -; #X msg 28 158 1; #X msg 45 194 5; #X text 23 50 For most objects in Pd , the leftmost inlet is the "hot" inlet. This means that it will output something whenever it receives data on the "hot" inlet.; #X text 24 99 All other inlets are generally "cold" inlets , which merely store the data they receive until input on the "hot" inlet causes the object to do its thing.; #X text 74 195 2) click this and there will be no new output; #X text 74 157 1) click this first , and [+ ] immediately ouptputs a 1; #X obj 190 396 +; #X floatatom 190 425 5 0 0 0 - - -; #X msg 113 331 1; #X text 28 304 Try a number of different combinations to see for yourself: ; #X text 223 390 <-- "cold" inlet; #X text 72 390 "hot" inlet -->; #X msg 143 331 2; #X msg 173 331 3; #X msg 253 331 4; #X msg 283 331 5; #X msg 313 331 6; #X text 74 227 3) now click the [1( message box , and you get a new output; #X text 31 458 Notice that the number is stored in the "cold" inlet until you change it. For example , if you click [4( , then click [1( , [2( , and [3( , you will see that 1 , 2 , and 3 are all added to 4; #X connect 1 0 2 0; #X connect 3 0 1 0; #X connect 4 0 1 1; #X connect 9 0 10 0; #X connect 11 0 9 0; #X connect 15 0 9 0; #X connect 16 0 9 0; #X connect 17 0 9 1; #X connect 18 0 9 1; #X connect 19 0 9 1;
--- NEW FILE: 0.pure_data_files.pd --- #N canvas 19 110 649 545 10; #X obj 191 209 textfile; #X obj 111 239 print all; #X msg 137 164 bang; #X msg 191 163 rewind; #X obj 131 307 route canvas; #X obj 112 434 print width; #X obj 51 385 print Xpos; #X obj 81 410 print Ypos; #X obj 143 459 print heigth; #X obj 174 384 print fontsize; #X obj 51 354 unpack f f f f f; #X text 35 17 As much as possible , every message in Pd uses the same format , hence the name "pure data".; #X text 53 78 Here is a patch that reads the file of this patch:; #X msg 272 167 read 0.pure_data_files.pd; #N canvas 0 22 557 556 clone 1; #X obj 191 209 textfile; #X obj 111 239 print all; #X msg 137 164 bang; #X msg 191 163 rewind; #X obj 131 307 route canvas; #X obj 112 434 print width; #X obj 51 385 print Xpos; #X obj 81 410 print Ypos; #X obj 143 459 print heigth; #X obj 174 384 print fontsize; #X obj 51 354 unpack f f f f f; #X text 35 17 As much as possible , every message in Pd uses the same format , hence the name "pure data".; #X text 53 78 Here is a patch that reads the file of this patch:; #X msg 272 167 read 0.pure_data_files.pd; #X obj 356 405 s pd-clone; #X obj 191 234 route #N #X; #X obj 138 135 metro 1000; #X obj 271 115 loadbang; #X obj 138 109 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1; #X obj 363 295 loadbang; #X msg 359 319 vis 1 , clear; #X connect 0 0 1 0; #X connect 0 0 16 0; #X connect 2 0 0 0; #X connect 3 0 0 0; #X connect 4 0 10 0; #X connect 10 0 6 0; #X connect 10 1 7 0; #X connect 10 2 5 0; #X restore 430 484 pd clone; #X obj 356 405 s pd-clone; #X obj 191 234 route #N #X; #X obj 138 135 metro 1000; #X obj 271 115 loadbang; #X obj 138 109 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1; #X obj 363 295 loadbang; #X msg 359 319 vis 1 , clear; #X connect 0 0 1 0; #X connect 0 0 16 0; #X connect 2 0 0 0; #X connect 3 0 0 0; #X connect 4 0 10 0; #X connect 10 0 6 0; #X connect 10 1 7 0; #X connect 10 2 5 0; #X connect 10 3 8 0; #X connect 10 4 9 0; #X connect 13 0 0 0; #X connect 16 0 4 0; #X connect 16 1 15 0; #X connect 17 0 2 0; #X connect 18 0 13 0; #X connect 18 0 3 0; #X connect 19 0 17 0; #X connect 20 0 21 0; #X connect 21 0 15 0;
--- NEW FILE: 0.all_just_data.pd --- #N canvas 0 22 454 304 10; #X text 152 35 Its all just data.;
--- NEW FILE: 0.controlling_dsp_processing.pd --- #N canvas 361 163 471 494 10; #X text 117 189 (screenshot of main Pd window); #X msg 26 288 ; pd dsp 1; #X msg 93 288 ; pd dsp 0; #X text 19 252 As with most programming languages , in Pd "1" means on , and "0" means off.; #X obj 210 283 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1; #X msg 209 308 ; pd dsp $1; #X text 28 137 To see whether the DSP is on or off , look at the checkbox on the main Pd window. You can also turn the DSP on and off using that checkbox.; #X obj 344 343 osc~ 250; #X obj 330 375 dac~; #X text 24 20 You can turn the processing of audio data on and off. In order for your patch to run , you need to make sure that "compute audio" is turned on. This is also known as the "DSP". There are a couple ways of turning the "DSP" on and off.; #X text 23 100 - TODO: is Gem or PDP computation also controlled by the DSP?; #X text 23 407 There are also keyboard shortcuts:; #X text 34 459 (On MacOS X , you can also use Cmd-. and Cmd-/); #X text 41 425 off: Ctrl-.; #X text 48 440 on: Ctrl-/; #X text 73 84 - TODO: messages are always processed; #X connect 4 0 5 0; #X connect 7 0 8 0; #X connect 7 0 8 1;
--- NEW FILE: 0.hello_world.pd --- #N canvas 228 159 497 433 10; #X msg 144 98 Hello world!; #X obj 143 144 print; #X text 235 99 <-- message box; #X text 149 121 <-- connection , aka "cord"; #X text 18 28 In Pd , programming is done with boxes which are connected together. The boxes have "inlets" and "outlets" , where they are connected. ; #X text 80 137 inlet-->; #X text 85 90 inlet-->; #X text 77 106 outlet-->; #X text 185 144 <-- object box; #X connect 0 0 1 0;
--- NEW FILE: TODO ---
- make object which outputs previous and next files
- make patch close itself, otherwise: - upon [loadbang], wait, then close previous patch
--- NEW FILE: 0.inlets_and_outlets.pd --- #N canvas 128 360 462 312 10; #X obj 213 114 inlet; #X obj 213 146 outlet; #X text 110 26 inlets and outlets; #X text 37 70 You connect Pd objects using their inlets and outlets. ; #N canvas 0 22 454 304 object 0; #X obj 175 99 inlet; #X obj 174 206 outlet; #X connect 0 0 1 0; #X restore 41 117 pd object; #X text 39 219 Connections are always made from the inlet to the outlet since that always the direction that the data flows.; #N canvas 0 22 454 304 another 0; #X obj 175 99 inlet; #X obj 174 206 outlet; #X connect 0 0 1 0; #X restore 40 147 pd another object; #X text 38 258 Try making connections yourself.; #X connect 4 0 6 0;
--- NEW FILE: 0.shell_sketch.pd --- #N canvas 369 214 524 457 10; #X obj 92 138 soundfiler; #X obj 228 139 getdir; #X obj 168 319 shell; #X obj 169 373 print; #X obj 233 98 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 191 253 t a a; #X obj 225 275 print; #X msg 169 220 ls -1 "$1"; #X connect 1 0 7 0; #X connect 2 0 3 0; #X connect 4 0 1 0; #X connect 5 0 2 0; #X connect 5 1 6 0; #X connect 7 0 5 0;