Fret Math

On or off Topic
Post Reply
User avatar
Dave-M
Posts: 154
Joined: Mon Feb 07, 2011 3:30 pm
Location: Northern Ontario, Canada

Fret Math

Post by Dave-M »

Fret Spacing Math

Have you ever wanted to make your own guitar neck and wondered about fret spacing? There are fret spacing generators found on the Internet, but have you ever wondered how to figure the fret spacing for a given guitar string length for yourself instead of trusting some other person to be correct?

Others may have posted similar info already, but for amusement I decided to tackle the fret spacing problem myself, and drag you guys along with me.

I assumed that there is a constant relationship between, say, the first fret spacing and the second fret spacing, which has to be a number less than one since the second fret is smaller than the first. I call this particular constant K, which remains the same for any system of measurement.

The third fret is related to the second fret by the same constant multiplier, and so on.

Another crucial fact is that fret thirteen spacing is half the size of fret one spacing (one octave), fret fourteen is half the size of fret two, and so on. Also fret twelve is located at the halfway point of the string.

To get a bird’s eye view of the problem, I made up a chart showing this general relationship, using a distance from the nut for fret one of what I call D1 units. Most people with high school algebra should be able to follow along without too much trouble.

Fret Spacing
1 D1
2 D1 x K
3 (D1 x K) x K
4 ((D1 x K) x K) x K

We see a pattern here, and can continue

5 D1 x K ^ 4 , where ^ means “ to the power of”. (ie: K^4 is K x K x K x K)
6 D1 x K ^ 5
,
,
,
13 D1 x K ^ 12

But fret 13 width is also half the size of fret 1 width, or D1 / 2

Therefore D1 x K ^ 12 = D1 / 2

Divide by D1 each side to get

K ^12 = 1 / 2 = 0.5

Taking the 12th root of both sides

K = 0.5 ^ (1/12)

One way of finding that is to use a calculator. I used the calculator in MS Windows, as follows.

Open the calculator to Scientific view.
Enter 12
Press magenta 1/x key on calculator for 1/12 decimal value.
Save to memory by pressing red MS key.
Enter 0.5
Press magenta x^y key.
Press red MR key to recall 1/12 decimal value
Press red = key to find

K = 0.94387431268169….. to about 33 decimal places or so.

Now let us count the combined lengths of the first 12 frets, which, as you know, is half the length of the string between the nut and the bridge. We will call this half-length H, so full string length
S = 2 x H

Now bear with me through this complicated-looking (but easy) part. Looking at the chart we see that:

H = D1 x (1 + K + K^2 + K^3 +K^4 + …..+ K^11) the sum of all the frets 1 through 12.
[Note that the exponent of K is one less than the fret number.] Call this equation one.

Most of us regard this as a complicated calculation, but we have a “magic” way to shorten it.

Let us multiply the left hand side of equation one by K to get H x K

Since the equation must balance we must multiply the long right hand side by K also. This means all the exponents bump up by one, or D1 x ( K + K^2 +K^3 + ….+ K^12)

This gives H x K = D1 x ( K + K^2 +K^3 + ….+ K^12)
Call this equation two, which looks even worse than equation one, but we need it for the “magic” part.

Subtract the left side of equation two from the left side of equation one to get
H – (H x K), which may be written H x (1 – K).

For the equation to balance we must subtract the associated right sections and wind up with
1 – K^12. Hocus Pocus, almost all those nasty extra K thingys disappear.

This leaves us with equation three, or D1 x (1 – K^12) = H x (1 – K)

We already know K^12 = 1/2, so D1 x (1 – 1/2) = H x (1 – K) or
reducing that to equation four we get D1 = 2 x H x (1 – K)

We also know K = 0.943874 …, and S = 2 x H.
Substituting these values in equation four we get

D1 = S x ( 0.056125687 …)

In plain English, this means that fret one spacing from the nut is 0.056125 … [actually 1 – K], times the chosen string length from nut to bridge, and the ratio of adjacent fret spacings, smaller divided by larger, is 0.943874 … [actually K]. By using a calculator you can figure out all the fret sizes. As mentioned above, K= 0.5^(1/12).

It is preferable to measure all fret locations from the nut when sawing the grooves for the fret wires. If you use enough decimal places the compounded addition error is negligible. I made a DOS program in Qbasic to calculate this, using 64ths of an inch, which I will post later.
Conceive, believe, achieve!
User avatar
burt
Posts: 153
Joined: Sun Nov 08, 2009 6:19 am
Contact:

Re: Fret Math

Post by burt »

I have the formula that I use in this thread:
viewtopic.php?f=2&t=377&p=2762#p2762
richard37066
Posts: 517
Joined: Sat Dec 11, 2010 11:44 am
Location: Gallatin, Tennessee, USA

Re: Fret Math

Post by richard37066 »

As Dave-M has stated, there are a bunch of places on the 'net to derive fret information. I've gotten lazy in my old age and my scientific calculator is getting long in the tooth so I rely upon:

http://www.liutaiomottola.com

for more information than just fret calculations. Ya really oughtta give him a looksee. The site is great.

Richard
Paul Lafountaine
Posts: 332
Joined: Sun Jan 23, 2011 5:06 am
Location: Northern Ontario

Re: Fret Math

Post by Paul Lafountaine »

Nice post Dave. I like your explanation. This will come in handy soon. I have started to template out my 8 string lap steel. I am working on it slowly as I am waiting for the weather to warm up so I can do most of the cutting outside in my shed and not in the house. I am getting a little frustrated as it will be a while before I can get out there. I may have my second or third project drawings done by then.

Paul
Eldon
Posts: 286
Joined: Mon Nov 02, 2009 6:39 pm
Location: LeeSiding, Ontario

Re: Fret Math

Post by Eldon »

I'm impressed DAve, what were you in your former life??
Music is what feelings sound like!

Eldon
mac639
Posts: 208
Joined: Mon Nov 30, 2009 10:06 pm
Location: Carleton Place, ON
Contact:

Re: Fret Math

Post by mac639 »

Hi guys... I love the math solutions!

For us folks that would rather do it a bit more simple there's a freeware
program out there that I've used for a few years called WFRET.

Just google that and you'll find it easily. You can download it easy as it's only about 2.9 meg.

Before I found that my best solution was to put a string on the guitar and a piece of paper under the string on the fretboard. Take your chromatic tuner and starting at the open, tune to a note (E) or whatever shows perfect on the tuner. Move up 'till you get to F (perfect) and mark on the paper, then F# and mark, then G, mark ....and so on

Cheers, Mac
User avatar
Dave-M
Posts: 154
Joined: Mon Feb 07, 2011 3:30 pm
Location: Northern Ontario, Canada

Re: Fret Math

Post by Dave-M »

For what it's worth, my program was only 42 kb long, but it will not attach. Tried all kinds of extensions, but all are dis-allowed.
Source code below. Copy into Notepad and name it FRETSv01.bas. Anyone with QB45 compiler or interpreter can run it.
-------------------------------------------

DEFINT A-Z
k! = .5 ^ (1 / 12) 'ratio of fret2:fret1
u! = 64 'fractional unit
numfrets% = 30
E$ = "FRETDIST.log"
F$ = E$
templ1$ = "F## = ##.#### or # - ##/64 wide"
templ2$ = "F## = ##.#### or ## - ##/64"
main:
CLS

OPEN F$ FOR OUTPUT AS #1
COLOR 14
PRINT "Dave's Dandy Fret Locator V1.0"
COLOR 7
INPUT "Length of string ", s!
d1! = s! * (1 - k!) 'fret1 from nut
PRINT #1, "Compiled by Dave's Dandy Fret Locator ... FRETSv01.exe"
PRINT #1,
PRINT #1, "For string length"; s!; " units"
PRINT #1,
PRINT #1, "Fret units distance from the nut: "
GOSUB combined
PRINT #1,
PRINT #1, "Fret units distance from the previous fret: "
GOSUB individual
PRINT
PRINT "Data was saved in "; F$
CLOSE #1

INPUT "Do you wish to calculate another string length? Y or N : ", choice$
IF UCASE$(choice$) <> "Y" THEN END
PRINT
PRINT "New data will overwrite "; F$; ", so enter new log name below."
PRINT "xxx.log will be new log file ..."
INPUT "Enter 1 to 8 characters for xxx: ", n$
IF n$ = "" THEN
F$ = E$
ELSE F$ = n$ + ".log"
GOTO main
END IF
END

individual:
FOR i = 0 TO numfrets% - 1
fwidth! = d1! * k! ^ i
m = INT(fwidth!) 'integer part
r = INT((fwidth! - m) * u!) 'remainder * 64ths integer part
IF INT((((fwidth! - m) * u!) - r) * 100) >= 50 THEN r = r + 1
PRINT #1, USING templ1$; i + 1; fwidth!; m; r
NEXT i
RETURN

combined:
prev! = 0
FOR i = 0 TO numfrets% - 1
fwidth! = d1! * k! ^ i
prev! = prev! + fwidth!
m = INT(prev!) 'integer part
r = INT((prev! - m) * u!) 'remainder * 64 integer part
IF INT((((prev! - m) * u!) - r) * 100) >= 50 THEN r = r + 1
PRINT #1, USING templ2$; i + 1; prev!; m; r
NEXT i
RETURN
Last edited by Dave-M on Sun Feb 27, 2011 8:48 am, edited 1 time in total.
Conceive, believe, achieve!
Allan
Posts: 419
Joined: Sun Nov 01, 2009 11:55 pm
Location: Scotland

Re: Fret Math

Post by Allan »

Good stuff guys.
There is another option too. Send me an email WITH YOUR EMAIL ADDRESS (no attachments can be sent through the forum) and I will send you a set of drawings to suit your scale length.
The drawings are .PDF's and can be printed out to full size.

