by trixmoto » Fri Sep 30, 2005 8:01 am
This is what I did.
1) Tag all mp3s with BPM value (using MixMeister software)
2) Rescan all tracks so library contains BPM values
3) Open MediaMonkey.mdb in Access and change List table to contain all the records I wanted (Type=1, Data=Slow | Type=1, Data=Medium | ...)
4) Download script, save as SetTempo.vbs
5) Edit the script so the categories match the information I set up in the .mdb file
6) Double click on the .vbs file to run the script externally
This is all I did and all my files are successfully tagged with tempo, presumably because I have MM set up to edit my tags when updating the library.
Just to be sure, this is the contents of my .vbs file:
Code: Select all
Option Explicit
Sub SetTempo
REM "Unknown" for BPM < 1
REM "Largo" for BPM between 0 and 56
REM "Andante" for BPM between 57 and 82
REM "Allegro" for BPM between 83 and 145
REM "Presto" for BPM > 145
Dim SDB
Set SDB = CreateObject( "SongsDB.SDBApplication")
Dim KeyLargo
Dim KeyAndante
Dim KeyAllegro
Dim KeyPresto
Dim dsTemp
Set dsTemp = SDB.Database.OpenSQL("SELECT ID FROM Lists WHERE IDListType = 1 AND TextData = 'Slow'")
if not dsTemp.EOF then KeyLargo = dsTemp.ValueByIndex(0)
Set dsTemp = SDB.Database.OpenSQL("SELECT ID FROM Lists WHERE IDListType = 1 AND TextData = 'Moderate'")
if not dsTemp.EOF then KeyAndante = dsTemp.ValueByIndex(0)
Set dsTemp = SDB.Database.OpenSQL("SELECT ID FROM Lists WHERE IDListType = 1 AND TextData = 'Fast'")
if not dsTemp.EOF then KeyAllegro = dsTemp.ValueByIndex(0)
Set dsTemp = SDB.Database.OpenSQL("SELECT ID FROM Lists WHERE IDListType = 1 AND TextData = 'Very fast'")
if not dsTemp.EOF then KeyPresto = dsTemp.ValueByIndex(0)
set dsTemp = Nothing
'Delete all Tempos
SDB.Database.ExecSQL("Delete from AddSongInfoInt WHERE DataType = 10101")
'Set all Tempos to Largo, where BPM between 0 and 56
if CStr(KeyLargo) <> "" then
SDB.Database.ExecSQL("INSERT INTO AddSongInfoInt (IDSong, DataType, IntData) Select Songs.ID, 10101, " & KeyLargo & " FROM Songs WHERE BPM BETWEEN 0 AND 56")
else
MsgBox "Largo is not part of the Tempo-List"
end if
'Set all Tempos to Andante, where BPM between 57 and 82
if CStr(KeyAndante) <> "" then
SDB.Database.ExecSQL("INSERT INTO AddSongInfoInt (IDSong, DataType, IntData) Select Songs.ID, 10101, " & KeyAndante & " FROM Songs WHERE BPM BETWEEN 57 AND 82")
else
MsgBox "Andante is not part of the Tempo-List"
end if
'Set all Tempos to Allegro, where BPM between 83 and 145
if CStr(KeyAllegro) <> "" then
SDB.Database.ExecSQL("INSERT INTO AddSongInfoInt (IDSong, DataType, IntData) Select Songs.ID, 10101, " & KeyAllegro & " FROM Songs WHERE BPM BETWEEN 83 AND 145")
else
MsgBox "Allegro is not part of the Tempo-List"
end if
'Set all Tempos to Presto, where BPM between 0 and 56
if CStr(KeyPresto) <> "" then
SDB.Database.ExecSQL("INSERT INTO AddSongInfoInt (IDSong, DataType, IntData) Select Songs.ID, 10101, " & KeyPresto & " FROM Songs WHERE BPM > 145")
else
MsgBox "Presto is not part of the Tempo-List"
end if
Set SDB = Nothing
End Sub
If your library has the tempo tags but your songs do not, try saving your tags to files manually.
ADDITION: By "manually" I mean by selecting all your tracks and clicking "Menu|Advanced Tag Management|Synchronise Tags" or clicking "Ctrl+S".
This is what I did.
1) Tag all mp3s with BPM value (using MixMeister software)
2) Rescan all tracks so library contains BPM values
3) Open MediaMonkey.mdb in Access and change List table to contain all the records I wanted (Type=1, Data=Slow | Type=1, Data=Medium | ...)
4) Download script, save as SetTempo.vbs
5) Edit the script so the categories match the information I set up in the .mdb file
6) Double click on the .vbs file to run the script externally
This is all I did and all my files are successfully tagged with tempo, presumably because I have MM set up to edit my tags when updating the library.
Just to be sure, this is the contents of my .vbs file:
[code]Option Explicit
Sub SetTempo
REM "Unknown" for BPM < 1
REM "Largo" for BPM between 0 and 56
REM "Andante" for BPM between 57 and 82
REM "Allegro" for BPM between 83 and 145
REM "Presto" for BPM > 145
Dim SDB
Set SDB = CreateObject( "SongsDB.SDBApplication")
Dim KeyLargo
Dim KeyAndante
Dim KeyAllegro
Dim KeyPresto
Dim dsTemp
Set dsTemp = SDB.Database.OpenSQL("SELECT ID FROM Lists WHERE IDListType = 1 AND TextData = 'Slow'")
if not dsTemp.EOF then KeyLargo = dsTemp.ValueByIndex(0)
Set dsTemp = SDB.Database.OpenSQL("SELECT ID FROM Lists WHERE IDListType = 1 AND TextData = 'Moderate'")
if not dsTemp.EOF then KeyAndante = dsTemp.ValueByIndex(0)
Set dsTemp = SDB.Database.OpenSQL("SELECT ID FROM Lists WHERE IDListType = 1 AND TextData = 'Fast'")
if not dsTemp.EOF then KeyAllegro = dsTemp.ValueByIndex(0)
Set dsTemp = SDB.Database.OpenSQL("SELECT ID FROM Lists WHERE IDListType = 1 AND TextData = 'Very fast'")
if not dsTemp.EOF then KeyPresto = dsTemp.ValueByIndex(0)
set dsTemp = Nothing
'Delete all Tempos
SDB.Database.ExecSQL("Delete from AddSongInfoInt WHERE DataType = 10101")
'Set all Tempos to Largo, where BPM between 0 and 56
if CStr(KeyLargo) <> "" then
SDB.Database.ExecSQL("INSERT INTO AddSongInfoInt (IDSong, DataType, IntData) Select Songs.ID, 10101, " & KeyLargo & " FROM Songs WHERE BPM BETWEEN 0 AND 56")
else
MsgBox "Largo is not part of the Tempo-List"
end if
'Set all Tempos to Andante, where BPM between 57 and 82
if CStr(KeyAndante) <> "" then
SDB.Database.ExecSQL("INSERT INTO AddSongInfoInt (IDSong, DataType, IntData) Select Songs.ID, 10101, " & KeyAndante & " FROM Songs WHERE BPM BETWEEN 57 AND 82")
else
MsgBox "Andante is not part of the Tempo-List"
end if
'Set all Tempos to Allegro, where BPM between 83 and 145
if CStr(KeyAllegro) <> "" then
SDB.Database.ExecSQL("INSERT INTO AddSongInfoInt (IDSong, DataType, IntData) Select Songs.ID, 10101, " & KeyAllegro & " FROM Songs WHERE BPM BETWEEN 83 AND 145")
else
MsgBox "Allegro is not part of the Tempo-List"
end if
'Set all Tempos to Presto, where BPM between 0 and 56
if CStr(KeyPresto) <> "" then
SDB.Database.ExecSQL("INSERT INTO AddSongInfoInt (IDSong, DataType, IntData) Select Songs.ID, 10101, " & KeyPresto & " FROM Songs WHERE BPM > 145")
else
MsgBox "Presto is not part of the Tempo-List"
end if
Set SDB = Nothing
End Sub[/code]
If your library has the tempo tags but your songs do not, try saving your tags to files manually.
ADDITION: By "manually" I mean by selecting all your tracks and clicking "Menu|Advanced Tag Management|Synchronise Tags" or clicking "Ctrl+S".