# "Create a basic Audio/MIDI plugin Part 2" Tutorial VST don't work

**URL:** <https://forum.juce.com/t/create-a-basic-audio-midi-plugin-part-2-tutorial-vst-dont-work/20470>\
**Category:** Audio Plugins\
**Created:** [January 2, 2017, 8:37pm UTC](https://forum.juce.com/t/create-a-basic-audio-midi-plugin-part-2-tutorial-vst-dont-work/20470 "2017-01-02T20:37:39Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![arstudio](https://avatars.discourse-cdn.com/v4/letter/a/bc8723/32.png) [@arstudio](https://forum.juce.com/u/arstudio)\
**Post date:** [January 2, 2017, 8:37pm UTC](https://forum.juce.com/t/create-a-basic-audio-midi-plugin-part-2-tutorial-vst-dont-work/20470/1 "2017-01-02T20:37:39Z")

</div>

Hi, I’m new to Juce and C++, and I’m following the tutorials on Juce Web Site.  
At the moment I’m trying the “Create a basic Audio/MIDI plugin Part 2” tutorial (on OS X) and the released vst don’t work… The Juce project settings are correct (I assume):  
build vst true  
plugin wants midi input true  
plugin produces midi output true  
All the rest apart the name are default.

The midi signal doesn’t arrive to the processBlock(), I think, because I’ve tried to change the text in the ::paint() with the noteOnVel value… and nothing happens…

Do someone have the same problem?

(OSX 10.11.6 and xCode 8.0)

Regards,

Francesco

---

<div class="post-metadata">

**Author:** ![t0m](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/t0m/32/16413_2.png) [@t0m](https://forum.juce.com/u/t0m)\
**Post date:** [January 3, 2017, 10:15am UTC](https://forum.juce.com/t/create-a-basic-audio-midi-plugin-part-2-tutorial-vst-dont-work/20470/2 "2017-01-03T10:15:02Z")

</div>

Well the first thing I would suggest is to compile JuceDemoPlugin in `examples/audio plugin demo` and make sure you can read midi information there.

A few more questions that might help us track down the problem:

- How are you updating your GUI?
- Which host are you using to test?

If you start your host using the debugger (in Xcode go to “Edit scheme” -\> “run” -\> “executable”) then you can use the `DBG` macro to print information to the Xcode console:

```
MidiBuffer::Iterator i (midiMessages);
MidiMessage message;
int time;
while (i.getNextEvent (message, time))
    DBG (message.getFloatVelocity());
```

---

<div class="post-metadata">

**Author:** ![arstudio](https://avatars.discourse-cdn.com/v4/letter/a/bc8723/32.png) [@arstudio](https://forum.juce.com/u/arstudio)\
**Post date:** [January 3, 2017, 10:57am UTC](https://forum.juce.com/t/create-a-basic-audio-midi-plugin-part-2-tutorial-vst-dont-work/20470/3 "2017-01-03T10:57:25Z")

</div>

So, I opened the example and it sounds well (apart for the fact that is a plugin and not a synth).  
But i noticed that the code is more different from the code of the tutorial…  
I can’t understand the question about updating GUI…and i use Cubase 8 Elements as host.  
I’ve tried also to replace the code in ::processBlock() with the code you gave me, and i receive in Xcode the error “No matching constructor for initialization of ‘MidiBuffer::Iterator’”…  
How can I use the macro?

---

<div class="post-metadata">

**Author:** ![t0m](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/t0m/32/16413_2.png) [@t0m](https://forum.juce.com/u/t0m)\
**Post date:** [January 3, 2017, 11:14am UTC](https://forum.juce.com/t/create-a-basic-audio-midi-plugin-part-2-tutorial-vst-dont-work/20470/4 "2017-01-03T11:14:09Z")

</div>

Sorry, my example had a misleading variable name. I’ve now edited my previous post changing `buffer` to `midiMessages` to make it more clear. The constructor of `MidiBuffer::Iterator` requires a `MidiBuffer`.

“I’ve tried to change the text in the ::paint() with the noteOnVel value…” - this is why I asked about updating the GUI. Your `AudioProcessor` receives midi information in the `processBlock` method, and this information needs to be communicated to your paint method in your `AudioProcessorEditor`. I was wondering how you had done this. If nothing happens then it may be the case that there’s something going wrong with how your editor is updated, rather than the midi messages, and it would help us track down the problem. The code I provided lets you print information to the console, so we eliminate the step of updating the GUI.

---

<div class="post-metadata">

**Author:** ![arstudio](https://avatars.discourse-cdn.com/v4/letter/a/bc8723/32.png) [@arstudio](https://forum.juce.com/u/arstudio)\
**Post date:** [January 3, 2017, 2:43pm UTC](https://forum.juce.com/t/create-a-basic-audio-midi-plugin-part-2-tutorial-vst-dont-work/20470/5 "2017-01-03T14:43:23Z")

</div>

Excuse me, I’m trying some coding…  
The output of Xcode is:

JUCE v4.3.0  
2017-01-03 15:41:32.668 Cubase LE AI Elements 8[5152:445683] plugin com.adobe.accmac.ACCFinderSync invalidated  
JUCE v4.3.0

---

<div class="post-metadata">

**Author:** ![t0m](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/t0m/32/16413_2.png) [@t0m](https://forum.juce.com/u/t0m)\
**Post date:** [January 3, 2017, 3:00pm UTC](https://forum.juce.com/t/create-a-basic-audio-midi-plugin-part-2-tutorial-vst-dont-work/20470/6 "2017-01-03T15:00:07Z")

</div>

Even if you provide some midi input? When midi input is received you should see some floating point numbers corresponding to the velocities.

Try the following:

- Create a brand new Audio Plug-in project
- Set the options you describe:
  - build vst true
  - plugin wants midi input true
  - plugin produces midi output true

- Add my code as the very first thing in processBlock
- Run a host in the Xcode debugger and load your plugin
- Send some midi to your plug-in

If I follow these instructions I can see that midi is reaching the plug-in.

---

<div class="post-metadata">

**Author:** ![arstudio](https://avatars.discourse-cdn.com/v4/letter/a/bc8723/32.png) [@arstudio](https://forum.juce.com/u/arstudio)\
**Post date:** [January 3, 2017, 3:36pm UTC](https://forum.juce.com/t/create-a-basic-audio-midi-plugin-part-2-tutorial-vst-dont-work/20470/7 "2017-01-03T15:36:05Z")

</div>

No, the midi don’t reach the plugin…  
I read only “JUCE v4.3.0”

---

<div class="post-metadata">

**Author:** ![t0m](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/t0m/32/16413_2.png) [@t0m](https://forum.juce.com/u/t0m)\
**Post date:** [January 3, 2017, 3:50pm UTC](https://forum.juce.com/t/create-a-basic-audio-midi-plugin-part-2-tutorial-vst-dont-work/20470/8 "2017-01-03T15:50:33Z")

</div>

Well I don’t know what to suggest now. The procedure I listed above should definitively work. Have you tried the same with JuceDemo?

Are you sure you’re correctly routing midi to your plug-in in your DAW?

---

<div class="post-metadata">

**Author:** ![arstudio](https://avatars.discourse-cdn.com/v4/letter/a/bc8723/32.png) [@arstudio](https://forum.juce.com/u/arstudio)\
**Post date:** [January 3, 2017, 7:28pm UTC](https://forum.juce.com/t/create-a-basic-audio-midi-plugin-part-2-tutorial-vst-dont-work/20470/9 "2017-01-03T19:28:53Z")

</div>

I’ll try, thanks,

Francesco

---

<div class="post-metadata">

**Author:** ![cachen](https://avatars.discourse-cdn.com/v4/letter/c/82dd89/32.png) [@cachen](https://forum.juce.com/u/cachen)\
**Post date:** [January 5, 2017, 8:35am UTC](https://forum.juce.com/t/create-a-basic-audio-midi-plugin-part-2-tutorial-vst-dont-work/20470/10 "2017-01-05T08:35:22Z")

</div>

Hi t0m,

I tried `DBG (message.getFloatVelocity());`, it shows some floating point numbers.

And when I tried `std::cout << "processBlock " << m.getChannel() << " " << m.getNoteNumber() << " " << noteOnVel << std::endl;`,  
it shows `processBlock 1 84 127` when I pressed the midi keyboard in Juce Plug-In Host, but with **no sound**.

Is it normal it didn’t come out any sounds? Even I turned it to max 127.

---

<div class="post-metadata">

**Author:** ![t0m](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/t0m/32/16413_2.png) [@t0m](https://forum.juce.com/u/t0m)\
**Post date:** [January 5, 2017, 9:08am UTC](https://forum.juce.com/t/create-a-basic-audio-midi-plugin-part-2-tutorial-vst-dont-work/20470/11 "2017-01-05T09:08:27Z")

</div>

For part 2 of the tutorial? Yes. It’s a _midi effect_ plug-in - it only modifies the midi. It’s up to you to route the new midi produced by the plug-in to an instrument in your DAW.

---

<div class="post-metadata">

**Author:** ![DKDiveDude](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/dkdivedude/32/7020_2.png) [@DKDiveDude](https://forum.juce.com/u/DKDiveDude)\
**Post date:** [September 3, 2019, 10:00pm UTC](https://forum.juce.com/t/create-a-basic-audio-midi-plugin-part-2-tutorial-vst-dont-work/20470/12 "2019-09-03T22:00:49Z")

</div>

I am having a problem with this example too, and I believe it important enough for me to understand fully before I continue, however there is no download zipfile on the tutorial page I see. How did you “open” the example, as I can not find it in my examples folder?
