Forums > MaxMSP

Loadbang and scripting

February 2, 2007 | 2:17 pm

I created an object that uses patcherargs to collect parameters and
scripting to customize the insides. The cycle and Label (Peter Elsea)
objects are recreated depending on the number of items in the @parameter
arg.

Scplayer bubbles @parameters pit vel dur chan

Input is a list (len = 4 in this case) and output is a message suitable for
udpsend.

The object formats messages for supercollider synthdefs Arg #1 (bubbles) is
the name of the synthdef.

It works perfectly when a patch is loaded but if I edit the object to change
parameter count or names, the innards are not updated. I added a bang to do
this by hand but obviously it should be made automatic. Any suggestions?

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 30 35 57 196617 route bang;
#P window setfont "Fixedwidth Serif" 10.;
#P message 626 310 304 1441802 set script new cycle newex 64 96 128 196617
cycle;
#P window setfont "Sans Serif" 9.;
#P message 693 237 255 196617 set script new Label newex 64 126 128 196617
Label;
#P message 662 151 184 196617 script delete cycle , script delete Label;
#P outlet 63 287 15 0;
#P window linecount 3;
#P message 256 332 125 196617 script connect Label 0 prepender 0 , script
connect trigger 1 cycle 0;
#P window linecount 1;
#P newex 342 68 181 196617 b 7;
#P window linecount 4;
#P message 411 360 57 196617 script connect cycle $1 Label $1;
#P window linecount 1;
#P newex 411 333 27 196617 – 1;
#P newex 341 255 80 196617 uzi 8;
#P message 505 216 55 196617 append $1;
#P window setfont "Fixedwidth Serif" 10.;
#P message 479 342 280 1441802 script new cycle newex 64 96 128 196617
cycle;
#P window setfont "Sans Serif" 9.;
#P newex 596 235 80 196617 prepend append;
#P newex 479 186 34 196617 zl len;
#P window setfont "Fixedwidth Serif" 10.;
#P message 581 268 286 1441802 script new Label newex 64 126 128 196617
Label;
#P window setfont "Sans Serif" 9.;
#P newex 26 63 69 196617 t b l b;
#P objectname trigger;
#N thispatcher;
#Q end;
#P newobj 411 425 61 196617 thispatcher;
#P inlet 42 14 15 0;
#P newex 479 150 89 196617 route parameters;
#P newex 342 38 88 196617 loadbang;
#P newex 426 115 64 196617 patcherargs;
#P newex 85 200 78 196617 prepend append;
#P objectname prepender;
#P window linecount 0;
#P message 64 231 143 196617;
#P window linecount 1;
#P message 201 193 104 196617 set s_new $1 -1 1 0;
#P newex 64 126 128 196617 Label;
#P objectname Label;
#P newex 64 96 128 196617 cycle;
#P objectname cycle;
#P connect 10 1 0 0;
#P connect 1 0 4 0;
#P connect 0 0 1 0;
#P connect 19 6 23 0;
#P fasten 19 4 22 0 459 99 667 99;
#P connect 19 5 24 0;
#P connect 7 0 12 0;
#P fasten 7 0 13 0 484 176 601 176;
#P fasten 19 2 11 0 403 103 586 103;
#P connect 23 0 11 0;
#P connect 13 0 11 0;
#P fasten 12 0 16 1 484 209 416 209;
#P fasten 12 0 15 0 484 209 510 209;
#P fasten 19 1 14 0 375 240 484 240;
#P connect 24 0 14 0;
#P fasten 15 0 14 0 510 270 484 270;
#P connect 5 1 7 0;
#P connect 19 3 5 0;
#P connect 22 0 9 0;
#P connect 20 0 9 0;
#P fasten 11 0 9 0 586 422 416 422;
#P fasten 14 0 9 0 484 420 416 420;
#P connect 18 0 9 0;
#P connect 17 0 18 0;
#P connect 16 2 17 0;
#P connect 25 0 19 0;
#P connect 6 0 19 0;
#P connect 19 0 16 0;
#P connect 16 1 20 0;
#P fasten 10 2 2 0 89 90 206 90;
#P connect 10 0 3 0;
#P connect 4 0 3 0;
#P connect 2 0 3 0;
#P connect 3 0 21 0;
#P connect 8 0 25 0;
#P connect 25 1 10 0;
#P window clipboard copycount 26;

Cheers
Gary Lee Nelson
Oberlin College
http://www.timara.oberlin.edu/GaryLeeNelson


February 2, 2007 | 5:03 pm

qlim is your friend,- just put it after the loadbang object (deferlow will do it too ;)


February 2, 2007 | 6:09 pm


February 2, 2007 | 6:32 pm


February 2, 2007 | 8:04 pm


February 3, 2007 | 12:37 am


February 3, 2007 | 1:56 pm


February 3, 2007 | 2:31 pm

Quote: Emmanuel Jourdan wrote on Sat, 03 February 2007 01:37
—————————————————-
> For the synchronization, there’s trigger. On my computer (4.6.x), the
> patcherargs send the argument of an abstraction at "loadbang"
> automatically. I don’t need any extra loadbang object.
>
> Best,
> ej
>

Patcherargs outputs automatically, but after all loadbangs in a patch. The order in which loadbangs execute is not defined, idem for patcherargs.

I made a little abstraction that manages loading order without the need for trigger. Check the .help file in the zip and tell me if you like it.

Cheers,
Mattijs


Viewing 8 posts - 1 through 8 (of 8 total)