processing.js in Max

Nov 15, 2012 at 9:07am

processing.js in Max

Hello

No news about use processing.js inside Max
Is it possible or not?
It would be amazing!

#65226
Nov 16, 2012 at 4:19am

I’ve been thinking about this… would it be possible to export to javascript and then just use [js]?

#235047
Nov 16, 2012 at 8:18am

it would be great to use directly [jsui]
I will try this morning, if it works i will share an exemple

#235048
Nov 17, 2012 at 7:07pm

I got this to work. It uses [jweb] so I don’t know what kind of output/input you can get from this way of doing it.

But at least I got something to work :)

Attachments:
  1. processingTest.zip
#235049
Nov 18, 2012 at 9:17am

I tried your patch on a windows computer without any luck. Any idea why this is? I can open the html document separately. Jweb finds the file htmlProcessing.html, it just does not display anything.

#235050
Nov 19, 2012 at 12:32am

I just tried downloading and opening what I posted and it works here.

It should work on windows, I didn’t use an external and processing.js is the same for all platforms.
Maybe try your own processing sketch? It didn’t work for the first sketch I tried to run, and I never found out why.
You can just modify the html file (which by the way contains an extra line I commented out because I originally copied the html from the processingjs.org homepage – in case you were wondering what that was) to have your file name instead (and make sure your sketch is in the folder with the max patch).

If another sketch doesn’t work, then I might suggest asking on the processingjs forum about javascript compatibility. maybe?

#235051
Nov 20, 2012 at 4:37am

http://js.processing.org/reference/articles/jsQuickStart#javascriptonlyprocessingcode

This link might prove to be useful… also if you scroll up a bit there’s a heading called “Pre-compiling Processing code to JavaScript” which is what I’m trying to do now.

#235052
Dec 5, 2012 at 6:17pm

Looks like I’m the only one interested in this ;) hehe

BUT, I just figured out what the deal is with libpd…. and it’s not Max, but PD… and it’s not processing in PD, but PD in processing
I know it’s a little off topic, but I thought it may be useful to know about

This website was most useful to getting it to all work:

http://robertesler.com/libpd-with-processing/

-Mike

#235053
Apr 16, 2014 at 2:56pm

Hi, I know this has sat idle for a while, but I am wondering if you pushed on this any further? I am trying to simplify a set up that includes a Processing sketch that sends video data out a serial port by pulling that data via syphon from wherever… I’d prefer if I could somehow wrap that part of the system (the processing sketch) up into some javascript and just run it inside my Max patch, skip the syphoneing and just send my jitter matrix right into the js…

#286825
Apr 17, 2014 at 9:05am

I have worked on this pretty extensively. I am currently working on a porting library for processing sketches using mgraphics.

The basic idea is you take your processing sketch, convert it to java script (which is pretty easy after you have done it a few times) then run the sketch. It should appear and behave as it does in processing.

Although I have not ported over the full precessing API, I have enough here to do some interesting stuff. I have attached what I have so far. Feel free to give it a spin and let me know what you think.

Please put processinglib.js in your Max jsextentions directory, then restart max before running the sketch.

#286922
Apr 17, 2014 at 8:03pm

hey Anthony this looks really interesting but can’t seem to get it working:

loading P_2_2_3_02
js: processinglib.js: Javascript ReferenceError: mgfx is not defined, line 226
js: processinglib.js: Javascript ReferenceError: mgfx is not defined, line 226
js: error calling function setup [P_2_2_3_02-2.js]
jit.pwindow: jit.pwindow: object u905000363 is not a valid matrix
js: P_2_2_3_02-2.js: Javascript TypeError: plib.draw is not a function, line 93
js: error calling function bang [P_2_2_3_02-2.js]

#286969
Apr 18, 2014 at 7:49am

Well that is strange…

What version of Max are you running? Are you Windows or OSX?

#287009
Apr 18, 2014 at 5:22pm

here’s the details; the js object instantiates and I can see the code when it is sent the open message. The js extension is where you specified…
OSX 10.6.8, {
“version” : “Version 6.1.4 (22b50b3)”,
“platform” : “mac”,
“arch” : “x86″,
“osversion” : “Mac OS X Version 10.6.8 x86_64″,
“samplerate” : 44100,
“iovs” : 1024,
“sigvs” : 64,
“scheduler_in_audio_interrupt” : “off”,
“audio_drivername” : “Core Audio”,
“audio_driver_subname” : “”,
“eventinterval” : 2,
“overdrive” : “off”,
“mixerparallel” : “on”,
“mixercrossfade” : 1,
“mixerlatency” : 30.0,
“mixerramptime” : 10.0
}

#287056
Apr 19, 2014 at 8:53am

Okay, I sorted out the problem. I sent the wrong version of processingLib.js
I have attached a new version. Please put it in your jsextension directory and
restart Max. Then start the sketch and let me know if it works.

Attachments:
  1. processinglib.js
#287092

You must be logged in to reply to this topic.