MusicTheory Docs API Toolbox GitHub NuGet
Contents

API / MusicTheory.Guitar

GuitarVoicing record

A playable guitar voicing of a chord.

Constructors

GuitarVoicing(ChordSymbol Chord, IReadOnlyList<int?> Frets, IReadOnlyList<int?> Fingers, Barre? Barre, int BaseFret, VoicingSource Source, string? ShapeName, double Difficulty)
A playable guitar voicing of a chord.
Chord
The chord the shape plays (with a capo, the chord that sounds is transposed up by it).
Frets
Per string, low to high: null = muted, 0 = open, otherwise the fret (relative to the capo).
Fingers
Per string: null when not fretted, otherwise finger 1 (index) to 4 (little).
Barre
The index-finger barre, if any.
BaseFret
First fret of a 4-fret diagram window: 1 when the shape fits in frets 1–4.
Source
Curated table, movable shape or generated.
ShapeName
"open", "E-form", "A-form", "D-form", or null for generated voicings.
Difficulty
Ranking score, lower is easier.

Properties

ChordSymbol Chord { get; init; }
The chord the shape plays (with a capo, the chord that sounds is transposed up by it).
IReadOnlyList<int?> Frets { get; init; }
Per string, low to high: null = muted, 0 = open, otherwise the fret (relative to the capo).
IReadOnlyList<int?> Fingers { get; init; }
Per string: null when not fretted, otherwise finger 1 (index) to 4 (little).
Barre? Barre { get; init; }
The index-finger barre, if any.
int BaseFret { get; init; }
First fret of a 4-fret diagram window: 1 when the shape fits in frets 1–4.
VoicingSource Source { get; init; }
Curated table, movable shape or generated.
string? ShapeName { get; init; }
"open", "E-form", "A-form", "D-form", or null for generated voicings.
double Difficulty { get; init; }
Ranking score, lower is easier.

Methods

IReadOnlyList<Note?> Sound(Tuning tuning, int capo = 0)
The sounding note per string (null when muted), spelled after the chord where possible.

Throws ArgumentException The tuning's string count differs from the voicing's.

IReadOnlyList<int> ToMidi(Tuning? tuning = null, int capo = 0)
MIDI note numbers to play, low string to high, muted strings skipped: open C (x32010) is [48, 52, 55, 60, 64]. Tuning- and capo-aware, so the same call feeds a piano view or a synth.

Throws ArgumentException The tuning's string count differs from the voicing's.

string ToTab()
Tab notation low to high: x32010; frets above 9 are space-separated: x 9 11 9 10 9.