To register and login, use your Google, Twitter, Facebook, LinkedIn, or OpenID credentials.

This is allowing us to stop most spam registrations. We've deleted most of the spam accounts that got through, and we're closely watching for more.

Libpd + processing => desktop java application

berengerberenger Posts: 56
edited April 2013 in Pd Everywhere

Hello Everyone,

I tried to build a java application using processing and libpd I have a little trouble setting up a sample project. Basically I added processing-core.jar and libpd.jar to a new java project. I used the class from libpd samples, and i have trouble linking to the patch. Here is how it goes :

package test;

// p5 stuff import processing.core.*; import*; import processing.event.*; import processing.opengl.*;

// java stuff import java.util.HashMap; import java.util.ArrayList; import; import; import; import; import; import;

//pd import org.puredata.core.*;

// main class : the PApplet extension seems to cause an issue with the hadling of exceptions

public class test extends PApplet {

 public static void main(String[] passedArgs) {
           String[] appletArgs = new String[] { "test" };
            if (passedArgs != null) {
              PApplet.main(concat(appletArgs, passedArgs));
            } else {

            JavaSoundThread audioThread = new JavaSoundThread(44100, 2, 16);
            int patch;
            patch = PdBase.openPatch("patch/test.pd"); // error
            Thread.sleep(5000);  // error
            audioThread.join(); // error

 // the rest is just processin stuff
public void setup() {
    size(600, 600);

public void draw() {
    fill(0, 25);
    rect(0, 0, width, height);

    for (int i = 0; i < 5; i++) {
        point(random(600), random(600));

    if (mousePressed) {
        PdBase.sendFloat("hello", random(48, 72));



Eclipse asks to add a throws declaration at the line loading the patch and also the Thread.sleep(5000); line aswell at the audioThread.join();

If I do so I get an error at the public static void main(String[] passedArgs) throws IOException stating that : Exception IOException is not compatible with throws clause in PApplet.main(String[])

Could somebody point me in the right direction to resolve this ?



Sign In or Register to comment.