Skip to main content
Topic: foo_random_pools (Read 90659 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: foo_random_pools

Reply #225
You have to set the priority above zero.

Re: foo_random_pools

Reply #226
I'll attempt to echo what fabiospark and stevehero seemingly already requested, as I also think that would be a logical extension of the component.

The scenario is the following (picture below). Let's say you set up a random pool to populate a specific playlist with some arbitrary set of rules. Suppose you want your playlist to consist of 50% metal songs that came out before 2008 and 50% after and set up the component accordingly. The Playlist attributes component is also used to automatically remove played tracks from this playlist. The result is an auto-updating playlist which has the right distribution and basically requires no further input. Great.


Now suppose you want another playlist with yet another set of arbitrary distribution of songs. Let's say 50% electronic songs which were rated above 4 and 50% below. Important is that you want to keep the auto-updating nature of the playlist, just like the metal songs had. As far as I'm aware, this is currently not possible. You can go back, edit and overwrite your original settings - basically repurposing your metal playlist to create the electronic playlist (picture below) - but you can't define multiple of these special playlists with different parameters at the same time. You can of course still create the individual electronic and metal pools and add them by hand (via File/Random pools), but in that case auto-updating nature can't be utilized, which would be essential to how many of us would like to use this component.


Important distinction, which I think was the source of confusion, is that I don't think people want these special playlists to update in real time simultaneously. As long as I'm listening to the metal playlist, I don't care what happens to the electronic playlist and vice versa. All I would like is to be able to specify which pools to take into consideration depending on which playlist I'm currently playing. This is shown on the picture below. The red arrow signifies that the "Autoadd" setting would become the property of each individual pool as opposed to the global setting which it is now.


So the logic of the component would go from:
1) Check the name of the current playlist
2) If playlist name matches the global "Autoadd" setting, populate the playlist according to every pool

To:
1) Check the name of the current playlist
2) If playlist name matches at least one of the Autoadd settings, populate the playlist according to the pools which have a matching "Autoadd" setting

I don't think this modification would fundamentally break any mechanic that the component relies upon and would be fairly simple to implement, relatively speaking anyway. It would however allow us to spawn countless finely tuned auto-playlists which would be great. The functionality is already there, it's just limited to a single playlist currently. Playlist attributes component for example already lets you specify settings for both global and individual playlists, so that side of the equation is already covered.

Re: foo_random_pools

Reply #227
I don't think this modification would fundamentally break any mechanic that the component relies upon
Actually, it would just do this. In your example you defined four pools with the same priority. Either of the pools has the same probability to be chosen. You're proposal would in the end lead to different behaviours for adding a pool from all pools manually and adding a pool automatically. I don't think, that this is a good idea.

Sorry, but I won't implement this.

Re: foo_random_pools

Reply #228
Would like to pull an equal number of random tracks from two different genres.  One genre (Rock) has 13261 tracks in the library and the other genre (Blues) has 1852 tracks in the library.  Problem: tracks being pulled are proportionate to number of tracks in each genre.  Out of 200 tracks requested roughly 20 are from the Blues library and the remainder 180 are from the Rock library.  I would like an equal number of tracks pulled from each genre.  Is this possible??

 

Re: foo_random_pools

Reply #229
What are your current pool definitions?

Re: foo_random_pools

Reply #230
Thank you for your reply.  Parameters are as follows:

Blues Genre pool: 
Name = Blues
Group = %artist% and %title%
Determine probability for picking groups based on group size = not checked
Number of groups to add = 200
Filter = %genre" IS Blues
Filter with content of the target playlist = checked
Priority = 1
Number of tracks to add = 1
Number of minutes to add = 0
Number of MBs to add = 0
Sort = %artist% | %album% | %tracknumber%
Sort / limit each group = checked

All parameters for the Rock genre pool are exactly the same as the Blues genre pool with the exception of the Name and the Filter parameters
Name = Rock
Filter = %genre" IS Rock

All parameters for the Blues & Rock genre pool are exactly the same as the Rock or Blues pools with the exception of the Name, the Filter and the Group:
Name = Blues & Rock
Group = %DIRECTORYNAME%  -- (but I have also tried using %artist% and %title% as the group with same results)
Filter = %genre% IS Blues OR %genre% IS Rock

TIA for you help

Re: foo_random_pools

Reply #231
In general it is better to use the following properties to get 200 random tracks from a pool:

Group: %library% (or any other non-existing tag)
Number of groups to add: 1
Number of tracks to add: 200

This is especially for large libraries much faster.

However, this will not solve your problem to get a balanced number of tracks from one pool for two different genres. Actually, this is not possible. You need to add separately 100 tracks from the Rock genre pool and 100 tracks from the Blues genre pool to get the result you want.

