For you: Half BPM for iTunes track

This is about modifying the mp3 metadata, not the audio file itself.

I needed this and Doug’s Applescripts didn’t seem to have it, so I was able to make it surprisingly easily, deriving from the simple tutorials on his website. Thanks Doug!

I wrote this on High Sierra but if someone tests this with Apple Music and it either works as is or with modifications, please comment and let the community know.

I’ve been using MixMeister BPM Analyzer to automatically get the BPM of iTunes tracks, but I’m sure there’s others, such as DJ software.

I’ve saved the script as an .app, to HD > Users > MyName > Library > iTunes > Scripts, so it appears in the menu bar script menu of iTunes.

The script documentation is in the beginning. Enjoy!

-----------------------------------------------------
# Sometimes BPM analyzer programs analyze track BPM as double the speed you'd want.
# Fixing those manually is tedious, and it's particularly annoying to calculate BPMs that can't be halved perfectly.
# This script halves the BPM tag value of all the iTunes tracks that are currently selected.
# When a value can't be perfectly halved (for example, 121 BPM divided by two should give you 60.5 but iTunes does not support BPM decimals), the decimal points are dropped out (you would get 60.) This precision is usually enough for people who merely want to do things such as construct smart playlists by tempo.
# Not tested in Apple Music, but feel free to try as is or modified.
-----------------------------------------------------

tell application "iTunes"
	if selection is not {} then --- There's tracks selected...
		set mySelection to selection
		repeat with aTrack in mySelection --- Going through the selected tracks...
			set myTrack to current track --- Process this track...
			set OldBPM to (get bpm of aTrack) --- Get its BPM...
			set HalvedBPM to (OldBPM / 2) as integer --- Halve BPM, ignore decimals...
			copy HalvedBPM to bpm of aTrack --- Copy the halved BPM to track info.
		end repeat
	end if
end tell