Forums > MaxMSP

filtering a list of symbols

November 10, 2006 | 1:51 pm

Hello there,

so far I couldn’t find a solution for this but maybe the collective
brain can point me towards the right direction:

I have a long list of symbols:

slot1-autorndsel
slot1-autorndseldev
slot1-autorndsellen
slot1-autorndseltime
slot1-autorndseltimernd
.
.
.
slot2-autorndsel
slot2-autorndseldev
slot2-autorndsellen
slot2-autorndseltime
slot2-autorndseltimernd
.
.
.

etc.

I’d like to filter this list so the result is a sub-list which
contains everything that starts with slot1- or slot2- etc. (to
populate a ubumenu).

Any pointers will greatly be apprecaited!


Bernhard Loibner
sound & media artist

http://loibner.cc


November 10, 2006 | 2:33 pm

On 10 nov. 06, at 14:51, Bernhard Loibner wrote:

> I’d like to filter this list so the result is a sub-list which
> contains everything that starts with slot1- or slot2- etc. (to
> populate a ubumenu).

Not perfect, but this may give you some idea:

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 371 318 33 196617 clear;
#P user ubumenu 26 360 100 196617 0 1 1 0;
#X add slot1-autorndseeel;
#X add slot1-autorndseldev;
#X prefix_set 0 0 0;
#P newex 7 298 78 196617 prepend append;
#P user ubumenu 136 360 100 196617 0 1 1 0;
#X add slot2-autorndseaal;
#X add slot2-autorndseldev;
#X prefix_set 0 0
0;
#P newex 117 298 78 196617 prepend append;
#P newex 33 86 348 196617 t l b;
#P newex 33 134 25 196617 iter;
#P newex 33 158 129 196617 t l l;
#P newex 33 243 193 196617 gate 10;
#P message 33 52 371 196617 slot1-autorndseeel slot1-autorndseldev
slot2-autorndseaal slot2-autorndseldev;
#P newex 152 184 129 196617 regexp slot([\\d])-.*;
#P window linecount 2;
#P comment 246 244 100 196617 this is bad because limited to 10. it
should be abstracted;
#P connect 11 0 10 0;
#P connect 11 0 8 0;
#P connect 6 1 11 0;
#P connect 6 0 5 0;
#P connect 2 0 6 0;
#P connect 3 0 9 0;
#P connect 9 0 10 0;
#P connect 7 0 8 0;
#P connect 3 1 7 0;
#P connect 5 0 4 0;
#P fasten 1 1 3 0 186 227 38 227;
#P connect 4 1 1 0;
#P fasten 4 0 3 1 38 212 221 212;
#P window clipboard copycount 12;

_____________________________
Patrick Delges

Centre de Recherches et de Formation Musicales de Wallonie asbl

http://users.skynet.be/crfmw/max


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