Import BPM from MixMeister text-file - MixMeisterImport 1.02

Post a reply

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

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

Topic review
   

Expand view Topic review: Import BPM from MixMeister text-file - MixMeisterImport 1.02

Re: Import BPM from MixMeister text-file - MixMeisterImport

by MarkMe » Sun Nov 27, 2011 3:27 pm

For convenience I've added a file open dialog to the script.

Code: Select all

Option Explicit
'1. Save this text as 'MixMeisterImport.vbs' in the Scripts-folder of MediaMonkey
'2. Add this Section to Scripts.ini (remove ')

'[MixMeisterImport]
'FileName=MixMeisterImport.vbs
'ProcName=MixMeisterImport
'DisplayName=MixMeisterImport
'Language=VBScript
'ScriptType=0

'3. Edit the path to your MixMeister-BPM-file in the code below.
'4. Restart MediaMonkey
'5. You'll find "MixMeisterImport" under Tools/Scripts

Sub MixMeisterImport
   Dim path, ObjFSO, InitFSO
   
   Set ObjFSO = CreateObject("UserAccounts.CommonDialog")
   ObjFSO.Filter = "Text Documents|*.txt|All Files|*.*" 
   InitFSO = ObjFSO.ShowOpen
   If InitFSO = true Then 'File was selected

	   path=ObjFSO.FileName
   
	   Dim str, arr, fil, sit
	   Dim fso : Set fso = CreateObject("Scripting.FileSystemObject")
	   if fso.FileExists(path) then   
		 Dim txt : Set txt = fso.OpenTextFile(path,1,False)
		 SDB.Database.BeginTransaction
		 Do While Not txt.AtEndOfStream
			 str = Trim(txt.ReadLine)
			 arr = Split(str,Chr(9))    
			 fil = Mid(arr(0),2)   
			 Set sit = SDB.Database.QuerySongs("AND (Songs.SongPath = '"&Replace(fil,"'","''")&"')")
			 If Not (sit.EOF) Then 
				Dim itm : Set itm = sit.Item

		   if ((Mid(arr(3),(InStr(arr(3),".") + 1), 1)) >=5) then
		  itm.BPM = (Left(arr(3),(InStr(arr(3),".") - 1)) + 1)
		   else
		  itm.BPM = (Left(arr(3),(InStr(arr(3),".") - 1)))
		   end if

				itm.UpdateDB
			 End If
		  Loop
		  Set sit = Nothing
		  SDB.Database.Commit
	   else
		  SDB.MessageBox "The file `"&path&"` unfortunately doesn't exist."& vbCrLf &"Please modify the path to the MixMeister-BPM-file in the Scriptcode.", mtError, Array(mbOk)
	   end if
   end if

End sub

Re: Import BPM from MixMeister text-file - MixMeisterImport 1.02

by ojk12 » Mon May 17, 2010 1:27 pm

Sorry again, I found the way to tag BPM, it is with "MixMeister BPM Analyzer" and I was using the complete program instead analizer, I just have MM running while MixMeister BPM Analyzer is analizing the BPM and got no problems, it automatically updates the value in the MP3 file, also I have the file monitr activated in MM.

Thanks

Re: Import BPM from MixMeister text-file - MixMeisterImport 1.02

by Kynotzib » Mon May 17, 2010 12:43 pm

Just a couple of questions.

1. Can this script be used to import other data to tracks like date, disk and track numbers by tweaking the itm:bpm to another item? (If so what are the itm names)
2. Can it import more than one item at once?

Kyno

Import BPM from TXT

by ojk12 » Mon May 17, 2010 12:36 pm

Please, I've trying to use "MixMeisterImport 1.02" to tag the BPM but it says

Image

Image


The format of my generated txt file with MixMesiter is "SongPath ArtistName BPM", something like this:

D:\Mi Música\1\100 90's Thechno Hits\20. 2 Unlimited - Get Ready for This (Dance).mp3 2 Unlimited 124.9
D:\Mi Música\1\100 90's Thechno Hits\26. 69 Boyz - Tootsee Roll (Rap).mp3 69 Boyz 133.0
D:\Mi Música\1\100 90's Thechno Hits\43. Ace of Base - All That She Wants (Pop).mp3 Ace of Base 93.8

