We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi there!
I'm using the Ani library (http://www.looksgood.de/libraries/Ani/) to smooth out MIDI CC values I get from my QuNeo. I'm basically using the code below...
x and y are being smoothed out a little, but there are still many "bumbs". Is this the right way to do it? Are there just too many calls to this to be working effectively?
Are there other ways of smoothing this kind of data (without writing my own pseudo low pass filter)?
Thanks, Benni.
void setX(float _x) {
Ani.to(this, 3.5, "x", _x);
}
void setY(float _y) {
Ani.to(this, 3.5, "y", _y);
}
void draw() {
ellipse(x * width, (1-y) * height, 100, 100);
}
Answers
Try something like this:
Ani.to(this, 3.5, "y", _y, Ani.EASING_MODE);
where you replaceAni.EASING_MODE
by any of the modes in this cheat sheet: http://www.looksgood.de/libraries/Ani/Ani_Cheat_Sheet.pdf. Not sure what the default behaviour is but picking a smoother curve might get rid of the bumbs.