2 Sets of Sample Maps?
-
@d-healey I don't understand - the arrays aren't related to the sample maps in any way - I was expecting to do something like below but the function doesn't work like that...
inline function onSAMPLEBOXControl(component, value) { Sampler1.asSampler().loadSampleMap(sampleMaps[a1]); }; Content.getComponent("SAMPLEBOX").setControlCallback(onSAMPLEBOXControl);
-
@DanH Show me how you're doing it currently with a single array
-
inline function onSAMPLEBOX1Control(component, value) { TRANSIENT.asSampler().loadSampleMap(sampleMaps[value-1]); }; Content.getComponent("SAMPLEBOX1").setControlCallback(onSAMPLEBOX1Control);
-
Right, your array is called sampleMaps and this contains all of the sample maps.
You want to split this into two arrays, one for each combobox (there are other ways but this will be the simplest). Your code will look exactly the same except the name of the array will be different in each combobox's callback.
-
@DanH said in 2 Sets of Sample Maps?:
inline function onSAMPLEBOX1Control(component, value) { TRANSIENT.asSampler().loadSampleMap(sampleMaps[value-1]); }; Content.getComponent("SAMPLEBOX1").setControlCallback(onSAMPLEBOX1Control);
OK so where are you loading up "sampleMaps" ??
-- and maybe think about naming things better...
const var mySampleMaps = ["mapName1","mapName1","mapName2","mapName3","mapName4","mapName5","mapName6"]; inline function onSAMPLEBOX1Control(component, value) { TRANSIENT.asSampler().loadSampleMap(mySampleMaps[value-1]); }; Content.getComponent("SAMPLEBOX1").setControlCallback(onSAMPLEBOX1Control);
can you work i tout from there?
-
-
@DanH That function just provides an array of sample maps names. If you know the names aren't going to change you can write it out manually like Lindon demonstrated.
-
@d-healey Thanks, I wrote out all 320 in my last project into one array (in order to change the names) :face_with_tears_of_joy:
So to clarify something - when I had a list of sample maps and I deleted say one, the whole list after that one obviously shifted one map - and my presets which used the maps after that one were loading the wrong maps (i.e they loaded the map 1 below what I had saved).
Am I going about this the wrong way? Should the sampler be able to find the correct sample map no matter how they are arranged in the samplemaps folder?
-
Should the sampler be able to find the correct sample map no matter how they are arranged in the samplemaps folder?
The sampler doesn't do any finding. All it does is load the sample map you tell it to, it's your job to implement the mechanism for that.
If you are loading sample maps from a UI control and that UI control is saved in the preset, then when you delete or add a sample map it could definitely screw things up and I think there's not much you can do about it.
-
@d-healey Ok I think my assumption was right then, thanks.