MegaDJ v2.59 [MM3+4] 2012: Better compatibility + time fix

Download and get help for different MediaMonkey for Windows 4 Addons.

Moderators: Peke, Gurus

twinbee
Posts: 180
Joined: Tue May 13, 2008 2:36 am
Location: England
Contact:

Re: MegaDJ v2.54 [MM3] - (2011-01-03) (escape char added)

Post by twinbee »

Hey that looks good too, but like you say will need more checking out. I've cross-linked this page with here:

http://www.mediamonkey.com/forum/viewto ... 19&t=62317

...where Thanasis has also come up with some promising solutions.
MegaDJ v2 - Lightning fast and easy to use search to replace the standard AutoPlaylist. Features include random jukebox style playlists, along with syncing, weighting options, and logic complete querying.
MonkeyEargasms
Posts: 2
Joined: Tue Nov 29, 2011 5:28 pm

Re: MegaDJ v2.54 [MM3] - (2011-01-03) (escape char added)

Post by MonkeyEargasms »

thanks for this really usefull tool.

i only have a quesiton. When i'm creating a playlist via MegaDj, where the .m3u files are stored (dir path)?
twinbee
Posts: 180
Joined: Tue May 13, 2008 2:36 am
Location: England
Contact:

Re: MegaDJ v2.54 [MM3] - (2011-01-03) (escape char added)

Post by twinbee »

@MonkeyEargasms - MegaDJ doesn't create m3u files, but instead uses the internal Mediamonkey song number. Each file is named, 1, 2, 3, 4 etc., for each node, and inside each file, you might see something like this for 5 songs:
129,466,1113,3027,5872

These are in the scripts/auto/MegaDJ folder, which itself is probably found in the the Mediamonkey folder.

@AnthonyM1229 - After some brain-strain, I think I've sorted out the path thing now. See my latest posts at this thread, and let me know what you think:
http://www.mediamonkey.com/forum/viewto ... 7&p=320851
MegaDJ v2 - Lightning fast and easy to use search to replace the standard AutoPlaylist. Features include random jukebox style playlists, along with syncing, weighting options, and logic complete querying.
MonkeyEargasms
Posts: 2
Joined: Tue Nov 29, 2011 5:28 pm

Re: MegaDJ v2.54 [MM3] - (2011-01-03) (escape char added)

Post by MonkeyEargasms »

twinbee wrote:@MonkeyEargasms - MegaDJ doesn't create m3u files, but instead uses the internal Mediamonkey song number. Each file is named, 1, 2, 3, 4 etc., for each node, and inside each file, you might see something like this for 5 songs:
129,466,1113,3027,5872

These are in the scripts/auto/MegaDJ folder, which itself is probably found in the the Mediamonkey folder.
thanks for your answer twinbee

I was wondering if you could help me with the query filters. the options with MegaDJ are endless and i trully believe it needs a good wiki page

I want to execute some really BIG and complex queries so i can create a playlist like this :

search all library
1) Find mood~energetic|uplifting|happy
2) AND/OR occasion~whatever1|whatever2|whatever3
3) AND/OR Tempo=medium|medium fast|fast
4) AND|OR Rating Above 3.5 stars
5) AND (not OR this time. so all the above must be one of the specific genres) Genre = (Equals) House|Electronic|DnB
6) AND Year From 2009-2011 OR date Added after November 2011
7) AND not recently played (last 2days)

And thats a basic one! A more complex query i need to know is how can i also include and use the most of the rest query filters
ie :
!= (not equals) Genres metal|hardcore|etc OR !~ (does not contain) comment: whatever
+ (add) 5tracks of House 5 tracks of Electronic
+ (add) 5tracks with mood=energetic|uplifting|happy


Can you please help me out? Any cahnce for a wiki page/tutorial/something?
AnthonyM1229
Posts: 46
Joined: Fri Oct 14, 2011 2:59 pm

Re: MegaDJ v2.54 [MM3] - (2011-01-03) (escape char added)

Post by AnthonyM1229 »

