Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Search the Sound Browser #209

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

PLNech
Copy link

@PLNech PLNech commented Sep 1, 2024

I've got 37k samples accessible in my Tidalcycles setup, so the sound browser is a godsend

But I struggle to scan it even with the browser's tree view

So I built a search feature:

It filters to only dirs that have matches in their name or their samples' names:

Filters within folders too:

And when you play them once they get back to normal font weight, here you can see which tom in the rampleP3 folder I listened to since the last "tom" search:

I don't think we should merge it now though! 🚧 👷

  • When you listened to all search results in a dir it should get back to unbold imo, didn't manage to make it work yet
  • In my screenshots you see dirs with dir children, e.g. my poesie and rample folders - although a bug in my local links that should not be visible in clean dirt-samples folders, would be nice to filter also on "has no child of class tidal-sample
  • The code is quite slow on my 30k+ samples set, surely there are ways to make it more performant? I only started timing parts to see what's the bottleneck
  • Maybe some edge cases are not properly handled yet, I need to test it more
  • Overall I'm not confident in my JS, would love code review with honest comments

Let me know what you think 🫶

@ndr-brt ndr-brt self-requested a review September 2, 2024 06:51
Copy link
Collaborator

@ndr-brt ndr-brt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the idea is really good!

An improvement could be to apply the filter only on the directories, I mean, why would somebody filter also on file name? the best pattern for sample packs is to have a lot of folders with a meaningful name and every folder contains a limited amount of samples (in the Dirt-Samples pack the maximum is 53 samples for sn) that usually don't have a significant file name.

I know that this doesn't satisfy all the needs you have, but it will permit to have a simpler PR that could be merged sooner already providing an useful feature, an additional filter on files could be added later on)

@PLNech
Copy link
Author

PLNech commented Sep 4, 2024

Thanks @ndr-brt for the kind words! 😺

Good idea to offer search only in dirs as a first step. This makes sense for the default samples and dirt-specific sample packs!

I agree with the ideal sample structure you describe - but I still see a lot of value, when adding to a livecoding setup sample packs gleaned on the web or from friends, to be able to search in the sample file name itself.

Often packs will have quite bad structures (for livecoding), and the .wav filename is the main place with useful signal: see e.g. in the above screenshot searching for toms, those "Rample samples" (from Squarp) which are named rampleA0, rampleA1, etc - short of a heavy restructuring, it's great to be able to ln x rampleX them all in Dirt-Samples/ and then search them using their more descriptive filenames 🙃

Likewise a techno-making friend gave me 3 folders of movie sounds, they are all stored by movie, with an idea of the text in the file names, e.g.MOVIES/CatAndMouse/ComeUpHere.wav|GoodBoy.wav|GoodIdea.wav - once aliased as movie_catandmouse # n "<0 .. 22>", it makes sense imo to find them by the text of the sample and not only the movie title, especially when I want to add quotes from various movies around a common theme :)
Example of movie samples structure

Same for all fx samples, they often are called e.g. "explosion3_wav", "electric_noise2.wav", which I find better for discovery than going through all fx:42 sounds by ear 😛

Anyway, I'll refactor my code above to search on dirs first, and add a plugin setting toggle for searching in files too, disabled by default 😇

@telephon
Copy link

telephon commented Sep 4, 2024

Wouldn't it be more useful if you could query SuperDirt what samples it has actually loaded, and what synths are available? It would be relatively easy to do this.

@ndr-brt
Copy link
Collaborator

ndr-brt commented Sep 5, 2024

Wouldn't it be more useful if you could query SuperDirt what samples it has actually loaded, and what synths are available? It would be relatively easy to do this.

this would be the best approach, it would also solve the ancient-but-still-actual #122 . I guess this is something not doable correct? Do you want me to create the issue on the SuperDirt repo?

@ndr-brt
Copy link
Collaborator

ndr-brt commented Oct 1, 2024

@telephon is this issue related right?
musikinformatik/SuperDirt#199

@telephon
Copy link

telephon commented Oct 6, 2024

@ndr-brt yes, exactly – this would be the issue to discuss and then solve it in the most general way.

@telephon
Copy link

telephon commented Oct 6, 2024

Or, actually, these are two somewhat related issues:

  • a way to query the current sound library (#199)
  • a way to query the harddrive for sounds to load into the sound library

The current load_something_something methods inn DirtSoundLibrary give you the option of some degree of query and naming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants