Forums > MaxMSP

preloading sfplays from multiple ubumenus

February 21, 2006 | 5:19 pm

hello,

i am trying to preload my soundfiles which are located
in several ubumenus divided according to categories
(percussion, accordian etc.)etc..
i can’t figure out how give each file a unique cue
number.
for example, if the first folder has 33 files in it, i
want these to have cue numbers 1-33. then if another
folder has 24 files in it, the cue numbers would have
to start from 34-57. and then if the third folder had
72 files, then it’s cues would go from 58-129 etc.
you get the idea. i can make it work for the first
two folders, (i think…) but after that, i’m not sure
how to add the values so that the cue numbers increase
according to the number of files in the menus/folders,
adding to where previous cue number left off. i want
this to be dynamic process because the number of files
in each menu/folder are always changing, so i can’t
just set the number ahead of time. is this making
sense?
would anyone be able to help me with a solution? i’ve
been starring at the screen for hours and i just can’t
figure it out. i’m sure it will be quite obvious to
someone else out there.
i would greatly appreciate your help. i’m attaching a
simplified patch as an example. you will be able to
see where i’m stuck. i’ve done the tutorials and read
the docs, searched the forums and i’m still stuck.

thanks in advance,

kenichi

max v2;
#N vpatcher 492 194 1686 940;
#P window setfont "Sans Serif" 9.;
#P user ubumenu 892 70 100 196617 0 1 1 0;
#X add a;
#X add accordianfft;
#X add introfft4;
#X add trueintro2;
#X add trueintro3;
#X prefix_set 0 1
AUDIO:/maxmsp-soundfiles/soundfiles/accordian/ 3;
#P window linecount 1;
#P newex 1006 138 20 196617 t b;
#P message 983 159 50 196617 5;
#P newex 982 95 83 196617 route count;
#P newex 983 118 75 196617 prepend set;
#P user ubumenu 716 71 100 196617 0 1 1 0;
#X add a;
#X add accordianfft;
#X add introfft4;
#X add trueintro2;
#X add trueintro3;
#X prefix_set 0 1
AUDIO:/maxmsp-soundfiles/soundfiles/accordian/ 3;
#P newex 830 139 20 196617 t b;
#P message 807 160 50 196617 5;
#P newex 806 96 83 196617 route count;
#P newex 807 119 75 196617 prepend set;
#P message 348 413 78 196617 preload 69;
#P newex 347 383 73 196617 prepend set;
#P newex 434 227 50 196617 +;
#P user ubumenu 539 78 100 196617 0 1 1 0;
#X add a;
#X add accordianfft;
#X add introfft4;
#X add trueintro2;
#X add trueintro3;
#X prefix_set 0 1
AUDIO:/maxmsp-soundfiles/soundfiles/accordian/ 3;
#P newex 321 28 50 196617 loadbang;
#P newex 653 146 20 196617 t b;
#P message 630 167 50 196617 5;
#P newex 629 103 83 196617 route count;
#P newex 630 126 75 196617 prepend set;
#P number 379 271 35 9 0 0 0 3 0 0 0 221 221 221 222
222 222 0 0 0;
#P message 324 52 50 196617 count;
#P newex 160 272 50 196617 gate;
#P newex 143 168 50 196617 select 1;
#P button 182 192 15 0;
#P message 183 214 50 196617 0;
#P toggle 143 143 15 0;
#P user gain~ 358 519 26 50 158 0 1.071519 7.94321
10.;
#P number 184 245 35 9 0 0 0 3 0 0 0 221 221 221 222
222 222 0 0 0;
#P newex 448 352 90 196617 prepend open;
#P newex 335 304 50 196617 + 1;
#P user ubumenu 324 79 100 196617 0 1 1 0;
#X add "4 Summertime.aiff.7.aif";
#X add "4 Summertime.aiff.8.aif";
#X add a;
#X add mars.14.aif;
#X add mars.15.aif;
#X add mars.16.aif;
#X add mars.17.aif;
#X add mars.27.aif;
#X add mars.28.aif;
#X add mars.29.aif;
#X add mars.30.aif;
#X add mars.31.aif;
#X add mars.44.aif;
#X add mars.45.aif;
#X add mars.46.aif;
#X add mars.47.aif;
#X add mars.48.aif;
#X add mars.49.aif;
#X add mars.50.aif;
#X add mars.51.aif;
#X add mars.52.aif;
#X add mars.53.aif;
#X add mars.54.aif;
#X add mars.55.aif;
#X add mars.56.aif;
#X add mars.57.aif;
#X add mars.58.aif;
#X add mars.59.aif;
#X add mars.60.aif;
#X add mars.61.aif;
#X add mars.62.aif;
#X add osonho.aif;
#X add summertime.1.aif;
#X add summertime.2.aif;
#X add summertime.3.aif;
#X add summertime.4.aif;
#X add summertime.5.aif;
#X add Summertime.aiff.49.aif;
#X add Summertime.aiff.50.aif;
#X add Summertime.aiff.51.aif;
#X add Summertime.aiff.52.aif;
#X add Summertime.aiff.53.aif;
#X add Summertime.aiff.54.aif;
#X add Summertime.aiff.55.aif;
#X add Summertime.aiff.56.aif;
#X add Summertime.aiff.57.aif;
#X add Summertime.aiff.58.aif;
#X add Summertime.aiff.59.aif;
#X add Summertime.aiff.60.aif;
#X add Summertime.aiff.61.aif;
#X add Summertime.aiff.62.aif;
#X add Summertime.aiff.63.aif;
#X add Summertime.aiff.64.aif;
#X add Summertime.aiff.65.aif;
#X add Summertime.aiff.66.aif;
#X add Summertime.aiff.67.aif;
#X add Summertime.aiff.68.aif;
#X add Summertime.aiff.69.aif;
#X add Summertime.aiff.70.aif;
#X add Summertime.aiff.71.aif;
#X prefix_set 0 1 3;
#P message 297 484 26 196617 127;
#P user ezdac~ 330 608 374 641 0;
#P user gain~ 330 518 26 50 158 0 1.071519 7.94321
10.;
#N sfplay~ 2 120960 0 ;
#P newobj 330 482 58 196617 sfplay~ 2;
#P newex 322 350 108 196617 sprintf preload %i;
#P newex 444 146 20 196617 t b;
#P message 421 167 50 196617 60;
#P newex 420 103 83 196617 route count;
#P newex 421 126 75 196617 prepend set;
#P window linecount 2;
#P comment 560 229 394 196617 this is where i’m
stuck…how do i get successive folder to start their
cue number from where last cue number left off? simpel
math? help please!;
#P connect 15 0 18 0;
#P connect 15 0 19 0;
#P connect 18 1 17 0;
#P connect 17 0 16 0;
#P connect 11 0 13 0;
#P connect 18 0 13 0;
#P connect 13 0 19 1;
#P connect 11 0 5 0;
#P connect 10 0 5 0;
#P connect 26 0 20 0;
#P connect 20 0 10 0;
#P connect 5 0 6 0;
#P connect 12 0 6 0;
#P connect 16 0 6 0;
#P connect 19 0 6 0;
#P connect 9 0 7 0;
#P connect 6 0 7 0;
#P connect 7 0 8 0;
#P connect 27 0 11 0;
#P connect 5 0 29 0;
#P connect 29 0 30 0;
#P connect 7 1 14 0;
#P connect 6 1 14 0;
#P connect 14 0 8 1;
#P connect 21 0 11 1;
#P connect 28 0 21 0;
#P connect 10 2 2 0;
#P connect 2 0 1 0;
#P connect 4 0 3 0;
#P connect 1 0 3 0;
#P connect 3 0 28 0;
#P connect 1 0 4 0;
#P connect 27 1 12 0;
#P connect 10 1 12 0;
#P connect 24 0 28 1;
#P connect 20 0 27 0;
#P connect 27 2 23 0;
#P connect 23 0 22 0;
#P connect 22 0 24 0;
#P connect 25 0 24 0;
#P connect 22 0 25 0;
#P connect 35 2 32 0;
#P connect 32 0 31 0;
#P connect 31 0 33 0;
#P connect 34 0 33 0;
#P connect 31 0 34 0;
#P connect 40 2 37 0;
#P connect 37 0 36 0;
#P connect 36 0 38 0;
#P connect 39 0 38 0;
#P connect 36 0 39 0;
#P pop;


