falkTX / Carla

Audio plugin host
https://kx.studio/carla
1.61k stars 146 forks source link

midi events ignored with a plugin with another atom control port #866

Open Houston4444 opened 5 years ago

Houston4444 commented 5 years ago

Not strong now but strange. I'm writing an audio rhytmic tremolo plugin and I had a strange issue only with Carla. This plugin (not ready yet) contains midi in/out ports to able user to synchronize many plugin instances.

I had first 2 midi inputs, written this way in .ttl :

[
    a atom:AtomPort, lv2:InputPort;
    atom:bufferType atom:Sequence;
    atom:supports time:Position;
    lv2:index 2;
    lv2:symbol "ctrl_in";
    lv2:name "Control In";
],
[
    a atom:AtomPort, lv2:InputPort;
    atom:bufferType atom:Sequence;
    atom:supports midi:MidiEvent;
    lv2:index 3;
    lv2:symbol "midi_in";
    lv2:name "MIDI In";
],

but events sent to midi_in were totally ignored when plugin is loaded by Carla. It was working well with jalv and Ardour. Signals are MIDI PLAY and MIDI STOP, but the trouble came also with NOTE ON events.

Finally I tried to unify these two midi inputs this way:

[
    a atom:AtomPort, lv2:InputPort;
    atom:bufferType atom:Sequence;
    atom:supports time:Position;
    atom:supports midi:MidiEvent;
    lv2:index 2;
    lv2:symbol "ctrl_in";
    lv2:name "Control In";
],

and it works well. I think that finally I don't need separate inputs, but there are maybe cases where it can be useful.

Houston4444 commented 5 years ago

argg. finally it's very embarrassing. Ardour (5.12) doesn't sends position infos to my plugin atom port if this port also accept midi events. So, I can't make this plugin fully compatible with Ardour and Carla. Maybe should I make 2 versions, this idea does not enchant me so much.

for info, the source code is here: https://github.com/Houston4444/plujain-ramp

falkTX commented 4 years ago

What is the situation on this? Ardour 6 is coming very soon, I guess they fixed their side of the issue.

Carla should handle this case if you set the "control" designation to the MIDI port.

niclashoyer commented 4 years ago

@falkTX any news on this?

I'm hitting this bug now. I'm using the multi-client-mode and I'm trying to port my jack sequencer that uses a launchpad as control interface.

The launchpad talks midi itself, but sends note on/off for pad touches, so I do have one midi input for the launchpad and another midi input for the sequencer itself (and one output port each, but I don't think that matters regarding this bug).

Adding the control designation just gives a lot of these error messages in the logs:

Carla assertion failure: "fJackBuffer != nullptr" in file CarlaEngineJack.cpp, line 420