Forums > MaxMSP

problems reading in folder of samples to sflist

November 30, 2006 | 6:30 pm

Hi list,

I have a patch to convert the contents of a folder into an preload list to be read into an sflist~ object. The folder name is stored in a pattr so that I can use the patch for a multi-sampler I’m building to use with my electronic drumkit.

Max keeps crashing when changing between stored pattr presets which at first I attributed to my hard disk speed but it doesn’t seem to matter how many files are being fed into the sflist~. Does any one have a better idea on how to extract filenames from a folder and pass them to sflist~?

Cheers,

Don

max v2;
#N vpatcher 224 84 1018 531;
#P origin 0 33;
#P window setfont "Sans Serif" 9.;
#P newex 626 273 47 9109513 tosymbol;
#P newex 616 185 19 9109513 t b;
#P newex 613 213 46 9109513 pv folder;
#P newex 626 247 64 9109513 sprintf %s%s;
#P newex 535 182 19 9109513 t b;
#P newex 621 33 45 9109513 loadbang;
#P newex 494 239 28 9109513 sel 0;
#P newex 617 113 43 9109513 sel clear;
#P newex 496 262 27 9109513 + 1;
#P newex 494 192 19 9109513 t b;
#N counter;
#X flags 0 0;
#P newobj 494 216 66 9109513 counter;
#P newex 616 136 62 9109513 route append;
#P message 620 64 62 9109513 types WAVE;
#P newex 617 87 32 9109513 folder;
#P newex 513 310 114 9109513 sprintf preload %ld "%s";
#P newex 326 74 61 9109513 pattr filepath;
#X prestore 1 0 "D:/Imperial Drums/COWBELL/AMB samples/";
#P objectname filepath;
#P newex 281 176 48 9109513 route text;
#P newex 277 105 57 9109513 prepend set;
#P message 548 349 26 9109513 print;
#P button 516 33 15 0;
#P newex 516 57 71 9109513 opendialog fold;
#N sflist~ snare 0;
#P newobj 502 382 60 9109513 sflist~ snare;
#P user textedit 279 136 425 164 0 139 9 "D:/Imperial Drums/COWBELL/AMB samples/";
#P objectname textedit;
#P message 206 48 14 9109513 8;
#P message 189 48 14 9109513 7;
#P message 172 48 14 9109513 6;
#P message 155 48 14 9109513 5;
#P message 206 27 14 9109513 4;
#P message 189 27 14 9109513 3;
#P message 172 27 14 9109513 2;
#P message 155 27 14 9109513 1;
#P message 122 48 14 9109513 8;
#P message 105 48 14 9109513 7;
#P message 88 48 14 9109513 6;
#P message 71 48 14 9109513 5;
#P message 122 27 14 9109513 4;
#P message 105 27 14 9109513 3;
#P message 88 27 14 9109513 2;
#P message 71 27 14 9109513 1;
#P comment 155 12 35 9109513 save;
#P window setfont "Fixedwidth Serif" 10.;
#P message 144 195 83 9240586 storagewindow;
#P window setfont "Sans Serif" 9.;
#P message 86 172 28 9109513 clear;
#P window setfont "Sans Serif" 10.;
#P message 72 73 33 9109514 read;
#P message 109 73 38 9109514 write;
#P window setfont "Fixedwidth Serif" 10.;
#P message 112 127 53 9240586 store $1;
#P newex 67 221 272 9240586 pattrstorage @name pattr_test @autorestore 0;
#B color 5;
#X client_rect 0 0 640 240;
#X storage_rect 15 55 655 295;
#P objectname pattr_test[1];
#P window setfont "Sans Serif" 9.;
#P comment 71 12 36 9109513 load;
#P connect 15 0 1 0;
#P connect 14 0 1 0;
#P connect 13 0 1 0;
#P connect 12 0 1 0;
#P connect 11 0 1 0;
#P connect 10 0 1 0;
#P connect 9 0 1 0;
#P connect 8 0 1 0;
#P connect 2 0 1 0;
#P connect 6 0 1 0;
#P connect 5 0 1 0;
#P connect 4 0 1 0;
#P connect 3 0 1 0;
#P connect 16 0 2 0;
#P connect 17 0 2 0;
#P connect 18 0 2 0;
#P connect 19 0 2 0;
#P connect 20 0 2 0;
#P connect 21 0 2 0;
#P connect 22 0 2 0;
#P connect 23 0 2 0;
#P connect 26 0 29 0;
#P connect 31 1 24 0;
#P connect 29 0 24 0;
#P connect 24 0 30 0;
#P connect 35 0 37 0;
#P connect 37 0 36 0;
#P connect 36 0 40 0;
#P connect 40 1 38 0;
#P connect 28 0 25 0;
#P connect 32 0 25 0;
#P connect 38 0 32 0;
#P connect 27 0 26 0;
#P connect 26 0 42 0;
#P connect 42 0 36 3;
#P connect 26 0 44 0;
#P connect 45 0 44 0;
#P connect 39 1 35 0;
#P connect 35 0 45 0;
#P connect 34 0 33 0;
#P connect 30 0 33 0;
#P connect 26 0 33 0;
#P connect 33 0 39 0;
#P connect 46 0 32 1;
#P connect 41 0 34 0;
#P connect 44 0 43 0;
#P connect 43 0 46 0;
#P connect 35 0 43 1;
#P pop;


November 30, 2006 | 7:38 pm

> Does any one have a better idea on how to extract filenames from a folder and
> pass them to sflist~?

I tend to use [ubumenu] as much as I can. It deals with the filtered type,
too. The right outlet gives you the count of elements, in case you need it.


December 1, 2006 | 9:18 pm

Right. I’ve defragged and that has helped a little.

Max seizes up only when switching between pattr stored presets and not when actually playing would this…
a) indicate a problem with the way I’m populating sflist~…
opendialog fold (select a folder with multi-samples) to folder to sprintf to sflist~
(I can’t see many other ways to do this other than ubumenu but I plan to use this as a Pluggo)
b) indicate a problem with the way my pattr presets are recalled – the filename is stored in a bound textedit box in a bpatcher within a subpatch
c) a problem with my hardware. I would like to run 12 separate sflists holding a total of about 300mb between in about 600 samples. I’m running Max on XP on a Sempron 2300 1500Ghz with 1Gb RAM and a 125Gb Maxtor 7600rpm hard drive. Is this asking too much?

It’s certainly asking a lot to look through this so thanks in advance for any tips…

Don


December 2, 2006 | 10:27 am

A while back, I wrote a patch to play multiple soundfiles in order to play cues in theaters. For the playlist, I began with sflist. Off the top of my head, I can’t remember what the problem was, but I definitely had problems with sflist, perhaps because I was using a javascript to poplulate the list (speed too high?). All I remember is that it behaved erratically. Other users reported similar frustrations here in the list. Instead, I went over to using coll, and connect this with a jit.cellblock. This combination allows for easy sorting after populating the list, easy visualisation of the list, saving various lists for the same coll and various other advantages. I’ve been using it for a while now, and there has never been any problem or noticeable latency on my machine (WinXP, P4 3 GHz, 1GB RAM).


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