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: foo_random (Read 40857 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

foo_random

The component adds support for playlist entries that map to a random entry of a subset of the Media Library on playback.

The component adds a decoder for URIs of the form
Code: [Select]
random:|query|
where query is a valid playlist generator query. The component provides a main menu command to add ("Playlist/Add randomized entry...") and a playlist context menu command to edit ("Edit randomized entries...") entries of this form. The context menu command replaces the existing entry with the new one. It is recommended that you use these commands to manipulate randomized entries instead of the "Add location..." command, as they also check that the query is syntactically valid.

The use of random: paths is limited to playback, i.e. you cannot use them with the Replaygain scanner or the converter. This is by design.

When a randomized entry is played, it will fiter the contents of the Media Library using the specified query and randomly chose one of them. During playback, the static metadata of the chosen track is made available to the player as dynamic information of the random: entry. This works similar to audio streams on the Internet. The dynamic metadata is augmented with "played_path" and "played_subsong" tech info fields that hold the location of the chosen track. The dynamic data of the chosen track is not available.

Note that dynamic metadata is available in (some) titleformatting scripts, including the playlist, main window caption and statusbar. It is however not available to the DSP pipeline, so Replaygain is applied by foo_random using the core settings.

There are a number of error conditions that can lead to the component not being able to play a "real" track. If the Media Library is empty or no tracks are left after filtering its contents, the component will raise a "Not found" type error. An error occurs as well, if the query is not syntactically correct. More information is printed on the console under these conditions.
If you try to use the Replaygain scanner or the converter on a randomized entry, the component will raise an "Access denied" type error. The same happen, if you try to change the tags of a randomized entry.

foo_random

Reply #1
Thanks, foosion.
f to c to f to c

foo_random

Reply #2
Updated to version 1.1.

The component now outputs which file it picked for playback.

There is an issue with full file buffering affecting this component. If you get a "Not found" type error without any console messages originating from foo_random, try turning full file buffering off. This should be fixed in the next beta.

foo_random

Reply #3
Hey this is pretty cool, thanks

foo_random

Reply #4
1) When playing random song if pause is presed, the position slider goes to begining but when resuming jumps back.
2) When resume playback on start is enabled, when started a new song is chosen and it starts playing from place where the one that played before exiting. Yust wondering what will happend when the song chosen on startup is shorter than the progress on song playing before exiting.
fb2k 0.9 beta 13.

foo_random

Reply #5
Quote
1) When playing random song if pause is presed, the position slider goes to begining but when resuming jumps back.[a href="index.php?act=findpost&pid=324001"][{POST_SNAPBACK}][/a]
That is an issue in the user interface. Nothing that can be solved in foo_random.

Quote
2) When resume playback on start is enabled, when started a new song is chosen and it starts playing from place where the one that played before exiting. Yust wondering what will happend when the song chosen on startup is shorter than the progress on song playing before exiting.[a href="index.php?act=findpost&pid=324001"][{POST_SNAPBACK}][/a]
It will attemp to seek to the remembered point, hit the end of the file and skip to the next song (as determind by the playback order).

foo_random

Reply #6
Thank's
fb2k 0.9 beta 13.

foo_random

Reply #7
I know this is pretty trivial, but is there a chance of being able to set a title for the query, that is displayed when the track is not playing. If I were to make a really long query, it will get truncated.  I like the 'Random:' part, but if we could give it our own title, that might making the playlists easier to read.
I guess if you plan on releasing the source like you have with your other components, I will add this myself, but maybe other people would find this useful.

foo_random

Reply #8
When a track is playing it would be nice also that Right Click --> Properties provides with the properties of the currently playing track (not the query).

.... if this is feasible.



foo_random

Reply #11
foo_random updated for 0.9 RC 2006-03-11.


This is an awesome plug-in, and I'm totally psyched to be able to use a custom ratings-weighted shuffle. It looks like foo_random doesn't play especially well with playlist statistics or with audioscrobber. I imagine this is a pretty hard problem. Any insight into why this is the case, or suggested workarounds? It's not mission critical for me: this is a great bit of code and, as is, I really appreciate it.

stephen

foo_random

Reply #12
The problem is that foo_random adds an additional layer of indirection that obscures what track is playing to all components that are not aware of what foo_random does - which means virtually every component in existence. This obfuscation is an (unavoidable) side-effect and not a deliberate attempt to prevent these other components from working.

foo_random

Reply #13
Sorry for reviving an old topic.

Is there a way to make foo_random truly random?

That is, a query that make foo_random pick rnadomly from my whole database? I'm currently struggling to find a plugin that offers truly random playback qualities.

(foo_dbshuffle?  )

foo_random

Reply #14
You just need to devise a query that selects all songs, like "%path% IS *" or "NOT all IS golden".

foo_random

Reply #15
Aha, thank you. I will try it as soon as I finish processing the ReplayGains of my music collection.

LATER:

The component adds a decoder for URIs of the form
Code: [Select]
random:|query|
where query is a valid playlist generator query. The component provides a main menu command to add ("Playlist/Add randomized entry...") and a playlist context menu command to edit ("Edit randomized entries...") entries of this form. The context menu command replaces the existing entry with the new one. It is recommended that you use these commands to manipulate randomized entries instead of the "Add location..." command, as they also check that the query is syntactically valid.

