Announcement

Collapse
No announcement yet.

Write ratings into files

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Write ratings into files

    unfortunately i no longer can as my subsequent post shows, however i am gratified to see the head cheese respond to my post!

    Mr.Allison, please, PLEASE consider supporting reading and writing ratings/POPM to the tags in a file. i BEG you.

    it would tremendously lesson the frustrations when things go wrong, as they have here, (b/c all the rating info in the winamp db is now lost).

    what say you?

    thank you.

    [Edit > Mod] Thread was split, it isn't Winamp 5.57 related and it's worth to get an own thread.
    PENN STATE Radio or http://www.LION-Radio.org/
    --
    BUG #1 = Winamp skips short tracks
    Wish #1 = Multiple Column Sorting
    Wish #2 = Add TCMP/Compilation editing

  • #2
    Originally posted by MrSinatra
    unfortunately i no longer can as my subsequent post shows, however i am gratified to see the head cheese respond to my post!

    Mr.Allison, please, PLEASE consider supporting reading and writing ratings/POPM to the tags in a file. i BEG you.

    it would tremendously lesson the frustrations when things go wrong, as they have here, (b/c all the rating info in the winamp db is now lost).

    what say you?

    thank you.
    Here you go, drop these into winamp plugins folder. it'll overwrite ml_local and in_mp3. Final implementation (for 5.58) will likely have some small changes, mainly an option to turn it on/off. Only supports MP3 right now, I'll finish up the other file formats after some sleep.

    Note: For use with Winamp 5.57 only!

    [EDIT1: Jan 2010 / EDIT2: Oct 2010]

    Attachments were lost in forum upgrade, Mar 2010.
    Just use latest versions of in_mp3.dll & ml_local.dll
    as included with very latest version of Winamp (eg. 5.59 beta or newer).

    ----------

    Comment


    • #3
      Originally posted by Benski
      Here you go, drop these into winamp plugins folder. it'll overwrite ml_local and in_mp3. Final implementation (for 5.58) will likely have some small changes, mainly an option to turn it on/off. Only supports MP3 right now, I'll finish up the other file formats after some sleep.

      Wow. Amazing! This is not a feature that I use or care about. But I want to really send my appreciation to Benski, all the devs and the people who work to make winamp the quality program it is. To think that you can mention something and someone will just say here you go deserves something more than what I can post on these boards. Unfortunately, I have no money so I cant give you that either.

      Comment


      • #4
        Dear Mr.Allison,

        i am in awe. i want to thank you for your extraordinarily kind and prompt response, and for actually making my number one winamp wish come true!

        i'm just floored, shock and awe!

        i've always loved winamp, but its gone to a whole new level now.

        if you don't mind, can you please shed some light on how POPM is implemented? for example, does it use the 0-255 scale? is it compatible with WMP? (i hate WMP, just curious on that)

        i assume it reads from and writes to tags, but if someone already has ratings in the DB, but not their tags, what happens? do their db ratings get wiped out? or do they persist, and can they then apply them to the tags?

        anyway, i can't wait to try this out! let me know if i can help in any way!

        thx again!
        PENN STATE Radio or http://www.LION-Radio.org/
        --
        BUG #1 = Winamp skips short tracks
        Wish #1 = Multiple Column Sorting
        Wish #2 = Add TCMP/Compilation editing

        Comment


        • #5
          Originally posted by MrSinatra
          Dear Mr.Allison,

          i am in awe. i want to thank you for your extraordinarily kind and prompt response, and for actually making my number one winamp wish come true!

          i'm just floored, shock and awe!

          i've always loved winamp, but its gone to a whole new level now.

          if you don't mind, can you please shed some light on how POPM is implemented? for example, does it use the 0-255 scale? is it compatible with WMP? (i hate WMP, just curious on that)

          i assume it reads from and writes to tags, but if someone already has ratings in the DB, but not their tags, what happens? do their db ratings get wiped out? or do they persist, and can they then apply them to the tags?

          anyway, i can't wait to try this out! let me know if i can help in any way!

          thx again!
          I made it just use 1-5. I'm not sure how WMP writes its stuff, if it's 1-255 it should be easy to convert (just multiply by 51). Let me check out what it does and adjust accordingly. Winamp is using the e-mail address field of the POPM field, but that's another thing I could easily change for better compatibility.

          The media library will attempt to read the rating out of the tags when importing music and also when right-clicking and selecting "read metadata on selected items.

          Comment


          • #6
            Originally posted by Benski
            I made it just use 1-5. I'm not sure how WMP writes its stuff, if it's 1-255 it should be easy to convert (just multiply by 51). Let me check out what it does and adjust accordingly. Winamp is using the e-mail address field of the POPM field, but that's another thing I could easily change for better compatibility.
            when you say it uses the email feature, how does it do that? does it use the email addy given when one installs winamp? would that support multiple windows OS login profiles?

            here is some info that should help you implement the feature:



            Official website for MusicBrainz Picard, a cross-platform music tagger written in Python.


            http://id3.org/id3v2.3.0 (search popm to see)

            4.18. Popularimeter
            The purpose of this frame is to specify how good an audio file is. Many interesting applications could be found to this frame such as a playlist that features better audiofiles more often than others or it could be used to profile a person's taste and find other 'good' files by comparing people's profiles. The frame is very simple. It contains the email address to the user, one rating byte and a four byte play counter, intended to be increased with one for every time the file is played. The email is a terminated string. The rating is 1-255 where 1 is worst and 255 is best. 0 is unknown. If no personal counter is wanted it may be omitted. When the counter reaches all one's, one byte is inserted in front of the counter thus making the counter eight bits bigger in the same away as the play counter ("PCNT"). There may be more than one "POPM" frame in each tag, but only one with the same email address.

            <Header for 'Popularimeter', ID: "POPM">
            Email to user <text string> $00
            Rating $xx
            Counter $xx xx xx xx (xx ...)
            and "erland" is a brilliant programmer with lots of exp with handling tags and ratings:



            that thread is loaded with great info from erland, (you can skim the parts of me and phil going back n forth)

            Originally posted by Benski
            The media library will attempt to read the rating out of the tags when importing music and also when right-clicking and selecting "read metadata on selected items.
            ok, but what if a user already has ratings in the winamp db? can they apply them to a files tag, even if the file has no pre-existing POPM frame?

            and what if you have a db rating set, but rescan a file with no rating or frame? will it null out whats pre-existing in the db?
            PENN STATE Radio or http://www.LION-Radio.org/
            --
            BUG #1 = Winamp skips short tracks
            Wish #1 = Multiple Column Sorting
            Wish #2 = Add TCMP/Compilation editing

            Comment


            • #7
              Thread got split from the 5.57 release thread since it's unrelated.

              E-mail will get written as "[email protected]" (hardcoded string) just to differentiate. If an existing POPM field is present, it will update that one and leave the e-mail alone. I can probably use the contents e-mail field to differentiate different programs which use different scales, as most write an application name in there.

              I'd be hesistant about writing any user-identifiable information into the tag, although maybe an MD5 hash of the windows user name could work?

              If updating/rescanning a DB, the rating will only get picked up from the file if it's present. If it's not in the file's tag, the DB will be left alone.

              As for writing the ratings to files when you have an existing database, perhaps some sort of bulk "write database information permanently to file" available from the right-click menu could work.

              Comment


              • #8
                Originally posted by Benski
                Here you go, drop these into winamp plugins folder. it'll overwrite ml_local and in_mp3. Final implementation (for 5.58) will likely have some small changes, mainly an option to turn it on/off. Only supports MP3 right now, I'll finish up the other file formats after some sleep.
                After installing these 2 dll files Winamp doesnt start up anymore and tells me that it needs nsutil.dll (and after clicking ok it crashes!)

                Comment


                • #9
                  Originally posted by Psygnosis2097
                  After installing these 2 dll files Winamp doesnt start up anymore and tells me that it needs nsutil.dll (and after clicking ok it crashes!)
                  It needs to be installed over 5.57

                  Comment


                  • #10
                    Originally posted by Benski
                    E-mail will get written as "[email protected]" (hardcoded string) just to differentiate. If an existing POPM field is present, it will update that one and leave the e-mail alone. I can probably use the contents e-mail field to differentiate different programs which use different scales, as most write an application name in there.
                    are you talking about multiple POPM frames in a given file? or are you talking about setting multiple values for different apps in one frame using email addys?

                    also, isn't the email addy part of POPM for distinguishing multiple users, not apps? (i'm not sure other apps respect multiple frames or using differing emails)

                    did you read the links i posted? the thread at slim devices with erland really is chock full of good technical info which might save you a lot of time looking for the answers.

                    i think one of the goals here should be to set a "marketplace de facto standard" and if you, WMP, and MM all were compatible with how you implemented POPM i think other apps would eventually fall in line. (like how TPE2 became "Album Artist")

                    Originally posted by Benski
                    I'd be hesistant about writing any user-identifiable information into the tag, although maybe an MD5 hash of the windows user name could work?
                    i do know what a MD5 hash is, and that sounds smart, but i have to confess, i might sound like i know what i am talking about, but to some degree i really don't. i'm not knowledgable enough to answer the best way to handle this, but i do think it would be good if there was a way to let users have different ratings on the same file.

                    i thought thats what the email part of the POPM spec was for?

                    but there may not be a reasonable way to handle that, nor one any other app would respect. i also don't know to what degree windows profiles would matter, since the music files could be on USB drives and moved from computer to computer easily.

                    and finally, maybe its not even a worthwhile goal to try to distinguish ratings by user, as it may just lead to confusion about whats in the tag, esp if different apps handle the info differently.

                    Originally posted by Benski
                    If updating/rescanning a DB, the rating will only get picked up from the file if it's present. If it's not in the file's tag, the DB will be left alone.
                    what if the frame is there, but is null, has no value?

                    Originally posted by Benski
                    As for writing the ratings to files when you have an existing database, perhaps some sort of bulk "write database information permanently to file" available from the right-click menu could work.
                    perhaps this idea sounds too big, but i think you can use it to some degree:

                    i think winamp needs a "sync" feature. it basically would do what you described above, however it would be bi-directional.

                    so, you could:

                    1. "sync" your files tags to reflect whats in the DB
                    or
                    2. "sync" your DB to reflect whats in the files tags

                    i know other apps take this to the extreme, like MM will get all the tags and art, embedded or not, for all files and mirror it in the MM db. at that point you could strip/delete all the tags and art from the files and folders using mp3tag, and it wouldn't matter, b/c you could fix it all back up like it was originally by "sync'ing" the MM db back onto the files/folders and their tags.

                    that may be too grand for this particular purpose though. i would suggest some kind of way to "Write winamp DB info to your files tags" and the more specific "Write winamp DB ratings to your files tags"

                    (and btw, a function to rename files actual filenames to reflect whats in the tags/db would be cool too)

                    ***

                    once again, i want to thank you, and look forward to trying out updated POPM.zip files as you post them!

                    thanks!
                    Last edited by MrSinatra; 18 December 2009, 20:46.
                    PENN STATE Radio or http://www.LION-Radio.org/
                    --
                    BUG #1 = Winamp skips short tracks
                    Wish #1 = Multiple Column Sorting
                    Wish #2 = Add TCMP/Compilation editing

                    Comment


                    • #11
                      How do these 2 new files work? Are all the current ratings stored in the file (so even if I move it, Winamp will remember the rating)? Or does it only apply to new files that I give a certain rating?

                      I have over 50 000 rated files so this would be very useful to me

                      Thanks a lot for the hard work Benski and the whole Winamp dev. team!

                      Comment


                      • #12
                        Would be nice to know if only new ratings are stored to the mp3s tags. Or do the old ratings from the database get written to the Mp3s tags at Winamp startup. If so, is there a way to check it?

                        Greetings,
                        Marcel

                        Comment


                        • #13
                          Originally posted by DJ Egg
                          @Mr Sinatra

                          The POPM frame stuff (in_mp3 & ml_local) that Benski posted in your thread was included in 5.572

                          However, we didn't document it, because it's a work in progress.

                          We disabled it by default, and to enable it you need to manually set:

                          writeratings=1

                          in gen_ml.ini


                          So... the newer ml_local.dll fixes two 5.57-specific bugs related to ratings:

                          1. Rating is lost when updating mp3 file info

                          ie. rate a file in winamp, then view File Info (Alt+3) for that file,
                          click 'Update'
                          and the rating you just set is gone.


                          2. When writeratings=1 is set in gen_ml.ini, m4a files temporarily lose metadata & format info when you rate them.

                          ie. add an album of m4a files to the playlist,
                          rate the first track,
                          then try to play it - and notice how it skips to the next track.
                          If you view File Info for that 1st track, the metadata & format info are empty.
                          However, when you rate track 2, then track 1 becomes playable again,
                          and the metadata & format info return,
                          but then track 2 is affected by the bug instead.
                          The only way to fix it was to make a physical copy of the last track and rate that last.
                          Then all the album tracks were ok, and you could then close winamp and delete the copied file
                          (Windows wasn't letting you delete said file, because it was locked whilst Winamp was open).


                          The new ml_local fixes all that. [EDIT: find it here:]

                          Did you find a bug in Winamp? Can you reproduce it? Let us know, we'll try to fix it as soon as possible!





                          The first bug occurred regardless of the writeratings setting, but was caused by the implementation of that feature.


                          Oh, and it also fixes the tabbing order of Director & Producer in the Edit Selected Items (Ctrl+E) dialog.



                          Re: "what if the ML already has ratings? which takes precedence? what scale is being used to represent the ratings? 0-255?"

                          Well, if you've already rated an mp3 in Winamp before the popm feature was implemented/enabled,
                          then the rating will only be stored in the ML database.

                          If you rate it again in Winamp, then both the mldb entry and id3v2 popm field will be updated,
                          so Winamp will then read the new value.

                          If you rate it externally with a program/app that writes ratings to the popm frame (ID3FID_POPULARIMETER),
                          then as with all things when edited externally,
                          you will need to refresh the metadata in the library for Winamp to be able to see it.

                          ie. Media Library -> Local Media view -> song(s) -> right-click -> Read metadata on selected items


                          Yes, we're using the WMP-style 0-255 scale for ID3FID_POPULARIMETER
                          (0,1,64,128,194,255)

                          Though I think we also look at/for ID3FN_RATING scale...
                          which I think is 1-10, and then divided by 2....

                          At the moment, I think we read popm 0-255, but write 1-5,
                          which is why currently, eg. a 1-5 star rating in Winamp only shows as 1 star in Windows, heh
                          (I guess this will need changing).



                          By the way, I strongly recommend that you DO NOT use Windows Explorer / WMP in Windows 7 to edit any tags whatsoever, including star Ratings, because it destroys custom TXXX frames such as Album Artist and ReplayGain:


                          That's a pretty bad bug in Win7, and I'm quite amazed that it hasn't been patched yet.
                          What is Winamp? Why is Winamp? How is Winamp? All these burning questions and issues discussed within.
                          Last edited by MrSinatra; 2 February 2010, 04:40.
                          PENN STATE Radio or http://www.LION-Radio.org/
                          --
                          BUG #1 = Winamp skips short tracks
                          Wish #1 = Multiple Column Sorting
                          Wish #2 = Add TCMP/Compilation editing

                          Comment


                          • #14
                            DJ Egg,

                            thanks for that reply! cleared up a lot of my confusion.

                            i understand that implementing ratings in tags is a work in progress, but i am curious as to how it is being planned to work?

                            i tried to outline and link to a lot of info and concerns above.

                            can you sketch out the plan? like compatibility with other apps, (like WMP, itunes, etc), and also how it will work when there are ratings in tags but not the ML, or vice versa?

                            finally, thx for the tip about not using windows explorer or WMP in win7... but does that tip apply ONLY to win7, or all windows versions?
                            PENN STATE Radio or http://www.LION-Radio.org/
                            --
                            BUG #1 = Winamp skips short tracks
                            Wish #1 = Multiple Column Sorting
                            Wish #2 = Add TCMP/Compilation editing

                            Comment


                            • #15
                              Hi

                              The plan is to make it work, and be friendly with other apps.

                              We plan to do it the official way, eg.
                              write mp3 ratings to id3v2 popm frame,
                              write ogg/flac ratings to rating in vorbis comments,
                              etc etc.

                              I've no idea about iTunes.
                              Does iTunes also write ratings to tags?

                              I think I already explained "how it will work when there are ratings in tags but not the ML, or vice versa", didn't I?

                              Re: but does that tip apply ONLY to win7, or all windows versions?

                              I'm not sure about Vista.
                              But WinXP isn't affected by it.
                              I think it's just a WMP12 bug...

                              Playlist | Twitter | Albums

                              Comment

                              Working...
                              X
                              😀
                              🥰
                              🤢
                              😎
                              😡
                              👍
                              👎