features request quick argument rename

phiol's icon

Hi C74 ,

Paste replace was a great upgrade , can we add to it please

Would it be possible to set up a quick system to rename arguments in one go .
for example : if you have multiple [s user1] [s user2 ] [s user3 ]etc... and then you decide you want to change these to for ex [s Myuser1] [s Myuser2 ] [s Myuser3 ] etc.... it could be a simple shortkey combo that would give the selected object's arguments and you could replace them there.

BUT A BETTER SOLUTION WOULD BE ;

An autoname number increment @ttribute on duplication object.
give the user the option in the inspector. Something like @autoname 1

so every time you have an object say [select bill] <-uppon creation it will automatically become [select bill0]
if you copy paste it , it will become [select bill1 ] [select bill2 ] etc......

for the folks who don't to use this they could simple leave the option unchecked in the inspector.
how to make this quick change.
you already have half the work done, in the scripting name <-- it auto increments <-- simply use that to rewrite the name :-)

which bring me to a 2nd half request;
creating a max object call thisobject with a getname message <-- this object would give the option to have the object's scriptingname number. I know we can do it with with js this.patcher getname or getvarname I think it was.

It would behave exactly like the thispoly in poly~ but from with subpatchers.

PLEASE PLEASE PLEASE.

The amount of time saved would be insane and more focus on creation would come out of it.

thanks

phiol

Roman Thilenius's icon


arguments are always included... but i am not convinced that paste/replace multiple items will make much sense.

what if 2 objects are on the same geographic position? what if the user copies 15 and then selects 16?

to your #2)

i understand the request - but for the changeable argument inside instances of abstractions you could program that behavior yourself - at least when a right to left order is present and maintained.


Roman Thilenius's icon


save as [110.loadinstance]


#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 83 78 212 196617 t b 1 b b b;
#N vpatcher 37 169 437 469;
#P outlet 187 181 15 0;
#P inlet 187 92 15 0;
#P connect 0 0 1 0;
#P pop;
#P newobj 499 215 25 196617 p t;
#N vpatcher 37 169 437 469;
#P outlet 187 181 15 0;
#P inlet 187 92 15 0;
#P connect 0 0 1 0;
#P pop;
#P newobj 499 280 25 196617 p t;
#P newex 544 262 64 196617 - 1;
#B color 6;
#P newex 544 233 246 196617 v $1;
#B color 15;
#N vpatcher 37 169 437 469;
#P outlet 187 181 15 0;
#P inlet 187 92 15 0;
#P connect 0 0 1 0;
#P pop;
#P newobj 38 215 25 196617 p t;
#N vpatcher 37 169 437 469;
#P outlet 187 181 15 0;
#P inlet 187 92 15 0;
#P connect 0 0 1 0;
#P pop;
#P newobj 38 280 25 196617 p t;
#P newex 544 202 77 196617 closebang;
#B color 3;
#P newex 83 262 64 196617 + 1;
#B color 6;
#P newex 83 233 246 196617 v $1;
#B color 15;
#P hidden newex 681 96 108 196617 bgcolor 150 250 50;
#P newex 283 168 25 196617 1;
#N vpatcher 315 276 497 445;
#N comlet 0;
#P outlet 38 92 15 0;
#P window setfont "Sans Serif" 9.;
#P newex 38 63 30 196617 t 1;
#N comlet data;
#P outlet 100 92 15 0;
#N comlet data;
#P inlet 100 47 15 0;
#P connect 0 0 2 0;
#P connect 2 0 3 0;
#P connect 0 0 1 0;
#P pop;
#P newobj 183 168 43 196617 p t1d;
#P newex 361 186 43 196617 gate;
#P newex 317 168 25 196617 0;
#P newex 317 122 109 196617 if $i1!=0 then bang;
#P newex 317 96 253 196617 v $2;
#B color 15;
#P newex 361 215 29 196617 0;
#N comlet instance (int);
#P outlet 83 345 15 0;
#P newex 83 50 59 196617 loadbang;
#B color 3;
#P connect 15 0 16 0;
#P connect 12 0 15 0;
#P lcolor 4;
#P connect 18 0 15 0;
#P connect 16 0 17 0;
#P connect 17 0 18 0;
#P connect 7 1 6 1;
#P connect 6 0 2 0;
#P connect 5 0 6 0;
#P connect 8 0 6 0;
#P connect 7 0 6 0;
#P connect 4 0 5 0;
#P connect 3 0 4 0;
#P connect 19 1 3 0;
#P connect 19 3 3 0;
#P connect 19 4 8 0;
#P connect 19 2 7 0;
#P connect 11 0 13 0;
#P connect 11 0 1 0;
#P connect 10 0 11 0;
#P connect 19 0 10 0;
#P connect 14 0 10 0;
#P connect 2 0 10 0;
#P connect 0 0 19 0;
#P lcolor 4;
#P connect 13 0 14 0;
#P window clipboard copycount 20;

