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 205714 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: foo_random_pools

Reply #325
Hello @fbuser, that's amazing!
Just 2-3 seconds on my old PC as well!!
Please, recommend to install SQLite to everybody!!
Cheers, Andrea

Re: foo_random_pools

Reply #326
For the record, doing the same with SMP on 70K tracks, plus duplicates removal by title|artist|date (reduced to 65K elegible tracks)... takes 500 ms. Just giving options, since some specific use-cases may be covered with other approaches.

Spoiler (click to show/hide)

Re: foo_random_pools

Reply #327
Hello @regor, I am sorry but I don't know how to do that within SMP.
Would you be so kind to provide some more details? Or share your scripts?
Regards, Andrea

Re: foo_random_pools

Reply #328
Hello @regor, I am sorry but I don't know how to do that within SMP.
Would you be so kind to provide some more details? Or share your scripts?
Regards, Andrea
I put the link on the reply (also on my sig, Playlist Tools), and the video should be self-explanatory once you install the scripts and got it running.

Further discussion should be handled on its own topic though; I just wanted to add my 2 cents to the performance tests done with random pools, since my scripts essentially use TF and queries too.

Re: foo_random_pools

Reply #329
Hello @regor , sorry, I was reading from a smartphone and I missed something.
Regards, Andrea

Re: foo_random_pools

Reply #330
Hello @fbuser , ... just a last favor than I will not disturb you anymore...

How to have a similar SQL random pool of 10 albums?

I tried following one of your example of the help file, but I get the message "no table album" as well as "no table artist"...

Kind regards, Andrea

Re: foo_random_pools

Reply #331
How to have a similar SQL random pool of 10 albums?
This is a bit more complicated, especially if you want to have a good performance. With the more easier way I get 10 albums in about 35s, with some optimizations I got the 10 album in about 2.5s. So let's have a look at this.

  • First you need to create a materialized table from your media library:
    Go to "Preferences -> Media Library -> SQLite utilities -> MediaLibrary table", set for all columns, which you want to be part of the materialized table the "Materialize" flag and set "Materialized table" to "MMediaLibrary" in the upper right corner of the preferences page. Then click on the OK button and confirm, that you want to materialize the table. This will take some time, probably between 10-15 minutes on your PC, as it needs between 3-6 minutes on mine, but it needs to be done only once.

    Afterwards the materialized table will be maintained automatically and needs only to be refreshed, if you change the columns of the materialize dtable or in case the table gets out of sync due to abnormal program exits without having saved the latest tag changes (they are already in the materialized library but not anymore in the foobar2000 library after program restart). But with foobar2000 v2 this should normally not happen anymore.
  • Now go to "Library -> SQLite console" and execute the following SQL statement
    Code: [Select]
    CREATE INDEX materialize.MMediaLibrary_in_album on MMediaLibrary(album||'|'||coalesce("album artist",artist));
  • Finally you can define a pool "10 random albums". The left side of the dialog has the same entries as the pool for "20 random tracks", so you only need to supply different SQL expressions:
    Code: [Select]
    WITH:
    Albums AS (
      SELECT album||'|'||coalesce("album artist",artist) Album
      FROM MMediaLibrary
      GROUP BY 1
      ORDER BY random()
      LIMIT 10
    )

    SELECT path, subsong FROM:
    MMediaLibrary

    WHERE:
    album||'|'||coalesce("album artist",artist) IN (SELECT album FROM Albums)

    ORDER BY:
    album||'|'||coalesce("album artist",artist),coalesce(discnumber,1),tracknumber
    LIMIT remains blank. The proposed solution assumes, that you can identify an album uniquely by a combination of %album% and %album artist%. If this is not the case you need to adjust the expression "album||'|'||coalesce("album artist",artist)" wherever it is used to fit your needs. If you have an own tag to identify an album, e.g. %album id%, you should use this.

For the mentioned easier way you only need to define the pool as specified in the last point and replace the two occurences of MMediaLibrary by MediaLibrary.

Re: foo_random_pools

Reply #332
Hello @fbuser , thank you so much! It works well even on my old 32bit laptop.
All the best, Andrea

Re: foo_random_pools

Reply #333
Nice and useful plugin, but what about people who don't have any concept or idea about how works with SQL plugin or about how build SQL database.
So some of us stuck with older and simple plugin of Random Pools.

Re: foo_random_pools

