Changable arguments and route? (or equivilent)

Dec 29, 2006 at 6:55pm

Changable arguments and route? (or equivilent)

I’m writing some MIDI leaning/interpeting patches…

And essentially I want to be able to dynamically change the arguments of a “route” object…or have something that does the same thing.

I took a look at the tutorials and found the $/# changeable variables but I think route is making them literal matches instead of changables.

Any ideas?

Thanks for this and all the other help I’ve received here.

-sean

#29423
Dec 29, 2006 at 7:25pm

Ive made a simple abstraction in my v001 library that changes the
first arguments to route dynamically – you could easily modify it for
more arguments should you want.

feel free to check it out. 001.vade.info – the specific file is
v001.lib.dynamicroute

im 99% positive someone else has a better answer or external, but the
meantime you can see how I did it.

On Dec 29, 2006, at 1:55 PM, Sean Stevens wrote:

>
> I’m writing some MIDI leaning/interpeting patches…
>
> And essentially I want to be able to dynamically change the
> arguments of a “route” object…or have something that does the
> same thing.
>
> I took a look at the tutorials and found the $/# changeable
> variables but I think route is making them literal matches instead
> of changables.
>
> Any ideas?
>
> Thanks for this and all the other help I’ve received here.
>
> -sean

v a d e //

http://www.vade.info
abstrakt.vade.info

#91997
Dec 29, 2006 at 7:29pm

I don’t think route’s arguments can be changed on the fly. Select can be if there’s only one argument, so you could send whatever number or word into it and use the bang to forward the value onward (be sure your order of messages are correct using a trigger). Match also does this and can be used with multiple arguments, check these out.

I *believe* the $ and $1 etc. are illegal in object boxes like route. And the #1 #2 etc. is generally only used in patcher instances (like with bpatcher) to stand for one of the nine arguments that you can send the patcher itself. Very handy but doesn’t seem like what you need in this case.

I have wondered the same thing at certain points, being able to set the arguments of route dynamically would be great. Not adding or taking away any of them, just being able to change them. This doesn’t seem like it would be much of a problem in the object’s code itself, as each argument is stored into a variable… for example, the “set 5 29″ message would set argument 5 to look for value 29?

I’m certainly no expert so I may be missing something but this is my understanding at this point….

–CJ

#91998
Dec 29, 2006 at 7:39pm
#91999
Dec 29, 2006 at 8:00pm

I think the issue is that since route needs to be able to route anything (serial data, midi, string, text, ints, etc) and only has one inlet you can’t reserve any delimiters to tell it to change things…it just ends up routing them.

Perhaps it should be a feature request for a 2nd inlet? :)

I definitely need the whole route functionality, but I don’t need to change the number of arguments runtime.

I’ll try some of the abstractions in the meantime, but route would be perfect.

Thanks, and if anyone has other ideas please chime in :)

#92000
Dec 29, 2006 at 8:14pm

You can build this fairly painlessly with an abstraction, using
thispatcher scripting to delete and rebuilt an instance of route that
has n number of variables, with n numbers of inlets and outlets
associated. Iveonly done this for one variable (the equivalent of
your set 1 something, set 1 somethingelse type message).

On Dec 29, 2006, at 2:29 PM, Seejay James wrote:

>
> I have wondered the same thing at certain points, being able to set
> the arguments of route dynamically would be great. Not adding or
> taking away any of them, just being able to change them. This
> doesn’t seem like it would be much of a problem in the object’s
> code itself, as each argument is stored into a variable… for
> example, the “set 5 29″ message would set argument 5 to look for
> value 29?
>
> I’m certainly no expert so I may be missing something but this is
> my understanding at this point….

v a d e //

http://www.vade.info
abstrakt.vade.info

#92001
Dec 30, 2006 at 7:57pm

The object you are looking for is called XROUTE.

you can find it here:

http://www.cycling74.com/twiki/bin/view/Share/Jhno

or

http://francois.eudes.free.fr/maxmsp_temp_page.htm

I used it in a simmilar patch you are building. It’s very handy indeed. However, I transfered to a macbook pro and Xroute isn’t UB yet. Hope Francois makes a UB version.

#92002
Dec 30, 2006 at 10:46pm

here’s a UB build of xroute:

http://www.jasch.ch/dl/xroute_UB.dmg

if the maintainer of the share pages would be so kind as to put it on
jhno’s page, that would be great.

cheers

