Last chance to enter The Hackaday Prize.

Forever.fm: Infinite Beat-matched Music

Forever.fm is [Peter]‘s combination of SoundCloud and The Echo Nest that plays a continuous stream of beat-matched music. The result is a web radio station that just keeps playing.

[Peter] provided a great write up on how he built the app. The server side is Python, using the Tornado web server and Tornadio2 + Socket.IO for handling live updates in the client. To deal with the challenge of streaming audio, he wrote a LAME interface for Python that handles encoding the raw, beat-matched audio into MP3 blocks. These blocks are queued up and sent out to the client by the web server.

Another challenge was choosing songs. Forever.fm takes the “hottest” songs from SoundCloud and creates a graph. Then it finds the shortest path to traverse the entire graph: a Travelling Salesman Problem. The solution used by Forever.fm finds an iterative approximation, then uses that to make a list of tracks. Of course, the resulting music is going to be whatever’s hot on SoundCloud. This may, or may not, match your personal tastes.

There’s a lot of neat stuff here, and [Peter] has open-sourced the code on his github if you’re interested in checking out the details.

Comments

  1. Kris Lee says:

    I’m not sure that it falls into the hack* category but it is a great writeup and nice implementation nonetheless.

  2. M4CGYV3R says:

    “beatmatched”

    I don’t think that word means what you think it means. There are many songs that can’t or shouldn’t be mixed because of tempo, key, and style differences.

    For example, I just heard it BLEND Adele – Skyfall into Tetris by Doctor P. Not even remotely a ‘mix’.

    For orchestral intro/outro songs or non-beat-oriented music, it’s pretty good.

    • pelrun says:

      No, it *should* be beatmatched. That’s what the Echo Nest integration is for – it analyses tracks and provides extremely detailed information which includes things like tempo. So transitions should only be happening between tracks that are close in those respects.

      That said, generating a tracklist that perfectly minimises the differences between consecutive tracks would require solving the TSP – since you can’t do that, you occasionally get transitions that are less than perfect, as you noticed.

      • M4CGYV3R says:

        I’m not trying to lessen the accomplishment – it is an extremely sleek site with a nice bit of kit on the backend. However, it should *NOT* be stated as ‘beatmatched’. It should be ‘blended’.

        I didn’t ‘occasionally get transitions that are less than perfect’. I got complete trainwrecks, constantly, every mix. I have yet to hear a single properly ‘beatmatched’ mix from this thing over several hours of listening.

        I’m not familiar with EchoNest, however, I am extremely familiar with audio analysis software. Audio analysis is not the most fun thing I have coded. I can attest that it is a PAIN in the ass to process audio frames, and as music varies so much between styles and songs, auto-matching never works for all music.

        I have been a DJ for about 12 years. I can say definitively that this is not proper beatmatching in any way. As far as I can tell, there is no alignment of the standard 8-beat divisions which DJs rely on to beatmatch, and there is no alignment of measures and parts of the song to avoid the ‘shoes in a dryer’ effect even if the tempos are made the same.

        • Erik Johansson says:

          Since you seem to have experience maybe you could tell us of any other software that does this better. The worst thing I can say is that the vocals mostaly badly “beatmatched”.

          Still it’s a wonderful automagical web radio..

    • ed says:

      It’s a very cool setup.

      FYI I heard the skyfall –> tetris one and thought it was hilarious/awesome.

  3. anons says:

    No fuking volume control

  4. John says:

    Not a hack. This is a business card masquerading as a free online service.

    Anyway, certain songs keep coming up and are obviously being used as “glue” in the playlist. That’s a kink that needs to be worked out, but it’s probably beyond the scope of the purpose of this piece of work.

  5. Kshi says:

    Complex programming resulting in software that effectively DJs like Paris Hilton. (pressing the sync button to cue the next song at the end of the previous track). Now if only you could have it pre-record its sets for large live performances, it could take on David Guetta as a Top DJ. All joking aside, it is pretty nicely done.

  6. Who? says:

    Welp This has just become my new favorite thing to listen to, I wouldn’t mind seeing a standalone windows app that sits in the taskbar.

  7. Stefaan says:

    This is great!

  8. Bloodlock says:

    It only needs a volume button… >______<"

  9. CG says:

    I can’t tell if it’s trainwrecking or just dubstep.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 91,175 other followers