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

Re: foo_random_pools

Reply #300
I am sure that it is me and not you that is causing my issue.
I'm not that sure. What I understand from your description is actually impossible. But maybe you mean something different. So, could you please also describe exactly what you are doing with an example what you get as final result and what you expect?

Re: foo_random_pools

Reply #301
@onanboy : I uploaded a new version mainly with the fix for the recently reported problems. However, at least with this new version I cannot confirm your problem. Could you please try again with the new version and let me know the result?
Great work, this makes the plugin just that tiny bit greater than it already was. :D

Re: foo_random_pools

Reply #302
I am sure that it is me and not you that is causing my issue.
I'm not that sure. What I understand from your description is actually impossible. But maybe you mean something different. So, could you please also describe exactly what you are doing with an example what you get as final result and what you expect?

I have a Playlist that I named No RG. I can clear it of all tracks.  Then I choose File>Random Pools>No Gain. It didn't used to but now it pops up a window that makes me select the No Gain pool.



I check the No Gain box and select OK.

It loads three titles.  Usually I listen to the tracks and during the final track I highlight all of the track from the title and then right-click and choose Replay Gain>Scan as single album and then Update the tags after the scan. 

Before it would immeditaley disappear because it no longer qualified as %replaygain_album_gain% MISSING

But now it stays in the playlist until I clear it.
Hope this is clear enough to help.

Re: foo_random_pools

Reply #303
Before it would immeditaley disappear because it no longer qualified as %replaygain_album_gain% MISSING
But this was not caused by foo_random_pools. foo_random_pools did never work in this way, that tracks were automatically removed, when the filter didn't match anymore. What you describe is the behavior of an autoplaylist, but it is not possible to add tracks to an autoplaylist. So, you must have used something else to realize the removal of the tracks. Maybe a script in one of the javascript panel components.
But now it stays in the playlist until I clear it.
This is the expected behavior and was also the expteced behavior with the old version.
Hope this is clear enough to help.
It's clear enough, but I fear, that my answers above don't really help you.

Re: foo_random_pools

Reply #304
Don't worry about it.  Maybe I am confusing it with the Autoplaylist that is mentioned in the pool list.

Your work is wonderful and still meets my needs.  Thanks for hearing me out and making sure I wasn't doing something dumb.

Re: foo_random_pools

Reply #305
I'm getting my old pools set up in the new version (I didn't see that they were already there under Default pool set at first), and I was wondering how best to do it for my purposes. I just have a simple breakdown of five different pools by genre, and I don't actually want to mingle them together. Furthermore, I had made toolbar buttons in a Spider Monkey Panel to add albums from one of the five genres.

So I'm guessing that I want to make five pool sets each with one pool? This would make the File menu look like how it did before and make my buttons function as they did.

My issue then is that I basically don't need to see the Add from pool set dialog and would like to suppress it. Is there a way to do so? I see from your help file that assigning keyboard shortcuts and using those will bypass the dialog, but I'm not sure where that leaves my buttons. It seems a bit hackish to make keyboard shortcuts and investigate some kind of javascript sendkeys functionality for the SMP.

Anyway, between this and all the SQLite stuff, you're a big part of my foobar2000 experience. Many thanks for that.  :D

Re: foo_random_pools

Reply #306
So I'm guessing that I want to make five pool sets each with one pool?
Having one pool set with all your pools in is actually, what you had before without the possibility to organize pools in pool sets. Pool sets are just an additional hierarchy level above the pools.

This would make the File menu look like how it did before and make my buttons function as they did.
If it is only for the buttons, then you don't need a file menu entry for each button. See my next answer below for more details.

but I'm not sure where that leaves my buttons. It seems a bit hackish to make keyboard shortcuts and investigate some kind of javascript sendkeys functionality for the SMP.
Of course, but this not necessary. The actions, which are displayed for the keyboard shortcuts, are actually hidden main menu entries. As you are using SMP for your buttons, you could set a button command as follows (just replace the values for the two constants to values that you need):

