gabc-converter is a command-line tool to convert gabc files to JSON or Lilypond. It provides a basic interface to functions in the gabc-parser Rust library.
To build and install this program, you will need the Rust programming language and its build tool, cargo. See rustup.rs to install them.
Clone this repository with git clone https://github.com/saybaar/gabc-converter.git
.
From the project directory, run cargo build
to build the application without installing (the gabc-converter binary will appear in target/debug/ and can be run from there), or cargo install
to build and install it (see here for help with the "cargo install" command; in particular, it requires that $HOME/.cargo/bin
is in your $PATH
environment variable).
This tool has only been tested on Linux systems. If you would like to use it on another OS and run into problems, please open an issue!
gabc-converter <TARGET> [-i INPUT] [-o OUTPUT]
<TARGET>
can be json
, lilypond
, or debug-print
(which prints the gabc input's parse tree for analysis and debugging).
Input and output files may optionally be specified with the -i
and -o
flags. If not specified, input will default to STDIN and output to STDOUT.
With -i and -o flags:
gabc-converter lilypond -i ./examples/populus_sion.gabc -o ./populus_sion.ly
On a Linux system, using I/O redirection with STDIN and STDOUT instead of flags:
./examples/populus_sion.gabc > gabc-converter lilypond > ./populus_sion.ly
Without an -o flag or output redirection, the program will simply print the output to STDOUT:
gabc-converter lilypond -i ./examples/populus_sion.gabc
The gabc files in /examples should all play nicely with this program. populus_sion.gabc is the canonical example in the gabc documentation, and the other examples are from gregobase.
This tool is under development and doesn't yet recognize all gabc syntax. Major gabc features not yet supported include:
- Accidentals and flat clefs (e.g. "cb2")
- gabc comments
- Text above or below the staff
Auto-generated Lilypond output may require adjustments, especially to the transposition range (which is c -> c' by default) or to correct formatting and alignment of lyrics.
- gabctk: A toolkit for gabc, including conversion to Lilypond, abc, midi, and others. Written in Python and documented (only) in French.
- gabc2mid: An earlier iteration of gabctk with midi conversion only. Written in Python with English documentation available.
- gabc-to-ly: Conversion from gabc to Lilypond via a .csv file, which can be manually edited to add organ accompaniment chords. Written in Python.
- lygre: Conversion from gabc to Lilypond. Written in Ruby.
gabc is part of the Gregorio project, which also includes the GregorioTeX tool for rendering gabc. GregorioTeX can be installed locally, which may be a complicated process. Web renderers like run.gregoriochant.org are a simpler option.
Lilypond files can be rendered with lilypond file.ly
on a local installation, or through a web renderer like lilybin.
Copyright (c) 2018 Lydia Simmons
This software is licensed under the GNU General Public License v3.0. See the LICENSE file in this distribution for license terms.