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§

open

Structs§

Config
All of the configuration values which can be set in config.toml get stored in this struct
Factors
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.
Font
MultiscaleBuilder
A builder pattern struct for building a Variant::Multiscale struct
ParseHandednessError
An error occurred parsing the neck’s Handedness from a str
RGB
Represents a color as red, green and blue channels with no transparency
RGBA
Represents a color as red, green and blue channels with an alpha channel for transparency
Specs
This struct contains the user data used to create the svg output file
SpecsBuilder
A Specs builder

Enums§

ColorError
Errors which might occur when validating or converting colors
Handedness
Whether the output represents a right handed or left handed neck style
PrimaryColor
An enumeration of primary and secondary colors
Units
Whether to use Metric (millimeters) or Imperial (inches) measurements
Variant
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.
Weight
The weight of the font

Traits§

Hex
Transformations to and from hexadecimal notation (base 16)