Usage¶
Roles¶
The lily
role¶
You can use lily
role to insert a single LilyPond Music Expression as
inline score.
- Inline Score¶
- reStructuredText
:lily:`{c'}` is the first note of the C major scale.
Resultis the first note of the C major scale.
If the score contains MIDI block, the extension will generate audio file and show a player beside the score:
- Playable Inline Score¶
- reStructuredText
:lily:`{c' e' g' } \layout{} \midi{}` is playable.
Resultis playable.
Added in version 2.1.0.
Hint
Some implementation details to help you debug your music expressions:
the music expression will be wrapped by a \score
block before passing
to Lilypond.
For example, :lily:`{c'}`
will be converted to \scores { {c'} }
.
Directives¶
The lily
directive¶
The lily
directive is used to insert a complete LilyPond score as
block level element.
.. lily:: \version "2.20.0" \header { title = "翼をください, Excerpts" } \score { << \new Staff \relative c' { \time 4/4 \tempo 4 = 70 r4 r r c8 d e8 e f16 e8 d16 (d4) e8 d c8 c d16 c8 b16 (b4) b8 g a4 c8 a g4 c4 d4 r r r } >> \layout {} \midi {} }
The directive supports the following options:
- nocrop:
(flag) Set this option to have scores output to images with appropriate margins and preset size (A4), which is easy for printing. See
🎵 Original paper size
.Changed in version 2.0.0.
- noaudio:
(flag) If the score contains MIDI block, Lilypond generates MIDI output files. which are converted to audio files by this extension. Use this option to disable audio, see
🎵 Disable Audio
.Changed in version 2.0.0.
- loop:
(flag) Whethre audio player will automatically seek back to the start upon reaching the end of the audio. This conflicts with
noaudio
. Example:🎵 Loop
.Added in version 1.2.
- transpose:
(text) Transposing the pitches of score from one to another. Pitches are written in LilyPond Notation and separated in whitespace. For example:
:transpose: g c
, see🎵 Transposing
.Added in version 2.0.0.
- controls:
(text, one of the
top
orbottom
) Specify the position of the control bar relative to the score. This impliesaudio
. See example🎵 Control Bar at the Top
.Added in version 1.3.
The lilyinclude
directive¶
The lilyinclude
directive is similar to The lily directive,
except the source of LilyPond are read from file but not contents of directive.
.. lilyinclude:: /_scores/witch-spring.ly
Options of the directive are same to The lily directive.
See also
You and download the example LilyPond documentation from here:
/_scores/witch-spring.ly
.
The jianpu
directive¶
Added in version 1.6.
The jianpu
directive is used to insert a Jianpu
(Numbered Musical Notation, 简谱) score as block level element.
Hint
The syntax of Jianpu is defined by Silas S. Brown and we use his jianpu-ly script to convert Jianpu source code to Lilypond source code, and finally engraving a music score.
.. jianpu:: title=C Major Scale 1=C 2/4 4=60 1 2 3 4 5 6 7 1'
Options of the directive are same to The lily directive.
The jianpuinclude
directive¶
Added in version 1.6.
The jianpuinclude
directive is similar to The jianpu directive,
except the source of Jianpu are read from file but not contents of directive.
.. jianpuinclude:: /_scores/songbie.jp
See also
You and download the example LilyPond documentation from here:
/_scores/songbie.jp
.
Options of the directive are same to The lily directive.