Import BPM from MixMeister text-file - MixMeisterImport 1.02

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

Big_Berny
Posts: 1784
Joined: Mon Nov 28, 2005 11:55 am
Location: Switzerland
Contact:

Import BPM from MixMeister text-file - MixMeisterImport 1.02

Post by Big_Berny »

Hi guys,
yesterday I wantes Mixmeister to detect all BPMs of my song. Unfortunately it couldn't save the BPMs in the file, don't know why. But I have a text-file where the informations are stored in.

It's strucktured like "Path[Tab]Title[Tab]Artist[Tab]BPM[Tab]".
The first three lines here:

Code: Select all

D:\Eigene Dateien\Eigene Musik\Final\!!!\2007 - Myth Takes\01 - !!! - Myth Takes.mp3	Myth Takes	!!!	97.07	
D:\Eigene Dateien\Eigene Musik\Final\!!!\2007 - Myth Takes\02 - !!! - All My Heroes Are Weirdos.mp3	All My Heroes Are Weirdos	!!!	122.31	
D:\Eigene Dateien\Eigene Musik\Final\!!!\2007 - Myth Takes\03 - !!! - Must Be The Moon.mp3	Must Be The Moon	!!!	120.06	
Does someone have a idea how I can import them? The first problem I have is that I don't know how to get the Path and the BPM (=How to extract from the whole line) and I don't know how to get the song with the path (=Don't know the sql-query).
Would be cool if someone would have the basic lines so that I can import the BPMs.

Thanks! :)
Last edited by Big_Berny on Fri Sep 05, 2008 4:08 pm, edited 3 times in total.
Image
Scripts in use: Genre Finder / Last.fm DJ / Magic Nodes / AutoRateAccurate / Last.FM Node
Skins in use: ZuneSkin SP / Eclipse SP
AutoRateAccurate 3.0.0 (New) - Rates all your songs in less than 5 seconds!
About me: icoaching - internet | marketing | design
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

Well to read the lines of the file you want to have a loop, something like this...

Code: Select all

Dim fso : Set fso = CreateObject("Scripting.FileSystemObject")
Dim txt : Set txt = fso.OpenTextFile(xml,1,False)
Do While Not txt.AtEndOfStream
  Dim str : str = Trim(txt.ReadLine)
Loop
To get the parts of the line you want you can split the string into an array, like this...

Code: Select all

Dim fso : Set fso = CreateObject("Scripting.FileSystemObject")
Dim txt : Set txt = fso.OpenTextFile(xml,1,False)
Do While Not txt.AtEndOfStream
  Dim str : str = Trim(txt.ReadLine)
  Dim arr : arr = Split(str,Chr(9))
  Dim fil : fil = arr(0)
  Dim bpm : bpm = arr(3)
Loop
And then to find the track you need to query like this...

Code: Select all

Dim fso : Set fso = CreateObject("Scripting.FileSystemObject")
Dim txt : Set txt = fso.OpenTextFile(xml,1,False)
Do While Not txt.AtEndOfStream
  Dim str : str = Trim(txt.ReadLine)
  Dim arr : arr = Split(str,Chr(9))
  Dim fil : fil = Mid(arr(0),2)
  Dim sit : 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
Hope this helps! :)
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Big_Berny
Posts: 1784
Joined: Mon Nov 28, 2005 11:55 am
Location: Switzerland
Contact:

Post by Big_Berny »

Thanks a lot! That helped! :D

And another step to a perfect and complete library... :)

What a great forum...
Image
Scripts in use: Genre Finder / Last.fm DJ / Magic Nodes / AutoRateAccurate / Last.FM Node
Skins in use: ZuneSkin SP / Eclipse SP
AutoRateAccurate 3.0.0 (New) - Rates all your songs in less than 5 seconds!
About me: icoaching - internet | marketing | design
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

Glad I could help. :)
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
m_bojangles
Posts: 99
Joined: Fri Jun 11, 2004 8:22 pm
Contact:

Post by m_bojangles »

I'm in this same situation. Berny, can you post your complete script? Thanks.
Big_Berny
Posts: 1784
Joined: Mon Nov 28, 2005 11:55 am
Location: Switzerland
Contact:

Post by Big_Berny »