Re: foo_random_pools

Reply #232
Thank you for your assistance.  I did figure out that by selecting the two different genre pools independently I could add the same number of tracks from each genre to the playlist.  I suspect it is possible to do what I am asking but not without additional coding.  You have already provided foobar users with a great tool, I can understand why an enhancement like this may not be something you want to spend time on.  Thanks again for your help. 

p.s. If I can get a look at the source code I may be able to help with the enhancement should you decide it is worthwhile to include.  

Re: foo_random_pools

Reply #233
I'm new to foo_random_pools and I'm struggling with it right now.
What I'm trying to achieve: define pools (currently with a directory as source) filtering by bpm, to build playlists with "one click" (and maybe fine tune them later, but that's another story).
I've been successful in defining a playlist column to display bpm, but it seems I'm stuck with filter definition, this is what I came up with, which is invalid: $and($num($meta(TEMPO),1) GREATER 100,$num($meta(TEMPO),1) LOWER 180)

It seems I don't have a good enough grasp of the syntax, could you please point me in the right direction?

Re: foo_random_pools

Reply #234
I don't have time to help you now but you should have a look
at "Menu\Library\Search\ and click on the question mark in the upper right corner.
You shoud see what I have attached here, with better formatting, and you should carefully check the syntax
of your query. I suggest you to start with a simple search and only when you see
all of them work by themselves, try to put them together with the boolean operators.

Good work.

Code: [Select]
Query Syntax Help
Conventions in this Document

Queries are written in italics.
Example: %rating% GREATER 3

Query examples may contain placeholders which are enclosed in angle brackets. Their name indicates what they need to be replaced within a real query. If multiple placeholders of the same type occur in the same query example, a number will be appended to the name.
Example: <field> GREATER <number>

The following common types of placeholders are used in the rest of this document:

    <field>
    A reference to a tag field. This can be either a plain field name or a title formatting expression. See Notes for details.
    <number>
    An integer value.
    <string>
    A text value that may be enclosed in double quotation marks. See Notes for details.
    <time>
    A time value or a title formatting expression that evaluates to a time value. See Time Expressions for details.
    <expression>
    A query expression in a composed query. This has to follow the rules described under Advanced Search below.

Simple Search

The simple search mode does not use any keywords.

    <any string>
    Returns only items that have all words from specified string in their metadata or file path.

When using the simple search, any latin characters are matched regardless of their accents, e.g. “foo” will match “foo” as well as “föö” or “fóo”.
Advanced Search

The advanced search allows the construction of more complex queries. It offers several keywords to perform specific types of comparisons and to combine multiple query expressions.
Text Expressions

    <field> HAS <string>
    Returns only items that have all words from <string> in a metadata field named <field>.
    Example: title HAS blah
    <field> IS <string>
    Returns only items where (at least one) metadata field <field> is equal to <string>.
    Example: artist IS blah
    * HAS <string>
    Same as simple search, but can be combined using logical operators (see below).

Numeric Expressions

Perform integral number comparison between the value of a <field> and a <number>, e.g. ”%rating% GREATER 3”.

    <field> GREATER <number>
    <field> LESS <number>
    <field> EQUAL <number>

Metadata Expressions

    <field> MISSING
    Returns only items that don't have a metadata field named <field>.
    Example: genre MISSING
    <field> PRESENT
    Returns only items that have a metadata field named <field>.
    Example: genre PRESENT

Time Expressions

    <time1> BEFORE <time2>
    Returns only items where <time1> value is before <time2>.
    Example: %last_modified% BEFORE 2008
    <time1> AFTER <time2>
    Returns only items where <time1> value is after <time2>.
    Example: %last_modified% AFTER 2008
    <time1> SINCE <time2>
    Returns only items where <time1> value is not before <time2>.
    Example: %last_modified% SINCE 2007
    <time1> DURING <time2>
    Returns only items where <time1> value is a subset of <time2> period.
    Example: %last_modified% DURING 2007
    <time> DURING LAST <number> <time-unit>
    Returns items where <time> value is contained in the specified period.
    <time-unit> can be one of SECONDS, MINUTES, HOURS, DAYS, or WEEKS.
    Example: %last_modified% DURING LAST 2 WEEKS
    If <number> is 1, the expression can be simplified to <time> DURING LAST SECOND/MINUTE/HOUR/DAY/WEEK

