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: [fb2k v2] Random Pools (foo_random_pools) (Read 209074 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

foo_random_pools

Reply #50
one of my favorite ways to use it is as a virtual album changer [in conjunction with foo_removeplayed (basically just removes songs from the playlist after they finish playing)].

Example Random Pool:
Code: [Select]
Name: Album-Pop/Rock
Group: %album artist% - %date% - %album%
Number of groups to add: 1
Filter: (NOT %album artist% IS "Various Artists") AND (%genre% IS Pop/Rock)
Limit: 0, 0, 0, unchecked
Sort: %path_sort%
Sort / limit each group: checked
Priority: 10

Random Pools - Autoadd settings:
"Playlist patterns" set to "Random*"
"Add, when the playlist had X items or less" set to 1
"Add, when the playback position is X items..." set to 1


then i name a playlist Random1, manually populate the 1st pool, File -> Random Pools -> Album-Pop/Rock, and hit play.  Once playback starts, foo_random_pools will monitor that playlist (based off my settings above).

after each album plays down to the last track a new random album will be en queued to the playlist.
thus creating the virtual changer effect.

there are tons of stuff you can do with the plugin, this is just one example.

foo_random_pools

Reply #51
one of my favorite ways to use it is as a virtual album changer [in conjunction with foo_removeplayed (basically just removes songs from the playlist after they finish playing)].

Example Random Pool:
Code: [Select]
Name: Album-Pop/Rock
Group: %album artist% - %date% - %album%
Number of groups to add: 1
Filter: (NOT %album artist% IS "Various Artists") AND (%genre% IS Pop/Rock)
Limit: 0, 0, 0, unchecked
Sort: %path_sort%
Sort / limit each group: checked
Priority: 10

Random Pools - Autoadd settings:
"Playlist patterns" set to "Random*"
"Add, when the playlist had X items or less" set to 1
"Add, when the playback position is X items..." set to 1


then i name a playlist Random1, manually populate the 1st pool, File -> Random Pools -> Album-Pop/Rock, and hit play.  Once playback starts, foo_random_pools will monitor that playlist (based off my settings above).

after each album plays down to the last track a new random album will be en queued to the playlist.
thus creating the virtual changer effect.

there are tons of stuff you can do with the plugin, this is just one example.

Great Example! Thanks!

foo_random_pools

Reply #52
fbuser a billion thanks, I was looking for that for a long time!


foo_random_pools

Reply #53
Just started playing around with this component, it is great!

How would I go about populating a new playlist with one random album from each genre in my library?

foo_random_pools

Reply #54
Not possible because that would require not only one group but also a subgroup.

foo_random_pools

Reply #55
Not possible because that would require not only one group but also a subgroup.


That's what I was suspecting.  Thanks for the quick reply though.  As a workaround, I just setup a pool for each genre I have and then manually select each one from the random pools menu to populate.  Not as elegant as what I was hoping for, but plenty good enough.

This is great for iPod syncing with foo_dop.

Much thanks to the dev!

foo_random_pools

Reply #56
I remember that the @limit function inside playlist tree gave the opportunity to create such queries. Fbuser, what dou you think about field for a subgroup and a sub-subgroup (no more, no less ) - that would make possible fancy queries


... with one random album from each genre in my library?
Another request: easy option to choose all groups

foo_random_pools

Reply #57
Hi,

Is there a limitation in MBs?
It works fine until I chose a limitation big enough. If I pick, for example, a limitation of 5000 MBs, There's not even 1000MBs of tracks (group = %track%)!

Thank you!


foo_random_pools

Reply #59
Great, thanks!

foo_random_pools

Reply #60
First of all, let me say that I really like this component. Along with foo_scheduler it is probably most essential component to my listening. That said, I have two suggestions:

1. How about making autoadding choose possible pools depending on what playlist is active. For example, if it's "random tracks", foo_randompools would pick only from pools named with TR_* (or perhaps some pool specific option at which playlists they attend to).

2. I would like to see somekind of simple "master query" in options. For example, I have quite complex system with ratings, playcounts, hyped statuses and so on with my pools. Sometimes though, I would only like to listen certain type or aged music and easiest way that comes to my mind is that on options-page I coul write something like '%genre% HAS "metal"' and it would automatically be added to every poolquery. So, if my "%rating" EQUAL 3" was selected (randomly) the whole query would be '%genre% HAS "metal" AND %rating% EQUAL 3'. Does this make sense?

The component is sufficient the way it is, but I think these improvements would make it even better.

foo_random_pools

Reply #61
I'm terrible at figuring out code to get FB2K to work for me.  Could someone tell me if  it would be possible to write code for foo_random_pools that would target directories with large numbers of files, and then set a low playback priority for them in the 'Random Pool' preferences?

I like to have FB2K play tracks from my entire library at random.  But the problem is that even with a randomized playlist, and 'Shuffle (tracks)" set, FB2K tends to play the artists more frequently with large numbers (complete discographies) of files.

I've experimented with foo_random_pools, and have found something that works.  I can create a pool for, say all 'Rock' genre  tracks, but that excludes an artist with a huge number of files, with a high priority:

(%path% HAS "\MP3s\Rock-Pop") AND (NOT %artist% IS "UB40")
Priority: 30

Then I can create another pool that loads that artist, and sets its priority low:

%artist% IS UB40
Priority: 1

I could create a separate pool for each artist with large numbers of tracks, and set the priority of each low.  And then go into the pool that plays all files, and add every artist that has high numbers of tracks.

But that seems like more work than should be needed.  Is it possible to write code that limits playback based on the number of tracks in an artist's folder/subfolders?

That would just require two pools:

1 – One with artists with less than say 100 tracks set to a high priority
2 – One with artists with more than 100 tracks set to a low priority

Geopoliticus Child Watching the Birth of the New Man

foo_random_pools

Reply #62
Just create only one pool with using %artist% as your group definition and %path% HAS "\MP3s\Rock-Pop" as your filter. Then for each artist you will get the same probability to get picked, independent from the number of tracks you have for an artist.

foo_random_pools

Reply #63
Wow... this is closing in on something I've been thirsting for since the 1st copy of Winamp ever released.  As you suggested, I set %artist% as my group definition, but dropped 'Rock-Pop' and set %path% HAS "\MP3s" as a filter for my entire library.

I say 'closing in' because, while I am getting few if any repeat artists played with things configured as you suggested, I'm finding that foo_random_pools seems to dwell within some folders more than others.

I played about a half hour's worth of my entire library, and noticed that I was hearing a lot of tracks from my 'World' folders.  And I was hardly hearing any classical tracks at all.  I have a foo_np_simple script logging everything FB2K plays.  So I opened the log file and ran searches to see how many files from each genre's top folder were played.

I should point out that I only set foo_random_pools to add 1 track to the queue at a time.

I won't post all the results, but here's enough to make a point:

Code: [Select]
  Play    Total  Folder 
  Count   Files

    12    402:  Miscellaneous MP3s 1
    31    557:  Miscellaneous MP3s 2
    6     1840: Classical (Choral)
    7     655:  Classical (Instrumental)
    6     416:  Classical (Vocal)
    2     323:  Country
    51    4651: Folk-World
    7     448:  Jazz
    6     50:   Jazz Collections
    10    48:   Jazz Webcasts
    13    183:  Pop FM Broadcasts
    34    7960: Rock-Pop
    42    656:  Rock-Pop Collections
    8     109:  Soundtracks
    72    835:  World
    --
    324 Total played (genres with only few files not listed above)
.


Look at the proportions:

Out of 835 files in the 'World' folders, 72 of them were played.
Out of 1840 classical choral files, only 6 were played
Out of 655 classical instrumental files, only 7 were played
Out of 414 classical vocal files, only 6 were played

Then look at the numbers for the 'Rock-Pop' files, and the 'Rock-Pop Collections' play counts:

Out of 7960 'Rock-Pop' files, 34 were played.
Out of only 656 'Rock-Pop Collections', 42 were played. 

That one really startled me.  I'll test this a bit more, but I guess with a little code added to set priorities, I can level things out.

After about 1/2 hour of normal playback, I started to skip forward to quickly play the next queued tracks (a total of 324).  Without waiting the 60 seconds FB2K requires to recognize them as having been 'Last Played', foo_random_pools would sometimes queue the same file again, or queue another track from the same album folder.  Not a problem with normal playback, but it makes it a little hard to evaluate performance. 

I'm still not clear on a few aspects of this component, but I'll hold off on questions until I've played with it a bit more.  Overall it's really a fantastic tool for customizing random track playback.  Thanks for all your effort on this fbuser.

Geopoliticus Child Watching the Birth of the New Man

foo_random_pools

Reply #64
Wow... this is closing in on something I've been thirsting for since the 1st copy of Winamp ever released.  As you suggested, I set %artist% as my group definition, but dropped 'Rock-Pop' and set %path% HAS "\MP3s" as a filter for my entire library.
This is a different scenario and so the results you described are not very suprising. If you want to equalize the results for the folders you should use $directory(%path%) as group and for using all tracks of your entire library you can leave the filter empty. If you have any subfolders in your folders, it will not work as described, but can be adjusted.

Without waiting the 60 seconds FB2K requires to recognize them as having been 'Last Played', foo_random_pools would sometimes queue the same file again, or queue another track from the same album folder.
'Last Played' and foo_random_pools are not related at all. foo_random_pools does not have any memory, therefore it can happen, that the same file will be picked twice in a row.


foo_random_pools

Reply #65
...you should use $directory(%path%) as group and for using all tracks of your entire library you can leave the filter empty.

I'll give that a try.

Quote
If you have any subfolders in your folders, it will not work as described, but can be adjusted.

Under each genre's main subfolder under \MP3s I used to have separate folders for each 'artist - album'.  But as the library grew over the years, I began to create a single folder for some artists, and group that artist's albums in sub-directories on that one.  So you're saying that will require some tweaking?

Would that mean creating a pool for each genre's folder, and setting a priority for each?
Geopoliticus Child Watching the Birth of the New Man

foo_random_pools

Reply #66
Would that mean creating a pool for each genre's folder, and setting a priority for each?
That could be solution. It is not necessary, if you are able to describe the structure of your folders with one title format expression. Basically, it should be possible, but the expression might become complicated.

foo_random_pools

Reply #67
Could you just lay out a brief abstract of what needs to be done here?  I'm not at all clear on why changing the group and filter as we did here changed the whole dynamic of what's going on.  This thread is about the only source of information on this component... si/no?
Geopoliticus Child Watching the Birth of the New Man

foo_random_pools

Reply #68
Could you just lay out a brief abstract of what needs to be done here?
Mainly you need to find a title format expression for grouping, which matches your root folders. Something like $puts(Remainder,$stripprefix(%path%,<your base path>))$left($get(Remainder),$sub($strchr($get(Remainder),\),1)) could be a starting point, maybe it already works.


I'm not at all clear on why changing the group and filter as we did here changed the whole dynamic of what's going on.
The filter is used to restrict the tracks of the media library before building the groups. For each track of the media library, which is not filtered out by the filter expression, the group expression is evaluated. All evaluations with the same value are building one group. Normally one such complete group will be randomly picked, but this behaviour can be customized by several attributes, e.g. you can limit the picking to only one track per group. So, for your described cases it should be obvious, that using %artist% as group leads to a different result than using $directory(%path%) as a group.

This thread is about the only source of information on this component... si/no?
Besides the help file, most probably yes.



foo_random_pools

Reply #69
Something like $puts(Remainder,$stripprefix(%path%,<your base path>))$left($get(Remainder),$sub($strchr($get(Remainder),\),1)) could be a starting point, maybe it already works.

Well if one of the main purposes of this component for me is to avoid constantly playing tracks by artists I have huge numbers of files for, after a quick test, that code seems to do just the opposite.

I'll try to read up on those title formatting values and see if I can figure out what they do and how to tweak things to work for me.
Geopoliticus Child Watching the Birth of the New Man

foo_random_pools

Reply #70
the main purposes of this component for me is to avoid constantly playing tracks by artists I have huge numbers of files for, after a quick test, that code seems to do just the opposite.
This code is not meant to do this. It is meant to balance the groups determined from different folders. If you want to balance the groups determined from different artists, you have to go back to use just %artist% as group. You need to decide for one of these. Both together is logically not possible.

foo_random_pools

Reply #71
If you want to balance the groups determined from different artists, you have to go back to use just %artist% as group

If I could set %artist% as the group, and then as a filter, set a path for each genre I have folders for, and then set a priority for each within the filter code string, I think I could accomplish what I'm after. 

But even though Wooops suggested that it should work in an earlier post, apparently I can't set more than just one path as a filter.  For instance this filter will lock up FB2K:

(%path% HAS "\MP3s\Blues") AND (%path% HAS "\MP3s\Country")

And then there'd still be the problem of setting a priority for each within the script.
Geopoliticus Child Watching the Birth of the New Man

foo_random_pools

Reply #72
For instance this filter will lock up FB2K:

(%path% HAS "\MP3s\Blues") AND (%path% HAS "\MP3s\Country")

I'm not surprised. This expression would only return results if you had music in a directory structure (path) like so:
...\MP3s\Blues\MP3s\Country\*

Surely: (%path% HAS "\MP3s\Blues") OR (%path% HAS "\MP3s\Country")

C.
PC = TAK + LossyWAV  ::  Portable = Opus (130)

foo_random_pools

Reply #73
Surely: (%path% HAS "\MP3s\Blues") OR (%path% HAS "\MP3s\Country")

!OR! ... Yes... That makes much more sense.  Thanks for explaining that carpman.

That let's me combine 3-4 folder paths into one of 4 pools.  Each with %artist% as 'Group' and with priorities set to either 1, 5, 10, or 15.  That gets me closer to what I'm looking for.

It would be nice if it was possible to put all folder paths into the filters of one pool, and then set a priority for each.  Would FB2K code formatting prohibit that?
Geopoliticus Child Watching the Birth of the New Man

foo_random_pools

Reply #74
Thanks for this great plug in!  I use it with autoadd in the way described by mrinferno above: http://www.hydrogenaudio.org/forums/index....st&p=713114

I would really like the ability to be able to specify priorities dynamically: e.g. %rating%*100 + %play_count%

An even bigger (?) feature request is to have different priority ratings for different playlists (and autoadd).  For example I would like to be able to have a pop/rock autoadd list and a separate classical/jazz autoadd list.  At the moment I think autoadd behaves the same way towards all playlists that match the playlist pattern.

Cheers!