/*j

> The object you are looking for is called XROUTE.
>
> you can find it here:
> http://www.cycling74.com/twiki/bin/view/Share/Jhno

#92003
Dec 31, 2006 at 2:09pm

Sean Stevens wrote:
> Thanks, and if anyone has other ideas please chime in :)

the below abhaXion will accept a list in the right inlet to redefine the
routes… (to change a single outlet give it a “set #ofoutlet match”…)

Stefan

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 86 91 34 196617 zl reg;
#P newex 86 71 13 196617 b;
#P newex 86 51 109 196617 route reset;
#P newex 19 138 13 196617 b;
#N vpatcher 30 89 630 489;
#P window setfont “Sans Serif” 9.;
#P window linecount 0;
#P newex 175 173 37 196617 zl reg;
#P newex 175 152 72 196617 t b i;
#P newex 175 107 37 196617 zl slice 1;
#P window linecount 1;
#P newex 175 61 206 196617 t l 1 clear;
#P window linecount 2;
#P newex 162 196 44 196617 prepend symbol;
#P window linecount 1;
#P newex 123 173 49 196617 route int;
#P newex 249 240 66 196617 route symbol;
#N coll ;
#P newobj 249 307 49 196617 coll;
#P newex 249 264 72 196617 prepend store;
#P newex 249 284 38 196617 zl join;
#P newex 249 196 67 196617 zl join;
#N coll ;
#P newobj 249 219 49 196617 coll;
#P newex 249 152 13 196617 b;
#P newex 214 107 45 196617 t dump l;
#N counter;
#X flags 0 0;
#P newobj 249 174 58 196617 counter;
#P newex 249 128 24 196617 iter;
#P newex 175 84 49 196617 route set;
#P inlet 175 41 15 0;
#P inlet 123 42 15 0;
#P outlet 249 329 15 0;
#P connect 1 0 14 0;
#P connect 14 1 15 0;
#P connect 2 0 16 0;
#P connect 16 0 3 0;
#P connect 3 0 17 0;
#P connect 17 0 18 0;
#P connect 18 0 19 0;
#P connect 17 1 19 1;
#P connect 19 0 6 0;
#P connect 3 1 6 0;
#P connect 6 1 4 0;
#P connect 4 0 7 0;
#P connect 7 0 5 0;
#P connect 5 0 9 0;
#P fasten 6 0 8 0 219 216 254 216;
#P connect 9 0 8 0;
#P connect 8 0 13 0;
#P connect 13 0 11 0;
#P fasten 13 1 11 0 310 260 254 260;
#P connect 11 0 10 0;
#P fasten 16 2 12 0 376 304 254 304;
#P connect 10 0 12 0;
#P connect 15 0 12 0;
#P connect 14 0 12 0;
#P connect 12 0 0 0;
#P fasten 18 1 5 2 242 172 278 172;
#P connect 16 1 5 2;
#P connect 8 1 10 1;
#P fasten 4 0 9 1 254 148 311 148;
#P pop;
#P newobj 31 180 65 196617 p memory;
#P outlet 927 265 13 0;
#P objectname out[65];
#P newex 42 138 13 196617 b;
#P inlet 86 32 15 0;
#P newex 42 159 37 196617 int 66;
#P newex 31 94 50 196617 zl slice 1;
#P inlet 31 32 15 0;
#P newex 19 201 69 196617 zl reg;
#N thispatcher;
#Q end;
#P newobj 123 135 57 196617 thispatcher;
#N vpatcher 162 248 1039 711;
#P window setfont “Sans Serif” 9.;
#P newex 115 119 23 196617 + 1;
#P newex 64 169 31 196617 – 4;
#P newex 64 148 31 196617 * 14;
#P window linecount 7;
#P newex 64 193 61 196617 sprintf script replace gate newex 31 220 %i
196617 gate %i;
#P outlet 222 290 15 0;
#P window linecount 0;
#P newex 168 219 50 196617 sprintf script delete out[%i];
#P newex 140 93 35 196617 zl len;
#P outlet 168 290 15 0;
#P inlet 140 60 15 0;
#P window linecount 1;
#P newex 168 162 32 196617 !- 66;
#P newex 140 119 38 196617 !- 64;
#P newex 140 140 38 196617 uzi;
#P fasten 11 0 9 0 120 142 69 142;
#P connect 9 0 10 0;
#P connect 10 0 8 0;
#P fasten 5 0 11 0 145 114 120 114;
#P connect 11 0 8 1;
#P connect 3 0 5 0;
#P connect 5 0 1 0;
#P connect 1 0 0 0;
#P connect 0 2 2 0;
#P connect 2 0 6 0;
#P connect 8 0 4 0;
#P connect 6 0 4 0;
#P fasten 11 0 7 0 120 188 227 188;
#P pop;
#P newobj 123 114 64 196617 p scripting;
#P newex 123 91 64 196617 patcherargs;
#P outlet 913 265 13 0;
#P objectname out[64];
#P outlet 899 265 13 0;
#P objectname out[63];
#P outlet 885 265 13 0;
#P objectname out[62];
#P outlet 871 265 13 0;
#P objectname out[61];
#P outlet 857 265 13 0;
#P objectname out[60];
#P outlet 843 265 13 0;
#P objectname out[59];
#P outlet 829 265 13 0;
#P objectname out[58];
#P outlet 815 265 13 0;
#P objectname out[57];
#P outlet 801 265 13 0;
#P objectname out[56];
#P outlet 787 265 13 0;
#P objectname out[55];
#P outlet 773 265 13 0;
#P objectname out[54];
#P outlet 759 265 13 0;
#P objectname out[53];
#P outlet 745 265 13 0;
#P objectname out[52];
#P outlet 731 265 13 0;
#P objectname out[51];
#P outlet 717 265 13 0;
#P objectname out[50];
#P outlet 703 265 13 0;
#P objectname out[49];
#P outlet 689 265 13 0;
#P objectname out[48];
#P outlet 675 265 13 0;
#P objectname out[47];
#P outlet 661 265 13 0;
#P objectname out[46];
#P outlet 647 265 13 0;
#P objectname out[45];
#P outlet 633 265 13 0;
#P objectname out[44];
#P outlet 619 265 13 0;
#P objectname out[43];
#P outlet 605 265 13 0;
#P objectname out[42];
#P outlet 591 265 13 0;
#P objectname out[41];
#P outlet 577 265 13 0;
#P objectname out[40];
#P outlet 563 265 13 0;
#P objectname out[39];
#P outlet 549 265 13 0;
#P objectname out[38];
#P outlet 535 265 13 0;
#P objectname out[37];
#P outlet 521 265 13 0;
#P objectname out[36];
#P outlet 507 265 13 0;
#P objectname out[35];
#P outlet 493 265 13 0;
#P objectname out[34];
#P outlet 479 265 13 0;
#P objectname out[33];
#P outlet 465 265 13 0;
#P objectname out[32];
#P outlet 451 265 13 0;
#P objectname out[31];
#P outlet 437 265 13 0;
#P objectname out[30];
#P outlet 423 265 13 0;
#P objectname out[29];
#P outlet 409 265 13 0;
#P objectname out[28];
#P outlet 395 265 13 0;
#P objectname out[27];
#P outlet 381 265 13 0;
#P objectname out[26];
#P outlet 367 265 13 0;
#P objectname out[25];
#P outlet 353 265 13 0;
#P objectname out[24];
#P outlet 339 265 13 0;
#P objectname out[23];
#P outlet 325 265 13 0;
#P objectname out[22];
#P outlet 311 265 13 0;
#P objectname out[21];
#P outlet 297 265 13 0;
#P objectname out[20];
#P outlet 283 265 13 0;
#P objectname out[19];
#P outlet 269 265 13 0;
#P objectname out[18];
#P outlet 255 265 13 0;
#P objectname out[17];
#P outlet 241 265 13 0;
#P objectname out[16];
#P outlet 227 265 13 0;
#P objectname out[15];
#P outlet 213 265 13 0;
#P objectname out[14];
#P outlet 199 265 13 0;
#P objectname out[13];
#P outlet 185 265 13 0;
#P objectname out[12];
#P outlet 171 265 13 0;
#P objectname out[11];
#P outlet 157 265 13 0;
#P objectname out[10];
#P outlet 143 265 13 0;
#P objectname out[9];
#P outlet 129 265 13 0;
#P objectname out[8];
#P outlet 115 265 13 0;
#P objectname out[7];
#P outlet 101 265 13 0;
#P objectname out[6];
#P outlet 87 265 13 0;
#P objectname out[5];
#P outlet 73 265 13 0;
#P objectname out[4];
#P outlet 59 265 13 0;
#P objectname out[3];
#P outlet 45 265 13 0;
#P objectname out[2];
#P outlet 31 265 13 0;
#P objectname out[1];
#P newex 31 241 906 196617 gate 65;
#P objectname gate;
#P fasten 65 0 75 1 128 111 91 111;
#P connect 65 0 79 1;
#P connect 65 0 66 0;
#P connect 0 64 74 0;
#P connect 68 0 0 1;
#P connect 0 63 64 0;
#P connect 0 62 63 0;
#P connect 0 61 62 0;
#P connect 0 60 61 0;
#P connect 0 59 60 0;
#P connect 0 58 59 0;
#P connect 0 57 58 0;
#P connect 0 56 57 0;
#P connect 0 55 56 0;
#P connect 0 54 55 0;
#P connect 0 53 54 0;
#P connect 0 52 53 0;
#P connect 0 51 52 0;
#P connect 0 50 51 0;
#P connect 0 49 50 0;
#P connect 0 48 49 0;
#P connect 0 47 48 0;
#P connect 0 46 47 0;
#P connect 0 45 46 0;
#P connect 0 44 45 0;
#P connect 0 43 44 0;
#P connect 0 42 43 0;
#P connect 0 41 42 0;
#P connect 0 40 41 0;
#P connect 0 39 40 0;
#P connect 0 38 39 0;
#P connect 0 37 38 0;
#P connect 0 36 37 0;
#P connect 0 35 36 0;
#P connect 0 34 35 0;
#P connect 0 33 34 0;
#P connect 0 32 33 0;
#P connect 0 31 32 0;
#P connect 0 30 31 0;
#P connect 0 29 30 0;
#P connect 0 28 29 0;
#P connect 0 27 28 0;
#P connect 0 26 27 0;
#P connect 0 25 26 0;
#P connect 0 24 25 0;
#P connect 0 23 24 0;
#P connect 0 22 23 0;
#P connect 0 21 22 0;
#P connect 0 20 21 0;
#P connect 0 19 20 0;
#P connect 0 18 19 0;
#P connect 0 17 18 0;
#P connect 0 16 17 0;
#P connect 0 15 16 0;
#P connect 0 14 15 0;
#P connect 0 13 14 0;
#P connect 0 12 13 0;
#P connect 0 11 12 0;
#P connect 0 10 11 0;
#P connect 0 9 10 0;
#P connect 0 8 9 0;
#P connect 0 7 8 0;
#P connect 66 0 67 0;
#P connect 0 6 7 0;
#P connect 0 5 6 0;
#P connect 0 4 5 0;
#P fasten 77 1 75 1 190 175 91 175;
#P connect 79 0 75 1;
#P connect 78 0 79 0;
#P connect 77 0 78 0;
#P connect 72 0 77 0;
#P connect 69 0 70 0;
#P fasten 69 0 68 1 36 89 83 89;
#P connect 0 3 4 0;
#P fasten 66 1 71 1 182 155 74 155;
#P connect 0 2 3 0;
#P connect 0 1 2 0;
#P connect 73 0 71 0;
#P connect 70 0 76 0;
#P connect 70 0 75 0;
#P connect 70 0 73 0;
#P connect 0 0 1 0;
#P connect 71 0 0 0;
#P connect 75 0 0 0;
#P connect 76 0 68 0;
#P window clipboard copycount 80;


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com

#92004
Dec 31, 2006 at 2:43pm

Quote: i@seanstevens.com wrote on Fri, 29 December 2006 19:55
—————————————————-
> I’m writing some MIDI leaning/interpeting patches…
>
> And essentially I want to be able to dynamically change the arguments of a “route” object…or have something that does the same thing.
>

how about [zl sub]?

#92005
Jan 1, 2007 at 10:06pm

Hi Jasch,

Thanx for making the xroute UB. My old patch is working fine now.

#92006
Jan 2, 2007 at 2:36am

in case its all about numbers, you can do that with [split].

replace [route 5 66] with [split 5 5], [split 66 66]
for a dynamic route.

its more work, slower, and does not work with lists, but
probably the best you can do in all other cases.

-110

#92007
Jan 2, 2007 at 2:40am

Quote: Roman Thilenius wrote on Mon, 01 January 2007 19:36
—————————————————-
>
> in case its all about numbers, you can do that with [split].
>
> replace [route 5 66] with [split 5 5], [split 66 66]
> for a dynamic route.
>
> its more work, slower, and does not work with lists, but
> probably the best you can do in all other cases.
>
>
> -110
—————————————————-

oh, and of course for int, you could use comparison operators
(input bangs a dynamic number which is sent into [=])

#92008

You must be logged in to reply to this topic.