Ardour midi self-controlling

Hello guys!

Is there a way to create MIDI track/bus|audio track/bus with midi output that can control the Ardour?

I believe there are possibilities of creative usage:
a) One MIDI CC that would stop playback (would be great for live usage)
b) “Compressor” using MIDI. Plugin watching volume, sending MIDI CC 01 [volume] controlling one or more faders/filters/panning/everyhing
c) Dozen of other usage I can’t imagine now.

The a) maybe has some solution without midi. b) can be almost everytime solved with compressor/envelope/filter/EQ plugins and/or with automation… but I would like to use this way (when playing live, you cannot prepare automation and not all types of crazy things can be done with existing plugins - and writing new plugin is pretty overkill).

I tried to do this, but there was few problems.
First, Ardour don’t react on MIDI CCs coming from Ardour bus, although MIDI monitor showed me messages going through - being same like from USB controller which worked. I can work-around this by sending midi elsewhere than Ardour and then back to Ardour MIDI control bus. Direct connection did not worked.
Second one which may be just my ignorance: I could not find, how to insert CC into MIDI track.

Thank you and have a nice day.

Please be more specific about the MIDI routing you are using. There’s no reason why what you’re describing would not work, at least not that I’m aware of. I believe that we consider MIDI connections to be equivalent to audio connections when considering the “data graph” between tracks and busses. Also, the version of Ardour that you’re using.

Hello. It was maybe the most simple setup you can even imagine.
2 audio tracks, one having audio->midi plugin (I cannot find what was that - it converted audio level into configurable CC A B - A was configured in GUI, B was audio level) and midi output was sent into Ardour control jack input.
I tried to look what’s going on the channel with midi monitor (ardour-inline) and it was the good old midi CC messages like from Korg nanokontrol (which was working flawlessly).

The only way to make it work (but pretty unreliable) was send MIDI to Jack MIDI through and then back from MIDI thru to Ardour control.

I’m always trying to use self-compiled, latest stable version. So now it should be 5.4 tag from git:
Ardour5.4.0 (built using 5.4 and GCC version 6.2.1 20160830)

Yeah, and the second question: is it possible to insert MIDI CC into midi “timeline”? If yes, how?

Thank you!

All MIDI CC data is treated identically to automation. Click on the “A” (automation) button for a MIDI track and select from the menu to make the “lane” for a particular controller visible. The data can be entered graphically or by recording MIDI.

Here’s an example how to use CC in Carla LV2 for controlling Shortcircuit1(VemberAudio):

The MIDI control inputs of control surfaces (e.g. generic MIDI etc) are not part of the process-graph. They cannot be fed from Ardour tracks/busses. So yes the only way to make this work currently is to send them elsewhere first, like you did.

Sending MIDI to another track or bus however does work.

Thanks for your replies! I will try your tips whenever I will have piece of time to do it.

About process-graph - is there some reason for it? Is there possibility to change sourcecode and add it to internal processing?

There is a conceptual disconnect:

Tracks and Busses are in a graph: e.g. if Bus 2’s input depends on Track3’s output: first process Track3, then run Bus 2.
Control Surfaces are user-interfaces. They are handled asynchronously (e.g. OSC message or GUI button presses may arrive at any time and are queued)

Control messages are processed at the beginning of every process cycle before doing any processing: Depending on the control event(s), Ardour may even split the process cycle internally. e.g. Process 100 audio-samples, apply change, then process remaining samples.

Output from a given MIDI track is only available at the end of the process cycle. The buffer is flushed to jack… and cleared when the next cycle begins. So when Ardour comes around at the beginning of the next cycle it’s too late.

Strictly speaking, connecting a Track’s MIDI output to a Ardour’s MIDI control input actually constitutes a feedback loop. The control-input depends on output of the track, but the track’s processing itself depends on the control-data. Adding some external jack-client in-between breaks that loop (and adds 1 cycle latency).

But yes, it’s all software, so you can hack the sourcecode :slight_smile: AsyncMIDIPort::cycle_start () would be the place to start.