randomize the sort order of the files found?

Have a suggestion for "Everything"? Please post it here.
Post Reply
frew
Posts: 45
Joined: Tue Apr 28, 2015 2:16 am

randomize the sort order of the files found?

Post by frew »

Hello,

Is it possible to randomize the sort order of the files found?

Sometimes it would be fun, for example, to browse the mp3s I find on my hard drive
through a randomized listing of files.

Thank you,

frew
frew
Posts: 45
Joined: Tue Apr 28, 2015 2:16 am

Re: randomize the sort order of the files found?

Post by frew »

Hello,

Just wondering if there may be a way that I don't know of yet,

to sort the results randomly.

There's many fun uses for random sort.

For example, to browse a music collection in a way that surprises me each time.

Any way to get all my mp3s that show up in Everything searches to be sorted randomly?

Thanks for any ideas.

frew
Stamimail
Posts: 1121
Joined: Sat Aug 31, 2013 9:05 pm

Re: randomize the sort order of the files found?

Post by Stamimail »

Maybe the solution would be by Run Count.
You can set the Run Count manually by Context Menu.
I don't know if or how you can set to a random nunber with scripting.
void
Developer
Posts: 15096
Joined: Fri Oct 16, 2009 11:31 pm

Re: randomize the sort order of the files found?

Post by void »

Setting the run count for every file and folder is not very efficient.

Because the result list is a live list of the database, sorting randomly is not an easy task.
I need to create an randomized "index of the index" and maintain it in real-time.

It is on my TODO list.
frew
Posts: 45
Joined: Tue Apr 28, 2015 2:16 am

Re: randomize the sort order of the files found?

Post by frew »

Stamimail wrote:Maybe the solution would be by Run Count.
Thanks for the idea, but I was hoping for perhaps
a hot key combination to just randomly sort the search results.

This can be fun for browsing music files sorted randomly.
void wrote:Because the result list is a live list of the database, sorting randomly is not an easy task.
I need to create an randomized "index of the index" and maintain it in real-time.

It is on my TODO list.
Good to know.
And thanks for considering this option.
I'll bet many would enjoy it too.

Thanks again,

Seeya,

frew
Stamimail
Posts: 1121
Joined: Sat Aug 31, 2013 9:05 pm

Re: randomize the sort order of the files found?

Post by Stamimail »

I understand you would prefer not to use the Random option of your MP3 Player.
Why is it?
frew
Posts: 45
Joined: Tue Apr 28, 2015 2:16 am

Re: randomize the sort order of the files found?

Post by frew »

Sorry, bringing up old topic, but figured I'd ask on this one instead of starting new topic.

Just wondering if there's a way to do sort by random that I might not know of.

Not wanting to do shuffle in media player.

Rather wanting to browse hard drive, find list of files,
and then randomize their sort order, just to have that
option for a different kind of fun browsing of files.

Thanks for any ideas.

frew
Stamimail
Posts: 1121
Joined: Sat Aug 31, 2013 9:05 pm

Re: randomize the sort order of the files found?

Post by Stamimail »

I know that in the last version of Void Image Viewer
Navigate > Shuffle
command was added.
The problem is that Void Image Viewer supports only images...
But it is open source program that works with Everything.
Maybe one know how to make the needed tweaks.

EDIT:
  • added randomized everything search option
Randomized Everything Search is a very efficient way to randomly view any image on your computer:
  • In void Image Viewer, Press Ctrl + E
  • Type in a search, or leave the search empty to randomize all images on your computer.
  • Check Randomize.
  • Click OK.
There is no play list in randomized mode, so there is no going back to the previous image.
viewtopic.php?t=5623#p19586
https://github.com/voidtools/voidImageViewer/
therube
Posts: 4580
Joined: Thu Sep 03, 2009 6:48 pm

Re: randomize the sort order of the files found?

Post by therube »

a way to do sort by random
I asked for the opposite (in MPUI media player GUI).
RFE: Ability to sort playlist

As it is now, when you drag a (diverse) set of files [from Everything] into MPUI, they are added, shown, in file path+name order.

It would be nice, if in the play list, you had an option to do an alpha sort by name.
https://sourceforge.net/p/mpui-hcb/disc ... /be964126/


(Until he does that ;-)) my work-around is to write the wanted Everything results, sorted by name, to a .m3u file, with a separate (Everything) shortcut that opens that .m3u, loading in my media player. It's OK, but a bit awkward.
therube
Posts: 4580
Joined: Thu Sep 03, 2009 6:48 pm

Re: randomize the sort order of the files found?

Post by therube »

