Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Sort>Random (intelligently)? (Read 2950 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Sort>Random (intelligently)?

Hey all,

I quickly abandoned the play modes Random (can play the same song 100x in a row - it's random) and Shuffle (cached random sorted playlist) and have actually just created a playlist and sorted it randomly, and use normal play mode.

This means I can queue another track if I want to hear that sooner, I can use Playlist Attributes component to remove the played tracks and put them into another playlist.  I can also close foobar2000 or play songs from the media library at will, then return to the original playlist and it stays where I left off.  It all works nicely for me this way.

My question is when I add a bunch of tunes to a playlist and Edit>Sort>Randomise, it does just that (what it is supposed to do), but say I have my entire library in a playlist and want it to act as a radio station style, I do no want songs from the same artist let alone the same album cropping up too close to each other.

I fully understand that that is the nature of the term random - if you had two dice, and rolled them multiple times, you could get the same result.  If you removed the results that were the same, and only recorded each different result, they could be sequential, annoyingly. 

I suppose what I am looking for is some kind of arguments to firstly Randomise, then scan that list and re-randomise sections if the same %artist% or %album% come up too close to each other (as a percentage of the total list of songs, or as a definite value, I'm not that fussy).

I know this is possible in computing, but I don't know if it's possible in foobar2000's set of already quite extensive sorting commands.  It could require a long time to churn through all the data too - making the randomise sort function very slow.


Anyone got any idea's?

cheers

 

Sort>Random (intelligently)?

Reply #1
Or you could just use Shuffle for randomization and 'Add to playback queue' to overwrite the next song(s) temporarily when necessary.

You might want to take a look at foo_random_pools as well.

Sort>Random (intelligently)?

Reply #2
Or you could just use Shuffle for randomization and 'Add to playback queue' to overwrite the next song(s) temporarily when necessary.

You might want to take a look at foo_random_pools as well.


Thanks for the reply and suggestion.


So far I just have a quick gander at the list and shift the artists tracks that are too close to each other.  That's easy but requires a bit of user intervention / effort.

I have had a look at random pools and it looks a bit over complicated and overly functional for my purpose.  I can't work out how to get an intelligent random sort order either.

I am looking into alternative software that can generate an .m3u or similar playlist file.  That would suffice, as I can just plonk that straight into foobar2000 and be done.  I can then generate a new order every time the bulk playlist has been gone through.

I guess it could work on a system of analysing a random sort order, and then adjusting where necessary, however, as said before, that takes CPU cycles and therefore time.


Sort>Random (intelligently)?

Reply #3
Hey all,

I started a topic here, asking if it was possible and if I missed something, but I don't think it currently is with what is built into foobar2000.
http://www.hydrogenaudio.org/forums/index....amp;qpid=810506

What I am looking for is an intelligent randomisation to create a playlist that doesn't have songs by the same artist cropping up too often after each other.

For instance say, we load our entire music library as a playlist, Sort>Randomise the list and have just played a Fleetwood Mac track.  We do not want to hear another Fleetwood Mac track for at least 10 tracks by different artists.

I put forward this proposition to anyone who knows ho to write this sort of thing:  Basic web design is a challenge for me, and "echo" and "print" commands on a c64 aren't going to cut it here!

=======================================================

I've tried to explain it in human written form and sort of semi-computery way:

I've thought of a different approach to just continually randomising batches that are not 'random' enough.

OK so here's the plan in human (H) and Computer © terms:

1H: We have a hat filled with strips of paper which contain TITLE - ARTIST for each track.  A pool of our music list.
1C: This is what we have already, a pool of files with correctly meta tagging.  A pool of our music library.

2H: We pull out a strip of paper - its random selection
2C: Randomise entire library order save a "randomised_temporary_list".  Take first item - its random selection

3H: Put it at the top of our list.
3C: Copy to new playlist, and delete from "randomised_temporary_list"

4Ha: Select another strip of paper (second). 
4Hb: If it has different info to first (Artist), add to list, under the first strip.
4Hc: If it has the same info as the first (Artist), leave to one side

4Ca: Select first item on random "randomised_temporary_list". Analyse meta data.
4Cb: $if[selection]<ARTIST> = [first playlist item] then copy to "hold_list" and delete from "randomised_temporary_list"
4Cc: $if[selection]<ARTIST> not equal to [first playlist item] then copy to "playlist" and delete from "randomised_temporary_list"

5Ha: Select another strip of paper (third). 
5Hb: If it has different info to first or second (Artist), add to list, under the second strip.
5Hc: If it has the same info as the first or second (Artist), leave to one side, underneath any previous strips.

5Ca: Select first item on random "randomised_temporary_list". Analyse meta data.
5Cb: $if[selection]<ARTIST> = [first playlist item] or [second playlist item] then copy to "hold_list" and delete from "randomised_temporary_list"
5Cc: $if[selection]<ARTIST> not equal to [first playlist item] or [second [playlist item] then copy to "playlist" and delete from "randomised_temporary_list"

This would then continue, with a range of playlist items to keep artists/albums/genres separate by any number of tracks.

6Ha: Select a strip of paper (the tenth in succession). 
6Hb: If it has different info to first to ninth strips, inclusive, (Artist), add to list, under the second strip.
6Hc: If it has the same info as the first to ninth, inclusive, (Artist), leave to one side, underneath any previous strips.

6Ca: Select first item on random "randomised_temporary_list". Analyse meta data.
6Cb: $if[selection]<ARTIST> = [bottom 9 playlist items] then copy to "hold_list" and delete from "randomised_temporary_list"
6Cc: $if[selection]<ARTIST> not equal to [bottom 9 playlist item] then copy to "playlist" and delete from "randomised_temporary_list"

This is now happily randomising and checking to make sure tracks that are from the same artist/genre do not appear within a close proximity.  This proximity can be adjusted by using the [bottom X playlist items].  If there are less than X number then it will keep the next item different from all of the playlist items.


Now, there is an issue of what to do with those tracks that were too similar.  What would need to be employed as part of the script is to check the "hold_list" after every 11 successful items get added to playlist.
Or the hold list could be removed all together, and the unsuccessful track could be shifted down the "randomised_temporary_list" 11 places.

*I choose 11 places as we are using 10 items as the proximity range of same artist tracks.



OK, there is definitely as issue in this setup, and probably any kind of setup, where if the pool of tracks is too samey - in an extreme example: 3 artists, 20 albums, 18 albums by one artist.  This scenario would leave many many tracks not played because they occur far to frequently.  The above processing could and probably would crash in this scenario.  So a fail safe would need to be employed - to stop looking after say 30 recursive fails (remember the pool is still random - its highly unlikely that you sort>randomise your library and end up with 30 items in a row that belong to the same artist - genre perhaps.).

The source data for the randomised list could be made by copying the current playlist, and randomising that, or by having a GUI to select locations.  Either way it shouldn't be all that hard to use.

Cheers for any input on this

If I have placed this in the wrong section I am sorry.  Pease move it and let me know, thanks.

Sort>Random (intelligently)?

Reply #4
**apologies for the double post, wasn't sure if it would have been better in the other section..**

I found a link to a plugin for the Squeezbox which looks like it does something very similar:
http://wiki.slimdevices.com/index.php/Dyna...Playlist_plugin
Look to the bottom of the wiki for "Integration with Custom Skip plugin" - "recently added artist"

I tried to have a go myself with MS Express Visual C++, and got nowhere fast.  I don't understand the whole dependencies thing, and the step by step tutorial I found here seems outdated and half non-applicable, so I couldn't follow that.

Anyway, be a nice feature if it could be done without too much processing power.  Things would appear more random when we want random, rather than how it is.

Anyways, sorry again to the mods.