Forums > MaxMSP

Calling Python from Javascript

July 23, 2012 | 1:49 pm

http://www.maxmsptutorials.com/2011/07/11/wtf-is-js-tutorial-2-is-up/

Having recently found out about the js object, having to learn Javascript is something I’d like to avoid if possible.
I’m quite fond of Python and would like to know if it’s possible to invoke Python from a javascript callback, called by Max/Msp.
I would just write my custom code in Python, then return to the javascript that called it.

Would someone point me to an example?

Thanks



pid
July 23, 2012 | 1:55 pm

best way is probably:

http://www.loadbang.net/space/Software/net.loadbang.jython

although learning js and/or lua for all your max needs is the best option – does not take long.

good luck.


July 23, 2012 | 5:16 pm

Another alternative is to use Thomas Grill’s py external. It is an external that supports python 2.7.
You can load classes and execute code.

http://www.maxobjects.com/?v=objects&id_objet=1688&requested=Python&operateur=AND&id_plateforme=0&id_format=&PHPSESSID=3abd5ee576145ed9675335d299fe796d


July 23, 2012 | 8:15 pm

"Another alternative is to use Thomas Grill’s py external. It is an external that supports python 2.7.
You can load classes and execute code."

Thanks. I will give this a try.

There’s too much about Max to learn, I don’t want to waste any timer leaning any J-languages.


July 24, 2012 | 12:21 pm

There is not much documentation on the py external , but here is the help file I created. If you can not
find the scripts for it on Thomas’s website, let me know and I can post those too.

Attachments:
  1. py.maxhelp

July 24, 2012 | 4:09 pm

"There is not much documentation on the py external , but here is the help file I created. If you can not
find the scripts for it on Thomas’s website, let me know and I can post those too."

Thanks Anthony,and to all who replied


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