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_skip: skip tracks that match a specified search query (Read 330092 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

foo_skip: skip tracks that match a specified search query

Reply #425
@Pure_BY, You can use the next pattern to fine-tune the relation between the rating of the track and the chance of it to be played.

Code: [Select]
 (%rating% IS 0 AND "$mod($rand(),100)" GREATER 75) OR (%rating% IS 1 AND "$mod($rand(),100)" GREATER 25) OR (%rating% IS 2 AND "$mod($rand(),100)" GREATER 25) OR (%rating% IS 3 AND "$mod($rand(),100)" GREATER 75) OR (%rating% IS 4 AND "$mod($rand(),100)" GREATER 90)

Explanation : for example (%rating% IS 1 AND "$mod($rand(),100)" GREATER 25) means that if the track's rating is 1 then the chance for it to be played is 25%

If you totally don't want to play the rating 1 tracks replace the "rating 1 part" with (%rating% IS 1)

You can take the pattern and change the "weights" of all the "rating parts" as you personally want.


foo_skip: skip tracks that match a specified search query

Reply #426
Explanation : for example (%rating% IS 1 AND "$mod($rand(),100)" GREATER 25) means that if the track's rating is 1 then the chance for it to be played is 25%
If you totally don't want to play the rating 1 tracks replace the "rating 1 part" with (%rating% IS 1)
You can take the pattern and change the "weights" of all the "rating parts" as you personally want.

Wow, this is amazing! I never knew this was possible. Loved SkipTrack feature, however it was always a very 'hard measure'. I'm really an album listener, so sometimes I'd like to hear even the tracks which I dislike -- for the completeness.

I'll start with simple pattern: 0.2 chance for rating 1, 0.4 chance for rating 2. Will check how that works out, maybe I'll tweak it a little later.
Code: [Select]
(%rating% IS 1 AND "$mod($rand(),100)" GREATER 20) OR (%rating% IS 2 AND "$mod($rand(),100)" GREATER 40)

Any idea where I can find more info on such commands, etc.?

Big thanks for this great tip!


foo_skip: skip tracks that match a specified search query

Reply #428
Feature suggestion: I'd love to see the ability to use the contents of a playlist for foo skip's exclusion data.

Eg: create a playlist named 'Skip' then in the Skip Track preferences set the 'Skip' playlist as the exclusion list.

That makes it easier for users who use '1' ratings for tracks but don't want them to be skipped, while providing a simple method of excluding single tracks.

foo_skip: skip tracks that match a specified search query

Reply #429
I'd like to have a quick key that when pressed:
1) marks current song to be skipped in the future
2) goes to next track

How could I achieve this?

foo_skip: skip tracks that match a specified search query

Reply #430
^ File/Preferences/Keyboard shortcuts. You can only assign one command to one key therefore you will need two of them.

If you really want it on a single button, look into macros (lots of keyboard/mouse drivers provide these) or something like AutoHotkey which can simulate key presses for you.

foo_skip: skip tracks that match a specified search query

Reply #431
^ File/Preferences/Keyboard shortcuts. You can only assign one command to one key therefore you will need two of them.

If you really want it on a single button, look into macros (lots of keyboard/mouse drivers provide these) or something like AutoHotkey which can simulate key presses for you.

Ok, macro it is then

Do I need to enable ratings to make 'skip track' to work and how do I make keyshortcut for "set rating for current song to 1"

foo_skip: skip tracks that match a specified search query

Reply #432
Install something like foo_quicktag (and fiddle with its options), which will provide that command to be bindable on the keyboard preferences page.

foo_skip: skip tracks that match a specified search query

Reply #433
Thanks, works perfectly

Skipping if '%skip% IS TRUE'
Added 'Skip=SKIP' to the standard fields.
Global shortkey for 'set <SKIP> to TRUE'.
And macro that calls shortkey and next track.

Re: foo_skip: skip tracks that match a specified search query

Reply #434
Feature suggestion: I'd love to see the ability to use the contents of a playlist for foo skip's exclusion data.

Eg: create a playlist named 'Skip' then in the Skip Track preferences set the 'Skip' playlist as the exclusion list.

That makes it easier for users who use '1' ratings for tracks but don't want them to be skipped, while providing a simple method of excluding single tracks.

