Zynaddsubfx preview remembers previous arpeggio
- Preview a preset with arpeggio for any other instrument (e.g. TripleOscillator, ArpeggioPing.xpf)
- Preview a ZynAddSubFX preset and it will arpeggiate like the preset in step 1.
This happens at least on stable-1.1. Couldn't try master ATM (crashes on this system for some reason).
Reproduced, thanks. I would expect the data model isn't clearing out a value.
@softrabbit so I've been crawling through the code and I can't find an obvious change or cause... I think this one has been around for a while though...
This is just a hunch, but is there a chance we're re-using the noteplayhandle on presets that play for longer than 3 seconds per:
https://github.com/LMMS/lmms/blob/stable-1.1/src/gui/FileBrowser.cpp#L520
Sorry, I didn't link the line number: https://github.com/LMMS/lmms/blob/stable-1.1/src/gui/FileBrowser.cpp#L520
Scratch that... the one you linked is less than 3 seconds and the playback bug only affects Zyn, I'm looking in the wrong place... Still investigating.
So the major difference I see is that Zyn is loaded as a plugin, so the presets are loaded slightly differently:
https://github.com/LMMS/lmms/blob/stable-1.1/src/core/PresetPreviewPlayHandle.cpp#L131
I've tried to trace the xpf loading process but got stuck in some of the casting that occurs. I would expect this is a problem with the Instrument being reused for plugins without first checking to see if it is the same type, but that is another wild guess...
Reproduced on 0.4.15. This is an old one... :+1: Bumping out the milestone since we've lived with it for years. :)
Been investigating this one a little. It appears that xpf presets alter the InstrumentTrack that the PreviewTrackContainer keeps to play previews, while xiz presets leave it as-is. This means that much more is remembered than just the arpeggio. Effects, for example, stay as well, and stacking keys. Try previewing TripleOscillator/Erazzor.xpf and then a zasfx preset for fun :smile:.
The solution would probably be to somehow reset the InstrumentTrack whenever a new load_by_plugin instrument is loaded (which would be here). Maybe add a clear() method to InstrumentTrack or just instantiate a new object.
This means that much more is remembered than just the arpeggio.
Confirmed with note stacking, volume and pan...
Try previewing TripleOscillator/Erazzor.xpf and then a zasfx preset for fun :smile:.
:+1:
I can reproduce this for drag&drop. The steps are:
- Drop a Zyn preset on the song editor.
- Drop another preset(ex.
TripleOscillator/Arpeggio.xpf). - Drop the preset in step 1 into the track created in step 2.
- Compare settings of two tracks.
Since Plugin::loadFile() is used for Zyn presets(.xiz files), track-specific settings aren't reset automatically. In most of other cases, however, InstrumentTrack::loadTrackSpecificSettings() is used.
What's the solution here ?
What's the solution here ?
@luzpaz please try to avoid bumping issues unless you have relevant information to add. The purpose of a bug report is to hopefully find a solution to the bug, so this kind of comment is rather redundant.