Can someone modify this Tempo script for MM 3.2?

Post a reply


In an effort to prevent automatic submissions, we require that you complete the following challenge.
Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Can someone modify this Tempo script for MM 3.2?

Re: Can someone modify this Tempo script for MM 3.2?

by nynaevelan » Mon Dec 14, 2009 6:04 pm

Kazona wrote:Really? Hmm I'll look again then.

Look on the last page: http://www.mediamonkey.com/forum/viewto ... &sk=t&sd=d

Re: Can someone modify this Tempo script for MM 3.2?

by Kazona » Mon Dec 14, 2009 4:16 pm

Really? Hmm I'll look again then.

Re: Can someone modify this Tempo script for MM 3.2?

by nynaevelan » Mon Dec 14, 2009 2:57 pm

Did you look through the original forum topic, I thought someone had already modified it for 3.x?

Can someone modify this Tempo script for MM 3.2?

by Kazona » Mon Dec 14, 2009 2:04 pm

I found a script which automatically tags your files with the appropriate Tempo based on the BPM value. Unfortunately it doesn't seem to work with MediaMonkey 3.2. Is there anyone who can modify it so that it will work?

Code: Select all

Option Explicit

Sub SetTempo
REM "Very Slow" for BPM between 0 and 56
REM "Slow" for BPM between 57 and 82
REM "Moderate" for BPM between 83 and 145
REM "Fast" for BPM between 146 and 200
REM "Very Fast" for BPM > 200
End Sub

Dim SDB
Set SDB = CreateObject( "SongsDB.SDBApplication")

Dim KeyVerySlow
Dim KeySlow
Dim KeyModerate
Dim KeyFast
Dim KeyVeryFast

Dim dsTemp
   Set dsTemp = SDB.Database.OpenSQL("SELECT ID FROM Lists WHERE IDListType = 1 AND TextData = 'Very Slow'")
   if not dsTemp.EOF then KeyVerySlow = dsTemp.ValueByIndex(0)
   Set dsTemp = SDB.Database.OpenSQL("SELECT ID FROM Lists WHERE IDListType = 1 AND TextData = 'Slow'")
   if not dsTemp.EOF then KeySlow = dsTemp.ValueByIndex(0)
   Set dsTemp = SDB.Database.OpenSQL("SELECT ID FROM Lists WHERE IDListType = 1 AND TextData = 'Moderate'")
   if not dsTemp.EOF then KeyModerate = dsTemp.ValueByIndex(0)
   Set dsTemp = SDB.Database.OpenSQL("SELECT ID FROM Lists WHERE IDListType = 1 AND TextData = 'Fast'")
   if not dsTemp.EOF then KeyFast = dsTemp.ValueByIndex(0)
   Set dsTemp = SDB.Database.OpenSQL("SELECT ID FROM Lists WHERE IDListType = 1 AND TextData = 'Very Fast'")
   if not dsTemp.EOF then KeyVeryFast = dsTemp.ValueByIndex(0)
set dsTemp = Nothing

'Delete all Tempos
SDB.Database.ExecSQL("Delete from AddSongInfoInt WHERE DataType = 10101")

'Set all Tempos to Very Slow, where BPM between 0 and 56
if CStr(KeyVerySlow) <> "" then
   SDB.Database.ExecSQL("INSERT INTO AddSongInfoInt (IDSong, DataType, IntData) Select Songs.ID, 10101, " & KeyVerySlow & " FROM Songs WHERE BPM BETWEEN 0 AND 56")
else
   MsgBox "Largo is not part of the Tempo-List"
end if

'Set all Tempos to Slow, where BPM between 57 and 82
if CStr(KeySlow) <> "" then
   SDB.Database.ExecSQL("INSERT INTO AddSongInfoInt (IDSong, DataType, IntData) Select Songs.ID, 10101, " & KeySlow & " FROM Songs WHERE BPM BETWEEN 57 AND 82")
else
   MsgBox "Andante is not part of the Tempo-List"
end if

'Set all Tempos to Moderate, where BPM between 83 and 145
if CStr(KeyModerate) <> "" then
   SDB.Database.ExecSQL("INSERT INTO AddSongInfoInt (IDSong, DataType, IntData) Select Songs.ID, 10101, " & KeyModerate & " FROM Songs WHERE BPM BETWEEN 83 AND 145")
else
   MsgBox "Allegro is not part of the Tempo-List"
end if

'Set all Tempos to Fast, where BPM between 146 and 200
if CStr(KeyFast) <> "" then
   SDB.Database.ExecSQL("INSERT INTO AddSongInfoInt (IDSong, DataType, IntData) Select Songs.ID, 10101, " & KeyFast & " FROM Songs WHERE BPM BETWEEN 146 AND 200")
else
   MsgBox "Presto is not part of the Tempo-List"
end if

'Set all Tempos to Very Fast, where BPM > 200
if CStr(KeyVeryFast) <> "" then
   SDB.Database.ExecSQL("INSERT INTO AddSongInfoInt (IDSong, DataType, IntData) Select Songs.ID, 10101, " & KeyVeryFast & " FROM Songs WHERE BPM > 200")
else
   MsgBox "Presto is not part of the Tempo-List"
end if

Set SDB = Nothing 
I would greatly appreciate it if someone could fix this for me.

Top