I'm non-computer programming literate. What is a 'syntactically valid' query? Is there anywhere I could look to help me learn these queries? I'm struggling to find a query that defines a random playlist by genre, or another tag field.

The use of random: paths is limited to playback, i.e. you cannot use them with the Replaygain scanner or the converter. This is by design.

Could I ask why?


foo_random

Reply #17
Could you maybe offer a variable which indicates the number of matches of the query. Unlike Autoplaylists or search results, here we don't have information about the number of matches. I want to display it in panels.

 

foo_random

Reply #18
Another question: tracks played by foo_random do not update playback statistics data, as those tracks are not recognized as Media Library tracks. Can you change this?

foo_random

Reply #19
Can anyone explain why Queen's "You're my Best Friend" does not appear with this query?

"title HAS best friend"

It only plays two songs and neither have the words "best" or "friend" in them.

Thanks to anyone who can help.

-Brandon

foo_random

Reply #20
Could you maybe offer a variable which indicates the number of matches of the query. Unlike Autoplaylists or search results, here we don't have information about the number of matches. I want to display it in panels.
The benefit of having this information does not justify the development and runtime cost to provide it, which is quite significant.

Another question: tracks played by foo_random do not update playback statistics data, as those tracks are not recognized as Media Library tracks. Can you change this?
No. Effectively a randomized playlist entry is a radio station that plays tracks from your media library. It comes with the same limitations (w.r.t. playback statistics tracking) as a normal web radio station. See also post #13 in this thread.

Sorry for the late replies. Apparently I didn't get a notification for this topic.

Can anyone explain why Queen's "You're my Best Friend" does not appear with this query? ...
Have you tried this query in the media library search?
You can also try the plugin's built-in troubleshooting tool. In the context menu preferences, you have to add the command "Random Encounter" to your context menu. Now when you open the context menu for a single random entry, there will be a "Random Encounter" submenu that lists up to 10 matches for your query. If this submenu is missing, the plugin found no matches. In that case, the foobar2000 console will show an error message:
Quote
Failed to open random entry. No items left after applying filter: this IS an example

foo_random

Reply #21
Hello foosion,

here a short list of some issues i experienced with foo_random:

1. (an old one i mentioned over one year ago in the database search thread): "There is a little but annoying usability issue with foo_random: when choosing a query preset from the dropdown list you can't access the OK button as long as you don't add a space sign(f.e) to the query text)"

2. foo_random seems to have a conflict with two newer features of foobar core.
a) I typed "ALL" as query to get back an random entry of whole library but foo_random interpretes that as string "all"
b) Furthermore it also looks in fields that are not in the search restriction field in advanced preferences.

3. The seekbar doesn't work - on the other side you can seek in a playing track by "seek ahead by ..." command

foo_random

Reply #22
1. (an old one i mentioned over one year ago in the database search thread): "There is a little but annoying usability issue with foo_random: when choosing a query preset from the dropdown list you can't access the OK button as long as you don't add a space sign(f.e) to the query text)"
Reproduced. I will look into it, but please report such issues in the correct topic in the future.

2. foo_random seems to have a conflict with two newer features of foobar core.
a) I typed "ALL" as query to get back an random entry of whole library but foo_random interpretes that as string "all"
b) Furthermore it also looks in fields that are not in the search restriction field in advanced preferences.
I can't reproduce this with the latest version from my website (currently 1.2.3) and foobar2000 0.9.6.8.

Edit: I'll have to try this when I'm back home. The media library on my laptop only contains songs in "C:\Documents and Settings\All users\...".

3. The seekbar doesn't work - on the other side you can seek in a playing track by "seek ahead by ..." command
Known/won't fix. This is due to how foo_random works.

foo_random

Reply #23
foo_random 1.3.0

Changes:
  • Fixed usability issue in GUI.
  • The component now uses the standard search filter API. New filter expressions - including ALL - will work now.
  • The entries in the "Random Encounter" context menu submenu start playback of the specified song. This is equivalent to using the built-in "Play" context menu command on a song.

foo_random

Reply #24
I'm totally psyched to be able to use a custom ratings-weighted shuffle.
How can this be attained?  I've been trying to find a way to do ratings-weighted random but it seems that the method people have previously used, utilizing foo_skip, does not work anymore.  Is using foo_random the only current option?  If so, I'm unsure how to make a playlist generator query that works to achieve ratings-weighted random unless rand() will work with this plugin.  But I thought rand() doesn't currently work in most situations.

Also, foosion, can I assume from the fact that you had to design foo_random the way you did (as a kind of channel) that there's no way currently to add playlist order options or modify the behavior of those that exist?  I'm unsure if I can live with the understandably necessary limitations that foo_random imposes such as limited compatibility with functionality and other plugins that I like (such as audioscrobbler and the seek bar).  I was going to look into writing a plugin to do what I wanted, but if someone as experienced as yourself found this the best option I'm guessing what I want to do is currently impossible.

Thank you.