please help me

Re: Import BPM from MixMeister text-file - MixMeisterImport 1.02

by ojk12 » Mon May 17, 2010 12:23 pm

Sorry guys, Please I need your help, I've been tryinng to tag the BPM value in my MP3 files but I can't get it. I used MixMeister but I cant get the BPM in the tag so I exported the playlist and tried to use this script but it doesnt work for me, the format for the txt file its something like this:

Song Path ArtisName BPM

D:\Mi Música\1\100 90's Thechno Hits\20. 2 Unlimited - Get Ready for This (Dance).mp3 2 Unlimited 124.9
D:\Mi Música\1\100 90's Thechno Hits\26. 69 Boyz - Tootsee Roll (Rap).mp3 69 Boyz 133.0
D:\Mi Música\1\100 90's Thechno Hits\43. Ace of Base - All That She Wants (Pop).mp3 Ace of Base 93.8

please help me

Updating script in mediamonkey

by jjsemm » Mon Jan 05, 2009 11:38 pm

I'm trying to add the script to import bpm's from mixmeister and i'm getting "permission" & "path not found errors" when I'm trying to save. My XP computer crashed, so I'm using our new Vista computer. I've tried adding the script under my regular windows log in and as th administrator. Does anybody have a clue what I need to do? Thanks in advance. ~ JJ

Re: Import BPM from MixMeister text-file - MixMeisterImport 1.02

by koro » Fri Oct 17, 2008 11:25 am

Hi all,

After my mails with Berny i found someone at my job who editted this wonderfull script.

When using the script now, the dot is not anymore in the tag.

When the BPM is 124.76 it becomes 125, and when its 124.35 it becomes 124

Code: Select all

Option Explicit
'1. Save this text as 'MixMeisterImport.vbs' in the Scripts-folder of MediaMonkey
'2. Add this Section to Scripts.ini

'[MixMeisterImport]
'FileName=MixMeisterImport.vbs
'ProcName=MixMeisterImport
'DisplayName=MixMeisterImport
'Language=VBScript
'ScriptType=0

'3. Edit the path to your MixMeister-BPM-file in the code below.
'4. Restart MediaMonkey
'5. You'll find "MixMeisterImport" under Tools/Scripts

Public Const path = "c:\bpm.txt" 'PUT THE PATH TO YOUR MIXMEISTER-BPM-FILE HERE

Sub MixMeisterImport
   Dim str, arr, fil, sit
   Dim fso : Set fso = CreateObject("Scripting.FileSystemObject")
   if fso.FileExists(path) then   
     Dim txt : Set txt = fso.OpenTextFile(path,1,False)
     SDB.Database.BeginTransaction
     Do While Not txt.AtEndOfStream
         str = Trim(txt.ReadLine)
         arr = Split(str,Chr(9)) 	
         fil = Mid(arr(0),2)	
         Set sit = SDB.Database.QuerySongs("AND (Songs.SongPath = '"&Replace(fil,"'","''")&"')")
         If Not (sit.EOF) Then 
            Dim itm : Set itm = sit.Item

	    if ((Mid(arr(3),(InStr(arr(3),".") + 1), 1)) >=5) then
		itm.BPM = (Left(arr(3),(InStr(arr(3),".") - 1)) + 1)
	    else
		itm.BPM = (Left(arr(3),(InStr(arr(3),".") - 1)))
	    end if

            itm.UpdateDB
         End If
      Loop
      Set sit = Nothing
      SDB.Database.Commit
   else
      SDB.MessageBox "The file `"&path&"` unfortunately doesn't exist."& vbCrLf &"Please modify the path to the MixMeister-BPM-file in the Scriptcode.", mtError, Array(mbOk)
   end if
End sub

Re: Import BPM from MixMeister text-file - MixMeisterImport 1.02

by Big_Berny » Tue Sep 30, 2008 12:34 pm

Probably a localization bug because of '.' and ','... Unfortunately I don't have time to work on it at the moment as I work on nother project now. But feel free to work on it. Maybe you also find someone who helps?

Re: Import BPM from MixMeister text-file - MixMeisterImport 1.02

by koro » Tue Sep 30, 2008 10:10 am

Hi Berny,

It was the problem with the path...

