Editing a p5js sketch is harder than it looks

I got lost in a coding rabbit hole this week. I was trying to edit the Donut p5js sketch to prep it to get serial input. After replacing one of the hand-made sliders with a DOM slider, I noticed the sketch had gotten glitchy, i.e. not running smoothly, at some point in its iterations.

So I tried troubleshooting by commenting out particular lines, taking the song and amplitude elements out, taking all the sliders away. Even with all the donuts out, the background still exhibited this glitchy behavior. I tried commenting out the frameRate() controls. I tried running smooth();. I restarted my computer. As a last resort, I even tried porting it over to Processing, but this proved to be unfruitful as I found out that it has no DOM elements, so none of my sliders would be of any use.

Right now, I would like to solve the problem of the glitchy-ness so I can eventually make this work interactive. I booked some office hours with Jasmine to try to sort it out.