Midi from IControl

I have inherited a IControl and set mWantsMidi = true.

This makes my control to receive midi messages as long as the GUI is open. But if I close the GUI I get no sound.

How should I do to get midi messages to a control if the GUI is closed?

I have used the IPlugInstrument example as base for my project and my control is created with the mLayoutFunc function.

In iPlug2, the UI gets destroyed/recreated when the user closes/opens the plug-in window, so the IControls do not exist when the window is closed. You can deal with your MIDI messages in ProcessMidiMessage()

Thank you very much!

I think I understand now. The sound is not meant to be played instant, and the call to ProcessMidiMsg() function gets midi messages that contains an offset that should go to the ProcessBlock() function. There seems to exist a smart way to pass these midi messages via the IMidiQueue.