💾 Archived View for g.nubecita.online › musica › lilypond.org captured on 2023-07-22 at 16:25:41. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-01-29)

-=-=-=-=-=-=-

Documentation:

http://lilypond.org/doc/v2.22/Documentation/learning/aligning-lyrics-to-a-melody

"Compiling Music" Section with basic notation and examples:

http://lilypond.org/text-input.html

Manual:

http://lilypond.org/manuals.html

Manuals are at info too.

Lilypond sources provides some Elisp packages for Emacs. In Manjaro and several distributions, the lilypond package contains these files, and are placed at [[file:/usr/share/emacs/site-lisp][file:/usr/share/emacs/site-lisp]] directory after installing it.

To load the LilyPond mode use the following snippet:

+caption: Elisp code to load the LilyPond major mode.

+BEGIN_SRC elisp

(push "/usr/share/emacs/site-lisp" load-path)

(load-file "/usr/share/emacs/site-lisp/lilypond-init.el")

+END_SRC

After loading the snippet, the LilyPond-mode is available to use.

Use =C-c C-c lilypond RET= to compile the file. To play the MIDI file use =C-c C-c midi RET=. The last command triggers two compilation commands (which may be considered as a bug in recent Emacs): the compilation with lilypond, and the MIDI player. Thus, it may appear the message "A compilation process is running; kill it? (y or n)", just wait until the current lilypond compilation is done, and press =y= to continue (which will not kill the process because it has already ended, it just continue with the player "compilation").

Lilypond exports to MIDI when it find the =\midi { }= command inside the =\score { ... }=.

The score with the =\midi= is not exported to PDF, only to MIDI. Another score should be used to export a PDF too.

Lilypond will use the relevant part that a MIDI format and player can use. For instance: notes, chords, lyrics (song lyrics are shown while playing the song as if the player is signing), tempo, etc.

This is a basic template to create a MIDI file with Lilypond.

+caption: Template to create a MIDI file with Lilypond.

+BEGIN_SRC lilypond

\version "2.22.2"

\score {

\relative c' {

\tempo 4 = 160

c4 d e f g a b c'

}

\layout { }

\midi { }

}

+END_SRC

To play the MIDI file, a player or an output must be specified. In this case, the timidity++ player is used. Timidity can be used as a standalone program or as an output, but here is configured as standalone.

Install timidity++ and the required soundfont

+BEGIN_SRC fish

pacman -S timidity++

pacman -S freepats-general-midi soundfont-fluid

+END_SRC

Then, configure timidity to use a sound font. Just add the following lines into the config file.

+BEGIN_SRC fish

echo 'soundfont /usr/share/soundfonts/freepats-general-midi.sf2' >> /etc/timidity/timidity.cfg

echo '# soundfont /usr/share/soundfonts/FluidR3_GM.sf2' >> /etc/timidity/timidity.cfg

+END_SRC

Timidity is now ready to use. To play the file, execute like the following:

: timidity -OO the_file.midi

User interfaces are available with =-in= for terminal text interface, or =-ig= for GTK Graphical interface. For example, the following will open a graphical interface:

: timidity -OO -ig the_file.midi

More information:

- https://wiki.archlinux.org/title/Timidity

- http://linux-sound.org/midi.html

+name: before-save

+BEGIN_SRC emacs-lisp :results silent

(require 'ox-gemini)

(org-export-to-file 'gemini "lilypond.gmi")

+END_SRC

----------------------------------------------------------------------

+TITLE: Lilypond

+SUBTITLE:

+AUTHOR: Christian Gimenez

+DATE: 15 oct 2022

+EMAIL:

+DESCRIPTION:

+KEYWORDS:

+COLUMNS: %40ITEM(Task) %17Effort(Estimated Effort){:} %CLOCKSUM

+STARTUP: inlineimages hidestars content hideblocks entitiespretty

+STARTUP: indent fninline latexpreview

+OPTIONS: H:3 num:t toc:t \n:nil @:t ::t |:t ^:{} -:t f:t *:t <:t

+OPTIONS: TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc

+OPTIONS: tex:imagemagick

+TODO: TODO(t!) CURRENT(c!) PAUSED(p!) | DONE(d!) CANCELED(C!@)

-- Export

+LANGUAGE: en

+LINK_UP:

+LINK_HOME:

+EXPORT_SELECT_TAGS: export

+EXPORT_EXCLUDE_TAGS: noexport

#+export_file_name: index

-- HTML Export

+INFOJS_OPT: view:info toc:t ftoc:t ltoc:t mouse:underline buttons:t path:libs/org-info.js

+HTML_LINK_UP: index.html

+HTML_LINK_HOME: index.html

+XSLT:

-- For ox-twbs or HTML Export

#+HTML_HEAD: <link href="libs/bootstrap.min.css" rel="stylesheet">

-- -- LaTeX-CSS

#+HTML_HEAD: <link href="css/style-org.css" rel="stylesheet">

#+HTML_HEAD: <script src="libs/jquery.min.js"></script>

#+HTML_HEAD: <script src="libs/bootstrap.min.js"></script>

-- LaTeX Export

#+LATEX_CLASS: article

+latex_compiler: xelatex

#+latex_class_options: [12pt, twoside]

+latex_header: \usepackage{csquotes}

#+latex_header: \usepackage[spanish]{babel}

#+latex_header: \usepackage[margin=2cm]{geometry}

#+latex_header: \usepackage{fontspec}

-- biblatex

+latex_header: \usepackage[backend=biber, style=alphabetic, backref=true]{biblatex}

+latex_header: \addbibresource{tangled/biblio.bib}

-- -- Tikz

#+LATEX_HEADER: \usepackage{tikz}

#+LATEX_HEADER: \usetikzlibrary{arrows.meta}

#+LATEX_HEADER: \usetikzlibrary{decorations}

#+LATEX_HEADER: \usetikzlibrary{decorations.pathmorphing}

#+LATEX_HEADER: \usetikzlibrary{shapes.geometric}

#+LATEX_HEADER: \usetikzlibrary{shapes.symbols}

#+LATEX_HEADER: \usetikzlibrary{positioning}

#+LATEX_HEADER: \usetikzlibrary{trees}

#+LATEX_HEADER_EXTRA:

-- Info Export

+TEXINFO_DIR_CATEGORY: A category

+TEXINFO_DIR_TITLE: Lilypond: (lilypond)

+TEXINFO_DIR_DESC: One line description.

+TEXINFO_PRINTED_TITLE: Lilypond

+TEXINFO_FILENAME: lilypond.info

Local Variables:

org-hide-emphasis-markers: t

org-use-sub-superscripts: "{}"

fill-column: 80

visual-line-fringe-indicators: t

ispell-local-dictionary: "british"

org-latex-default-figure-position: "tbp"

eval: (add-hook 'before-save-hook (lambda () (org-babel-ref-resolve "before-save")) nil t)

End: