Transform rating stars into values and vice versa

Hi
May I ask you if there is a regular expression with if ... than ...?
For example about ratings musicbee is used to rate 5 stars with the tag rating ->100 , 4.5 stars to 90 ,3 stats -> 60
while foobar2000 is used to tag 5 stars to rating tag -> 5 , 4 to 4 and 3 to 3
is there an action that can covert from musicbee to foobar2000 ratings values?
or does mp3tag need a script to do this job?
thanks

Please see the documentation on the popularimeter field - it is the same for all players that really look at the contents (a fair number of players does not care):

It would be best if you enter the real values according to standard in MP3tag and then see what your players makes of it.
For conversions, try an action of the type "Format value" for POPULARIMETER
Format string: $replace(%popularimeter%,255,*****,196,****,128,***,64,**,32,*)
(you would have to adapt the numeric values to the really used ones)

Hi
do you think could be used ?
$div(%rating%,20)
thanks

You would have to look at the data and see what each player likes.

If you have a look at the standard definiton, then the values range from 0 to 255 which resembles one of these magic binary numbers
5 stars would be 256, and bits set 1111 1111
4 stars would be 128 and bits set 1111 111
3 stars would be 64 and bits set 1111 11
2 stars would be 32 and bits set 1111 1
1 star every thing below it
But if your player interprets the numbers and stars in a different way - no problem.

At least there is one solution to convert MusicBee POPULARIMETER ratings into the respective values 0-10 in Mp3tag, because there are also half-star-ratings in MusicBee

1 Like

hi @LyricsLover @ohrenkino
in the link this code should do it
$ifgreater($regexp(%popularimeter%,.*\|(\d+)\|.*,$1),254,10,$ifgreater($regexp(%popularimeter%,.*\|(\d+)\|.*,$1),241,9,$ifgreater($regexp(%popularimeter%,.*\|(\d+)\|.*,$1),195,8,$ifgreater($regexp(%popularimeter%,.*\|(\d+)\|.*,$1),185,7,$ifgreater($regexp(%popularimeter%,.*\|(\d+)\|.*,$1),127,6,$ifgreater($regexp(%popularimeter%,.*\|(\d+)\|.*,$1),117,5,$ifgreater($regexp(%popularimeter%,.*\|(\d+)\|.*,$1),63,4,$ifgreater($regexp(%popularimeter%,.*\|(\d+)\|.*,$1),53,3,$ifgreater($regexp(%popularimeter%,.*\|(\d+)\|.*,$1),12,1,$ifgreater($regexp(%popularimeter%,.*\|(\d+)\|.*,$1),0,2,0))))))))))

can I ask you few questions?

  1. the code is only 1 string , i mean i have to copy all of them and paste all the code lines
  2. about the code there is
    (\d+)\|.*,$1),63,4,$ifgreater($regexp(%popularimeter%,.*\|
    I don't understand the 63 , 60 should be 3 stars
  3. but i don't understand where should I copy this code?

thanks
sadly i have searched it but i have not found the forum topic Support for MusicBee’s rating field II (popularimeter)

Is this the value you see in your files or has MusicBee changed (again) the stars and half-stars rating?
According to you:
What should be the value for MusicBee's:
1 star
1,5 stars
2 stars
2,5 stars
3 stars
3,5 stars
4 stars
and so on?

If you want to change the code permanently, use an action of the type "Format value" for POPULARIMETER
If you only want to see the values, paste it in the column definition as Value.

This is a comparison I found online for the different rating handling:


The different tagger and player all have different scalings.

You would have to ask the people at MusicBee and foobar2000 what values exactly they use currently for POPULARIMETER ratings. Both program codes are not Open Source, so we cannot check them ourselves.

hi @LyricsLover
the rating is

  1. 1 star -> 20
  2. 1 + 1/2 star -> 30
  3. 2 stars -> 40
  4. 2 +1/2 stars -> 50
  5. 3 stars -> 60
  6. 3 + 1/2 stars -> 70
  7. 4 stars -> 80
  8. 4 + 1/2 stars -> 90
  9. 5 stars ->100

the tag is his , might you please if i have pasted the screenshot correctly ?
thanks

1 Like

If you load the same song in Mp3tag and then press Alt + T on this song, what do you see in the Extended Tag view?
Could you please paste one more screenshot from Mp3tag's view?

hi @LyricsLover
yes there is a screenshot , the rating number are the same

I don't see why you think that this song was rated by MusicBee.

I just tested it by myself and rated 10 songs with MusicBee v3.5.8698P:

This is how MusicBee rated songs are looking in Mp3tag Extended Tag view:
image

and as new File List column POPULARIMETER:
image

In your file is no POPULARIMETER tag.
The RATE tag indicates that it is a mp4 file.

Nevertheless, you can customise the formula above to your 9 scales from 20 to 100. Just change the numbers in descending order accordingly and change the %popularimeter% to %rate%

I tried to repeat the star rating in foobar2000.
Unfortunately, a fresh installed foobar don't offer this star rating at my first sight.

If I manually enter a new tag called "Rating" under properties of a file, it will be written as POPM and "Windows Media Player 9 Series" into the file. Mp3tag is then showing RATING WMP
image

I have no idea how I could enter half star ratings in Foobar 2000.
Anyone?

This gets crazy: :exploding_head: :crazy_face:
If you load a MusicBee tagged song with 2½ Stars and see it in Mp3tag as
image

and then load it into Foobar2000 the POPULARIMETER tag will be shown
as <RATING> with a value of 3

In your file is no POPULARIMETER tag.
The RATE tag indicates that it is a
mp4 file.

Hi @LyricsLover
you are right , i guess on other file audio format , there is no rate tag outside mp4
there is a screenshot of musicbee rating
4 stars


4 +1/2 stars
image

and then load it into Foobar2000 the POPULARIMETER tag will be shown
as <RATING> with a value of 3

in foobar2000 there is not a 1/2 star

@ohrenkino @LyricsLover
May I know that kind of action should I use for all my audio file formats (mp3,aac/mp4,flac/and on)?
this for all audio files and outside mp4?
image

for the mp4 should I use for field RATE ?
thanks
appreciate your help a lot

Before you invest any further effort: are you sure that the player of your choice reads the tag field at all? E.g. iTunes ignores all ratings found in a file.

For best compatibility, I would alsways fill the raw values for POPULARIMETER (and switch on the option to show them)

Hi
I use musicbee and sometime foobar2000 ,both portable , and they should read the tag fields
I have aimp portable but I don't use it
will you use the action to convert stars and let musicbee and foobar2000 share the same rating?
thanks

This is something that you can find much more easily yourself: set a rating in each playere and see whether it appears in the other one.

And if these are decent players, then they read the field POPULARIMETER then they should be able to cope with fields in the standard format (and not only in their proprietary one).
This could also be tested best in your environment.
If oyu find that both players can cope with the standard format for ratings but they cannot deal with the individual format of the other player, then it would probably be best to use a program that writes a compatible format.

@ohrenkino @LyricsLover
Hi
1)
so if I want to make some tests ,should I use the action with screenshot and copy all the code for all the media outside mp4/AAC?

for aac should I change the code from
$ifgreater($regexp(%popularimeter%,.*\|
to
$ifgreater($regexp(%RATE%,.*\|
or
$ifgreater($regexp(%RATING%,.*\|
?

  1. but can a mp3tag .src script do the job ?and can a .src distinguish all audio file format from mp4/aac?

thanks

AFAIK MP3tag writes the correct fields for each format.
In MP3tag I would use only POPULARIMETER for all file types.

As this whole topic takes a lot of effort - is it really worth it?
I don't know now many files you want to classify ... but just a calculated example:
There are users that talk about collections with more than 20,000 files.
If you have 5 stars and the categories are distirbuted evenly, you get 4,000 files per category.
If one goes one step further and say that 1 star means "too bad to be kept", then these files would be deleted - which in return means that there would not be any files with 1 star, so there are only 4 categories left.
But in any case - if you have 4,000 files in the best category ... does this really help?
Or would a playlist for a dedicted purpose be of a much higher value?
I do not think that the stars represent an absolute scale but that the categories are relative for a specific purpose. And that would mean for me that the any effort spent on the rating tag is questionable.
Or in short: I would create playlists.
But, of course, this is a very individual decision.