Folder scanning ?

For general discussion related FlowStone
User avatar
lalalandsynth
Posts: 600
Joined: Sat Oct 01, 2016 12:48 pm

Folder scanning ?

Post by lalalandsynth »

So I made a "thing" that when I load say a wavefile into a sampler (One shot) It scans the whole folder of wavefiles where the loaded file originates. Then I make knobs that select Next - Previous wave file in that folder.
It works but I am 100% sure that its a hackjob and very inefficient and way too many triggers .

"Works in the sense that it scans the folder , but always starts from the first file and is not aware if the first file loaded was number 5 for example"

Has anyone made one of these or are there maybe preexisting modules that solve this in an elegant way ?

I can upload my hackjob but its from the Alpha.


PS. Wish I had some Ruby skills, seems like that would make this particular task much easier.
MichaelBenjamin
Posts: 275
Joined: Tue Jul 13, 2010 1:32 pm

Re: Folder scanning ?

Post by MichaelBenjamin »

.
Last edited by MichaelBenjamin on Mon Sep 21, 2020 10:20 am, edited 1 time in total.
User avatar
lalalandsynth
Posts: 600
Joined: Sat Oct 01, 2016 12:48 pm

Re: Folder scanning ?

Post by lalalandsynth »

Well , its a hackjob in the sense that I am pretty sure it could be simpler, maybe not ?

I guess the problem is : 10 files in a folder , I load number 5 . As I load that , it will scan the folder .
If I now use the Next Previous it will start on file 1 and advance through the list rather then start from 5.
Apart from that , it works :)

And yeah , I was hoping that someone had dealt with this before and might have a solution that would be more elegant and most of all , be aware of the number for the first loaded file.

in fact I think something like this should be a prim .

my mess.
Mess.jpg
Mess.jpg (142.64 KiB) Viewed 17111 times
MichaelBenjamin
Posts: 275
Joined: Tue Jul 13, 2010 1:32 pm

Re: Folder scanning ?

Post by MichaelBenjamin »

.
Last edited by MichaelBenjamin on Mon Sep 21, 2020 10:20 am, edited 2 times in total.
User avatar
lalalandsynth
Posts: 600
Joined: Sat Oct 01, 2016 12:48 pm

Re: Folder scanning ?

Post by lalalandsynth »

Its a sampler where you can dragndrop files into it when using so the folder is always changing.
So you might start with dragging number 5 from the folder.
MichaelBenjamin
Posts: 275
Joined: Tue Jul 13, 2010 1:32 pm

Re: Folder scanning ?

Post by MichaelBenjamin »

.
Last edited by MichaelBenjamin on Mon Sep 21, 2020 10:20 am, edited 1 time in total.
User avatar
trogluddite
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Folder scanning ?

Post by trogluddite »

MichaelBenjamin wrote:or do you just want some fancy ruby oneliner from trog?;)

But you could call the "glob" method! Say it over and over a few times; "glob, glob, glob"- You see? It's worth it just for the name alone! :lol:
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
lalalandsynth
Posts: 600
Joined: Sat Oct 01, 2016 12:48 pm

Re: Folder scanning ?

Post by lalalandsynth »

My problem is that the list is loaded independent of the selected file , if that makes sense?
I load the file , extract the folder name , scan the folder but that list is not aware of what file was loaded.
I am fully prepared to learn that I am just doing it in a stupid way :P

I cannot know the index of the loaded file...not with my method anyway.
User avatar
lalalandsynth
Posts: 600
Joined: Sat Oct 01, 2016 12:48 pm

Re: Folder scanning ?

Post by lalalandsynth »

MichaelBenjamin wrote:
edit:
these prims should all that's needed besides some counterfiddling and proper trigger refresh


This is pretty much what I am using, although I am sure I could simplify .
User avatar
trogluddite
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Folder scanning ?

Post by trogluddite »

What's the reason for needing to know which file was dragged first? Do you need to cycle through them in a particular order or something?

EDIT: Ah sorry, I see now - I'd missed the bit where you mentioned it!
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
Post Reply