[LV2] LV2 vs. Ardour: unexpected time.Position events and time.frames values

Robin Gareus robin at gareus.org
Sat Oct 26 13:24:39 PDT 2019

On 10/26/19 9:34 PM, Sven Jaehnichen wrote:
> If I use a single atom input port without midi, it works like yours and
> it receives time_position events (speed, bpm, ...) from any host I
> tested. Fine.
> If I add "atom:supports midi:MidiEvent" to the same port, it receives
> midi events and time_positon events using jalv (fine too) but it only
> receives midi events using Ardour. 

Odd. I can't reproduce this either :( Which version of Ardour is that?

Take the midifilters.lv2 for example then, some FX have eg. "MIDI Strum" has

 [a atom:AtomPort, lv2:InputPort ;
  atom:bufferType atom:Sequence;
  atom:supports <http://lv2plug.in/ns/ext/midi#MidiEvent>;
  atom:supports time:Position;
  lv2:index 0;
  lv2:symbol "midiin";
  lv2:name "MIDI In"

I just checked (adding some printf to MIDI Strum) with Ardour 5.12 as
well as current git. The plugin receives both time information as well
as MIDI events in the same cycle on a single Atom port.

Do you have a link to some code and/or a recipe how to produce this issue?

> Therefore I came back to the idea with two atom input ports.

Ardour only has a single buffer, this is more of an issue for output
ports though. Since both atom ports point to the same memory address
this can lead to invalid messages being written. LSP plugins had issues
with this.

For inputs it may actually work to use two atom ports if, and only if,
the first port is used for MIDI data. The 2nd (and 3rd, etc) buffer(s)
would be connected to a "silent/scratch" buffer. Ardour can inject
timestamps to those on the fly, but it's not backed by a MIDI event buffer.


More information about the Devel mailing list