I wish to learn how to run a Processing sketch using external libraries like HYPE and MINIM on a web page. I am able to run a sketch that does not use an external library successfully after reading the basic tutorial. But not with external libraries.
Asked
Active
Viewed 71 times
1
-
In the future, please be more specific. What have you tried exactly? What errors are you getting? Where is your [mcve]? Can you link to a CodePen? – Kevin Workman Aug 16 '18 at 16:28
1 Answers
1
Short answer: you can't.
It sounds like you're using Processing in Java mode and then using Processing.js to deploy as JavaScript.
This will work for simple sketches that don't contain any Java-specific code, and don't contain any Processing 3 code. This is because your Processing code is converted to JavaScript, but that conversion can't be done on arbitrary Java code. This also means you can't use Java libraries like Minim. And Processing.js has not been updated in several years, so you also can't use newer Processing 3 features.
So at this point you have a few options:
- You can eliminate the libraries altogether.
- You can find JavaScript versions of the libraries to use instead. Google "Processing.js minim" for a ton of results.
- You can deploy as a Java application instead of embedding in a website.
- You can rewrite the whole thing in P5.js.
Shameless self-promotion: here is a tutorial on using Processing.js.

Kevin Workman
- 41,537
- 9
- 68
- 107
-
Thanks Kevin. I kind of got it around working by pasting the entire HYPE.pde within the sketch pde. i know thats a very sorry work around, but thats what I kind of have for now.. Thanks again. Checking out your tutorial now. – Ujjwal Agarwal Aug 22 '18 at 09:04