tildearrow / furnace

a multi-system chiptune tracker compatible with DefleMask modules
GNU General Public License v2.0
2.65k stars 209 forks source link

inconsistencies in export vs. tracker playback w/ YM2151 LFO #1578

Open damifortune opened 1 year ago

damifortune commented 1 year ago

hello there,

i spent some time trying to troubleshoot why some channels in a song using (2x) YM2151 were rendering out of tune in both .wav and .vgm, but sounded just fine in the tracker. i'm on version 0.6, windows 11.

i ended up pinning it down on the LFO setting in the instrument; if i set a macro forcing PM Depth to be 0, the issue stopped, and the export became "accurate" again (i.e. matching with the tracker playback). however, this behavior strikes me as a little weird. i had the LFO freq set to max (7) and the amp set to 1, but what was happening was my patch just drifting eternally out of tune at a particular point, not wavering like a vibrato.

i was mainly using the LFO for the AM, which was turned on for ops 1 and 3, and i had macros modulating the AM Depth, algorithm and feedback. removing the macro on AM Depth also stops the issue in the exports, so i guess it is contributing to the problem.

let me know if you have questions. this is an oddly specific thing. i spent a while trying to root out the cause so i thought i'd report it. thanks for your work on this software.

tildearrow commented 1 year ago

Used cores for YM2151 (playback and rendering) in Settings > Emulation?

damifortune commented 1 year ago

playback core is "ymfm", render core is "nuked-opm". i didn't notice this setting for YM2151 before, or that there were separate options for playback and rendering - this explains why i was experiencing inconsistency between the two things.

i also confirmed that it renders fine under ymfm. the tuning issue happens if i set playback core to nuked-opm too, if and only if i backtrack playback far enough for the previous instrument to be playing in the affected channels. potentially notably, this previously playing instrument has its own LFO setting (no macros, just set to freq 2/amp 1), though it has been note OFF'd and unused for several patterns before the part that's detuning.

tildearrow commented 9 months ago

It appears this will be harder to diagnose than ever.

I do remember running over a very similar issue two years ago or so, where a specific song would cause the pitch of one channel to drift over time. Turns out it was due to LFO, but for some weird reason it only happened with ymfm and not with Nuked-OPM (the opposite of this issue!).

Do you think you can provide a project file which exhibits the issue?

Dragonsboystar commented 5 months ago

i ran into a very similar issue with the fds chip in the tracker it sounded fine but in the exported audio file after one specific instrument played it pitched itself up for the rest of the song after changing the render core from NSFplay to puNES (the same as the playback core) the problem went away so it seems to be an issue with NSFplay