I don't have to think about these results.
It would be up to you to tell us why you think that each of the results is invalid.
The best way would be to say whether the first part or the second part of the condition is ture for each file.
OK, that makes sense when just discussing logic theory yet still don't get how mp3tag does it. A track contain any of the specified NOT genre expressions shouldn't show yet I still seem them in the results.
Eg using (NOT genre HAS "noise") OR (NOT genre HAS "Instrumental")
The AND version seems to work though.
My earlier reply shows more focused screenshots.
... and so does "OR". The result is plausible, correct and valid.
OK so here's my understanding:
- The first screenshot is showing 'Ah Yeah' because it evaluated true for the "noise" part of the expressions
-- And it's showing 'All Aboard' cos that evaluated true for the "instrumental" part of the expression
-- The 'Bootcamp' song isn't showing cos it evaluated false for both parts of the expression
Using multiple expressions is like doing several little calculations that come together.
- Then the AND version only shows 'Dance' because it evaluated true for both expressions
-- The other tracks couldn't because they evaluated false for atleast one of the tags
EDIT: I think I'm understanding it but struggling to put into words just yet. Will sleep on it again ![]()
So now thinking about it, what use are the OR expressions for? Seems like AND is the way to go when trying to filter out genres.
EDIT: Think I initially thought AND looks for exact matches like genre tag must "noise, instrumental' for (NOT genre HAS "Noise") AND (NOT genre HAS “Instrumental”) to match; so "noise, big synth, instrumental' won't match the aforementioned expression.
You need to look at what those expressions mean.
AND is true only if ALL applied conditions are met
OR is true if ANY (one or more) of the conditions are met
Yes, the AND version is what you want. Not sure how we can better explain it, you have gotten multiple explanations now. Maybe another angle ![]()
So let's turn this around and you want to list all songs that have any of "noise" or "instrumental" as genre. That's
(genre HAS "noise") OR (genre HAS "instrumental")
That's clear, right?
Now we negate this, you want to select all other tracks that don't fit the above. The straight forward way is negating the entire expression:
NOT ((genre HAS "noise") OR (genre HAS "instrumental"))
This actually should do what you want, give you all tracks that have neither noise nor instrumental as genre. Maybe you should use this expression if the OR syntax is easier to grasp for you.
Now if we want to we can move the NOT into the parantheses, but then we need to switch the OR for an AND (*):
(NOT genre HAS "noise") AND (NOT genre HAS "instrumental")
That's exactly equivalent to the previous expression.
Now the OR expression you used originally is something completely different, it only excludes tracks that have all genres set. We can see this if we apply the transformation of pulling the NOT out, in that case we need to change the OR to an AND. So
(NOT genre HAS "noise") OR (NOT genre HAS "instrumental")
is exactly equivalent to
NOT ((genre HAS "noise") AND (genre HAS "instrumental"))
You see, that selects only tracks that do not have both genres set.
(*) According to boolean logic NOT (A OR B) is equivalent to NOT A AND NOT B. This can be verified with a truth table.
This is definitely understandable and can be expanded with more expressions/genres! I can understand why AND is working now.
So the OR is the intersection bit of the venn diagram? The tracks that get listed have to have been true/existed in both (NOT genre HAS "noise") and (NOT genre HAS "instrumental")?
^^^ So the AND here is also combining two sets (ie. (NOT genre HAS "noise") and `(NOT genre HAS "instrumental") - not just intersection.
I think I'm getting to the point that I'll just take your word and wait for it to completely click lol.
No, it is enough that 1 condition results in "true", not both.
So why is a track with this genre tag (Melbourne Bounce; Instrumental) is showing in the result?
Is it because it does have "noise" thus True?
I'm even seeing tracks with just the "noise" tag showing-up in the results.
I get the formal logic explanation, I've done the maths to show how the results of AND and OR add-up. I'm just not getting what mp3tag is doing.
Maybe I need to look at this with fresh eyes some time. I'll stick with AND version we've discussed because it seems to be giving me the results I need.
It does NOT have noise as a genre, hence the first part of the expression is true.
If genres are melbourne bounce; instrumental:
NOT genre HAS "noise" => TRUE
NOT genre HAS "instrumental" => FALSE
TRUE OR FALSE => TRUE
If it would have genre set to melbourne bounce; instrumental; noise:
NOT genre HAS "noise" => FALSE
NOT genre HAS "instrumental" => FALSE
FALSE OR FALSE => FALSE
So only if it has both genres set the (NOT genre HAS "noise") OR (NOT genre HAS "instrumental") becomes FALSE.
I get the formal logic explanation, I've done the maths to show how the results of AND and OR add-up. I'm just not getting what mp3tag is doing.
It is doing the formal logic. I think it is the negation that is putting you off-path, it is sometimes difficult to wrap your head around.
Maybe look at some venn diagrams. If you say (genre HAS "noise") OR (genre HAS "instrumental") this means everything in the colored circles in the picture below:

If you negate the entire expression with NOT ((genre HAS "noise") OR (genre HAS "instrumental")) you get everything except what is in the circles (all the green part):

This is what you want to have.
Now let's disect what (NOT genre HAS "noise") OR (NOT genre HAS "instrumental") does. Let's look at only NOT genre HAS "noise" first:

All the colored parts are "NOT noise". This includes those with genre "instrumental" as long as they don't have noise. Likewise NOT genre HAS "instrumenatal":

Now a OR of the above gives you everything that is in NOT genre HAS "noise" or in NOT genre HAS "instrumenatal":

This is nearly everything except those songs that are both in the set of "instrumental" and in the set of "noise".
What you wanted is everything that is neither "noise" nor "instrumental, or in other words everything that is NOT noise AND NOT instrumental.
In formal logic this then becomes the expression (NOT genre HAS "noise") AND (NOT genre HAS "instrumental"):

And see, this is exactly the same diagram as for NOT ((genre HAS "noise") OR (genre HAS "instrumental")) ![]()
