# Midi and virtual intruments

**URL:** <https://forum.juce.com/t/midi-and-virtual-intruments/11933>\
**Category:** Audio Plugins\
**Created:** [November 26, 2013, 8:41am UTC](https://forum.juce.com/t/midi-and-virtual-intruments/11933 "2013-11-26T08:41:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![solar3d](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/solar3d/32/135_2.png) [@solar3d](https://forum.juce.com/u/solar3d)\
**Post date:** [November 26, 2013, 8:41am UTC](https://forum.juce.com/t/midi-and-virtual-intruments/11933/1 "2013-11-26T08:41:57Z")

</div>

Hi,

could somebody confirm and explain the following behavior?

I have my plugin compiled as instrument and then I noticed that Midi events, coming from the processblock, also seem to be bypassed to the plugin Midi output. I discovered that in Ableton 9 having my plugin inserted as instrument and another Midi track its input connected to the plugin its Midi output. My plugin provides Midi event filter that also works on the processblock Midi buffer and I set it up to filter out Note events. This work pretty well when the plugin is compiled as audio effect only while I still hear Note messages if the plugin is an instrument.

Does anybody have the same experiences?

Thanks,

Joerg

&nbsp;

---

<div class="post-metadata">

**Author:** ![kmolcard](https://avatars.discourse-cdn.com/v4/letter/k/ed8c4c/32.png) [@kmolcard](https://forum.juce.com/u/kmolcard)\
**Post date:** [November 26, 2013, 9:08am UTC](https://forum.juce.com/t/midi-and-virtual-intruments/11933/2 "2013-11-26T09:08:26Z")

</div>

Do you empty the midi input buffer before filling it with your data?

---

<div class="post-metadata">

**Author:** ![solar3d](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/solar3d/32/135_2.png) [@solar3d](https://forum.juce.com/u/solar3d)\
**Post date:** [November 26, 2013, 9:49am UTC](https://forum.juce.com/t/midi-and-virtual-intruments/11933/3 "2013-11-26T09:49:13Z")

</div>

No, but I have a filter class running that removes these particular Note messages from the host its midi buffer. So they shouldn't appear at the plugin midi output anymore. I have another method checking that the removal was successful.

---

<div class="post-metadata">

**Author:** ![lucem](https://avatars.discourse-cdn.com/v4/letter/l/97f17d/32.png) [@lucem](https://forum.juce.com/u/lucem)\
**Post date:** [November 27, 2013, 8:04pm UTC](https://forum.juce.com/t/midi-and-virtual-intruments/11933/4 "2013-11-27T20:04:35Z")

</div>

Are you sure you are working on the MidiBuffer instance passed in and removing the Messages from that, and not with a copy?

---

<div class="post-metadata">

**Author:** ![solar3d](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/solar3d/32/135_2.png) [@solar3d](https://forum.juce.com/u/solar3d)\
**Post date:** [November 28, 2013, 12:07pm UTC](https://forum.juce.com/t/midi-and-virtual-intruments/11933/5 "2013-11-28T12:07:08Z")

</div>

I am for 100% sure that I am working on the reference passed in. This problem does NOT exist if I compile the plugin as

effect instead of instrument. If my code is wrong then I should see the same behavior then, right? It also does NOT exist

using Reaper as host or Cubase.
