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


#1

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


#2

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());

#3

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?


#4

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.


#5

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


#6

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.


#7

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


#8

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?


#9

I’ll try, thanks,

Francesco


#10

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.


#11

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.