Musicaster

Musicaster, the new generation of music tracking.

Last.FM: I created this almost two years ago, and at the time I hadn’t heard of Last.FM. So I finish this project then a few weeks later I learn about Last.FM, doh! Oh well, it was a very fun project nonetheless. I definitely learned a lot about C# and PHP in the process. If you want to see my Last.FM profile, check out my About Me page :)

Updated
I have now incorporated a ‘plug-in’ type system where you can simply drop in a plug-in you have made or found and it’ll work, as far as you abide by the specification which I will go over later. Musicaster now has support for iTunes and WinAmp out of the box, and I’m currently working on the Windows Media Player support.

The cool thing is it lets you switch the media player at anytime.

What is Musicaster?
Musicaster is a music tracking application which interfaces with your favorite music player and POSTs the information to a web script, allowing you to show others what you’re listening to. For example, I’m using the WordPress Plugn I created for it on this site, you can see that my tag-line (Under my name) displays the song I’m currently listening to (Or I last listened to).

What does it do?
Currently, it does each of the following:
» POST information to a web script
» POST information includes name of song, artist, and album

What are you thinking of doing with it later?
I plan on integrating some type of database (MySQL and SqLite) to allow to track more than just one song. This will enable for things like ‘Last 10 Songs I listened to‘, of course it won’t be limited to 10. Then I might be able to also ‘linkify’ the names to search for lyrics or something of the sort.

What about the WordPress Plug-in?
The WordPress plug-in I made simply, when activated, accepts the Musicaster POST information directly to the site (e.g. http://www.blaenkdenum.com/index.php, must have index.php), or better said, where WordPress is located. The plug-in then will update the blog’s tagline (The text under the name of the blog, in my site’s case, the text under my name) to display the current song information in song nameartist form, of course this is configurable if you edit the plug-in (Not too hard, if you need help or want me to add a new format, let me know). This is a single file script, and you could uninstall it simply by deactivating it and removing it, installing it is just as simple. For any more information, please read the ReadMe included in the folder.

What else is included in the Musicaster ZIP archive?
Other than the actual application and the WordPress plugin, there’s also a folder called ‘netPod‘. This folder contains a ReadMe (So does the WordPress plugin folder) which you should read and two sample scripts. One script, recv.php, receives Musicaster’s POST information and writes it to a text file. read.php then reads the information from the file for people to view it. This is strictly proof of concept and probably not as efficient. You might have to play around with the file permissions (And maybe the directory containing the file’s permission as well), though I highly doubt it.

Screenshots (Courtesy of Screeny)

Developers
PLUG-INS
For those of you that would like to create your own plug-in, simply reference the IMediaPlayer.dll to your project (Can be written in any CLS/.Net language, look at this list). The dll you link to is simply an interface which defines the basic behavior a plug-in requires to be able to work with Musicaster. Here is its definition:

namespace IMediaPlayer
{
    public interface IMediaPlayer
    {
        void refresh();
        string name { get; }
        string artist { get; }
        string album { get; }
        int flags { get; }
    }
}

Simply implement that interface into your class, make sure you conform, and drop in the DLL into Musicaster’s directory. Then click on ‘other’ and browse for the plugin, MAKE SURE that it’s in the same directory as Musicaster.

By the way, although this is bad form, this is how Musicaster reads the libraries so name them like what I’m about to say otherwise it won’t understand it.

namespace somePlugin
{
    class somePlugin
    {
        // code goes here
    }
}

What I mean by this is, name the namespace AND the class the same, this might change in the future, but for now that’s how Musicaster expects it.

WEB-SIDE SCRIPTS

The parameters are as follow:

» name – This is the actual name of the song – string
» artist – This is the song’s artist – string
» album – This is the album the song is from – string
» flags – This is parameter that will hopefully be helpful in the future. Of course they can be defined in the plug-in and handled accordingly by anyone – int

Current flags that are used out of the box are:
» 1 – If the ‘flags’ parameter is set to 1, then this means that all of the information is packed into the name parameter. Of course, the information can then be modified in the script. Currently used by ampSnitch (The WinAmp plug-in)

Download Musicaster

Credit
Thanks to the following people:
Ryan – From FreeNode/wordpress, helped me iron out almost all of the bugs. First user, first contributor :)
Horizon – Urged me to add WinAmp support
MarkJaquith from freenode/wordpress, helped out with the WordPress Plugin
sp0nge from EFNet/php, Helped out a lot with the PHP part of things
mjec from freenode/php
DARKguy, KeeperOfTheSouls, jwormy, and many more from freenode/csharp
James Curran from MSDN Forums, for the ‘plug-in’ system

4 Responses to “Musicaster”


  • nice man, imma hook u up wit an icon

  • Thanks! :D I was going to tell you. Hey man, I’m thinking about writing a Mac version, after all, iTunes is on Mac as well. I don’t know about a GUI (Window) yet since I don’t know Cocoa#, so I might make it command line at first. Same with the linux version.

  • hey that is pretty kool, i just don’t completely understand how to use it… haha!

  • That’s what a lot of people are asking. Technically, you have to know what you’re dealing with. Basically you just put some scripts into your site, modify them if you want, and listen to music while running the program. I’ll work on adding other media player support later, and I’ve already got an idea for how to do a linux version which will support things like amarok, hopefully :S

Leave a Reply