Reply #334
Nice and useful plugin, but what about people who don't have any concept or idea about how works with SQL plugin or about how build SQL database.
They simply don't use the SQL feature.
So some of us stuck with older and simple plugin of Random Pools.
You're wrong. The SQL feature is only optional and the current version can be used without. There is no need to use an older version.

Re: foo_random_pools

Reply #335
Nice and useful plugin, but what about people who don't have any concept or idea about how works with SQL plugin or about how build SQL database.
They simply don't use the SQL feature.
So some of us stuck with older and simple plugin of Random Pools.
You're wrong. The SQL feature is only optional and the current version can be used without. There is no need to use an older version.

Ok. First of all, thank you for sharing this plugin and sacrifice your life time for develop this plugin.
That was misunderstanding of plugin requirements.

Re: foo_random_pools

Reply #336
just signed up to say what a cool plugin this is! being able to pick music in this way really feels like it's refreshed my library.

in the longer term I want to work out how to make a playlist that would walk along camelot numbers, but right now this tool has taken out so much of the legwork in selection. thanks!

Re: foo_random_pools

Reply #337
just signed up to say what a cool plugin this is! being able to pick music in this way really feels like it's refreshed my library.

in the longer term I want to work out how to make a playlist that would walk along camelot numbers, but right now this tool has taken out so much of the legwork in selection. thanks!
https://regorxxx.github.io/foobar2000-SMP.github.io/scripts/playlist-tools-smp/

Re: foo_random_pools

Reply #338
just signed up to say what a cool plugin this is! being able to pick music in this way really feels like it's refreshed my library.

in the longer term I want to work out how to make a playlist that would walk along camelot numbers, but right now this tool has taken out so much of the legwork in selection. thanks!
https://regorxxx.github.io/foobar2000-SMP.github.io/scripts/playlist-tools-smp/
Can you please stop hijacking this thread to make propaganda for your script, which is actually NOT a replacement for foo_random_pools?

Re: foo_random_pools

Reply #339
? I'm answering to an user request about camelot keys... wow... too much ego here (?)

EDIT: Let me be even more clear. It can be used along YOUR plugin, after playlist creation. So your comment was totally out of context and not justified at all.
Spoiler (click to show/hide)

Re: foo_random_pools

Reply #340
? I'm answering to an user request about camelot keys
By full quoting the user's post and just placing a link to the page of your script without any further comment? Already here you dropped in with hardly comparable results of your script, but ok.

... wow... too much ego here (?)
Not at all. I probably wouldn't even care, if you would not make the wrong statement on your script's page, that it is a replacement of foo_random_pools. The truth is, that it covers some functionality of foo_random_pools and some related additional functionality, besides a lot of unrelated functionality.

To be clear: I create all my components for my own needs in the first place and I share them, so that someone, who find them useful, can use them too. If nobody wants to use them, then it's also ok for me, although it's of course nice to receive some positive feedback like recently from @cheezopath and @Priest_1.

Let me be even more clear. It can be used along your plugin, after playlist creation.
And why didn't you write this before, instead just posting an uncommented link?

So your comment was totally out of context and not justified at all.
I don't think so, see above.

P.S.: If you want to continue discussing this, please send me a pm. This thread is not the right place to continue this.

Re: foo_random_pools

Reply #341
Spoiler (click to show/hide)

Re: foo_random_pools

Reply #342
I'm using random pools exclusively for playing albums, Can I get FB to play full albums without using Shuffle (albums) while using random pools?

I have several thousand tracks all arranged as albums, most with multiple tracks, but some with a single track, all classical music. I moved to random pools recently to get around some of the problems of playlists being played by Shuffle (albums) and to implement priority playback by rating. It appears to work well, but I'm not sure that the random pools that I generate do not end up playing in some repeating shuffle order. Must I use the Shuffle (albums) playback mode or is there some other way to get random pools to playback in album mode? Or is it not a problem in that it will play albums in random order in any case?

For each of the pools, set with %rating% IS [number], I load several hundred groups (albums), as it appears to work best that way. Is that itself a potential problem (it takes only a few seconds to load) and should I use the Autoload "Add" options instead?

Re: foo_random_pools

Reply #343
I'm using random pools exclusively for playing albums, Can I get FB to play full albums without using Shuffle (albums) while using random pools?
Sure.

Must I use the Shuffle (albums) playback mode or is there some other way to get random pools to playback in album mode?
Random pools is not playing at all. It just fills playlist randomly. In which playback order you play the playlist is up to you. But in your case you should use the default playback order.

Is that itself a potential problem (it takes only a few seconds to load)
No.

and should I use the Autoload "Add" options instead?
Probably not. This option is meant to add groups only to a playlist, when they are needed according to the specified rules. It works ideal together with the "Remove played tracks" function from foo_playlist_attributes to keep the playing playlist small.

Re: foo_random_pools

Reply #344
fbuser: I played with this for some time, shortening the number of groups in my pool set to add, in each pool, a number that I could easily look through when the playlist was populated. I have three pools, each grouped by album and each based on a rating: 5, 4, and 3. When I load my pool set, it always loads into the playlist as albums in random order per pool, but always contiguously by pool. That is, all of the Album rating 3 might load first, then perhaps Album rating 5, then finally Album rating 4. The order of these random loads may change each time the playlist is populated, but the albums are always loaded contiguous by rating.

Then, when I play them back in Default mode, playback will start at the first album in the list and proceed in the order that they are loaded in the playlist, start to finish. This means that, as in the example above, 3 ratings will all play first, then 5 ratings, then 4 ratings. Playing them in Shuffle (albums) will jump around the list as I would expect it to.

The problem here is there is no playback by priority in any case (as I suspected and as you stated above as "Random pools is not playing at all. It just fills playlist randomly. In which playback order you play the playlist is up to you."). Since random pools suggests that the playback with my setup will be picking albums to play back by priority, with my priorities being 10, 3, and 1, I should be hearing 10 of the rating 5 albums to every 3 of the rating 4 albums and every 1 of the rating 3 albums. But if I set up all my pools to load, for example, 100 groups (defined as albums) each, playback in both default and shuffle will play the same number of albums from each pool. There will be no favoring of the pool with a priority of 10 over the other two, but an equal number from each pool (100 in this example) will play.

The only way I can see that this would work with my setup using Default playback is if random pools would load 10 albums for rating 5 for every 3 albums of rating 4 and 1 album of rating 3, per the priorities, and would load them into the playlist with the various pool albums interspersed instead of in pool order. But with an equal number of albums in each pool, that can't happen.

What am I missing? Do I have a total misconception of how this works? Is there perhaps some other setting in FB or in one of the add-ins that keeps this from working properly?

I can make this work fairly well by adjusting each pool's "Number of groups to add:" to a number that is an even multiple of its priority, then playing back in Shuffle (album) mode. But this obviously isn't the way random pools should work.

Re: foo_random_pools

Reply #345
Quote
What am I missing? Do I have a total misconception of how this works? Is there perhaps some other setting in FB or in one of the add-ins that keeps this from working properly?
About your questions, yep. Priority is not meant to populate a playlist by proportion. If you want 60/20/20 then set your group numbers to those values. Priority sets the probability of a pool being picked when the Pool Set has multiple pools.

About your sorting problem, well that -currently- goes out of scope of this tool standard features. You are asking to configure how items from pools are inserted on the playlist, in your case intercalating them. Unless someone comes with a SQL expression to do it all, with a single pool. There are also other ways of doing that via SMP plugin.

And you should read the docs at:
./profile/user-components/foo_random_pools/help/foo_random_pools_help.html

Re: foo_random_pools

Reply #346
I've read last three pages, and I didn't see - will there be 64 bit version of plugin for new foobar?
I like this plugin, but can't use it currently as it is not supported.
TAPE LOADING ERROR

Re: foo_random_pools

Reply #347
I've read last three pages, and I didn't see - will there be 64 bit version of plugin for new foobar?
Yes, as soon as fb2k v2 becomes stable.

Re: foo_random_pools

Reply #348
Thanks for this component. I use it for some weeks, I hate myself for not having used it all these years, since I use "Shuffle" a lot.
I use the setting "Add when the playback position is X items or less from the end": 1
Ideally I'd like the new item to be added at the end of the last track or when using "Next" command, but I guess it would be too complicated. But I'm fine if I'm spoiled by only 1 track.

But I noticed that sometimes, the playlist stops, meaning plugin did not manage to add a new track.
To avoid that, I use "2" for the setting "Add when the playback position is X items or less from the end".
I don't know if it's a known bug, or if it can be circumvented ?

Some infos; I use Foobar 1.6.16. I don't use foo_sqlite.
My settings in screenshot.



Re: [fb2k v2] Random Pools (foo_random_pools)

Reply #349
New version, see first post.