Gfret

Introduction

This is a fretBoard layout tool. Given a set of parameters gfret will calculate the fret, nut, and bridge locations and output an svg template suitable for using as a pattern for a fretted stringed instrument. Multiscale designs are supported. Measurements are currently expected to be in millimeters.

Building

You will need a Rust toolchain installed, including cargo. Gtk+3x is also required. To build the program, run cargo build --release to build a release binary in target/release.

Alternatively, you can use the included Makefile to build and install the program, adjusting the installation path with the PREFIX and DESTDIR variables.

Usage

By default the Gtk based gui will run. If desired, the program can be run in standalone cli mode by using the cli subcommand. The first argument to the cli is the scale length in millimeters. If the -m, or --multiscale argument is also given, this becomes the bass side scale length.

Cli Flags

Some useful defaults can be set for the rendered image by editing the file ~/.config/gfret/config.toml. A sample of this file would look like this: ``` Toml

An external program which can edit svg files

external_program = "inkscape"

The border to be placed around the rendered image

border = 5.0

The line weight, in mm

line_weight = 0.5000000000000001

The color of the fret lines in RGBA format

fretline_color = "rgba(255,255,255,1)"

The background fill color of the fretboard, in RGBA format

fretboard_color = "rgba(0,0,0,1)"

Whether or not to draw the dashed centerline

draw_centerline = true

The color of the dashed centerline, in RGBA format

centerline_color = "rgba(165,29,45,1)"

Whether or not to print the specifications used onto the image rendering

print_specs = true

The font used to print the specifications

font = "sans 12" ``` If running the gui, all of these settings can be adjusted using the preferences dialog.

Future Development

For the gui, it would be nice to save state and allow loading specs from and saving to templates. partial implementation 4/7/21 completed 5/5/21