Hey guys, I am trying to create a simple array of SineWave objects from the minim library, but I keep getting null pointer exceptions. Here's my setup.
- void setup() {
- minim = new Minim(this);
- SineWave[] sineTime = new SineWave[10];
- for (int i = 0; i< 10; i++) {
- sineTime[i] = new SineWave(100 * i, 0.5, out.sampleRate());
- }
- }
Thanks for your help.
Here's the full code if it helps.
- import ddf.minim.*;
- import ddf.minim.signals.*;
- Minim minim;
- AudioOutput out;
- void setup()
- {
- size(512, 200, P2D);
- minim = new Minim(this);
- SineWave[] sineTime = new SineWave[10];
- for (int i = 0; i< 10; i++) {
- sineTime[i] = new SineWave(100 * i, 0.5, out.sampleRate());
- }
- }
- void draw()
- {
- background(0);
- stroke(255);
- }
- void stop()
- {
- out.close();
- minim.stop();
- super.stop();
- }
1