twinbee wrote:@AnthonyM1229 - After some brain-strain, I think I've sorted out the path thing now. See my latest posts at this thread, and let me know what you think:
http://www.mediamonkey.com/forum/viewto ... 7&p=320851
Wow, a lot happened in the day or so that I didn't log on to the MM forums, haha. Okay, I checked out your new path coding, and played with it on both my virtual XP install (non-portable MM) and my native 7 install (portable MM). At first, I could only get the code working correctly in one or the other. Initially, the path would be incorrectly lacking "\Scripts\Auto" on XP, and therefore throw errors at me, so, I fixed that. But then, testing the code on my portable install resulted in "\Scripts\Auto" being doubled in the path, and throwing errors at me too. So, I played some with the coding and came up with a way to make it work correctly in both:

Code: Select all

   Dim strMMPath
   Dim settingsPath
       isPortable = instr(SDB.Database.Path, SDB.ApplicationPath)   ' Checks if the Application path string is contained inside the DataBase path string
       if(isPortable=false) Then
          MsgBox("not portable")
          Set oFSO = CreateObject("Scripting.FileSystemObject")
          Set shell = CreateObject("WScript.Shell")
          settingsPath = shell.ExpandEnvironmentStrings("%appdata%") & "\MediaMonkey\"
          set objFSO = createobject("Scripting.FileSystemObject")
          If objFSO.FolderExists(settingsPath) = False then
             objFSO.CreateFolder(settingsPath)
          end If
          strMMPath = settingspath & "Scripts\Auto\"
       Else
          MsgBox("portable")
          settingsPath = SDB.ScriptsPath & "Auto\"
          strMMPath = settingsPath
       End if
       MsgBox("final settings path: "+settingsPath)
and then delete the line that reads the following or variation thereof:

Code: Select all

Dim strMMPath : strMMPath = SDB.ApplicationPath & "Scripts\Auto\"
I think ideally, the code should use either strMMPath or settingspath and not both...I did change all instances of "settingspath" to "strMMPath" on XP, and the code appears to work correctly.

Well, I definitely think you're on to something with this idea...I just hope I've tested it correctly, haha! Let me know...
AnthonyM1229
Posts: 46
Joined: Fri Oct 14, 2011 2:59 pm

Re: MegaDJ v2.54 [MM3] - (2011-01-03) (escape char added)

Post by AnthonyM1229 »

@MonkeyEargasms

Have you tried looking at the example presets? Try them out, and also use the "?" help button, as it provides more info about each example. That aside, I took a try at coming up with a query for you:

Code: Select all

LastPlayedAge > 2 & (Year >= 20090000 & Year <= 20110000 | Dateadded > 40847) & (Genre = "House" | Genre = "Electronic" | Genre = "DnB") & (mood ~ "energetic" | mood ~ "uplifting" | mood ~ "happy") 
& ((occasion ~ "whatever1" | occasion ~ "whatever2" | occasion ~ "whatever3") | (Tempo = "medium" |Tempo = "medium fast"| Tempo = "fast") | rating > 3.5)
I used the literal values you provided, so, you'll probably have to substitute real values, especially for the occasions, haha. For the year values, they must be 8 digits...I had trouble with that myself starting out. Now, the Dateadded value may look strange too. MM stores that value as a number of days since December 30, 1899, I believe. 40847 should resolve to October 31, 2011, meaning the query should pick up songs added on November 1 or later. If you want only songs added after November 30, then change 40847 to 40877, and that should do it.

I haven't even tried your more complex requirements, haha...your basic ones were complex enough :lol: It looks like you'll have to use a rotate node for those, though.
twinbee
Posts: 180
Joined: Tue May 13, 2008 2:36 am
Location: England
Contact:

