ly-fu - play or display lilypond snippets
Set the MIDI_EDITOR and SCORE_VIEWER environment variables to suitable MIDI playing and PDF opening utilities, or adjust the source to your liking.
$ export MIDI_EDITOR=timidity $ export SCORE_VIEWER=xpdf $ ly-fu --instrument=banjo c des ees c des bes c aes $ ly-fu -i=trumpet --open "c8 g'4 c,8 g'4 c,8 g'2" $ echo c e g | ly-fu -
Or, to instead save the generated lilypond somewhere:
$ ly-fu --show-code e e e c1 > masterpiece.ly
Plays and possibly displays lilypond snippets entered at the command line. The MIDI_EDITOR environment variable should be set to a program that can play MIDI files, and the SCORE_VIEWER optionally set to a PDF viewer. (Or edit the source code as necessary.)
MIDI_EDITOR
SCORE_VIEWER
https://www.lilypond.org/ and in particular the Learning and Notation manuals should be consulted to understand the lilypond syntax.
This program currently supports the following command line switches:
Assume lilypond absolute notation.
Set MIDI instrument (see lilypond docs and ZSH compdef script).
Specify the lilypond language to use, by default the lilypond default of nederlands. If using note names from Music::PitchNum::German,
lilypond
nederlands
... | ly-fu --language=deutsch ...
may be of some use. "Note names in other languages" in the lilypond notation reference contains the full list of supported languages.
Save the MIDI and other various files (they are unlinked by default).
Show the score via the SCORE_VIEWER program.
A lilypond fragment played once at the beginning.
Specify what note the input is relative to.
How many times to repeat the (non-partial) input.
Make the staff a lilypond RhythmicStaff instead of the usual one.
RhythmicStaff
Prints the generated lilypond data to standard out, then exits the program. The score is not shown, nor the music played.
Do not play the MIDI.
Kluge sleep before unlinking temporary files (might be handy if SCORE_VIEWER is slow to start).
What the tempo is (in quarter notes, e.g. 120 or the like).
120
Show output from lilypond and the MIDI player.
NOTE This program makes heavy use of temporary files. On a shared system, the lilypond generated output files might introduce /tmp security problems (arbitrary file clobber or unlink against the user running the code). These can be avoided by employing a private temporary directory, for example by pointing the TMPDIR environment variable to such a directory.
TMPDIR
A ZSH completion script is available in the zsh-compdef/ directory of the App::MusicTools distribution. Install this to a $fpath directory.
zsh-compdef/
$fpath
https://www.lilypond.org/
Copyright 2012 Jeremy Mates
This program is distributed under the (Revised) BSD License: https://opensource.org/license/bsd-3-clause/
To install App::MusicTools, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::MusicTools
CPAN shell
perl -MCPAN -e shell install App::MusicTools
For more information on module installation, please visit the detailed CPAN module installation guide.