MusicTheory.ChordPro 3.0.0

dotnet add package MusicTheory.ChordPro --version 3.0.0
                    
NuGet\Install-Package MusicTheory.ChordPro -Version 3.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MusicTheory.ChordPro" Version="3.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MusicTheory.ChordPro" Version="3.0.0" />
                    
Directory.Packages.props
<PackageReference Include="MusicTheory.ChordPro" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MusicTheory.ChordPro --version 3.0.0
                    
#r "nuget: MusicTheory.ChordPro, 3.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package MusicTheory.ChordPro@3.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MusicTheory.ChordPro&version=3.0.0
                    
Install as a Cake Addin
#tool nuget:?package=MusicTheory.ChordPro&version=3.0.0
                    
Install as a Cake Tool

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 Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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