But i discovered another thing.

Mixmeister gives 124.99 and when importing the songs it becomes 12499 in Mediamonkey.

Do i do something wrong?

Re: Import BPM from MixMeister text-file - MixMeisterImport 1.02

by Big_Berny » Mon Sep 29, 2008 4:21 am

Yeah, this is probably the problem. I hope that it works for you somehow as I don't have time at the moment to develop it further and I don't know how to fix that quickly.

Re: Import BPM from MixMeister text-file - MixMeisterImport 1.02

by koro » Mon Sep 29, 2008 4:17 am

Hi berny,

tnx for the reply...

I did some searching and find the following...

I drag my files, wich i want the bmp for it, from Mediamonkey to MixM.

After the calculate of the BPM i'll save the txt file.

Now i discovered the following...

My files are stored on drive S:, wich is the path MixM goes to.
But in my MediaMonkey db the files are in the path //mp3/...... (selected via network places...)

So i think if i rescan all my files again , and take them from S:, the problem should be gone.

The reason i did the//mp3/.... thing is, that the S drive is on another PC.
When starting MM from my pc in my bureau, he don't find the db.
I have to select drive S first in explorer, before i can start MM.

With //mp3/.... i don't have that problem...

Re: Import BPM from MixMeister text-file - MixMeisterImport 1.02

by Big_Berny » Mon Sep 29, 2008 3:57 am

Well, it's normal that you don't see anything. The BPM values should get imported in the background.

Do all songs of the txt-file still don't have BPM in MM? Did you move your MP3s before importing? TIf yes, this is the problem as the paths in the text-file are used by the script to find the MP3s. And can you send me the path of such songs which didn't get the BPM? Maybe there are some problemtic characters in it.

Re: Import BPM from MixMeister text-file - MixMeisterImport 1.02

by koro » Mon Sep 29, 2008 12:39 am

Hi,

I saved the code to the vbs file.
And put it into the scripts folder.

I took some files and calculate them wit MiwMeister BPM.
I saved the file to d:\bpm.txt and i set this path into the vbs

After starting the import, nothing happens, even no error message...

I don't know what's wrong...

Re: Import BPM from MixMeister text-file - MixMeisterImport 1.02

by mhendu » Sat Sep 20, 2008 9:32 pm

Thank you for all your work!!

Re: Import BPM from MixMeister text-file - MixMeisterImport 1.02

by Big_Berny » Fri Sep 05, 2008 4:08 pm

Fixed another potential bug.

Code: Select all

Option Explicit
'1. Save this text as 'MixMeisterImport.vbs' in the Scripts-folder of MediaMonkey
'2. Add this Section to Scripts.ini

'[MixMeisterImport]
'FileName=MixMeisterImport.vbs
'ProcName=MixMeisterImport
'DisplayName=MixMeisterImport
'Language=VBScript
'ScriptType=0

'3. Edit the path to your MixMeister-BPM-file in the code below.
'4. Restart MediaMonkey
'5. You'll find "MixMeisterImport" under Tools/Scripts

Public Const path = "c:\bpm.txt" 'PUT THE PATH TO YOUR MIXMEISTER-BPM-FILE HERE

Sub MixMeisterImport
   Dim str, arr, fil, sit
   Dim fso : Set fso = CreateObject("Scripting.FileSystemObject")
   if fso.FileExists(path) then
      Dim txt : Set txt = fso.OpenTextFile(path,1,False)
      SDB.Database.BeginTransaction
	  Do While Not txt.AtEndOfStream
         str = Trim(txt.ReadLine)
         arr = Split(str,Chr(9))
         fil = Mid(arr(0),2)
         Set sit = SDB.Database.QuerySongs("AND (Songs.SongPath = '"&Replace(fil,"'","''")&"')")
         If Not (sit.EOF) Then 
            Dim itm : Set itm = sit.Item
            itm.BPM = arr(3)
            itm.UpdateDB
         End If
      Loop
      Set sit = Nothing
      SDB.Database.Commit
   else
      SDB.MessageBox "The file `"&path&"` unfortunately doesn't exist."& vbCrLf &"Please modify the path to the MixMeister-BPM-file in the Scriptcode.", mtError, Array(mbOk)
   end if
End sub

Top