We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I am trying to draw a simple wave plot, to be sent to Csound over OSC. The problem is, I would like to save the y value to an array as I'm drawing. Something like:
void mouseDragged(){
stroke(25,25);
int x = mouseX;
if (x<512 && x>=0) {
int y = mouseY;
line(x, y, pmouseX, pmouseY);
outbuf[x] = y;
}
}
But this leaves gaps in the buffer, unless I draw really slow. How to get around this?
Richard
Answers
I think it should work. I would try doing it in draw() inside this conditional:
Yes, tried it in draw() too, but the same thing. I understood I was better of using mouseDragged() or mouseMoved().. When I show the output buffer ( at the frame rate or slower), it has these gaps.
Interesting approach, GotoLoop, but for a wave file I need every x coordinate to be filled. This method also skips x coordinates (leaves gaps) when I move the mouse faster...
Richard
Dunno! Mebe you should create a method to analyze each collected coordinate, and then fill in the gaps between 1 to the other.
Then save it to another structure.
Yes, I was thinking about that too.