Allan.....
Only nuts eat squirrels.
Keep yer tools sharp! That way you can use more of your strength guiding them AWAY from your body rather than forcing the cut!!!
User avatar
Dave-M
Posts: 154
Joined: Mon Feb 07, 2011 3:30 pm
Location: Northern Ontario, Canada

Re: Fret Math

Post by Dave-M »

Here's the output for a 22.5 inch string length so you can see how it was supposed to work. I left the thing in 64ths, so 9/32 is 18/64 for the inches units. You can use millimeters (or furlongs) and still get the right decimal answer answer, but the 64th stuff is redundant there.

I put it in "CODE" to maintain spacing. I made 30 frets default, which should be enough. For more, go back 12 frets (11 from the last one) and halve the width.

Code: Select all

Compiled by Dave's Dandy Fret Locator ... FRETSv01.exe

For string length 22.5  units

Fret units distance from the nut: 
F 1 =  1.2628   or   1 - 17/64
F 2 =  2.4548   or   2 - 29/64
F 3 =  3.5798   or   3 - 37/64
F 4 =  4.6417   or   4 - 41/64
F 5 =  5.6440   or   5 - 41/64
F 6 =  6.5901   or   6 - 38/64
F 7 =  7.4831   or   7 - 31/64
F 8 =  8.3259   or   8 - 21/64
F 9 =  9.1214   or   9 -  8/64
F10 =  9.8723   or   9 - 56/64
F11 = 10.5810   or  10 - 37/64
F12 = 11.2500   or  11 - 16/64
F13 = 11.8814   or  11 - 56/64
F14 = 12.4774   or  12 - 31/64
F15 = 13.0399   or  13 -  3/64
F16 = 13.5709   or  13 - 37/64
F17 = 14.0720   or  14 -  5/64
F18 = 14.5451   or  14 - 35/64
F19 = 14.9915   or  14 - 63/64
F20 = 15.4129   or  15 - 26/64
F21 = 15.8107   or  15 - 52/64
F22 = 16.1862   or  16 - 12/64
F23 = 16.5405   or  16 - 35/64
F24 = 16.8750   or  16 - 56/64
F25 = 17.1907   or  17 - 12/64
F26 = 17.4887   or  17 - 31/64
F27 = 17.7700   or  17 - 49/64
F28 = 18.0354   or  18 -  2/64
F29 = 18.2860   or  18 - 18/64
F30 = 18.5225   or  18 - 33/64

Fret units distance from the previous fret: 
F 1 =  1.2628   or   1 - 17/64 wide
F 2 =  1.1920   or   1 - 12/64 wide
F 3 =  1.1251   or   1 -  8/64 wide
F 4 =  1.0619   or   1 -  4/64 wide
F 5 =  1.0023   or   1 -  0/64 wide
F 6 =  0.9461   or   0 - 61/64 wide
F 7 =  0.8930   or   0 - 57/64 wide
F 8 =  0.8428   or   0 - 54/64 wide
F 9 =  0.7955   or   0 - 51/64 wide
F10 =  0.7509   or   0 - 48/64 wide
F11 =  0.7087   or   0 - 45/64 wide
F12 =  0.6690   or   0 - 43/64 wide
F13 =  0.6314   or   0 - 40/64 wide
F14 =  0.5960   or   0 - 38/64 wide
F15 =  0.5625   or   0 - 36/64 wide
F16 =  0.5310   or   0 - 34/64 wide
F17 =  0.5012   or   0 - 32/64 wide
F18 =  0.4730   or   0 - 30/64 wide
F19 =  0.4465   or   0 - 29/64 wide
F20 =  0.4214   or   0 - 27/64 wide
F21 =  0.3978   or   0 - 25/64 wide
F22 =  0.3754   or   0 - 24/64 wide
F23 =  0.3544   or   0 - 23/64 wide
F24 =  0.3345   or   0 - 21/64 wide
F25 =  0.3157   or   0 - 20/64 wide
F26 =  0.2980   or   0 - 19/64 wide
F27 =  0.2813   or   0 - 18/64 wide
F28 =  0.2655   or   0 - 17/64 wide
F29 =  0.2506   or   0 - 16/64 wide
F30 =  0.2365   or   0 - 15/64 wide
Conceive, believe, achieve!
User avatar
Dave-M
Posts: 154
Joined: Mon Feb 07, 2011 3:30 pm
Location: Northern Ontario, Canada

Re: Fret Math

Post by Dave-M »

Eldon wrote:I'm impressed DAve, what were you in your former life??
Thanks, Eldon. I worked at a TV station, designing electronics equipment for TV shows before I retired. I also did the station wiring drawings.
When they dissolved the R and D department due to policy changes, (buy from outside sources) they had me downlinking program feeds from satellite and Bell fiber-optics links.
Conceive, believe, achieve!
Post Reply