midi support questions

Hi there,

i am trying to use midi with Darktable and OpenStageControl on MacOS (Nul n’est parfait)

the idea is to create an interface as you probably guessed :slight_smile:

Can you please confirm :

  • the MIDI channel value can not be a value I can trust on : sending an c5 on channel 1 or on channel 2 is considered the same in Darktable ? the same shortcut
  • could you give me the correct syntax in Miscellaneous to use to specify which port I want to use ?
  • do I need to create a virtual port on macOS to see it listed ? how can I achieve this ?
nlb:darktable.app/ $ Contents/MacOS/darktable -d input                                     [21:54:03]
darktable 5.2.1
Copyright (C) 2012-2025 Johannes Hanika and other contributors.

Compile options:
  Bit depth              -> 64 bit
  Exiv2                  -> 0.28.5
  Lensfun                -> 0.3.4
  Debug                  -> DISABLED
  SSE2 optimizations     -> DISABLED
  OpenMP                 -> ENABLED
  OpenCL                 -> ENABLED
  Lua                    -> ENABLED  - API version 9.5.0
  Colord                 -> DISABLED
  gPhoto2                -> ENABLED
  OSMGpsMap              -> ENABLED  - map view is available
  GMIC                   -> ENABLED  - Compressed LUTs are supported
  GraphicsMagick         -> DISABLED
  ImageMagick            -> ENABLED
  libavif                -> ENABLED
  libheif                -> ENABLED
  libjxl                 -> ENABLED
  LibRaw                 -> ENABLED  - Version 0.22.0-Devel202502
  OpenJPEG               -> ENABLED
  OpenEXR                -> ENABLED
  WebP                   -> ENABLED

See https://www.darktable.org/resources/ for detailed documentation.
See https://github.com/darktable-org/darktable/issues/new/choose to report bugs.

     0.0010 [dt starting]
 Contents/MacOS/darktable -d input

(darktable:8526): Gtk-CRITICAL **: 21:54:29.935: gtk_window_add_accel_group: assertion 'GTK_IS_WINDOW (window)' failed
     0.4402 [input device] Input devices found:

     1.4707 [_midi_open_devices] PortMidi initialized
     1.4707 [_midi_open_devices] found midi device 'APC Key 25' via 'CoreMIDI'
     1.4707 [_midi_open_devices] opened midi device 'APC Key 25' via 'CoreMIDI' as midi0
     1.4708 [_midi_open_devices] found midi device 'APC Key 25' via 'CoreMIDI'
     1.6440 [_gamepad_open_devices] SDL initialized

Cheers

Greeman

The only use dt makes of the channel on incoming messages is that it sends back updates on the same channel. No support for multiple channels for the same port.

You’d specify part of the name (enough to make it unique) used by the portmidi library to identify the port. You disable a port by putting - in front of the name. All remaining by just putting -. By default, all ports are opened and listened to. If portmidi sees them. No idea what that requires on Mac.

thanks for your answer about the midi channel.
for the part concerning disable i think you made a typo :slight_smile: no ?

The doc says :

Darktable uses the simple cross-platform layer PortMidi to access the underlying OS API (Alsa, Core Midi, WinMM). If you are self-compiling, make sure you have included this library.

Starting darktable with the debug parameters -d input will give additional information. It should try to open up to 10 MIDI devices in the order it finds them. On the command line you might see something like this:

[midi_open_devices] opened midi device 'Arturia BeatStep' via 'MMSystem' as midi0
[midi_open_devices] opened midi device 'BCR2000' via 'MMSystem' as midi1
[midi_open_devices] opened midi device 'X-TOUCH MINI' via 'MMSystem' as midi2

Two issues can arise:

  • a device you don’t want to use might be opened anyway (and potentially cause inappropriate behavior, like starting a fireworks show prematurely – see this document); or
  • devices might appear in a different order at the next startup (for example because they are plugged into a different usb port). Since configurations are stored with the device number only, reordering would cause an incorrect layout to be picked up.

You can fix which devices to load in a specific location and which ones to skip using the configuration parameter preferences > miscellaneous > interface > order or exclude midi devices. To skip loading the BCR2000 in the above example and to fix the other two devices into the number 0 and 2 slots, you could set this config parameter to “BeatStep;dontuse;X-TOUCH;-BCR2000”. This would leave the BeatStep as device midi0, always leave midi1 unused and would not load the BCR2000 at all, but if any other devices are connected, they would appear as midi3, midi4 and so on. Adding “;-” at the end would prevent any further devices loading.

If you just specify the configuration parameter as a single minus sign “-”, no devices will be loaded at all.

now on windows11 i have to find how to launch darktable in debug mode.

I am keeping exploring see you soon !