A set of tools to convert between guitar music formats
This project was initially an attempt to programmatically convert guitar music from plaintext (as in most guitar music websites) to the chordpro format (as chordie and worship together can provide). This is similar to several other git projects, with the difference that it is intended to be easy to add new formats/sources (see below).
There are four parts of the project:
- Command-line program to convert between formats
- Parser to read/write to different sources (such as files or URLs)
- Parser to read/write to a string from different formats
- A intermediate format to store the information regardless of music type
convert_song.py
This hasn't been done properly yet. It doubles as an example of how to use the python packages.
source_parsers/*
Each source_parser converts the music from whatever file format it comes from into a string This string has yet to be converted into the Song format, which the format_parsers do. Sources include:
(This is because I have lots of music in an obscure powerpoint format)
*Will be implemented
**May be implemented
format_parsers/*
Each format_parser converts the music from a plaintext string of the song into the Song format. Formats include:
VERSE
Fm Db
I have this sinking feeling
{c:VERSE}
[Fm] I have this [Db]sinking feeling
(because this is the native format of the Song object, see below for example)
*Will be implemented
**May be implemented
Full examples can be found in the example_formats folder
song_object.py
song_primitives.py
The Song object is a structure for containing all the song meta-data (title, author, capo etc) as well as the music itself. The data is all stored in a dictionary/list tree structure so that it is easy to save as a json to debug. The song primitives include classes for: Meta-data, Labels (eg Verses), Chords and Instructions (eg 'Mute').
A sample of what a line looks like is below. It is by no means the most compact or human-readible format, but it shows how the data is stored, and what kind of information it holds.
{
"line_list": [
{
"chord_dict": {
"0": {
"bass": null,
"root": "F",
"mod": "m"
},
"14": {
"bass": null,
"root": "Db",
"mod": null
}
},
"lyric": " I have this sinking feeling"
}
],
"label": {
"alt": null,
"label_type": "verse",
"value": null,
"pre": false
}
}