This is an LMMS 1.2.0-rc2 issue mainly. When you open .mmp or .mmpz files from https://lmms.io/lsp/ and they contain AudioFileProcessor files, it mostly does not autodetect any of these files in your LMMS directory. This needs to be fixed as many songs will use <yourfilepath>/data/samples/drumsynth/ files, will nearly all of them will go missing through auto-detect and then viewing the error message with missing files that you have in your directory.
@JordanKyser can you link us one failed file, so we can use it as a unit test for fixing this bug?
https://lmms.io/lsp/?action=show&file=10633 This file is an example (all of the AFP files are in the factory directory, but LMMS does not detect them).
@JordanKyser thanks. It's very clear that this file was saved with absolute file paths. This likely occurred when the project author installed LMMS into a non-standard location. I would guess this was done to allow both versions of LMMS to work simultaneously however this is a configuration we do not yet support. Even when installed in separate locations, LMMS shares the same %userprofile%/.lmmsrc.xml file.
If the author of this song were to examine the %userprofile%/.lmmsrc.xml file, they will likely notice the LMMS HOME is set to some other location, so relative paths are not being honored.
We've drastically improved this in 1.2.x by making the relative paths calculated but this feature is incompatible with 1.1 branch, so the author of the project will have to fix this unfortunately.
Additionally, if you want to fix this yourself, you can save the file as an .mmp file extension and do a search/replace on D:/Program Files/Lmms 1.2.0/LMMS/data/ but the LSP file should still be corrected by the artist.
Do you have a second example of this by a different author?
Edit: On second thought... I'm still going to ping a developer about this problem since this user isn't actually leveraging LMMS_HOME. Perhaps is there's a bug we did not catch.
Since AFP uses .ds files mainly, any .ds file in the main directory that appears in a .mmp/.mmpz file, but 1.2.0.-rc2 causes the majority of .ds files to be detected as missing, corrupted, or misplaced. A developer should try to implement a code in some way that will detect any AFP files in any directory in the LMMS (or the filepath directory, if LMMS folder is either named something else and/or put under another directory other than the default directory) that may appear in a .mmp/.mmpz file. In addition to this, there should be an option to put additional directories for LMMS to search AFP files (in other words, more than one or the given directories in the settings).
An upgrade method should detect missing files and replace absolute paths.
An upgrade method should detect missing files and replace absolute paths.
That sounds nice a nice enhancement.
For the purposes of this bug, we should focus our primary efforts on the regression that caused this.
This appears to be a regression from #1719. When saving a project, the relative path is constructed in SampleBuffer::tryToMakeRelative by checking if the file's absolute path begins with the factory data path ConfigManager::inst()->factorySamplesDir().
The factory data path however is a search path since #1719 and equals to data:/samples/, which is why tryToMakeRelative fails with factory files.
It seems to be affecting LMMS_HOME files as well.
It is hard to find the actual initial point of the bug, but the fix (as I stated earlier) is to place an auto-detect system for AFP (this will take a bit longer depending on how many AFP files are present in a .mmp/,mmpz files).
@tresf Any hopes on fixing this issue?
@tresf Any hopes on fixing this issue?
Yes, this will be fixed before the 1.2.0 release. It should be relatively trivial to do expansion on data:/foo/
from within tryToMakeRelative however @Lukas-W was responsible for the code which caused the regression, so we'll give him an opportunity first.
I've made my first attempt to patch this in #3510. This should address problems specific to data:/samples/, which is for the factory samples. Testing appreciated.
@JordanKyser there's no need to put the LMMS version in the title since this bug has been properly labeled and milestoned.
I'll test out @tresf's PR ASAP :+1:
@Umcaruje FYI #3510 DOES NOT have an upgrade routine to relativize existing samples (e.g. in broken RC2 projects). Newly dragged samples should be fixed. Clicking "browse" and reselecting samples should fix existing.
Most helpful comment
@Umcaruje FYI #3510 DOES NOT have an upgrade routine to relativize existing samples (e.g. in broken RC2 projects). Newly dragged samples should be fixed. Clicking "browse" and reselecting samples should fix existing.