I have a synth out for sale and found a small bug that I really don't know how to solve properly:
When the instrument is up and running in a DAW, I send a NoteOn midi message (holding a note on the keyboard). Before sending the NoteOff (releasing the note on the keyboard), I bypass the plug-in. When the plug-in is bypassed I release the keyboard (sending NoteOff). When I enable the plug-in again the note obviously continues playing since the NoteOff wasn't parsed in processBlock() because the instrument was bypassed at the time.
My current (seem-to-be-working) approach is to have a check the current time in processBlock() and if there's a gap greater than some value based on blockSize and samplerate I turn off all playing notes. This method is a really ugly hack and will most certainly turn back at me at some point/in some DAW/in some special-case that I cannot think of right now.
So, to the question: Is there any other way do get a notification/read some flag whether the instrument is bypassed by host so I instead could check for actual changes instead of assuming stuff based on gaps in the audio stream.