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());
}
}
My goal is to be able to play multiple sine waves simultaneously, but I can't seem to create an array of SineWaves. I feel like I'm missing something simple but I can't figure out what.
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());