Forums > MaxMSP

Mac iTunes file path regex

December 16, 2010 | 2:58 pm

I am visualizing iTunes music library with Processing.
I send the filepath of the selected song to Max Msp over maxlink.
I then prepend the read command, and send the message to the jit.qt.movie object, that can read mp3s.

The problem is that the filepaths, that come from the iTuneslibrary.xml look like this "file://localhost/Users/peko6107/Music/iTunes/iTunes%20Media/Music/E-Z%20Rollers/Weekend%20World/12%20Short%20Change.mp3"

And Max Msp doesn’t know how to read this. I’m guessing it’s some sort of standard format iTunes uses and should be decodable with regexp object. I know %20 means space, but some songs have a bunch of other strange symbols in such as %5B, which is [ and so on…

Does anyone have the über regexp object expression that decodes iTunes format into mac/max msp format?


December 16, 2010 | 5:35 pm

you are faced with the issue of URL encoding:
http://www.blooberry.com/indexdot/html/topics/urlencoding.htm
In your max5 folder, there is /examples/javascript/lists+strings/urlescape-example.maxpat
which should solve your problem, more or less.


December 17, 2010 | 4:27 pm

pnyboer, Thank you soo much, that is exactly what I needed.
P


Viewing 3 posts - 1 through 3 (of 3 total)