We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
Array help. (Read 474 times)
Array help.
Dec 14th, 2005, 7:52pm
 
Why doesn't this work? I've just started using arrays - so apologies for it being SO simple.

all i want to do is create a blank array, then add variables into it every frame - should be simple enough.

Code:
float meterData;
float[] audioData = new float[0];

void draw() {
meterData = 100 * LiveInput.getLevel();
audioData[0] = append (audioData[0], meterData);
}


cheers
Niall
Re: Array help.
Reply #1 - Dec 14th, 2005, 11:50pm
 
I tihnk you want:

Code:
float meterData;
float[] audioData = new float[0];

void draw() {
meterData = 100 * LiveInput.getLevel();
audioData = append (audioData, meterData);
}

Re: Array help.
Reply #2 - Dec 15th, 2005, 2:01pm
 
I could have sworn I tried this at the beginning.

clearly I didn't!

Cheers
Niall
Page Index Toggle Pages: 1