Benches Uncategorized

14

Robert Jacobson1 ? Can you help with BPM tags?

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

Hello, is it possible to write a script that will change BPM tags in MP3 files?

iTunes for Windows 8.0 and lower allowed non-compliant ID3 BPM tags that were in decimal format.
iTunes for Mac just didn't display them

Apparently Apple has 'fixed' iTunes for Windows 8.1 so now all my BPM tags are gone. Unless they just miraculously happened to be an integer. I used MixMeister to figure the values.

MixMeister should not be using decimal values, I know, I know....but both it and iTunes-Win have been working together for years.

Is this the kind of script you could write? Could I use that iTunes SDK and try to get one going myself? I'm not sure it changes tags, rather just reads and manipulates things in the iTunes database.
Although I'd rather donate to you via PayPal, I haven't written code for years. I'm sure you could get plenty of other donations, it's maddening as I've so many playlists that depend on BPM.

14 replies

Sign in or join Beachball Help to reply.

  1. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    bump

  2. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    This forums needs private messages You can always email me at the address on my itunes script page. Just click on the "Donate" button and it will display my email address. Oh, and don't feel obligated to donate anything!

    The iTunes COM SDK does allow you to read and set BPMs. I did a quick test with the SDK and iTunes 7.6 (Yes, I'm still using 7.6!) -- if the MP3 tag has a BPM with a floating point number, iTunes displays an integer. The SDK reports the value as an integer as well. Note that the integer is not rounded, but "floored" or truncated; e.g. if the BPM is 33.7, iTunes displays 33.

    If the song doesn't already have a BPM tag, and I set BPM via the SDK, it writes a new tag to the file. If the song already has a BPM tag with a floating point value, and I set the BPM to an int via the SDK, it may update the tag. Whether it updates the tag depends on whether the integer part of the value changes. For example, if the tag was 33.3 and I set it to 33, it does NOT update the tag. However, if I set it to 34, it DOES update the tag.

    The workaround for this is to simply set the BPM to a higher, temporary value (say, BPM + 1), then set it back to the original. Again, if the tag is 33.3, I set it to 34 to get iTunes to update the tag, then set it to back down to 33.

    I have no clue if any of this will work with iTunes 8. I don't have time to fire up my VM with iTunes 8 on it and test it. But here is the script, which you can try and see what happens!

    Save the code below into a text file and name it with a ".vbs" extension (e.g. "itunes_bpm.vbs". Select some tracks in iTunes, then double-click the script to run it.

    If the track doesn't have a BPM tag, it shouldn't do anything at all to it.


    ' ###############################################################################
    ' #
    ' # itunes_bpm.vbs
    ' #
    ' # This script will read the BPM, change it to an integer, and write it back to iTunes
    ' #
    ' # written by: Robert Jacobson (http://www.pobox.com/~teridon/itunesscripts/index.html)
    ' # Last Updated: 27 Mar 2009
    ' # Version 1.0
    ' #
    ' # This script is GPL v2. see http://www.gnu.org/copyleft/gpl.html
    ' #
    ' ###############################################################################

    Option Explicit

    Dim iTunesApp ' iTunes.Application object used to access the iTunes application.
    Dim tracks
    Dim track
    Dim BPM_float
    Dim BPM_int
    Dim i

    Set iTunesApp = CreateObject("iTunes.Application.1")
    Set tracks = iTunesApp.SelectedTracks

    For i = 1 to tracks.Count
    Set track = tracks.Item(i)

    IF track.Kind = 1 Then
    BPM_float = track.BPM
    wscript.echo "BPM is " & BPM_float & Chr(10)
    If (BPM_float > 0) Then
    BPM_int = Int(BPM_float)
    track.BPM = ( BPM_int + 1 )
    track.BPM = BPM_int
    End If
    End If
    Next

  3. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Can I immediately say how super I think you are for doing this?

    I did look at your site, but couldn't find your email....thanks for the tip on that.

    I will try this code ASAP and let you know how it goes in itunes 8.1. I have to fiddle around and back up my library first, which will take a while....

    Thank you, thank you, thank you!

  4. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Don't thank me yet! You don't know what it'll do!

    The orange "PayPal Donate" button is on the left side below the google groups subscription boxes. Clicking it will take you to a PayPal payment page -- my email will be in huge font across the top.

    Just to be clear (more for the Hosts than you...) -- I'm not asking for a donation, just telling you how to get my email address (without giving it to spammers!)

  5. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Hi there! I am such a slacker, I have been having a rare day off and have not gotten to it. Actually I have lied to most folks on this forum and said I would test it this weekend. Excuses, excuses, I am full of them....just started a new job and the office air gave me the sneezes, yada yada.

    I do thank you, but part of my brain tells me I need a whole 'nother exHD to test this, and I cannot afford one right now. My library is preciousssss to me.

    The laptop, I should test on it tomorrow. except the space bar is broken and I hate it, and I'm working 2 jobs. Nah, you gave me a kick in the pants, I should go up and try it now!

  6. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    You could just create another library to test with, using copies of a few files. It would be much faster than backing the whole thing up...

    But hey, backups are good.

  7. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    I tried this with 8.1 on a 64 bit Windows Vista machine but had the following error:

    Line: 27
    Char: 1
    Error: Object required
    Code: 800A01A8
    Source: Microsoft VBScript runtime error

  8. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Did you select tracks in iTunes first? If you don't, you'll get that error. Sorry, no user-friendliness is provided for scripts written in 5 minutes :-D

  9. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    FINALLY, i tried creating a account but it kept not working,
    ok so i tried your software/script
    but i get this,
    Msgbox "bpm=0"
    well something like that.
    it just reads what itunes has in the box (which is nothing)
    and im sure that de id3 tag has the bpm in it

  10. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    why no more reactions ??
    i really need this script to work.
    i tried the software again.
    and i keep getting
    BPM is 0
    any idea's ?

  11. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Check out the the following program. It works as fast or faster than MixMeister and will batch your whole library and save the tags so that itunes 8 will read them.
    I used the trial version and fixed my whole library.

    http://www.beatunes.com/

  12. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    doesnt work for me.
    i need something that i can use allways not for 14 days.
    i now have repid evolution 2
    it is FREE
    and it WORKS FOR ITUNES 8.1
    BUT
    its very slow
    but as soon as i have my whole library done it wont take that long anymore.
    cause then it will be 20 songs per time maybe.
    not 5000+ in one go

  13. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Thanks again for doing this!

    I, too, got the BPM is 0 message - itunes 8.1 must be blanking it out to zero.
    But wonder of wonders, it is supposed to be fixed with the new 8.1.1 release from today!

    I'm installing 8.1.1. now and will see if your script works on that.

  14. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    THE NEW 8.1.1 FIXED THE PROBLEM
    LETS ALL CHEER !!!!!!!!!!

    WIIEEEJJJ
    im happy now