EchoNest Explorations

Working on a pretty amazing site for Chris Bulter’s Major Glitch project in which the longest pop song in the world is to be interactively re-asselbled and made even longer through collective development. Henry Lowengard turned us on to EchoNest, and EchoNest Remix, so have been experimenting with the JavaScript and Python Remix APIs and today looking at a php wrapper for the basic EchoNest API.

Finally going ahead to install PHPUnit on the OSX server. That was a little time consuming. This tutorial helped a bit. Ended up installing wget as well and using phar method to install. Also took a minute to realize that phpUnit runs on the command line, not via a browser (be default, anyway).

Have easily adapted one of the test apps, Capsule, to assemble various tracks into a single track. Just had to change the part that selects a specified segment (default 8 seconds) of each track to selecting the whole (of each) track.

Next steps:

  • confirm it can handle dozens of tracks
  • interface with front end (wordpress?)
  • what interesting ways can we set, store and parse metadata about the audio segments

It can definitely handle a bunch of tracks, but one awesome 8 second bit is being left out and the 12 minute one is getting cut short. So there’s that to figure out. Taking some time now to experiment with installing in a shared environment.

I need to understand the unix $PATH environment variable better.

Not sure if this is really going to work on a shared server. The tutorial referenced above is using a package called Passenger – designed for use with Ruby and Python code – which my server doesn’t include.

Ended up using php’s proc_open to call the remix python script as a child or sub-process (if I’m understanding correctly), and using stream_set_blocking and stream_select to keep the ports open until the python script completes.