The Sonic Landscape

Parsing (Pachube) XML Data directly into Max/Msp (updated version)

Posted on | December 6, 2010 | 2 Comments

Here is another quick update on how i’ve been parsing XML data (from Pachube) into Max/Msp.

My earlier blog post (here) went into some detail on how I had managed to read the XML data, although the previous version was not ideal.  I’ve since updated it and hopefully it will help others who are also trying to input Pachube data into Max/Msp.

The screenshot below gives details on how to parse the XML file (line by line). Change the Feed ID to the Pachube feed you wish to import. Also, you’ll need to enter your own valid Pachube API key into the text box.

I still have to specify the ‘line number’ which holds the value i wish to import (this could be different for other users using different feeds).  Double click [jit.textfile] to read the XML file in Max, then specify the line which contains the value you wish to output.

Credits and thanks to Luke Hall, for his helpful Max/Msp forum posts regarding XML and the [jit.textfile] object!

(Click the image below for larger view)

I hope to experiment further over the next few weeks to see if there is a simpler way of gathering the data (preferably without having to specify the line number).

Shown below is a zip file containing a version of the patch (with added comments.

Download – pachube test patch (zip file, 4KB)

If further help is needed, just send me a message using the contact form (shown on the contact page, linked at top of this blog)…thanks!

Comments

2 Responses to “Parsing (Pachube) XML Data directly into Max/Msp (updated version)”

  1. Joel
    March 31st, 2011 @ 6:31 am

    Hi Guy,

    Thanks for sharing your Pachube to Max Patch, looks very handy indeed.

    I’ve downloaded and opened the patch in Max5, filled in the various variables, but when I get to step 4 (double click to bang), all I get in my max window is an error message. Object: jit.textfile, Message: doesn’t understand “download”. Have I missed something very basic here? PS. Great blog site, heaps of really interesting e-art related info!
    PPS. The contact form on your contact page doesn’t appear in any of my browsers (Mac: Safari, Firefox, Iron)

    Thanks in advance,
    Joel in Western Australia

  2. Guy
    March 31st, 2011 @ 9:17 am

    Hi Joel, Thank you so much for your comments.

    I have now fixed the contact form on my blog.
    I recently updated the wordpress plugin and it seemed i also needed to reactivate the plugin. Thanks for letting me know that it wasn’t working correctly.

    Also, the xml parser (Pachube to Max) max/msp patch has since been updated and is now available at http://apps.pachube.com/#mc
    (scroll down to the bottom of page).

    The current version of Pach2Max (1.01) includes a few updates to the early test version shown on my blog). I would be very grateful if you could give the updated version a test.

    p.s You might also like to test out these max/msp Pachube patches, created by Nnimar (from the max/msp forums).
    http://cycling74.com/toolbox/pachube-tools/

    He created 2 max/msp patches, one gets data from Pachube (using OSC) and the other patch receives XML data from a CC128 Current Cost meter.

    Thanks again for your comment and good luck with your projects!

Leave a Reply





*

  • Pages

  • Admin

  • Archives