include c++ source files in a max external java project

Sep 4, 2010 at 5:08pm

include c++ source files in a max external java project

hi guys

I would like to add a c++ source file to a java max external project and call it in the main file..
do you guys know a way to do such a thing..

greets
tiago morgado

#52165
Sep 5, 2010 at 6:39am

You will need to rewrite the file. But not worries, from c++ to java is quite straight forward.

#187467
Sep 7, 2010 at 3:10pm

You could also use the max messaging system (create a symbol in C++ and send messages to it from Java). This would of course require some knowledge of C++.

#187468
Sep 7, 2010 at 6:14pm

I have not done it myself but know people who have: it is possible to create bindings to a compiled C library to call from your Java code. A quick google serach of “using c in java” seems to bring up some possibly helpful results.

#187469
Sep 7, 2010 at 9:18pm

@Roth Indeed, this is possible using the Java Native Interface which allows a java to link to native code dynamically and vice versa. However, Max java objects already run inside a JVM created by Max. To communicate with Max externals you would need to send messages to symbols (see the SDK for details).

#187470
Sep 15, 2010 at 2:54pm

@ Roth @ Hans Höglund – thank you so much for the helpful tips.. In fact I am creating a database of math expressions in order to optimize non-linear situations, etc. I’ve coded mandelbrot, fibonacci, etc. I will code some more fractals, I will code some graphs, maybe some system for balancing of permutations (I don’t know if you guys know something more specific about it).. and I want to pick up andré siers source code files in c++, from chaos-lib, in order, to include his externals in my database.. of course I will give him and the source code authors proper credit but there are actually a lot of work already done there.. and I would like to take advantage of it, once it is open source.. my object will probably be open source too

#187471
Sep 15, 2010 at 2:56pm

so that I can then, use neural networks, to optimize all the values for the expressions, and drive them in non linear situations for generative purposes

#187472

You must be logged in to reply to this topic.