Code: [Select]
const poolSet = `<pool set>`;
const pool = `<pool from pool set>`;

fb.RunMainMenuCommand(`File/Random pools/Assign keyboard shortcuts/${poolSet}: ${pool}`);

Re: foo_random_pools

Reply #307
I've recently started using this plugin and love it.  I've been wondering how I could pool my pools, and the new version popped up and voila!  Kudos!

I only do album pools and I'm curious if I can filter a pool to remove duplicate tracks from within albums.  For example, I have many jazz albums that have the same song but alternate 'version' or 'take' - often they're bonus tracks. 

Is there a way to remove these sorta duplicate tracks via the target playlist filter?

Re: foo_random_pools

Reply #308
Is there a way to remove these sorta duplicate tracks via the target playlist filter?
No, with this filter it is not possible, as the duplicates are already inside of the group defined by the pool. It would be possible with SQL as source and if the version information is stored in an own tag and not part of the actual title tag. But it is not trivial.

Another possibility would be to add an extra tag to all "duplicates" and just filter them out with the standard filter, if the source is a title format source.

Re: foo_random_pools

Reply #309
Another possibility would be to add an extra tag to all "duplicates" and just filter them out with the standard filter, if the source is a title format source.
Thanks for the reply - that's what I suspected.  To your latter point, I use Musicbrainz Picard for tagging, so I can write a script to tag tracks with keywords in the title (e.g. "alternate" or "take").  But if I'm using %album% for the pool, will a filter for that tag eliminate the album or just the individual tracks with the new tag?

Re: foo_random_pools

Reply #310
But if I'm using %album% for the pool, will a filter for that tag eliminate the album or just the individual tracks with the new tag?
Just the individual tracks.

Re: foo_random_pools

Reply #311
Perfect.  Thanks again!

Re: foo_random_pools

Reply #312
Hello, I am sorry but I do not understand how to use this component (how to have it working).
Is there a step-by-step instruction document for the absolute beginners?
I am not a SQL expert, nor a programmer... just a regular music listener.
Thanks and regards, Andrea

Re: foo_random_pools

Reply #313
Is there a step-by-step instruction document for the absolute beginners?
No, but there is not that much what is really needed. All options are briefly explained in the help file, which you can find in the help menu. In the end the configuration depends on your actual needs.
I am not a SQL expert, nor a programmer
You don't need SQL at all nor to be a programmer. Although SQL driven pools are more powerful than pure title format pools, there are already a lot of pool definitions possible without SQL. In the end you need SQL only, if you want to use filter conditions, where tracks are picked based on the values of other tracks or if you want to use functions, which are not available in title format, e.g. regular expression functions.

If you have any specific use case and don't know how to define it, feel free to post it here. Possibly you can be helped.

Re: foo_random_pools

Reply #314
There's no documentation, I can't get it to work, please help. I want 'rating-weighted' shuffle, is it possible to implement?
These are my settings ,literally nothing happens when I go to file - random pools


OK I figured out GROUP field should be a tag, changed it to %album%. Number of groups to add should be higher than number of something(?) in my library, based on previous posts. I've set it to 9000 in each group and ended up with a playlist of 140k songs (my media library is 20k songs). And I assume if I use foobar's shuffle then the purpose of this component is wasted? So I should just be using the playlist I generated with a normal playback order? Which means songs will never repeat?

So what I want is not possible with this plugin, right?

Re: foo_random_pools

Reply #315
There's no documentation
To quote myself:
All options are briefly explained in the help file, which you can find in the help menu.
I want 'rating-weighted' shuffle, is it possible to implement?.
It depends on what you mean with "'rating-weighted' shuffle".

So what I want is not possible with this plugin, right?
It's actually not really clear what you want. You should describe more in detail, what you want to achieve.

Re: foo_random_pools

Reply #316
So what I want is not possible with this plugin, right?
It's actually not really clear what you want. You should describe more in detail, what you want to achieve.
[/quote]
Higher rating - higher probability of shuffling algorithm of playing the song.

Re: foo_random_pools