Re: MegaDJ v2.55 [MM3] - (2011-12-02) (MM4/Win7/Vista compat

Post by twinbee »

MegaDJ v2.55 is out now, and should work for portable/non-portable/MM4/Win7/Vista and general UAC goodness. The MegaDJ nodes may move around, so for this release I suggest people only upgrade if they need to (despite a couple of new minor features).

If you must go ahead and you are confident with Windows and moving files around, then nodes can usually be found in the "Mediamonkey/Scripts/Auto/MegaDJ" folder. These would then be moved to the "Settings path" location you can see if you select "About MegaDJ" from the dropdown menu. Nodes will look like numbered files such as "1", "2", "3" etc. and don't forget to move the "megadj.ini" file to the new location too.

------------------------------------------------------------------

AnthonyM1229, thanks muchly for providing that example for MonkeyEargasms. Regarding my new settings path code, it wasn't just that chunk of code I changed - there are bits throughout the new v2.55 MegaDJ.vbs which are different. I suggest maybe you keep with what works for you, and ignore this release (apart from testing it if you really want to). If you must go ahead, then strMMpath is called settingsPath mostly now, but strMMpath is used for a couple of things which it used to do. I've also added some control focusing stuff (look for "ActiveControl"), again only if you'd like that minor improvement :) There has been a mass find/replace on a certain string extension to prevent a part of the path being duplicated (sorry I can't be more specific, but I think you'd figure it out to be honest). I've also added a helpful print of the file 'locations' in the MegaDJ help menu (look for "MegaDJ Script path" and "MegaDJ Settings path"). There may be other changes I've made too which would only be found through comparing the files side by side (or using diff or something). I'm only saying all this because I imagine it would be easier for you to add my relatively small changes to work with your current MegaDJ.vbs file, rather than add your own hard-coded scheduling changes to this new release. Forks are fun ;)

@MonkeyEargasms, let me know if you need any more help, and I'll study it too.
MegaDJ v2 - Lightning fast and easy to use search to replace the standard AutoPlaylist. Features include random jukebox style playlists, along with syncing, weighting options, and logic complete querying.
Mars74
Posts: 42
Joined: Sun Jan 11, 2009 6:29 am

Re: MegaDJ v2.55 [MM3+4] (2011-12-02): Now Win7/Vista compat

Post by Mars74 »

Salut Twinbee,

Mega DJ is really amazing ... However, there's one thing I can't do :
I have as a query filter : 'rotate(Easy_DJ,TOP_NE_PAS_EFFACER)' ... this works OK & returns correct result (100 tracks required)... But tracks are always the same, & I can't use any Random mode here.
More generally, how can I setup MegaDJ so that it extracts a random subset of a MM Playlis ?

Thanks in advance for answer.
twinbee
Posts: 180
Joined: Tue May 13, 2008 2:36 am
Location: England
Contact:

Re: MegaDJ v2.55 [MM3+4] (2011-12-02): Now Win7/Vista compat

Post by twinbee »

The workaround for now is to refresh (F4) the two nodes which make up the rotation playlist. Make sure you have Easy_DJ and TOP_NE_PAS_EFFACER set up as random.
MegaDJ v2 - Lightning fast and easy to use search to replace the standard AutoPlaylist. Features include random jukebox style playlists, along with syncing, weighting options, and logic complete querying.
AnthonyM1229
Posts: 46
Joined: Fri Oct 14, 2011 2:59 pm

Re: MegaDJ v2.55 [MM3+4] (2011-12-02): Now Win7/Vista compat

Post by AnthonyM1229 »

Cool, there's an update to MegaDJ :) I'll be happy to either install it and include my changes, or incorporate your changes to my current install. Either way, I'm in no rush to do anything, since I've been busy with other projects and such, so it might be a while before I get around to this.

I've been meaning to ask something... is there any way to control frequency of artists and/or albums? In my more specialized nodes (ones that query less than 1500 tracks), I'll fairly often see one or two (occasionally more) artists have four or more songs in my generated set of 20-30 tracks. Even worse, when that happens, the tracks tend to come from one album. It's like the algorithm is not completely random, haha. I mean, even in the relatively small subset of my library that these nodes query, there should be over 50 albums to choose from--so, getting these dupes is weird. I've looked previously in the code to see if I can find how the current implementation of "No Dupes" works so I could try to add "No Dupe Albums" or something like that, but all I could see and figure out in the code was how to enable or disable "No Dupes"...perhaps only the exe file does most of the work here?
twinbee
Posts: 180
Joined: Tue May 13, 2008 2:36 am
Location: England
Contact:

Re: MegaDJ v2.55 [MM3+4] (2011-12-02): Now Win7/Vista compat

Post by twinbee »

What's that quote, something like "the generation of random numbers is too important be left to chance" - haha :)

