Saving MIDI CC assignments in user presets?
-
@David-Healey By the way - you might have to extend my PR to include macros and MPE in the saved data. I'm only accounting for MIDI CC mappings because I haven't down any thing with macros or MPE in my plugins yet.
-
@dannytaurus Aha I don't think that will help me then. The saving/loading I can do already, and I like having the fallback in the preset. The issue I have is that the updateCallbacks trigger multiple times and overwrite the data I've saved. I'll keep trying.
-
@David-Healey Yeah, that's why I wanted a solution that didn't involve any plugin/preset callbacks at all.
Just wanted zero mappings saved in the presets, and a nice clean
MidiMappings.jssave/load script. -
@dannytaurus I decided to see what Claude would do with the problem. It's a massive commit so I'm not going to rely on it, but I'll leave it here as it might be a starting point for Christoph - or who knows, maybe it's perfect!
https://github.com/davidhealey/HISE/commit/adc0826307163d1e8781d8b024a2090233dfe0c9
-
Worked on this today:
https://github.com/christophhart/HISE/commit/528ccf712722db6bb213470e40a0b4cb47f9775b
I didn't use any preprocessors but a dynamic API call - there's no need for this to be a compile-time setting.
You can define for each of macros, midi & mpe assignments whether they should be stored externally, in the user preset or in the plugin state.
Docs:
-
@Christoph-Hart Oh nice, I'm going to dig into it this evening and try it out. Thanks!
-
@Christoph-Hart For expansions will it use one external xml file per expansion?
-
@David-Healey you can specify the file in the onInit callback so for rhapsody it should work if the developer keeps it tidy
-
@Christoph-Hart This system seems to work very well, haven't thoroughly tested it yet but in the standalone version of Rhapsody it's working as expected.
-
@Christoph-Hart Works great here!

I'm only using it with the
PluginStaterather thanExternal, which I think you're doing @David-Healey ?SubStates: { MidiAutomation: "PluginState" }But it works great with all my scenarios.
-
@dannytaurus Yeah this is what I'm doing
const automationDataFile = Expansions.getAppDataFolder().getChildFile("automation.xml"); const automationDefaults = Engine.createMidiAutomationHandler().getAutomationDataObject(); // Pulls the defaults from the project on first run const uph = Engine.createUserPresetHandler(); uph.setStateManagerProperties({ SubStates: { MidiAutomation: "External", MPEData: "External", macro_controls: "External" }, ExternalFileDefault: { MidiAutomation: automationDefaults }, ExternalFile: automationDataFile.toString(automationDataFile.FullPath) });