staskobzar / vue-audio-visual

VueJS audio visualization components
MIT License
693 stars 111 forks source link

What does the calculation in each function_drawLine mean? #17

Closed 2474370906 closed 5 years ago

2474370906 commented 5 years ago

image

staskobzar commented 5 years ago

This is to calculate line height from the middle of the canvas (h / 2). The height has to fit the cancas height (v/255 * h/2). image

And to draw vertical line from the middle of the canvas up and every second line from the middle to bottom.