Bumping for feedback. @Case ?

Re: foo_skip: skip tracks that match a specified search query

Reply #435
I think you can use %playlist_name% to do that...

Code: [Select]
NOT %playlist_name% IS Skip AND %rating% IS 1

Re: foo_skip: skip tracks that match a specified search query

Reply #436
I think you can use %playlist_name% to do that...

Code: [Select]
NOT %playlist_name% IS Skip AND %rating% IS 1

Tested but doesn't appear to work. The track I tested was skipped because it was rated 1 star rather than because it was in a playlist named 'Skip'. Tried also:

Code: [Select]
%playlist_name% IS Skip

But this had the effect of not playing any tracks. Really would be useful to just be able to set a playlist of skippable tracks, and without the need to rate them.

Re: foo_skip: skip tracks that match a specified search query

Reply #437
Oh whoops, I read that completely wrong.

Re: foo_skip: skip tracks that match a specified search query

Reply #438
I think there's some confusion here.

From what I understand you want to create a playlist that will essentially serve as a blacklist (or whitelist) for tracks that you want to skip. In other words, you want contents of a specific playlist affect (the same) tracks in OTHER playlists.

The problem is foobar generally works on a track by track basis. %playlist_name% will return the name of the playlist you are playing the current song from. If you play the song directly from your 'Skip' playlist, it will return 'Skip'. But if you play the same song from another playlist, it will return something else and the foo_skip check will fail, even if the same track can also be found in the playlist 'Skip'. %playlist_name% does not list all occurrences the track has in other playlists, only the current one.

Which means what you are looking for can't be done with the tools we currently have.

Re: foo_skip: skip tracks that match a specified search query

Reply #439
I could probably script something to do it but the track changes may not be entirely seamless. I'll test and report back.

edit: I tried it and it was fine for me but YMMV.

Requires WSH panel mod or JScript panel. You can find the latter via the link in my signature.

Code: [Select]
var t = tracks_to_skip();

function on_playback_new_track() {
var handle = fb.GetNowPlaying();
if (!handle)
return;
var p = handle.Path.toLowerCase();
for (var i = 0; i < t.length; i++) {
if (t[i] == p)
return fb.Next();
}
}

function tracks_to_skip() {
var a = [];
for (var i = 0; i < plman.PlaylistCount; i++) {
if (playlist_name_is_skip(i)) {
var items = plman.GetPlaylistItems(i);
for (var j = 0; j < items.Count; j++) {
a.push(items.Item(j).Path.toLowerCase());
}
}
}
return a;
}

function playlist_name_is_skip(idx) {
return plman.GetPlaylistName(idx).toLowerCase() == "skip";
}

function on_playlist_items_added(p) {
if (playlist_name_is_skip(p))
t = tracks_to_skip();
}

function on_playlist_items_removed(p) {
if (playlist_name_is_skip(p))
t = tracks_to_skip();
}

Re: foo_skip: skip tracks that match a specified search query

Reply #440
I could probably script something to do it but the track changes may not be entirely seamless. I'll test and report back.

edit: I tried it and it was fine for me but YMMV.

Requires WSH panel mod or JScript panel. You can find the latter via the link in my signature.

THANK YOU! Really. Like Daeron described this is exactly what I was after, functionality wise.

Tested and seems to be working well. From what I can tell a panel has to be added permanently for the script to function?

Re: foo_skip: skip tracks that match a specified search query

Reply #441
Yes. If using columns UI, you can hide it on the layout tab in the preferences.

If using default UI, put it a tab or add this bit of code that colours the it the same as a splitter and then resize it as small as you can.

Code: [Select]
function on_paint(gr) {
    gr.FillSolidRect(0, 0, window.Width, window.Height, utils.GetSysColor(15));
}

Re: foo_skip: skip tracks that match a specified search query

Reply #442
hi
i've read this topic more than once, but didn't find the answer to my question
i've installed foo_skip and it function manually

