Standalone Application MIDI I/O Not Working

What’s the correct way to reset my MidiMessageCollector in a MIDI effect plugin running standalone? I am getting an assertion here as soon as I play a note:

void MidiMessageCollector::addMessageToQueue (const MidiMessage& message)

{
#if JUCE_DEBUG
jassert (hasCalledReset); // you need to call reset() to set the correct sample rate before using this object
#endif

My effect does work as a plugin under the JUCE test host.

Calling its reset method within prepareToPlay: JUCE: MidiMessageCollector Class Reference

Btw: most of the JUCE assertions will tell you what’s wrong and what you have to do in order do avoid them :wink:

Thanks, it works great now. The assertions answered the rest of my questions :joy:

Hi, I came across this same issue, and I understand that I need to call “reset()” on the midi message collector object, but how do I access that object within the prepareToPlay function of the plugin??

Thanks!

@danielrudrich @ohthepain

Just to note that this error is easily reproducible by simply opening the “Arpeggiator” plugin example using JUCE and compiling/running its standalone target. Once MIDI devices are configured, as soon as a key is pressed in the midi keyboard, the error arises.

Hi again, anyone knows about that? I Tried with latest 6.0.8 version and I hit the same error with the example Arpeggiator plugin. Maybe someone at JUCE? @ed95

Thanks!

Thanks for reporting. We’ve just pushed some changes to the develop branch so that the standalone format and AudioProcessorPlayer now support MIDI effect plug-ins with no input/output channels:

Thanks for that, example seems to work fine now!

Hi, I tried to update projucer but I still receive same error.
Someone could show the solution in source code?

Just checking – are you on the develop branch? The fix @ed95 added is not on the main branch at the moment (and also not in the Projucer if you downloaded it from the web)