MIDIdef Slider2D

i have a Slider2D which peforms an action and i would like to be able to send the slider movement via MIDI to the DAW and playback the recorded MIDI to move the Slider2D. (the routing is not the problem, have a setup with loopMIDI which is working).
how can i do that using for example MIDIdef.cc? thanks

var xySlider = Slider2D()
.action_{ |view|
	... some action ...

MIDIOut: make sure this is configured correctly/going to the correct port/etc.

From the GUI object, .control method from MIDIOut.

MIDIIn: same thing basically - make sure you have the right port sending messages in.

And basically this:

w = Window.new.front.alwaysOnTop_(true)

l = Slider2D(w, w.view.bounds)



MIDIdef.bend(\test, {|val, num, chan, src| var pos = val * 16383.reciprocal; {l.x_(pos)}.defer})

I used bend because it was the most convenient analog I have available to me at the moment, but there’s nothing stopping you from using cc

thanks, currently looking into 14bit midi for a better resolution.