a way to do sort by random
Perhaps you could work something similar using the (UNIX) sort -R command.
https://sourceforge.net/p/gnuwin32/disc ... f070/#632f
(There is also a 'shuf' command, but I don't have that.)

Find your files in Everything
Export... (Ctrl+S) in .txt format
sort -R export.txt > randomsort.m3u

Then "run" randomsort.m3u.


(There is no Export... to .m3u, so using .txt, then simply renaming it to .m3u, generally works OK.)
therube
Posts: 4580
Joined: Thu Sep 03, 2009 6:48 pm

Re: randomize the sort order of the files found?

Post by therube »

There is the fsi: function, which might be able to show files in some quasi-random (though deterministic) order, alas there is no way to sort by fsi in Everything.
frew
Posts: 45
Joined: Tue Apr 28, 2015 2:16 am

Re: randomize the sort order of the files found?

Post by frew »

Hi,

(bringing this topic back up from a while ago)

I'm wondering if there's any other ideas on this.

I wish to find all mp3 on my hard drive, then have them be sorted randomly.

I do not have skills at scripts or open source etc.

I feel the need to have this random sort order ability for any filetypes that I search for,
without relying on media players to do the randomizing, shuffling, etc.

I'd just like to have the ability to have files sorted randomly so I can click on them
and be surprised by what happens to show up at the top of the list.

I think being presented with sound items in random order stimulates my creativity.

Thanks for any ideas.
NotNull
Posts: 5167
Joined: Wed May 24, 2017 9:22 pm

Re: randomize the sort order of the files found?

Post by NotNull »

frew wrote: [..] scripts [..]
Thanks for any ideas.
An idea:
  • Download ES.exe (it's in this zipfile) and put it somewhere on your disk (in the same folder as Everything.exe?)
  • Save this code as RandomMP3.ps1 somewhere on your disk

    RandomMP3.ps1

    Code: Select all

    #_________________________________________________________
    #
    #	SETTINGS
    #_________________________________________________________
    #
      $ES = "c:\Tools\Everything\es.exe"
      $MusicFolder = "c:\Media"
    
    
    #_________________________________________________________
    #
    #	ACTION!
    #_________________________________________________________
    #
    
    # Create a list of all MP3's in $MusicFolder
      Start-Process -FilePath "$ES" -ArgumentList "ext:mp3 -path `"$MusicFolder`" -export-m3u `"$env:TEMP\MP3list.txt`"" -Wait
    
    # Randomize this list and save it to M3U file
     gc "$env:TEMP\MP3list.txt" | Sort-Object {Get-Random} | Out-File "$env:TEMP\randomMP3.m3u" -Encoding utf8
    
    # Open his M3U file in the default program for M3U's (Windows Media Player?) 
      Start-Process "$env:TEMP\randomMP3.m3u"
    
  • Change the settings (path to ES.exe; folder where your music is) to match your situation
  • Doubleclick RandomMP3.ps1
  • ... and enjoy your randomized playlist


If you have never run a PowerShell script before, you will probably have to run this command from the PowerShell prompt first, to allow the running of PowerShell scripts:

Code: Select all

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

But ...
Personally I would go for a software music player that supports playing music files in random order. That's probably 75% of the playrs out there. foobar, MusicBee, MediaMonkey are the first that come to my mind. Keywords: random and shuffle.
frew
Posts: 45
Joined: Tue Apr 28, 2015 2:16 am

Re: randomize the sort order of the files found?

Post by frew »

NotNull wrote:...RandomMP3.ps1...
I am trying for a situation where I am not using a media player for anything except playback.

Also I do not want to have to use a script to do the randomizing.
(I just want to be able to click a button, or something like that.)

I'm hoping for a sort order that does the randomizing right in the search tool.

NotNull, thank you very much though, for the ideas to try.

I can do all kinds of shuffle the order of playback in various media players.

That's not what I want.

I want to search my hard drive for any filetype I choose at the moment,
for example, it may be *.mp3, or it may be *.mp4, or *.txt, etc.

Then when the search results show up, I wish to be able to go to the top of the
list and start clicking on the files and be surprised by various content.


The content I click on will surprise me because I never know what content
will show up at the top of the randomized sort order.

It's all about finding various ways to stimulate myself with random content.
That's part of my creative process.

For example, I wish I knew a way to search Youtube where I would be presented with
random video content, rather than going only to my usual search habits there.

So perhaps a random video may show up about a subatomic particle, or a clarinet trio,
or deep sea lifeforms, or an existentialist philosopher biography, or life in ancient
Mesopotamia, etc. Sort of like Wikipedia random article search:
https://en.wikipedia.org/wiki/Special:Random

I wish to be able to do random sort order with the content of my hard drive, for creative inspiration purposes.

Thanks for any other ideas.
NotNull
Posts: 5167
Joined: Wed May 24, 2017 9:22 pm

Re: randomize the sort order of the files found?

Post by NotNull »

frew wrote: For example, I wish I knew a way to search Youtube where I would be presented with
random video content, rather than going only to my usual search habits there.

So perhaps a random video may show up about a subatomic particle, or a clarinet trio,
or deep sea lifeforms, or an existentialist philosopher biography, or life in ancient
Mesopotamia, etc. Sort of like Wikipedia random article search:
https://en.wikipedia.org/wiki/Special:Random
Try https://ytroulette.com
frew
Posts: 45
Joined: Tue Apr 28, 2015 2:16 am

Re: randomize the sort order of the files found?

Post by frew »

NotNull wrote: Try https://ytroulette.com
Thanks, yeah that's a fun site.
Had never been there.

Still trying to think of ways to have Everything search results be accessible
to me in randomized sort order.

How to search my hard drive for all .wav, for example, and then sort them randomly.

Just seems like such a fun feature.
Sometimes in searching for something it's fun not only to find what one was looking for,
but also to find some other somewhat related things along the way that may be pleasant surprises too.
therube
Posts: 4580
Joined: Thu Sep 03, 2009 6:48 pm

Re: randomize the sort order of the files found?

Post by therube »

So it turns out my media player's "random" playlist function was not random "enough".
At some point, I was hearing repeats (at least what I thought was repeats).
(My car probably is the same, its' "Mix All" is not "mixed" enough, nor do I think it's getting "all" in its' mix.)

Perhaps you could work something similar using the (UNIX) sort -R command.
https://sourceforge.net/p/gnuwin32/disc ... f070/#632f
(There is also a 'shuf' command, but I don't have that.)
My sort doesn't have the -R switch.
And I (didn't) have the shuf command either.

But busybox-w32 does have shuf.

Code: Select all

busybox.exe  shuf  musiclist.txt  >  musiclist.m3u
That has given me a much more random list (which I then play sequentially) in my player.


(NotNull's code works too, but I'm not really familiar with PS [unless you mean something like; busybox ps] & find that more awkward.)
Post Reply