prko
October 21, 2022, 3:22pm
6
Ah, there are also .load
, .loadRelative
and .relative.load
.
"xxx.scd".load
"yyy.scd".loadRelative
"zzz.scd".resolveRelative.load
I think it would be helpful if you constructed folders with the composer’s names and put unique codes with unique names.
Then you can make a dictionary with the folders, and then you could make an array in each folder. Please refer to the following code:
FWIW, I looked at the code for these methods, and I can’t see why it wouldn’t work.
I don’t have access to SC in Windows at the moment, so I have zero idea what is the issue you’re seeing. Can’t move forward until you can provide the error text (with stack trace).
This really should be done with recursion. It’s the cleanest way to go into any number of nested sub-sub-sub-sub-folders. (Your way might handle subfolders, but what if they are 8 levels deep?)
(
~scanDirectory = { |path, dict|
v…
and the following code as well:
@scnils
Does the following code work for you?
My code is not so elegant as the code by @jamshark70 ,
but it seems to work well at least on my end:
(
~buffers = Dictionary[];
~pathBase = Platform.resourceDir;
PathName(~pathBase).filesDo { |item|
var
folder = item.folderName.asSymbol,
path = item.fullPath;
if ("aiff|aif|wav|flac".matchRegexp(item.extension)) {
if(~buffers.at(folder).isNil) {
~buffers.put(folder, []);
("The dictionary key \\" ++ folder + "is added to ~buffers").pos…