Closed MartijnBraam closed 2 years ago
Ping @dterrahe
The midi interface isn't very configurable at the moment yet; I've got an x-touch mini myself, so have done a lot of testing and customising for that (for example the led rings), but many other devices have idiosyncrasies that would need to be configured/worked around, but which need to be identified first.
Shortcuts are only triggered on the release of a button or when a move happens while a button is pressed. Otherwise it would be impossible to generate double and triple presses or to have button+mouse combinations. There are a few exceptions ("hold" actions, like previews, the H screen or emulated modifier keys) which get enabled on key press and disabled on key release (and if a key is mapped to those, it can't be used in combination with any other keys/mouse actions). So to achieve something like what you want, if your windows configuration utility allows you to bind multiple midi messages to one button press or button release, you could have it send "note on A, note off A" when you press the button and "note on B, note off B" when you release the button and then in dt map note A to toggle on and note B to toggle off.
On the x-touch (and Arturia Beatstep and BCF2000/BCR2000) if you map a button to a toggle (for example the overexposed button bottom right in darkroom) the midi button lights up depending on whether the toggle is enabled. But this depends on whether the midi code for the "note" (that is sent to the controller to turn the button light on) is identical to the button code (that is received from the controller when the button is pressed). Logically they would be, but on the x-touch for example there is on offset of 1. There is a hardcoded correction for just the x-touch in the code, but your nanoKONTROL2 might require something different.
When I was working on the midi prototype I received feedback from a user on the BCF2000, which has motorized sliders, indicating that it worked somewhat fine. I have a BCR2000, which has just knobs, which requires a "Deadtime" setting of 0, otherwise it will ignore any instructions it receives immediately after sending changes (presumably to avoid feedback loops). Tbh my feeling is that knobs (especially with led rings around them, like the x-touch mini) work better than motorised sliders, but I'd be very happy to hear if sliders can work even better. One reason knobs are nice (as long as they are limitless!) is that you can change the accuracy by holding ctrl or shift (or a midi button emulating it, via the global/modifiers action) pressed while turning them. For this to work automatically, fallbacks should be on.
Just in response to "Current things that could be better"; I've tried to find a compromise in the framework between power&configurability and intuitiveness&universality. I was anticipating for every request to make things simpler to receive another to make things more powerful. Instead, I've basically only been asked to allow advanced features to be disabled (so that the system behaved as closely as possible to what people were used to, while still allowing multiple shortcuts, for example both keyboard and midi, to be mapped to the same action). It is not unlikely that when this gets released to the general population there will be a larger group of people who will show more enthusiasm and want the framework to be extended, but by now it is somewhat hard to change the fundamental approach.
So the fun thing with this controller is that most (but not all) buttons don't send note events but CC, with the value going to max when pressing and to 0 when releasing. So to deal with that you'd need a way to only trigger on value increasing or value decreasing.
For the leds I can set the controller to mirror the toggle state of a CC to the led in the internal mode. that works fine for something like the highlights mode. But I want to map sliders to specific modules and have the mute button for the channel enable/disable that module with the led on it reflecting that state. if I switch pictures that state would change without the internal tracking of leds in the controller being able to reflect that.
For a panel with motor fader I was looking at the https://www.behringer.com/product.html?modelCode=P0B1X (but mainly for other audio workflows, not specifically for Darktable) and that has motor faders with capacitive sensing, so it also sends a CC when you touch the fader without moving it, which can be used kill feedback loops. It can also be used to focus the relevant module when touching that fader.
By far the most advanced feature on that panel is the displays per fader though that can have text on it, I have not looked yet into how that actually works in the protocol and I assume that won't be something that's easily supported.
buttons don't send note events but CC, with the value going to max when pressing and to 0 when releasing
How funny. The Beatstep has pressure sensitive buttons too, but it just sends notes with different velocities (a whole series while you change pressure). Velocity=0 is release. Does the nanoKONTROL2 have a mode to do that?
have the mute button for the channel enable/disable that module with the led on it reflecting that state.
If the mute button sends a note you can map it. The module enable/disable show/hide elements don't at the moment send back status, so the light on the x-touch doesn't respond. Which could be considered a "bug" (incomplete implementation).
that has motor faders with capacitive sensing, so it also sends a CC when you touch the fader without moving it
This might work to achieve additional accuracy (make small moves). Maybe even out of the box (with correct configuration of the device).
the displays per fader though that can have text on it
Having a look at the nanoKontrol2's documentation. I would suggest trying to set the "Type" of all the buttons to "Note" and the "Button Behavior" to "Momentary". Note numbers should be all different/unique, On Value=127, Off Value=0. Also set the "LED Mode" to "External".
And please let me/us know how that works for you! We should be collecting a set of setup instructions/suggestions for different devices in the manual. And if possible precooked configuration files that can be sent directly to the device. A possible extension of the MIDI module would allow sending SYSEX files at initialisation and merge shortcutsrc files with default layouts.
We've made a start in https://darktable-org.github.io/dtdocs/en/special-topics/midi-device-support/.
Yeah it looks like using those settings it works pretty great, even leds light up if I link a button to a toggle.
Here's the settings in the file format for the config tool for reference: note_buttons.zip
Would you be able to submit instructions to apply this configuration file to the above mentioned dtdocs page?
Could this issue then be considered closed, or would you have additional suggestions for improvements?
It seems like it works perfectly now with this hardware so this can be closed, where exactly do I send the docs update?
User manual is in the darktable-org/dtdocs repo. Raise a PR or an issue with the text.
I've been testing the midi support in the latest git master and it seems to work pretty great. I used the KORG nanoKONTROL2 which is basically the same as the cheap Behringer panel except it has sliders.
Current things that could be better: