LMMS / lmms

Cross-platform music production software
https://lmms.io
GNU General Public License v2.0
8.15k stars 1.01k forks source link

Oversampling changes pitch with .ds files #6314

Closed Monospace-V closed 7 months ago

Monospace-V commented 2 years ago

The last similar issue of pitch change with oversampling was for AFP files in general, and closed at the end of 2019. This one is specific to .ds files.

Bug Summary

Oversampling, on export, changes the output pitch of a ds (drumsynth) file note in an AFP instance.

Steps to reproduce

  1. Open the sidebar and navigate to My Samples
  2. Open the drumsynth folder, drag in any of the samples
  3. It creates an AudioFileProcessor instrument track. Open the Piano Roll of this track and place a note there
  4. Export a wav file on normal settings
  5. Export a wav file with settings set to a non-default oversampling.
  6. Listen and compare.

Expected behavior

Both sound more or less the same

Actual behavior

Their pitches are different

Affected LMMS versions

1.3 alpha. (1.2.0 is also affected, but in a different way, and I have reason to believe that specific odd bug was fixed.) 1.3 alpha makes it clear that the problem is a pitch difference.

image (Downloaded from the recent PR that uses automation track for MIDI program change events)

RiedleroD commented 2 years ago

I did some tests, which might provide a better picture. @Monospace-V check if it sounds similar to your problem; I kind of expected something else to happen. PS.: I had to wrap the flac files in an mp4 container so github lets me attach it. Technically that's not allowed, but everything I've tried it with can play them. (except for my browser, it seems)

https://user-images.githubusercontent.com/57227431/154688514-17f280c1-e572-4b41-a432-e8b2c43200bb.mp4

https://user-images.githubusercontent.com/57227431/154688523-b681f1b2-8c21-4c66-bc6b-a6d091bbb414.mp4

https://user-images.githubusercontent.com/57227431/154688528-8a9647d1-bf40-453e-b8ee-fc0a4813c37e.mp4

https://user-images.githubusercontent.com/57227431/154688537-7ba3de6c-1f98-4525-8f6b-cdd1acc47497.mp4

Monospace-V commented 2 years ago

Not quite what I'm facing. I don't understand what's happening, but your file is going under some odd sort of wavy pitchbend. I used the preset drumsynth>latin>guiro. Check this folder for output files.

RiedleroD commented 2 years ago

wth I can reproduce… but why? It's just a sample, and regular ones don't have this issue.

I'll investigate further

edit: no idea what could be causing this tbh.

softrabbit commented 2 years ago

Duplicate of #6087, I believe. There's a bunch of magic numbers in the drumsynth code and they should be adapted to fit the sampling rate. (or we could just undo PR #406 and have the code always run at 44100 and resample to whatever LMMS is running at)

zonkmachine commented 7 months ago

Issue confirmed, but it looks like it was fixed in https://github.com/LMMS/lmms/commit/ce722dd6b6cdfa5c7378161ce7d1fa98bfe5fec2 / https://github.com/LMMS/lmms/pull/6610

zonkmachine commented 7 months ago

^Closed as fixed. Please reopen this issue if you can still replicate it on master.