Issue with re-loading plugin in Ableton 12

I’ve encountered an issue whose source I am not sure of. My plugin loads perfectly inside Ableton 12. However, if I save a project which contains a copy of my plugin and restart ableton, the ‘Show/Hide Plug-In Window’ (the one with a wrench icon) on the instance of my plugin in that project is unresponsive, making it effectively unusable.

Strangely, pressing the ‘Unfold Device Parameters’ to it’s left entirely removes the ‘Show/Hide Plug-In Window’ button, but newly loaded instances of the plugin within the same project have none of these issues. This problem might be limited to Ableton 12 (I have tested the plugin in a reloaded the Audio Plugin Host which works fine), but I haven’t tested it in other DAWs.

Has anyone run into this or similar problems? Or have any intuition as to what might be causing it?

Maybe it’s a problem with reloading the saved state, in which case the problem could be either in getStateInformation() (returning a bad state) or setStateInformation() (failing to load a valid state). If you’re saving and restoring editor state (e.g. viewport dimentions) then perhaps you’re accidentally creating an empty editor component or something like that.

The best approach to resolve these kinds of issues is to run the host under a debugger. After launching the DAW, use the “Attach debugger to process…” option in your IDE to attach the debugger, and then try loading the broken DAW project. From there, you should be able to place breakpoints and inspect the state of your plugin during and after the failure.

Ableton Live can be tricky to debug, depending on the OS, so I’d also recommend checking whether you can reproduce the same behaviour in REAPER. If you can, then the issue is likely to be easier to debug there.

If you can’t attach a debugger at all, try to narrow down where the problem might be coming from. If your plugin can still process audio and sounds the way you expect, then that would imply that the plugin is restoring its processing state correctly, and the problem is more likely to relate to displaying the editor. As a last resort, you can also try systematically disabling (commenting out) parts of your plugin to work out which part is causing the problem.

Appreciate the thorough response. I guess it’s unlikely to be either of the state functions as I have not yet implemented either - the plugin and my own programming skills are both in the early stages of development! The plugin is essentially a MIDI generator so doesn’t process any audio. However, it can output MIDI data normally when reloaded, so I’ll take a look at the editor as suggested. Perhaps the bug is related to the fact that I am not enabling the AudioProcessor in the PluginProcessor?

Anyway whatever is causing it, thankfully the same behaviour is indeed happening in Reaper too, so I’ll start by debugging there.

Edit: Fixed. It was something to do with updateTrackProperties(). Maybe it was interacting badly with the disabled AudioProcessor.