ClassNotFoundException: processing.serial.Serial

I cant for the life of me figure out what the problem is with my Processing code. When I compile it, I get this error:
ClassNotFoundException: processing.serial.Serial

and it highlights this area of code:
arduino = new Arduino(this, Arduino.list()[0], 9600);

I've assigned it different comports, I've double checked the baudrate in Standard Firmata against this code, I've declared arduino as an object and imported the library.... what am I overlooking?

here is the Processing code:

import cc.arduino.*;
import ddf.minim.*;

Arduino arduino;
Minim minim;
AudioPlayer heart;


int ledPin1 = 0;
int ledPin2 = 1;
int ledPin3 = 2;

void setup() {
  size(512,200);
  background(255); 
  minim = new Minim(this);    
  arduino = new Arduino(this, Arduino.list()[0], 9600);
  int ledPin1;
  int ledPin2;
  int ledPin3; 
}

void draw() {
 background(255); 
    playSound();
}

void playSound() {    
  do {
      arduino.digitalWrite(ledPin1, Arduino.LOW); // set first bundle of LEDs off
      arduino.digitalWrite(ledPin2, Arduino.LOW); // set second bundle of LEDs off
      arduino.digitalWrite(ledPin3, Arduino.LOW); // set third bundle of LEDs off

      heart = minim.loadFile("heart.wav");
      heart.play();
      arduino.digitalWrite(ledPin1, Arduino.HIGH); // set first bundle of LEDs HIGH
      wait(30);  
      arduino.digitalWrite(ledPin2, Arduino.HIGH); // set second bundle of LEDs HIGH
      wait(30); 
      arduino.digitalWrite(ledPin3, Arduino.HIGH); // set third bundle of LEDs HIGH
      
      do {
        // do nothing until the file ends
      } while (heart.isPlaying());
    } while (true);    
}

void wait(int seconds) {
  do {
    delay(1000);
    seconds--;
  } while (seconds > 0);
}  

void stop() {
  heart.close();
  minim.stop();     
  super.stop();
}

pffffff.... I forgot to import the Serial library. Of course I cannot call to Serial without it!

dunce

To import Serial:
import processing.Serial.*;

And then shouldn't that be "Serial" in all instances where you have "Arduino".

Arduino arduino;
arduino = new Arduino(this, Arduino.list()[0], 9600);

to

Serial arduino;
arduino = new Serial(this, Serial.list()[0], 9600);

i just had to import the library, it can still be written as an Arduino serial object, as per my original code.

It was late, i was tired :slight_smile: