Skip to content

CHill's Ramblings

Thoughts, ideas, and other such things I feel like putting here. About basically any topic.

Making my playlist processing be concurrent.

Posted on September 10, 2013August 2, 2021 By darkhelm No Comments on Making my playlist processing be concurrent.
0 0
Read Time:2 Minute, 17 Second

This may come as a shock to some people, but I have this itch to continually tweak my music playlist. It started with me having a set of songs I liked… And [un?]fortunately, this collection grew, and grew. Soon, I wanted to have a way to organize my music and ensure that I’m listening to a certain set of songs. Enter the iTunes Smart Playlists, which let me define, in Set Theory-like notation, multiple playlists each following a different set of rules, that I could combine together and randomize to produce a “daily playlist”, which I loaded into my Gen 1 iPhone. This worked fairly well.

Well… eventually I replaced that phone, and chose a less technologically-advanced phone (read: not a smart phone), and had to come up with some other way to get my music. So I took my music, and used a plethora of different streaming servers, building the same kind of functionality as I had with the iTunes smart playlists, building a daily playlist to stream to me at work (or wherever I can get the stream from). I eventually got fed up with most of the streaming servers, and settled onto Music Player Daemon (MPD). I also found a nice python library to interface with the MPD server, and control it (python-mpd2). This meant I could basically write my own playlist generator, how I wanted it, and have my music streamed through MPD, without all of the annoyances that the proprietary streaming servers were doing.
Now, several generations and revisions later, I have my own music database (the backend is unimporant, it will work with any database backend that SQLAlchemy can use) for my playlist generator, which has transformed into a playlist controller (it continually runs, and updates as songs are played through the day, eventually loading in a new batch of songs as the internal playlist gets used up). I have rebuilt it so that the database updating, and the playlist generating is all done concurrently, with multiple “worker processes” that drive handles chunks of the processing of each independently of the other processes. The beauty of this is that I can leverage multi-core computers for the playlist controller, and be able to have the processes spread around the different cores, which gives a nice performance boost.
Now, I am trying to add in new features to it. I want it to scrobble to last.fm. I want my holiday music playlist modifications to work again. I want it to play stuff from podcasts, I want to be able to mix in music from Pandora. These will keep m busy, now that I think I have the core processing working in a way I am comfortable with.

Share

Facebook
Twitter
Pinterest
LinkedIn

About Post Author

darkhelm

chill@darkhelm.org
http://darkhelm.org
Happy
Happy
0 0 %
Sad
Sad
0 0 %
Excited
Excited
0 0 %
Sleepy
Sleepy
0 0 %
Angry
Angry
0 0 %
Surprise
Surprise
0 0 %
Uncategorized

Post navigation

Previous Post: A Christian’s Response To: A Christian’s View of World of Warcraft (published in 2008)
Next Post: Smarter playlist length calculations

Average Rating

5 Star
0%
4 Star
0%
3 Star
0%
2 Star
0%
1 Star
0%
(Add your review)

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Archives

  • October 2021
  • August 2021
  • October 2019
  • November 2018
  • October 2016
  • September 2016
  • November 2015
  • September 2013
  • May 2013
  • October 2012
  • April 2012
  • March 2012
  • December 2010
  • November 2010
  • September 2010
  • August 2010
  • July 2010
  • January 2010

Categories

  • america
  • bitsy
  • blueprints
  • ejb
  • glassfish
  • gwt-syntaxhighlighter
  • jpa
  • jython
  • lies
  • network
  • politics
  • Uncategorized

Recent Posts

  • To Dave Hines, my friend, may you now have the joy you had spread to everyone around you.
  • Router Fun
  • False Peace
  • Moving away from the google universe.
  • The problem with people abusing scripture to attack entertainment

Recent Comments

  1. darkhelm on To Dave Hines, my friend, may you now have the joy you had spread to everyone around you.
  2. Matt Sutton on To Dave Hines, my friend, may you now have the joy you had spread to everyone around you.
  3. Unknown on Jonah, Jonah, did not obey God immediately…
  4. 1seanv on A Christian’s Response To: A Christian’s View of World of Warcraft (published in 2008)
  5. Unknown on Jonah, Jonah, did not obey God immediately…

Copyright © 2023 CHill's Ramblings.

Powered by PressBook WordPress theme