Initial MIDI feedback for custom control surface


I am creating a custom firmware for MIDIPLUS SmartPAD which is a pretty cheap Launchpad-like controller.

At the moment I have pretty much implemented all the hardware functionality and am thinking about the different modes I want to implement and how to achieve a sensible mapping between the pads and corresponding MIDI messages and so on.

As a first use case I want to assign the first 16 pads to soloing the corresponding track, the next 16 pads to mute and the next to record. They should light up in different colors, e.g. red for the record pads.

I have created a midi_map and it is working as expected except for one thing:
When I push one of the buttons the action is performed and due to Ardour’s feedback MIDI message the pad lights up or is turned of. Now when I save the session with say a track muted and open it another time the pad will not light up because Ardour does not send feedback messages for the current state.

Is there any possibility to generate initial feedback messages for all the midi-mapped parameters? Is this implemented in some other controller class like Mackie? As I have full control over the firmware I could for sure include Mackie protocol support. I also thought about some kind of OSC translation daemon or something in that direction. On the other hand there is Lua as well but I am not sure if you can hook into the control MIDI channel. The last option would be to implement a custom control device class but I think this would be a bit overkill.

What do you think? Is there something obvious that I might have overlooked?

Thank you for your feedback!


In the meantime I made a strange observation:
When opening Generic MIDI settings all the buttons suddenly light up as they should! But opening this dialog every time I open a session seems like a hacky workaround. The messages are only sent when opening the dialog for the first time though.
Is there any setting I might have wrong that inhibits sending of initial MIDI messages?

Just a quick heads up: I do not know the answer to most of your questions and I’m not very familiar with tge generic-midi protocol. I’ve only just had a quick look but perhaps I can provide a few leads to follow up .

It seems that generic MIDI ctrl surface doesn’t do that. The function that is called once both input and output ports of the device are connected, does nothing:

Perhaps it’s a chick/egg bug: MIDI-learn does emit a message when the control is assigned (set_state), but at this point in time the device is not yet connected.

Yes. In Mackie’s case, it is nested for each surface: Surface::connected() calls ::turn_it_on() which pushes the state. A better example is probably FaderPort8::connected() that method is used to initialize user-mappings, transmit session state and assign strips to the device. in libs/surfaces/faderport8/

Thank you very much for your answer, Robin!
I compiled Ardour myself and will have a look if I can find the problem with initial feedback for generic MIDI.

In the meantime I played a bit with Mackie mode. But it is a bit strange: When I activate for example a track mute via Ardour GUI there is no feedback sent to the controller at all. I used profile for Behringer X-Touch since it has LED buttons for mute, record and so on. How does Ardour light up these buttons on the Behringer device?
Since there is not much documentation of the Mackie protocol it is quite hard to figure out exactly how it works.

For Mackie, buttons and LEDs use MIDI note-on messages. The Mute LED specifically would be libs/surfaces/mackie/ MidiByteArray (3, 0x90, id(), msg); id() is 0x10 for the mute-LED of first channel-strip.

The Faderport8 protocol is to large parts identical to Mackie (scribble script, and colored LEDs are extensions). It is very well documented Chapter 11.2 page 77, 78 is pretty much MCU:

I recall seeing seeing some a site with Mackie Universal spec in the past, but I can’t find it just now. maybe? The link with “The old manual” chapter 13 is for the Logic Control which is the same as the Mackie control except for the initialization. I don’t know what the initialization for the universal is but the straight mackie control and the xtouch don’t use that anyway. That is, if you choose the mackie control universal, things won’t work for anything but the universal, but if you use the mackie control setting almost everything works at least somewhat.

1 Like

Thank you very much for documentation links and hints!

I just compiled current master branch and with this initial feedback is working properly! So this bug is obviously fixed. Therefore I will stick with generic MIDI for the moment and use the workaround with opening the configuration window in Ardour 5.12.

Thank you very much!