Noob java – max question

Sep 21, 2011 at 7:00pm

Noob java – max question

Sorry for noob question guys, I’m new to coding and stuff and its relationship with an object language like maxmsp. Basically I want to know if there is anyway to turn a max patch into javascript – I need a way to change patches into common code (I know I can’t do C, but I know max works with java so thought it might be worth a shot asking).

Many Thanks for any replies
Nick

#58976
Sep 21, 2011 at 7:15pm

As I understand the question: no. javascript can be used to “auto-generate”/”script” Max patches….but a Max patch cannot be made a javascript program that would function in a browser without Max.

#211857
Sep 21, 2011 at 7:16pm

Thanks Charles, guess I’m better of learning C then

#211858
Sep 21, 2011 at 7:44pm

What is it you want to do anyway ?

#211859
Sep 22, 2011 at 8:51am

Well, I wanted to make something in Max (ideally) and then somehow have that running in a browser – I got excited about Native Client from google but realised it only supports native code C and C++. So I guess I back to being faced with learning one of those or Flash

#211860
Sep 22, 2011 at 9:02am

Now, I don’t know how feasible this is but you do realize that both Max and all common browsers contain a javascript engine ?

So while you cannot turn a Max patch into javascript code you can embed javascript code into a max patch (or a max project). And that might give you options enough to have that code executed in a browser.

#211861
Sep 22, 2011 at 9:24am

#211862
Sep 22, 2011 at 9:28am

The only problem I see is that it might mean I just need to learn Jscript and max becomes redundant anyway?

#211863
Sep 22, 2011 at 9:30am

That question is impossible to answer without knowing what this is all about.

#211864
Nov 17, 2011 at 10:32pm

hi guys, i take it this answers my similar question of:

if you write an external in eclipse with java, can it run inside that compiled application/applet and interact with the code?

im using java/processing for an audio based game and wondered if for example a granular sampler could mangle the bg music when the player dies? i kind of assumed you cant since there isnt any info on it but im not sure what with using eclipse etc

thanks in advance

#211865
Nov 24, 2011 at 1:54pm

@CR4SH3D:
In short no! :)

In long: An external written in java is a class that extends a parent class (i.e MaxObject). These classes are defined in the .jar files that come with max and they do interact with the Max/MSP application. Very similar to function JavaScript inside Max you can use your Java class (through th [mxj] object to interact with max.

Think about both (Java and JS) as a kind of (programmable remote-control) to Max/MSP/Jitter.

The difference between Java and JavaScript inside Max is that Java inside Max has more options than JavaScript. It can not only interact with the Max/MSP application but also with the computer itself (i.e. you can create your own windows, make network connections and many other things). And it is much much faster than JavaScript.

So even if you write a Max Java class and you would manage to implement this class in your processing environment you still don have the Max/MSP functionalities inside processing.

So you cannot “import” the sound engine of Max into Processing by using Max-Java Classes.

I don know much about processing at this point but it seems to be a Java-Framework with a focus on visualizing data…

So it would be most likely possible to interact between Processing and Max – but this would be in a more indirect way i.e. by sending data from one app to the other via a network.

J.

#211866
Nov 24, 2011 at 9:04pm

Hey, i would reallllly appreciate if someone can help me out pleasee.
Well, i have the java code written, with the interface and sounds(predefined) in eclipse…
But now, what i wanna do is send that sounds from eclipse to max msp, so that i can process that sound with effects through that max msp patch!! How to do that? HELP!!

#211867

You must be logged in to reply to this topic.