# No elements of MidiBuffer in Cakewalk

**URL:** <https://forum.juce.com/t/no-elements-of-midibuffer-in-cakewalk/54827>\
**Category:** Getting Started\
**Created:** [February 1, 2023, 1:22pm UTC](https://forum.juce.com/t/no-elements-of-midibuffer-in-cakewalk/54827 "2023-02-01T13:22:41Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![sapka12](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/sapka12/32/14958_2.png) [@sapka12](https://forum.juce.com/u/sapka12)\
**Post date:** [February 1, 2023, 1:22pm UTC](https://forum.juce.com/t/no-elements-of-midibuffer-in-cakewalk/54827/1 "2023-02-01T13:22:41Z")

</div>

I have a simple project that displays midi notes on the GUI (this is my first plugin and the first time with C++).

It works fine in Reaper (win11) but cannot read any midi note from `MidiBuffer` in Cakewalk by Bandlab (which is the DAW where my plugin is supposed to work).  
Shall I tweak something in the code? or in Cakewalk?

here is my code: [MidiDiff/Source · main · Arnold Farkas / MidiDiff · GitLab](https://gitlab.com/sapka12/mididiff/-/tree/main/MidiDiff/Source)

---

<div class="post-metadata">

**Author:** ![reuk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/reuk/32/21494_2.png) [@reuk](https://forum.juce.com/u/reuk)\
**Post date:** [February 1, 2023, 2:40pm UTC](https://forum.juce.com/t/no-elements-of-midibuffer-in-cakewalk/54827/2 "2023-02-01T14:40:40Z")

</div>

Have you tested any of the example plugins that use a MIDI input, e.g. the MIDILogger or AudioPluginDemo projects? If those work, you could look for differences between your Projucer project and the Projucer projects of the working plugins.

---

<div class="post-metadata">

**Author:** ![sapka12](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/sapka12/32/14958_2.png) [@sapka12](https://forum.juce.com/u/sapka12)\
**Post date:** [February 1, 2023, 6:59pm UTC](https://forum.juce.com/t/no-elements-of-midibuffer-in-cakewalk/54827/3 "2023-02-01T18:59:24Z")

</div>

sounds straightforward, I’ll have a look, thanks

---

<div class="post-metadata">

**Author:** ![sapka12](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/sapka12/32/14958_2.png) [@sapka12](https://forum.juce.com/u/sapka12)\
**Post date:** [February 1, 2023, 7:26pm UTC](https://forum.juce.com/t/no-elements-of-midibuffer-in-cakewalk/54827/4 "2023-02-01T19:26:34Z")

</div>

@reuk

I tried the example MIDILogger in Cakewalk and I got the following error:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/juce/original/2X/e/e10f749710dc4924a08e8d05f699c5ad9945d6ef.png)

by selecting the “MIDI Effect Plugin” I could do the same in my project, but without this check, the plugin at least started 🙂

so I’m digging more…

---

<div class="post-metadata">

**Author:** ![sapka12](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/sapka12/32/14958_2.png) [@sapka12](https://forum.juce.com/u/sapka12)\
**Post date:** [February 5, 2023, 8:10pm UTC](https://forum.juce.com/t/no-elements-of-midibuffer-in-cakewalk/54827/5 "2023-02-05T20:10:23Z")

</div>

I have had no luck yet.

Has anybody ever used Juce’s Midi in a Cakewalk?  
Could you please tell me what example project worked for you?

---

<div class="post-metadata">

**Author:** ![Qfactor](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/qfactor/32/14921_2.png) [@Qfactor](https://forum.juce.com/u/Qfactor)\
**Post date:** [February 5, 2023, 11:24pm UTC](https://forum.juce.com/t/no-elements-of-midibuffer-in-cakewalk/54827/6 "2023-02-05T23:24:22Z")

</div>

Are you loading your plugin as a VST3? Have you tried configuring it as a Synth in Projucer?

---

<div class="post-metadata">

**Author:** ![reuk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/reuk/32/21494_2.png) [@reuk](https://forum.juce.com/u/reuk)\
**Post date:** [February 6, 2023, 12:06pm UTC](https://forum.juce.com/t/no-elements-of-midibuffer-in-cakewalk/54827/7 "2023-02-06T12:06:45Z")

</div>

It looks like Cakewalk requires plug-ins to have at least one audio bus. I’ll update the demo to allow the MIDILogger to load.

Once the MIDILogger is loaded, I could get it to display incoming MIDI messages by taking the following steps:

- Create an Audio track. Add an instance of MIDILogger as an FX insert on that track.
- Open the MIDILogger’s editor window. In the “VST3” dropdown menu at the top of the editor window, click “Enable MIDI Input”.
- Create a new MIDI track.
- Set the MIDI track’s output (dropdown menu with an ‘o’ symbol) to the MIDILogger.

Now, MIDI events on the MIDI track should be printed in the MIDILogger’s editor window.

---

<div class="post-metadata">

**Author:** ![sapka12](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/sapka12/32/14958_2.png) [@sapka12](https://forum.juce.com/u/sapka12)\
**Post date:** [February 6, 2023, 3:22pm UTC](https://forum.juce.com/t/no-elements-of-midibuffer-in-cakewalk/54827/8 "2023-02-06T15:22:14Z")

</div>

thanks, how/when can I get the updated MIDILogger demo?

---

<div class="post-metadata">

**Author:** ![reuk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/reuk/32/21494_2.png) [@reuk](https://forum.juce.com/u/reuk)\
**Post date:** [February 6, 2023, 4:36pm UTC](https://forum.juce.com/t/no-elements-of-midibuffer-in-cakewalk/54827/9 "2023-02-06T16:36:56Z")

</div>

We’ll probably push it in the next few days.

In the meantime, you can try out the same change by modifying `getBusesLayout` on line 338 to

```auto
    static BusesProperties getBusesLayout()
    {
        // Live and Cakewalk don't like to load midi-only plugins, so we add an audio output there.
        const PluginHostType host;
        return host.isAbletonLive() || host.isSonar()
             ? BusesProperties().withOutput ("out", AudioChannelSet::stereo())
             : BusesProperties();
    }

```

---

<div class="post-metadata">

**Author:** ![reuk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/reuk/32/21494_2.png) [@reuk](https://forum.juce.com/u/reuk)\
**Post date:** [February 10, 2023, 4:35pm UTC](https://forum.juce.com/t/no-elements-of-midibuffer-in-cakewalk/54827/10 "2023-02-10T16:35:57Z")

</div>

That change is on develop now:

> <https://github.com/juce-framework/JUCE/commit/321cab0c15f5c398fff2d805c261611918c34291>

---

<div class="post-metadata">

**Author:** ![sapka12](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/sapka12/32/14958_2.png) [@sapka12](https://forum.juce.com/u/sapka12)\
**Post date:** [February 20, 2023, 7:58pm UTC](https://forum.juce.com/t/no-elements-of-midibuffer-in-cakewalk/54827/11 "2023-02-20T19:58:56Z")

</div>

I just had time to try out the modified MidiLogger and it’s working for me in Cakewalk as you described. thanks

trying out my own project. I’ll let you know the result

---

<div class="post-metadata">

**Author:** ![sapka12](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/sapka12/32/14958_2.png) [@sapka12](https://forum.juce.com/u/sapka12)\
**Post date:** [February 28, 2023, 9:47pm UTC](https://forum.juce.com/t/no-elements-of-midibuffer-in-cakewalk/54827/12 "2023-02-28T21:47:06Z")

</div>

thanks for the help @reuk. Based on the demo and your change I could implement my plugin and use it in Cakewalk too.

---

<div class="post-metadata">

**Author:** ![johnspeth](https://avatars.discourse-cdn.com/v4/letter/j/6de8d8/32.png) [@johnspeth](https://forum.juce.com/u/johnspeth)\
**Post date:** [November 25, 2023, 3:42pm UTC](https://forum.juce.com/t/no-elements-of-midibuffer-in-cakewalk/54827/13 "2023-11-25T15:42:45Z")

</div>

The advice in this thread is known to work and I’ve benefitted from it. One additional Cakewalk by Bandlab configuration detail that needs to be set when a Juce MIDI plugin is installed is enabling MIDI inputs and outputs on the host side. It can be done manually but:

Can anyone advise how to enable MIDI inputs and outputs from within the Juce MIDI plugin automatically when the plugin is initialized?
