I had a quick hack this evening using a Novation Launch Control, and rtmidi. Done very ugly. I basically added some code to main.py which imported rtmidi, and set up a callback. The contents of the callback are rather crude (parameters r,s,t are the three bytes of the MIDI message):
app = application.get_app()
ba = app.brush_adjustment
if r == 0xb8 and s == 0x15:
v = (t/127.0)*5.0-0.5
For a few movements of the knob (the top left, there are two rows of 8, and 8 buttons), the brush size option moved in sync. Then mypaint crashed out with an X11 error.
What I'm trying to figure out how to do is:
1. Have the top 8 knobs in this interface control up to 8 of the current tool options, with predefined scaling from [0...127] (a midi byte) to the desired value.
2. Have the second 8 knobs control the foreground and background colour, and perhaps current layer opacity and something else.
3. Have the bottom 8 buttons toggle visibility/locking of, say, the bottom layer, and perhaps up to three others.
This is a first attempt at reading the python source of mypaint, and having a go. Wondering as to thoughts...
(Also, more generally, being able to have foot pedals and controllers do stuff would be great, and basically that means merely a capacity to have callbacks fire in response to midi messages, and stuff happen without mypaint crashing.)