From 21859fabaa92215068d7176e504ac0d59d4301a5 Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Sat, 19 Nov 2005 23:14:18 +0000 Subject: added Buffer.resize example add Buffer.resize method svn path=/trunk/; revision=3980 --- externals/grill/py/pd/buffer-1.pd | 10 +++++----- externals/grill/py/pd/buffer-2.pd | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 5 deletions(-) create mode 100644 externals/grill/py/pd/buffer-2.pd (limited to 'externals/grill/py/pd') diff --git a/externals/grill/py/pd/buffer-1.pd b/externals/grill/py/pd/buffer-1.pd index ca799385..0314d3fe 100644 --- a/externals/grill/py/pd/buffer-1.pd +++ b/externals/grill/py/pd/buffer-1.pd @@ -1,4 +1,4 @@ -#N canvas 123 58 712 492 12; +#N canvas 123 58 716 496 12; #X obj 37 240 print; #X obj 107 241 print A; #X msg 30 139 reload; @@ -42,16 +42,16 @@ #X coords 0 1 99 -1 200 140 1; #X restore 65 301 graph; #X obj 36 199 py buffer @detach 1; -#X msg 192 127 mul array3 array1 array2; -#X msg 192 149 add array3 array1 array2; +#X msg 200 123 mul array3 array1 array2; +#X msg 200 145 add array3 array1 array2; #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 text 17 67 This demonstrates the usage of buffers. See the buffer.py script.; -#X msg 193 176 fadein array1; -#X msg 191 200 neg array2; +#X msg 201 172 fadein array1; +#X msg 199 196 neg array2; #X connect 2 0 6 0; #X connect 6 0 0 0; #X connect 6 1 1 0; diff --git a/externals/grill/py/pd/buffer-2.pd b/externals/grill/py/pd/buffer-2.pd new file mode 100644 index 00000000..fe066805 --- /dev/null +++ b/externals/grill/py/pd/buffer-2.pd @@ -0,0 +1,37 @@ +#N canvas 608 159 694 442 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 text 17 67 This demonstrates how to resize buffers; +#N canvas 0 0 450 300 graph1 0; +#X array array1 42 float 3; +#A 0 0 0 0 0 0.0285715 0.0857145 0.128572 0.171429 0.257144 0.314287 +0.385715 0.385715 0.385715 0.385715 0.385715 0.37143 0.342858 0.314287 +0.228572 0.128572 0.0428573 -0.0857145 -0.200001 -0.285715 -0.328572 +-0.357144 -0.400001 -0.428573 -0.428573 -0.457144 -0.457144 -0.457144 +-0.457144 -0.457144 -0.457144 -0.457144 -0.457144 -0.457144 -0.414287 +-0.342858 -0.314287 1.02445e-007; +#X coords 0 1 42 -1 200 140 1; +#X restore 413 259 graph; +#X msg 40 148 symbol array1; +#X obj 40 194 py pyext.Buffer @py 1; +#X obj 143 238 nbx 5 14 0 100 0 1 empty empty empty 0 -6 0 10 -260818 +-1 -1 42 256; +#X obj 143 260 t b f; +#X obj 39 287 pym 2 resize @py 1; +#X obj 40 120 loadbang; +#X text 37 310 returns buffer object; +#X obj 41 361 py .len; +#X text 111 361 call __builtin__.len; +#X text 222 192 create Buffer object; +#X obj 41 394 nbx 5 14 -1e+037 1e+037 0 0 empty empty empty 0 -6 0 +10 -261681 -1 -1 0 256; +#X connect 5 0 6 1; +#X connect 6 0 9 1; +#X connect 7 0 8 0; +#X connect 8 0 9 0; +#X connect 8 1 9 2; +#X connect 9 0 12 1; +#X connect 10 0 5 0; +#X connect 12 0 15 0; -- cgit v1.2.1