ChordSymbol
The definitive chord symbol parser and renderer for Javascript/NodeJS.
ChordSymbol is the definitive chord symbol parser and renderer for Javascript/NodeJS.
While most chord parsing libraries expect you to write chord symbols in a specific way, ChordSymbol can handle whatever chord syntax you throw at him, or almost. Currently, the unit test suite contains more than 37 000 distinct chords symbols!
ChordSymbol will transform a string representing a chord (Cm7, for example) into a suite of intervals (1, b3, 5, b7) and individual notes (C, Eb, G, Bb). It will also normalize the chord symbol, such as it doesn't matter if the original input was Cm7, CMINOR7,C7min, or C7mi: ChordSymbol will consistently render it asCmi7. And if you prefer a different kind of normalization,ChordSymbol allows you to configure the rendering to your taste.
ChordSymbol is the chord parsing engine behind ChordMark, a new and powerful way to write chord charts.
- Read the full README
- API documentation
- See the Github repository
- See on NPM
Demo
Parser
Notation systems: | |
Key: | key of the context in which the chord is found. Used to build the roman numeral symbol for the chord. |
Alt intervals: | user selection of intervals affected by the "alt" modifier (all by default). If you would like "alt" to consistently yield a specific set of intervals, you can specify those here. |
Ab7(b9,#9)| Intervals | 1 | 3 | 5 | b7 | b9 | #9 |
|---|---|---|---|---|---|---|
| Notes | Ab | C | Eb | Gb | A | B |
| Semitones | 0 | 4 | 7 | 10 | 13 | 15 |
JSON representation of the parsed chord
{
"input": {
"symbol": "Ab7(b9,#9)",
"rootNote": "Ab",
"descriptor": "7(b9,#9)",
"parsableDescriptor": "7 b9 #9 ",
"modifiers": [
"seventh",
"b9",
"#9"
],
"notationSystem": "english"
},
"normalized": {
"intervals": [
"1",
"3",
"5",
"b7",
"b9",
"#9"
],
"semitones": [
0,
4,
7,
10,
13,
15
],
"intents": {
"major": true,
"eleventh": false,
"alt": false
},
"rootNote": "Ab",
"quality": "dominant7",
"isSuspended": false,
"extensions": [],
"alterations": [
"b9",
"#9"
],
"adds": [],
"omits": [],
"notes": [
"Ab",
"C",
"Eb",
"Gb",
"A",
"B"
]
},
"formatted": {
"rootNote": "Ab",
"descriptor": "7",
"chordChanges": [
"b9",
"#9"
],
"symbol": "Ab7(b9,#9)"
},
"parserConfiguration": {
"notationSystems": [
"english",
"german",
"latin"
],
"altIntervals": [
"b5",
"#5",
"b9",
"#9",
"#11",
"b13"
],
"key": "C"
},
"numeral": {
"symbol": "?⁷",
"degree": "?",
"descriptor": "⁷",
"inversion": "",
"type": "unknown",
"thirdQuality": "major"
}
}
Renderer
Use short namings: | "Academic" rendering based on the rules defined in the books Contemporary Music Theory Series (by Mark Harrison) and Standardized Chord Symbol Notation (by Carl Brandt and Clinton Roemer) |
Simplify: | No simplification |
Transpose value: 0 | |
Render to: | Auto will render the chord using the notation system detected during the parsing |
Accidental: | |
Ab7(b9,#9)| Intervals | 1 | 3 | 5 | b7 | b9 | #9 |
|---|---|---|---|---|---|---|
| Notes | Ab | C | Eb | Gb | A | B |
| Semitones | 0 | 4 | 7 | 10 | 13 | 15 |
JSON representation of the rendered chord ("Raw" printer)
{
"input": {
"symbol": "Ab7(b9,#9)",
"rootNote": "Ab",
"descriptor": "7(b9,#9)",
"parsableDescriptor": "7 b9 #9 ",
"modifiers": [
"seventh",
"b9",
"#9"
],
"notationSystem": "english"
},
"normalized": {
"intervals": [
"1",
"3",
"5",
"b7",
"b9",
"#9"
],
"semitones": [
0,
4,
7,
10,
13,
15
],
"intents": {
"major": true,
"eleventh": false,
"alt": false
},
"rootNote": "Ab",
"quality": "dominant7",
"isSuspended": false,
"extensions": [],
"alterations": [
"b9",
"#9"
],
"adds": [],
"omits": [],
"notes": [
"Ab",
"C",
"Eb",
"Gb",
"A",
"B"
]
},
"formatted": {
"rootNote": "Ab",
"descriptor": "7",
"chordChanges": [
"b9",
"#9"
],
"symbol": "Ab7(b9,#9)"
},
"parserConfiguration": {
"altIntervals": [
"b5",
"#5",
"b9",
"#9",
"#11",
"b13"
],
"key": "C"
},
"numeral": {
"symbol": "?⁷",
"degree": "?",
"descriptor": "⁷",
"inversion": "",
"type": "unknown",
"thirdQuality": "major"
}
}
MusicXml renderer
<harmony>
<root>
<root-step>A</root-step>
<root-alter>-1</root-alter>
</root>
<kind text="7">dominant</kind>
<degree>
<degree-value>9</degree-value>
<degree-alter>-1</degree-alter>
<degree-type>alter</degree-type>
</degree>
<degree>
<degree-value>9</degree-value>
<degree-alter>1</degree-alter>
<degree-type>alter</degree-type>
</degree>
</harmony>