Music is a legal minefield when it comes to sharing and swapping. The best solution I have found to bypass this is Spotify. Spotify is absolutely perfect for this project as it allows access to a massive database of music. Users can build playlists and share them via URL or social media. The Spotify app automatically opens when the URL is accessed and opens the playlist ready for playing.
The next step was getting Spotify to interface with Arduino. I started by creating an applescript that would open a specific playlist on Spotify and start to play it. This was relatively easy and works extremely well. The next step was triggering this applescript via the Arduino. This proved far trickier than expected. I tried using Processing, however, I kept getting a lot of java based errors plus Processing has to carry out the applescript within its code and does not run an already available script. I gave up at this point and admitted defeat.
One week later I started attempt two. I’d done some more research into this and found a potential solution. The applescript editor included in OSX can accept plugins. I found one called SerialPortX. With the right code this can monitor the serial outputs from the Arduino within Applescript editor. My Arduino code is very simple and prints the number ’1′ whenever a physical button is pressed. The Applescript code watches the serial monitor and activates the Spotify part of the code when it detects that a ’1′ has been printed.
Although this process was very trial and error it works exactly how I need it to and will be beneficial when I start my Make Stage.
Video to follow soon…