# Outgoing MIDI issues

**URL:** <https://forum.cabbageaudio.com/t/outgoing-midi-issues/1618>\
**Category:** Cabbage slugs\
**Created:** [29 October 2019 23:51 UTC](https://forum.cabbageaudio.com/t/outgoing-midi-issues/1618 "2019-10-29T23:51:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![severak](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/severak/32/1517_2.png) [@severak](https://forum.cabbageaudio.com/u/severak)\
**Post date:** [29 October 2019 23:51 UTC](https://forum.cabbageaudio.com/t/outgoing-midi-issues/1618/1 "2019-10-29T23:51:39Z")

</div>

I am developing my first ever VST plugin and I ran into two issues. One is probably my bug, second not.

My VST plugin is velocity fixer - [velofix.csd](https://forum.cabbageaudio.com/uploads/short-url/8KFrBDy35OZ6RgAn1AObKq4kRG9.csd) (1.4 KB) - it sets fixed velocity (set by slider) to incoming notes. This is useful if you have cheapest keyboard as I have.

I noticed two bugs:

- it does not work if it’s exported as VST3 (VST2 is okay) - outgoing velocity is not fixed
- if you press more keys at once, only one is released

Aside from that, Cabbage looks very powerful.

---

<div class="post-metadata">

**Author:** ![vallste](https://forum.cabbageaudio.com/letter_avatar_proxy/v4/letter/v/bc8723/32.png) [@vallste](https://forum.cabbageaudio.com/u/vallste)\
**Post date:** [30 October 2019 09:26 UTC](https://forum.cabbageaudio.com/t/outgoing-midi-issues/1618/2 "2019-10-30T09:26:28Z")

</div>

Maybe midiin in a loop so you can read all the midi messages arriving in the same kcycle

```
instr 1
kvol chnget "vol"
kbyvol chnget "byvol"

loop:
    kstatus, kchan, kdata1, kdata2 midiin

    if changed(kstatus, kchan, kdata1, kdata2)==1 then
        if kstatus==144 then
            printks "note %d %d\n", 0.5, kdata1, kvol
            midiout kstatus, kchan, kdata1, kvol
        elseif kstatus==176 && kdata1=7 then
            if kbyvol==1 then
                printks "volchange %d\n", 0.5, kdata2
                chnset kdata2, "vol"
            endif
        elseif kstatus>0 then
            printks "midi pass %d %d %d\n", 0.5, kstatus, kdata1, kdata2
            midiout kstatus, kchan, kdata1, kdata2
        endif
    endif

if kstatus!=0 kgoto loop

endin
```

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [30 October 2019 18:04 UTC](https://forum.cabbageaudio.com/t/outgoing-midi-issues/1618/3 "2019-10-30T18:04:19Z")

</div>

VST3 doesn’t handle midi very well. It’s well known. For example, check this JUCE thread.

> **[VST3 Midi In/Out problematic](https://forum.juce.com/t/vst3-midi-in-out-problematic/18166)**
>
> Hello. I’m working on a midi plugin, that swaps midi data with a new one, similar to the midi volume tutorial on the site. Works with VST2, but VST3 is dead. what to do? I read that VST3 handles midi data a bit differently. Is there a solution for...

And even more:

> **[Search results for 'Vst3 midi' - JUCE](https://forum.juce.com/search?q=Vst3%20midi)**
>
> The JUCE Forum

---

<div class="post-metadata">

**Author:** ![severak](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/severak/32/1517_2.png) [@severak](https://forum.cabbageaudio.com/u/severak)\
**Post date:** [31 October 2019 10:39 UTC](https://forum.cabbageaudio.com/t/outgoing-midi-issues/1618/4 "2019-10-31T10:39:18Z")

</div>

it seems that I opened whole can of worms. 🙂

Is there any way of using VST3-native note data/objects in Cabbage?

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [31 October 2019 14:34 UTC](https://forum.cabbageaudio.com/t/outgoing-midi-issues/1618/5 "2019-10-31T14:34:35Z")

</div>

> [@severak](#):
>
> Is there any way of using VST3-native note data/objects in Cabbage?

I’m afraid not, and I can’t see that changing any time soon. I think there is a better chance the people at JUCE will update their wrapper, and they will probably do it far better than I could 😉

Note that I’m still reading through those threads. Perhaps we’ll come across a suitable fix.

---

<div class="post-metadata">

**Author:** ![severak](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/severak/32/1517_2.png) [@severak](https://forum.cabbageaudio.com/u/severak)\
**Post date:** [31 October 2019 16:01 UTC](https://forum.cabbageaudio.com/t/outgoing-midi-issues/1618/6 "2019-10-31T16:01:01Z")

</div>

Okay. I will just keep using VST2 for MIDI altering plugins for now.

Thanks for help.
