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: Is there a way to prevent songs from playing twice on random? (Read 2174 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Is there a way to prevent songs from playing twice on random?

I leave my foobar running 24/7 -- but because shuffle plays the songs in the same order every time it goes through, it's getting frustrating.

Is there a way to use random playback but not play something that's been played in the last X amount of hours?

Or, is there a way to randomize playlists every X amount of hours?  foo_scheduler doesn't allow for that it seems.

Is there a way to prevent songs from playing twice on random?

Reply #1
If your foobar writes play_counter tag field then I would make an autoplaylist with a max play_counter field defined. This way any file that hits your set play_counter limit will automatically be excluded from that playlist. You can ad a time expression to your autoplaylist if you want to define a time limt, example: NOT %last_modified% DURING LAST 2 HOURS.
No idea if randomizing playlists is possible.

Is there a way to prevent songs from playing twice on random?

Reply #2
Use the components foo_playcount and foo_skip. Then you can use an expression like '%last_played% DURING LAST 1 HOUR' or similar to automatically skip tracks.

Also:
Quote
Shuffle modes keep an internal randomized list of tracks in your playlist and play tracks according to their order in that list, so you don't get repetitions until all tracks in your playlist have been played. Shuffle's randomized track lists for each playlist are re-created on foobar2000 restart or when starting/advancing playback with another shuffle mode. Note that manually selecting a track to play in your playlist will result in shuffle playback continuing from that track's location on the randomized list, which is often perceived as repetitions: each time you manually choose a track to play (by doubleclicking it in playlist, etc.), shuffle plays the same tracks after that track; use 'Play → Random' menu command or the 'Random' button when you want to continue playback from a random track instead.

https://www.foobar2000.org/FAQ#random_shuffle_playback_order

Is there a way to prevent songs from playing twice on random?

Reply #3
Thanks!

Is there a way to have two functions?  Maybe don't repeat artists and don't repeat songs, so that the same artist doesn't get played twice in a row?

I have this as my function: (%last_played% DURING LAST 5 HOURS) OR (%artist% DURING LAST 2 HOURS) but I'm not sure it's working.  Any ideas?

Is there a way to prevent songs from playing twice on random?

Reply #4
No, since the playback statistics component tracks whether a track has been played based on track title (and artist, album, disc number, track number to be precise), which you can't change.

I recall some version of the component where you could set which tags are compared (in which case you could set it to artist only to get what you want), but I don't know if that thing (maybe called foo_playcout_mod or similar) is even compatible with the current version of foobar. Not to mention running it along the official version would most likely cause problems on its own.

If you are trying to alter the query, look into the wikis on how it works, but changing that on its own won't provide the functionality you are looking for:
http://wiki.hydrogenaud.io/index.php?title...00:Query_syntax
http://wiki.hydrogenaud.io/index.php?title...tting_Reference

Is there a way to prevent songs from playing twice on random?

Reply #5
So skip works, but only kind of.  It will take its time going between tracks, sometimes skipping 30-40 tracks, which means it won't actually crossfade between tracks, sometimes leaving a few seconds of silence before hitting the next song.  I've tried extending the crossfade function, but that just sounds bad.  And I've tried making the buffer 30 seconds in the hopes that will allow it to figure out the next song without a problem.  I'm wondering if what I want just isn't possible, but that's okay.

I really appreciate all your help, Daeron.  You're a good egg.

 

Is there a way to prevent songs from playing twice on random?

Reply #6
Sounds like a problem originating from your setup. The skip should happen immediately the moment the file is loaded. If your loading is slow (maybe a networked drive on a slow network) that might take some time. I'd expect increasing the buffer size would actually make things worse since it needs to load a bigger chunk first before it can do anything.

It certainly is possible since I and probably many other users of foo_skip are using it on a daily basis. Skipping on my setup happens so fast that I have no clue when a song is actually skipped.

Also skipping 30-40 tracks? What pattern did you set? Sounds like you don't have many songs at all or you set the 'played since' period way too high if it has to go through 30+ songs before it finds a valid one.

I think foo_random_pools has an option to move tracks played to a different playlist as well, which you could potentially utilize, but foo_skip+foo_playcount is a much more elegant and reliable solution overall.

I guess you could use the titleformatting function $rand() too to randomize your songs using foo_skip. Since foo_skip provides %playlist_name% as well, you could apply different percentages to different playlists. Or just turn it off if %playlist_order% is not shuffle.