• TalkBass has been independent since 1998. Add your voice.
    Create a free account to reply to discussions, view embedded media, and browse with fewer display ads.
    Join freeLog in
    Want zero display ads or expanded classifieds tools? Compare plans.

String tension calculator program!

Hello, I am in college for computer science, and decided to make a little python script to calculate string tension, the formula is T (Tension) = (UW x (2 x L x F)2 ) / 386.4, so a little long winded. Anyways, I messaged an administrator, (thanks again Bryan R. Tyler) and he said to upload it to a third party site, so here is a google drive [Invalid or Expired Link Removed]. To use it, unzip the file, and then go into the "dist" directory and click on the file "stringtension", it should hopefully open up a command prompt, and ask you what the unit weight is, and as a test enter .00214990, then it will ask scale length, I would request you please enter 34, and finally frequency, please enter 41.2, and hopefully the result should be 43.67(with a lot of fluff after that .67). Hopefully this will work, it should hopefully work on both Windows and macOS, unfortunately, I have neither so I can't test it, please tell me any issues, anyways thanks!

PS: The raw .py file is in there too if you have python, and if you are curious that should be able to be opened with a text editor.

Also for savvy users here is a few hashes for the .zip!

MD5: b41a1c66e9c947356f2b06c57d344bec

SHA1: ff7eb09933c2ed8d866f5e5a9c655b7952ee93a5

also attached is a txt file with the python script
 

Attachments

Last edited:
May I ask which strings the calculator is based on?

The tension of otherwise identical gauge strings will be different from brand to brand and type of strings and for example depending on weather it is guitar or bass strings.

Not all strings are made alike, the wounds and not least core thickness will vary, having great influence on the tension on the specific strings of otherwise identical gauge.

Also will it work for different scale length?

Also may I suggest you do the work with translating notes to frequency, as most player won't be familiar with the exact frequency of the notes :
[Invalid or Expired Link Removed]
 
Last edited:
May I ask which strings the calculator is based on?

The tension of otherwise identical gauge strings will be different from brand to brand and type of strings and for example depending on weather it is guitar or bass strings.

Not all strings are made alike, the wounds and not least core thickness will vary, having great influence on the tension on the specific strings of otherwise identical gauge.

Also will it work for different scale length?

Also may I suggest you do the work with translating notes to frequency, as most player won't be familiar with the exact frequency of the notes :
[Invalid or Expired Link Removed]

I took the equation from D'Addario's tension chart, it's really just a general string tension equation, and that is what the unit weight is for, unfortunately, many string companies do not publish these figures. It will work from any scale length, it really is simple it's basically the equation I posted, but without having to do all the leg work of entering each individual piece. And I'll put together a little chart that goes through the frequencies of various notes across the octaves. You can really put any number in there and it will run through this formula (UW x (2 x L x F)2 ) / 386.4, so just a simple specified job caculator, general, and hopefully helpful, I don't even know if it will run on Windows yet so that's an issue, thanks for the feedback!

Also just so you can see what goes on in the background, here's the code:

#Get unit weight of string from user (refer to manufacturer's specifications).
unit_weight=float(input('What is the unit weight of the string? '))

#Get the scale length of the instrument from user.
length=float(input('What is the scale length of your instrument? '))

#Get the pitch of the desired note.
pitch=float(input('What is the frequency of the note you are tuning to? '))

#Calculate string tension from results.
tension=(unit_weight*(2*length*pitch)**2)/386.4

print('Your string tension will be', tension)
#End

Also, if needed I can break down each figure, so they are better understood.
 
Last edited:
I took the equation from D'Addario's tension chart, it's really just a general string tension equation, and that is what the unit weight is for, unfortunately, many string companies do not publish these figures. It will work from any scale length, it really is simple it's basically the equation I posted, but without having to do all the leg work of entering each individual piece. And I'll put together a little chart that goes through the frequencies of various notes across the octaves. You can really put any number in there and it will run through this formula (UW x (2 x L x F)2 ) / 386.4, so just a simple specified job caculator, general, and hopefully helpful, I don't even know if it will run on Windows yet so that's an issue, thanks for the feedback!

Also just so you can see what goes on in the background, here's the code:

#Get unit weight of string from user (refer to manufacturer's specifications).
unit_weight=float(input('What is the unit weight of the string? '))

#Get the scale length of the instrument from user.
length=float(input('What is the scale length of your instrument? '))

#Get the pitch of the desired note.
pitch=float(input('What is the frequency of the note you are tuning to? '))

#Calculate string tension from results.
tension=(unit_weight*(2*length*pitch)**2)/386.4

print('Your string tension will be', tension)
#End

Also, if needed I can break down each figure, so they are better understood.

I don't understand how raw uncut/not installed yet weight of the string can possibly be of relevance, as too many variables will come in play here, weight of wrap/weight of core ratio, length of specific string in question, and not least weight of actual active length of the string vs. length of whole uncut/not installed yet string.

Or how string weight would be of interest whatsoever of the user for that matter, string gauge (thickness) would though.
 
Last edited:
  • Like
Reactions: Sailfish
Okay, so the gauge is extremely relevant to the "unit weight". Unit weight doesn't refer to weight at all, it refers to linear density, in this particular instance lb/in. So this is the density of a particular length of string, this changes with core size, flat or round wrap, I can't list the unit weights, that is something to find, here is a link to D'Addario's chart, which is one of the very few manufacturer's who give unit weight of particular strings. So, with your density, length and frequency, you can run them through the equation like so, [ .00214990 x (2 x 34 x 41.2)^2 ) / 386.4 ] This is the equation for a .105 gauge string tuned to E1, so just an E string, the tension of which is 43lbs, so hopefully this clarifies, just remember not weight, but density. Sorry for the science lesson!
 
