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…
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());
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?
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.
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.
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.
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?