Skip to content

A simple song notation syntax that uses a JSON data structure.

License

Notifications You must be signed in to change notification settings

daryl-williams/JSON-Song-Notation

Repository files navigation

JSON Song Notation

The JSON Song Notation (or JSN) data structure is meant to be a simple representation of a song, defined as some number of measures, consisting of some number of beats per measure with each beat containing some number of voices, i.e. a chord or lyric or a symbolic representation of the beat itself among other possibilities.

Motivation

There is a wealth of song material on the Internet and most every musician I know either carries a stack of binders or perhaps a tablet or computer with the songs that they will use for practive, or for a jam, or to entertain at open mics or even perform professionaly. Now these collection of songs are seldom repesented as full blown musical scores but rather as simple text with the lyrics and chords. But not all of these songs have neem created equaly and some are just downright wrong and need to be tweaked a bit at the very least, but at least they are usually in a plain text format and so it is possible.

So I started looking around for a system that would allow for a more sophisticated way to create these simple song charts of lyric and chords, to ensure more accuracy from the begining. The long and short of it is I was not able to find anything that was simple enough for me to use for this purpose. Yes, there are many music notation systems out there, from full blown, proprietary applications like Dorico, Sibelius, Finale, Band-in-a-Box, Noteflight, Flat to open source programs such as MuseScore, LilyPond, Chordii. These applications are very powerful and sophisticated, being able to produce full blown scores of beautiful sheet music, and they are hard to use, at least for me. All I want is a simple lead sheet with the chords and lyrics in an open data format. There is of course the de facto open standard musicXML that is more than up to the job but again I find it to be more than I need. I find it easier to work with JSON data than data in XML otherwise I would not have bothered with JSN. This is also true of other notation formats like abc notation, ChordPro that aim to help but just aren't easy to work with programmatically. I want is an open source machine readable format, i.e. a data structure that can be used to build music applications; imagine an open source version of Band-in-a-Box! (who doesn't love BIAB)? And that is where the JSON Song Notation format comes in to play.

Objective

Ideas are limited only by imagination, but I think a good start will be a song editor capable of producing a lead sheet that can be output in various formats or styles, for example:

Lead Sheet

or perhaps the more familar:

Lead Sheet

Depending on the client software. To that end there is related project called SongWriter that is the proof of concept and initial reference implementation for the JSN client that is comming soon.

Technical Details

A song expressed in JSN consists of a header (a JSON object) and a body (a JSON array). The header contains song metadata such as title, composer, key, time signature, number of measures, etc. and the body is an array containing the measures and beats of the song. Each measure contains an array of beats and each beat (a JSON ojbect) contains some number of "voices" that occur during that beat, i.e. a chord, lyric, etc. The value of a "voice" is a simple lexical value.

The following very simple example defines a full (if very short) song defined as a JSN structure with only one measure from the song Twinkle, Twinkle Little Star:

{
  "header": {
    "key": "C",
    "tags": "",
    "title": "Twinkle Twinkle",
    "composer": "Traditional",
    "capo_at_fret": "",
    "time_signature": "4/4",
    "beats_per_bar": 4,
    "number_of_bars": 12
  },
  "body": [
    [
      {"chord": "C"}, {"beat":1}, {"lyric": "Twin -"},
      {"chord": ""},  {"beat":1}, {"lyric": "kle, "},
      {"chord": ""},  {"beat":1}, {"lyric": "twin -"},
      {"chord": ""},  {"beat":1}, {"lyric": "kle, "}
    ]
  ]
}

Here is the full song rendered in JSN format: Twinkle Twinkle Little Star.

Or view the whole song here:

{
  "header": {
    "key": "C",
    "tags": "",
    "title": "Twinkle Twinkle",
    "composer": "Traditional",
    "capo_at_fret": "",
    "time_signature": "4/4",
    "beats_per_bar": 4,
    "number_of_bars": 12
  },
  "body": [
    [
      { "chord": "C", "beat": 1, "lyric": "Twin - " },
      { "chord": "",  "beat": 1, "lyric": "kle, " },
      { "chord": "",  "beat": 1, "lyric": "twin - " },
      { "chord": "",  "beat": 1, "lyric": "kle, " }
    ],
    [
      { "chord": "F", "beat": 1, "lyric": "lit - " },
      { "chord": "",  "beat": 1, "lyric": "tle " },
      { "chord": "C", "beat": 1, "lyric": "star," },
      { "chord": "",  "beat": 1, "lyric": "" }
    ],
    [
      { "chord": "F", "beat": 1, "lyric": "How" },
      { "chord": "",  "beat": 1, "lyric": "I" },
      { "chord": "C", "beat": 1, "lyric": "won -" },
      { "chord": "",  "beat": 1, "lyric": " der " }
    ],
    [
      {
      "chord": "G7",  "beat": 1, "lyric": "what" },
      { "chord": "",  "beat": 1, "lyric": "you" },
      { "chord": "C", "beat": 1, "lyric": "are." },
      { "chord": "",  "beat": 1, "lyric": "" }
    ],
    [
      { "chord": "C", "beat": 1, "lyric": "Up" },
      { "chord": "",  "beat": 1, "lyric": "a - " },
      { "chord": "F", "beat": 1, "lyric": "bove" },
      { "chord": "",  "beat": 1, "lyric": "the " }
    ],
    [
      { "chord": "C",  "beat": 1, "lyric": "world" },
      { "chord": "",   "beat": 1, "lyric": "so" },
      { "chord": "G7", "beat": 1, "lyric": "high," },
      { "chord": "",   "beat": 1, "lyric": "" }
    ],
    [
      { "chord": "C", "beat": 1, "lyric": "like" },
      { "chord": "",  "beat": 1, "lyric": "a" },
      { "chord": "F", "beat": 1, "lyric": "dia - " },
      { "chord": "",  "beat": 1, "lyric": "mond" }
    ],
    [
      { "chord": "C",  "beat": 1, "lyric": "in" },
      { "chord": "",   "beat": 1, "lyric": "the" },
      { "chord": "G7", "beat": 1, "lyric": "sky." },
      { "chord": "",   "beat": 1, "lyric": "" }
    ],
    [
      { "chord": "C", "beat": 1, "lyric": "Twin - " },
      { "chord": "",  "beat": 1, "lyric": "kle" },
      { "chord": "",  "beat": 1, "lyric": "twin - " },
      { "chord": "",  "beat": 1, "lyric": "kle" }
    ],
    [
      { "chord": "F", "beat": 1, "lyric": "lit - " },
      { "chord": "",  "beat": 1, "lyric": "tle" },
      { "chord": "C", "beat": 1, "lyric": "star" },
      { "chord": "C", "beat": 1, "lyric": "" }
    ],
    [
      { "chord": "F", "beat": 1, "lyric": "How" },
      { "chord": "",  "beat": 1, "lyric": "I" },
      { "chord": "C", "beat": 1, "lyric": "won -" },
      { "chord": "",  "beat": 1, "lyric": " der " }
    ],
    [
      { "chord": "G7", "beat": 1, "lyric": "what" },
      { "chord": "",   "beat": 1, "lyric": "you" },
      { "chord": "C",  "beat": 1, "lyric": "are." },
      { "chord": "",   "beat": 1, "lyric": "" }
    ]
  ]
}

There is also work underway on the next version of the JSON Song Notation structure to enable additonal functionality: Proposed JSN version 2.

About

A simple song notation syntax that uses a JSON data structure.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published