Update of /cvsroot/pure-data/externals/grill/py/pd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4239/pd
Modified Files: script-1.pd simple-2.pd Added Files: builtins-1.pd methods-1.pd methods-2.pd Log Message: python-like dotted module.function syntax reworked outbound message generation (now with symbols instead of one-element anythings) multiply inlets for py (hot and cold inlets) cleaned up float vs. int pyext tags pymeth object for object methods enable built-in functions sequence protocol for symbol type enabled built-in functions py: allow all callables
Index: script-1.pd =================================================================== RCS file: /cvsroot/pure-data/externals/grill/py/pd/script-1.pd,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** script-1.pd 31 Mar 2005 03:54:10 -0000 1.7 --- script-1.pd 9 Jul 2005 13:03:34 -0000 1.8 *************** *** 1,3 **** ! #N canvas 297 17 696 538 12; #X obj 39 278 print; #X obj 345 251 print; --- 1,3 ---- ! #N canvas 297 17 700 542 12; #X obj 39 278 print; #X obj 345 251 print; *************** *** 27,31 **** #X obj 43 424 py script addall; #X obj 350 420 py script; - #X obj 516 419 py script ret3; #X obj 346 204 py script strlen; #X msg 21 159 dir; --- 27,30 ---- *************** *** 40,44 **** #X text 505 372 just trigger without arguments; #X msg 386 371 set ret4; ! #X connect 2 0 25 1; #X connect 3 0 21 1; #X connect 4 0 21 1; --- 39,44 ---- #X text 505 372 just trigger without arguments; #X msg 386 371 set ret4; ! #X obj 516 419 py script ret3; ! #X connect 2 0 24 1; #X connect 3 0 21 1; #X connect 4 0 21 1; *************** *** 46,64 **** #X connect 7 0 22 1; #X connect 9 0 23 0; ! #X connect 11 0 24 0; #X connect 12 0 21 1; ! #X connect 13 0 25 0; #X connect 14 0 23 0; #X connect 15 0 23 0; ! #X connect 17 0 25 1; #X connect 19 0 21 0; #X connect 21 0 0 0; ! #X connect 21 1 27 0; #X connect 22 0 5 0; #X connect 23 0 8 0; ! #X connect 24 0 10 0; ! #X connect 25 0 1 0; ! #X connect 26 0 21 0; ! #X connect 28 0 21 0; ! #X connect 32 0 25 1; ! #X connect 35 0 23 0; --- 46,64 ---- #X connect 7 0 22 1; #X connect 9 0 23 0; ! #X connect 11 0 35 0; #X connect 12 0 21 1; ! #X connect 13 0 24 0; #X connect 14 0 23 0; #X connect 15 0 23 0; ! #X connect 17 0 24 1; #X connect 19 0 21 0; #X connect 21 0 0 0; ! #X connect 21 1 26 0; #X connect 22 0 5 0; #X connect 23 0 8 0; ! #X connect 24 0 1 0; ! #X connect 25 0 21 0; ! #X connect 27 0 21 0; ! #X connect 31 0 24 1; ! #X connect 34 0 23 0; ! #X connect 35 0 10 0;
--- NEW FILE: builtins-1.pd --- #N canvas 327 349 706 421 12; #X obj 36 241 py .range @xlate 0; #X floatatom 35 356 5 0 0 0 - - -; #X obj 35 323 py .sum; #X obj 16 13 cnv 15 650 40 empty empty py/pyext 10 22 0 24 -260818 -1 0; #X text 235 16 Python script objects , (C)2003-2005 Thomas Grill; #X text 235 32 http://grrrr.org/ext; #X obj 36 159 nbx 5 14 -1e+037 1e+037 0 1 empty empty min 0 -6 0 10 -262131 -1 -1 38 256; #X obj 95 159 nbx 5 14 -1e+037 1e+037 0 1 empty empty max 0 -6 0 10 -262131 -1 -1 100 256; #X obj 154 159 nbx 5 14 1 100000 1 1 empty empty step 0 -6 0 10 -262131 -1 -1 1 256; #N canvas 0 0 462 312 pak3 0; #X obj 34 26 inlet; #X obj 81 28 inlet; #X obj 129 28 inlet; #X obj 36 158 outlet; #X obj 36 123 pack 0 0 0; #X obj 61 78 t b f; #X obj 108 80 t b f; #X obj 208 46 loadbang; #X obj 208 73 1; #X connect 0 0 4 0; #X connect 1 0 5 0; #X connect 2 0 6 0; #X connect 4 0 3 0; #X connect 5 0 4 0; #X connect 5 1 4 1; #X connect 6 0 4 0; #X connect 6 1 4 2; #X connect 7 0 8 0; #X connect 8 0 4 2; #X restore 36 195 pd pak3; #X text 115 240 construct a Python list; #X text 78 282 Python object pointer is propagated to next object; #X text 106 320 calculate sum over list elements; #X text 21 73 Py can use built-in Python functions; #X text 21 97 A . preceding the function name searches for the function in either the pyext module or in __builtins__; #X connect 0 0 2 1; #X connect 2 0 1 0; #X connect 6 0 9 0; #X connect 7 0 9 1; #X connect 8 0 9 2; #X connect 9 0 0 1;
Index: simple-2.pd =================================================================== RCS file: /cvsroot/pure-data/externals/grill/py/pd/simple-2.pd,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** simple-2.pd 19 Jan 2005 04:58:35 -0000 1.3 --- simple-2.pd 9 Jul 2005 13:03:34 -0000 1.4 *************** *** 1,3 **** ! #N canvas 95 223 654 394 12; #X floatatom 202 113 5 0 0 0 - - -; #X text 338 286 watch the console output!; --- 1,3 ---- ! #N canvas 570 275 788 398 12; #X floatatom 202 113 5 0 0 0 - - -; #X text 338 286 watch the console output!; *************** *** 17,27 **** #X msg 193 180 hello; #X msg 266 179 msg; - #X msg 325 154 hello 3; - #X text 338 189 special case: 'hello' handler doesn't like args , - so _anything_ is called!; #X obj 16 13 cnv 15 600 40 empty empty py/pyext 10 22 0 24 -260818 -1 0; #X text 213 16 Python script objects , (C)2003-2005 Thomas Grill; #X text 213 32 http://grrrr.org/ext; #X connect 0 0 8 1; #X connect 2 0 8 0; --- 17,25 ---- #X msg 193 180 hello; #X msg 266 179 msg; #X obj 16 13 cnv 15 600 40 empty empty py/pyext 10 22 0 24 -260818 -1 0; #X text 213 16 Python script objects , (C)2003-2005 Thomas Grill; #X text 213 32 http://grrrr.org/ext; + #X msg 333 186 whoopie a b c; #X connect 0 0 8 1; #X connect 2 0 8 0; *************** *** 37,39 **** #X connect 14 0 8 3; #X connect 15 0 8 2; ! #X connect 16 0 8 3; --- 35,37 ---- #X connect 14 0 8 3; #X connect 15 0 8 2; ! #X connect 19 0 8 3;
--- NEW FILE: methods-1.pd --- #N canvas 540 469 714 349 12; #X obj 16 13 cnv 15 650 40 empty empty py/pyext 10 22 0 24 -260818 -1 0; #X text 235 16 Python script objects , (C)2003-2005 Thomas Grill; #X text 235 32 http://grrrr.org/ext; #X symbolatom 21 139 10 0 0 0 - - -; #X symbolatom 25 298 10 0 0 0 - - -; #X obj 25 252 pym upper; #X obj 22 179 py .str @xlate 0; #X text 93 167 convert the symbol to a Python string; #X text 35 216 pass it as a true Python object; #X text 105 251 use string.upper method; #X obj 363 252 py string.upper; #X symbolatom 364 288 10 0 0 0 - - -; #X text 495 254 use module function; #X text 23 119 enter some text; #X text 21 73 Py can act on Python objects in a object-oriented manner ; #X text 93 184 using the built-in str function; #X connect 3 0 6 1; #X connect 5 0 4 0; #X connect 6 0 5 1; #X connect 6 0 10 1; #X connect 10 0 11 0;
--- NEW FILE: methods-2.pd --- #N canvas 540 469 734 339 12; #X obj 16 13 cnv 15 650 40 empty empty py/pyext 10 22 0 24 -260818 -1 0; #X text 235 16 Python script objects , (C)2003-2005 Thomas Grill; #X text 235 32 http://grrrr.org/ext; #X symbolatom 21 139 10 0 0 0 - #0-t -; #X text 23 119 enter some text; #X text 21 73 Py can act on Python objects in a object-oriented manner ; #X obj 25 252 pym 2 *; #X obj 213 169 t b f; #X text 105 251 repeat text; #X text 215 117 multiply it!; #X symbolatom 25 283 80 0 0 0 - - -; #X obj 214 139 nbx 5 14 1 100 0 1 empty empty empty 0 -6 0 10 -262131 -1 -1 34 256; #N canvas 0 0 458 308 init 0; #X obj 61 116 s $0-t; #X obj 64 44 loadbang; #X obj 64 81 symbol a; #X connect 1 0 2 0; #X connect 2 0 0 0; #X restore 606 127 pd init; #X connect 3 0 6 1; #X connect 6 0 10 0; #X connect 7 0 6 0; #X connect 7 1 6 2; #X connect 11 0 7 0;