[Request] Weighted random playback |
This is NOT a tech support forum.
Tech support questions go to foobar2000 Tech Support forum instead.
See also: Hydrogenaudio Terms of Service.
![]() ![]() |
[Request] Weighted random playback |
Aug 31 2006, 08:40
Post
#1
|
|
![]() Group: Members Posts: 879 Joined: 18-June 06 From: Singapore Member No.: 31980 |
Hi foobar community!
I'm not sure if this has already been requested, but a forum search with the keywords above didn't bring any results. With all those nice ways to create metadata from playback-statistics (e.g. hotness, hot-or-not, auto-rating, ...) I think it is a shame that they are only useful for sorting and eye-candy purposes at the moment. I would be glad to be able to influence a track's playback frequency with TAGZ, too. foo_skip shows me how such a component could work: I set up a TAGZ string which returns a value between 0 (skip never) and 1 (skip always), so-to-say a skip probability. A little modification in foo_skip should already make this functionality possible. But in general I would prefer a variant which does not require the song to be loaded before, i.e. the next song can be calculated in the background. The idea behind this is that I can get different playback experiences from one single playlist file (e.g. an autoplaylist containing all music [not speech]) without having to code a seperated autoplaylist. For example "Play (more probably, not only!) what I haven't heard for a while", "Avoid everything from %genre%", "Give me the high rated ones!", ... I'd like to hear your opinion about that, ojdo -------------------- http://freemusi.cc/
|
|
|
|
Aug 31 2006, 17:10
Post
#2
|
|
|
Group: Members Posts: 77 Joined: 12-June 03 Member No.: 7145 |
That would be really cool. Just curious, is there any other music player that already does this?
-------------------- Everything I've learned about space, I've learned from psytrance.
|
|
|
|
Aug 31 2006, 17:16
Post
#3
|
|
![]() Group: Members Posts: 301 Joined: 1-March 06 Member No.: 28189 |
I would prefer a variant which does not require the song to be loaded before, i.e. the next song can be calculated in the background. i would love to have this. right now, foo_skip can go through several songs, even playing the first split-second of some of them, before landing on a song that passes the filter. this is annoying and i can't use crossfading because of it. |
|
|
|
Sep 1 2006, 05:00
Post
#4
|
|
|
Group: Members Posts: 50 Joined: 28-May 05 Member No.: 22351 |
I have simulated this behaviour by using a VB.net console application that reads my rating tags and outputs the filename into an M3U multiple times. This effectively gives a weighted playlist.
From an SDK perspective, do we have control over the shuffle mechanism and can we write our own component that will modify the algorithm? Cheers, c0utta This post has been edited by c0utta: Sep 1 2006, 05:00 |
|
|
|
Sep 1 2006, 06:49
Post
#5
|
|
![]() Group: Members Posts: 472 Joined: 16-February 05 Member No.: 19881 |
Oh yes!
And a fuzzy logic interface too, maybe... |
|
|
|
Sep 1 2006, 14:34
Post
#6
|
|
![]() Group: Members Posts: 879 Joined: 18-June 06 From: Singapore Member No.: 31980 |
And a fuzzy logic interface too, maybe... I know about fuzzy logic, but what is a fuzzy logic interface? When I imagine an interface for a possible plugin I tink of something quite simple like foo_skip. The only "fuzzy" part of all this is the calculated skip probability and it is the user's task to make it as... fuzzy (i.e. result in digital skip [1]/don't skip [0] or a value between [0.5=skip in 50% of all cases) as he wishes to. Example: CODE $ifgreater(%_hotness%,60,'0.8','0.2') This would skip a track with hotness greater 60 with a probability of 80%, otherwise 20%. I'm quite sure that there could be some nifty algorithms possible. -------------------- http://freemusi.cc/
|
|
|
|
Sep 3 2006, 22:20
Post
#7
|
|
![]() Group: Members Posts: 879 Joined: 18-June 06 From: Singapore Member No.: 31980 |
A little update from the foo_skip-thread: As I learned from a post by SoulMan $rand() can be used in foo_skip to - for example - play high rated tracks more often than low rated:
CODE $if($or(%skip%,$greater($add(1,$rand(10)),$add($mul($if2(%rating%,2),2),1))),1,0) The $greater-function compares a random integer from 1 to 10 with 2*%rating%+1. If no %rating% is present, a value of 2 is assumed. The result: CODE // R = %rating% R | 2*R+1 | Skip probability --+-------+------------------ 0 | 1 | 90% 1 | 3 | 70% 2 | 5 | 50% 3 | 7 | 30% 4 | 9 | 10% 5 | 11 | 0% The only bad thing is that this results in a kind of playlist-hopping, until foobar finds a track to play. A solution which would calculate the next song to play in advance would be much more elegant. ojdo -------------------- http://freemusi.cc/
|
|
|
|
Oct 23 2006, 14:03
Post
#8
|
|
![]() Group: Members Posts: 2296 Joined: 18-May 03 From: Denmark Member No.: 6695 |
BUMP!!
foo_skip is very nice, but as mentioned a few times in this thread, it's not *great*. I think it would be fairly simple for a developer, to make a foo_skip, that actually looks ahead in the playlist and not just evaluates after the skip! ...hint hint In regard to the weighted playback function, I did this just before I found this thread: CODE // R = %rating% R | Skip probability --+------------------ 0 | 100% 1 | 80% 2 | 60% 3 | 40% 4 | 20% 5 | 0% And the code I came up with: CODE $if($greater($add($mod($rand(),4),2),%rating%),1,0) Edit: And beware, I don't take any responsability for this code. It has no checking whatsoever, and does not take untagged files into account! This post has been edited by odyssey: Oct 23 2006, 14:13 -------------------- Can't wait for a HD-AAC encoder :P
|
|
|
|
Oct 23 2006, 19:39
Post
#9
|
|
![]() Group: Members Posts: 102 Joined: 5-May 06 From: Minneapolis, MN Member No.: 30448 |
Foosion always goes on and on about how random playback isn't supported in the SDK every time this comes up. This is the 3rd that I've counted. But, I still want it. ;]
|
|
|
|
Oct 23 2006, 20:05
Post
#10
|
|
![]() Group: Members Posts: 2296 Joined: 18-May 03 From: Denmark Member No.: 6695 |
Foosion always goes on and on about how random playback isn't supported in the SDK every time this comes up. This is the 3rd that I've counted. But, I still want it. ;] Maybe, but still - since the random play now is a pre-created list of random tracks, how hard could it be to implement? And we don't get it if we don't whine about it -------------------- Can't wait for a HD-AAC encoder :P
|
|
|
|
Oct 23 2006, 22:38
Post
#11
|
|
![]() Group: Members Posts: 102 Joined: 5-May 06 From: Minneapolis, MN Member No.: 30448 |
Agreed on the whining. I'm sure there's more complex ways to implement this type of thing, but it generally wouldn't be worth the trouble when it would be easier to implement in the SDK. However, it has been some months since this was first brought up, and we don't know when or if there will ever be an update.
Something like background automatic playlist generation (the old history component made a seperate playlist) seems somewhat complicated, but I'm not a coder by choice (I fear that it would consume what little I consider to be my life). Then there's the whole random-not-being-truly-random discussion, blah, blah, blah... I forgot the point I was trying to make, or if there was one... |
|
|
|
Oct 24 2006, 04:40
Post
#12
|
|
|
Group: Members Posts: 2340 Joined: 28-August 02 Member No.: 3218 |
Agreed on the whining. I'm sure there's more complex ways to implement this type of thing, but it generally wouldn't be worth the trouble when it would be easier to implement in the SDK. However, it has been some months since this was first brought up, and we don't know when or if there will ever be an update. iirc peters point of view was like "make your own playlist manually" when it was about the playback queue. Maybe this also applies here...
|
|
|
|
Oct 24 2006, 13:15
Post
#13
|
|
![]() Group: Members Posts: 446 Joined: 13-August 06 Member No.: 34002 |
I would like this for a different reason: to make every a song on every ALBUM the same chance of playing, not songs. That way 3 track albums would have as much chance of playing a song as 20 track ones. The only way to do this with a playlist is to duplicate tracks, which is ugly.
-------------------- err... i'm not using windows any more ;)
|
|
|
|
Oct 30 2006, 18:07
Post
#14
|
|
![]() Group: Members Posts: 2296 Joined: 18-May 03 From: Denmark Member No.: 6695 |
I would like this for a different reason: to make every a song on every ALBUM the same chance of playing, not songs. That way 3 track albums would have as much chance of playing a song as 20 track ones. The only way to do this with a playlist is to duplicate tracks, which is ugly. If you have tagged your albums with %total tracks% (or whatever that tag is called) you could use a variant of my skip-control: $if($greater($mod($rand(),%total tracks%),0),1,0) Takes a random number between 0 and %total tracks%, and skips if it's above 0. Should make every album have the same amount of proberbility (but still has the disadvantage of foo_skip beginning to play every skipped track though). Note, I did not test the code above. Edit: ...and I would assume that this code would skip ALOT!!! (All I want for christmas is... that Peter allows components to take control of the playlists This post has been edited by odyssey: Oct 31 2006, 00:20 -------------------- Can't wait for a HD-AAC encoder :P
|
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 19th May 2013 - 01:46 |