Time values used in these expressions must be in one of the following formats: YYYY, YYYY-MM, YYYY-MM-DD, YYYY-MM-DD hh, YYYY-MM-DD hh:mm, YYYY-MM-DD hh:mm:ss.
Composed Queries

    <expression1> AND <expression2>
    Returns only items where both expressions are true.
    Example: artist IS blah AND title HAS blah
    <expression1> OR <expression2>
    Returns only items where at least one expression is true.
    NOT <expression>
    Returns only items where the expression is false.
    Example: NOT %last_played% AFTER %first_played%

Sorting Results

You can put a SORT BY operator at the end of your search expression to produce search results sorted by the specified title formatting pattern.

    SORT BY <sort-pattern>, SORT ASCENDING BY <sort-pattern>
    Sort results in ascending order.
    SORT DESCENDING BY <sort-pattern>
    Sort results in descending order.

Notes

    <field> and <string> in HAS and IS expressions should be enclosed in double quotation marks (”) if they include spaces or parentheses.
    If <field> in HAS, IS, GREATER, LESS, EQUAL includes at least one of #$% characters, it will be treated as a title formatting string.
    Example: %codec% IS MP3
    If <field> in HAS, IS, GREATER, LESS, EQUAL does not include any of #$% characters, it will be treated as a metadata field.
    Example: artist IS Radiohead
    Note that you can't access technical information (such as codec specifications) or component-provided information (playback statistics and such) this way.
    Using title formatting strings instead of simple field names will decrease search speed on large libraries and break multiple field value handling in the IS operator - for example, a track with two artist names: “name1” and “name2”, will be found by artist IS name1 query, but not by %artist% IS name1.
    To control the evaluation order of composed queries, enclose the individual expressions in parentheses.
    Example: ( (artist IS blah) AND (title HAS blah) ) OR (%rating% GREATER 3)
    All search expressions are not case-sensitive. All keywords must be uppercase.

Operator Summary
Operator Syntax Comment
AFTER <time1> AFTER <time2>
AND <expression1> AND <expression2>
BEFORE <time1> BEFORE <time2>
DURING <time1> DURING <time2>
DURING LAST <time> DURING LAST <number> SECONDS/MINUTES/HOURS/DAYS/WEEKS
<time> DURING LAST SECOND/MINUTE/HOUR/DAY/WEEK
EQUAL <field> EQUAL <number>
GREATER <field> GREATER <number>
HAS <field> HAS <string>
* HAS <string>
IS <field> IS <string>
LESS <field> LESS <number>
MISSING <field> MISSING
NOT NOT <expression>
OR <expression1> OR <expression2>
PRESENT <field> PRESENT
SINCE <time1> SINCE <time2>
SORT BY SORT BY <sort-pattern>
SORT DESCENDING BY <sort-pattern> Must be at the end of the query.


Re: foo_random_pools

Reply #236
I've made great progress. However I seem to be stuck again. When I add tracks from all pools all tracks will be selected from the just one group.

These are my definitions:
A
Group: $strcmp($lower($directory(path)),'tempo')
Number of groups to add: 1
Filter: ("$num($meta(TEMPO),1)" GREATER 179)
Filter with the content of target pl: yes
Number of minutes to add: 10
Sort/limit each group: yes
B
Group: $strcmp($lower($directory(path)),'tempo')
Number of groups to add: 1
Filter: ("$num($meta(TEMPO),1)" GREATER 100) AND ("$num($meta(TEMPO),1)" LESS 180)
Filter with the content of target pl: yes
Number of minutes to add: 50
Sort/limit each group: yes

With these settings, the 50 minutes of tracks will be added from group B, none from group A. Setting "Number of groups to add: 2" in both groups, 10 minutes of tracks will be added from group A.
I can of course circumvent the problem by just clicking twice but I'd rather understand what I'm doing wrong.

Thanks in advance.

Re: foo_random_pools

Reply #237
I've made great progress. However I seem to be stuck again. When I add tracks from all pools all tracks will be selected from the just one group.
Of course, that is how it is designed.

Re: foo_random_pools

Reply #238
My bad, it was my understanding that "all pools" would indeed mix all of them together, proportionally, based on the priority field.
As I said then, it will be two clicks instead of one. :)

Re: foo_random_pools

Reply #239
Hi. I wanted to make a sort of Spotify's Instant Mix (left out from Spotify from a couple of weeks ago); I want to know if my way is the closest I can be from the Instant Mix-like playlist, have you got more ideas? I used:
  • Random Pools
  • Playlist attributes
  • Lastfm, optional

First of all, I went to Lastfm to check my top ten artists. I created ten pools, one for each artist with the next configuration:
Quote
Group: %all%;
Filter: artist HAS <yourartist>;
Priority: 1;
Number of tracks to add: 1

My idea here is to check the artists of my top ten on Lastfm from time to time to adjust the pools.