Well here it didn't work directly so I imported the date into a custom field first and then into the BPM. But I can write a complete script if you want. Just need some days because I still have some exams...
Image
Scripts in use: Genre Finder / Last.fm DJ / Magic Nodes / AutoRateAccurate / Last.FM Node
Skins in use: ZuneSkin SP / Eclipse SP
AutoRateAccurate 3.0.0 (New) - Rates all your songs in less than 5 seconds!
About me: icoaching - internet | marketing | design
m_bojangles
Posts: 99
Joined: Fri Jun 11, 2004 8:22 pm
Contact:

Post by m_bojangles »

I don't mind using your initial approach... I don't need anything elegant. So do you have a script for importing the BPM into a custom field?

Then did you use one of those cool "set a field to the value of another field" scripts I've seen floating around on here?

Thanks!
Big_Berny
Posts: 1784
Joined: Mon Nov 28, 2005 11:55 am
Location: Switzerland
Contact:

Post by Big_Berny »

Well, I just have a temp.vbs-file which I always use for small temporary scripts. So I don't have the code anymore. But I'll post it soon!
Image
Scripts in use: Genre Finder / Last.fm DJ / Magic Nodes / AutoRateAccurate / Last.FM Node
Skins in use: ZuneSkin SP / Eclipse SP
AutoRateAccurate 3.0.0 (New) - Rates all your songs in less than 5 seconds!
About me: icoaching - internet | marketing | design
vanmeterannie
Posts: 34
Joined: Mon Mar 05, 2007 10:58 am
Contact:

Post by vanmeterannie »

So, I'm new at this coding thing...will the above sections work pieced together, or is there more to it? I'd love to be able to extract the info as well, since I have all ape files - it'll be a bear to make mp3s of them and get the bpm from that, but I don't see another way around it, and I'd like to pull that data from the txt file.
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

If the "sections" means the 3 chunks of code I posted at the top, then you only need the last one. If you check them carefully, they are the same code but adding extra lines each time, as I was explaining each thing that I was doing.

This is a VERY rough-and-ready block of code, but it should be usable. :)
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
mhendu
Posts: 100
Joined: Thu Jan 12, 2006 11:18 am
Contact:

Post by mhendu »

Has anyone worked out this script completely? I'd love to be able to import the BPM data from MixMeister but my scripting skills are meager. Thanks!
spacefish
Posts: 1427
Joined: Mon Jan 14, 2008 7:21 am
Location: Denmark
Contact:

Post by spacefish »

I'd be interested in this too!
Image
MM Gold 3.0.3.1183 : Vista HP SP1 (x86) : Zen Stone (2GB)
Zekton: An original MM3 skin by Eyal.
Scripts in Use: Add/Remove PlayStat | Auto Album DJ | AutoRateAccurate | Backup
Case & Leading Zero Fixer | Classification & Genre Changer | Clean Scripts.ini | Clear
Field | Custom Report | Discogs Auto-Tag Web Search | Forget Crossfade | Invert
Selection/Select None | Last 100... | Lyricator | Lyrics to Instrumental | MonkeyRok
MusicBrainz Tagger | My Custom Nodes | Now Playing Art Node | Play History & Stats
Right Click for Reports | Right Click for Scripts | Right Click for Web | Stop After Current
WebNodes
mhendu
Posts: 100
Joined: Thu Jan 12, 2006 11:18 am
Contact:

Post by mhendu »

Soooo - I'm sorry to keep asking but if anyone could help out with this script I'd really appreciate it. I don't know of any other way to easily get the BPMs imported for all my tracks and I'm sure others would find this to be useful also. Thanks!
newmomma
Posts: 2
Joined: Fri Apr 11, 2008 9:58 am
Contact:

Post by newmomma »

I don't know much about the whole code thing, but in order to import BPM into my library I just ran the songs on MixMeister and then highlighted the whole thing and dragged and dropped into my library. All tags were updated... I didn't bother saving as a text file 'cuz I couldn't figure out how to use it! Hope this is useful to someone :)
Big_Berny
Posts: 1784
Joined: Mon Nov 28, 2005 11:55 am
Location: Switzerland
Contact:

Post by Big_Berny »

@newmomma: Unfortunately this doesn't work for some songs - don't know why though...

Sorry, that I forgot to finish the script. I'll do that as soon as possible!
Image
Scripts in use: Genre Finder / Last.fm DJ / Magic Nodes / AutoRateAccurate / Last.FM Node
Skins in use: ZuneSkin SP / Eclipse SP
AutoRateAccurate 3.0.0 (New) - Rates all your songs in less than 5 seconds!
About me: icoaching - internet | marketing | design
Post Reply