Post by cundo on Feb 6, 2023 20:09:49 GMT
Because you will want to make your own guitar someday!
I made this code centuries ago haha.
Online tools for Comparisions:
www.harpkit.com/fret-calculator
www.stewmac.com/fret-calculator/
I made this code centuries ago haha.
Online tools for Comparisions:
www.harpkit.com/fret-calculator
www.stewmac.com/fret-calculator/
' fret position calculator by cundo
' I made this code years ago, this text and some fixes added : jan - 2023
nomainwin
WindowWidth = 378
WindowHeight = 510
UpperLeftX=int((DisplayWidth-WindowWidth)/2)
UpperLeftY=int((DisplayHeight-WindowHeight)/2)
gosub [lang]
[init]
groupbox #main, "", 6, 1, 360, 120
statictext #main.statictext, main$, 14, 16, 264, 20
textbox #main.textbox1, 126, 41, 100, 25
textbox #main.textbox2, 126, 76, 100, 25
statictext #main, in1$, 14, 46, 104, 20
statictext #main, in2$, 14, 81, 104, 20
button #main.button1, do$, [calc], UL, 238, 76, 112, 25
texteditor #main.out, 14, 130, 344, 326
menu #main, "Language","Englsih <-> Spanish" ,[options]
menu #main, "Edit" '<--- Texteditor Menu can be moved but not removed.
open "GFSC" for window_nf as #main
#main.textbox1 "!setfocus"
print #main, "trapclose [quit.main]"
#main.textbox1,"22"
#main.textbox2,"648"
wait
[quit.main]
Close #main
END
[calc]
#main.out "!cls"
#main.textbox1 "!contents? n$"
#main.textbox2 "!contents? long$"
if n$ ="" or long$= "" then wait
'#main.out "___________________";chr$(13)+chr$(10)
e = Root(2,12)
le = val(long$)
all = val(long$)
n = val(n$)
if le < n then wait
for i = 1 to n
if i<10 then fret$= "fret0";i else fret$ = "fret";i
#main.out fret$;space$(3);"|";space$(4);le-all/e
all=all/e
next i
wait
[options]
gosub [lang]
Close #main
goto [init]
wait
[lang]
if a=0 then
main$="Guitar fret spaces calculator"
in1$= "Number of frets"
in2$ = "Scale lenght (mm)"
do$ = "&Calculate"
op1$= "Options"
op2$= "Language -> Spanish"
else
main$="Calculador de espacios en trastes para Guitarra"
in1$= "Numeros de trastes"
in2$ = "Largo de escala (mm)"
do$ = "Calcular"
op1$= "&Opciones"
op2$= "Lenguage -> Inglés"
end if
a=not(a)
return
function Root(value,r)
Root = value ^ ( 1/r )
end function