bsutherland/JuceOPLVSTi — pull request #17 by trylle (2014-08-25 21:52:00+00:00)
Title: Issue #15 workaround and miscellaneous improvements

I had the same problems as issue #15 with Cubase 7.5 64-bit, so I've attempted a fix that seems to work OK for me. While researching the issue, I came across http://www.kvraudio.com/forum/viewtopic.php?t=83930 and http://www.juce.com/forum/topic/problems-recalling-plugin-state-versus-current-preset, which seems to relate to the same problem. Am unsure if this is a bug in Steinberg's host implementation - haven't been able to find anything illuminating in the VST SDK. The problem is that Cubase invokes setCurrentProgram after setStateInformation, so the saved state is simply discarded when you load up a previously saved song. The same thing happened when loading a saved preset. My workaround requires adding information to the state, so I've added versioning to it to make it backwards compatible.

I've also fixed some of the assertions that got thrown by JUCE while I was debugging, and improved the channel reuse algorithm which, previously, had a bad habit of interrupting still audible notes. Also added some GUI that shows the active channel state.