MusicTheory Docs API Toolbox GitHub NuGet
Contents

API / MusicTheory.Guitar

Fretboard record

A tuning and a fret range: names every fret and finds the positions of a note, scale or chord.

Constructors

Fretboard(Tuning Tuning, int Frets = 24)
A tuning and a fret range: names every fret and finds the positions of a note, scale or chord.
Tuning
The open strings.
Frets
Frets above the nut, so 12 gives 13 positions per string.

Properties

Tuning Tuning { get; init; }
The tuning; never null.
int Frets { get; init; }
Frets above the nut; at least 1, and the highest open string plus this stays within MIDI 127.

Methods

Note NoteAt(int string, int fret)
The note at a string and fret, sharps for black keys like Note.FromMidiNumber.

Throws ArgumentOutOfRangeException The string or fret is off the board.

IReadOnlyList<FretPosition> Positions(Note note)
Every position of note's pitch class, spelled with its letter; Degree is null.
IReadOnlyList<FretPosition> Positions(Scale scale)
Every position of a scale tone, spelled as the scale, Degree = 1-based scale degree.
IReadOnlyList<FretPosition> Positions(Chord chord)
Every position of a chord tone, spelled as the chord, Degree = the tone's interval number (root is 1).