by Killjoy12 » Sat Jan 12, 2008 9:58 pm
I am trying to set the Tempo based upon the BPM in an auto script. While it does set the tempo field as desired, it does not appear to be recognized by MM. For example, the Tempo will get set to 'Fast', but the tracks are still showing up under the Unknown Tempo node, and do not show up under the Fast node. This is even after a restart of MM.
It looks like tempo is a simple text field, but now I am thinking it is not. Can anyone give me an idea why this script does not work correctly?
Code: Select all
Sub OnStartup
Dim SDB
Set SDB = CreateObject( "SongsDB.SDBApplication")
' Set Tempo where BPM is known, and the Tempo has not been set.
SDB.Database.ExecSQL("Update Songs Set Tempo = 'Very Slow' Where (Tempo = '' or Tempo = 'None') AND (BPM >= 0 and BPM <=56)")
SDB.Database.ExecSQL("Update Songs Set Tempo = 'Slow' Where (Tempo = '' or Tempo = 'None') AND (BPM >= 57 and BPM <=82)")
SDB.Database.ExecSQL("Update Songs Set Tempo = 'Moderate' Where (Tempo = '' or Tempo = 'None') AND (BPM >= 83 and BPM <=145)")
SDB.Database.ExecSQL("Update Songs Set Tempo = 'Fast' Where (Tempo = '' or Tempo = 'None') AND (BPM >= 146 and BPM <=200)")
SDB.Database.ExecSQL("Update Songs Set Tempo = 'Very Fast' Where (Tempo = '' or Tempo = 'None') AND (BPM >200)")
Set SDB = Nothing
End Sub
I am trying to set the Tempo based upon the BPM in an auto script. While it does set the tempo field as desired, it does not appear to be recognized by MM. For example, the Tempo will get set to 'Fast', but the tracks are still showing up under the Unknown Tempo node, and do not show up under the Fast node. This is even after a restart of MM.
It looks like tempo is a simple text field, but now I am thinking it is not. Can anyone give me an idea why this script does not work correctly?
[code]
Sub OnStartup
Dim SDB
Set SDB = CreateObject( "SongsDB.SDBApplication")
' Set Tempo where BPM is known, and the Tempo has not been set.
SDB.Database.ExecSQL("Update Songs Set Tempo = 'Very Slow' Where (Tempo = '' or Tempo = 'None') AND (BPM >= 0 and BPM <=56)")
SDB.Database.ExecSQL("Update Songs Set Tempo = 'Slow' Where (Tempo = '' or Tempo = 'None') AND (BPM >= 57 and BPM <=82)")
SDB.Database.ExecSQL("Update Songs Set Tempo = 'Moderate' Where (Tempo = '' or Tempo = 'None') AND (BPM >= 83 and BPM <=145)")
SDB.Database.ExecSQL("Update Songs Set Tempo = 'Fast' Where (Tempo = '' or Tempo = 'None') AND (BPM >= 146 and BPM <=200)")
SDB.Database.ExecSQL("Update Songs Set Tempo = 'Very Fast' Where (Tempo = '' or Tempo = 'None') AND (BPM >200)")
Set SDB = Nothing
End Sub
[/code]