Last edited:
Yep, those online string tension calculators are pretty good, but I find them limiting, because of the range of guages they have, mine is a bit more general, and yeah unit weight is a bit of a pain in the a** to find, I really don't know why many companies don't publish at least tension statistics, with balanced sets being a big deal now.
 
  • Like
Reactions: dkelley
Yep, those online string tension calculators are pretty good, but I find them limiting, because of the range of guages they have, mine is a bit more general, and yeah unit weight is a bit of a pain in the a** to find, I really don't know why many companies don't publish at least tension statistics, with balanced sets being a big deal now.
I haven't checked out your calculator yet (GDrive says no) - can you enter a known tension value at a certain scale (as provided by some companies, such as Thomastik-Infeld and Elixir), obtain the unit weight in the process, and - more importantly - vary scale and frequency for alternate tunings and scale lengths?
I can take any tension datum and, as long as I know the reference scale, finagle my way through any existing tension chart in order to get any other info I need, but it would be a nice feature for folks that can't.
 
  • Like
Reactions: Sailfish
Firstly, I haven't checked the app yet, but as a senior software engineer myself (and having developed machine learning stuff professionally with python as the logic language), I'm definitely grabbing your source to check it out!

Your physics points are on point, from what I recall (many moons ago).

AWESOME stuff that you're doing this! The points about differences between manufacturers and types of strings, as people are pointing out, are of course in part related to the weight measurement that you were making logical note of in your calculations.

So, given all of the info that D'addario supplies, from any other manufacturer, your script ought to work perfectly accurately (assuming it's bug free and not missing something else we've not thought of).

Thank you so much for doing this.

I should note to those who are not thanking this gentleman for his efforts - regardless if you plan to use it or not, we should ALL be very grateful to him for taking the probably rather long time to code this, debug it, get it working reliably, triple check the math, and so forth.

This is the sort of person we want in our community - so let's show some gratitude for the efforts in the world of bass guitar! Information, apps, support like this is ALWAYS a good thing. And I personally find it extremely rude that folks are just saying "THIS is what I use, and for other stuff THIS is what I use.". The OP wasn't asking what you use, nor was he even suggesting what he uses. He did something that most of you could not do, based on the questions about weight etc, and that most folks here likely couldn't program in a computer either for public distribution. he already made the app, put in the time, so stop dismissing it with other apps, and show some gratitude.
 
Last edited:
I haven't checked out your calculator yet (GDrive says no) - can you enter a known tension value at a certain scale (as provided by some companies, such as Thomastik-Infeld and Elixir), obtain the unit weight in the process, and - more importantly - vary scale and frequency for alternate tunings and scale lengths?
I can take any tension datum and, as long as I know the reference scale, finagle my way through any existing tension chart in order to get any other info I need, but it would be a nice feature for folks that can't.
No but, there is an equation for that, so I can make another program to get that unit weight, I forgot that Thomastik provided tension measures, thank you! Also, this should work for any string, whether it be a bridge cable or ukelele string, it really doesn't matter, and start writing that other program, thanks for all the input!

Edit: I bet the reason why the Google Drive link is broken is because of PyInstaller using a python version to make an executable, and me distributing might be a violation of terms.
 
Last edited:
  • Like
Reactions: HaphAsSard
Firstly, I haven't checked the app yet, but as a senior software engineer myself (and having developed machine learning stuff professionally with python as the logic language), I'm definitely grabbing your source to check it out!

Your physics points are on point, from what I recall (many moons ago).

AWESOME stuff that you're doing this! The points about differences between manufacturers and types of strings, as people are pointing out, are of course in part related to the weight measurement that you were making logical note of in your calculations.

So, given all of the info that D'addario supplies, from any other manufacturer, your script ought to work perfectly accurately (assuming it's bug free and not missing something else we've not thought of).

Thank you so much for doing this.

I should note to those who are not thanking this gentleman for his efforts - regardless if you plan to use it or not, we should ALL be very grateful to him for taking the probably rather long time to code this, debug it, get it working reliably, triple check the math, and so forth.

This is the sort of person we want in our community - so let's show some gratitude for the efforts in the world of bass guitar! Information, apps, support like this is ALWAYS a good thing. And I personally find it extremely rude that folks are just saying "THIS is what I use, and for other stuff THIS is what I use.". The OP wasn't asking what you use, nor was he even suggesting what he uses. He did something that most of you could not do, based on the questions about weight etc, and that most folks here likely couldn't program in a computer either for public distribution. he already made the app, put in the time, so stop dismissing it with other apps, and show some gratitude.

You forgot to sign this as "Sailfish's Dad"

(kidding! :roflmao:)
 
  • Like
Reactions: Sailfish
I really don't know why many companies don't publish at least tension statistics, with balanced sets being a big deal now.

It's because balanced sets aren't nearly as big of a deal in the real world as Talkbass would have you believe.

I've found that, after publishing my company's tension chart (which involved a lot of string destruction and swearing at Excel), the majority of the musicians using it are not using it for balanced tension. They're using it or altered tunings, drop tunings, general curiosity, etc.. Balanced tension is on the bottom of the users' list.