I have a question regarding handling of hanging note for audio plugins that send out MIDI events.
I have an internal module that sends out MIDI events based on some audio analysis calculations, and that module has these functions:
[code] /** Tells the module that Process will be called from now on. */
/** Processes one mono input sample and indicates whether events occurred or not. @param inAudioInput input sample @param outAudioOutput output sample @return true if events occurred while processing the current sample, false otherwise */ bool Process(const float inAudioInput,float* outAudioOutput); /** Tells the module that Process will not be called any more. All currently playing notes will be released and you can use GetEventMessages to retrieve the corresponding note off messages. @return True if events were generated. False otherwise. */ bool StopProcessing();[/code]
I am embedding this into a Juce audio processor, I was wondering if this the right way to do this:
// send out MIDI note on or off message
// send out MIDI note off messages
This is the approach I used in VST world (where sendVstEventsToHost is used to send out the MIDI messages).
since all MIDI message passing is done through the processBlock call in Juce, how will the note off messages that are only obtained when processing stops (so in releaseResources) get sent to the host? I need something like this to avoid hanging notes.