View Issue Details

IDProjectCategoryView StatusLast Update
0001546OpenMPTUser Interfacepublic2024-11-23 21:30
ReporterLachesis Assigned ToSaga Musix  
PrioritylowSeveritytweakReproducibilityalways
Status assignedResolutionopen 
Platformx64OSWindowsOS Version10
Product VersionOpenMPT 1.30.01.00 / libopenmpt 0.6.0 (upgrade first) 
Summary0001546: Minor raw sample export/import issues.
Description

Putting several minor issues/complaints regarding raw samples here because they aren't really worth their own individual reports.

  • Sample export consistently forgets the selected file format was raw, every single time. Export a sample as raw and then open the sample export dialog again. FLAC will now be selected. This seems to be a clamping bug as S3I export is also affected. If it is intentional, it's still bad, because 99.9% of the time I use raw export I am exporting samples for software that does not support WAV or FLAC.
  • OpenMPT coerces the ".raw" extension when exporting raw, which adds an annoying extra step of manually removing that extension when generating samples for software that uses ".sam" or no extension. Example: old RISC OS versions have a 10 character filename limit and no concept of filename extensions. It would be nice to have some way for it to use whatever extension (or lack thereof) was entered, but I don't have any good suggestions for how.
  • Raw import by default similarly does not recognize ".sam" or raw samples without extensions (ST-01 et al...). This one isn't that bad because it does temporarily remember when "All Files" was selected.

My use case for raw samples is mainly testing very old junk so this issue is about as low priority as it gets...

TagsNo tags attached.
Has the bug occurred in previous versions?Yes
Tested code revision (in case you know it)

Activities

Saga Musix

Saga Musix

2022-01-09 14:59

administrator   ~0004982

I think I should explain one thing upfront which might clear up some of the confusion: OpenMPT tries to be smart (maybe too smart?) about which sample format it offers by default in the dialog, which is not always the one chosen in the configuration dialog: After loading a file, OpenMPT will deduce the format to use from its filename, but only (until now) if it ends in .wav or .flac (as of r16474 it also takes S3I into account). I'd be hesistant to add .raw to that logic because I think that most people, after loading a raw sample, wouldn't want to keep the sample in raw format, but rather convert it to WAV and FLAC, so that they can keep the middle-C frequency, loop points, etc... I totally get your use case but I think that defaulting to RAW format in this case would be dangerous (many people don't even realize how they could change the format from the dropdown in the Save As dialog...). Note that this logic no longer applies if a sample has been saved once, as then OpenMPT knows its new filename.

r16474 does two more things: It adds .sam to the list of raw sample extensions, and adds S3I to the list of default formats in the config dialog.

OpenMPT coerces the ".raw" extension when exporting raw

This is essentially a bit of a workaround for some of Windows' own smartness when it comes to deducing the correct filename. IIRC when you manually enter a filename but leave out the file extension, Windows will not always add the correct file extension when hitting the Save button, if the filename looks like something that already has a valid file extension. This again can cause a lot of confusion because now your sample that you just saved doesn't show up in the sample browser because it uses a bogus file extension.

I'm open to suggestions how this could be improved but I wouldn't want to hurt the default behaviour for users without this specific usecase.

Lachesis

Lachesis

2022-01-26 03:19

reporter   ~0005014

OpenMPT tries to be smart (maybe too smart?) about which sample format it offers by default in the dialog [...]

OK, that makes sense. I didn't try explicitly adding any of the raw extensions to the filename or sample name before, but they also all default to FLAC as you mentioned. I don't have any ideas here aside from maybe a config option to opt-in to keeping the raw format for raw or unrecognized extensions.

Side note: ".wav" selects FLAC, but "a.wav" selects WAV. Off-by-one?

This is essentially a bit of a workaround for some of Windows' own smartness when it comes to deducing the correct filename. IIRC when you manually enter a filename but leave out the file extension, Windows will not always add the correct file extension when hitting the Save button, if the filename looks like something that already has a valid file extension. This again can cause a lot of confusion because now your sample that you just saved doesn't show up in the sample browser because it uses a bogus file extension.

I'm open to suggestions how this could be improved but I wouldn't want to hurt the default behaviour for users without this specific usecase.

I agree that nothing here is worth changing if doing so would affect general users (worst case I'll just cope and occasionally whine about it). A couple of thoughts that aren't necessarily mutually exclusive:

  • Would whitelisting the other raw extensions for raw export be viable? Exporting ".snd", ".pcm" also appends ".raw", even though they're in the raw extension list. This doesn't do anything about filenames like "DigiHarp" or whatever.
  • A second raw export option instead that just uses whatever filename the user provides, "Other uncompressed audio"? This might be perceived as unnecessary clutter.
Saga Musix

Saga Musix

2022-01-26 21:36

administrator   ~0005016

Side note: ".wav" selects FLAC, but "a.wav" selects WAV. Off-by-one?

File name tokenization (a reimplementation of splitpath) treats ".wav" as the filename and not the extension in that case, that's why.

Would whitelisting the other raw extensions for raw export be viable?

I'll look into that, seems like the most sensible option for me.

Lachesis

Lachesis

2022-01-27 02:28

reporter   ~0005018

maybe a config option to opt-in to keeping the raw format for raw or unrecognized extensions.

I'm dumb, this already exists. Still used to the general lack of options MPT 1.16 had...

Saga Musix

Saga Musix

2022-01-27 20:41

administrator   ~0005021

You know, I think I have an idea. As we already have a way to force loading samples as raw, maybe adding another option to force saving samples as raw might do it - at least for individual samples (or would it be useful for you to have "Save All as Raw" as well?). So just like there's a dropdown menu item to load raw samples, I'd add one to the save icon. That would solve the whole extension mess. What do you think?

Saga Musix

Saga Musix

2023-04-04 20:51

administrator   ~0005648

I've been thinking about this again in another context, and think that the last option I mentioned could be very useful for another reasons as well - instead of overloading the existing save dialog will all sorts of RAW options, a dedicated "Save as raw" file dialog could offer options to save as signed/unsigned/delta samples.

Lachesis

Lachesis

2024-11-23 21:30

reporter   ~0006213

Sorry, I didn't realize this was still open with a pending question—yes, adding a "Save as RAW" option to the save dropdown would probably sufficiently fix this issue for me.

Issue History

Date Modified Username Field Change
2022-01-09 04:58 Lachesis New Issue
2022-01-09 14:24 Saga Musix Assigned To => Saga Musix
2022-01-09 14:24 Saga Musix Status new => assigned
2022-01-09 14:59 Saga Musix Note Added: 0004982
2022-01-26 03:19 Lachesis Note Added: 0005014
2022-01-26 21:36 Saga Musix Note Added: 0005016
2022-01-27 02:28 Lachesis Note Added: 0005018
2022-01-27 20:41 Saga Musix Note Added: 0005021
2023-04-04 20:51 Saga Musix Note Added: 0005648
2024-11-23 21:30 Lachesis Note Added: 0006213