Automatically generate list of all send~ objects in a patcher?

Feb 22, 2008 at 12:19am

Automatically generate list of all send~ objects in a patcher?

Hi,

I’d like to automatically create a list of all of the [send~] objects in a patcher, so I can set up an ubumenu to choose which [send~] a [receive~] will receive from.

Is this possible?

Thanks,

Aengus.

#35983
Feb 22, 2008 at 11:14am

Actually, to clarify a bit, or make the problem more difficult: I’d like to be able to generate a list of the names of all [send~] busses that are in use at any particular time- in any open patcher including bpatchers.

Thanks for any help,

Aengus.

#123245
Feb 22, 2008 at 1:20pm

Well, I thought of a way to do it, so here it is:

I first created a wrapper for the [send~] object like this:

max v2;
#N vpatcher 461 109 779 325;
#P inlet 9 89 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 156 125 118 196617 s am.receiveSendNames;
#P newex 156 67 123 196617 r am.transmitSendNames;
#P window linecount 0;
#P message 156 98 77 196617;
#P window linecount 1;
#P newex 60 71 62 196617 prepend set;
#P newex 60 50 66 196617 unpack name;
#P newex 60 24 64 196617 patcherargs;
#P newex 9 118 87 196617 send~ am.dummy;
#P window linecount 2;
#P comment 9 145 278 196617 Wrapper for send~ which stores the name for sending to a central collector of names of send~ busses.;
#P connect 4 0 1 0;
#P connect 8 0 1 0;
#P connect 2 0 3 0;
#P connect 3 0 4 0;
#P connect 4 0 5 0;
#P connect 6 0 5 0;
#P connect 5 0 7 0;
#P pop;

Then I created a little patch which tells all the [send~] wrappers to report their names and sends out the names on another [send] bus:

max v2;
#N vpatcher 465 209 676 463;
#P inlet 15 30 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 68 130 78 196617 prepend append;
#P newex 39 165 117 196617 s am.transmitSendMenu;
#P message 39 87 33 196617 clear;
#P newex 68 107 118 196617 r am.receiveSendNames;
#P newex 15 194 123 196617 s am.transmitSendNames;
#P button 15 51 15 0;
#P window linecount 6;
#P comment 54 11 138 196617 Tell all the am.send~ objects to report their names and then transmit messages for umenus so that they have a list of the names of all the am.send~ objects.;
#P connect 7 0 1 0;
#P connect 1 0 2 0;
#P fasten 1 0 4 0 20 77 44 77;
#P connect 6 0 5 0;
#P connect 4 0 5 0;
#P connect 3 0 6 0;
#P pop;

…. to fill any umenus or ubumenus which might be listening through the appropriate [receive-] such as the one in this example patcher:

max v2;
#N vpatcher 762 1118 944 1287;
#P window setfont “Sans Serif” 9.;
#P user ubumenu 27 70 100 196617 0 1 1 0;
#X add w_amPadSynth01;
#X add w01_fmMonoSynth01;
#X prefix_set 0 0 0;
#P window linecount 1;
#P newex 27 39 117 196617 r am.transmitSendMenu;
#P connect 0 0 1 0;
#P pop;

I did a similar system for the [buffer~] object so that I can automatically fill lists of these as well.

If there is another way to do this, without the wrapper, I’d be very interested.

Cheers,

Aengus.

———————-
http://www.am-process.org

#123246
Feb 26, 2008 at 9:51am

aengus schrieb:
> If there is another way to do this, without the wrapper, I’d be very interested.

I did it the same way, a wrapper is a good, if not the best method…
Only thing I’d add is a closebang to be able to erase an entry…

Stefan


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

#123247

You must be logged in to reply to this topic.