February 21, 2006 | 5:59 pm

One thought – do the Q numbers have to be all consecutive?

you could number the folders, say two digits, and number the files
starting at 01 in each folder. so your first folder would be 0101 to
0133, and your next folder would be 0202 to 0224 – use part of your
folder and file names (last two characters?) to provide the information
- might work, but I don’t know your circumstances.

L


February 21, 2006 | 6:25 pm

Hi, Takami,

Away from my machine right now, but I’d speculate that you want a
combination of ubumenu and coll.

ubumenu doesn’t keep track of its length (well, not in a publicly
accessible way), but coll does. So some system of multiple ubumenus
feeding into a coll would probably solve it. (though there is the
limit IIRC of 127-128 files on sflist~) (basically dumping the
ubumenus into coll, using a single counter to generate the cue
numbers.)

Peter McCulloch


February 21, 2006 | 6:57 pm

-> ubumenu -> dumpout -> coll -> counter? depends on the the length
of the array, tought (-~127)…

could use muliple of these, if you want…

*/


February 21, 2006 | 7:31 pm

thanks schurer, peter and lawrence!
i’ll give it a try and let you know how it works out.

thanks again!

-kenichi


February 21, 2006 | 8:42 pm

sorry…how and what do i "dumpout" of the ubumenus into coll?
file names? index numbers? i notice that right outlet of ubumenu is for dumpout, but i don’t understand how to get into coll. sorry i’m confused about how to use the two together..

