I'm building a simple bitcrusher effect. I would like to display a static drawing of a sine wave that updates its quantization according to the bit depth chosen by the user. I figured out how to draw the correct sine wave per bit-depth using the Path class when the effect loads. The problem I'm facing is that I would like to update the drawing immediately when the user moves the slider. Can anyone help please?
Attached are the visualisation I created for 3-bit and 5-bit. I just don't know how to update them in real time.