Feature #10919

darktable and MIDI controler

Added by daniel patin over 3 years ago. Updated 10 days ago.

Target version:
Start date:
Due date:
% Done:


Affected Version:
hardware architecture:


Hi, sorry for my poor english.

many Lightroom users use USB MIDI controler for fast and confortable use. you can assign each setting to one controler for time saving and accuracy
on tread on twitter, but in french:
this feature is possible to implant in Darktable?


#1 Updated by Tobias Ellinghaus over 3 years ago

In theory that would be possible. However, until a developer needs that it will most likely not happen.

WARNING: Brainstorming about darktable internals ahead.

One way to handle that could be handled is interfacing Lua to vimkeys (or rather, using the same mechanism to access controls) and then have a Lua script that interfaces with MIDI controllers.

#2 Updated by Tobias Jakobs over 3 years ago

Gimp supports MIDI controller, perhaps there is some code to share.

#3 Updated by daniel patin over 3 years ago

you can find here old mac app for assign MIDI keyboard to keystrokes:
and the source code is on github

#4 Updated by Christian Kanzian over 2 years ago

Tobias is working on this. More about the progress can be found here:

#5 Updated by Tim Sinthofen almost 2 years ago

I checked the link and saw that Tobias was basically trying to build some Midi Hardware, which didn't work out.
I just want to leave a affordable device here, if somebody still wants to try to implement MIDI: Akai LPD8.
50€ for a board with 8 pads, 8 rotary knobs. And as far as i understand can switch between 4 "programs" basically giving you 4 different mappings for each of the controls.
For implementation you could also check (DJing software)

#6 Updated by Philippe Gauthier over 1 year ago

Hi there,
I'm very interested in this feature too and I have a Korg nanoKontrol2, so I gave it a try.
I found a basic midi C library : : reading and writing (turning pannel's leds on/off) to the controller works fine.
I don't know how darktable's insides are designed, but I tried to hardcode a basic midi mapping as proof of concept.
I did a dirty thread in the main loop, listening for midi inputs, and called some image processing function I found, for exemple : dt_dev_exposure_set_exposure(darktable.develop,midiValue);
It kinda works but it stacks too many processing jobs while you move the knobs, and takes forever.
How do I abord previous job if the knob moved while previous job is still in process?
If there is some documentation on the image processing pipeline/jobs API, I'd be glad to read it.

#7 Updated by Tobias Ellinghaus over 1 year ago

  • Category changed from Darkroom to General
  • System changed from Mac OS X to all
  • % Done changed from 0 to 20
  • Status changed from New to Triaged
  • Tracker changed from Bug to Feature

Currently the whole control infrastructure inside darktable is not suited to something like that. It will require a major rewrite of several parts.

I started work on that a while ago and hope to continue it once we have the next release out.

#8 Updated by Matthew Harrison over 1 year ago

Please can the new infrastructure be flexible enough to support:
Absolute position sliders or dials
Relative position sliders or dials
Motor driven sliders
Led indexed dials
I'll be buying a controller when support is added. Thanks Tobias for the work.

#9 Updated by Tobias Ellinghaus over 1 year ago

Yes, all of that is on my list already.

#10 Updated by Philippe Gauthier over 1 year ago

Ok, thanks Tobias, good luck then! :)
Just to keep track, I published what I did here :

#11 Updated by Slipe Lop 11 months ago

It kinda works but it stacks too many processing jobs while you move the knobs, and takes forever.

Would it be possible to do rate limiting? You can probably move a slider or knob from 0 to 127 in 0.1 seconds. That's 1270 events per second. What if you set a maximum of 5 events per second, for instance? (discarding the rest).

Different question: could midi support be implemented using the Lua interface? Then one could support any kind of input hardware, not only midi (say VR controllers or a Leap motion).

#12 Updated by Andreas Kreuzer 10 days ago

Hi, I am new to darktable-developement and interested in contributing to implement this feature.
I have some experience in embedded C but not very much with git and such a complex project.
Could anybody give me a hint how and where to start implementing?

Also available in: Atom PDF