I want to hide all tracks that contain either Noise OR Big Synth in the genre tag (semicolon delimitered), however I'm finding that using AND is giving results instead of OR, which seems to make more sense because I don't just want genre tags that contain both. This is the expression: (NOT genre HAS "noise") OR (NOT genre HAS "Big Synth")
And the AND version:
(NOT genre HAS "noise") AND (NOT genre HAS "Big Synth")
Total tracks, unfiltered: 577
Using OR expression gives me 575
When using AND expression: 413
I guess the AND version is giving correct results yet I don't understand how. I have also read the Filter Syntax docs.
a question about logic.
NOT genre HAS "noise" gives you all files without "noise" (which includes "Big Synth")
NOT genre HAS "Big Synth" gives you all files without "Big Synth (which includes "noise")
And as you link them with OR, you should get all files where either condition becomes true - you seem to have 2 files in which both genres appear.
If you link the 2 conditions with AND then both conditions have to be true so as soon as you find either "noise" or "Big Synth" in genre then that file is not displayed.
Reading the formal logic makes sense but not when applied to mp3tag. Here's what I've calculated in the hopes that I can be shown the obvious!
Total = 577
(genre HAS "Noise") = 97
(genre HAS "Big Synth") = 69
(genre HAS "Noise") OR (genre HAS "Big Synth") = 164 (577 - 164 = 413)
(genre HAS "Noise") AND (genre HAS "Big Synth") = 2 (577 - 2 = 575)
^^^ These seem to add-up.
Flipping the logic adds up too:
(NOT genre HAS "Noise") = 480 (480 + 97 = 577)
(NOT genre HAS "Big Synth") = 508 (508 + 69 = 577)
And the final piece:
(NOT genre HAS "Noise") OR (NOT genre HAS "Big Synth") = 575 (577 - 575 = 2)
(NOT genre HAS "Noise") AND (NOT genre HAS "Big Synth") = 413 (577 - 413 = 164
Random examples of track genres:
Big Room; Mainstage; Instrumental; Noise
Big Synth; Instrumental
Bounce; Electro House
^^^ So I only expect the third track to appear in the result of a (NOT genre HAS "Noise") OR (NOT genre HAS "Big Synth") search.
And only the fourth track to appear when searching `
Maybe I'm over thinking things so missing the obvious. I think I'm not getting how the two expressions in (NOT genre HAS "Noise") OR (NOT genre HAS "Big Synth") are merging results. Trying to picture a venn diagram in my head.
I guess I could just blindly use the AND version ((NOT genre HAS "Noise") AND (NOT genre HAS "Big Synth") ) yet I prefer to understand what's happening for accuracy and learning!
The following tracks should show because:
1: yes, as it does not have "Big Synth"
2: yes, because it does not have "noise"
3: yes, because it does not have "Big Synth" and does not have "Noise"
4: yes, because it does not have "Big Synth"
Have you tried NOT (%genre% HAS "Noise" OR %genre% HAS "Big Synth")
OK, so I think I'm understanding what mp3tag is doing regarding the above example. Each expression within the parentheses generates its own 'true' list, then they're combined as one big list at the end with the OR part?
Looks like only the first genre is getting filtered. I suspected this too with the earlier example expressions.
Getting same results with this: NOT (%genre% HAS "Noise")
If the first expression already leads to the result true, then the whole expression is true as you combined it with "OR".
Believe me: MP3tag filters correctly.
It would be up to you to create a suitable test environment to deepen your understanding.
If Mp3tag does not show the results that you expected then check why your expectation and the result does not match.
I have used some pretty complex filters in the past to drill down a library of ~25k files to exactly what I was looking for. Standard logic always applies, although often it can seem counter to what we may say in conversation. The more complex the filter, the more accurate you need to be with the terminology. But I can definitely confirm through positive experience that mp3tag applies the filter syntax as it should for all of the operators.
A word of caution in some more complex cases - if any of the fields you are filtering have some of the protected use characters (like $ or %) you have to enclose that operation in double quotation marks. Out of habit I do this most of the time, as there is always a possibility that these characters can exist.
There are tons of websites that have examples of logic. All the fun details specific to how mp3tag uses filters that @ohrenkino mentioned previously here applies in all cases.
As said above the behavior you see is expected and correct.
(NOT genre HAS "noise") OR (NOT genre HAS "Big Synth")
This finds all tracks that either miss the genre "noise" OR "big synth", as long as one or both of these are missing it's matched. Only for the two tracks that have both genres both the left and right part of the condition is false, and false or false is false.
(NOT genre HAS "noise") AND (NOT genre HAS "Big Synth")
This matches all tracks that miss both the genre "noise" AND "big synth". So this is what you want.
OK, I woke up in the night thinking I understand what's happening. The OR version stops evaluating the other expressions when the first one is true. Then the AND version means the track cannot have any of the genre tag (eg. noise, big synth, instrumental) but it doesn't mean it must not contain all three to evaluate as true.
That is false.
Your problem is the "OR".
Any assembly of conditions joined with OR gets as overall result "true" as soon as 1 of the conditions is "true".
MP3tag does not "stop" evaluating - you only see the overall result..