lmms icon indicating copy to clipboard operation
lmms copied to clipboard

Zynaddsubfx preview remembers previous arpeggio

Open softrabbit opened this issue 11 years ago • 11 comments

  1. Preview a preset with arpeggio for any other instrument (e.g. TripleOscillator, ArpeggioPing.xpf)
  2. 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).

softrabbit avatar Jan 16 '15 14:01 softrabbit

Reproduced, thanks. I would expect the data model isn't clearing out a value.

tresf avatar Jan 16 '15 15:01 tresf

@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

tresf avatar Jan 16 '15 16:01 tresf

Sorry, I didn't link the line number: https://github.com/LMMS/lmms/blob/stable-1.1/src/gui/FileBrowser.cpp#L520

tresf avatar Jan 16 '15 16:01 tresf

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.

tresf avatar Jan 16 '15 16:01 tresf

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...

tresf avatar Jan 16 '15 16:01 tresf

Reproduced on 0.4.15. This is an old one... :+1: Bumping out the milestone since we've lived with it for years. :)

tresf avatar Jan 16 '15 20:01 tresf

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.

Fastigium avatar Feb 17 '16 18:02 Fastigium

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:

zonkmachine avatar Sep 03 '16 21:09 zonkmachine

I can reproduce this for drag&drop. The steps are:

  1. Drop a Zyn preset on the song editor.
  2. Drop another preset(ex. TripleOscillator/Arpeggio.xpf).
  3. Drop the preset in step 1 into the track created in step 2.
  4. 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.

PhysSong avatar Oct 04 '17 07:10 PhysSong

What's the solution here ?

luzpaz avatar Aug 22 '23 13:08 luzpaz

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.

Spekular avatar Aug 22 '23 16:08 Spekular