ADLplug icon indicating copy to clipboard operation
ADLplug copied to clipboard

Problems when using ADLplug in OpenMPT

Open brickblock369 opened this issue 2 years ago • 4 comments

The biggest problem I have when using ADLplug with OpenMPT is that when saving and closing OpenMPT, the customized patches don't get saved along with the MPT file, while the customized patches do seem to be retained in other project files when saved (FL Studio in my end).

Second, when I start playing the song in OpenMPT, occasionally the FM patch parameters get reverted to the previous revision's FM parameters, I'm not entirely sure how the patch parameters get saved upon playing it in OpenMPT.

brickblock369 avatar Dec 13 '21 17:12 brickblock369

There might be a defect in the save & load mechanism. That depends whether the host uses a weird sequence to interact with the plugin (I've never tried OpenMPT before).

following a quick examination of source code, the following sequence might create a problem

  1. host does NOT initialize processor (prepareToPlay not called)
  2. host restores state data (OK)
  3. host requests current state data (FAIL when not initialized at step 1, returns empty)
  4. host restores state data again (FAIL, replacing last_state_information_ with empty from step 3)

So I would think step 3 needs fixing at this location; the state data should be filled from previous state info from step 2.

https://github.com/jpcima/ADLplug/blob/a17a34a6bf23675d7598fc064f16a0e831bb628a/sources/plugin_processor.cc#L804-L806

All this is just guessing, but we can give a quick try.

jpcima avatar Dec 15 '21 13:12 jpcima

https://ci.appveyor.com/project/jpcima/adlplug/builds/41901596

Retry one of these builds if you don't mind. Under one of the mingw 32 or 64-bit builds, artifacts tab.

jpcima avatar Dec 15 '21 14:12 jpcima

Ah, that version seems to fix it! Thanks!

brickblock369 avatar Dec 16 '21 18:12 brickblock369

Great, thanks for the feedback.

jpcima avatar Dec 16 '21 23:12 jpcima