Slashdot Mirror


More iTunes Math

markmcb writes "OmniNerd once again digs into the math behind iTunes. The 5-star ratings in iTunes are actually stored in a variable allowing values from 0 to 100, with 20 = 1-star, 40 = 2-star, etc. Known to few, if you set a rating to 30 (manually), it will show up as 1 1/2 stars in the program's GUI. Matt Schinckel provides interesting statistical evidence showing that not only do non-whole, non-half values (e.g., 47) not increase the amount a song will play, but neither do the half-star ratings (with the exception of .5 star)."

31 of 167 comments (clear)

  1. How does the Windows version work? by CyricZ · · Score: 2, Interesting

    Has anyone been able to replicate this behavior with the Windows version of iTunes? Is it built upon the same core as the Mac OS version, or does Apple have a separate implementation that may behave differently?

    --
    Cyric Zndovzny at your service.
  2. Re:How does it handle values outside the range? by frostilicus2 · · Score: 5, Interesting

    I've just tried this - If you insert a value outside the range, iTunes assumes the nearest value to 0, 20, 40, 60, 80, and 100 and doesn't crash.

    --
    Nothing sucks like a Vax, nothing blows like a PowerMac G4
  3. So it's basically fixed point math. by voxel · · Score: 2, Insightful

    So, 32 of 100 is simply 1.6 stars.

    Formula 32 / 20 = Number of stars.

    Wow. I don't see why this article is on slashdot, what am I missing?

    --
    Modesty is one of life's greatest attributes
    1. Re:So it's basically fixed point math. by flyingsquid · · Score: 5, Funny
      Wow. I don't see why this article is on slashdot, what am I missing?

      Whatever it is the editors were smoking.

    2. Re:So it's basically fixed point math. by CyricZ · · Score: 5, Funny

      I doubt they're smoking anything. And if they are, it's likely a substance that enhances one's journalistic abilities.

      This story has everything to do with what this site stands for. It directly involves Apple, mathematics, software design, software analysis, software realiability, and so forth.

      Remember, one of the traits of the true, traditional hacker was to experiment with systems in order to better understand them. That holds especially true of proprietary software systems, where the source code cannot be easily or readily viewed.

      Indeed, this is a very interesting story that should appeal perfectly to the general Slashdot audience.

      --
      Cyric Zndovzny at your service.
    3. Re:So it's basically fixed point math. by Profane+Motherfucker · · Score: 2

      Yeah, everyone in this thread seems to be in love with it.

    4. Re:So it's basically fixed point math. by nathanh · · Score: 5, Insightful
      This story has everything to do with what this site stands for. It directly involves Apple, mathematics, software design, software analysis, software realiability, and so forth.

      Indeed, this is a very interesting story that should appeal perfectly to the general Slashdot audience.

      The hacker audience who is interested in such things has been dwindling both in numbers and as a percentage. Now the "general Slashdot audience" prefers to fawn over the latest consumer product from Apple, to complain about Microsoft, or to inexpertly argue their "Rights Online".

      Articles about technology, impressive hacks, homebrew projects, science and mathematics would be extremely welcome. Unfortunately the editors are infatuated with content-free articles that are little more than advertisements for products like the PS3 and Xbox and iPod.

  4. Re:The beauty of AppleScript. by Anonymous Coward · · Score: 5, Funny

    "This shows the beauty of scripting systems like AppleScript. They allow you a level of interaction with a system that is hardly seen on Windows, and only vaguely available on UNIX."

    This shows the level of brainwashing only possibly seen in apple zealots.

  5. Re:The beauty of AppleScript. by slavemowgli · · Score: 4, Funny

    Goodness, just how many top-level comments can you post in a single discussion in rapid succession? It *is* possible to write more than one sentence in a comment, y'know. :)

    --
    quidquid latine dictum sit altum videtur.
  6. Re:The beauty of AppleScript. by gowmc · · Score: 2, Informative

    AppleScript really isn't a particularly great language. My understanding is that any OSA language can use AppleEvents, so all you need is something like this to talk to applications in something you are more used to:

    http://mail.python.org/pipermail/pythonmac-sig/200 1-August/004064.html

    --
    -- If it aint broke, fix it till it is. --
  7. closed source.. by GrAfFiT · · Score: 2, Interesting

    Interesting to see that what would just involve reading a few lines of code on open source software takes a whole complicated statistical analysis on closed source software...

  8. Obligatory by Errandboy+of+Doom · · Score: 5, Funny

    iTunes? Is anyone still using that old thing? I now exclusively use Songbird, even though it's still alpha.

    Tsk, and I thought this was Slashdot... bleeding edge, people!

    1. Re:Obligatory by dr.badass · · Score: 4, Funny

      iTunes? Is anyone still using that old thing? I now exclusively use Songbird

      I tried to install Songbird, but it just installed a buggy, broken and cluttered version of iTunes that didn't work with my iPod and had a farting bird for an icon. Does anyone know where the real installer is?

      --
      Don't become a regular here -- you will become retarded.
    2. Re:Obligatory by Queer+Boy · · Score: 2, Funny

      Yeah, you were modded funny because you're talking about Slashdot and bleeding edge when referring to a product that is currently Windows-only.

      --
      Not since Marie-Antoinette played milkmaid has looking simple and honest been so fake and complicated.
  9. Re:The beauty of AppleScript. by Jussi+K.+Kojootti · · Score: 2, Funny
    This shows the beauty of scripting systems like AppleScript. They allow you a level of interaction with a system that is hardly seen on Windows, and only vaguely available on UNIX.
    Come on, mods! Show your sense of humour and mod that insightful.
  10. Future considerations, perhaps? by CyricZ · · Score: 3, Insightful

    They could have just been leaving their options open for future expansion of the software. Indeed, it would be better for compatibility to already use the 0 to 100 range.

    Suppose in the future they added support for giving a song a percentage ranking. It's quite easy to do with the system they're using now. Data from the new software could be used with the old, as the old software is already expecting and can cope with a value in the 0 to 100 range, even if it does so slightly differently than the future versions.

    --
    Cyric Zndovzny at your service.
  11. why linear? by kavehkh · · Score: 5, Interesting

    Why is the rating system linear instead of exponential. I would like a song that has one more star than another to play TWICE more often.

    1. Re:why linear? by darkitecture · · Score: 2, Insightful

      Why is the rating system linear instead of exponential. I would like a song that has one more star than another to play TWICE more often.

      Man, do you really want your favorite song to play 32 times for every 0-star rated song you have on your iPod? I don't care how much you love a song, after listening to it that often, you're bound to want to stab your iPod in the face. Or the closest fan of The Cure. Come to think of it, that'd be a win-win situation.

    2. Re:why linear? by NeMon'ess · · Score: 2, Interesting

      I agree that the fixed settings suck. As a user actually comfortable operating a computer, unlike much of the market, I want advanced options that let me adjust how much more and less often I hear songs. So Party Shuffle isn't worth using to me.

      Instead I rate my tracks like I would a movie.
      1-star is probably going to get deleted eventually.
      2-stars play half as much as No-stars.
      No-stars play twice as much as 2-stars.
      3-stars play 3 times as much as 2-stars.
      4-stars play 4 times as much as 2-stars.
      5-stars play 6 times as much as 2-stars.

      Then I make an enormous playlist containing 1 play of 2-star songs, 2 plays of No-star songs... and 6 plays of 5-star songs, shuffle them, and save the result in a new playlist. Takes between 3 and 5 months to go through the list.

  12. Re:Is it really surprising? by CyricZ · · Score: 5, Informative

    Yes, it's interesting. If you find such topics boring, then perhaps you shouldn't be reading Slashdot. I'm sure you'll find reading material more entertaining and suitable for lower intelligence level at Disney.com.

    Many people who read this site care about issues like this. We find it interesting to experiment with software systems, especially those which we do not have direct access to the source code of. It's fun to see how a consumer-grade application reacts to unexpected data, for instance.

    He could have decompiled the application. But doing so would likely have been in violation of the licensing agreement he agreed to before using said software. You may question the legality of such agreements, but he may not have wanted to take the risk of publishing his findings. Litigation is expensive, after all.

    Not only that, but it's quite difficult to decompile a program written in C, C++ or Objective-C. That's especially true when you're dealing with an optimized program. It often isn't obvious what a particular chunk of assembly code is doing, and thus is basically useless for such analysis.

    --
    Cyric Zndovzny at your service.
  13. In a spirit of non-Disneyness... by Expert+Determination · · Score: 2, Insightful
    ...I could announce that in the Palm ebook reader, eReader's PalmReader, you can uncover the markup used to format the text even though it isn't directly visible. You can do this by using the search facility to search for markup tokens from the "Peanut Markup Language" used. Curiously it skips the escape character ('\') and the first letter of each markup symbol, as if the original authors expected all markup symbols to be one character long. The markup also includes the filenames of included images which are stored in .png format. So you can search for images in an eReader ebook by searching for the string ".png". I discovered this by disassembling the executable - not by trial and error in the application. I think this was a much more interesting bit of sleuthing than this trivial iTunes one and wish it would get published on slashdot.

    On the other hand, even I think this is too boring to tell other people.

    --
    "The White House is not an intelligence-gathering agency," -- Scott McClellan, Whitehouse spokesman.
  14. Re:The beauty of AppleScript. by Dorceon · · Score: 2, Informative
    You can do all of this through the iTunes COM interface, which is accessible to VBS, and also any compiled application.
    var iTunesApp = WScript.CreateObject("iTunes.Application");
    var mainLibrary = iTunesApp.LibraryPlaylist;
    var tracks = mainLibrary.Tracks;
    var numTracks = tracks.Count;
    var time_secs = 0;

    for (i = 1; i <= numTracks; i++)
    {
    var currTrack = tracks.Item(i);
    var track_end = currTrack.Finish;
    var track_start = currTrack.Start;
    var track_dur = track_end - track_start;
    var track_time = currTrack.PlayedCount * track_dur;
    time_secs += track_time;
    }

    WScript.Echo("You've spent " + Math.floor(time_secs / (3600*24)) + " days " + Math.floor((time_secs / 3600) % 24) + " hours " + Math.floor((time_secs / 60) % 60) + " minutes " + Math.floor(time_secs % 60) + " seconds listening to iTunes. (" + time_secs + " seconds total.)");
    According to this, iTunes has been playing for ~29.5 days since my hard drive crash about a year ago. This is what I get for having a Scheduled Task (think cron job) run a VBS that uses COM to start iTunes as my alarm clock. (Item is 1-indexed, which is probably simpler for non-coders; subtracting the start time from the end time instead of using Length makes sure it doesn't count space that isn't part of the song, such as most of The Wonderful Future by Our Lady Peace, which has abour 13 minutes of empty space between the end of the song and Ray Kurzweil reading a long excerpt from his "The Age of Spiritual Machines".)
    --
    What sound do people on rollercoasters make? Hint: it's not Xbox 360.
  15. Re:How does it handle values outside the range? by Eccles · · Score: 3, Informative

    Carbon applications are usually written in Objective C.

    No they aren't. I'm a professional programmer for a Mac (and PC) program using the Carbon interface for Macs. As Wikipedia says, "Carbon is more versatile in that it may be accessed using C, C++, Pascal, Ada, or any other language with suitable interface headers, whereas Cocoa exclusively uses Objective C and Java." Most cross-platform apps use Carbon because Objective-C isn't widely used on PCs.

    --
    Ooh, a sarcasm detector. Oh, that's a real useful invention.
  16. Re:The beauty of AppleScript. by MrNonchalant · · Score: 3, Funny

    And you'll note all of those posts contain something like "Apple really understands how to do integrated systems right" or "iTunes is realy what we should be looking at as a shining example of desktop consumer software." I would buy an Apple if only I didn't have to become one of them.

  17. Re:Endnote #20 by tom6a · · Score: 2, Informative

    Brandon answered the question in the article comments, "Assuming no time between tracks, the test ran for about 15.41 minutes (924.81 seconds)." (See http://www.omninerd.com/2006/02/11/news/530)

  18. Smart Shuffle might have something to do with it by theurge14 · · Score: 2, Insightful

    In the current Windows version of iTunes (6.0.2.23), in Preferences there is a tab for Playback. And in there is a section for Smart Shuffle.

    The first control is a 3-setting slider for "more likely, random, less likely". The description below says "Smart shuffle allows you to control how likely you are to hear multiple songs in a row by the same artist or from the same album."

    Below that are three radio boxes, labled Shuffle: ( ) Songs ( ) Albums ( ) Groupings.

    Is it possible that this 100 scale rating system might be more fine grained to take these Smart Shuffle user settings into account? Perhaps that might be why it isn't simply the integers 0-5. /didnt rtfa

  19. Re:I'm just saying this... by Lisandro · · Score: 2, Insightful

    Why troll? He's damn right. Why how iTunes calculates ratings is considered a story? Why is it presented as "math", like it's advanced calculus? And why the hell is this on the science section?

  20. Basically the same... by Otto · · Score: 2, Informative

    You can do half star ratings in iTunes for Windows as well. Works exactly the same way.

    Scripts to do it can be found here: http://ottodestruct.com/blog/category/geekery/prog rammery/

    --
    - Give a man a fire and he's warm for a day, but set him on fire and he's warm for the rest of his life.
  21. Negative towards iTunes? by rodm13 · · Score: 2, Funny

    "that not only do non-whole, non-half values (e.g., 47) not increase the amount a song will play, but neither do the half-star ratings (with the exception of .5 star)."


    I know this article is about DRM-filled software, but do we really have to be this negative towards it?

    --
    Move Sig.
  22. 5 Stars Rating Systems are Poor Design by ChristopherA · · Score: 3, Interesting

    If you read my article on the Rating Systems you'll see that 5 point rating systems are a poor way to do ratings. In our analysis, only 10% of raters use the bottom two star in a 5-point scale, and only 2% use the lowest rating of 1 star. The median of the 5-point scale is actually the fourth star, with a neat bell curve arranged around it. In my own personal use of iTunes, I've forced myself to be much more consistent and lower with my ratings. 1 star means that it has been rated, but in general I don't like it and don't play it. 2 stars means average, which means play it some of the time. 3 stars is above average, and play it more often, but I can get bored with these. 4 is good, and can basically listen to these regularly without getting tired. 5 stars are exemplars -- I try to find more songs like these.

    1. Re:5 Stars Rating Systems are Poor Design by ibennetch · · Score: 2, Interesting

      I think this is because people tend to think of a 5-point rating system as being 5 stars for love it and 0 for hate it -- where as if they hate a song, they probably don't even own it. Even "strongly dislike" which is what most people would figure as 1 or 2 stars, doesn't make the cut to be purchased for my music collection. I like your system, where 5 is exceptionally good and 2 is average; it's much more useful for this type of thing because the music that would typically get rated 0, 1, or 2 isn't even in one's music collection, so the whole rating system needs to compensate for that.