Can a specific samplemap be loaded by passing the filename as string?
-
So far, I relied on the function
sampleMaps=Synth.getSampler('Sam1').getSampleMapList();
and browse through all available maps by a slider with this in the callback:
Synth.getSampler('Sam1').loadSampleMap(sampleMaps[value]);
But now that I need to restrict specific samplers to choose between very few maps only, so: Can I make an array with the filename strings of let's say 3 specific sample maps?
-
@Frankbeat What does the
sampleMaps
array that you're currently using contain? -
@d-healey I don't yet use an array for this at all. I just use the built in function that looks up all maps that are contained in the project folder. But how would I do it, if Sampler 1 must only load maps bass-drum-1 and bass-drum2 but not maps with names other than those?
-
@Frankbeat
loadSampleMap(sampleMaps[value]);
You're using an array here, it's calledsampleMaps
it was populated by thegetSampleMapList
function.So take a look inside the array (use the variable watch table or the trace command), and then you'll have the answer to your original question.
-
-
@Frankbeat I'm not sure if the extension is required, just do the same as what's in the sampleMaps array.
-
@d-healey Solved, thank you very much! Indeed the suffix isn't needed.