[PD] Simple editor like patch for dynamically create/delete objects.........

Roman Haefeli reduzierer at yahoo.de
Thu Nov 25 18:57:27 CET 2004


hi chun

nice tool, you are developing.
to pick up your intention to create selfmade abs (small agents), i
think, an option to set arguments would be funny, so the overall/global
behaviour gets more interesting.

roman

----- Original Message -----
From: "chun lee" <leechun at leechun.freeserve.co.uk>
To: "Pd_list" <pd-list at iem.at>
Sent: Thursday, November 25, 2004 1:54 AM
Subject: [PD] Simple editor like patch for dynamically create/delete
objects.........


> Hi there:
>
> I have been messing around with Pd's internal message for a bit and I
came
> up with this patch. Its a bit like a editor for objects/patches (best
> description I can think of).
>
> It essentially allows you to dynamically (re)create/delete
objects/patches
> while keeping a object count. Because of this, it creates objects into
rows
> and columns so you can see what's been created/deleted and it looks
nice.
> You can also specify the space between each object and the number of
objects
> allowed per line.
>
> My idea is to develop this into a performance tool and each of the
patch
> that's been created are designed as autonomous agent or something like
that.
> I have tried it with very simple dsp abstractions and it seems to work
ok.
>
> There are many problems that I can see if I am taking this further,
but this
> is step one.
>
> Anyway, I hope some one you might find this interesting and take a
look at
> it and give me some feedback as to how things can be better put
together.
> And perhaps work on it together.
>
> Apologies if its a bad practice to put long patch text on the list,
please
> let me know and I will behave myself;)
>
> Cheers
>
> CHUN
>
> Just remembered something that I forgot to comment in the patch, if
object
> you are creating takes more horizontal space, remember to increase the
space
> parameter so that each object don't overlap.
>
> /*---- patch begin
here ------------------------------------------------*/
>
>
> #N canvas 20 445 547 197 10;
> #N canvas 384 46 586 269 dynamic 1;
> #X restore 468 3 pd dynamic;
> #X floatatom 61 117 5 0 0 0 - - -;
> #X floatatom 109 117 5 0 0 0 - - -;
> #X obj 157 116 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
> -1;
> #X floatatom 205 85 5 0 0 0 - - -;
> #X floatatom 253 102 5 0 0 0 - - -;
> #X obj 302 118 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
> -1;
> #X text 60 100 create/delete/del 1;
> #X text 320 117 reset x;
> #N canvas 65 43 905 569 <<.....:::::_create/delete_:::::.....>> 0;
> #X obj 417 472 print;
> #X msg 419 450 -----;
> #X obj 205 522 s pd-dynamic;
> #X msg 524 180 cut;
> #X floatatom 220 62 5 0 0 0 - - -;
> #X obj 705 435 pack s \$1 0 0 0;
> #X msg 705 341 symbol mouse;
> #X obj 705 457 route list;
> #X obj 553 437 pack s \$1 0 0 0;
> #X obj 553 458 route list;
> #X msg 553 214 symbol mouseup;
> #X obj 220 79 s space;
> #X text 7 4 dynamiclly create n number of dplay;
> #X text 521 -2 dynamically delete n number of dplay;
> #X text 218 44 space unit;
> #X obj 10 481 pack s f f s;
> #X msg 62 458 0;
> #X msg 10 69 symbol obj;
> #X obj 10 502 route list;
> #X obj 10 122 repeat 5;
> #X floatatom 10 22 5 0 0 0 - - -;
> #X obj 28 241 - 1;
> #X obj 28 266 *;
> #X obj 58 217 f;
> #X obj 28 217 +;
> #X obj 28 192 t f b;
> #X msg 28 171 1;
> #X msg 74 194 0;
> #X obj 55 402 s last_x;
> #X obj 53 266 r last_x;
> #X obj 55 340 +;
> #X msg 55 359 set \$1;
> #X msg 55 381 40;
> #X obj 28 291 + 0;
> #X floatatom 309 296 5 0 0 0 - - -;
> #X obj 299 230 * 2;
> #X obj 283 250 -;
> #X obj 283 204 t f f;
> #X obj 582 127 != 0;
> #X obj 524 126 spigot;
> #X obj 265 319 s current_objs;
> #X obj 582 105 r current_objs;
> #X obj 28 312 % 400;
> #X obj 253 418 * 25;
> #X msg 253 439 set \$1;
> #X obj 253 369 / 10;
> #X obj 253 391 % 10;
> #X floatatom 286 418 5 0 0 0 - - -;
> #X obj 283 295 f;
> #X obj 253 295 +;
> #X obj 253 270 t f b;
> #X msg 253 249 1;
> #X msg 299 272 0;
> #X obj 253 345 - 1;
> #X obj 722 124 s last_x;
> #X msg 722 103 0;
> #X obj 306 439 s last_y;
> #X msg 799 379 0;
> #X msg 799 360 set \$1;
> #X obj 799 339 r last_y;
> #X obj 349 347 * 10;
> #X obj 333 371 -;
> #X floatatom 305 61 5 0 0 0 - - -;
> #X obj 305 84 * 40;
> #X obj 381 58 r space;
> #X obj 333 416 s objs_at_current_line;
> #X msg 524 105 1;
> #X obj 578 235 r objs_at_current_line;
> #X obj 578 298 * 40;
> #X obj 601 264 r space;
> #X obj 730 366 + 40;
> #X obj 588 331 moses 0;
> #X obj 632 405 s last_x;
> #X msg 632 358 set \$1;
> #X msg 632 382 0;
> #X obj 524 151 t f b b b;
> #X obj 553 180 t b b b;
> #X obj 70 312 r space;
> #X obj 59 241 r space;
> #X obj 341 84 s objs_per_line;
> #X obj 373 319 r objs_per_line;
> #X obj 305 105 s fold_position;
> #X obj 58 289 r fold_position;
> #X text 348 295 number of objects;
> #X obj 524 79 repeat 1;
> #X floatatom 524 18 5 0 0 0 - - -;
> #X obj 618 35 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
> -1;
> #X text 304 43 max objs per line;
> #X text 244 167 workout current number of objects;
> #X text 242 182 and the y position in the new line;
> #X text 637 34 delet 1 object at the time;
> #N canvas 76 46 446 579 s/r_defs 0;
> #X text 74 33 so there is a gap between each obj.;
> #X text 23 70 objs_per_line: in number of objs \, specifies the number
> ;
> #X text 129 86 of objs each lines will hold.;
> #X text 23 18 space: in pixels \, the horizontal space for each
object.
> ;
> #X text 23 128 fold_position: in pixels \, the horizontal (x) poition
> ;
> #X text 129 144 to go into a new line.;
> #X text 24 187 last_x: in pixels \, the current/latest x position
after
> ;
> #X text 80 205 creating or deleting.;
> #X text 24 244 last_y: in pixels \, the current/latest y position
after
> ;
> #X text 80 261 creating or deleting.;
> #X text 23 308 current_objs: in number of objs \, the current number
> of;
> #X text 23 376 objs_at_current_line: in number of objs \, the number
> of;
> #X text 178 393 objects in the current line.;
> #X text 121 324 objs.;
> #X text 27 445 finish_sig: bang \, signaling that the creating or
deleting
> ;
> #X text 110 463 process is finished;
> #X text 27 511 initialise: perhaps use this to initialise each
abstraction
> ;
> #X text 112 526 that has been created.;
> #X restore 722 167 pd s/r_defs;
> #X text 565 17 delete n objects at once!;
> #X text 721 84 reset the x position;
> #X text 721 70 use when things go wrong!;
> #X text 721 150 see the defs/comments of all sents;
> #X obj 11 -21 inlet;
> #X obj 50 -21 inlet;
> #X obj 89 -21 inlet;
> #X obj 128 -21 inlet;
> #X obj 168 -21 inlet;
> #X obj 207 -21 inlet;
> #X msg 116 111 vis 1 \, editmode 1;
> #X obj 116 92 loadbang;
> #X msg 261 61 40;
> #X msg 345 60 10;
> #X obj -30 -22 inlet;
> #X obj 12 547 outlet;
> #X obj 58 547 outlet;
> #X obj 105 547 outlet;
> #X obj 105 527 + 1;
> #X msg 275 480 loadbang;
> #X obj 10 142 t s b b b b;
> #X obj 10 353 t b s;
> #X obj 10 98 t b s b;
> #X obj 91 141 s finish_sig;
> #X obj 611 155 s finish_sig;
> #X obj 524 37 t b b f b;
> #X msg 583 61 editmode 1;
> #X obj 10 42 t b b b f;
> #X obj 10 422 s inisialise;
> #X symbolatom 132 372 10 0 0 0 - - -;
> #X msg 173 310 set +;
> #X obj 173 290 loadbang;
> #X connect 1 0 0 0;
> #X connect 3 0 2 0;
> #X connect 4 0 11 0;
> #X connect 5 0 7 0;
> #X connect 6 0 5 0;
> #X connect 7 0 2 0;
> #X connect 8 0 9 0;
> #X connect 9 0 2 0;
> #X connect 10 0 8 0;
> #X connect 15 0 18 0;
> #X connect 16 0 15 2;
> #X connect 17 0 114 0;
> #X connect 18 0 2 0;
> #X connect 19 0 112 0;
> #X connect 20 0 119 0;
> #X connect 21 0 22 0;
> #X connect 22 0 33 0;
> #X connect 23 0 24 1;
> #X connect 24 0 23 1;
> #X connect 24 0 21 0;
> #X connect 25 0 24 0;
> #X connect 25 1 23 0;
> #X connect 26 0 25 0;
> #X connect 27 0 23 1;
> #X connect 29 0 33 1;
> #X connect 30 0 31 0;
> #X connect 31 0 32 0;
> #X connect 32 0 28 0;
> #X connect 33 0 42 0;
> #X connect 35 0 36 1;
> #X connect 36 0 50 0;
> #X connect 37 0 36 0;
> #X connect 37 1 35 0;
> #X connect 38 0 39 1;
> #X connect 39 0 75 0;
> #X connect 41 0 38 0;
> #X connect 42 0 30 0;
> #X connect 42 0 15 1;
> #X connect 43 0 44 0;
> #X connect 43 0 56 0;
> #X connect 44 0 16 0;
> #X connect 45 0 46 0;
> #X connect 46 0 43 0;
> #X connect 46 0 47 0;
> #X connect 46 0 60 0;
> #X connect 46 0 108 0;
> #X connect 48 0 49 1;
> #X connect 49 0 48 1;
> #X connect 49 0 40 0;
> #X connect 49 0 34 0;
> #X connect 49 0 53 0;
> #X connect 49 0 107 0;
> #X connect 50 0 49 0;
> #X connect 50 1 48 0;
> #X connect 51 0 50 0;
> #X connect 52 0 48 1;
> #X connect 53 0 45 0;
> #X connect 53 0 61 0;
> #X connect 55 0 54 0;
> #X connect 57 0 5 2;
> #X connect 57 0 8 2;
> #X connect 58 0 57 0;
> #X connect 59 0 58 0;
> #X connect 60 0 61 1;
> #X connect 61 0 65 0;
> #X connect 61 0 110 0;
> #X connect 62 0 63 0;
> #X connect 62 0 79 0;
> #X connect 63 0 81 0;
> #X connect 64 0 63 1;
> #X connect 66 0 39 0;
> #X connect 67 0 68 0;
> #X connect 68 0 70 0;
> #X connect 68 0 8 1;
> #X connect 68 0 71 0;
> #X connect 69 0 68 1;
> #X connect 69 0 70 1;
> #X connect 70 0 5 1;
> #X connect 71 1 73 0;
> #X connect 73 0 74 0;
> #X connect 74 0 72 0;
> #X connect 75 0 37 0;
> #X connect 75 1 74 0;
> #X connect 75 2 3 0;
> #X connect 75 3 76 0;
> #X connect 76 0 10 0;
> #X connect 76 1 6 0;
> #X connect 76 2 57 0;
> #X connect 77 0 30 1;
> #X connect 78 0 22 1;
> #X connect 80 0 45 1;
> #X connect 80 0 46 1;
> #X connect 80 0 60 1;
> #X connect 82 0 42 1;
> #X connect 84 0 66 0;
> #X connect 85 0 117 0;
> #X connect 86 0 66 0;
> #X connect 96 0 20 0;
> #X connect 97 0 85 0;
> #X connect 98 0 86 0;
> #X connect 99 0 4 0;
> #X connect 100 0 62 0;
> #X connect 101 0 55 0;
> #X connect 102 0 2 0;
> #X connect 103 0 102 0;
> #X connect 103 0 104 0;
> #X connect 103 0 105 0;
> #X connect 104 0 4 0;
> #X connect 105 0 62 0;
> #X connect 106 0 121 0;
> #X connect 110 0 109 0;
> #X connect 111 0 2 0;
> #X connect 112 0 113 0;
> #X connect 112 1 26 0;
> #X connect 112 2 16 0;
> #X connect 112 3 121 0;
> #X connect 112 4 51 0;
> #X connect 113 0 111 0;
> #X connect 113 0 120 0;
> #X connect 113 1 15 0;
> #X connect 114 1 19 0;
> #X connect 114 2 27 0;
> #X connect 117 0 116 0;
> #X connect 117 1 84 0;
> #X connect 117 2 84 1;
> #X connect 117 3 118 0;
> #X connect 118 0 2 0;
> #X connect 119 0 115 0;
> #X connect 119 1 32 0;
> #X connect 119 2 17 0;
> #X connect 119 3 19 1;
> #X connect 121 0 15 3;
> #X connect 122 0 121 0;
> #X connect 123 0 122 0;
> #X restore 13 137 pd <<.....:::::_create/delete_:::::.....>>;
> #X floatatom 13 159 5 0 0 0 - - -;
> #X floatatom 157 159 5 0 0 0 - - -;
> #X floatatom 302 159 5 0 0 0 - - -;
> #X text 12 173 No. of objs;
> #X text 154 172 current line No.;
> #X text 300 172 No. of objs @ current line;
> #X symbolatom 13 81 10 0 0 0 - - -;
> #X text 13 64 name of the object/patch to create;
> #X msg 13 22 set +;
> #X obj 13 2 loadbang;
> #X text 247 83 x space \, default 40;
> #X text 292 101 objs per line \, default 10;
> #N canvas 179 95 590 442 readme 0;
> #X text 13 7 an patch that dynamically creates and delets
objects/patches
> ;
> #X text 13 33 work in progress \, still a bit experimental...;
> #X text 21 64 to create objects:;
> #X text 151 83 enter the number of object to create in the create
number
> ;
> #X text 152 99 box and hit enter.;
> #X text 21 114 to delete objects:;
> #X text 151 133 enter the number of object to delete in the delete
> number;
> #X text 152 149 box and hit enter. or click on the bang next to it
> to;
> #X text 151 164 delete one object at the time.;
> #X text 152 208 things up a bit \; );
> #X text 27 240 in case things go wrong:;
> #X text 154 263 manually delete the object in the dynamic\ window and
> click;
> #X text 155 283 the reset\ x bang. also make sure the object count
> is 0;
> #X text 156 298 by enter the right number at the delete correct the
> count;
> #X text 25 348 *don't save the patch if there are objects in the
dynamic
> window/subpatch;
> #X text 153 193 *don't enter the number by draging the mouse \, it
> will mess;
> #X restore 79 2 pd readme;
> #X text 151 2 <- info here!;
> #X connect 1 0 9 1;
> #X connect 2 0 9 2;
> #X connect 3 0 9 3;
> #X connect 4 0 9 4;
> #X connect 5 0 9 5;
> #X connect 6 0 9 6;
> #X connect 9 0 10 0;
> #X connect 9 1 11 0;
> #X connect 9 2 12 0;
> #X connect 16 0 9 0;
> #X connect 18 0 16 0;
> #X connect 19 0 18 0;
>
>
> _______________________________________________
> PD-list at iem.at mailing list
> UNSUBSCRIBE and account-management ->
http://iem.at/cgi-bin/mailman/listinfo/pd-list





More information about the Pd-list mailing list