RSS
  • My PyMP'D Playlist project...

    30 Sep 2013, 15:26

    I am currently in heavy development for making my music playlist controller application be fleshed out, and potentially available for other people to be able to use. I am calling it the "PyMP'D Playlist" (pronounced "pimped playlist"), which is a Python-based Music Played Daemon (MPD) Playlist controller that manages the construction and control of the playlist in MPD using my current set of rules. Right now, it is very buggy and not recommended to be used unless you are intimately familiar with the code, but as of today, it now is scrobbling my music as I play it (again), so hopefully my scrobbles will return.

    The playlist is created by partitioning my large music library, based on tags I've marked different tracks with, into 15 separate categories. Each category then is weighted based on my preferences, and I load a number of tracks for each category based on the rules: Least Often Played, Least Recently Added [and not played], Least Recently Played, and Random. Further, there is an extra set of processing for the tracks that I consider my favorites in each category, which ensures my favorite tracks are always played. I then re-integrate all of the selections for each category together, shuffle the list, and this becomes my daily playlist.

    There is extra processing for whenever the list is processed during my pre-defined date ranges for holidays. Each holiday that is currently available also loads with the same processing rules for the categories above as well, and these holiday tracks are added into the playlist... so, for instance, the Christmas season has an increase in Christmas music, etc.

    I also am loading a set of podcasts that get aggregated and injected into the playlist at calculated intervals, so that the podcasts become part of my playlist processing.

    Finally, I have added support for last.fm scrobbling, so that Last.FM is updated with each track as it is played, and in turn, my last.fm recommended podcast will download new music from last.fm for me to listen to.

    I am planning on integrating Pandora.com's stations into the mix as well, making it possible to edit tags for each of my tracks in the playlist (as well as potentially being able to edit-update tags for podcasts that don't do a good job with their tags). I also want to build a GUI interface for people to be able to use the system in a prettier way.

    All in all, I've made some considerable progress on this system, and I am hoping that it will become something anyone can use and will enjoy.
  • 3 years later, and I've made even more progress with my music...

    14 Mar 2012, 22:05

    I got fed up with SqueezeBox Server, and Logitech's insistence that I must buy a SqueezeBox to really get the full benefits of the system... and the SqueezeBox Server's insistence to send a "Welcome to SqueezeBox Server" message on the stream I was listening to in the title for the songs... of every song.

    So... I ditched that software. I now am using Music Player Daemon (MPD), with some carefully constructed python code that generates a playlist for MPD to play. Along with lastfmscrobbled, and lastmp... I have my music being played, as a stream, in the most simple method possible, with me needing to do nothing to keep it running.

    Out of curiosity, I built my python script to be run from pypy, just to see how it works, and I'm fairly impressed with pypy, to be sure. I still have some work to do on the script, but I'm happy with the result -- an ever-changing & updated playlist being monitored and controlled by that script, and through use of the mpc command-line tool it controls mpd in a nice, simple manner. Scrobbling is now being controlled entirely by lastfmscrobbled and its lastmp client, and it works flawlessly.

    With some creative use of my squid3 proxy server, I even have the music stream being sent through https and password protected (I really only want to stream the music to myself). So... yay. Everything working exactly as I want it to.

    Of course, to make it all work right, I've also used TagScanner 5.1 to clean up all of my tags for all of my music, so that it can tell the python script how to work and everything... Which does mean that finally, everything I want to identify a song by is actually included *in* the song's tags directly (including group/category, favorite status, and other things I have specified) -- so my music dictates how the playlist generator works.
  • Finally free of the Apple monopoly on my music...

    25 Mar 2009, 18:22

    It took a little time, and research, but I'm finally free of the iTunes control over my music I had gotten into.

    It started with me getting an iPhone... yes, I was an early adopter, got it the 2nd day the iPhone hit the market. I then proceeded to load my music library onto my phone, unfortunately it couldn't hold everything. So I discovered smart playlists, and a trick to have iTunes, when it synchronizes with my phone, actually remove played songs from the phone and add new ones into it.

    Then... I got increasingly complex with my playlists... doing a heavy restructuring of the music in such a way to provide the kind of mix I wanted for my music. iTunes' smart playlists are impressive in what they can do. However, there were a few problems:

    1. The iPhone is notoriously buggy. Especially when I was having all of my smart playlists on the iPhone (and they work off of each other, playlists built from playlists and such). It got to the point that my phone would regularly crash after playing maybe 1 or 2 songs. This was unacceptable, and resulted in me no longer managing the playlists on my phone directly, but rather having iTunes simply load it with songs in a single playlist, and letting iTunes do everything else.

    2. iTunes gets very sluggish when you have a lot of inter-connected playlists. By a lot, I mean somewhere around 200 smart playlists tied together. iTunes isn't happy with that. The software seriously needs some optimizations with these things.

    3. The iPhone occasionally would not sync music correctly. Occasionally, I'd end up with just a part of a song file, rather than the whole thing. A bit jarring when you are listening to a sing, and then halfway through it changes to something else abruptly (or the real fun iPhone crashing because the file is corrupt). This would mean I have to completely remove ALL of the songs from the iPhone and resync. Such fun!

    4. iTunes doesn't work in Linux. This is a stickler for me, as I'm a long-time, tried & true user of Linux as my main OS of choice. I got sck of having Windows on my laptop, JUST for iTunes. So, I made a VirtualBox VM with Windows XP on it, and iTunes inside it.

    5. The iPhone doesn't like VirtualBox. Yes, I got it to sync my music and stuff to and from iTunes inside VirtualBox. But if I ever had a firmware update, it would never work right, I'd have to update my firmware from my work computer (which does run Windows), which is a pain, and then this occasionally had a similar effect as #3 above -- I'd end up losing all my music (because iTunes on my work computer "decides" that it now is in charge of the music on my iPhone, and would wipe the music when I updated my iPhone's firmware).

    6. VirtualBox occasionally does BAD THINGS. Like, for instance... corrupting the virtual disk partition in such a way it becomes unrecoverable. Good-bye iTunes running in VirtualBox system...

    This left me without a way to sync my music to my iPhone, very frustrated with my iPhone (which also has been steadily going from 5 bars Cell network connection to < 1 bar Cell network connection any more and completely unusable at my new home).

    So... I begin to look at other things. First, I tried the Firefly Media Server from Roku (formerly mt-daapd). Cool stuff, works a lot like iTunes, sends daap shares for daap-aware systems to pick up on. Very limited in its smart playlist functionality, so I built a Python script that duplicated, more or less, my efforts in iTunes. I was able to get my iTunes library up and running, somewhat, through Firefly.

    Then I found Logitech's SqueezeCenter. With a few plug-ins (notably the customscan, dynamic playlist, trackstat, and sql playlist plugins), and a little effort moving my Firefly database over to SqueezeCenter (mainly, I needed the old iTunes groupings I had, as well as my meticulously worked on ratings, dates added & last played, and play counts from my Firefly/iTunes library), I then proceeded to build a set of stored procedures, functions, views, and tables inside my SqueezeCenter database (I made it point to my own MySQL database server instance rather than its own). From those, I was able to completely duplicate what iTunes offered for smart playlists, through extensive SQL coding. Even better, I was able to make it work without needing further intervention on my part.

    SqueezeCenter also lets me stream the audio like an internet radio station, so my work computer can play it in WinAmp, my desktop & laptop comptuers at home use my favorite Banshee player, and my (now Jailbroken) iPhone uses vlc4iphone. All of them play off the same music library, and it works *very* well.

    And, the integration/scrobbling for Last.fm also is automated by the SqueezeCenter system, so regardless of what system I'm using, I have scrobbling going on :)

    So, t'hell with Apple's attempts to tell me how I want to listen to my music, I'm free and clear, and really enjoying the liberty I have with my music now :)