3 ms·
we used to have to do this with a calculator and a ruler. Most relevant line of code: return s - (s / (Math.pow(2, (i / 12)))) It still blows my mind that
by danbmil99 13y ago
we used to have to do this with a calculator and a ruler.
Most relevant line of code:
return s - (s / (Math.pow(2, (i / 12))))
It still blows my mind that an irrational series like 2 ^ (i/12) is such a close approximation to the harmonic series.
- daeken 13y agoThe fret placement was, slightly surprisingly, the absolute easiest part of everything. 99% of my time was spent on the math for producing the base fretboard shape (the fingerboard() function in fret_worker.js if you're curious). Between getting the mesh right and doing the math for radius, it was a bit of a beast, but it ended up working out well.