Hi there,
Forgive me as I’m very removed from Processing and only used it 5 years ago for this specific project in college. I’m coming back to it as I’d like to share it with a friend, but can’t seem to find a solution.
I understand there are multiple ways to do this, i.e. embedding the program as Javascript, exporting it as an application and uploading it a host, etc…
Here’s my process. I’m on macOS Monterey 12.6.3. My project uses a Minim library including image and audio files. The .pde file opens and runs great in Processing 4.2 (most recent) but not Processing 3.3.7 which I wrote the code in. In 3.3.7 the code doesn’t open at all, just a blank sketch.
In 4.2 I Export Application, select macOS 64-bit (and Windows), check Include Java, and have already installed the Code Signing files.
The console only says “Done exporting.” No errors. The resulting .app file doesn’t open properly, it’s only a gray rectangle.
The project itself is a sort of soundboard pulling audio files from songs on an album I loved. Here’s the meat and potatoes of the code below including the first song’s code. Everything that would come after (passes the character limit) calls forward specific audio files when clicking square areas and has Minim play/pause/rewind others which might be unnecessarily convoluted, but it was college. The only thing I’m clueless to remember is what the variable ‘patrick’ was supposed to represent, maybe it was an example taught in class which doesn’t actually affect anything.
I’d appreciate your insight in figuring out how to export this properly for macOS and Windows with the ultimate goal to share it on a site either embedded or uploaded. I’ll try to be quick with responses.
Thank you!
// import of the minim library and declaring special AudioPlayer variables
import ddf.minim.*;
Minim minim;
AudioPlayer greenlight1;
AudioPlayer greenlight2;
AudioPlayer greenlight3;
AudioPlayer sober1;
AudioPlayer sober2;
AudioPlayer sober3;
AudioPlayer dynamite1;
AudioPlayer dynamite2;
AudioPlayer dynamite3;
AudioPlayer louvre1;
AudioPlayer louvre2;
AudioPlayer louvre3;
AudioPlayer liability1;
AudioPlayer liability2;
AudioPlayer liability3;
AudioPlayer hardloveless1;
AudioPlayer hardloveless2;
AudioPlayer hardloveless3;
AudioPlayer hardloveless4;
AudioPlayer soberII1;
AudioPlayer soberII2;
AudioPlayer soberII3;
AudioPlayer writer1;
AudioPlayer writer2;
AudioPlayer writer3;
AudioPlayer supercut1;
AudioPlayer supercut2;
AudioPlayer supercut3;
AudioPlayer supercut4;
AudioPlayer reprise1;
AudioPlayer reprise2;
AudioPlayer reprise3;
AudioPlayer perfectplaces1;
AudioPlayer perfectplaces2;
AudioPlayer perfectplaces3;
AudioPlayer perfectplaces4;
AudioInput input;
// Statements in in setup are only executed once
PImage background;
PImage background2;
PImage information;
int x;
int y;
int z;
int scene=0;
int patrick;
void setup() {
size(1300, 525);
background = loadImage("background.png");
background2 = loadImage("background2.png");
background(background);
//background(21, 4, 29);
// the variable "minim" is called each time a new sound is imported into the sketch
minim = new Minim(this);
greenlight1 = minim.loadFile("greenlight1.mp3");
greenlight2 = minim.loadFile("greenlight2.mp3");
greenlight3 = minim.loadFile("greenlight3.mp3");
sober1 = minim.loadFile("sober1.mp3");
sober2 = minim.loadFile("sober2.mp3");
sober3 = minim.loadFile("sober3.mp3");
dynamite1 = minim.loadFile("dynamite1.mp3");
dynamite2 = minim.loadFile("dynamite2.mp3");
dynamite3 = minim.loadFile("dynamite3.mp3");
louvre1 = minim.loadFile("louvre1.mp3");
louvre2 = minim.loadFile("louvre2.mp3");
louvre3 = minim.loadFile("louvre3.mp3");
liability1 = minim.loadFile("liability1.mp3");
liability2 = minim.loadFile("liability2.mp3");
liability3 = minim.loadFile("liability3.mp3");
hardloveless1 = minim.loadFile("hardloveless1.mp3");
hardloveless2 = minim.loadFile("hardloveless2.mp3");
hardloveless3 = minim.loadFile("hardloveless3.mp3");
hardloveless4 = minim.loadFile("hardloveless4.mp3");
soberII1 = minim.loadFile("soberII1.mp3");
soberII2 = minim.loadFile("soberII2.mp3");
soberII3 = minim.loadFile("soberII3.mp3");
writer1 = minim.loadFile("writer1.mp3");
writer2 = minim.loadFile("writer2.mp3");
writer3 = minim.loadFile("writer3.mp3");
supercut1 = minim.loadFile("supercut1.mp3");
supercut2 = minim.loadFile("supercut2.mp3");
supercut3 = minim.loadFile("supercut3.mp3");
supercut4 = minim.loadFile("supercut4.mp3");
reprise1 = minim.loadFile("reprise1.mp3");
reprise2 = minim.loadFile("reprise2.mp3");
reprise3 = minim.loadFile("reprise3.mp3");
perfectplaces1 = minim.loadFile("perfectplaces1.mp3");
perfectplaces2 = minim.loadFile("perfectplaces2.mp3");
perfectplaces3 = minim.loadFile("perfectplaces3.mp3");
perfectplaces4 = minim.loadFile("perfectplaces4.mp3");
//player1.loop();
// the sounds do not play until activated
//Load Images
} //ends void setup
// Statements in draw are executed repeatedly (looped)
void draw() {
if (scene==0) {
if (patrick==0) {
background(background);
}
patrick=patrick+1;
//GREEN LIGHT - GREEN
if (mousePressed) {
if (mouseX > 125 && mouseX < 175 && mouseY > 125 && mouseY < 175) {
greenlight1.rewind();
greenlight1.play();
greenlight2.pause();
greenlight3.pause();
sober1.pause();
sober2.pause();
sober3.pause();
dynamite1.pause();
dynamite2.pause();
dynamite3.pause();
louvre1.pause();
louvre2.pause();
louvre3.pause();
liability1.pause();
liability2.pause();
liability3.pause();
hardloveless1.pause();
hardloveless2.pause();
hardloveless3.pause();
hardloveless4.pause();
soberII1.pause();
soberII2.pause();
soberII3.pause();
writer1.pause();
writer2.pause();
writer3.pause();
supercut1.pause();
supercut2.pause();
supercut3.pause();
supercut4.pause();
reprise1.pause();
reprise2.pause();
reprise3.pause();
perfectplaces1.pause();
perfectplaces2.pause();
perfectplaces3.pause();
perfectplaces4.pause();
fill(0, 239, 172);
rect(125, 125, 50, 50);
}
} else {
fill(126);
rect(125, 125, 50, 50);
}
if (mousePressed) {
if (mouseX > 125 && mouseX < 175 && mouseY > 225 && mouseY < 275) {
greenlight1.pause();
greenlight2.play();
greenlight2.rewind();
greenlight3.pause();
sober1.pause();
sober2.pause();
sober3.pause();
dynamite1.pause();
dynamite2.pause();
dynamite3.pause();
louvre1.pause();
louvre2.pause();
louvre3.pause();
liability1.pause();
liability2.pause();
liability3.pause();
hardloveless1.pause();
hardloveless2.pause();
hardloveless3.pause();
hardloveless4.pause();
soberII1.pause();
soberII2.pause();
soberII3.pause();
writer1.pause();
writer2.pause();
writer3.pause();
supercut1.pause();
supercut2.pause();
supercut3.pause();
supercut4.pause();
reprise1.pause();
reprise2.pause();
reprise3.pause();
perfectplaces1.pause();
perfectplaces2.pause();
perfectplaces3.pause();
perfectplaces4.pause();
fill(0, 239, 172);
rect(125, 225, 50, 50);
}
} else {
fill(126);
rect(125, 225, 50, 50);
}
if (mousePressed) {
if (mouseX > 125 && mouseX < 175 && mouseY > 325 && mouseY < 375) {
greenlight1.pause();
greenlight2.pause();
greenlight3.play();
greenlight3.rewind();
sober1.pause();
sober2.pause();
sober3.pause();
dynamite1.pause();
dynamite2.pause();
dynamite3.pause();
louvre1.pause();
louvre2.pause();
louvre3.pause();
liability1.pause();
liability2.pause();
liability3.pause();
hardloveless1.pause();
hardloveless2.pause();
hardloveless3.pause();
hardloveless4.pause();
soberII1.pause();
soberII2.pause();
soberII3.pause();
writer1.pause();
writer2.pause();
writer3.pause();
supercut1.pause();
supercut2.pause();
supercut3.pause();
supercut4.pause();
reprise1.pause();
reprise2.pause();
reprise3.pause();
perfectplaces1.pause();
perfectplaces2.pause();
perfectplaces3.pause();
perfectplaces4.pause();
fill(0, 255, 158);
rect(125, 325, 50, 50);
}
} else {
fill(126);
rect(125, 325, 50, 50);
}
// ALL OTHER SONGS REMOVED FOR PROCESSING FORUM CHARACTER LIMIT
void mousePressed() {
if (scene==0) {
if (mouseX > 1200 && mouseX < 1300 && mouseY > 140 && mouseY < 350) {
scene=1;
}
}
if (scene==1) {
if (mouseX > 100 && mouseX < 1200 && mouseY > 100 && mouseY < 500) {
scene=0;
patrick=0;
}
if (scene==0) {
if (mouseX > 30 && mouseX < 80 && mouseY > 225 && mouseY < 275) {
greenlight1.rewind();
greenlight2.pause();
greenlight3.pause();
sober1.pause();
sober2.pause();
sober3.pause();
dynamite1.pause();
dynamite2.pause();
dynamite3.pause();
louvre1.pause();
louvre2.pause();
louvre3.pause();
liability1.pause();
liability2.pause();
liability3.pause();
hardloveless1.pause();
hardloveless2.pause();
hardloveless3.pause();
hardloveless4.pause();
soberII1.pause();
soberII2.pause();
soberII3.pause();
writer1.pause();
writer2.pause();
writer3.pause();
supercut4.pause();
supercut1.pause();
supercut2.pause();
supercut3.pause();
reprise1.pause();
reprise2.pause();
reprise3.pause();
perfectplaces1.pause();
perfectplaces2.pause();
perfectplaces3.pause();
perfectplaces4.pause();
}
}
}
} // ends void mousePressed