fret positioning

From Noah.org
Revision as of 11:35, 19 April 2015 by Root (talk | contribs)
Jump to navigationJump to search


fret #       factor
 1           0.056126
 2           0.109101
 3           0.159104
 4           0.206291
 5           0.250847
 6           0.292893
 7           0.33258
 8           0.370039
 9           0.405396
10           0.438769
11           0.470268
12           0.5
13           0.528063
14           0.554551
15           0.579552
16           0.60315
17           0.625423
18           0.646447
19           0.66629
20           0.68502
21           0.702698
22           0.719385
23           0.735134
24           0.75

d = s – (s / 2(n / 12))

d
distance from nut to fret number, n
s
scale or string length
n
fret number

Here is a little Python script that will output fret positions given a string length.

#!/usr/bin/env python
# This will print the distance from the nut to each fret
# over a two octave range given an open string length.

import sys
# Set string length here. Units don't matter. Output is in the same units.
string_length = 35.0

fret_length_factors = [ 0.056126, 0.109101, 0.159104, 0.206291, 0.250847,
        0.292893, 0.33258, 0.370039, 0.405396, 0.438769, 0.470268, 0.5,
        0.528063, 0.554551, 0.579552, 0.60315, 0.625423, 0.646447, 0.66629,
        0.68502, 0.702698, 0.719385, 0.735134, 0.75 ]
fret_number = 1
for length_factor in fret_length_factors:
    sys.stdout.write('%3d    %5.2f'%(fret_number, (length_factor * string_length)))
    sys.stdout.write('\n')
    fret_number += 1

sys.stdout.write('\n')

# This should give the same results.
# This calculates the same information in a different way.
for fret_number in range(1,25):
    fret_distance = string_length - (string_length / (2 ** (fret_number/12.0)))
    sys.stdout.write('%3d    %5.2f'%(fret_number, fret_distance))
    sys.stdout.write('\n')