Ctrlr vsti sends midi messages twice

Home Forums General General MIDI discussion Ctrlr vsti sends midi messages twice

This topic contains 15 replies, has 7 voices, and was last updated by goodweather goodweather 1 month ago.

Viewing 16 posts - 1 through 16 (of 16 total)
  • Author
    Posts
  • #68891
    Possemo
    Possemo
    Participant
    • Topics: 13
    • Replies: 582
    • Total: 595
    • ★★★

    Does someone know a workaround for the vsti bug sending midi messages twice? Or is this not an issue on modern synths? When you send a midimessage via Lua script it will send the message just once, but all modulators no matter if sysex or CC’s will send all values twice.

    I am thinking about making a special vsti version for my panel that will send values via Lua script but I would be glad if there would be an easier way…

    #68892

    dasfaker
    Keymaster
    • Topics: 79
    • Replies: 785
    • Total: 864
    • ★★★

    With Ctrlr plugin, if you set to on “Enable output to plugin host”, messages are sent to the midi output port and to the host, and the midi monitor shows the same message duplicated. But there’s only one sent to the synth’s port.
    You can see the name of the ports where messages are sent on the midi monitor, menu View -> Show device name

    #68900
    Possemo
    Possemo
    Participant
    • Topics: 13
    • Replies: 582
    • Total: 595
    • ★★★

    Thanky you for your answer dasfaker. Well this makes me thinking that the bug could be related to my vst-host (Reaper). Ctrlr MidiMonitor shows this:

    [17:50:32:000842]: Dev:[VST OUTPUT] Ch:[ 1] RAW:[b0 63 00]
    [17:50:32:000842]: Dev:[VST OUTPUT] Ch:[ 1] RAW:[b0 63 00]
    [17:50:32:000842]: Dev:[VST OUTPUT] Ch:[ 1] RAW:[b0 62 05]
    [17:50:32:000842]: Dev:[VST OUTPUT] Ch:[ 1] RAW:[b0 62 05]
    [17:50:32:000842]: Dev:[VST OUTPUT] Ch:[ 1] RAW:[b0 06 01]
    [17:50:32:000842]: Dev:[VST OUTPUT] Ch:[ 1] RAW:[b0 06 01]

    This should be 3 messages not 6. I will test this on Cubase maybe it reacts differently. Most people here seem to use Ableton Live, maybe this works best…

    #68901
    Possemo
    Possemo
    Participant
    • Topics: 13
    • Replies: 582
    • Total: 595
    • ★★★

    Btw. same prob with sysex:

    [19:22:57:000301]: Dev:[VST OUTPUT] Ch:[–] RAW:[f0 41 39 00 24 30 01 19 69 f7]
    [19:22:57:000301]: Dev:[VST OUTPUT] Ch:[–] RAW:[f0 41 39 00 24 30 01 19 69 f7]

    But it works as expected with Lua generated sysex:

    [19:26:23:000288]: Dev:[VST OUTPUT] Ch:[–] RAW:[f0 41 38 00 24 20 01 20 46 41 54 20 46 49 46 54 48 20 38 00 00 60 4e 05 00 40 00 00 40 00 00 73 7f 7f 35 00 00 00 62 55 6d 68 63 00 00 00 00 00 00 00 00 00 00 00 00 7f 00 7f 00 7f 00 23 63 00 29 16 41 71 36 00 00 00 60 00 60 00 60 60 00 20 20 00 00 00 00 20 00 00 00 00 50 50 20 50 50 40 60 40 20 00 10 00 00 00 00 10 00 00 f7]

    #68903
    Carl Licroy
    Carl Licroy
    Participant
    • Topics: 3
    • Replies: 28
    • Total: 31

    Hi Possemo!

    I’ve experienced the same behaviour with CTRLR, that’s why when I load a panel, I only setup midi “Input” and “Output” and let “Controller” set to “none”.

    #68921
    Possemo
    Possemo
    Participant
    • Topics: 13
    • Replies: 582
    • Total: 595
    • ★★★

    Hi Carl. First I want to thank you for your great Prophet08 panel. I used a lot of lua code for my own panels.

    The issue I described only happens in the vst plugin. I just select “output to plugin host”. Input, Output and Controller are set to –None. But it still sends Midi messages twice.

    Disabling “output to plugin host” and selecting an “Output” is not an ideal workaround as the vst-host already uses the Midi-port where the synth is connected to. There may be a way with virtual Midiports, re-feeding into the vst-host.

    #69524
    Grimulkan
    Grimulkan
    Participant
    • Topics: 0
    • Replies: 2
    • Total: 2

    This issue still exists when using host MIDI I/O, i.e., every message is sent twice. Likely a bug.
    2 workarounds:
    1. As Possemo mentioned, using virtual MIDI ports and turning off host MIDI I/O. Sadly, this won’t work correctly if using Expert Sleepers’ MIDI outputs, which require the the MIDI data to be routed inside the DAW to be sample accurate.

    2. Custom plugin that removes duplicate consecutive MIDI messages after CTRLR output. Seems like a waste of resources to process everything, but it does work. I have one written in Reaper JSFX if anyone is interested. The doubling of messages always occurs consecutively as far as I can tell, but it might not work if using several different multi message output modulators.

    Any other workarounds possible with Lua scripting in CTRLR?

    #69528
    Possemo
    Possemo
    Participant
    • Topics: 13
    • Replies: 582
    • Total: 595
    • ★★★

    Hi Grimulkan,

    nice that finally someone bothers this too :-). It is true that many synths don’t care if they receive the same messages twice. But nevertheless I think it is Ctrlr’s most serious bug. Bandwith of MIDI is very limited, so it could provoke lots of weird things like e.g. timing probs.

    As mentioned before: when you send messages by Lua scripts it does not happen. Here a simple example:

    sendUselessMessage = function()
    panel:sendMidiMessageNow(CtrlrMidiMessage({0xF0, 0x10, 0x06, 0x0a, 0x01, 0xF7}))
    end

    So the bug seems to lie on the MIDI-send component of Ctrlr. In theory you could make a complete panel without using the MIDI component and instead doing it all by Lua scripts. But this is a lot of (useless) work.

    One day I will to get into the Ctrlr code and will try to localize this big fat bug…

    #69530
    Grimulkan
    Grimulkan
    Participant
    • Topics: 0
    • Replies: 2
    • Total: 2

    That makes sense, thanks for the code.

    I’m thinking that for the bug, the host output is getting MIDI from the input port along with the MIDI that would otherwise be forwarded to the output port. So effectively twice. But that is just a guess.

    #69553
    goodweather
    goodweather
    Participant
    • Topics: 40
    • Replies: 392
    • Total: 432
    • ★★

    Hi guys,
    I experienced the same on Ctrlr Standalone and on MidiMessageReceived.
    Searching on the forum I found the workaround that consists in resetting the Midi devices on panel load. The proposal was to reset the Controller devices.
    BUT this was then removing the bidirectional behaviour of my panel.

    The solution I found was to reset the Input devices at panel load and this is working fine:

    -- Reset Midi INPUT devices to avoid having MidiMessageReceived method called twice
    -- If resetting Controller devices then the bidirectional behaviour is loss (most probably a bug)
    sMidiDevices = panel:getProperty("panelMidiInputDevice")
    panel:setPropertyString("panelMidiInputDevice", "-- None")
    panel:setPropertyString("panelMidiInputDevice", sMidiDevices)

    So, maybe that you try resetting the Output devices instead to solve your send issue?

    #115558

    CleverMonkey
    Participant
    • Topics: 1
    • Replies: 2
    • Total: 3

    Hi, this is an old post so maybe this is old news (and I am a Ctrl noob) but I seem to have solved the problem, at least for my needs (Ctrlr as VST in Reaper) by checking the “No MIDI output from panel” option. Hope this is helpful 🙂

    #115562
    goodweather
    goodweather
    Participant
    • Topics: 40
    • Replies: 392
    • Total: 432
    • ★★

    Well, removing the Midi Output completely should prevent you to enjoy the benefits of bidirectional behavior, no?

    #115564

    CleverMonkey
    Participant
    • Topics: 1
    • Replies: 2
    • Total: 3

    One would assume so.. But seems to work fine here with that option checked in the panel properties. . Midi settings are “Input from host to comparitor” and “Output to plugin host”.

    #115568
    Possemo
    Possemo
    Participant
    • Topics: 13
    • Replies: 582
    • Total: 595
    • ★★★

    Hi CleverMonkey, this is a nice find – though there is still a problem.

    I first want to say that this discussion in solely related to the Reaper DAW. The other DAW’s I know (Ableton and Cubase) are not working anyway. On these DAW’s you have to dedicate the midi ports to Ctrlr. You have to disable the ports on the DAW – in the case of Cubase: it does not assign ports as long as you don’t use them on a track. This configuration is working fine – no doubly messages, just set the ports in Ctrlr as you would in standalone Ctrlr. Meanwhile I prefer this config to the one with “input/output to plugin host”. First, there is no doubly-message-bug and second you have no problems with midi feedbacks because you don’t have to set midi thru-options in Ctrlr. Only drawback: you cannot use the keyboard of the synth as a masterkeyboard for entering notes into the DAW – the input-port is dedicated to Ctrlr.

    The other prob with CleverMonkeys find: when you disable midi out with this checkbox it won’t send data twice via modulators – but it won’t send data at all via Lua scripts.

    #115592

    daimondamps
    Participant
    • Topics: 8
    • Replies: 80
    • Total: 88

    This is the only workaround for me:

    function resetMIDIdevice()
    	-- Trick to avoid doubled MIDI messages
    	local sMIDIDeviceName=panel:getProperty("panelMidiOutputDevice")
    	panel:setPropertyString("panelMidiOutputDevice","-- None")
    	panel:setPropertyString("panelMidiOutputDevice",sMIDIDeviceName)
    
    	local sMIDIDeviceName=panel:getProperty("panelMidiControllerDevice")
    	panel:setPropertyString("panelMidiControllerDevice","-- None")
    	panel:setPropertyString("panelMidiControllerDevice",sMIDIDeviceName)
    
    	local sMIDIDeviceName=panel:getProperty("panelMidiInputDevice")
    	panel:setPropertyString("panelMidiInputDevice","-- None")
    	panel:setPropertyString("panelMidiInputDevice",sMIDIDeviceName)
    		
    
    end
    #115595
    goodweather
    goodweather
    Participant
    • Topics: 40
    • Replies: 392
    • Total: 432
    • ★★

    Yep and this is what I have been using except that I only do it on the Input Devices and that it seems to be enough.
    Now, doing it on Output and Controller do not hurt either 😉

Viewing 16 posts - 1 through 16 (of 16 total)

You must be logged in to reply to this topic.

There is currently 0 users and 32 guests online
No users are currently active
Forum Statistics
Threads: 2,241, Posts: 15,791, Members: 55,954
Most users ever online was 12 on January 22, 2019 3:47 pm
Do NOT follow this link or you will be banned from the site!