thanks!

kenichi

-> ubumenu -> dumpout -> coll -> counter? depends on the the length of the array, tought (-~127)…

could use muliple of these, if you want…


February 22, 2006 | 9:58 pm

hello,

i posted the original problem below and peter and schurer came up with what sounds like a possible solution to my original problem.
however, i can’t figure out how to implement their suggestion.
I’m having trouble "dumping out" the contents of the ubumenus into a coll. i can’t figure out how to integrate the two objects. i’ve studied the help/ref docs for both objects, but am stuck. would anyone be willing to show me a quick example of how to dump the contents of an ubumenu into a coll? i would really apprecaite your help.

THank you!

kenichi

POSSIBLE SOLUTION

-> ubumenu -> dumpout -> coll -> counter? depends on the the length of the array, tought (-~127)…

ORIGINAL MESSAGE

i am trying to preload my soundfiles which are located
in several ubumenus divided according to categories
(percussion, accordian etc.)etc..
i can’t figure out how give each file a unique cue
number.
for example, if the first folder has 33 files in it, i
want these to have cue numbers 1-33. then if another
folder has 24 files in it, the cue numbers would have
to start from 34-57. and then if the third folder had
72 files, then it’s cues would go from 58-129 etc.
you get the idea. i can make it work for the first
two folders, (i think…) but after that, i’m not sure
how to add the values so that the cue numbers increase
according to the number of files in the menus/folders,
adding to where previous cue number left off. i want
this to be dynamic process because the number of files
in each menu/folder are always changing, so i can’t
just set the number ahead of time. is this making
sense?
would anyone be able to help me with a solution? i’ve
been starring at the screen for hours and i just can’t
figure it out. i’m sure it will be quite obvious to
someone else out there.
i would greatly appreciate your help. i’m attaching a
simplified patch as an example. you will be able to
see where i’m stuck. i’ve done the tutorials and read
the docs, searched the forums and i’m still stuck.


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