musikinformatik / SuperDirt

Tidal Audio Engine
GNU General Public License v2.0
519 stars 75 forks source link

Sort sound library files by ascii code #214

Closed ndr-brt closed 2 years ago

ndr-brt commented 3 years ago

As discussed in #131

telephon commented 3 years ago

How do we handle breaking changes @yaxu ?

yaxu commented 3 years ago

@telephon In tidal I release a major version (according to https://pvp.haskell.org/ ) and put some details in a CHANGELOG file

However with the discussion around ordering from metadata files, maybe it isn't worth the breaking change here?

yaxu commented 3 years ago

I think this isn't a breaking change under linux btw. I think the difference between platforms is whether the extension is considered in the sorting.

telephon commented 3 years ago

How should we proceed here? I think it is good to have a consistent ordering.

On macOS there seems to be no difference, here is a test:


(
var k;
k = { |e| e[\bufferObject].path.basename };

~dirt.soundLibrary.bufferEvents.select { |x|
    x.order { |a, b| k.(a) < k.(b) } != (0..x.size-1)
};
)
telephon commented 2 years ago

Good! I had forgotten about your PR. Making it globally configurable seems like a bad idea in my version. Probably better as an argument to the function itself. Would you like to add this to yours?

loadSoundFileFolder { |folderPath, name, appendToExisting = false, sortFiles = true|

…
if(sortFiles) { files.sort };
…
ndr-brt commented 2 years ago

@telephon done! added the argument also to the outer loadSoundFileFolder