@Christoph-Hart
It's like this ..... I have an external arppegiator triggering my synth... I click my left/right arrows to change preset.... and because I use a custom data model, I have to tap into the pre/post callbacks.... so here's what I get:
synth notes triggering.... click the arrow....
Interface: preLoadCallback triggered - no synth notes triggering when this is running
Interface: onPresetLoad triggered - no synth notes triggering when this is running
Once the onPresetLoad method is finished, a midi note does sneak through into the synth....
Then this callback fires:
Interface: postLoadCallback triggered
This kills the previous notes, and triggers the new ones.....
Here is my full loadGlobalPreset method:
inline function loadGlobalPreset(obj) {
local samplemaps = obj.samplemaps;
local wavetables = obj.wavetables;
local params = obj.parameters;
local fxSelections = obj.fxSelections;
local fxChainOrder = obj.fxChainOrder;
lastLoadParams = params;
// Restore samplemaps
UISoundSelector.syncSamplerMenu(1, samplemaps[0]);
UISoundSelector.syncSamplerMenu(2, samplemaps[1]);
UISoundSelector.syncSamplerMenu(3, samplemaps[2]);
// Restore wavetables
UISoundSelector.syncSynthMenu(1, wavetables[0]);
UISoundSelector.syncSynthMenu(2, wavetables[1]);
UISoundSelector.syncSynthMenu(3, wavetables[2]);
// Update all UI parameters - except the ones that are not tagged as saveInPreset
UserPresetHandler.updateSaveInPresetComponents(params);
// TODO: Restore custom samples
// Fix-up FX menus by stable id, but only when they differ
if (isDefined(fxSelections)) {
for (i = 0; i < fxSelections.length; i++) {
local sel = fxSelections[i];
if (!isDefined(sel) || !isDefined(sel.id)) continue;
local targetId = (isDefined(sel.idName) && sel.idName != "") ? sel.idName : "empty";
local menu = Content.getComponent(sel.id);
if (!isDefined(menu)) continue;
// what saveInPreset restored (by index)
local currentId = UIEffectDropDownMenu.getIdForIndex(menu.getValue());
if (currentId == undefined) currentId = "empty";
// only fire callback if mismatch
if (currentId != targetId)
UIEffectDropDownMenu.setMenuToId(sel.id, targetId, true);
}
}
// Restore FX chain ordering (pageKey -> [4 slots])
if (isDefined(fxChainOrder)) {
for (k in fxOrderKeys) {
local key = fxOrderKeys[k];
local saved = fxChainOrder[key];
// expect an array of length 4 with unique 0..3
if (!isDefined(saved) || saved.length != 4) continue;
UIEffectReordering.pageOrder[key] = saved; // update UI state
UIEffectReordering.applyVisualOrder(key); // move panels
PluginEffectReorder.apply(key, saved); // set DSP chain
}
}
// Update all UI parameters - except the ones that are not tagged as saveInPreset
//UserPresetHandler.updateSaveInPresetComponents(params);
}
It is doing quite a lot... and ultimately what happens is when I switch a preset, I get one voice that sounds one way... and then another voice that sounds completely different... like a voice is being allowed to be triggered before the preset is fully loaded.
It seems to be something related to my effect menus and/or effect re-ordering.
It is hard to explain. Might have to make a video. But any immediate thoughts??