Hi there,
I'm quite new to processing, so I would be very glad if anyone can help me with my problem…
I've already searched a lot in this forum but couldn't get the solution.
I'm working on something like a clock which represents and records the volume of the surrounding area. so the sketch has 60 rects per row, 60 rows. so each rect stands for one seconds, the whole sketch represents an hour.
the saturation of the filling depends of the incoming sound (in.mix.level()).
my problem is:
how do I get the average volume of the second? at the moment, processing overwrites the rect every frame, so in the end, after the second, when the position of the next rect changes, you can see only the last value.
-
levelGesamt means the sum of all measured values
-
levelColl is my array which should collect the last 60 values
-
levelAvg is the average of all values
but now, the values for levelColl[1] up to levelColl[59] are similar and not shifting as it should do, I think…
has anyone an idea, what the problem is??
and the second problem is, just to draw the rect every (current time(!))second. using millis() % 1000 == 0 doesn't work because the millis start when the program is running and I need the real time seconds…
so I tried this but as I realized, it doesn't work (quite clear, because all seconds are integers and % 0 == 0………):
if(second() % 1 == 0) {
……………
}
has anyone an idea on this??? I would be very thankfull!!!
best regards,
stephan
PS: please tell me, if you need to see the whole code!