MIDI Learn 2024
-
I would like to roll my own MIDI Learn UX.
Right clicking will offer "Learn MIDI..." which will then pop up a separate window where the user can enter the number or it will enter itself on controller, and will also display all currently mapped controllers.
Can I somehow plug into the built in MIDI learn functionality? I'm aware of the floating tile that shows the mappings, but since I'd like to change the UX of mapping a control, I'd need a method to link a control and a controller #.
If not, what's the next best thing, just calling setAttribute on UI controls from down the line? What if the UI script is deferred, are the control callbacks executions still synchronous?
My noteOn, noteOff and Controller functions in the UI script trigger repaints of certain panels, so I figured it's a good idea to defer the UI script. This means I have to call setAttribute on controller from my logic script down the line.
In this case it looks like this:
- create global object to store CC mappings
- in Performance script, check on controller for array index, if not undefined, set value of that control using setAttribute (which should trigger the callback of the control as well, if I'm not wrong). I'll need to manually calculate the value based on min, max and midpoint
Anyone have any better solutions or have worked on their own CC mapping implementations?
-
MidiAutomationHandler is what you want I think:
https://docs.hise.audio/scripting/scripting-api/midiautomationhandler/index.html
-
Yup, that class should provide you all you need to implement your own MIDI learn UX. You don't need to roll your own MIDI logic, but just pass a JSON object with the MIDI CC numbers and what processor attribute from your interface you want to control.
-
@aaronventure Are you SEO'ing your post?
-
@clevername27 Yes!
-
@Christoph-Hart How does this work with persistence? Do I have to keep a copy of the object that I'm then updating, sending to the handler and storing in my own persistent storage solution? Any gotchas?
-
@aaronventure You could write it to a json file.
-
@d-healey Global mappings and project backwards compatibility unfortunately aren't part of the same universe.
-
@aaronventure said in MIDI Learn 2024:
How does this work with persistence?
Midi Mappings are stored in a preset so you don't have to do anything. The JSON objects are just temporary objects that you need for manipulating the data model (or display stuff on the UI).