pdj-logo java external plugin for pure-data

PDJ enables you to write java code to interact with pure-data objects. The API is totally based on Cycling74 Max/MSP 'mxj' object implementation. This will enable java mxj objects to run on pure-data with pdj.

This is a work in progress and some features are missing and some might not even be ported. I am trying to do my best to release soon and often! If you find any bugs feel free to contact me.

Is it compatible with mxj on Max/MSP ?

On the I/O level it is. Anything that deals on receiving/sending atoms will try to match extact mxj behavior. Off course, mxj is acting like a reference implementation. The API complience is based on Max/MSP 4.5.5 with MSP signal support.

How does it looks ?

This overview :

import com.cycling74.max.*;

public class help_class extends MaxObject {

public help_class() {
declareOutlets(new int[] { DataTypes.FLOAT, DataTypes.ALL });
}

public void inlet(float x) {
outlet(0, x);
}

public void bang() {
outlet(1, "BANG! received");
}

public void callme(Atom args[]) {
outlet(1, "callme has called with arg1:" + args[0].toString());
}

public void dynamic_method() {
outlet(1, "dynamic_method has been called");
}

}
Looks like this:

pdj-help example

Please see the javadoc for more information.

How to write pdj externals:

Edit your .java in the /classes directory (in the pdj home) with your favorite editor. Type the name of the .java file (without the extension) into the pdj object argument. If pdj finds out that the .java is younger than the .class, pdj will compile it for you.

JavaScript support

JavaScript externals can be written using the embedded pdj object "jjs". This class wraps JavaScript objects by using Rhino. The API is similar to Cycling74 "js" object in Max.

// example of a pd "javaScript" object:
post("js in pdj");

inlets = 2; // number of inlets to define
outlets = 4; // number of outlets to define

// this function will be called when a float is sended an outlet
function float_msg(val) {
	outlet(0, val)
}

// this function is called when the message "what" is sended. 
function what(msg1, msg2) {
	post("what ?", msg1, msg2);
	post("number of arguments", arguments.length);
}

// send float '1.0' to [r reader] object.
function great() {
	messnamed("reader", "float", 1);
}
pdj jjs

Requirements:

  • pure-data 0.41.x
  • java jdk 1.5.x or better; use java 1.6 !!!
  • apache ant 1.5.x or better for building
  • works on Linux / Windows / OS X
  • Download:

    Download latest release here: pdj-0.8.7.tar.gz / pdj-0.8.7-win32.zip / pdj-0.8.7-osx.tar.gz - for 10.4/10.5 (March 2010)

    Documentation: pdj.pdf

    Contact: asb2m10 .at. users.sourceforge.net