3d Scrolling terrain with music w/ P5js

Hi guys,
I’m a newbie of P5js and I would like to create a scrolling terrain in 3D.

Here’s the link to my code repo. I’m using the sound to generate the terrain shape (FFT bins) but I’ve some problems in rendering it.

Just starting with simple lines to render the terrain I get this error in a never ending loop freezing the browser:

p5.Vector.prototype.mult: n is undefined or not a finite number


Thank you so much for your support