Then I created another pool with the next configuration—each <yourartist> represent one of the top ten artists that already have been added on the previous step so you do not want them on this pool playlist:
Quote
Group: %all%;
Filter: %play_count% LESS 5 AND NOT artist HAS "<yourartist>" AND NOT artist HAS "<yourartist>" AND NOT artist HAS "<yourartist>" AND NOT artist HAS "<yourartist>" AND NOT artist HAS "<yourartist>" AND NOT artist HAS "<yourartist>" AND NOT artist HAS "<yourartist>" AND NOT artist HAS "<yourartist>" AND NOT artist HAS "<yourartist>" AND NOT artist HAS "<yourartist>"
Priority: 2
Number of tracks to add: 5

In addition, I set to 10 the ''Add, when the playlist has X items or less'' to my playlist Instant Mix.

The next thing I did was going to ''Playlist attributes'' and set the playlist Instant Mix to "Remove and Skip played tracks".

Then I set Foobar2000 in shuffle mode and press Random Pool, start listening and that is all.

I think that this is the closest mode to Spotify's Instant Mix. I thought about to leave playback "default" but his will cause that the five songs pool would reproduce in a row and for me was better to mix it with the other pools so, for instance, F2K would reproduce two of the five and six of the others and one of the five and four of the others and so on. I mean it will, indeed, mix them. In addition, this configuration will cause to fill the playlist in a way that it may not be full of my top ten artists in a given time because it will only add songs when ten songs are left.

Regards.
Yes, the avatar it is the cover of «The City» by Vangelis.

Re: foo_random_pools

Reply #240
I have made another pool given that the Daily Mixes and not Instant as I called them adapt to the songs or artists you have been listening in the last couple of days so I decided to go with:

Quote
Group: all
Filter: %last_played% DURING LAST 9 DAYS AND NOT %last_played% DURING LAST 2 DAYS
Priority: 1;
Number of tracks to add: 3

This will add songs heard during last week without counting the last two days before today.

Yes, the avatar it is the cover of «The City» by Vangelis.

Re: foo_random_pools

Reply #241
what am i doing wrong. Random pools seems not working.
Please advice me some settings, updates, etc


Re: foo_random_pools

Reply #243
Just trying to figure this out, I have a random pool called Anime 3+ which looks to select a bunch of random anime style songs that are rated 3+.  In Filter I have %Genre% HAS "Anime" AND %Rating% GREATER 2 and Number of Tracks to add is 5. If I click File - Random Pools Anime 3+ I get 1-5 tracks and they're not random at all, most are from the same album.

Re: foo_random_pools

Reply #244
This sounds like you have only a few files in your media library. How many tracks do you get, if you search with the specified filter using the menu "Library -> Search"?
What is are your other settings, especially the setting for "Group"?


Re: foo_random_pools

Reply #246
With your settings, you will get up to 5 random tracks from a random album. If you want to have just 5 random tracks you need to group by a tag, which has the same value for each track. This is also the case for any non-existing track, like %all% or %library%, as the title format result in such a case is just a ?

Re: foo_random_pools

Reply #247
I'm searching for a plugin which can create playlists with artist and song repeat protection. But I don't know how to configure random_pools because I got no programming skills. My media library has 49 folders (13 of them are different VA folders). 1372 songs. No folder has less than 18 songs or more than 77 songs. In random_pools I configured 49 groups with autoadd, when the playback position is 1 items or less from the end. Figured out how to get my playlist populated and gave it a try. But I didn't like the results. Within an hour, I got 3 different songs from the same group (which has 24 songs total) and no songs from the biggest groups. All groups are configured similar:
group = %directoryname%
number of tracks to add = 1
determine probability for picking groups based on group size = yes
number of groups to add = 1
filter = %path% HAS "some-string-from-directory-name"
filter with the content of the target playlist = yes
sort/limit each group = yes (but no rules are defined)
priority = 1

And my question is - is it possible to configure this plugin so that within 2 hours no artist are repeated? Total playing time of my library is about 91 hours and no artist has more than 32 songs. Of course I'm probably doing it completely wrong because lack of programming skills...

Re: foo_random_pools

Reply #248


From the 6 groups created by this, I was hoping to get 1 track each from the 3 largest groups (total 3 tracks) at any given time, but I am getting all 3 tracks from 1 largest group.

Re: foo_random_pools

Reply #249
And my question is - is it possible to configure this plugin so that within 2 hours no artist are repeated?
No, this is not possible.

From the 6 groups created by this, I was hoping to get 1 track each from the 3 largest groups (total 3 tracks) at any given time, but I am getting all 3 tracks from 1 largest group.
Also this is not possible.

 
SimplePortal 1.0.0 RC1 © 2008-2018