MusicTheory.ChordPro
3.0.0
dotnet add package MusicTheory.ChordPro --version 3.0.0
NuGet\Install-Package MusicTheory.ChordPro -Version 3.0.0
<PackageReference Include="MusicTheory.ChordPro" Version="3.0.0" />
<PackageVersion Include="MusicTheory.ChordPro" Version="3.0.0" />
<PackageReference Include="MusicTheory.ChordPro" />
paket add MusicTheory.ChordPro --version 3.0.0
#r "nuget: MusicTheory.ChordPro, 3.0.0"
#:package MusicTheory.ChordPro@3.0.0
#addin nuget:?package=MusicTheory.ChordPro&version=3.0.0
#tool nuget:?package=MusicTheory.ChordPro&version=3.0.0
MusicTheory.ChordPro
ChordPro chord sheets for MusicTheory: parse a sheet into directives, lyric lines with chord segments and comments, and write it back byte for byte.
using MusicTheory.ChordPro;
var song = ChordProDocument.Parse("{t: Amazing Grace}\n{key: G}\n[G]Amazing [C]grace");
song.Title; // "Amazing Grace"
song.Key; // G major
song.Chords; // ["G", "C"]
song.ToString(); // the input text, unchanged
Lines the parser cannot classify become lyric lines, so Parse never throws on content. Each line keeps its
Raw text (a trailing \r included), which is what makes the round trip exact.
Transposing
song.Transpose(2).ToString(); // {key: A} ... [A]Amazing [A7]grace ...
song.Transpose(new KeySignature(Note.Parse("Bb"), KeyMode.Major)); // spelled in Bb
Every chord goes through ChordTransposer and the {key:} directive is rewritten; lyrics, annotations
([*Riff]), unparseable chords ([N.C.], [Gfoo/B]) and {start_of_tab} blocks are left as written by default;
Transpose(2, SuffixHandling.KeepUnparsed) also moves the root and bass of chords the library cannot read
([Gfoo/B] becomes [Afoo/C#]). Only changed lines
get new text. Transpose(KeySignature) needs a parseable {key:}, else it throws InvalidOperationException.
Suffixes are rewritten to their canonical form by default (CM7 becomes Dmaj7);
Transpose(2, SuffixHandling.Verbatim) keeps the writer's spelling and moves only root and bass (CM7 becomes DM7, C-7 becomes D-7).
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- MusicTheory (>= 3.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.0 | 57 | 11/21/2026 |