Good morning, I'd like to show two waves that I've created and their addition. So, in the window we'd see 3 waves. Wave 1, Wave2, and the result. I only can see the same wave1 three times. Thanks.
import ddf.minim.*; import ddf.minim.ugens.*; import ddf.minim.analysis.*; Minim minim; Oscil myWave1; Oscil myWave2; Summer sum; AudioOutput out; void setup(){ size (500, 820); minim = new Minim(this); Summer sum= new Summer(); myWave1 = new Oscil (1000,0.5f, Waves.SINE); myWave2 = new Oscil (1000,0.5f,Waves.SINE); out = minim.getLineOut();
myWave1.patch (sum); myWave2.patch (sum); sum.patch(out);
} void draw(){ background (0); stroke(255, 255, 255); strokeWeight(1); for (int i = 0; i < out.bufferSize() - 1; i++) { line(i, 20 - out.left.get(i)50, i+1, 50 - out.left.get(i+1)50); line(i, 120 - out.right.get(i)50, i+1, 150 - out.right.get(i+1)50); } stroke(255,255,255); for (int i = 0; i < out.bufferSize() - 1; i++){ line(i, 215 - out.left.get(i)50, i+1, 250 - out.left.get(i+1)50); line(i, 270 - out.right.get(i)50, i+1, 350 - out.right.get(i+1)50); }
stroke(255,255255); for (int i = 0; i < out.bufferSize() - 1; i++){ line(i, 360 - out.left.get(i)50, i+1, 450 - out.left.get(i+1)50); line(i, 425 - out.right.get(i)50, i+1, 550 - out.right.get(i+1)50); }