Keep the dot when making file names safe#226
Merged
git-moss merged 1 commit intoJul 25, 2026
Merged
Conversation
A dot is a valid file name character (e.g. "My.Sample") and formats which use the zone name as a display label - like the Roland SP-404MK2 pad name - would otherwise lose it. Leading and trailing dots are still stripped.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
createSafeFilenamecurrently replaces a dot with an underscore, so a name likeMy.SamplebecomesMy_Sample. A dot is a valid file name character on every supported platform, and the surrounding code already handles the cases that actually matter: leading and trailing dots are stripped on the following two lines (the Windows issue), andcreateUniqueFilenameappends the extension throughwithoutExtensionTail, so an inner dot cannot collide with the extension logic.The characters that are genuinely problematic are untouched by this change -
\ / : * ? " < > |are still replaced, as are&and'.This also matters for formats which use the zone name as a display label rather than as a file name.
ConverterBackend.ensureSafeSampleFileNamessanitizes every zone name up front, so such a format cannot opt out: in the Roland SP-404MK2 (#225) the pad name is shown on the device while the audio is stored under a fixedBANK<b>-<p>.SMPname, and a pad called@1prod.mars Galacurrently arrives as@1prod_mars Gala.Split out of #225 so that it can be judged on its own, since it affects the output of every creator. #225 does not depend on it - without this change the SP-404MK2 simply shows underscores in those pad names, and nothing else differs.
Checked that dotted names still round-trip through a file-based format (SFZ -> Bitwig writes
Snare.Tight.multisampleand reads it back asSnare.Tight, with no double extension).