then make a patch like that

#P window setfont "Sans Serif" 9.;
#P number 401 129 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 401 90 137 9109513 110.loadinstance gaga foo;
#P number 230 129 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 230 90 137 9109513 110.loadinstance gaga foo;
#P number 55 129 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 55 90 137 9109513 110.loadinstance gaga foo;
#P number 401 226 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 401 187 137 9109513 110.loadinstance bubu fooX;
#P number 230 226 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 230 187 137 9109513 110.loadinstance bubu fooX;
#P number 55 226 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 55 187 137 9109513 110.loadinstance bubu fooX;
#P connect 4 0 5 0;
#P connect 10 0 11 0;
#P connect 2 0 3 0;
#P connect 8 0 9 0;
#P connect 0 0 1 0;
#P connect 6 0 7 0;
#P window clipboard copycount 12;

it requires 2 unique arguments for technical reasons.

different arguments will create different object groups.

it can get confusing/confused while patching, but in a finished patch it will work.

if you put it in an abstraction, the right to left order of the abstraction is what counts.


-110

phiol's icon

Hi Roman,

Basically , in as you may know , I've been programming in Max since 2004-2005. I was forced to switch to other software 4-5 years ago. I still use max almost everyday. As you learn other software, you love some things about them and hate other things . It's like with anything.

But the important part is , the more you learn , the more you translate practices from software to software.
And one thing that change my patching efficiency (10 fold) is the fact that TouchDesigner has an auto number append in the name of each object. say bill1 . copy/pasting it create bill2 bill3 bill4 etc.....
you can then ride off these values to automatically connect things, multiply , offset parameters on each instances , automatically set positions and size and rotation , colors, you name it.

In max you have thispoly~ and js this.patcher. <-- I use these practices inside max using thispoly~
when you script name an object , the same system exists. bill[0] , bill[1], bill[2] bill[3] etc...
it happens automatically at the patching level. no need to create a voice in [poly~ ]

The only way to access these values is with js.
this.patcher.box.varname

I know things take time , but if people realized how much faster patching becomes when you can ride of names, or have send object that autoname themselves , no time is wasted programming , you simply focus on your creative process and ideas.

An example is mc.
It's basically a same level patching of poly~ so so so much more efficient than poly~
But it's poly~

So all I'm asking is an auto name option in objects check box in the inspector.

If you wish , I could record a TouchDesigner example and send it to you.

In the mean time here is my js. example. I'm sure you already know about it.

00_module.zip
application/zip 4.98 KB

Roman Thilenius's icon


of course you are right that in old style scripting or in poly~ a similar thing is already there.

but isnt old style scripting yet another solution to create objects like that easily?

button, counter, sprintf %s%i, list script newdefault object foo1 rhabarber rhabarber?

on the one hand i am also sometimes fed up by having to create such things on my own when i need it.
on the other hand, how often do i need it? most of the time i copy objects i dont want to have arguments counting upwards.

how would you like to select that action? via contextmenu?
how would you give the user access to deselect the function again?

Roman Thilenius's icon


imagine you would be the max app and you´d have to decide what do when you are told to make a copy of [select bill1 1 0 1 bill2]

phiol's icon

Yup , the option is always off, and an attribute in the inspector @autoname 1.

this would work on objects like send dog_0 , send dog_1

Then what would be great is a quick editor

When you wan’t create the receiving object , you select all the send objects, open up an editor / replace all send with receive . Like in notepad++ or sublime or any text editing software.

Roman Thilenius's icon


actually in max 4 i sometimes miss that you can not just edit a patch in a text editor. it was a bit strange; it could be saved as text, but not edited.
so for search and replace, sorting or numbering you have to rely on bbedit plug-ins or whatever, which is like 15 mouseclicks until you are there.

editing or creating patches programmatically is generally a weak point in max, i wouldnt disagree here, scripting (with or out without java) is more like a workaround which require you to learn how to do it first than an everydays solution for everyone.

however, i would be interested what you would think about my patches above. would you file it under "even more complicated"?

phiol's icon

I find your solution a very creative workaround . but yeah , I even drop my js version, creating too much abstraction and dependencies . Think poly~ vs mc. it‘s the same but one keeps the creative flow going.

Thank you very much for your patch. Again very simple and creative