MIDI mapping crawling via lua?

Hey,

I’m thinking of creating a plugin to push changes on parameters to the MIDI Controllers which are mapped to these parameters. I’m talking about the Mapping you can learn in the MIDI dialog.

For that I need to pull the MIDI map a user configured for his/her MIDI Controllers. I can’t figure out how to do this.

Crawling through each and every MIDI mappable element isn’t really practical, no.
But as a workaround, what you could do is to use the API feature “save_midi_mappings” to export the mappings, and then parse that file.

I quickly tried, and saving works fine. Loading it back again with the renoise.Document “load_from” wasn’t so easy (I’ve always found it kind of painful to work with that API, as it’s lacking important stuff like node traversal).
But you can parse the file using other means too, like the SLAXML parser I’m using in vLib:
https://github.com/renoise/xrnx/blob/master/Tools/com.renoise.vLib.xrnx/classes/parsers/vXML.lua

Thanks that’s a good idea. I’ll try that.