How to control loaded samples with preset.
-
-
maybe I didn't quite figure it out, but I tried to use expansions, but to use them, I need to add them manually. in other words, I've already built the app, and I don't have any expansions available. Since it looks like you need to add them to AppData, that's the problem. i,m won't to use this folder all time. i need a freedom. And built-in expansions could be a solution for my problem.
When I only used sepplers and ready-made sample maps that were embedded in my tool, everything worked the way I want it to.
Situation with sampler state in different presets: see, i create 2 presets, before and after load sample map into sampler, and i if i change a preset - i do not see different, sampler state has no changed! -
i write about
FileSystem.findFiles
.
my idea: find a samples by wildcard after change a sample path. if path contain nothing - see a warning message, else - load them.
-
-
@It_Used said in How to control loaded samples with preset.:
Since it looks like you need to add them to AppData
You need to add the data files here, not the samples though.
@It_Used said in How to control loaded samples with preset.:
Situation with sampler state in different presets: see, i create 2 presets, before and after load sample map into sampler, and i if i change a preset - i do not see different, sampler state has no changed!
Presets only store/restore the state of UI controls. Check out my video about changing sample maps with presets.
@It_Used said in How to control loaded samples with preset.:
i write about FileSystem.findFiles.
my idea: find a samples by wildcard after change a sample path. if path contain nothing - see a warning message, else - load them.Can you show me an example?
-
- Yes, that's what I meant, but maybe I'm using the wrong wording because I don't speak English. I ask you to forgive me in advance for possible inaccuracies and lack of information.
- I've watched almost half of your videos, but there's still a lot to come, thank you for your advice, maybe I'll change my approach and watch all your videos on the channel in full, and then I'll do something.
- No example, alas, this problem has stopped my progress. in the fact all is ready, samples and samplers have have the same names, or such, witch can be used in the
for
cycle, main work in the samples finding. The rest is not a problem to implement.
-
@d-healey
Still, I was able to figure out how to search for files, but one thing is still not clear to me, I can't use my wildcard variables that could change, I have to search for all files, I can't make it so that only *.ch files are searched. (Hard solution are founded) and The most wonderful solution (Thanks D.Healey)
the example here is specific, but in general it turns off the buttons in real time, for vendors whose samples are not detected.
inline function checkSamples() { // Declare find path. local samplesPath = FileSystem.getFolder(FileSystem.Samples); // Declare files var. local fFiles = []; // Resaults var. local findResaults = []; // Find files. fFiles = FileSystem.findFiles(samplesPath, "*", false); // Push files. for (f in fFiles) { findResaults.push(f.toString(f.Filename)); } // Check files with wildcard findResaults.every(function(arr) { for (i = 0; i < instrType.length; i++) { if (arr.contains(instrType[i])) { vSelector.btnVendor[i].set("enabled", true); } else { vSelector.btnVendor[i].set("enabled", false); } } }); };
-
@It_Used said in How to control loaded samples with preset.:
Still, I was able to figure out how to search for files, but one thing is still not clear to me, I can't use my wildcard variables that could change, I have to search for all files, I can't make it so that only *.ch files are searched.
dont you need to search for .ch1 files? not .ch files...
fFiles = FileSystem.findFiles(samplesPath, "*.ch1", false);
-
@Lindon no, no, for all ch in range ch1 to ch10, but i already find a solution. By move find to for cycle
const fileExt = []; for (i = 0; i < 10; i++) { fileExt.push("ch" + (i + 1)); } // Find files. for (ext in fileExt) { fFiles = FileSystem.findFiles(samplesPath, "*." + ext, false); // Push files. for (f in fFiles) { findResaults.push(f.toString(f.Filename)); } }
-
@It_Used yeah that would work I think.... ch10 ? - Grief how big is a single sample map ?
-
@Lindon This is still a fairly small size, when I converted all the samples to Multi-Mic, parts of the ch files there reached 10 and then the letters ADCDEF were added.
-
@It_Used Try
*.ch*
-
@d-healey oh shit this work... How did I not come up with such a simple solution?
Thanks again!