This one unfortunately is going to be a pig to test for. Unless you have good experience with random numbers, I have a feeling that maybe what you're seeing is what one would actually see with 'true' randomness anyway. It would be a coincidence if there weren't any coincidences and all that jazz, (and maybe you know of the birthday paradox: "if you get 20 people in a room there's a 50/50 chance that two of them will share the same birthday).

In any case, I'm semi-interested in adding a "no album-dupes" feature, though would worry this would impact on search speed.

You're also right that the main functionality is contained in the exe file. If you want to look further into this, I'd happily give this source code to you, though would ask you use it for your purposes and not spread it for now (not that you would, though actually, I have thought about opening up MegaDJ completely). Only if you're interested of course (you were brave enough to tackle the vbs file which is a bit messy to be honest, and I'm afraid the C/C++ source code for the exe is perhaps more convoluted ;) ). C/C++ is trickier to program as well generally, and it'd be a bit awkward to setup (I used Dev-C++, maybe Visual Studio's compiler has better random number generation).
MegaDJ v2 - Lightning fast and easy to use search to replace the standard AutoPlaylist. Features include random jukebox style playlists, along with syncing, weighting options, and logic complete querying.
AnthonyM1229
Posts: 46
Joined: Fri Oct 14, 2011 2:59 pm

Re: MegaDJ v2.55 [MM3+4] (2011-12-02): Now Win7/Vista compat

Post by AnthonyM1229 »

How does the current "No Dupes" function work? It seems like it removes the second or greater occurrences of a song with the same ID, right? Is this why, when I specify a node to queue, say 40 songs, I'll actually get 37-39 queued most of the time? Because those last few excluded were dupes? That check for dupes doesn't seem slow to me, and it works well.

Anyway, if "No Dupes" seems to work as simply as I think, then, would it be possible to add an option for checking for dupe albums? Albums have an ID value too, correct?

I'd be curious to take a look at the C/C++ code..., and see if I can understand any of it. Maybe some next project I do will be to learn the basics of C/C++, because currently, I know nothing of it :P
twinbee
Posts: 180
Joined: Tue May 13, 2008 2:36 am
Location: England
Contact:

Re: MegaDJ v2.55 [MM3+4] (2011-12-02): Now Win7/Vista compat

Post by twinbee »

I'll actually get 37-39 queued most of the time? Because those last few excluded were dupes?
Yep, that's right.
That check for dupes doesn't seem slow to me, and it works well.
True, but checking for song ID is different than checking for album. I seem to recall album being much harder/slower, but I can't say for sure.
I'd be curious to take a look at the C/C++ code..., and see if I can understand any of it.
Haha, talk about being plunged into the deep end ;) Okay, what I might do before sending the code to you is port MegaDJ over to Visual Studio, as it will be much easier for you to set up. Also I've found the Microsoft compiler to run around twice as fast as the Dev-C++/mingw compiler, so I wanted to port it over to Visual Studio anyway at some point.
MegaDJ v2 - Lightning fast and easy to use search to replace the standard AutoPlaylist. Features include random jukebox style playlists, along with syncing, weighting options, and logic complete querying.
twinbee
Posts: 180
Joined: Tue May 13, 2008 2:36 am
Location: England
Contact:

Re: MegaDJ v2.56 [MM3+4] Xmas-2011: WinXP/7/Vista, better ra

Post by twinbee »

MegaDJ v2.56 is now available.

For people who have more than 30000 tracks, MegaDJ now includes ALL the tracks in your collection when picking random tracks. Many thanks to Anthony for picking up this rather serious bug. The more you had before, the worse it was.

MegaDJ is now a smaller download, and the speed is up to twice as fast for many random playlists.

See MegaDJ homepage to download in the usual way:
http://www.skytopia.com/software/megadj/
MegaDJ v2 - Lightning fast and easy to use search to replace the standard AutoPlaylist. Features include random jukebox style playlists, along with syncing, weighting options, and logic complete querying.
Rollerphant
Posts: 5
Joined: Sun Oct 01, 2006 2:33 am

Re: MegaDJ v2.56 [MM3+4] Xmas-2011: WinXP/7/Vista, better ra

Post by Rollerphant »

Trying to figure out how to do something that seems like it should be real simple.

Based on a specifed MM Playlist, or a specific file directory,
Play X number of tracks by any AlbumArtist
lather, rinse, repeat

I've tried to write the query, but keep getting stuck. Any help wuold be appreciated.

Thanks for the script!
Post Reply