Max XML to JSON conversion

update 6/2014 – In the internet-sensors chatbot project, I am using a python script to convert xml to json: https://reactivemusic.net/?p=9834 – also the most recent version of Max 6.1.8 now includes JSON parsing in the javascript object

original post

notes:

Lest I completely forget. There is now an xml.parse object in max.

  • So I have figured out how to write xml files from an http request using jit.textfile
  • How to read an xml file into javascript
  • many ways of parsing xml in max using externals from sadam, jasch, and xml.parse – see weather report from mz
  • some – ways of converting xml to json using php (not quite), java, and node.js – but not yet in core javascript.

So the current approach is to try to find or write a javascript function to convert and xml string to a json object – or even to a json string. Or to find a generic xml/json converter which can be run in the background from the command line

 

Max XML to JSON

update 4/2014 – Max6.1.7 js object now incudes JSON parsing

notes

(update) none of these worked – the solution ended up being a patch from Peter Nyoeber explained elsewhere in this blog…

Looking for a solution to converting xml to json in max

https://gist.github.com/4153569

From this…

http://davidwalsh.name/convert-xml-json

From Stack Overflow – a simple function…

http://stackoverflow.com/questions/7769829/tool-javascript-to-convert-a-xml-string-to-json

Speech recognition in Max

(update 6/2014): its easier to use the Google speech-api by calling it from curl. See recent examples at: https://reactivemusic.net/?p=4690

original post:

from Luke Hall in the c74 forum:

http://cycling74.com/forums/topic.php?id=18403

I’ve used Macspeech Dictate in this way. In fact it uses the same speech recognition engine as Dragon Naturally Speaking, it works very well but you could potentially run into the same problems as CJ described above.

Another way to achieve this on a mac is using the built in voice recognition and applescripts and extra suites, which is an applescript extension that extends the range of what you can do, including letting you send key presses.

1. Turn on “speakable items” from system preferences > speech > speech recognition.
2. Open max.
3. Open script editor and write a script like this:

tell application “MaxMSP” to activate
tell application “Extra Suites”
ES type key “1”
end tell

4. Save it in library > speech > speakable items > application speakable items > maxmsp and name the file whatever you want the voice command to be, for example “press one”
6. Now on the floating speech icon click the down arrow at the bottom and “open speech commands window”. With max as the front-most application check that the commands you just saved as applescripts have appeared in the maxmsp folder.
7. Now simply hook up a [key] object in max, press “escape” (or whichever key you have set up to turn speech recognition on) and say “press one” and you should have [key] spit out “49”!

Sorry about the length explanation I hope it makes sense to you and gives you another possible (and cheaper!) method of obtaining you goals.

Oh and the applescript extension can be downloaded from: http://www.kanzu.com/

lh

10 hours of audio uploaded to SoundCloud every minute

By Martin Bryant in thenextweb.com

http://thenextweb.com/insider/2012/12/04/with-10-hours-of-audio-uploaded-every-minute-soundcloud-rolls-its-new-site-design-out-to-all-users/?fromcat=all

Like with Youtube, the inflow of information exceeds our ability to consume it.

soundcloud

And this… http://thenextweb.com/insider/2012/12/04/soundcloud-has-near-doubled-its-registered-users-to-almost-30m-since-may-interview-with-cto-eric-wahlforss/

The following clip was inserted by using the embed code from the thenextweb.com site and pasting it into the html editor.

JSON parser in Max

by Peter Nyboer

update 6/2014 – Peter Nyboer’s method has been used successfully with most of the Internet sensors projects: https://reactivemusic.net/?p=5859 But as of Max 6.1.8 JSON parsing is built into Max js object.

original post

This post may have a real answer. It reads and writes JSON files. Note the the actual patch from Peter Nyoeber is near the bottom of the post. I have downloaded it into max teaching example/JSON_readwrite.maxhelp

http://cycling74.com/forums/topic.php?id=33601

All the rest of the stuff in this post has not been tested…

json to dict?

http://cycling74.com/forums/topic.php?id=40390

See if we can figure out this xml to json converter

http://cycling74.com/forums/topic.php?id=38631

another twitter4j thing but I can’t figure it out yet

 

http://cycling74.com/forums/topic.php?id=41843