Advertisement
gregwa

FretCalc - FCM 100

Aug 11th, 2015
791
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.59 KB | None | 0 0
  1. #Fret Calculator
  2. #Fretcalc.py
  3.  
  4. ScaleLength = 0
  5. CumulativeLength = 0
  6.    
  7. def CalcSpacing(Length,NTF):
  8.     BridgeToFret = Length - NTF
  9.     NutToFret = (BridgeToFret/17.817) + NTF
  10.     return NutToFret
  11.  
  12. def DoWork(ScaleLength):
  13.     CumulativeLength = 0
  14.     for x in range(1,25):
  15.         FretNumber = x
  16.         if FretNumber == 1:
  17.             CumulativeLength = CalcSpacing(ScaleLength,0)
  18.         else:
  19.             CumulativeLength = CalcSpacing(ScaleLength,CumulativeLength)
  20.         print("Fret=%d,NutToFret=%.3f" % (FretNumber,CumulativeLength))
  21.  
  22.  
  23. ScaleLength = raw_input("Please enter Scale Length of guitar -> ")
  24. DoWork(float(ScaleLength))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement