MusicTheory Docs API Toolbox GitHub NuGet
Contents

API / MusicTheory.Guitar

ChordDiagramLayout record

Framework-agnostic geometry for a chord diagram: strings are vertical lines, frets horizontal; (0, 0) is the top-left of the grid, the nut (or top fret line) is at y = 0, and markers sit half a fret above it.

Constructors

ChordDiagramLayout(double Width, double Height, IReadOnlyList<Line> Strings, IReadOnlyList<Line> FretLines, bool ShowNut, int? PositionLabel, IReadOnlyList<StringMarker> Markers, IReadOnlyList<FingerDot> Dots, BarreShape? Barre, IReadOnlyList<Point> InlayDots)
Framework-agnostic geometry for a chord diagram: strings are vertical lines, frets horizontal; (0, 0) is the top-left of the grid, the nut (or top fret line) is at y = 0, and markers sit half a fret above it.

Properties

double Width { get; init; }
double Height { get; init; }
IReadOnlyList<Line> Strings { get; init; }
IReadOnlyList<Line> FretLines { get; init; }
bool ShowNut { get; init; }
int? PositionLabel { get; init; }
IReadOnlyList<StringMarker> Markers { get; init; }
IReadOnlyList<FingerDot> Dots { get; init; }
BarreShape? Barre { get; init; }
IReadOnlyList<Point> InlayDots { get; init; }

Methods

static ChordDiagramLayout For(GuitarVoicing voicing, DiagramOptions? options = null, Tuning? tuning = null)
Lays out voicing in a window starting at its GuitarVoicing.BaseFret.

Throws ArgumentNullException voicing is null.

Throws ArgumentOutOfRangeException The window shows fewer than one fret, or a spacing is not positive.