rodrigocfd / string-tension-calc

Guitar string tension calculator with graphical plotting.
https://rodrigocfd.github.io/string-tension-calc/
MIT License
25 stars 13 forks source link

String weight calculation #3

Closed ezzatron closed 6 years ago

ezzatron commented 6 years ago

Hey, firstly I just wanted to say that your tension calc is awesome, especially the multi-scale support (I'm getting my hands on some multi-scale Ormsby Goliaths soon 😎).

I was helping my friend @jortronq learn about some front-end JavaScript tech, and were writing our own string tension calculator as a learning exercise. We referred to this repo quite a bit as an example of how to do certain things.

One thing we couldn't figure out is how you arrived at your calculation for string density / unit weight. I notice in this commit you switched from hard-coded weight values, to deriving weight from gauge and a plain/wrapped flag.

I was wondering what these coefficients are, and how you arrived at them:

let coefs = (gauge[gauge.length - 1] == 'P') ?
    [ -.000176520934, .0840206843, -16.01839853, 1656.456428,
        -96731.24564, 3248319.241, -58293798.41, 432468921.1 ] :
    [ -.002123403683, .4863557681, -46.19498733, 2403.599196,
        -74026.84724, 1389623.565, -15576312.23, 95696503.28, -247760614.2 ];

Cheers!

rodrigocfd commented 6 years ago

Hi,

Thanks for your interest. I consider the architecture of this little app very good, it's a good showcase of modular ES6. Oh and those headless Ormsby Goliath are awesome indeed.

Anyway, these values are the coefficients to high-degree polynomial functions. I found them empirically after performing a polynomial regression on the curves from the points, considering string density and unity weight relationship. They're not absolutely correct, but they got pretty close on my math modeling simulation. I don't remember the exact calc details, but I remember it was just this.

Cheers.

ezzatron commented 6 years ago

Ah okay, I thought it might have been something like that. So if I understand, you took the existing weights, gauges, and string types as data points, and using a tool of some kind you were able to find a curve that closely approximated a fit for those data points?

EDIT: With a different curve for each string type, obviously.

rodrigocfd commented 6 years ago

Pretty much that. The "tool" in question is the polynomial regression.

ezzatron commented 6 years ago

Cool, that makes sense to me. Thanks for the clarification!