title: Processing framerate very low and not changeable
body: <p>I'm building a processing sketch that uses both changing-background-images, oscillators and soundfiles.</p>
  
  <p>Basically every draw(), the background changes, an oscillator plays at a certain frequence and a short audio file is played</p>
  
  <p>Now, the problem: No matter what framerate I set, it always gets below 5. I have an NVIDIA 960 and 16GB of RAM, so I don't really think it's an hardware limitation (?)</p>
  
  <p>Here's my Setup(), where I set the framerate value. </p>
  
  <pre><code>     import processing.sound.*;
  SoundFile voice;//Quad [] quads;
  PImage bg;
  
  //Quad quads;
  
  ArrayList&lt;Quad&gt; quadsArray;
  int j=0;
  int randomImg;
  int randomVoice;
  int playVoiceorNot;
  TriOsc triangle;
  SawOsc saw;
  Reverb reverb;
  int playSaw;
  int timetoChange;
  int randomFrate;
  int prevVoice;
  int screenWidth = displayWidth; 
  int screenHeight = displayHeight;
  
  
  
  void setup(){
    fullScreen();
    //size(1920,1080);
    //quads=new Quad();
    quadsArray=new ArrayList&lt;Quad&gt;();
    triangle = new TriOsc(this);
    saw = new SawOsc(this);
    triangle.amp(0.1);
    saw.amp(0.1);
    prevVoice=0;
    frameRate(30);
    //background(255);
    //reverb = new Reverb(this);
    bg = loadImage("1.png");
    bg.resize(width,height);
    background(bg);
    triangle.play();
    saw.play();
  }
  
  
  void draw(){
     // println(frameRate);
      //frameRate(60);
      randomImg=floor(random(19));
      //randomImg=4;
      bg=loadImage(randomImg+".png");
      bg.resize(width, height);
      background(bg);
      //filter(INVERT);
      //----controllo se  è tempo di cambiare framerate. Possibilità del 2%----
      //timetoChange=floor(random(100));
     // randomFrate=floor(random(4,15));
       //if(timetoChange&gt;=98){
         //frameRate(randomFrate);
      // }
      //-----------------------------------------------------------------------
      //pusho un nuovo Quad nell'arrayList-------------------------------------
      quadsArray.add(new Quad());
      //----------PER OGNI QUAD, lo displayo e lo updato-----------------------
      //----------regolo anche la stroke weight in base alla width dei quadrati
      for(Quad current:quadsArray){
        blendMode(MULTIPLY);
        strokeWeight(4);
            triangle.freq(floor(random(100,current.quadwidth/2)));
             saw.freq(0);
            //reverb.damp(0.8);
            //reverb.room(0.7);
           // reverb.process(triangle);
            playSaw=floor(random(100));
            if(playSaw&gt;70){
                  saw.freq(floor(random(100,current.quadwidth)));
                 // reverb.damp(0.8);
                 // reverb.room(0.7);
                //  reverb.process(saw);
                  strokeWeight(8);
            }
            else{
               saw.stop();
            }
            current.display();
            current.update();
      }
      //------------------------------------------------------------------------
  
      //---Ciclo per la gestione dei quads con lifespan terminata-------
      for(int i=quadsArray.size()-1;i&gt;=0;i--){
         Quad temp=quadsArray.get(i);
            if(temp.lifespan&lt;=0){
             quadsArray.remove(i);
            }
      }
      println(quadsArray.size());
      //---------------------------------------------------------------------------
  
      //--controllo se playare una voce o meno. Possibilità del 15%----------------
      playVoiceorNot=floor(random(100));
      if(playVoiceorNot&gt;=85){
          // Load a soundfile from the /data folder of the sketch and play it back
          while(randomVoice==prevVoice){
             randomVoice=floor(random(70));
          }
          prevVoice=randomVoice;
          voice = new SoundFile(this,randomVoice + ".wav");
          voice.amp(1);
          voice.play();
      }
      //----------------------------------------------------------------------------
  
  }
  </code></pre>
  
  <p>and here's the Quad Object:</p>
  
  <pre><code>class Quad{
  
      float x;
      float y;
      float quadwidth;
      float quadheight;
      float lifespan;
      float moving;
  
  
    Quad(){ //constructor
  
     x=width/2;
     y=height/2;
     quadwidth=floor(random(80,width/2));
     quadheight=floor(random(height/2));
     lifespan=255;
     moving=0;
  
    }
  
    void display(){
      stroke(255,0,0,lifespan);
      //strokeWeight(3);
      noFill();
      rectMode(CENTER);
      rect(x,y,quadwidth,quadheight);
    }
  
   void update(){
     //fill(125,100,30,lifespan);
     lifespan=lifespan-20;
     moving++;
   }
  
  }
  </code></pre>
  
  <p>thanks for the replies!</p>