Crate fretboard_layout

source ·
Expand description

Fretboard Layout

fretboard_layout is a library for turning a set of specifications into a complete template of a stringed musical instrument fretboard, such as a guitar, banjo, or mandolin. | Sample output | | :–: | | Sample output |

Usage

use fretboard_layout::{Config,Specs};

    // the [Specs] struct constains the specifications used to generate the svg
    let mut specs = Specs::default();
    specs.set_multi(Some(615.0), Some(8.0));
    specs.set_scale(675.0);
    // the (optional) [Config] struct fine tunes the visual representation
    let mut cfg = Config::default();
    cfg.set_line_weight(0.5);
    let svg = specs.create_document(Some(cfg));

Modules

Structs

All of the configuration values which can be set in config.toml get stored in this struct
This struct contains multiplication factors used to convert the raw lengths from bridge to fret into x,y coordinates. It also contains an offset distance used to correctly orient the two scales in a multiscale design so that the desired fret is perpendicular to the centerline.
A builder pattern struct for building a Variant::Multiscale struct
An error occurred parsing the neck’s Handedness from a str
Represents a color as red, green and blue channels with no transparency
Represents a color as red, green and blue channels with an alpha channel for transparency
This struct contains the user data used to create the svg output file
A Specs builder

Enums

Errors which might occur when validating or converting colors
Whether the output represents a right handed or left handed neck style
An enumeration of primary and secondary colors
Whether to use Metric (millimeters) or Imperial (inches) measurements
Whether to output a traditional Monoscale style neck with the same scale across it’s entire width, or a modern Multiscale neck, with a shorter scale along the treble side, also known as fan fret.
The weight of the font

Traits

Transformations to and from hexadecimal notation (base 16)