Reply #317
Hello "Experts", I am still not able to have random pool working on my setup.

I just would like to create a single playlist of 20 random tracks from my entire library.

Nothing more
Regards, Andrea

Re: foo_random_pools

Reply #318
I just would like to create a single playlist of 20 random tracks from my entire library.
A solution could be:
  • Create a pool set "Random tracks"
  • Create a pool "20 random tracks" in this pool set
  • Define the pool as follows
    • Group: %path%|%subsong%
    • Number of groups to add: 20
    • Priority: any number greater 0 (Currently only necessary to bypass a little bug)
    • Source: Media library
    • Filter the content of the target playlist: checked (optionally, only necessary, if you want to avoid duplicate tracks in the playlist)

    Keep the default for all other settings

  • Call the pool set from the menu via "File -> Random pools -> Random tracks" and click Ok

Re: foo_random_pools

Reply #319
Hello @fbuser , thanks for your help, but it is still not running on my setup.
As per my other scripts, "random pool" starts elaborating but never reach the end.
Please see the attached screenshot. The progress bar was running for 3-4 minutes.
Kindly be aware that I am using FB v2 Alpha 2022-08-20 and my library is quite large.
Is there some kind of debugging or log files I can do/collect for you?
Regards, Andrea

Re: foo_random_pools

Reply #320
Kindly be aware that I am using FB v2 Alpha 2022-08-20 and my library is quite large.Is there some kind of debugging or log files I can do/collect for you?
No, thanks, but this is not necessary. Honestly, I was aware, that the proposed solution is not ideal for a large library and it is  even worse for foobar2000 v2. I need to check, if I can implement some performance optimizations for foobar2000 v2.

Anyway, you should get a better performance by changing the following attributes for the pool "20 random tracks" a
  • Group: %library%
  • Number of groups to add: 1
  • Number of tracks to add: 20
  • Sort: $rand()

The group attribute needs to be a tag, which is not present in your library. If you are using for any reason %library% in your library, you need to choose a different group attribute.

The sorting should actually not be necessary, as the 20 tracks are already randomly picked from the library. But strangely an empty sort attribute seems to have a negative performance impact. This is also something I need to check more deeply.

Re: foo_random_pools

Reply #321
Hello @fbuser, thanks, well understood your answer.
FYI, I tried anyway also your new proposed configuration, but I am having exactly the same starving behavior.
I look forward to a final future solution for FB v2.
Kind regards, Andrea

Re: foo_random_pools

Reply #322
FYI, I tried anyway also your new proposed configuration, but I am having exactly the same starving behavior.
How many items does your library have? What are exactly the attributes of your pool? With the new proposed solution I got the result after about 15 seconds with a library of about 900k items for foobar2000 v2.
I look forward to a final future solution for FB v2.
You should not put too much hope on it. There is actually not much room for optimizations.

Re: foo_random_pools

Reply #323
Hello @fbuser , my library has a similar size of your testing solution.
Your optimized script takes 45 seconds to complete on my 32bit PC. That's why, in my opinion, it takes anyway to much.
Just to give you a comparison, on the same PC (so also same library, same audio setup and so on), using JRiver MC 29, a similar random playlist is created in less than 10 seconds.
Do you think that installing SQLite would bring any improvement?
Regards, Andrea

Re: foo_random_pools

Reply #324
on my 32bit PC.
So it's probably a quite old and slow PC  ;D

Just to give you a comparison, on the same PC (so also same library, same audio setup and so on), using JRiver MC 29, a similar random playlist is created in less than 10 seconds.
It's quite difficult to make such comparisons. JRiver uses configurable but dedicated rules for creating smartlists while random pools uses title format query syntax, which adds more flexibility but also more overhead. This also leads to not getting always the best approach from the performance point of view for a specific use case. Having this in mind I think the 45 seconds for random pools compared to the 10 seconds of JRiver are explainable.

Do you think that installing SQLite would bring any improvement?
At least on my PC it does. The execution time is reduced by a factor of 10, i.e. 1.5 seconds execution time. For the pool definition have a look at the attached image.