can i define a function-key that stores "skip=1" as tag on the now playing track, if i push it
(the next time this track won't be played anymore)
if possible, how to make this

thx

Re: foo_skip: skip tracks that match a specified search query

Reply #443
Use foo_quicktag:
https://www.foobar2000.org/components/view/foo_quicktag

I'd bind a shortcut like so (just an example): 
CTRL+F1 to focus track
CTRL+F2 to set tag SKIP = 1

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

Re: foo_skip: skip tracks that match a specified search query

Reply #444
thx carpman for answering

ok, only with foo_skip there's no chance.

would be a nice feature (for now active track):
press funktion key --> if not skip-tag available, or skip-tag = 0, then SKIP=1
                       or   --> if skip-tag available, then delete skip-tag, or set SKIP=0


Re: foo_skip: skip tracks that match a specified search query

Reply #445
Not possible. You can only bind one action per key combination. Just use 2 keys and have a playlist column showing the current value so you know which button to press.

Re: foo_skip: skip tracks that match a specified search query

Reply #446
Hi,

I just found this useful component and installed it (1.9.7).
Thank you!

Now, after reading the whole 18 pages, I still have some questions...and feeling a bit dizzy... 8-)


1) first question/feature request:
after playing with this component and trying a lot of examples from the thread, I now have a cluttered pulldownmenu, filled with not working stuff.

(I'm old and I won't remember, which worked and which not...)

How can I delete wrong scripts/queries in the pulldown menu?

I have tried all combinations wtih alt/ctrl/shift+del/backspace, but with no success.

2) second question:
can anymone explain in simple words to me,
WHY
I need to use this string
Code: [Select]
("$meta(rating)" IS 1)
instead of
Code: [Select]
($meta(rating) IS 1)
or
Code: [Select]
"%rating% IS 1"
or
Code: [Select]
$meta(rating) IS 1
or
Code: [Select]
%rating% IS 1
?
I copied all those examples from this thread, and a lot of ppl here posting that one of the aboves are fine working for them, but I don't understand, why only the first one is working for me.


3) third question/feature request:
I have this little Collumns UI Collum Display Script
$if(%SKIP%,'['skip'] ')

which shows me, if a song has the %SKIP% tag. (Just to visually indicate, WHY that song won't play...)
When I change the skip-track-query from time to time, I need to change that script too (according to the new skip-track-query), which is ...something inconvenient.
Is there a way to kinda automate this?
Also, when the component should skip all songs with rating < 2 there is no way to visually indicate this in the playlist view?

Like, fetching the content of %skip-track-query% and putting it into my script in the Collumns UI Collum Display Script?

Any help would be very appreciated.

Re: foo_skip: skip tracks that match a specified search query

Reply #447
How can I delete wrong scripts/queries in the pulldown menu?
Shift+rightclick on the dropdown arrow/wipe history.

Why I need to use this string
Code: [Select]
("$meta(rating)" IS 1)
instead of
Code: [Select]
($meta(rating) IS 1)
There are two languages that you will commonly meet when using foobar. Titleformatting and query syntax. The former generally uses functions like $this(), the latter usually has capitalized words like %this text% HAS words. Both has pros and cons depending on what you are trying to do and not all parts of foobar may understand both of them.

Sometimes it's beneficial to try to mix the two. Maybe because it's shorter to "say" something in one or the other or only one language supports what you are trying to do in the first place. In the specific case of mixing titleformatting with query syntax, you have to tell foobar somehow that the code you just input should be interpreted as titleformatting as opposed to query syntax. To do so you enclose the code between " " characters.

Example query syntax:
%something% IS 1

Query syntax with titleformatting:
"$meta(rating)" IS 1

In which case foobar first solves the titleformatting part, which presumably returns a number between 1-5 (the rating), then that value is used to evaluate the query.

So halfway through foobar sees something like this (assuming the rating was 1):
1 IS 1

Which will evaluate true.

When I change the skip-track-query from time to time, I need to change that script too (according to the new skip-track-query), which is ...something inconvenient.
You'll have to change it manually.

Re: foo_skip: skip tracks that match a specified search query

Reply #448
This is a big help! Thank you very much! Really.

It took me some minutes to get the correct right-click, but then it worked. Tricky...only intuitive, when you know it :)

Re: foo_skip: skip tracks that match a specified search query

Reply #449
Epic plugin, thank you for a bang-up job. One minor feature request: would it be possible when "skip track" is bound to a toolbar button to make that button show as pressed when it's activated?
"Stop after current" for instance is highlighted when pressed. But only on Columns_UI for some reason.