https://github.com/martineausimon/lilypond-lib
My personal framework for LilyPond scores
https://github.com/martineausimon/lilypond-lib
engraving framework lilypond music-engraving scheme
Last synced: 6 days ago
JSON representation
My personal framework for LilyPond scores
- Host: GitHub
- URL: https://github.com/martineausimon/lilypond-lib
- Owner: martineausimon
- Created: 2022-12-24T15:06:58.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-31T09:25:48.000Z (3 months ago)
- Last Synced: 2025-03-30T11:15:39.390Z (about 1 month ago)
- Topics: engraving, framework, lilypond, music-engraving, scheme
- Language: LilyPond
- Homepage:
- Size: 671 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# lilypond-lib
This is my personal framework for LilyPond scores. It's a WIP, and I regularly make additions or modifications.
SCORE EXAMPLES
![]()
![]()
![]()
## Installation
Clone this repository :
```bash
git clone https://github.com/martineausimon/lilypond-lib
```Add `lilypond-lib/` dir to [LilyPond include path](https://lilypond.org/doc/v2.24/Documentation/notation/including-lilypond-files) then use :
```lilypond
\version "2.24.2"
\include "lilypond-lib.ily"
%\include "stylesheet-alt.ly" %% Alternative stylesheet
```## Stylesheet & fonts
This framework is based on [Futura PT](https://fonts.adobe.com/fonts/futura-pt) font.
All fonts are included in the repository, and loaded with `#(ly:font-config-add-directory "./fonts/")`
## Tools
### `\marquage`
Insert a non-transposable rythm section with `Pitch_squash_engraver` :

```lilypond
\relative c' {
r8 f r f aes aes f c
ees4 f \marquage { b4. b8 }
r8 f r f aes4 bes
}
```### `\beat`
Insert beats for rhythm section :

```lilypond
<<
\chords {
d2:m7 ees:7 aes:maj7 b:7 e:maj7 g:7 c1:maj7
}
{
\beat 16
}
>>
```### `\hidePitches`
Hide pitches. Useful for an educational document :
`\hidePitches [num (optional, raise stems)]`

```lilypond
\relative c'' {
g4 g8 a b4 b \hidePitches { fis4 fis8 gis a4 } a
}
```### `\rhythmMarks`
Add rhythm indications at the top/bottom of the staff :
`\rhythmMarks [num (optional, raise rhythms)]`
```lilypond
\relative c' {
\key ees \major
<<
\rhythmMarks 9 {
\repeat unfold 3 { r8 d r4 d2 }
}
\\
{
ees2. g8 f~f2. aes8 g~g1
}
>>
}
```
### `\kick`
Insert a non-transposable `\xNote` :

```lilypond
music = \relative c' {
\partial 8 f8
bes bes aes bes aes aes f aes
f4 r8 \kick b r2
}\score { \transpose c d \music }
```### `\xSpan`
Quickly add a test spanner with or without text :

```lilypond
\relative c' {
a8 b c d \xSpan "Rit" { a b c d }
}
```### `\crochet`
Add a simple analysis bracket with text :

```lilypond
\relative c' {
\crochet "Phrase A" { a8 b c d }
\crochet "Phrase B" { d c b a }
}
```### `\naturalizeMusic`
see [LilyPond manual](https://lilypond.org/doc/v2.21/Documentation/notation/changing-multiple-pitches.fr.html) :

```lilypond
music = \relative c' { c4 d e g }\score {
\new Staff {
\transpose c ais { \music }
\naturalizeMusic \transpose c ais { \music }
\transpose c deses { \music }
\naturalizeMusic \transpose c deses { \music }
}
\layout { }
}
```### "barre" tools
Add barre indication for fretted strings instruments
* `\singleB ["partial num" (optional)] [fret num]` : barre for single note/chord
* `\xBarre ["partial num" (optional)] [fret num] { ... }` : barre for a music section
* `... \startB ["partial num" (optional)] [fret num] ... \stopB` : barre delimiters for more complex situations```lilypond
\relative c'' {
% Single note/chord barre, partial barre :
1 \singleB "3" 3
% Same, complete barre
\singleB 3\xBarre 3 { g16 d' g bes d g8. }
% equivalent to
g,,16 \startB 3 d' g bes d g8. \stopB\xBarre "3" 3 { g8 d bes4 }
% Or
\tuplet 3/2 { fis'4 g8 \startB "3" 3 } d8 bes \stopB
}
```### Parenthesis tool
Add several notes/chords between parenthesis, with a size (optional)
`\openParen [size num (optional)] [fist note] ... \closeParen [size num (optional)] [last note]`
```lilypond
\relative c' {
\openParen a b c \closeParen d
}
```### `\xBook` tool
Use this function instead of `\book` to compile pdf with personalized odd and even headers. This function takes a string for argument, which will be used for `\bookOutputSuffix` and printed in `oddHeaderMarkup` and `evenHeaderMarkup`. The second argument must be a sheme list containing scores. Useful for transposed music :

```lilypond
\version "2.25.9"
\include "lilypond-lib.ily"\header {
title = "TITLE"
subtitle = "Subtitle"
subsubtitle = "subsubtitle"
composer = "Composer"
}music = \relative c'' {
\repeat unfold 20 {
c1 d e f \break
}
}musicBb = \transpose c d \music
\xBook "" #(list #{ \music #})
\xBook "Bb" #(list #{ \musicBb #})
```