├── .gitignore ├── .travis.yml.bak ├── LICENSE ├── README.md ├── custom-music-fonts ├── LilyJAZZ │ └── README.md └── smufl │ ├── LICENSE │ ├── README.md │ ├── bravura-1.12 │ ├── FONTLOG.txt │ ├── OFL-FAQ.txt │ ├── OFL.txt │ ├── bravura-text.md │ ├── bravura_metadata.json │ ├── eot │ │ ├── Bravura.eot │ │ └── BravuraText.eot │ ├── otf │ │ ├── Bravura.otf │ │ └── BravuraText.otf │ ├── svg │ │ ├── Bravura.svg │ │ └── BravuraText.svg │ └── woff │ │ ├── Bravura.woff │ │ └── BravuraText.woff │ ├── definitions.ily │ ├── example.ly │ ├── glyphnames.json │ ├── glyphnames.py │ └── smufldata.ily ├── debugging-layout ├── README.md ├── color-voices-and-directions │ ├── color-directions-example.ly │ ├── color-directions.ily │ ├── color-voices-example.ly │ ├── color-voices.ily │ ├── display-directions-example.ly │ └── display-directions.ily ├── debug-layout-options-test.ily ├── display-control-points │ ├── display-curve-control-points.ly │ └── display-curve-control-points.png ├── display-grob-anchors │ ├── definitions.ily │ ├── example.ly │ └── module.ily ├── display-grob-names │ ├── definitions.ily │ ├── example.ly │ └── module.ily ├── display-paper-columns │ ├── example.ly │ └── module.ily └── original-breaks │ ├── definitions.ily │ └── example.ly ├── deprecate.ily ├── editorial-tools ├── auto-transpose │ ├── README.md │ ├── definitions.ily │ ├── example.ly │ ├── example2.ly │ └── module.ily ├── edition-engraver │ ├── README.md │ ├── definitions.ily │ ├── example.ly │ ├── module.ily │ ├── module.scm │ └── rehearsal-marks-test.ly ├── git-commands │ ├── definitions.ily │ └── example.ly ├── line-break-marks │ ├── README.md │ ├── definitions.ily │ ├── examples.ly │ ├── line-break-marks.png │ └── module.ily ├── merge-rests-engraver │ ├── README.md │ ├── definition.ily │ ├── example.ly │ └── module.ily └── partial-compilation │ ├── compile-by-systems.ily │ ├── definitions.ily │ ├── produce-breaking-information-systems.count │ ├── produce-breaking-information-systems.tex │ └── produce-breaking-information-systems.texi ├── fried-library-to-be-sorted ├── README.md ├── cross-voice-curves.ily ├── date-function.ily ├── double-bars-engraver.ily ├── editorial-tools.ily ├── fried-headers.ily ├── fried-layout.ily ├── generic-shorthands.ily ├── lied-stylesheet.ily ├── lyrics-shorthands.ily ├── make-octaves.ily ├── markup-with-access-to-header-fields.ily ├── piano-shorthands.ily ├── progress-string.ily ├── set-horizontal-spacing.ily ├── squeeze-notation.ily ├── staccato-corrector-engraver.ily ├── take warning from here.ily └── tuplet-numers-on-kneed-beams.ily ├── general-tools ├── README.md ├── git-commands │ ├── definitions.ily │ └── example.ly ├── includeHelper │ ├── definitions.ily │ ├── example.ly │ └── example │ │ ├── f1.ly │ │ ├── f2.ly │ │ └── f3.ly ├── lilypond-version-predicates │ ├── definitions.ily │ └── example.ly ├── readComment │ ├── definitions.ily │ ├── example.ly │ └── module.ily └── scheme-wrapper │ ├── README.md │ ├── a-list-access │ ├── definitions.ily │ └── example.ly │ ├── add-guile-path │ ├── definitions.ily │ ├── example.ly │ └── my-scheme │ │ ├── my-init.scm │ │ └── my-module.scm │ └── parserDefine │ ├── definitions.ily │ └── example.ly ├── input-shorthands ├── README.md ├── articulations-not-aligned-with-notes │ ├── definitions.ily │ ├── example.ly │ ├── example.png │ └── module.ily ├── easy-custom-dynamics │ ├── definitions.ily │ ├── example.ly │ ├── example.png │ └── module.ily ├── easy-octaves │ ├── definitions.ily │ ├── example.ly │ └── example.png ├── fuzzy-scale │ ├── definitions.ily │ ├── example.ly │ └── module.ily ├── ignore-collisions │ ├── definitions.ily │ └── examples.ly ├── late-evaluation-of-variables.ly ├── optional-chord │ ├── definitions.ily │ └── example.ly ├── sizeContext │ ├── definitions.ily │ └── example.ly └── vertical-spacing │ ├── definitions.ily │ ├── example.ly │ └── module.ily ├── ly ├── _internal │ ├── doc-include │ │ ├── titling.ily │ │ └── usage-example.ily │ ├── init-openlilylib.ily │ ├── logging.ily │ ├── module-handling.ily │ ├── options.ily │ └── utilities │ │ ├── __main__.ily │ │ ├── alist-access.ily │ │ ├── alist-example.ly │ │ ├── general-predicates.ily │ │ ├── include-pattern.ily │ │ ├── lilypond-version-predicates.ily │ │ ├── lilypond-version-predicates.ly │ │ ├── os-path.scm │ │ ├── tree-example.ly │ │ ├── tree.ily │ │ └── tree.scm ├── basic-example.ly ├── comptools │ ├── README.md │ ├── __init__.ily │ ├── __main__.ily │ ├── conditional-breaks.ily │ ├── partial-compilation.ily │ ├── unit-tests │ │ ├── partial-compilation-01.ly │ │ ├── partial-compilation-02.ly │ │ ├── partial-compilation-03.ly │ │ ├── partial-compilation-04.ly │ │ ├── partial-compilation-05.ly │ │ ├── partial-compilation-06.ly │ │ └── partial-compilation-07.ly │ └── usage-examples │ │ ├── comptools-test-data.ily │ │ ├── conditional-breaks.ly │ │ └── partial-compilation.ly ├── example │ ├── __init__.ily │ ├── __main__.ily │ └── load-test.ily ├── gridly │ ├── CHANGELOG.md │ ├── README.md │ ├── __init__.ily │ ├── __main__.ily │ ├── grid-templates.ily │ └── usage-examples │ │ ├── .automated-tests-exclude │ │ ├── .automated-tests-include │ │ ├── example.ly │ │ ├── multi-file │ │ ├── global.ily │ │ ├── main.ly │ │ └── parts │ │ │ ├── alto-I.ily │ │ │ ├── basso-I.ily │ │ │ ├── soprano-I.ily │ │ │ └── tenore-I.ily │ │ ├── opening-lyrics.ly │ │ └── transpose.ly ├── openlilylib ├── scholarly │ ├── README.md │ ├── __init__.ily │ ├── __main__.ily │ ├── annotate │ │ ├── __main__.ily │ │ ├── config.ily │ │ ├── examples │ │ │ └── annotate.annotations.inp │ │ ├── export-latex.ily │ │ ├── export-plaintext.ily │ │ ├── export.ily │ │ ├── format.ily │ │ └── sort.ily │ ├── diplomatic-line-breaks.ily │ ├── roadmap │ │ └── annotate.md │ └── usage-examples │ │ ├── annotate.ly │ │ └── diplomatic-line-breaks.ly ├── stylesheets │ ├── README.md │ ├── __init__.ily │ ├── __main__.ily │ ├── fonts │ │ ├── arnold-default.ily │ │ ├── arnold-extensions.ily │ │ ├── beethoven-default.ily │ │ ├── cadence-default.ily │ │ ├── gonville-default.ily │ │ ├── gutenberg1939-default.ily │ │ ├── haydn-default.ily │ │ ├── henle-material │ │ │ ├── chopin-1.tiff │ │ │ └── chopin-2.tiff │ │ ├── improviso-default.ily │ │ ├── lilyboulez-default.ily │ │ ├── lilyjazz-default.ily │ │ ├── lilyjazz-extensions.ily │ │ ├── paganini-default.ily │ │ ├── profondo-default.ily │ │ ├── ross-default.ily │ │ ├── scorlatti-default.ily │ │ └── sebastiano-default.ily │ ├── load-font │ └── usage-examples │ │ ├── .automated-tests-exclude │ │ └── fonts │ │ ├── arnold--berg-opus-5-excerpt.ly │ │ ├── beethoven--beethoven-opus-10-3.ly │ │ ├── beethoven--example-helpers.ily │ │ ├── beethoven--notes.ily │ │ ├── haydn-sonata.ly │ │ ├── haydn-sonata.preview.png │ │ └── improviso-all-of-me.ly ├── tablature │ ├── README.md │ ├── __init__.ily │ ├── __main__.ily │ ├── bending.ily │ ├── microtones.ily │ └── usage-examples │ │ ├── bends.ly │ │ └── microtones.ly ├── usage-examples │ ├── include-pattern-examples │ │ ├── f1.ily │ │ ├── f2.ily │ │ └── f3.ily │ └── include-pattern.ly └── utility │ ├── __init__.ily │ ├── __main__.ily │ └── rhythmic-location.ily ├── meta ├── README.md ├── adding-new-file-github-interface.png ├── commit-msg ├── commit_message_hook.md ├── contributing.md ├── editing-pull-request.png ├── generate-pngs.sh ├── install-git-hooks.sh ├── no-tagline.ily ├── snippet-templates │ ├── includable-snippet-template │ │ ├── README.md │ │ ├── definitions.ily │ │ └── example.ly │ └── simple-snippet-template.ly ├── status-values.md └── todo.md ├── notation-snippets ├── README.md ├── adjust-horizontal-spacing │ ├── definitions.ily │ ├── example.ly │ ├── example.png │ └── module.ily ├── align-lyrics-on-vowels │ ├── definitions.ily │ ├── example.ly │ └── example.png ├── aligning-first-lyric-syllables │ ├── definitions.ily │ ├── example.ly │ └── module.ily ├── alternating-time-signatures │ ├── alternatingTimeSignatures.ly │ ├── alternatingTimeSignatures.png │ ├── definitions.ily │ ├── examples.ly │ ├── gould-interch.ly │ ├── gould-sketch.ly │ └── module.ily ├── compound-slurs │ ├── common-math-and-stencils.ily │ ├── example-flat-slur.ly │ ├── example-ravel.ly │ ├── example-sorabij.ly │ ├── example-straight.ly │ ├── example-weird-and-scale.ly │ └── module.ily ├── divisi │ ├── definitions.ily │ ├── example.ly │ └── module.ily ├── fill-line-evenly │ ├── definitions.ily │ ├── example.ly │ └── module.ily ├── guitar-string-bending │ ├── README.md │ ├── definitions.ily │ ├── example.ly │ └── module.ily ├── hairpin-with-text │ ├── README.md │ ├── definitions.ily │ ├── example.ly │ └── module.ily ├── interchangeable-metres │ ├── README.md │ ├── america.png │ ├── definitions.ily │ ├── examples.ly │ └── module.ily ├── interval-brackets │ ├── definitions.ily │ ├── example.ly │ └── module.ily ├── lyric-syllable-magnetic-snap │ ├── definitions.ily │ └── example.ly ├── manual-partcombine-for-vocal-parts │ ├── definitions.ily │ ├── example.ly │ ├── example.png │ └── module.ily ├── metricmod-function │ ├── definitions.ily │ ├── example.ly │ └── module.ily ├── overriding-stencils │ ├── definitions.ily │ ├── example.ly │ └── module.ily ├── pedal-decorations │ ├── README.md │ ├── definitions.ily │ ├── example.ly │ └── module.ily ├── scale-stencils │ ├── scaling-stencils.ly │ └── scaling-stencils.png ├── scale-vertical-spacing │ ├── README.md │ ├── definitions.ily │ ├── example.ly │ └── module.ily ├── shaping-bezier-curves │ ├── README.md │ ├── shape-tie-column │ │ ├── README.md │ │ ├── definition.ily │ │ ├── example.ly │ │ └── module.ily │ ├── shapeII.ily │ ├── shapeII │ │ ├── example.ly │ │ └── module.ily │ ├── slur-attachments.ily │ ├── slur-attachments │ │ ├── example.ly │ │ └── module.ily │ └── special-cpts-display.ily ├── slash-beam │ ├── definitions.ily │ ├── example.ly │ └── module.ily └── slash-stem │ ├── definitions.ily │ ├── example.ly │ └── module.ily ├── package.cnf ├── package.ily ├── scheme-lib ├── README.md ├── lalily │ ├── README.md │ ├── parser-location.scm │ ├── registry.scm │ ├── storage.scm │ └── utilities.scm └── modules.ily ├── simple-examples ├── README.md └── using-tie-configuration-property.ly ├── specific-solutions ├── README.md ├── bracket-repeats │ ├── definitions.ily │ ├── example.ly │ └── module.ily ├── ismn │ ├── README.md │ ├── definitions.ily │ ├── example.ly │ └── module.ily └── xelatex-markup-list │ ├── .gitignore │ ├── README.md │ ├── definitions.ily │ ├── example.ly │ └── module.ily ├── stylesheets ├── README.md ├── modern │ ├── README.md │ ├── example.ly │ └── settings.ily └── old-style │ ├── README.md │ ├── example.ly │ └── settings.ily ├── templates ├── README.md ├── SATB-choir-on-2-or-4-staves │ ├── SATB-choir-on-2-or-4-staves.ly │ └── SATB-choir-on-2-or-4-staves.png ├── adjustable-centered-stanzas │ ├── definitions.ily │ ├── example.ly │ └── module.ily ├── lalily │ ├── README.md │ ├── definitions.ily │ ├── definitions.scm │ ├── example-accomp.ly │ ├── example-book.ly │ ├── example-choir-cont.ly │ ├── example-satb.ly │ ├── example-transpose.ly │ ├── example.ly │ ├── init.scm │ ├── store-init.scm │ ├── store.scm │ └── templates │ │ ├── README.md │ │ ├── base.ily │ │ ├── instrument.ily │ │ ├── piano.ily │ │ ├── tools.ily │ │ └── vocal.ily └── predefined-instruments │ ├── README.md │ ├── context-creating-function.ily │ ├── example.ly │ ├── example.png │ ├── ideas-for-the-future.md │ └── instrument-context-definitions.ily └── test ├── .automated-tests-include ├── README.md ├── TEST-RESULTS.md ├── automated_tests.py ├── common_functions.py ├── install_lilypond.py ├── lilycmd.py └── results └── .forcedir /.gitignore: -------------------------------------------------------------------------------- 1 | *.pdf 2 | *.eps 3 | *.ps 4 | *.midi 5 | *.mid 6 | *.log 7 | *~ 8 | *.zip 9 | 10 | *.pyc 11 | 12 | # We don't generally want to track HTML files 13 | # as they can still be added manually 14 | *.html 15 | 16 | # log files by ScholarLY 17 | *.inp 18 | -------------------------------------------------------------------------------- /.travis.yml.bak: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # 3 | # Travis CI configuration 4 | # ======================= 5 | # 6 | # This file configures the Continuous Integration server on travis-ci.org 7 | # 8 | ############################################################################### 9 | 10 | language: python 11 | 12 | # This will route the build job to the new Travis build environment 13 | sudo: false 14 | 15 | # Keep installed lilypond versions between builds 16 | cache: 17 | directories: 18 | - $HOME/.lilypond 19 | 20 | # Download and install LilyPond (stable and devel) 21 | # when not present already (cached between builds) 22 | install: 23 | - pip install python-dateutil 24 | - python ./test/install_lilypond.py 25 | 26 | # This is the script that will actually run the tests 27 | script: ./test/automated_tests.py 28 | 29 | # These are environment variables that are used to configure the 30 | # tests. 31 | # 32 | # - LILY_PLATFORM is the platform for which lilypond was 33 | # compiled. Note that travis-ci is running 64 bit 34 | # Linux virtual machines, hence `linux-64` is pretty 35 | # much the only value that makes sense. 36 | # 37 | # - LILY_VERSION is the version of lilypond with which we want to 38 | # run the tests. "stable" and "devel" are placeholders 39 | # for values retrieved from test/LILYPOND-VERSIONS 40 | # during the installation and test scripts 41 | env: 42 | - LILY_PLATFORM=linux-64 LILY_VERSION=2.18.2-1 43 | - LILY_PLATFORM=linux-64 LILY_VERSION=2.19.30-1 44 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Since most of the snippets are separate entities, 2 | they can be licensed individially. 3 | There are no official rules on licensing (yet); 4 | We suggest that unless otherwise specified 5 | everything should be licensed under the MIT license 6 | as found at http://opensource.org/licenses/MIT. 7 | 8 | Any content of this repository that isn't explicitly 9 | licensed is implicitly licensed under the rules of 10 | this MIT license. 11 | -------------------------------------------------------------------------------- /custom-music-fonts/LilyJAZZ/README.md: -------------------------------------------------------------------------------- 1 | ## LilyJAZZ 2 | 3 | In March 2013 Torsten Hämmerle sent a wonderful LilyPond add-on to the 4 | lilypond-user mailing list: **LilyJAZZ**. Read his original announcement in [this 5 | message](http://lists.gnu.org/archive/html/lilypond-user/2013-03/msg00647.html). 6 | LilyJAZZ offers a JAZZ Music and a JAZZ Text font along with tools to 7 | integrate them in LilyPond. 8 | 9 | #### Disclaimer: 10 | The licensing status of this material isn't completely clear. The original developer 11 | isn't available and can't be contacted through email or phone anymore. 12 | Therefore we can only rely on his original post where he states that 13 | 14 | > the whole LilyJAZZ issue shall be open and free (just like Lilypond), so I first 15 | had to create my own fonts in order to become independent of commercial ones. 16 | 17 | We consider this as a release under the same licensing model as LilyPond (i.e. GPL). 18 | "shall be" is surely not meant as a temporal expression but as an expression of intent 19 | (it is probably inexactly translated from the German "soll sein", not from "wird sein"). 20 | Torsten surely meant that having created the fonts was the prerequisite for being 21 | able to release it under a free license, and not that making the material available 22 | in that message was the prerequisite to release it "open and free" at some undetermined 23 | point in future. 24 | 25 | #### Usage: 26 | 27 | To use **LilyJAZZ** you have to [please continue ...] 28 | -------------------------------------------------------------------------------- /custom-music-fonts/smufl/LICENSE: -------------------------------------------------------------------------------- 1 | This work is under the public domain, except for `glyphnames.json` (and its derivative `smufldata.ily`), which is copyright 2013 Steinberg Media Technologies and released under the MIT license. 2 | -------------------------------------------------------------------------------- /custom-music-fonts/smufl/bravura-1.12/eot/Bravura.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openlilylib/snippets/63858cdaf121935a6a2d835058bf24e2cea81a5a/custom-music-fonts/smufl/bravura-1.12/eot/Bravura.eot -------------------------------------------------------------------------------- /custom-music-fonts/smufl/bravura-1.12/eot/BravuraText.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openlilylib/snippets/63858cdaf121935a6a2d835058bf24e2cea81a5a/custom-music-fonts/smufl/bravura-1.12/eot/BravuraText.eot -------------------------------------------------------------------------------- /custom-music-fonts/smufl/bravura-1.12/otf/Bravura.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openlilylib/snippets/63858cdaf121935a6a2d835058bf24e2cea81a5a/custom-music-fonts/smufl/bravura-1.12/otf/Bravura.otf -------------------------------------------------------------------------------- /custom-music-fonts/smufl/bravura-1.12/otf/BravuraText.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openlilylib/snippets/63858cdaf121935a6a2d835058bf24e2cea81a5a/custom-music-fonts/smufl/bravura-1.12/otf/BravuraText.otf -------------------------------------------------------------------------------- /custom-music-fonts/smufl/bravura-1.12/woff/Bravura.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openlilylib/snippets/63858cdaf121935a6a2d835058bf24e2cea81a5a/custom-music-fonts/smufl/bravura-1.12/woff/Bravura.woff -------------------------------------------------------------------------------- /custom-music-fonts/smufl/bravura-1.12/woff/BravuraText.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openlilylib/snippets/63858cdaf121935a6a2d835058bf24e2cea81a5a/custom-music-fonts/smufl/bravura-1.12/woff/BravuraText.woff -------------------------------------------------------------------------------- /custom-music-fonts/smufl/example.ly: -------------------------------------------------------------------------------- 1 | \version "2.18.0" 2 | 3 | \include "definitions.ily" 4 | 5 | music = \relative c' { 6 | \clef alto 7 | \time 3/4 8 | c4-.(\f\< d4-. es4-.) | 9 | \time 4/4 10 | fis8.---\trill\sfz\> e!16\downbow d16->\niente r16 r8 c2-\prall | 11 | \time 2/2 12 | \clef treble 13 | r2-\fermata c8( eeh8)-^ \tuplet 3/2 { eeh8( gisih8 b')-! } | 14 | c,,4. c8 c4.. c16 | 15 | } 16 | 17 | << 18 | \new Staff \with { instrumentName = "Feta" } \music 19 | \new Staff \with { \bravuraOn instrumentName = "Bravura" } \music 20 | >> 21 | 22 | \markup "Create a ligature of two glyphs with \\smufllig" 23 | 24 | \markup { \smufllig #'("gClefLigatedNumberAbove" "tuplet4") } 25 | -------------------------------------------------------------------------------- /custom-music-fonts/smufl/glyphnames.py: -------------------------------------------------------------------------------- 1 | """ 2 | Converts the JSON glyph names for SMUFL into a LilyPond include. 3 | """ 4 | import json 5 | import textwrap 6 | 7 | IN_FILENAME = 'glyphnames.json' 8 | OUT_FILENAME = 'smufldata.ily' 9 | 10 | PREAMBLE = '''%{ 11 | Copyright (c) 2013 Steinberg Media Technologies GmbH 12 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 13 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | %}''' 16 | 17 | content = json.load(open(IN_FILENAME, 'r')) 18 | 19 | outfile = open(OUT_FILENAME, 'w') 20 | outfile.write('\n\n'.join([textwrap.fill(par, 70) for par in PREAMBLE.splitlines()]) + '\n' * 3) 21 | outfile.write("#(define smufl-map '(\n") 22 | 23 | for name, value in content.items(): 24 | try: 25 | code = value['codepoint'][2:] 26 | except KeyError: 27 | continue 28 | outfile.write(' ("{}" . #x{})\n'.format(name, code)) 29 | 30 | outfile.write('))') 31 | outfile.close() 32 | -------------------------------------------------------------------------------- /debugging-layout/README.md: -------------------------------------------------------------------------------- 1 | Debugging lilypond layout 2 | ------------------------- 3 | 4 | Sometimes you'd like to see why LilyPond did something, or you'd like 5 | to see some details like the positions of slur control points. This 6 | category is for snippets like this. 7 | 8 | 9 | ### debugging layout and Frescobaldi 10 | 11 | In Frescobaldi, there are two "modes" of compiling a file: 12 | 13 | * preview mode 14 | * publication mode 15 | 16 | The idea is that when you are working on the score, you use preview mode, 17 | and when you're done, you use publication mode to get the "final" pdf. 18 | Currently the only difference between these two modes is point-and-click - 19 | preview mode has point-and-click turned on by default, while publication 20 | mode has it turned off. 21 | We think that preview mode is a great place to use layout-debugging snippets 22 | from here. 23 | 24 | We are working on a considerable extension of Frescobaldi's preview mode 25 | with the intention of proposing a `-ddebug-layout` option for LilyPond 26 | proper once it's sufficiently stable, and once 2.18 is released. 27 | The Frescobaldi implementation is developed in our fork on the 28 | [debug-layout](https://github.com/openlilylib/frescobaldi/tree/debug-layout) 29 | branch. 30 | For more information see the [Wiki page] 31 | (https://github.com/openlilylib/frescobaldi/wiki/Preview-Mode-Development-Roadmap). 32 | -------------------------------------------------------------------------------- /debugging-layout/color-voices-and-directions/color-directions-example.ly: -------------------------------------------------------------------------------- 1 | \version "2.16.2" % absolutely necessary! 2 | 3 | \include "oll-core/package.ily" 4 | \loadModule snippets.debugging-layout.color-voices-and-directions.color-directions 5 | %\include "./color-directions.ily" 6 | 7 | %%%%%%%%%%%%%%%%%%%%% 8 | % USAGE EXAMPLE(S): % 9 | %%%%%%%%%%%%%%%%%%%%% 10 | { 11 | \stemUp g'4 a' \stemNeutral \slurUp b'( a') 12 | } 13 | -------------------------------------------------------------------------------- /debugging-layout/color-voices-and-directions/color-voices-example.ly: -------------------------------------------------------------------------------- 1 | \version "2.16.2" 2 | 3 | \include "oll-core/package.ily" 4 | \loadModule snippets.debugging-layout.color-voices-and-directions.color-voices 5 | %\include "color-voices.ily" 6 | 7 | #(define debug-explicit-voice-two-color red) 8 | 9 | \relative g' { 10 | g a b c | 11 | d \voiceOne c 12 | \voiceTwo bes8 as \voiceThree g\noBeam r 13 | \oneVoice 14 | e f g2. 15 | } 16 | -------------------------------------------------------------------------------- /debugging-layout/color-voices-and-directions/display-directions-example.ly: -------------------------------------------------------------------------------- 1 | \version "2.16.2" 2 | 3 | \include "oll-core/package.ily" 4 | \loadModule snippets.debugging-layout.color-voices-and-directions.display-directions 5 | %\include "./display-directions.ily" 6 | 7 | %%%%%%%%%%%%%%%%%%%%% 8 | % USAGE EXAMPLE(S): % 9 | %%%%%%%%%%%%%%%%%%%%% 10 | 11 | \new Staff { 12 | c''^( 13 | d'') 14 | c''(__ 15 | d'') 16 | c''_\( 17 | d''\) 18 | ^(_\mf 19 | ) 20 | c'~ c'^~ c'_~ c' 21 | } 22 | 23 | \layout { 24 | \context { 25 | \Voice 26 | \consists #Color_explicit_direction_engraver 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /debugging-layout/color-voices-and-directions/display-directions.ily: -------------------------------------------------------------------------------- 1 | \version "2.16.2" 2 | 3 | \header { 4 | snippet-title = "Color grobs with explicit direction" 5 | snippet-author = "David Nalesnik, Urs Liska" 6 | snippet-source = "http://lists.gnu.org/archive/html/lilypond-user/2013-09/msg00977.html" 7 | snippet-description = \markup { 8 | This snippets catches the directional operators and 9 | colors the objects whose direction have been set explicitly. 10 | } 11 | % add comma-separated tags to make searching more effective: 12 | tags = "debug, direction, color" 13 | % is this snippet ready? See meta/status-values.md 14 | status = "unfinished" 15 | %{ 16 | TODO: 17 | - Currently this only works for Slur/PhrasingSlur 18 | but it should work for any Grob that the operators 19 | can be applied to 20 | %} 21 | } 22 | 23 | %%%%%%%%%%%%%%%%%%%%%%%%%% 24 | % here goes the snippet: % 25 | %%%%%%%%%%%%%%%%%%%%%%%%%% 26 | 27 | % Define appearance: 28 | #(cond ((not (defined? 'debug-direction-up-color)) 29 | (define debug-direction-up-color red))) 30 | #(cond ((not (defined? 'debug-direction-down-color)) 31 | (define debug-direction-down-color blue))) 32 | 33 | 34 | #(define (Color_explicit_direction_engraver ctx) 35 | (make-engraver 36 | (acknowledgers 37 | ((slur-interface trans grob source) 38 | (let* ((event (event-cause grob)) 39 | (dir (ly:event-property event 'direction))) 40 | (if (not (null? dir)) 41 | (cond ((equal? dir 1) 42 | (set! (ly:grob-property grob 'color) 43 | debug-direction-up-color)) 44 | ((equal? dir -1) 45 | (set! (ly:grob-property grob 'color) 46 | debug-direction-down-color))))))))) 47 | -------------------------------------------------------------------------------- /debugging-layout/debug-layout-options-test.ily: -------------------------------------------------------------------------------- 1 | % demo sketch for a file that is included 2 | % when a -ddebug-layout command line option is present. 3 | % This will be deprecated. 4 | 5 | debugLayoutOptions = 6 | #(define-void-function (parser location)() 7 | ;; include preview options depending on the 8 | ;; presence or absence of command line switches 9 | (if (ly:get-option 'debug-control-points) 10 | ;; display control points 11 | (ly:parser-include-string parser "\\include \"debug-slurs.ily\"")) 12 | (if (ly:get-option 'debug-voices) 13 | ;; color \voiceXXX music 14 | (ly:parser-include-string parser "\\include \"voice-colors.ily\"")) 15 | (if (ly:get-option 'debug-skylines) 16 | ;; display skylines 17 | ;; -> this is very intrusive, so handle with care! 18 | ;; should be switched off by default 19 | (ly:set-option 'debug-skylines #t)) 20 | ;; this name clash has to be resolved! 21 | ) 22 | 23 | \debugLayoutOptions 24 | -------------------------------------------------------------------------------- /debugging-layout/display-control-points/display-curve-control-points.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openlilylib/snippets/63858cdaf121935a6a2d835058bf24e2cea81a5a/debugging-layout/display-control-points/display-curve-control-points.png -------------------------------------------------------------------------------- /debugging-layout/display-grob-anchors/definitions.ily: -------------------------------------------------------------------------------- 1 | #(ly:set-option 'relative-includes #t) 2 | \include "../../deprecate.ily" 3 | \ollSnippetsIncludeHint #(*location*) 4 | \include "module.ily" 5 | -------------------------------------------------------------------------------- /debugging-layout/display-grob-anchors/example.ly: -------------------------------------------------------------------------------- 1 | \version "2.16.2" 2 | 3 | \include "oll-core/package.ily" 4 | \loadModule snippets.debugging-layout.display-grob-anchors 5 | %\include "./definitions.ily" 6 | 7 | mus = 8 | { 9 | \override NoteHead #'style = #'altdefault 10 | g'2-> 11 | % Testing if \printRefpoint works with a custom-override. 12 | \once \override Script #'stencil = 13 | #(lambda (grob) 14 | (ly:font-get-glyph (ly:grob-default-font grob) "scripts.coda")) 15 | 16 | c''\fermata | 17 | as'1^"Yogi" | 18 | b'\breve _"Larry" | 19 | \mark "Twinkle" e''8 s4. 20 | \bar "|." 21 | } 22 | 23 | 24 | \markup "Red dots added for TimeSignature, Script, BarLine" 25 | \new Staff \with { \printAnchors #'(TimeSignature Script BarLine) } \mus 26 | 27 | \markup "Red dots added for all grobs" 28 | \new Staff \with { \printAnchors #'all-grobs } \mus 29 | 30 | \markup "Red dot added once to Script using \\onceDotScript" 31 | { 32 | \override NoteHead #'style = #'altdefault 33 | g'2-> 34 | \onceDotScript 35 | % Testing if \printRefpoint works with a custom-override. 36 | \once \override Script #'stencil = 37 | #(lambda (grob) 38 | (ly:font-get-glyph (ly:grob-default-font grob) "scripts.coda")) 39 | c''\fermata | 40 | as'1^"Yogi" | 41 | b'\breve _"Larry" | 42 | \mark "Twinkle" e''8-- s4. 43 | \bar "|." 44 | } 45 | -------------------------------------------------------------------------------- /debugging-layout/display-grob-names/definitions.ily: -------------------------------------------------------------------------------- 1 | #(ly:set-option 'relative-includes #t) 2 | \include "../../deprecate.ily" 3 | \ollSnippetsIncludeHint #(*location*) 4 | \include "module.ily" 5 | -------------------------------------------------------------------------------- /debugging-layout/display-grob-names/example.ly: -------------------------------------------------------------------------------- 1 | \version "2.16.2" 2 | 3 | \include "oll-core/package.ily" 4 | \loadModule snippets.debugging-layout.display-grob-names 5 | %\include "./definitions.ily" 6 | 7 | \layout { 8 | \context { 9 | \Voice 10 | \printGrobNames #debug-grob-name-groblist 11 | } 12 | } 13 | 14 | { 15 | a'4~ a'\fermata g'( f') 16 | } 17 | -------------------------------------------------------------------------------- /debugging-layout/display-paper-columns/example.ly: -------------------------------------------------------------------------------- 1 | \version "2.19.60" 2 | 3 | \include "oll-core/package.ily" 4 | \loadModule snippets.debugging-layout.display-paper-columns 5 | 6 | { 7 | c' d' e' d' 8 | } 9 | -------------------------------------------------------------------------------- /debugging-layout/display-paper-columns/module.ily: -------------------------------------------------------------------------------- 1 | \version "2.16.2" % absolutely necessary! 2 | 3 | \header { 4 | snippet-title = "Debugging paper columns" 5 | snippet-author = "" 6 | snippet-source = "" 7 | snippet-description = \markup { 8 | } 9 | % add comma-separated tags to make searching more effective: 10 | tags = "paper column, debugging" 11 | % is this snippet ready? See meta/status-values.md 12 | status = "undocumented" 13 | } 14 | 15 | % show information about paper-columns: 16 | \layout { 17 | \override Score.PaperColumn #'layer = #100 18 | \override Score.NonMusicalPaperColumn #'layer = #100 19 | \override Score.PaperColumn #'stencil = #ly:paper-column::print 20 | \override Score.NonMusicalPaperColumn #'stencil = #ly:paper-column::print 21 | } 22 | 23 | -------------------------------------------------------------------------------- /debugging-layout/original-breaks/example.ly: -------------------------------------------------------------------------------- 1 | 2 | \version "2.17.27" 3 | 4 | 5 | % Uncomment the following file to respect the original breaks 6 | % Including manually is necessary for this example. 7 | % However, the idea is having this loaded automatically 8 | \include "definitions.ily" 9 | #(define layout-keep-original-breaks #t) 10 | 11 | % Music containing original breaks 12 | { 13 | \tempo "Original breaks" 14 | \repeat unfold 6 { \repeat unfold 12 c' \originalBreak \mark "|"} 15 | \originalPageBreak 16 | #(define-public layout-keep-original-breaks #f) 17 | \tempo "No original breaks" 18 | \repeat unfold 6 { \repeat unfold 12 c' \originalBreak \mark "|"} 19 | \originalPageBreak 20 | \tempo "\\originalPageBreak" 21 | \repeat unfold 6 { \repeat unfold 12 c' \originalBreak \mark "|"} 22 | } -------------------------------------------------------------------------------- /editorial-tools/auto-transpose/README.md: -------------------------------------------------------------------------------- 1 | The auto-transpose engraver can be used to automatically transpose music according to the instrument transposition. The engraver has to know, if the music it finds in this context is in concert- or in instrument-pitch. Then it can use the `instrumentTransposition`, which is set by the `\transposition` command, to transpose the music as necessary. 2 | 3 | The engraver looks for three context-properties: 4 | 1. instrumentTransposition 5 | 2. music-concert-pitch 6 | 3. print-concert-pitch 7 | 8 | The first one is a standard lilypond-context-property, which is used to set instrument transposition for MIDI-output. So, if you use for example `\transposition bes` -- e.g. trumpet or clarinet -- MIDI-output will sound one note lower. Now the other two context-properties are used to set, if the music is provided in concert-pitch and if it shall be printed in concert-pitch. If the music is given in concert pitch and shall be printed in instrument pitch, the engraver transposes it accordingly. `\autoTranspose` provides a context-mod which consists the engraver and sets the *-concert-pitch variables to display concert-pitched music in instrument pitch. 9 | So the following displays a C major scale, which sounds like a B flat major scale, if played by an instrument tuned in B flat, like trumpet. 10 | 11 | ``` 12 | \version "2.18.2" 13 | \include "editorial-tools/auto-transpose/definitions.ily" 14 | 15 | \new Staff \with { 16 | \autoTranspose 17 | } \relative c'' { 18 | \transposition bes 19 | \key bes \major 20 | bes4 a g f ees d c bes 21 | } 22 | ``` 23 | 24 | If the instrument is switched, the auto-transpose will follow. 25 | 26 | There are some TODOs: 27 | 28 | * If the music is given in instrument pitch and shall be displayed, the `instrumentTransposition` property still has to be set, but that leads to incorrect MIDI-pitch. 29 | * We only need one context-property beside `instrumentTransposition`, which says: 30 | 1. do nothing 31 | 2. transpose from concert to instrument pitch 32 | 3. transpose from instrument to concert pitch 33 | This might also be an initial parameter for the engraver, so we needn't define extra context-properties 34 | * TBC 35 | 36 | -------------------------------------------------------------------------------- /editorial-tools/auto-transpose/definitions.ily: -------------------------------------------------------------------------------- 1 | #(ly:set-option 'relative-includes #t) 2 | \include "../../deprecate.ily" 3 | \ollSnippetsIncludeHint #(*location*) 4 | \include "module.ily" 5 | -------------------------------------------------------------------------------- /editorial-tools/auto-transpose/example.ly: -------------------------------------------------------------------------------- 1 | \version "2.19.15" 2 | 3 | \include "deutsch.ly" 4 | 5 | \include "oll-core/package.ily" 6 | \loadModule snippets.editorial-tools.auto-transpose 7 | %\include "editorial-tools/auto-transpose/definitions.ily" 8 | 9 | % some music to insert into example 10 | bach = \relative c'' { b a c h } 11 | 12 | % add two transposing instrument-definitions 13 | \addInstrumentDefinition #"eb-clarinet" 14 | #`((instrumentTransposition . ,(ly:make-pitch 0 2 -1/2)) 15 | (shortInstrumentName . "Es-Kl") 16 | (clefGlyph . "clefs.G") 17 | (middleCPosition . -6) 18 | (clefPosition . -2) 19 | (instrumentCueName . "Es-Kl") 20 | (midiInstrument . "clarinet")) 21 | 22 | \addInstrumentDefinition #"b-clarinet" 23 | #`((instrumentTransposition . ,(ly:make-pitch -1 6 -1/2)) 24 | (shortInstrumentName . "Kl") 25 | (clefGlyph . "clefs.G") 26 | (middleCPosition . -6) 27 | (clefPosition . -2) 28 | (instrumentCueName . "Kl") 29 | (midiInstrument . "clarinet")) 30 | 31 | %%% create demo score 32 | \score { 33 | \new Staff \with { 34 | \autoTranspose 35 | } { 36 | \key f \major 37 | \bach 38 | \instrumentSwitch "b-clarinet" 39 | \key f \major 40 | \bach 41 | \instrumentSwitch "eb-clarinet" 42 | \key f \major 43 | \bach 44 | } 45 | \layout {} 46 | \midi { \tempo 4=150 } 47 | } 48 | 49 | 50 | -------------------------------------------------------------------------------- /editorial-tools/auto-transpose/example2.ly: -------------------------------------------------------------------------------- 1 | \version "2.18.2" 2 | \include "deutsch.ly" 3 | 4 | \include "oll-core/package.ily" 5 | \loadModule snippets.editorial-tools.auto-transpose 6 | \loadModule snippets.editorial-tools.edition-engraver 7 | %\include "editorial-tools/auto-transpose/definitions.ily" 8 | %\include "editorial-tools/edition-engraver/definitions.ily" 9 | 10 | % some music to insert into example 11 | bach = \relative c'' { b a c h } 12 | 13 | % add two transposing instrument-definitions 14 | \addInstrumentDefinition #"eb-clarinet" 15 | #`((instrumentTransposition . ,(ly:make-pitch 0 2 -1/2)) 16 | (shortInstrumentName . "Es-Kl") 17 | (clefGlyph . "clefs.G") 18 | (middleCPosition . -6) 19 | (clefPosition . -2) 20 | (instrumentCueName . "Es-Kl") 21 | (midiInstrument . "clarinet")) 22 | 23 | \addInstrumentDefinition #"b-clarinet" 24 | #`((instrumentTransposition . ,(ly:make-pitch -1 6 -1/2)) 25 | (shortInstrumentName . "Kl") 26 | (clefGlyph . "clefs.G") 27 | (middleCPosition . -6) 28 | (clefPosition . -2) 29 | (instrumentCueName . "Kl") 30 | (midiInstrument . "clarinet")) 31 | 32 | \addInstrumentDefinition #"concert-pitch" 33 | #`((instrumentTransposition . #f) 34 | (shortInstrumentName . "C") 35 | (clefGlyph . "clefs.G") 36 | (middleCPosition . -6) 37 | (clefPosition . -2) 38 | (instrumentCueName . "C") 39 | (midiInstrument . "clarinet")) 40 | 41 | %%% create demo score 42 | 43 | \addEdition transp 44 | \editionMod transp 2 0/1 switch.instrument.Staff.A \instrumentSwitch "b-clarinet" 45 | \editionMod transp 3 0/1 switch.instrument.Staff.A \instrumentSwitch "eb-clarinet" 46 | \editionMod transp 4 2/4 switch.instrument.Staff.A \instrumentSwitch "b-clarinet" 47 | \editionMod transp 5 0/4 switch.instrument.Staff.A \instrumentSwitch "concert-pitch" 48 | 49 | music = { $bach $bach $bach <>_"repeat unfold c''" \repeat unfold 4 c''4 <>_"repeat unfold d''" \repeat unfold 4 d'' } 50 | global = { \key f \major s1 \key f \major s1 \key f \major s1 } 51 | \score { 52 | \new Staff \with { 53 | \autoTranspose 54 | \consists \editionEngraver switch.instrument 55 | } \new Voice << 56 | \global 57 | \music 58 | >> 59 | \layout {} 60 | \midi { \tempo 4=150 } 61 | } 62 | 63 | 64 | -------------------------------------------------------------------------------- /editorial-tools/edition-engraver/definitions.ily: -------------------------------------------------------------------------------- 1 | #(ly:set-option 'relative-includes #t) 2 | \include "../../deprecate.ily" 3 | \ollSnippetsIncludeHint #(*location*) 4 | \include "module.ily" 5 | -------------------------------------------------------------------------------- /editorial-tools/edition-engraver/module.ily: -------------------------------------------------------------------------------- 1 | \version "2.18.0" 2 | \include "scheme-lib/modules.ily" 3 | 4 | \header { 5 | snippet-title = "edition-engraver" 6 | snippet-author = "Jan-Peter Voigt" 7 | snippet-description = \markup { 8 | \wordwrap { 9 | The edition-engraver is a tool, to add tweaks to a score without cluttering the music source with (tagged) overrides. 10 | Look in the README.md file for documentation. 11 | } 12 | } 13 | tags = "edition-engraver" 14 | status = "ready" 15 | } 16 | 17 | % import the edition-engraver from the corresponding scheme-module 18 | #(use-modules (editorial-tools edition-engraver module)) 19 | -------------------------------------------------------------------------------- /editorial-tools/edition-engraver/rehearsal-marks-test.ly: -------------------------------------------------------------------------------- 1 | \version "2.19.16" 2 | 3 | \include "editorial-tools/edition-engraver/definitions.ily" 4 | 5 | \layout { 6 | \context { 7 | \Score 8 | \consists \editionEngraver score 9 | } 10 | \context { 11 | \Voice 12 | \consists \editionEngraver ##f 13 | } 14 | 15 | } 16 | 17 | \editionMod fullscore 18 | 4 0/4 19 | score.Score.A 20 | \mark \default 21 | 22 | \addEdition fullscore 23 | 24 | 25 | \new Staff \with { \consists \editionEngraver mystaff } 26 | { 27 | \mark \default 28 | \repeat unfold 36 c' 29 | } 30 | 31 | -------------------------------------------------------------------------------- /editorial-tools/line-break-marks/README.md: -------------------------------------------------------------------------------- 1 | #### \lineBreakMark 2 | 3 | This snippets allows to print a short dashed line above the staff. 4 | This is commonly used to indicate a line break of the original source in 5 | diplomatic transcriptions, e.g. of sketches and drafts. 6 | 7 | Entering `\lineBreakMark` at any time will print this symbol. -------------------------------------------------------------------------------- /editorial-tools/line-break-marks/definitions.ily: -------------------------------------------------------------------------------- 1 | #(ly:set-option 'relative-includes #t) 2 | \include "../../deprecate.ily" 3 | \ollSnippetsIncludeHint #(*location*) 4 | \include "module.ily" 5 | -------------------------------------------------------------------------------- /editorial-tools/line-break-marks/examples.ly: -------------------------------------------------------------------------------- 1 | \version "2.17.10" 2 | 3 | \include "oll-core/package.ily" 4 | \loadModule snippets.editorial-tools.line-break-marks 5 | %\include "definitions.ily" 6 | 7 | \header { 8 | title = "Line Break Marks" 9 | subtitle = "Print indicators for line breaks in the original score" 10 | } 11 | 12 | %{ Usage: 13 | Enter \ļineBreakMark whereever you want the dashed line to appear 14 | This can be used at barlines or anywhere between. 15 | %} 16 | 17 | \markup \vspace #1 18 | { 19 | s1*2 \mark \default 20 | s1*2 \lineBreakMark 21 | s1 22 | s2 \lineBreakMark 23 | s2 24 | s1*2 \mark \default 25 | s1 26 | } -------------------------------------------------------------------------------- /editorial-tools/line-break-marks/line-break-marks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openlilylib/snippets/63858cdaf121935a6a2d835058bf24e2cea81a5a/editorial-tools/line-break-marks/line-break-marks.png -------------------------------------------------------------------------------- /editorial-tools/line-break-marks/module.ily: -------------------------------------------------------------------------------- 1 | \version "2.17.10" 2 | 3 | \header { 4 | snippet-title = "Indicator for original line breaks" 5 | snippet-author = "Urs Liska" 6 | snippet-description = \markup { 7 | This snippet draws a dashed vertical line above the staff. 8 | This is a common notation to indicate line breaks in the 9 | original source (e.g. when editing sketches and drafts). 10 | } 11 | % add comma-separated tags to make searching more effective: 12 | tags = "editorial,markup,line breaks" 13 | status = "ready" 14 | %{ TODO: 15 | Make appearance of line configurable through variables 16 | Optionally: Add more styles (dotted, arrows ...) 17 | %} 18 | } 19 | 20 | lineBreakMark = { 21 | \once \override Score.RehearsalMark.padding = #0 22 | \mark \markup { 23 | \override #'(on . 0.25) 24 | \override #'(off . 0.15) 25 | \override #'(thickness . 1.6) 26 | \draw-dashed-line #'(0 . 3) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /editorial-tools/merge-rests-engraver/README.md: -------------------------------------------------------------------------------- 1 | Merge Rests Engraver 2 | ==================== 3 | 4 | `merge-rests-engraver` and `merge-mmrests-engraver` are used to combine two rests of the same duration from two voices into one. This eliminates the need to add `\once \omit` to the rest in one of the voices. `merge-mmrests-engraver` combines whole measure and multi-measure rests and `merge-rests-engraver` combines all others. 5 | 6 | Usage 7 | ----- 8 | 9 | Add one or both engravers to the staff context in the layout section. 10 | 11 | \layout { 12 | \context { \Staff \consists #merge-rests-engraver } 13 | \context { \Staff \consists #merge-mmrests-engraver } 14 | } 15 | 16 | See also `example.ly`. -------------------------------------------------------------------------------- /editorial-tools/merge-rests-engraver/definition.ily: -------------------------------------------------------------------------------- 1 | #(ly:set-option 'relative-includes #t) 2 | \include "../../deprecate.ily" 3 | \ollSnippetsIncludeHint #(*location*) 4 | \include "module.ily" 5 | -------------------------------------------------------------------------------- /editorial-tools/merge-rests-engraver/example.ly: -------------------------------------------------------------------------------- 1 | \version "2.18.2" 2 | 3 | \include "oll-core/package.ily" 4 | \loadModule snippets.editorial-tools.merge-rests-engraver 5 | %\include "definition.ily" 6 | 7 | \score 8 | { 9 | \new Staff 10 | << 11 | \new Voice \relative c' 12 | { 13 | \voiceOne 14 | e4 r e r | 15 | R1 | 16 | r2 e | 17 | } 18 | \new Voice \relative c' 19 | { 20 | \voiceTwo 21 | r4 c r r | 22 | R1 | 23 | r2 r4 c | 24 | } 25 | >> 26 | \layout { 27 | \context { \Staff \consists #merge-rests-engraver } % merges non-whole rests 28 | \context { \Staff \consists #merge-mmrests-engraver } % merges whole rests 29 | } 30 | } 31 | 32 | \score 33 | { 34 | \new Staff \relative c' 35 | << 36 | { 37 | \compressFullBarRests 38 | c4 r r2 | 39 | R1 | 40 | r2 r4 r8 r16 r32 r | 41 | R1*3 | 42 | } 43 | \\ 44 | { 45 | c4 r r r | 46 | R1 | 47 | r2 r4 r8 r16 r32 r | 48 | R1*3 | 49 | } 50 | >> 51 | \layout { 52 | \context { \Staff \consists #merge-rests-engraver } 53 | \context { \Staff \consists #merge-mmrests-engraver } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /editorial-tools/partial-compilation/compile-by-systems.ily: -------------------------------------------------------------------------------- 1 | 2 | \version "2.16.0" 3 | 4 | %% toplevel \book gets output per page, 5 | %% everything else gets output per system/title 6 | #(define default-toplevel-book-handler 7 | print-book-with-defaults-as-systems ) 8 | 9 | #(define toplevel-book-handler 10 | (lambda ( . rest) 11 | (set! output-empty-score-list #f) 12 | (apply print-book-with-defaults rest))) 13 | 14 | #(define toplevel-music-handler 15 | (lambda ( . rest) 16 | (apply collect-music-for-book rest))) 17 | 18 | #(define toplevel-score-handler 19 | (lambda ( . rest) 20 | (apply collect-scores-for-book rest))) 21 | 22 | #(define toplevel-text-handler 23 | (lambda ( . rest) 24 | (apply collect-scores-for-book rest))) 25 | 26 | %#(set! output-empty-score-list #t) 27 | 28 | 29 | #(ly:set-option 'backend 'eps) 30 | %#(ly:set-option (quote no-point-and-click)) 31 | %#(define inside-lilypond-book #t) 32 | %#(define version-seen #t) 33 | -------------------------------------------------------------------------------- /editorial-tools/partial-compilation/produce-breaking-information-systems.count: -------------------------------------------------------------------------------- 1 | 15 -------------------------------------------------------------------------------- /editorial-tools/partial-compilation/produce-breaking-information-systems.texi: -------------------------------------------------------------------------------- 1 | @image{produce-breaking-information-1} 2 | @image{produce-breaking-information-2} 3 | @image{produce-breaking-information-3} 4 | @image{produce-breaking-information-4} 5 | @image{produce-breaking-information-5} 6 | @image{produce-breaking-information-6} 7 | @image{produce-breaking-information-7} 8 | @image{produce-breaking-information-8} 9 | @image{produce-breaking-information-9} 10 | @image{produce-breaking-information-10} 11 | @image{produce-breaking-information-11} 12 | @image{produce-breaking-information-12} 13 | @image{produce-breaking-information-13} 14 | @image{produce-breaking-information-14} 15 | @image{produce-breaking-information-15} 16 | @c eof 17 | -------------------------------------------------------------------------------- /fried-library-to-be-sorted/README.md: -------------------------------------------------------------------------------- 1 | What's this? 2 | ------------ 3 | 4 | Functions, stylesheets and other stuff from the library of 5 | ["Oskar Fried: Complete Songs" project] 6 | (http://lilypondblog.org/2013/10/oskar-fried-complete-songs/) 7 | 8 | This is quite chaotic, as i just copied stuff from our library subdir, 9 | removing unwanted stuff but without doing thorough cleanup. It should 10 | be formatted accodrdingly to openlilylib/snippets conventions, files 11 | renamed appropriately and put in appropriate subdirectories. 12 | 13 | Every file contains a TODO explaining in more detail what should be done. 14 | Pull requests welcome! 15 | -------------------------------------------------------------------------------- /fried-library-to-be-sorted/cross-voice-curves.ily: -------------------------------------------------------------------------------- 1 | \version "2.17.3" 2 | 3 | % TODO: add oll/snippets headers, example. use \omit? 4 | 5 | % This looks like just an alias for hideNotes 6 | % But it is used especially for use in tying/slurring between voices 7 | % In addition to hideNotes it removes everything except 8 | % the notehead completely (namely the Flag which often 9 | % disturbs this construct) 10 | % and is \once 11 | % Furthermore it suppresses a warning about clashing note columns 12 | % as this will surely surely the case when using this shorthand for cross voice curves 13 | hideVoiceForTie = { 14 | \once \override NoteHead #'transparent = ##t 15 | \once \override Stem #'stencil = ##f 16 | \once \override Dots #'stencil = ##f 17 | \once \override Beam #'stencil = ##f 18 | \once \override Flag #'stencil = ##f 19 | \once \override NoteColumn #'ignore-collision = ##t 20 | } 21 | -------------------------------------------------------------------------------- /fried-library-to-be-sorted/date-function.ily: -------------------------------------------------------------------------------- 1 | % TODO: what to do with this? 2 | 3 | % Helper functions 4 | date = #(strftime "%d.%m.%Y" (localtime (current-time))) 5 | 6 | -------------------------------------------------------------------------------- /fried-library-to-be-sorted/double-bars-engraver.ily: -------------------------------------------------------------------------------- 1 | \version "2.17.3" 2 | 3 | % TODO: add oll/snippets headers, add example. 4 | 5 | %{ 6 | Scheme engraver that places double bar lines before time signature changes 7 | Provided by Jan-Peter Voigt 8 | Presumably written by David Nalesnik 9 | %} 10 | 11 | DbBars = #(lambda (context) 12 | (let ((time-signature '()) 13 | (last-fraction #f)) 14 | 15 | `((process-music 16 | . ,(lambda (trans) 17 | (let ((frac (ly:context-property context 'timeSignatureFraction))) 18 | (if (and (null? time-signature) 19 | (not (equal? last-fraction frac)) 20 | (fraction? frac)) 21 | (begin 22 | (ly:context-set-property! context 'whichBar "||") 23 | (set! last-fraction frac)))))) 24 | 25 | (stop-translation-timestep 26 | . ,(lambda (trans) 27 | (set! time-signature '())))))) -------------------------------------------------------------------------------- /fried-library-to-be-sorted/lyrics-shorthands.ily: -------------------------------------------------------------------------------- 1 | \version "2.17.3" 2 | 3 | % TODO: what to do with this? keep all shortcuts or what? 4 | % add oll/snippets headers, add example. 5 | 6 | %{ 7 | This library is part of ulLibrary (Urs Liska's LilyPond Toolbox) 8 | and may also be included separately. 9 | It assumes that the project root contains any number of 10 | first level subdirectories containing the to-be-compiled .ly files 11 | and a folder /includes/ulLibrary. 12 | So this file is always accessible through the relative path "../includes/ulLibrary/curvesToolbox.ily 13 | 14 | the lyrics toolbox contains 15 | - shorthands to align lyrics 16 | - functions to control melisma behaviour 17 | %} 18 | 19 | %%%%%%%%%%%%%% 20 | % Align lyrics 21 | 22 | lyrAlign = 23 | #(define-music-function (parser location amount) 24 | (number?) 25 | #{ 26 | \once \override LyricText #'self-alignment-X = #amount 27 | #}) 28 | 29 | lyrLeftI = \lyrAlign #0.2 30 | lyrLeftII = \lyrAlign #0.4 31 | lyrLeftIII = \lyrAlign #0.6 32 | lyrLeftIIII = \lyrAlign #0.8 33 | lyrLeft = \lyrAlign #1 34 | 35 | lyrRightI = \lyrAlign #-0.2 36 | lyrRightII = \lyrAlign #-0.4 37 | lyrRightIII = \lyrAlign #-0.6 38 | lyrRightIIII = \lyrAlign #-0.8 39 | lyrRight = \lyrAlign #-1 40 | 41 | 42 | %{Set melisma behaviour 43 | Some composers (e.g. Oskar Fried) don't use slurs and beams 44 | accordings to the standards, so one has to deal with melismaBusyProperties 45 | - for which the two commands offer shorthands. 46 | Generally melOn should be active vor vocal melodies, 47 | so ties, slurs and beams cause a melisma. 48 | If the lyrics proceed under ties, slurs or beams, 49 | melOff has to be activated. 50 | The command has to be placed after the beginning of the syllable 51 | %} 52 | melOff = { 53 | \set melismaBusyProperties = #'() 54 | } 55 | melOn = { 56 | \unset melismaBusyProperties 57 | } 58 | -------------------------------------------------------------------------------- /fried-library-to-be-sorted/markup-with-access-to-header-fields.ily: -------------------------------------------------------------------------------- 1 | 2 | % TODO: 3 | % is this still needed (maybe someone has improved default lily's behaviour)? 4 | % maybe there should be a bug report/feature request about this? 5 | % add oll/snippets headers, add example. 6 | 7 | 8 | % This function is originally copied from mark-up-title (file scm/titling.scm), 9 | % which is lilypond's internal function to handle the title markups. I needed 10 | % to replace the scopes and manually add the $defaultheader (which is internally 11 | % done in paper-book.cc before calling mark-up-title. Also, I don't extract the 12 | % markup from the header block, but use the given markup. 13 | % 14 | % I'm not sure if I really need the page properties in props, too... But I 15 | % suppose it does not hurt, either. 16 | #(define-markup-command (markupWithHeader layout props markup) (markup?) 17 | "Interpret the given markup with the header fields added to the props. 18 | This way, one can re-use the same functions (using fromproperty 19 | #'header:field) in the header block and as top-level markup." 20 | (let* ( 21 | ;; TODO: If we are inside a score, add the score's local header block, too! 22 | ;; Currently, I only use the global header block, stored in $defaultheader 23 | (scopes (list $defaultheader)) 24 | (alists (map ly:module->alist scopes)) 25 | (prefixed-alist 26 | (map (lambda (alist) 27 | (map (lambda (entry) 28 | (cons 29 | (string->symbol (string-append "header:" 30 | (symbol->string 31 | (car entry)))) 32 | (cdr entry))) 33 | alist)) 34 | alists)) 35 | (props (append prefixed-alist 36 | props 37 | (layout-extract-page-properties layout)))) 38 | (interpret-markup layout props markup))) 39 | 40 | -------------------------------------------------------------------------------- /fried-library-to-be-sorted/progress-string.ily: -------------------------------------------------------------------------------- 1 | \version "2.17.3" 2 | 3 | % TODO: what to do about this? 4 | 5 | %{PROJECT: 6 | This file belongs to the project 7 | "Oskar Fried. Complete Lieder" 8 | edited from the original prints by Urs Liska and Alexander Gurdon (mail@ursliska.de, alexander.gurdon@tu-dortmund.de) 9 | %} 10 | 11 | %{TYPE: 12 | This file is part of the global options 13 | %} 14 | 15 | %{FILE: 16 | After the refactoring of the includes to ulLibrary 17 | and changing the include strategy, the only use 18 | for this file is filling the progressString 19 | %} 20 | 21 | % String to be added in the first-page header 22 | progressString = \markup { 23 | \override #'(font-name . "Cronos Pro") 24 | \rounded-box \concat { 25 | "Edition finished: " 26 | \fromproperty #'header:editionfinished 27 | " – Print ready: " 28 | \fromproperty #'header:printready 29 | " – LilyPond " #(lilypond-version) 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /fried-library-to-be-sorted/set-horizontal-spacing.ily: -------------------------------------------------------------------------------- 1 | \version "2.16.2" 2 | 3 | % TODO the hardcoded 1024 is very stupid. One should use some other approach; 4 | % maybe something like in `adjust-horizontal-spacing`. or take two arguments. 5 | % or a fraction. 6 | % should the newspacingsection be part of this command, actually? 7 | % think about designing a coherent set of spacing commands. 8 | 9 | spacingDensity = 10 | #(define-music-function (parser location num) (number?) 11 | #{ 12 | \newSpacingSection 13 | \override Score.SpacingSpanner #'common-shortest-duration = 14 | #(ly:make-moment num 1024 ) 15 | #}) 16 | -------------------------------------------------------------------------------- /fried-library-to-be-sorted/squeeze-notation.ily: -------------------------------------------------------------------------------- 1 | \version "2.16.2" 2 | 3 | % TODO: add oll/snippets headers, add example. 4 | 5 | % TODO: parametrize (allow custom levels of squeezing). 6 | % other grobs to squeeze? e.g. flags 7 | % check if this function accumulates. 8 | 9 | 10 | squeezeNotation = { 11 | \temporary \override Staff.AccidentalPlacement #'right-padding = #-0.05 12 | 13 | % TODO: also override LedgerLineSpanner.minimum-length-fraction 14 | 15 | % TODO: should use narrow accidentals when they're available, 16 | % http://code.google.com/p/lilypond/issues/detail?id=2203 17 | % TODO: only make the override if the stencil exists 18 | % (currently the function fails when the stencil is empty). 19 | \temporary \override Staff.Accidental #'stencil = 20 | #(lambda (grob) 21 | (ly:stencil-scale (ly:accidental-interface::print grob) 0.92 1)) 22 | 23 | % TODO: design a narrow notehead glyph?? 24 | % TODO: only make the override if the stencil exists 25 | % (currently the function fails when the stencil is empty). 26 | \temporary \override Staff.NoteHead #'stencil = 27 | #(lambda (grob) 28 | (ly:stencil-scale (ly:note-head::print grob) 0.96 1.02)) 29 | 30 | % also, change tracking between letters (there is some snippet doing this) 31 | % TODO: only make the override if the stencil exists 32 | % (currently the function fails when the stencil is empty). 33 | \temporary \override Lyrics.LyricText #'stencil = 34 | #(lambda (grob) 35 | (ly:stencil-scale (lyric-text::print grob) 0.92 1)) 36 | } 37 | 38 | %{ 39 | just use \undo \squeezeNotation 40 | 41 | unsqueezeNotation = { 42 | \revert Staff.AccidentalPlacement #'right-padding 43 | \revert Staff.Accidental #'stencil 44 | \revert Staff.NoteHead #'stencil 45 | \revert Lyrics.LyricText #'stencil 46 | } 47 | %} 48 | -------------------------------------------------------------------------------- /fried-library-to-be-sorted/staccato-corrector-engraver.ily: -------------------------------------------------------------------------------- 1 | %\version "2.17.3" ? 2 | 3 | % TODO: add oll/snippets headers, add example. 4 | 5 | 6 | %{ 7 | Scheme engraver that corrects stem-side staccato alignment if there are other articulations present. 8 | Written by David Nalesnik 9 | %} 10 | 11 | StaccatoCorrector = 12 | #(lambda (context) 13 | (let ((articulations '()) 14 | (staccato '())) 15 | (make-engraver 16 | (acknowledgers ((script-interface engraver grob source-engraver) 17 | (set! articulations (cons grob articulations)) 18 | (if (equal? (ly:prob-property (event-cause grob) 'articulation-type) "staccato") 19 | (set! staccato grob)))) 20 | ((stop-translation-timestep trans) 21 | (if (and (ly:grob? staccato) 22 | (or (> (length articulations) 1) 23 | (boolean? (ly:prob-property (event-cause staccato) 'parenthesize)))) 24 | (set! (ly:grob-property staccato 'toward-stem-shift) 0)) 25 | (set! articulations '()) 26 | (set! staccato '()))))) -------------------------------------------------------------------------------- /general-tools/README.md: -------------------------------------------------------------------------------- 1 | This is the place for stuff that doesn't fit other categories, 2 | used for example for working on LilyPond itself. 3 | -------------------------------------------------------------------------------- /general-tools/includeHelper/definitions.ily: -------------------------------------------------------------------------------- 1 | \include "deprecate.ily" 2 | 3 | #(ly:message "general-tools/includeHelper from openLilyLib/snippets is deprecated. 4 | Please use \\includePattern from the oll-core.include-pattern module instead. 5 | 6 | ") 7 | 8 | \ollRedirect 9 | "general-tools/includeHelper/definitions.ily" 10 | "_internal/utilities/include-pattern.ily" -------------------------------------------------------------------------------- /general-tools/includeHelper/example.ly: -------------------------------------------------------------------------------- 1 | \version "2.18.0" 2 | 3 | \include "definitions.ily" 4 | 5 | % show all includes 6 | includePatternVerbose = ##t 7 | 8 | % include all files with pattern (regular expression) 9 | % the file f1.ly to f3.ly simply display a string 10 | \includePattern "example" ".*\\.i?ly" 11 | -------------------------------------------------------------------------------- /general-tools/includeHelper/example/f1.ly: -------------------------------------------------------------------------------- 1 | #(display "include file nr. 1") 2 | #(newline) 3 | -------------------------------------------------------------------------------- /general-tools/includeHelper/example/f2.ly: -------------------------------------------------------------------------------- 1 | #(display "include file nr. 2") 2 | #(newline) 3 | -------------------------------------------------------------------------------- /general-tools/includeHelper/example/f3.ly: -------------------------------------------------------------------------------- 1 | #(display "include file nr. 3") 2 | #(newline) 3 | -------------------------------------------------------------------------------- /general-tools/lilypond-version-predicates/example.ly: -------------------------------------------------------------------------------- 1 | \version "2.16.0" % This should also work with older versions 2 | 3 | \include "./definitions.ily" 4 | 5 | 6 | \header { 7 | title = "LilyPond Version Predicates" 8 | subtitle = \markup {Score compiled with LilyPond #(lilypond-version)} 9 | } 10 | 11 | \paper { 12 | ragged-right = ##f 13 | } 14 | 15 | versionCommentA = 16 | #(define-music-function (parser location ver) 17 | (list?) 18 | (cond ((lilypond-greater-than-or-equal? ver) 19 | #{ s^\markup {#(lilypond-version) is higher or equals that.} #}) 20 | ((lilypond-less-than-or-equal? ver) 21 | #{ s^ \markup {#(lilypond-version) is less or equals that.} #}))) 22 | 23 | versionCommentB = 24 | #(define-music-function (parser location ver) 25 | (list?) 26 | (cond ((lilypond-greater-than? ver) 27 | #{ s^\markup {#(lilypond-version) is higher} #}) 28 | ((lilypond-equals? ver) 29 | #{ s^\markup {#(lilypond-version) is equal} #}) 30 | ((lilypond-less-than? ver) 31 | #{ s^\markup {#(lilypond-version) is less} #}))) 32 | 33 | \markup { \vspace #3 } 34 | 35 | \markup \justify { 36 | Define a few music functions that produce output 37 | depending on the result of LilyPond version comparisons. 38 | Compile this file with different versions of LilyPond 39 | and see how the output markups change. 40 | } 41 | 42 | \markup { \vspace #3 } 43 | 44 | { 45 | \tempo "Comparing with: 2.16.0" 46 | s1 47 | \versionCommentA #'(2 16 0) 48 | \versionCommentB #'(2 16 0) 49 | } 50 | 51 | \markup { \vspace #2 } 52 | 53 | { 54 | \tempo "Comparing with: 2.16.2" 55 | s1 56 | \versionCommentA #'(2 16 2) 57 | \versionCommentB #'(2 16 2) 58 | } 59 | 60 | \markup { \vspace #2 } 61 | 62 | { 63 | \tempo "Comparing with: 2.17.5" 64 | s1 65 | \versionCommentA #'(2 17 5) 66 | \versionCommentB #'(2 17 5) 67 | } 68 | 69 | \markup { \vspace #2 } 70 | 71 | { 72 | \tempo "Comparing with: 2.17.16" 73 | s1 74 | \versionCommentA #'(2 17 16) 75 | \versionCommentB #'(2 17 16) 76 | } 77 | -------------------------------------------------------------------------------- /general-tools/readComment/definitions.ily: -------------------------------------------------------------------------------- 1 | #(ly:set-option 'relative-includes #t) 2 | \include "../../deprecate.ily" 3 | \ollSnippetsIncludeHint #(*location*) 4 | \include "module.ily" 5 | -------------------------------------------------------------------------------- /general-tools/readComment/example.ly: -------------------------------------------------------------------------------- 1 | \version "2.18.0" 2 | 3 | \include "oll-core/package.ily" 4 | \loadModule snippets.general-tools.readComment 5 | %\include "general-tools/readComment/definitions.ily" 6 | 7 | text = \readComment 8 | %{ 9 | \twocolumn{} \sloppy{} 10 | It was a night to remember. 11 | All of a sudden the door opened with dark noise and he, yes HE, came in. 12 | 13 | We all were waiting for something, but we all didn't know what it was. 14 | I was first to say "`Hello Sir"'. 15 | 16 | -- \textit{silence} --- 17 | 18 | It seemed like an invasion of something alien. 19 | No one knows, if it is evil or just some kind of short intermission. 20 | 21 | %} 22 | 23 | #(begin 24 | (display "If wrapped in a latex document, it can be compiled with pdflatex,")(newline) 25 | (display "then turned to an EPS-file and included in a markup.")(newline) 26 | (display "One might use markdown and pandoc to produce the PDF.")(newline) 27 | (newline) 28 | (display text) 29 | ) 30 | -------------------------------------------------------------------------------- /general-tools/scheme-wrapper/README.md: -------------------------------------------------------------------------------- 1 | Scheme-Wrapper and Scheme-Helper 2 | ================================ 3 | 4 | In this folder are a few functions helper functions collected. 5 | 6 | parserDefine 7 | ------------ 8 | 9 | To define variables inside a scope that is not toplevel, here is a void-function that does it. 10 | For example 11 | 12 | { 13 | mySnippet = \relative c'' { bes4 a c b } 14 | } 15 | 16 | is not allowed. But with the parserDefine command, variables can be defined almost anywhere: 17 | 18 | { 19 | \parserDefine mySnippet \relative c'' { bes4 a c b } 20 | } 21 | 22 | add-guile-path 23 | -------------- 24 | 25 | When you want to define a scheme-module, the path to the files must be known to guile. 26 | The addGuilePath command is a void function that extracts the directory path of the given location argument 27 | and adds the given relative path to %load-path. Now use-modules and load-from-path can access files in the 28 | denoted folder. 29 | 30 | In the given example are: 31 | 32 | definitions.ily 33 | example.ly 34 | my-scheme/my-init.scm 35 | my-scheme/my-module.scm 36 | 37 | In the example file the my-scheme folder is added to %load-path. Now lilypond can execute 38 | 39 | #(load-from-path "my-init.scm") 40 | #(use-modules (my-module)) 41 | 42 | a-list-access 43 | ------------- 44 | 45 | In a-list-access are commands defined, to work with a-lists and nested a-lists. 46 | With 47 | 48 | \setalist mylist symbol #val 49 | 50 | you can set the value 'symbol in the variable 'mylist' to value. 51 | If mylist is an empty list and val contains the value 25, mylist will be set to 52 | 53 | '((symbol . 25)) 54 | 55 | If you work with nested a-lists, you can use setatree with a path list: 56 | 57 | \setatree myopts my.option.path #25 58 | 59 | If myopts is an empty list, this command sets myopts to 60 | 61 | '((my . ((option . ((path . 25)) )) )) 62 | 63 | This is quite handy, if you need to prepare options, which are often given as (nested) a-lists. 64 | 65 | 66 | -------------------------------------------------------------------------------- /general-tools/scheme-wrapper/a-list-access/definitions.ily: -------------------------------------------------------------------------------- 1 | 2 | 3 | \include "deprecate.ily" 4 | 5 | \ollRedirect 6 | "general-tools/scheme-wrapper/a-list-access/definitions.ily" 7 | "_internal/utilities/alist-access.ily" -------------------------------------------------------------------------------- /general-tools/scheme-wrapper/a-list-access/example.ly: -------------------------------------------------------------------------------- 1 | \version "2.17.96" 2 | \include "definitions.ily" 3 | 4 | 5 | % work with a-lists 6 | \clralist tags % equivalent to "tags=#'()" but can be called, whenever a void-function is allowed 7 | % setalist wraps (assoc-set! ) 8 | \setalist tags instrumentName "Trumpet (b)" 9 | % addalist leaves the order of input in the assoc-list for the price of a little bit more computing 10 | \addalist tags midiInstrument "trumpet" 11 | % now the variable tags is defined and set, so display it ... 12 | #(display tags) 13 | 14 | #(newline) 15 | 16 | % work with nested a-lists 17 | \clratree opts % equivalent to "tags=#'()" but can be called, whenever a void-function is allowed 18 | % set '((staff . ((trumpet . ((name . "Trumpet")) )) )) 19 | \setatree opts staffs.trumpet.name "Trumpet" 20 | % addatree leaves the order of input in the assoc-list for the price of a little bit more computing 21 | \addatree opts staffs.trombone.name "Trombone" 22 | \addatree opts staffs.trombone.clef "bass" 23 | #(display opts) 24 | 25 | % There is more to come, where I make excessive use of nested a-lists (or a-trees?) to parametresize options 26 | % this might be called "[clr|set|add]Option" ??? 27 | -------------------------------------------------------------------------------- /general-tools/scheme-wrapper/add-guile-path/example.ly: -------------------------------------------------------------------------------- 1 | \version "2.18.0" 2 | \include "definitions.ily" 3 | 4 | \addGuilePath my-scheme 5 | % the first entry should be the absolute path to the folder "my-scheme" next to this file 6 | #(display %load-path) 7 | 8 | #(newline) 9 | 10 | % load file from %load-path 11 | #(load-from-path "my-init.scm") 12 | 13 | % import/activate my-module, which is located in the folder "my-scheme" 14 | #(use-modules (my-module)) 15 | % use the function, defined in module '(my-module) 16 | #(my-lambda 'is 'a 'great 'procedure!) 17 | 18 | 19 | -------------------------------------------------------------------------------- /general-tools/scheme-wrapper/add-guile-path/my-scheme/my-init.scm: -------------------------------------------------------------------------------- 1 | (display "Hello World from 'my-init.scm'") 2 | (newline) 3 | -------------------------------------------------------------------------------- /general-tools/scheme-wrapper/add-guile-path/my-scheme/my-module.scm: -------------------------------------------------------------------------------- 1 | ; define a module for test purposes 2 | (define-module (my-module)) 3 | 4 | ; define a function that is available, if the module '(my-module) is used 5 | (define-public (my-lambda . args) 6 | (display "my-lambda")(newline) 7 | (for-each (lambda (e) (display "\t")(display e)(newline)) args) 8 | ) 9 | -------------------------------------------------------------------------------- /general-tools/scheme-wrapper/parserDefine/definitions.ily: -------------------------------------------------------------------------------- 1 | \version "2.17.96" 2 | 3 | \header { 4 | snippet-title = "Define variables anywhere" 5 | snippet-author = "Jan-Peter Voigt" 6 | snippet-description = \markup { 7 | } 8 | % add comma-separated tags to make searching more effective: 9 | tags = "Program flow, LilyPond variables" 10 | % is this snippet ready? See meta/status-values.md 11 | status = "ready" 12 | } 13 | 14 | %%%%%%%%%%%%%%%%%%%%%%%%%% 15 | % here goes the snippet: % 16 | %%%%%%%%%%%%%%%%%%%%%%%%%% 17 | 18 | parserDefine = 19 | #(define-void-function (parser location name val)(symbol? scheme?) 20 | (ly:parser-define! parser name val)) 21 | 22 | %{ 23 | To make this work in pre 2.17 versions, one might use 24 | string-or-symbol? 25 | and conditionally change name to a symbol with 26 | (if (string? name) (set! name (string->symbol name))) 27 | %} 28 | -------------------------------------------------------------------------------- /general-tools/scheme-wrapper/parserDefine/example.ly: -------------------------------------------------------------------------------- 1 | \version "2.17.96" 2 | \include "definitions.ily" 3 | 4 | % with a simple void-function you can define variables almost anywhere 5 | % this means, you can include music files inside a scope. 6 | \score { 7 | % parserDefine is not allowed here, because it doesn't return a valid music expression, ... 8 | << 9 | % ... but here 10 | \parserDefine hansi-mausi 25 11 | % this might be included from a file here 12 | \parserDefine myMusic \relative c' { c4 e g b c1 } 13 | % use the former declared variable 14 | \new Staff \myMusic 15 | >> 16 | \layout { } 17 | } 18 | 19 | #(display (+ hansi-mausi 42)) 20 | -------------------------------------------------------------------------------- /input-shorthands/README.md: -------------------------------------------------------------------------------- 1 | This is a place for snippets that don't produce actual notation 2 | elements, but are meant to help in working with LilyPond code. 3 | Examples: 4 | * a function that takes a melody and adds octaves to every note, 5 | * a function that applies some articulation to a music expression, 6 | * definition of shorthand commands for frequently used overrides. 7 | -------------------------------------------------------------------------------- /input-shorthands/articulations-not-aligned-with-notes/definitions.ily: -------------------------------------------------------------------------------- 1 | #(ly:set-option 'relative-includes #t) 2 | \include "../../deprecate.ily" 3 | \ollSnippetsIncludeHint #(*location*) 4 | \include "module.ily" 5 | -------------------------------------------------------------------------------- /input-shorthands/articulations-not-aligned-with-notes/example.ly: -------------------------------------------------------------------------------- 1 | \version "2.17.25" 2 | 3 | \include "oll-core/package.ily" 4 | \loadModule snippets.input-shorthands.articulations-not-aligned-with-notes 5 | %\include "./definitions.ily" 6 | 7 | % examples: 8 | 9 | \paper { 10 | line-width = 9 \cm 11 | indent = 0 12 | ragged-right = ##f 13 | } 14 | 15 | \markup "You can insert an articulation in the middle of the note:" 16 | \new Voice \relative c'' { 17 | \at 4 \turn f4. g16-. a-. 18 | } 19 | 20 | \markup "You can add (multiple) dynamics in the middle of the note:" 21 | \new Voice { 22 | \at 1*1/3 \p 23 | \at 1*2/3 \< 24 | \at 1\! 25 | c'1 26 | } 27 | 28 | \markup "You can also apply this to a whole music expression:" 29 | \new Voice { 30 | \at 4 \< \at 2. \! \at 1 \p { c'2 d' e' } 31 | } 32 | 33 | \markup "You can even insert music into music this way:" 34 | << 35 | \new Staff { \at 2 { e'8 f' g' a' } c'1 } 36 | \new Staff { c'4 d' e' f' } 37 | >> 38 | 39 | \markup "And a really nice example by David Kastrup:" 40 | \new Staff 41 | { 42 | << 43 | { 44 | \dynamicUp 45 | \at 1*1/3\p 46 | \at 1*2/3\< 47 | \at 1 \! 48 | c''1\mf\> 49 | } 50 | \\ 51 | { 52 | <> \pp \< 53 | \repeat unfold 16 cis'16 54 | <>\mp 55 | } 56 | >> 57 | 1 58 | } 59 | -------------------------------------------------------------------------------- /input-shorthands/articulations-not-aligned-with-notes/example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openlilylib/snippets/63858cdaf121935a6a2d835058bf24e2cea81a5a/input-shorthands/articulations-not-aligned-with-notes/example.png -------------------------------------------------------------------------------- /input-shorthands/articulations-not-aligned-with-notes/module.ily: -------------------------------------------------------------------------------- 1 | \version "2.17.25" 2 | 3 | \header { 4 | %FIXME: better name? 5 | snippet-title = "Articulations not aligned to notes" 6 | snippet-author = "David Kastrup" 7 | snippet-description = \markup { 8 | Small function that simplifies adding dynamics, 9 | hairpins, articulations and other things in the middle 10 | of the notes' (or music expressions') durations. 11 | } 12 | tags = "syntax, articulation, hairpin, at" 13 | status = "official" 14 | } 15 | 16 | at = 17 | #(define-music-function (parser location t e m) 18 | (ly:duration? ly:music? ly:music?) 19 | #{ << #m { \skip $t <>$e } >> #}) 20 | -------------------------------------------------------------------------------- /input-shorthands/easy-custom-dynamics/definitions.ily: -------------------------------------------------------------------------------- 1 | #(ly:set-option 'relative-includes #t) 2 | \include "../../deprecate.ily" 3 | \ollSnippetsIncludeHint #(*location*) 4 | \include "module.ily" 5 | -------------------------------------------------------------------------------- /input-shorthands/easy-custom-dynamics/example.ly: -------------------------------------------------------------------------------- 1 | \version "2.16.2" 2 | 3 | \include "oll-core/package.ily" 4 | \loadModule snippets.input-shorthands.easy-custom-dynamics 5 | %\include "definitions.ily" 6 | 7 | { 8 | c'1 \dynamic sfffzppppp 9 | } 10 | { 11 | c' \dynamic "molto f ekspressivvo" 12 | } 13 | { 14 | c' \dynamic fff_I_can_use_underscores 15 | } 16 | { 17 | c' \dynamic \markup { lolish \huge \dynamic pp \italic ekspress, \caps "markups ftw!" } 18 | } -------------------------------------------------------------------------------- /input-shorthands/easy-custom-dynamics/example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openlilylib/snippets/63858cdaf121935a6a2d835058bf24e2cea81a5a/input-shorthands/easy-custom-dynamics/example.png -------------------------------------------------------------------------------- /input-shorthands/easy-octaves/example.ly: -------------------------------------------------------------------------------- 1 | \version "2.16.2" 2 | 3 | \include "definitions.ily" 4 | 5 | \relative a' { 6 | r8 r B-"Foo" r r A( | 7 | B4) 8 B r r A( | 8 | r8 r A r ) r G | 9 | A4 8 A-. r r A\pp | 10 | r8 dis r fis r A, r Gis | 11 | Gis8 d' e Gis,8~ Gis4. E8~ | 12 | E8 a c F,~ F a c Fis,~ | 13 | Fis8 a c F,~ F a c E, | 14 | } -------------------------------------------------------------------------------- /input-shorthands/easy-octaves/example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openlilylib/snippets/63858cdaf121935a6a2d835058bf24e2cea81a5a/input-shorthands/easy-octaves/example.png -------------------------------------------------------------------------------- /input-shorthands/fuzzy-scale/definitions.ily: -------------------------------------------------------------------------------- 1 | #(ly:set-option 'relative-includes #t) 2 | \include "../../deprecate.ily" 3 | \ollSnippetsIncludeHint #(*location*) 4 | \include "module.ily" 5 | -------------------------------------------------------------------------------- /input-shorthands/fuzzy-scale/example.ly: -------------------------------------------------------------------------------- 1 | \version "2.18.0" 2 | 3 | \include "oll-core/package.ily" 4 | \loadModule snippets.input-shorthands.fuzzy-scale 5 | %\include "definitions.ily" 6 | 7 | \header { 8 | title = "Fuzzy fast scale gesture" 9 | } 10 | 11 | music = { 12 | \time 3/2 13 | % This one gives a horizontal spacing issue due to parallel music in the other staff 14 | \repeat-stems #'(18 . -2) 2 15 | e'2 16 | \repeat-stems #'(12 . -2.5) 4 17 | s4 g'4 r4 18 | % manually specify the beam's slope 19 | \once \override Beam.positions = #'(4 . 1) 20 | \repeat-stems #'(10 . 0) 8 21 | \stemNeutral 22 | r8 e''2. | 23 | } 24 | 25 | ref = { \repeat unfold 24 r8 } 26 | 27 | #(ly:set-option 'strokeadjust #t) 28 | 29 | \score { 30 | << 31 | \new Staff \music 32 | \new Staff \ref 33 | >> 34 | } 35 | -------------------------------------------------------------------------------- /input-shorthands/ignore-collisions/definitions.ily: -------------------------------------------------------------------------------- 1 | \version "2.16.2" % absolutely necessary! 2 | 3 | \header { 4 | snippet-title = "Ignore Collision(s)" 5 | snippet-author = "Urs Liska" 6 | snippet-description = \markup { 7 | LilyPond issues warnings when two or more notes share the same 8 | note column. However, sometimes it is necessary to do that, 9 | for example when doing some polyphony tricks. 10 | It is useful to suppress the warnings in this case so the 11 | - expected - warnings don't "hide" the real ones. 12 | } 13 | status = "ready" 14 | tags = "shorthand, notecolumn, collision, clash" 15 | } 16 | 17 | %%%%%%%%%%%%%%%%%%%%%%%%%% 18 | % here goes the snippet: % 19 | %%%%%%%%%%%%%%%%%%%%%%%%%% 20 | 21 | 22 | % Suppress a warning about clashing note columns 23 | % Use when you deliberately use clashing note columns 24 | % e.g. when merging voices to one stem 25 | % or when hiding voices (although for tying the 26 | % \hideVoiceForTie approach is recommended) 27 | % 28 | ignoreCollision = \once \override NoteColumn #'ignore-collision = ##t 29 | 30 | % Use this one with care, as it will prevent lilypond from 31 | % warning you about real problems 32 | ignoreCollisions = \override NoteColumn #'ignore-collision = ##t 33 | warnOnCollisions = \override NoteColumn #'ignore-collision = ##f 34 | -------------------------------------------------------------------------------- /input-shorthands/ignore-collisions/examples.ly: -------------------------------------------------------------------------------- 1 | % Examples for \ignoreCollision 2 | 3 | \version "2.16.2" 4 | 5 | \include "definitions.ily" 6 | 7 | \markup "This will issue a warning about clashing note columns" 8 | 9 | \relative c'' { 10 | << 11 | { 12 | \voiceTwo 13 | \ignoreCollision 14 | c2 ^~ \voiceOne c4. b8 15 | } \\ 16 | \new Voice { 17 | \voiceTwo 18 | 2 19 | } 20 | >> 21 | } 22 | 23 | \markup "Using \\ignoreCollision will suppress this warning" 24 | 25 | \relative c'' { 26 | << 27 | { 28 | \voiceTwo 29 | c2 ^~ \voiceOne c4. b8 30 | } \\ 31 | \new Voice { 32 | \voiceTwo 33 | 2 34 | } 35 | >> 36 | } 37 | -------------------------------------------------------------------------------- /input-shorthands/late-evaluation-of-variables.ly: -------------------------------------------------------------------------------- 1 | \version "2.16.2" % absolutely necessary! 2 | 3 | \header { 4 | snippet-title = "Late evaluation of variables" 5 | snippet-author = "Kristóf Marussy" 6 | % taken from https://gist.github.com/kris7topher/6038247 7 | % featured on Lilypond blog (provide reference)9 8 | snippet-description = \markup { 9 | “Late-bind” variables using an arity-0 music function that looks up 10 | values at function call time instead of variable assignment time. 11 | } 12 | status = "unfinished" 13 | % TODO: tell Kristof about the snippet, reorganize description 14 | % add comma-separated tags to make searching more effective: 15 | tags = "arity-0, score organization, variable, transposition, lilypond blog" 16 | } 17 | 18 | %%%%%%%%%%%%%%%%%%%%%%%%%% 19 | % here goes the snippet: % 20 | %%%%%%%%%%%%%%%%%%%%%%%%%% 21 | 22 | beginning = \relative c'' { 23 | \key as \major 24 | c1 25 | } 26 | 27 | middlesection = \relative gis' { 28 | \key e \major 29 | gis1 30 | } 31 | 32 | end = \relative c'' { 33 | \key as \major 34 | c1 35 | \bar "|." 36 | } 37 | 38 | % ``Late-bind'' variables using an arity-0 music function that looks up values 39 | % at function call time instead of variable assignment time. 40 | 41 | #(define-macro (late embedded-lilypond) 42 | `(define-music-function 43 | (parser location) 44 | () 45 | ,embedded-lilypond)) 46 | 47 | 48 | music = #(late #{ 49 | \beginning 50 | \middlesection 51 | \end 52 | #}) 53 | 54 | \score { 55 | % The music without the enharmonic change---complex key signature! 56 | \new Staff \transpose as g \music 57 | \layout {} 58 | } 59 | 60 | % Apply enharmonic transposition to \middlesection. 61 | middlesection = \transpose e fes \middlesection 62 | 63 | \score { 64 | % Because variables in \music are ``late-bound'', the enharmonic 65 | % transposition is now respected. 66 | % The point is that the reassignment of middlesection variable 67 | % is respected despite the fact that \music was defined earlier! 68 | \new Staff \transpose as g \music 69 | \layout {} 70 | } 71 | -------------------------------------------------------------------------------- /input-shorthands/optional-chord/definitions.ily: -------------------------------------------------------------------------------- 1 | \version "2.16.2" % absolutely necessary! 2 | 3 | \header { 4 | snippet-title = "Optional chord" 5 | snippet-author = "Janek Warchoł" 6 | snippet-description = \markup { 7 | When writing down harmonization of a piece, sometimes there are places 8 | where a chord changes to some other just for a brief moment, so that playing 9 | it as a separate chord on the accompanying instrument is optional. 10 | This little function is for printing such chords in smaller font and parenthesized. 11 | } 12 | % add comma-separated tags to make searching more effective: 13 | tags = "chord, parenthesize, small" 14 | % is this snippet ready? See meta/status-values.md 15 | status = "ready" 16 | } 17 | 18 | %%%%%%%%%%%%%%%%%%%%%%%%%% 19 | % here goes the snippet: % 20 | %%%%%%%%%%%%%%%%%%%%%%%%%% 21 | 22 | optionalChord = 23 | #(define-music-function (parser location chord)(ly:music?) 24 | #{ 25 | \once \override ParenthesesItem #'font-size = 0 26 | \once \override ChordName #'font-size = #-1 27 | \parenthesize 28 | #chord 29 | #}) 30 | -------------------------------------------------------------------------------- /input-shorthands/optional-chord/example.ly: -------------------------------------------------------------------------------- 1 | \version "2.16.2" 2 | 3 | \include "./definitions.ily" 4 | 5 | << 6 | \new ChordNames \chordmode { 7 | b2:m \optionalChord g4 \optionalChord d e1:m 8 | } 9 | \new Staff { 10 | 2 11 | 4 12 | 13 | 1 14 | } 15 | >> 16 | -------------------------------------------------------------------------------- /input-shorthands/sizeContext/definitions.ily: -------------------------------------------------------------------------------- 1 | \version "2.18.0" 2 | 3 | \header { 4 | snippet-title = "size Staff context" 5 | snippet-author = "Jan-Peter Voigt" 6 | snippet-description = \markup { 7 | This is a little helper command, that returns a context-modification, which scales fontSize, StaffSymbol.staff-space and StaffSymbol.thickness by s. 8 | This is handy to resize a Staff with one command. 9 | } 10 | % add comma-separated tags to make searching more effective: 11 | tags = "Staff,size,font-size" 12 | % is this snippet ready? See meta/status-values.md 13 | status = "ready" 14 | } 15 | 16 | %%%%%%%%%%%%%%%%%%%%%%%%%% 17 | % here goes the snippet: % 18 | %%%%%%%%%%%%%%%%%%%%%%%%%% 19 | 20 | 21 | sizeContext = 22 | #(define-scheme-function (parser location s)(number?) 23 | #{ \with { 24 | fontSize = #s 25 | \override StaffSymbol #'staff-space = #(magstep s) 26 | \override StaffSymbol #'thickness = #(magstep s) 27 | } #}) 28 | -------------------------------------------------------------------------------- /input-shorthands/sizeContext/example.ly: -------------------------------------------------------------------------------- 1 | \version "2.18.0" 2 | \include "definitions.ily" 3 | 4 | << 5 | \new Staff \with { 6 | % make Staff bigger 7 | \sizeContext #2 8 | } \relative c'' { bes4 a c b } 9 | \new Staff \with { 10 | % leave size of Staff 11 | % \sizeContext #0 % no size change 12 | } \relative c'' { bes4 a c b } 13 | \new Staff \with { 14 | % make Staff smaller 15 | \sizeContext #-2 16 | } \relative c'' { bes4 a c b } 17 | >> 18 | -------------------------------------------------------------------------------- /input-shorthands/vertical-spacing/definitions.ily: -------------------------------------------------------------------------------- 1 | #(ly:set-option 'relative-includes #t) 2 | \include "../../deprecate.ily" 3 | \ollSnippetsIncludeHint #(*location*) 4 | \include "module.ily" 5 | -------------------------------------------------------------------------------- /input-shorthands/vertical-spacing/example.ly: -------------------------------------------------------------------------------- 1 | \version "2.16.2" 2 | 3 | \include "oll-core/package.ily" 4 | \loadModule snippets.input-shorthands.vertical-spacing 5 | %\include "definitions.ily" 6 | 7 | \markup \bold \huge "Vertical Spacing" 8 | 9 | \paper { 10 | % instead of a large construction, these four values 11 | % define the vertical spacing: 12 | system-system-spacing = \simplespace 25 2 3 60 13 | annotate-spacing = ##t % only for demonstration 14 | } 15 | 16 | { c''1 \break c''1 } 17 | -------------------------------------------------------------------------------- /input-shorthands/vertical-spacing/module.ily: -------------------------------------------------------------------------------- 1 | \version "2.16.2" 2 | 3 | \header { 4 | snippet-title = "Shorthand for Setting Vertical Spacing" 5 | snippet-author = "Joram Berger" 6 | snippet-source = "" 7 | snippet-description = \markup { 8 | This snippet provides the simplespace function. Usage: 9 | "\simplespace basic-distance min-distance padding stretchability" 10 | } 11 | tags = "vertical spacing, shorthand, distance" 12 | status = "ready" 13 | } 14 | 15 | % this is intended to return the scheme construct with the given values: 16 | simplespace = 17 | #(define-scheme-function 18 | (parser location bdist mdist padd stret) 19 | (number? number? number? number?) 20 | `((basic-distance . ,bdist) 21 | (minimum-distance . ,mdist) 22 | (padding . ,padd) 23 | (stretchability . ,stret)) 24 | ) 25 | -------------------------------------------------------------------------------- /ly/_internal/doc-include/titling.ily: -------------------------------------------------------------------------------- 1 | % Headers for openlilylib documentation pages 2 | % Currently an empty stub 3 | 4 | \paper { 5 | #(include-special-characters) 6 | 7 | bookTitleMarkup = \markup { 8 | \column { 9 | { \bold \huge \fromproperty #'header:oll-title } 10 | { \fromproperty #'header:oll-short-description } 11 | 12 | \concat { \vspace #1.5 "Author(s): " \fromproperty #'header:oll-author } 13 | \line \typewriter { #include-clause } 14 | 15 | \section "Description:" 16 | \fromproperty #'header:oll-description 17 | 18 | \section "Usage:" 19 | \fromproperty #'header:oll-usage 20 | 21 | \section "Configuration:" 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ly/_internal/doc-include/usage-example.ily: -------------------------------------------------------------------------------- 1 | % Formats for example pages in openlilylib documentation 2 | 3 | #(define include-name 4 | #{ \getOption documentation.include-file #}) 5 | 6 | #(define include-clause 7 | (format "\\loadModule \"~a\"" include-name)) 8 | 9 | \loadModule #include-name 10 | 11 | #(ly:set-option 'relative-includes #t) 12 | 13 | % This is still optional. I thought of providing a certain binding margin. 14 | \paper { 15 | indent = 0\cm 16 | left-margin = 2\cm 17 | right-margin = 1.5\cm 18 | } 19 | 20 | % Use this to consistently lay out the documentation 21 | #(define-markup-command (section layout props heading) (markup?) 22 | (interpret-markup layout props 23 | #{ 24 | \markup \column { 25 | \vspace #1 26 | \bold #heading 27 | \vspace #0.5 28 | }#})) 29 | 30 | 31 | 32 | 33 | 34 | % Consistently format and process headers and footers, 35 | % populated with data from the snippet's file 36 | \include "titling.ily" 37 | -------------------------------------------------------------------------------- /ly/_internal/utilities/alist-example.ly: -------------------------------------------------------------------------------- 1 | \version "2.17.96" 2 | \include "alist-access.ily" 3 | 4 | 5 | % work with a-lists 6 | \clralist tags % equivalent to "tags=#'()" but can be called, whenever a void-function is allowed 7 | % setalist wraps (assoc-set! ) 8 | \setalist tags instrumentName "Trumpet (b)" 9 | % addalist leaves the order of input in the assoc-list for the price of a little bit more computing 10 | \addalist tags midiInstrument "trumpet" 11 | % now the variable tags is defined and set, so display it ... 12 | #(display tags) 13 | 14 | #(newline) 15 | 16 | % work with nested a-lists 17 | \clratree opts % equivalent to "tags=#'()" but can be called, whenever a void-function is allowed 18 | % set '((staff . ((trumpet . ((name . "Trumpet")) )) )) 19 | \setatree opts staffs.trumpet.name "Trompete" 20 | \setatree opts staffs.trumpet.name "Trumpet" 21 | % addatree leaves the order of input in the assoc-list for the price of a little bit more computing 22 | \addatree opts staffs.trombone.name "Trombone" 23 | \addatree opts staffs.trombone.clef "bass" 24 | #(display opts) 25 | 26 | % There is more to come, where I make excessive use of nested a-lists (or a-trees?) to parametresize options 27 | % this might be called "[clr|set|add]Option" ??? 28 | -------------------------------------------------------------------------------- /ly/_internal/utilities/include-pattern.ily: -------------------------------------------------------------------------------- 1 | \version "2.18.0" 2 | 3 | \header { 4 | oll-title = "Include multiple files" 5 | oll-author = "Jan-Peter Voigt" 6 | oll-short-description = \markup { 7 | \wordwrap { 8 | Includes multiple files at once using 9 | a regular expression. 10 | } 11 | } 12 | oll-category = "general-tools" 13 | oll-tags = "include, file-handling" 14 | oll-status = "unfinished" 15 | } 16 | 17 | % Should includes be logged or not? 18 | \registerOption internal.include-pattern.display-includes ##f 19 | 20 | includePattern = 21 | #(define-void-function (parser location idir pattern) 22 | (string? string?) 23 | (let ((dirname 24 | (if (absolute-path? idir) 25 | (string-append idir "/") 26 | (string-append (location-extract-path location) "/" idir))) 27 | (includefiles '()) 28 | (pattern-regexp (make-regexp pattern))) 29 | 30 | (if (or (= (string-length dirname) 0) 31 | (not (eq? #\/ (string-ref dirname (- (string-length dirname) 1))))) 32 | (set! dirname (string-append dirname "/"))) 33 | (if (or (not (file-exists? dirname)) 34 | (not (eq? 'directory (stat:type (stat dirname))))) 35 | (set! dirname #f)) 36 | 37 | (if dirname (let ((dir (opendir dirname))) 38 | (do ((entry (readdir dir) (readdir dir))) ((eof-object? entry)) 39 | (if (regexp-exec pattern-regexp entry) 40 | (set! includefiles (merge includefiles (list (string-append dirname entry)) string>?)))) 41 | (closedir dir))) 42 | 43 | (for-each (lambda (file) 44 | (let* ((ipv #{ \getOption internal.include-pattern.display-includes #}) 45 | (istr (format "\\include \"~A\"\n" file))) 46 | (if (and ipv (or (not (list? ipv))(> (length ipv) 0))) 47 | (oll:log "~A" istr)) 48 | (if (lilypond-greater-than? "2.19.21") 49 | (ly:parser-include-string istr) 50 | (ly:parser-include-string parser istr)))) 51 | includefiles) 52 | )) 53 | -------------------------------------------------------------------------------- /ly/_internal/utilities/lilypond-version-predicates.ly: -------------------------------------------------------------------------------- 1 | \version "2.16.0" % This should also work with older versions 2 | 3 | \include "openlilylib" 4 | \registerOption documentation.include-file "_internal/utilities/lilypond-version-predicates.ily" 5 | 6 | \loadModule "_internal/doc-include/usage-example.ily" 7 | 8 | \paper { 9 | ragged-right = ##f 10 | indent = 0\cm 11 | } 12 | 13 | versionCommentA = 14 | #(define-music-function (parser location ver) 15 | (scheme?) 16 | (cond ((lilypond-greater-than-or-equal? ver) 17 | #{ s^\markup {#(lilypond-version) is higher or equals that.} #}) 18 | ((lilypond-less-than-or-equal? ver) 19 | #{ s^ \markup {#(lilypond-version) is less or equals that.} #}))) 20 | 21 | versionCommentB = 22 | #(define-music-function (parser location ver) 23 | (scheme?) 24 | (cond ((lilypond-greater-than? ver) 25 | #{ s^\markup {#(lilypond-version) is higher} #}) 26 | ((lilypond-equals? ver) 27 | #{ s^\markup {#(lilypond-version) is equal} #}) 28 | ((lilypond-less-than? ver) 29 | #{ s^\markup {#(lilypond-version) is less} #}))) 30 | 31 | \markup { \vspace #3 } 32 | 33 | \markup \justify { 34 | Define a few music functions that produce output 35 | depending on the result of LilyPond version comparisons. 36 | Compile this file with different versions of LilyPond 37 | and see how the output markups change. 38 | } 39 | 40 | \markup { \vspace #3 } 41 | 42 | \markup \bold { Compiled with LilyPond #(lilypond-version) } 43 | 44 | \markup { \vspace #3 } 45 | 46 | { 47 | \tempo "Comparing with: 2.18.2" 48 | s1 49 | \versionCommentA #'(2 18 2) 50 | \versionCommentB #'(2 18 2) 51 | } 52 | 53 | \markup { \vspace #2 } 54 | 55 | { 56 | \tempo "Comparing with: 2.19.5" 57 | s1 58 | \versionCommentA "2.19.5" 59 | \versionCommentB "2.19.5" 60 | } 61 | 62 | \markup { \vspace #2 } 63 | 64 | { 65 | \tempo "Comparing with: 2.19.16" 66 | s1 67 | \versionCommentA #'(2 19 16) 68 | \versionCommentB #'(2 19 16) 69 | } 70 | 71 | { 72 | \tempo "Comparing with: 2.20.0" 73 | s1 74 | \versionCommentA "2.20.0" 75 | \versionCommentB "2.20.0" 76 | } 77 | 78 | \markup { \vspace #2 } 79 | 80 | -------------------------------------------------------------------------------- /ly/_internal/utilities/tree.ily: -------------------------------------------------------------------------------- 1 | \version "2.18.2" 2 | 3 | \include "openlilylib" 4 | 5 | #(use-modules (_internal utilities tree)) 6 | #(use-modules (ice-9 format)) 7 | 8 | #(define (parser-lookup-symbol parser symbol) 9 | (if (lilypond-greater-than? "2.19.21") 10 | (ly:parser-lookup symbol) 11 | (ly:parser-lookup parser symbol))) 12 | 13 | %{! 14 | % Create a new tree at the given symbol 15 | %} 16 | makeTree= 17 | #(define-void-function 18 | (parser location name) (symbol?) 19 | (if (lilypond-greater-than? "2.19.21") 20 | (ly:parser-define! name (make-tree)) 21 | (ly:parser-define! parser name (make-tree)))) 22 | 23 | %{! 24 | % Set the value at the specified path. If the path already exists, 25 | % update the old value 26 | %} 27 | treeSet= 28 | #(define-void-function 29 | (parser location name path value) (symbol? list? scheme?) 30 | (tree-set! (parser-lookup-symbol parser name) path value)) 31 | 32 | %{! 33 | % Get the value at the specified path. If the path exists, return 34 | % the associated value, otherwise return the given default value. 35 | %} 36 | treeGet= 37 | #(define-scheme-function 38 | (parser location name path default) (symbol? list? scheme?) 39 | (tree-get (parser-lookup-symbol parser name) path default)) 40 | 41 | %{! 42 | % Get the value at the specified path. If the path exists, return 43 | % the associated value, otherwise terminate with an error. 44 | %} 45 | treeGetStrict= 46 | #(define-scheme-function 47 | (parser location name path) (symbol? list?) 48 | (catch 'key-error 49 | (lambda () 50 | (tree-get (parser-lookup-symbol parser name) path)) 51 | (lambda (key . args) 52 | (ly:error "~a: ~a" key (car args))))) 53 | 54 | %{! 55 | % Remove the value at the specified path. If the path does not exist, 56 | % do nothing. 57 | %} 58 | treeRemove= 59 | #(define-void-function 60 | (parser location name path) (symbol? list?) 61 | (tree-remove! (parser-lookup-symbol parser name) path)) 62 | -------------------------------------------------------------------------------- /ly/comptools/README.md: -------------------------------------------------------------------------------- 1 | # comptools - Compilation Helpers for GNU LilyPond 2 | 3 | `comptools` is a LilyPond library that provides functionality manipulating 4 | the *compilation* process in one way or the other. That means its tools are 5 | intended to treat the *presentation* part of a LilyPond compilation, and more 6 | specifically, potentially temporary parts of the presentation that are used 7 | for setting up the working environment or assisting in production workflows 8 | rather than editing the content or the published appearance of an edition. 9 | However, this separation is not exclusive, and there are areas of intersection 10 | with persistent modifications. 11 | 12 | The most prominent tools in this library are support for 13 | 14 | - partial compilation of scores - 15 | which is useful for reducing the time to wait for recompilation 16 | when working on small parts of a score 17 | - conditional breaks - 18 | which can be used to adapt the compilation to one or more manuscripts 19 | in order to simplify the navigation between manuscript and compiled score. 20 | However, this can also be used to make the handling of manual breaks 21 | more straightforward if that should be necessary. 22 | 23 | --- 24 | 25 | `comptools` is maintained by Urs Liska - ul@openlilylib.org -------------------------------------------------------------------------------- /ly/comptools/__init__.ily: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | \declareLibrary CompTools \with { 6 | maintainers = "Urs Liska " 7 | version = "0.1.0" 8 | 9 | short-description = "Tools providing support for different compilation modes." 10 | description = "This library supports ways to conditionally compile documents, 11 | that is, it provides commands that affect the appearance of the score but that 12 | don't belong to the musical content of the engraved piece. Rather it is at the 13 | level of presentation or of authoring workflows." 14 | } 15 | 16 | % Shared variable that can hold any number of break sets. 17 | % Selecting one set to apply makes it possible to manage different 18 | % break sets, e.g. corresponding to different manuscripts 19 | \registerOption comptools.break-sets #'() 20 | 21 | % Register a named set of breaks that can be referenced later 22 | #(define registerBreakSet 23 | (define-void-function (parser location name) 24 | (symbol?) 25 | (let ((base-path `(comptools break-sets ,name))) 26 | #{ \setChildOption #base-path #'line-breaks #'() #} 27 | #{ \setChildOption #base-path #'page-breaks #'() #} 28 | #{ \setChildOption #base-path #'page-turns #'() #}))) 29 | 30 | #(define setConditionalBreaks 31 | (define-void-function (parser location set type breaks) 32 | (symbol? symbol? list?) 33 | #{ \setChildOption #`(comptools break-sets ,set) #type #breaks #})) 34 | 35 | -------------------------------------------------------------------------------- /ly/comptools/__main__.ily: -------------------------------------------------------------------------------- 1 | 2 | 3 | % Stub 4 | -------------------------------------------------------------------------------- /ly/comptools/unit-tests/partial-compilation-01.ly: -------------------------------------------------------------------------------- 1 | % Test matrix for partial compilation module 2 | 3 | \version "2.18.0" 4 | 5 | \include "openlilylib" 6 | \useLibrary comptools 7 | \useModule comptools.partial-compilation 8 | 9 | #(display "") 10 | 11 | \include "../usage-examples/comptools-test-data.ily" 12 | 13 | % Uncomment the following commands to test different partial regions. 14 | % Multiple (non-overlapping) regions can be set, although the results 15 | % may not be acceptable. 16 | 17 | % Define a region with barnumbers 18 | \setClipRegion 8 12 19 | 20 | % Define a region beyond measure borders 21 | %\setClipRegion 198 #'(212 2/4) 22 | 23 | % Compile a single page 24 | %\setClipPage 5 25 | 26 | % Compile a page range 27 | %\setClipPageRange 4 5 28 | 29 | % Negative page range triggers a warning 30 | %\setClipPageRange 5 3 31 | 32 | % Non-existent pages result in errors 33 | %\setClipPageRange 3 123 34 | %\setClipPage -2 35 | 36 | 37 | \score { 38 | \new Staff \music 39 | } 40 | 41 | -------------------------------------------------------------------------------- /ly/comptools/unit-tests/partial-compilation-02.ly: -------------------------------------------------------------------------------- 1 | % Test matrix for partial compilation module 2 | 3 | \version "2.18.0" 4 | 5 | \include "openlilylib" 6 | \useLibrary comptools 7 | \useModule comptools.partial-compilation 8 | 9 | #(display "") 10 | 11 | \include "../usage-examples/comptools-test-data.ily" 12 | 13 | % Uncomment the following commands to test different partial regions. 14 | % Multiple (non-overlapping) regions can be set, although the results 15 | % may not be acceptable. 16 | 17 | % Define a region with barnumbers 18 | %\setClipRegion 8 12 19 | 20 | % Define a region beyond measure borders 21 | \setClipRegion 15 #'(44 2/2) 22 | 23 | % Compile a single page 24 | %\setClipPage 5 25 | 26 | % Compile a page range 27 | %\setClipPageRange 4 5 28 | 29 | % Negative page range triggers a warning 30 | %\setClipPageRange 5 3 31 | 32 | % Non-existent pages result in errors 33 | %\setClipPageRange 3 123 34 | %\setClipPage -2 35 | 36 | 37 | \score { 38 | \new Staff \music 39 | } 40 | 41 | -------------------------------------------------------------------------------- /ly/comptools/unit-tests/partial-compilation-03.ly: -------------------------------------------------------------------------------- 1 | % Test matrix for partial compilation module 2 | 3 | \version "2.18.0" 4 | 5 | \include "openlilylib" 6 | \useLibrary comptools 7 | \useModule comptools.partial-compilation 8 | 9 | #(display "") 10 | 11 | \include "../usage-examples/comptools-test-data.ily" 12 | 13 | % Uncomment the following commands to test different partial regions. 14 | % Multiple (non-overlapping) regions can be set, although the results 15 | % may not be acceptable. 16 | 17 | % Define a region with barnumbers 18 | %\setClipRegion 8 12 19 | 20 | % Define a region beyond measure borders 21 | %\setClipRegion 198 #'(212 2/4) 22 | 23 | % Compile a single page 24 | \setClipPage 5 25 | 26 | % Compile a page range 27 | %\setClipPageRange 4 5 28 | 29 | % Negative page range triggers a warning 30 | %\setClipPageRange 5 3 31 | 32 | % Non-existent pages result in errors 33 | %\setClipPageRange 3 123 34 | %\setClipPage -2 35 | 36 | 37 | \score { 38 | \new Staff \music 39 | } 40 | 41 | -------------------------------------------------------------------------------- /ly/comptools/unit-tests/partial-compilation-04.ly: -------------------------------------------------------------------------------- 1 | % Test matrix for partial compilation module 2 | 3 | \version "2.18.0" 4 | 5 | \include "openlilylib" 6 | \useLibrary comptools 7 | \useModule comptools.partial-compilation 8 | 9 | #(display "") 10 | 11 | \include "../usage-examples/comptools-test-data.ily" 12 | 13 | % Uncomment the following commands to test different partial regions. 14 | % Multiple (non-overlapping) regions can be set, although the results 15 | % may not be acceptable. 16 | 17 | % Define a region with barnumbers 18 | %\setClipRegion 8 12 19 | 20 | % Define a region beyond measure borders 21 | %\setClipRegion 198 #'(212 2/4) 22 | 23 | % Compile a single page 24 | %\setClipPage 5 25 | 26 | % Compile a page range 27 | \setClipPageRange 4 5 28 | 29 | % Negative page range triggers a warning 30 | %\setClipPageRange 5 3 31 | 32 | % Non-existent pages result in errors 33 | %\setClipPageRange 3 123 34 | %\setClipPage -2 35 | 36 | 37 | \score { 38 | \new Staff \music 39 | } 40 | 41 | -------------------------------------------------------------------------------- /ly/comptools/unit-tests/partial-compilation-05.ly: -------------------------------------------------------------------------------- 1 | % Test matrix for partial compilation module 2 | 3 | \version "2.18.0" 4 | 5 | \include "openlilylib" 6 | \useLibrary comptools 7 | \useModule comptools.partial-compilation 8 | 9 | #(display "") 10 | 11 | \include "../usage-examples/comptools-test-data.ily" 12 | 13 | % Uncomment the following commands to test different partial regions. 14 | % Multiple (non-overlapping) regions can be set, although the results 15 | % may not be acceptable. 16 | 17 | % Define a region with barnumbers 18 | %\setClipRegion 8 12 19 | 20 | % Define a region beyond measure borders 21 | %\setClipRegion 198 #'(212 2/4) 22 | 23 | % Compile a single page 24 | %\setClipPage 5 25 | 26 | % Compile a page range 27 | %\setClipPageRange 4 5 28 | 29 | % Negative page range triggers a warning 30 | \setClipPageRange 5 3 31 | 32 | % Non-existent pages result in errors 33 | %\setClipPageRange 3 123 34 | %\setClipPage -2 35 | 36 | 37 | \score { 38 | \new Staff \music 39 | } 40 | 41 | -------------------------------------------------------------------------------- /ly/comptools/unit-tests/partial-compilation-06.ly: -------------------------------------------------------------------------------- 1 | % Test matrix for partial compilation module 2 | 3 | \version "2.18.0" 4 | 5 | \include "openlilylib" 6 | \useLibrary comptools 7 | \useModule comptools.partial-compilation 8 | 9 | #(display "") 10 | 11 | \include "../usage-examples/comptools-test-data.ily" 12 | 13 | % Uncomment the following commands to test different partial regions. 14 | % Multiple (non-overlapping) regions can be set, although the results 15 | % may not be acceptable. 16 | 17 | % Define a region with barnumbers 18 | %\setClipRegion 8 12 19 | 20 | % Define a region beyond measure borders 21 | %\setClipRegion 198 #'(212 2/4) 22 | 23 | % Compile a single page 24 | %\setClipPage 5 25 | 26 | % Compile a page range 27 | %\setClipPageRange 4 5 28 | 29 | % Negative page range triggers a warning 30 | %\setClipPageRange 5 3 31 | 32 | % Non-existent pages result in errors 33 | \setClipPageRange 3 123 34 | %\setClipPage -2 35 | 36 | 37 | \score { 38 | \new Staff \music 39 | } 40 | 41 | -------------------------------------------------------------------------------- /ly/comptools/unit-tests/partial-compilation-07.ly: -------------------------------------------------------------------------------- 1 | % Test matrix for partial compilation module 2 | 3 | \version "2.18.0" 4 | 5 | \include "openlilylib" 6 | \useLibrary comptools 7 | \useModule comptools.partial-compilation 8 | 9 | #(display "") 10 | 11 | \include "../usage-examples/comptools-test-data.ily" 12 | 13 | % Uncomment the following commands to test different partial regions. 14 | % Multiple (non-overlapping) regions can be set, although the results 15 | % may not be acceptable. 16 | 17 | % Define a region with barnumbers 18 | %\setClipRegion 8 12 19 | 20 | % Define a region beyond measure borders 21 | %\setClipRegion 198 #'(212 2/4) 22 | 23 | % Compile a single page 24 | %\setClipPage 5 25 | 26 | % Compile a page range 27 | %\setClipPageRange 4 5 28 | 29 | % Negative page range triggers a warning 30 | %\setClipPageRange 5 3 31 | 32 | % Non-existent pages result in errors 33 | %\setClipPageRange 3 123 34 | \setClipPage -2 35 | 36 | 37 | \score { 38 | \new Staff \music 39 | } 40 | 41 | -------------------------------------------------------------------------------- /ly/comptools/usage-examples/comptools-test-data.ily: -------------------------------------------------------------------------------- 1 | 2 | \version "2.18.0" 3 | 4 | % Consider openLilyLib to be included already. 5 | 6 | % Define a list with original page breaks (barnumbers) 7 | % Entries can also be a list with barnumber and fraction 8 | % Also available: line-breaks and page-turns 9 | \setOption comptools.page-breaks #'(20 37 52 66 83 91) 10 | 11 | music = \relative c' { 12 | \time 4/2 13 | \repeat unfold 100 { 14 | c2 d \bar "" e4 d8 c d4 e 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ly/comptools/usage-examples/conditional-breaks.ly: -------------------------------------------------------------------------------- 1 | % Demonstrate the use of the clip-regions module 2 | 3 | \version "2.18.0" 4 | 5 | \include "openlilylib" 6 | 7 | %\setOption global.loglevel #oll-loglevel-log 8 | \useLibrary comptools 9 | 10 | %\loadModule "comptools/partial-compilation.ily" 11 | %\registerOption documentation.include-file "comptools/conditional-breaks.ily" 12 | %\loadModule "_internal/doc-include/usage-example.ily" 13 | \useModule comptools.conditional-breaks 14 | 15 | % Workaround for \useModule bug 16 | #(display "") 17 | 18 | % Define a set with original breaks (barnumbers) 19 | % Entries can also be a list with barnumber and fraction 20 | 21 | % Register one set and (optionally) define lists with breaks 22 | \registerBreakSet #'conditional-breaks-example 23 | \setConditionalBreaks conditional-breaks-example line-breaks #'(7 12 22 25 26 (29 2/4) 34 40 56) 24 | \setConditionalBreaks conditional-breaks-example page-breaks #'(48 125) 25 | \setConditionalBreaks conditional-breaks-example page-turns #'(85) 26 | 27 | % Register a second set but only define line breaks. 28 | % The default use case is to specify breaking patterns for different manuscrips you're working with. 29 | \registerBreakSet #'alternative-example 30 | \setConditionalBreaks alternative-example line-breaks #'(8 15 25 (29 2/4) 32) 31 | 32 | % Set the following options to ##f and ##t to see the different results 33 | \setOption comptools.conditional-breaks.use.line-breaks ##t 34 | \setOption comptools.conditional-breaks.use.page-breaks ##f 35 | \setOption comptools.conditional-breaks.use.page-turns ##t 36 | 37 | % Apply the breaks sets *after* all options have been set. 38 | % Usually you will want to use only one of the break sets (i.e. comment out the other one), 39 | % but they apply in addition, so you can also use different break sets for designing 40 | % complex breaking structures 41 | \applyConditionalBreaks conditional-breaks-example 42 | %\applyConditionalBreaks alternative-example 43 | 44 | % Some music, allowing mid-measure breaks 45 | music = \relative c' { 46 | \repeat unfold 160 { 47 | c d \bar "" e d 48 | } 49 | } 50 | 51 | \score { 52 | \new Staff \music 53 | } 54 | 55 | -------------------------------------------------------------------------------- /ly/comptools/usage-examples/partial-compilation.ly: -------------------------------------------------------------------------------- 1 | % Demonstrate the use of the clip-regions module 2 | 3 | \version "2.18.0" 4 | 5 | \include "openlilylib" 6 | %\setOption global.loglevel #oll-loglevel-log 7 | \useLibrary comptools 8 | 9 | %\registerOption documentation.include-file "comptools/partial-compilation.ily" 10 | %\loadModule "_internal/doc-include/usage-example.ily" 11 | 12 | \useModule comptools.partial-compilation 13 | 14 | % Workaround for \useModule bug 15 | #(display "") 16 | 17 | \include "comptools-test-data.ily" 18 | 19 | % Uncomment the following commands to test different partial regions. 20 | % Multiple (non-overlapping) regions can be set, although the results 21 | % may not be acceptable. 22 | 23 | % Define a region with barnumbers 24 | %\setClipRegion 8 12 25 | 26 | % Define a region beyond measure borders 27 | %\setClipRegion 65 #'(87 2/2) 28 | 29 | % Compile a single page 30 | %\setClipPage 5 31 | 32 | % Compile a page range 33 | %\setClipPageRange 4 5 34 | 35 | % Negative page range triggers a warning 36 | %\setClipPageRange 5 3 37 | 38 | % Non-existent pages result in errors 39 | %\setClipPageRange 3 123 40 | %\setClipPage -2 41 | 42 | 43 | \score { 44 | \new Staff \music 45 | } 46 | 47 | -------------------------------------------------------------------------------- /ly/gridly/__init__.ily: -------------------------------------------------------------------------------- 1 | \version "2.18.2" 2 | 3 | %% gridly - simple segmented grid for LilyPond 4 | %% Copyright (C) 2015 - Matteo Ceccarello 5 | %% 6 | %% This program is free software: you can redistribute it and/or modify 7 | %% it under the terms of the GNU General Public License as published by 8 | %% the Free Software Foundation, either version 3 of the License, or 9 | %% (at your option) any later version. 10 | %% 11 | %% This program is distributed in the hope that it will be useful, 12 | %% but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | %% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | %% GNU General Public License for more details. 15 | %% 16 | %% You should have received a copy of the GNU General Public License 17 | %% along with this program. If not, see . 18 | 19 | 20 | %%% Initialization of the GridLY library 21 | 22 | #(define gridly-version "0.6.0") 23 | 24 | %%% The association list holding all the music. 25 | #(if (not (defined? 'music-grid)) 26 | (define music-grid #f)) 27 | 28 | %%% Information that needs to be set up using \initMusicGrid 29 | #(if (not (defined? 'music-grid-meta)) 30 | (define music-grid-meta #f)) 31 | 32 | %%% Default segment range to the whole grid 33 | \registerOption gridly.segment-range #'all 34 | 35 | \void #(oll:log "Initialized GridLY version ~a" gridly-version) 36 | -------------------------------------------------------------------------------- /ly/gridly/usage-examples/.automated-tests-exclude: -------------------------------------------------------------------------------- 1 | multi-file/global.ily 2 | -------------------------------------------------------------------------------- /ly/gridly/usage-examples/.automated-tests-include: -------------------------------------------------------------------------------- 1 | multi-file/parts/alto-I.ily 2 | multi-file/parts/basso-I.ily 3 | multi-file/parts/soprano-I.ily 4 | multi-file/parts/tenore-I.ily 5 | -------------------------------------------------------------------------------- /ly/gridly/usage-examples/multi-file/global.ily: -------------------------------------------------------------------------------- 1 | \version "2.18.2" 2 | 3 | \include "openlilylib" 4 | \useLibrary gridly 5 | 6 | \gridInit #1 #'("marks" "soprano" "alto" "tenore" "basso") 7 | 8 | \gridSetSegmentTemplate #1 9 | \with { 10 | lyrics = \lyricmode { Ooo } 11 | music = \relative c { 12 | s1 | 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /ly/gridly/usage-examples/multi-file/main.ly: -------------------------------------------------------------------------------- 1 | \version "2.18.2" 2 | 3 | % See global.ily for module loading and initialization 4 | \include "global.ily" 5 | \useModule gridly.grid-templates 6 | 7 | % Workaround for strange bug with \useModule, 8 | % maybe due to the optional argument. 9 | % (we need _something_ Scheme-ish before any LilyPond code) 10 | #(display "") 11 | 12 | \include "parts/soprano-I.ily" 13 | \include "parts/alto-I.ily" 14 | \include "parts/tenore-I.ily" 15 | \include "parts/basso-I.ily" 16 | 17 | \gridDisplay 18 | 19 | \gridCheck 20 | 21 | \score { 22 | \SATBChoir 23 | 24 | \layout {} 25 | \midi {} 26 | } 27 | 28 | \rehearsalMidi {\SATBChoir } "soprano" 29 | 30 | \rehearsalMidi {\SATBChoir } "alto" 31 | 32 | \rehearsalMidi {\SATBChoir } "tenore" 33 | 34 | \rehearsalMidi {\SATBChoir } "basso" 35 | -------------------------------------------------------------------------------- /ly/gridly/usage-examples/multi-file/parts/alto-I.ily: -------------------------------------------------------------------------------- 1 | \version "2.18.2" 2 | 3 | \include "../global.ily" 4 | 5 | \gridPutMusic "alto" 1 6 | \relative c' { 7 | e1 | 8 | } 9 | 10 | \gridCompileCell "alto" 1 11 | -------------------------------------------------------------------------------- /ly/gridly/usage-examples/multi-file/parts/basso-I.ily: -------------------------------------------------------------------------------- 1 | \version "2.18.2" 2 | 3 | \include "../global.ily" 4 | 5 | \gridPutMusic "basso" 1 6 | \relative c { 7 | \clef "bass" 8 | c1 | 9 | \bar "|." 10 | } 11 | 12 | \gridCompileCell "basso" 1 13 | 14 | 15 | -------------------------------------------------------------------------------- /ly/gridly/usage-examples/multi-file/parts/soprano-I.ily: -------------------------------------------------------------------------------- 1 | \version "2.18.2" 2 | 3 | \include "../global.ily" 4 | 5 | \gridPutMusic "soprano" 1 6 | \relative c'' { 7 | g1 | 8 | } 9 | 10 | \gridCompileCell "soprano" 1 11 | -------------------------------------------------------------------------------- /ly/gridly/usage-examples/multi-file/parts/tenore-I.ily: -------------------------------------------------------------------------------- 1 | \version "2.18.2" 2 | 3 | \include "../global.ily" 4 | 5 | \gridPutMusic "tenore" 1 6 | \relative c' { 7 | \clef "violin_8" 8 | c1 | 9 | } 10 | 11 | \gridCompileCell "tenore" 1 12 | -------------------------------------------------------------------------------- /ly/gridly/usage-examples/opening-lyrics.ly: -------------------------------------------------------------------------------- 1 | \version "2.18.2" 2 | 3 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4 | %%% 5 | %%% Gridly example: opening lyrics 6 | %%% ============================== 7 | %%% 8 | %%% 9 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10 | 11 | %%% The usual includes and module loading 12 | \include "openlilylib" 13 | \useLibrary "gridly" 14 | 15 | %%% Initialize the grid: three segments for a single part 16 | \gridInit 2 #'("voice") 17 | 18 | %%% Fill the grid with music. In the `with` clause you can specify the 19 | %%% opening, the closing and their lyrics 20 | \gridPutMusic "voice" 1 21 | \with { 22 | closing = \relative c' { c } 23 | lyrics = \lyricmode { This is a test } 24 | music = \relative c' { 25 | \key c \major 26 | c e g c, ~ | 27 | } 28 | } 29 | 30 | \gridPutMusic "voice" 2 31 | \with { 32 | opening = \relative c' { \partial 4 c4 ~ } 33 | opening-lyrics = \lyricmode { test } 34 | lyrics = \lyricmode { a simple test! } 35 | music = \relative c' { 36 | c d b c | 37 | } 38 | } 39 | 40 | \gridCompileCell "voice" 1 41 | \gridCompileCell "voice" 2 42 | 43 | \gridSetRange #'all 44 | 45 | \score { 46 | << 47 | \new Voice = "test" { \gridGetMusic "voice" } 48 | \new Lyrics \lyricsto "test" { \gridGetLyrics "voice" } 49 | >> 50 | 51 | \layout {} 52 | } 53 | -------------------------------------------------------------------------------- /ly/gridly/usage-examples/transpose.ly: -------------------------------------------------------------------------------- 1 | \version "2.18.2" 2 | 3 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4 | %%% 5 | %%% Gridly example: transposition 6 | %%% ============================= 7 | %%% 8 | %%% This file illustrates the usage of the transposition option in 9 | %%% gridly. This shows how to leverage the `transposeKey` option to 10 | %%% write the part for a clarinet in A. 11 | %%% 12 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 13 | 14 | %%% The usual includes and module loading 15 | \include "openlilylib" 16 | \useLibrary "gridly" 17 | 18 | %%% Initialize the grid: three segments for a single part 19 | \gridInit 3 #'("clarinet") 20 | 21 | %%% Fill the grid with music. In the `with` clause you can specify the 22 | %%% transposition key of the cell. 23 | \gridPutMusic "clarinet" 1 24 | \with { 25 | transposeKey = a, 26 | music = \relative c' { 27 | \key c \major 28 | c d e f | 29 | } 30 | } 31 | 32 | %%% Different cells can have different transposition keys 33 | \gridPutMusic "clarinet" 2 34 | \with { 35 | transposeKey = c, 36 | music = \relative c' { 37 | \key c \major 38 | c d e f | 39 | } 40 | } 41 | 42 | 43 | \gridPutMusic "clarinet" 3 44 | \with { 45 | transposeKey = a, 46 | music = \relative c' { 47 | \key c \major 48 | c d e f | 49 | } 50 | } 51 | 52 | 53 | \score { 54 | 55 | %%% The function `gridGetMusic` will wrap each cell in a 56 | %%% `\transpose` block, if a transposeKey is defined. 57 | \gridGetMusic "clarinet" 58 | 59 | \layout {} 60 | } 61 | -------------------------------------------------------------------------------- /ly/openlilylib: -------------------------------------------------------------------------------- 1 | % This is the main entry file for openLilyLib. 2 | % When this is included different libraries and their modules can be loaded using 3 | % the \import command defined here. 4 | 5 | % Including this file also makes available some general helper material that 6 | % is therefore automatically available for any contained library, for example the 7 | % LilyPond version predicates that can be used to create code depending on the 8 | % LilyPond version currently executed 9 | 10 | % Include (once) the basic infrastructure of openLilyLib 11 | % 12 | % This does several things: 13 | % - define a global variable 'openlilylib-root 14 | % which is the absolute path to the root of openLilyLib 15 | % (the folder this file is located in) 16 | % This can be used to construct paths to locations in the 17 | % libraries that are relative to openlilylib-root 18 | % - add this directory to Scheme's module path. Scheme modules 19 | % can now be created and references from this root too. 20 | % - Add module handling support (\loadModule and friends) 21 | % - Add general tools that are available for all libraries. 22 | % - lilypond-version-predicates 23 | % - logging commands 24 | % 25 | % NOTE: There has been a major syntax change in 2.19.22: 26 | % the parser argument is now obsolete with a number of functions, 27 | % e.g. ly:parser-include-string. 28 | % As the lilypond-version-predicates have not been included yet 29 | % we have to hard-code the switch here. 30 | initOpenLilyLib = 31 | #(define-void-function (parser location)() 32 | (if (not (defined? 'openlilylib-options)) 33 | (if (let ((v (ly:version))) 34 | (or (> (first v) 2) 35 | (> (second v) 19) 36 | (>= (third v) 22))) 37 | (ly:parser-include-string 38 | "\\include \"_internal/init-openlilylib.ily\"") 39 | (ly:parser-include-string parser 40 | "\\include \"_internal/init-openlilylib.ily\"") 41 | ))) 42 | \initOpenLilyLib 43 | -------------------------------------------------------------------------------- /ly/scholarly/README.md: -------------------------------------------------------------------------------- 1 | # ScholarLY 2 | 3 | *ScholarLY* is a toolbox for scholarly editions with (mainly) GNU LilyPond. 4 | It belongs to *openLilyLib*, LilyPond's community library system. 5 | Therefore getting and installing *ScholarLY* is automatically handled by 6 | preparing *openLilyLib*. 7 | See its [home page](https://github.com/openlilylib/openlilylib) for details. 8 | 9 | As part of *openLilyLib* this library is released under the 10 | GNU General Public License. See *openLilyLib*'s license for details. 11 | 12 | ## Overview 13 | 14 | *ScholarLY* will include a number of features, but currently only `\annotate` is implemented, 15 | and this can only be seen as a beginning. See the `\annotate`'s [overview](annotate/README.md) 16 | for more information on this functionality. 17 | 18 | ## Getting Started 19 | 20 | Prerequisite to using *ScholarLY* is activating *openLilyLib* with 21 | 22 | ```lilypond 23 | \include "openlilylib" 24 | ``` 25 | 26 | *openLilyLib* will only be initialized once so it is safe to use this command in multiple 27 | initialization files. Loading ScholarLY is done with one of: 28 | 29 | ```lilypond 30 | \loadModule "scholarly" 31 | \loadModule "scholarly/annotate" 32 | ``` 33 | 34 | Once it is running *Scholarly*'s behaviour can be configured using *openLilyLib*'s 35 | global configuration mechanism. Please refer to the manuals of both for more information. 36 | -------------------------------------------------------------------------------- /ly/scholarly/annotate/examples/annotate.annotations.inp: -------------------------------------------------------------------------------- 1 | \annotation 2 | [original-text={}, 3 | arbitrary-calulation={158}, 4 | arbitrary-scheme-list={(1 34 (3 . 2) (quote foo))}, 5 | original-key={Key: #}, 6 | original-time={\time 3/4}, 7 | ossia={#}, 8 | original-music={}, 9 | original-pitch={#}, 10 | number-property={12.3}] 11 | {1}{1} 12 | {Linke Hand} 13 | {Clef} 14 | {See \textbackslash what is \emph{possible}} 15 | {custom-annotation} 16 | 17 | \musicalIssue 18 | [author={Foo Bar}] 19 | {1}{2 1/4} 20 | {right-hand} 21 | {NoteHead} 22 | {Could this be dis?} 23 | 24 | \musicalIssue 25 | {1}{3 1/2} 26 | {examples} 27 | {Hairpin} 28 | {This hairpin is completely unoriginal} 29 | 30 | \lilypondIssue 31 | {1}{4} 32 | {right-hand} 33 | {Script} 34 | {This should be bigger} 35 | 36 | \annotateQuestion 37 | {1}{4} 38 | {Linke Hand} 39 | {Beam} 40 | {Which kind of beaming should we use?} 41 | 42 | -------------------------------------------------------------------------------- /ly/scholarly/diplomatic-line-breaks.ily: -------------------------------------------------------------------------------- 1 | \version "2.17.10" 2 | 3 | \header { 4 | oll-title = "Indicator for original line breaks in diplomatic editions." 5 | oll-short-description = "" 6 | oll-author = "Urs Liska" 7 | oll-description = \markup \wordwrap { 8 | Draw an indicator for original line breaks (but don't apply any break). 9 | It is a common notation to indicate line breaks in the 10 | original source (e.g. when editing sketches and drafts) with such marks. 11 | By default a dashed line is drawn above the staff. 12 | } 13 | oll-usage = \markup \wordwrap { 14 | \typewriter "\\diplomaticLineBreak" can be used at any rhythmic position. 15 | Without configuration it will print a dashed vertical line above the staff. 16 | } 17 | oll-options = #'((root-path . scholarly.diplomatic-line-break 18 | )) 19 | oll-category = "editorial-marks" 20 | % add comma-separated tags to make searching more effective: 21 | oll-tags = "markup,line-breaks" 22 | oll-status = "ready" 23 | oll-todo = "Add more styles (dotted, arrows ...)" 24 | } 25 | 26 | \registerOption scholarly.diplomatic-line-break.thickness 1.6 27 | \registerOption scholarly.diplomatic-line-break.dash-pattern #'(0.25 . 0.15) 28 | \registerOption scholarly.diplomatic-line-break.length 3 29 | \registerOption scholarly.diplomatic-line-break.direction #UP 30 | \registerOption scholarly.diplomatic-line-break.Y-offset 0 31 | 32 | diplomaticLineBreak = { 33 | \once \override Score.RehearsalMark.padding = #0 34 | \once \override Score.RehearsalMark.extra-offset = #`(0 . 35 | ,#{ \getOption scholarly.diplomatic-line-break.Y-offset #}) 36 | \once \override Score.RehearsalMark.direction = \getOption scholarly.diplomatic-line-break.direction 37 | \mark \markup { 38 | \override #`(on . ,(car #{ \getOption scholarly.diplomatic-line-break.dash-pattern #})) 39 | \override #`(off . ,(cdr #{ \getOption scholarly.diplomatic-line-break.dash-pattern #})) 40 | \override #`(thickness . ,#{ \getOption scholarly.diplomatic-line-break.thickness #}) 41 | \draw-dashed-line #`(,0 . ,#{ \getOption scholarly.diplomatic-line-break.length #}) 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /ly/scholarly/usage-examples/annotate.ly: -------------------------------------------------------------------------------- 1 | \version "2.18.0" 2 | 3 | \include "openlilylib" 4 | 5 | \useLibrary ScholarLY 6 | 7 | \useModule scholarly.annotate 8 | 9 | #(display "loaded\n") 10 | 11 | %\registerOption documentation.include-file "scholarly/annotate" 12 | %\loadModule "_internal/doc-include/usage-example.ily" 13 | 14 | \markup \vspace #1 15 | 16 | \setOption scholarly.annotate.export-targets #'("plaintext" "latex") 17 | 18 | music = \relative c'{ 19 | c4 d e 20 | \criticalRemark \with { 21 | message = "Go \"to \textit{school} \vand \noindent{sit back}!" 22 | context = "Some staff" 23 | } 24 | NoteHead 25 | f ( | 26 | g a ) b c 27 | \musicalIssue \with { 28 | message = "Another test" 29 | } 30 | Staff.KeySignature 31 | \key a \major 32 | a d 33 | << 34 | { 35 | \voiceOne 36 | \criticalRemark \with { 37 | message = "go to @\emph{school}@!" 38 | } 39 | Accidental 40 | cis? d 41 | } 42 | \new Voice { 43 | \voiceTwo 44 | ais b 45 | } 46 | >> 47 | \oneVoice 48 | cis d 49 | } 50 | 51 | \score { 52 | \new Staff = "My Staff" \music 53 | } -------------------------------------------------------------------------------- /ly/scholarly/usage-examples/diplomatic-line-breaks.ly: -------------------------------------------------------------------------------- 1 | \version "2.17.10" 2 | 3 | \include "openlilylib" 4 | 5 | \useLibrary scholarly 6 | 7 | %\registerOption documentation.include-file "scholarly/diplomatic-line-breaks.ily" 8 | %\loadModule "_internal/doc-include/usage-example.ily" 9 | 10 | \useModule scholarly.diplomatic-line-breaks 11 | 12 | % The following is necessary because leaving it out would give lots of (strange) syntax errors 13 | #(ly:message "loaded") 14 | 15 | \markup \vspace #1 16 | { 17 | s1*2 \mark \default 18 | s1*2 19 | \diplomaticLineBreak 20 | s1 21 | s2. 22 | \diplomaticLineBreak 23 | s4 24 | s1*2 \mark \default 25 | s1 26 | } -------------------------------------------------------------------------------- /ly/stylesheets/fonts/henle-material/chopin-1.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openlilylib/snippets/63858cdaf121935a6a2d835058bf24e2cea81a5a/ly/stylesheets/fonts/henle-material/chopin-1.tiff -------------------------------------------------------------------------------- /ly/stylesheets/fonts/henle-material/chopin-2.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openlilylib/snippets/63858cdaf121935a6a2d835058bf24e2cea81a5a/ly/stylesheets/fonts/henle-material/chopin-2.tiff -------------------------------------------------------------------------------- /ly/stylesheets/usage-examples/.automated-tests-exclude: -------------------------------------------------------------------------------- 1 | fonts/arnold--berg-opus-5-excerpt.ly 2 | -------------------------------------------------------------------------------- /ly/stylesheets/usage-examples/fonts/beethoven--beethoven-opus-10-3.ly: -------------------------------------------------------------------------------- 1 | \version "2.19.12" 2 | \language "english" 3 | 4 | \include "openlilylib" 5 | \useLibrary stylesheets 6 | \useNotationFont Beethoven 7 | 8 | %TODO: This file includes an ugly mix of Henle stylesheet snippets and a few general 9 | % tools like "bars-per-line-systems-per-page-engraver" that should find their proper 10 | % place in openLilyLib. 11 | \include "beethoven--example-helpers.ily" 12 | 13 | % Include the actual music 14 | % TODO: Move the tweaks to edition-engraver 15 | \include "beethoven--notes.ily" 16 | 17 | 18 | \paper { 19 | page-count = 1 20 | systems-per-page = 6 21 | } 22 | 23 | 24 | \bookpart { 25 | 26 | \header { 27 | title = \markup \override #'(word-space . 1) \line { S O N A T E } 28 | opus = "Opus 10 Nr. 3" 29 | dedication = "Der Gräfin Anna Margarete von Browne gewidmet" 30 | date = "1796/98" 31 | } 32 | 33 | \score { 34 | \new PianoStaff \with { 35 | instrumentName = "7." 36 | } 37 | << 38 | \new Staff << \OpXNoIII_piano_global \OpXNoIII_piano_notes_upper >> 39 | \new Dynamics \OpXNoIII_piano_dynamics 40 | \new Staff << \OpXNoIII_piano_global \OpXNoIII_piano_notes_lower >> 41 | >> 42 | \layout { 43 | \context { 44 | \Score 45 | \consists #(bars-per-line-systems-per-page-engraver '((6*2 5*4))) 46 | \override NonMusicalPaperColumn.line-break-permission = ##f 47 | \override NonMusicalPaperColumn.page-break-permission = ##f 48 | } 49 | } 50 | } 51 | } -------------------------------------------------------------------------------- /ly/stylesheets/usage-examples/fonts/haydn-sonata.preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openlilylib/snippets/63858cdaf121935a6a2d835058bf24e2cea81a5a/ly/stylesheets/usage-examples/fonts/haydn-sonata.preview.png -------------------------------------------------------------------------------- /ly/tablature/__main__.ily: -------------------------------------------------------------------------------- 1 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2 | % % 3 | % This file is part of Tablature, % 4 | % ========= % 5 | % a toolkit library to enhance GNU LilyPond tablature. % 6 | % % 7 | % Tablature is free software: you can redistribute it and/or modify % 8 | % it under the terms of the GNU General Public License as published by % 9 | % the Free Software Foundation, either version 3 of the License, or % 10 | % (at your option) any later version. % 11 | % % 12 | % Tablature is distributed in the hope that it will be useful, % 13 | % but WITHOUT ANY WARRANTY; without even the implied warranty of % 14 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % 15 | % GNU General Public License for more details. % 16 | % % 17 | % You should have received a copy of the GNU General Public License % 18 | % along with Tablature. If not, see . % 19 | % % 20 | % Tablature is maintained by Federico Bruni, fede@inventati.org % 21 | % % 22 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 23 | 24 | \version "2.18.2" 25 | -------------------------------------------------------------------------------- /ly/tablature/usage-examples/microtones.ly: -------------------------------------------------------------------------------- 1 | \version "2.18.2" 2 | 3 | \include "openlilylib" 4 | 5 | \useLibrary Tablature 6 | \useModule tablature.microtones 7 | 8 | % Hack needed until issue #136 is fixed: 9 | % https://github.com/openlilylib/openlilylib/issues/136 10 | #(ly:message "loaded") 11 | 12 | mus = { 13 | geses 14 | geseh 15 | ges 16 | geh 17 | g 18 | gih 19 | gis 20 | gisih 21 | gisis 22 | } 23 | 24 | test-music = 25 | \relative eeh, { 26 | \cadenzaOn 27 | <>^"E" 28 | \transpose g e, 29 | %% exclude `eeses', `eeseh' and `ees' for current string-tuning 30 | $(make-sequential-music 31 | (drop (ly:music-deep-copy (ly:music-property mus 'elements)) 3)) 32 | 33 | <>^"F" \bar "||" 34 | \transpose g f, 35 | %% exclude `feses' for current string-tuning 36 | $(make-sequential-music 37 | (drop (ly:music-deep-copy (ly:music-property mus 'elements)) 1)) 38 | 39 | <>^"G" \bar "||" \transpose g g, \mus 40 | <>^"A" \bar "||" \transpose g a, \mus 41 | <>^"B" \bar "||" \transpose g b, \mus 42 | <>^"C" \bar "||" \transpose g c \mus 43 | <>^"D" \bar "||" \transpose g d \mus 44 | <>^"E" \bar "||" \transpose g e \mus 45 | <>^"F" \bar "||" \transpose g f \mus 46 | <>^"G" \bar "||" \transpose g g \mus 47 | <>^"A" \bar "||" \transpose g a \mus 48 | <>^"B" \bar "||" \transpose g b \mus 49 | <>^"C" \bar "||" \transpose g c' \mus 50 | <>^"D" \bar "||" \transpose g d' \mus 51 | <>^"E" \bar "||" \transpose g e' \mus 52 | <>^"F" \bar "||" \transpose g f' \mus 53 | <>^"G" \bar "||" \transpose g g' \mus 54 | <>^"A" \bar "||" \transpose g a' \mus 55 | <>^"B" \bar "||" \transpose g b' \mus 56 | \bar "||" 57 | } 58 | 59 | custom-tuning = \stringTuning 60 | 61 | << 62 | \new Staff << \clef "G_8" \test-music >> 63 | \new TabStaff \with { stringTunings = \custom-tuning } \test-music 64 | >> 65 | -------------------------------------------------------------------------------- /ly/usage-examples/include-pattern-examples/f1.ily: -------------------------------------------------------------------------------- 1 | #(display "include file nr. 1") 2 | #(newline) 3 | -------------------------------------------------------------------------------- /ly/usage-examples/include-pattern-examples/f2.ily: -------------------------------------------------------------------------------- 1 | #(display "include file nr. 2") 2 | #(newline) 3 | -------------------------------------------------------------------------------- /ly/usage-examples/include-pattern-examples/f3.ily: -------------------------------------------------------------------------------- 1 | #(display "include file nr. 3") 2 | #(newline) 3 | -------------------------------------------------------------------------------- /ly/usage-examples/include-pattern.ly: -------------------------------------------------------------------------------- 1 | \version "2.18.0" 2 | 3 | \include "openlilylib" 4 | 5 | % show all includes 6 | \setOption global.loglevel #oll-loglevel-log 7 | \setOption internal.include-pattern.display-includes ##t 8 | 9 | % include all files with pattern (regular expression) 10 | % the file f1.ly to f3.ly simply display a string 11 | % Arguments: 12 | % #1: directory, 13 | % - absolute or 14 | % - relative to the location of the file where it is used 15 | % #2: pattern matching files in that directory 16 | \includePattern "include-pattern-examples" ".*\\.i?ly" 17 | -------------------------------------------------------------------------------- /ly/utility/__init__.ily: -------------------------------------------------------------------------------- 1 | % empty library init file for utility lib. -------------------------------------------------------------------------------- /ly/utility/__main__.ily: -------------------------------------------------------------------------------- 1 | % empty library file for utility lib. -------------------------------------------------------------------------------- /meta/README.md: -------------------------------------------------------------------------------- 1 | This directory is for storing things related to the repository setup itself. 2 | -------------------------------------------------------------------------------- /meta/adding-new-file-github-interface.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openlilylib/snippets/63858cdaf121935a6a2d835058bf24e2cea81a5a/meta/adding-new-file-github-interface.png -------------------------------------------------------------------------------- /meta/editing-pull-request.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openlilylib/snippets/63858cdaf121935a6a2d835058bf24e2cea81a5a/meta/editing-pull-request.png -------------------------------------------------------------------------------- /meta/install-git-hooks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ## Creates a symbolic link for `meta/commit-msg` under the 4 | ## `.git/hooks` directory. 5 | 6 | if [ -e .git/hooks/commit-msg ] 7 | then 8 | echo "Skipping commit-msg hook, already installed" 9 | else 10 | ## See http://stackoverflow.com/questions/4592838/symbolic-link-to-a-hook-in-git 11 | ln -s ../../meta/commit-msg .git/hooks/commit-msg 12 | echo "Done! commit-msg hook installed" 13 | fi 14 | -------------------------------------------------------------------------------- /meta/no-tagline.ily: -------------------------------------------------------------------------------- 1 | \header { 2 | tagline = ##f 3 | } 4 | -------------------------------------------------------------------------------- /meta/snippet-templates/includable-snippet-template/README.md: -------------------------------------------------------------------------------- 1 | Use this template for snippets that define custom commands, functions etc. 2 | Place the snippet in its own directory in the appropriate category, 3 | put all definitions in `.ily` file(s) and the usage example(s) in `.ly` file(s), 4 | so that anyone interested in using the snippet could simply `\include` the `.ily` file. 5 | 6 | If the snippet requires detailed explanations, place them in a `README.md` file 7 | (like this one). If you do this, write a short description in the `.ily` file as well. 8 | Don't duplicate information from `README` or `.ily` files in the usage examples. -------------------------------------------------------------------------------- /meta/snippet-templates/includable-snippet-template/definitions.ily: -------------------------------------------------------------------------------- 1 | \version "2.16.2" % absolutely necessary! 2 | 3 | \header { 4 | snippet-title = "Example snippet" 5 | snippet-author = "John Doe" 6 | snippet-author-email = "john.doe@somewhere.com" 7 | snippet-source = "link to the mailing list archives or a website, if applicable" 8 | snippet-description = \markup { 9 | Briefly describe what the snippet does and how to use it. 10 | } 11 | % add comma-separated tags to make searching more effective: 12 | tags = "" 13 | % is this snippet ready? See meta/status-values.md 14 | status = "" 15 | } 16 | 17 | %%%%%%%%%%%%%%%%%%%%%%%%%% 18 | % here goes the snippet: % 19 | %%%%%%%%%%%%%%%%%%%%%%%%%% 20 | 21 | red = { 22 | % color the next note red 23 | \once \override NoteHead #'color = #red 24 | \once \override Stem #'color = #red 25 | \once \override Flag #'color = #red 26 | } 27 | -------------------------------------------------------------------------------- /meta/snippet-templates/includable-snippet-template/example.ly: -------------------------------------------------------------------------------- 1 | \version "2.16.2" 2 | 3 | \include "./definitions.ily" 4 | 5 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 6 | % This example shows how can be used. 7 | % The implementation of the snippet is in the file 8 | % `definitions.ily`. 9 | % Documentation (if any) should be in `README.md`. 10 | 11 | \markup "Color a note red:" 12 | { 13 | d' \red d'( d') 14 | } 15 | -------------------------------------------------------------------------------- /meta/snippet-templates/simple-snippet-template.ly: -------------------------------------------------------------------------------- 1 | \version "2.16.2" % absolutely necessary! 2 | 3 | \header { 4 | snippet-title = "Example snippet" 5 | snippet-author = "John Doe" 6 | snippet-author-email = "john.doe@somewhere.com" 7 | snippet-source = "link to the mailing list archives or a website, if applicable" 8 | snippet-description = \markup { 9 | Describe what the snippet does and how to use it. 10 | } 11 | % add comma-separated tags to make searching more effective: 12 | tags = "" 13 | % is this snippet ready? See meta/status-values.md 14 | status = "" 15 | } 16 | 17 | 18 | %%%%%%%%%%%%%%%%%%%%%%%%%% 19 | % here goes the snippet: % 20 | %%%%%%%%%%%%%%%%%%%%%%%%%% 21 | 22 | red = { 23 | % color the next note red 24 | \once \override NoteHead #'color = #red 25 | \once \override Stem #'color = #red 26 | \once \override Flag #'color = #red 27 | } 28 | 29 | 30 | %%%%%%%%%%%%%%%%%%% 31 | % usage examples: % 32 | %%%%%%%%%%%%%%%%%%% 33 | 34 | \markup "Color a note red:" 35 | { 36 | d' \red d'( d') 37 | } 38 | -------------------------------------------------------------------------------- /meta/status-values.md: -------------------------------------------------------------------------------- 1 | 2 | "Incomplete" statuses 3 | --------------------- 4 | 5 | In case of "incomplete" statuses, please provide a `TODO` 6 | comment below the status, listing what needs to be done. 7 | 8 | **broken** - this snippet doesn't work with latest 9 | LilyPond development version and needs upgrading. 10 | 11 | **hack** - this code gets something done, but it's ugly and/or 12 | wrong, and may do unexpected things. It should be simplified 13 | or rewritten; it is not recommended to use it as an example 14 | of LilyPond code. 15 | 16 | **unfinished** - this snippet is a work-in-progress. 17 | 18 | **unknown** - this snippet needs checking. Maybe it's working 19 | as desired, but maybe not. 20 | 21 | **undocumented** - this snippet is missing description and/or 22 | usage examples, but otherwise it is complete and working. 23 | 24 | 25 | "Finished" statuses 26 | ------------------- 27 | 28 | (every snippet should eventually reach one of these) 29 | 30 | **ready** - this snippet does what it is supposed to do. 31 | It may be further improved in the future, but there is 32 | nothing wrong with current code. 33 | 34 | **buggy** - this snippet is finished (i.e. the code is 35 | complete and it works), but there are known problems (for example 36 | caused by LilyPond bugs). 37 | 38 | **workaround** - this snippet is complete, but due to LilyPond 39 | limitations and/or the nature of the problem, the solution is 40 | flawed in some way (for example a notation element is 'faked'). 41 | 42 | **official** - this snippet represents Recommended LilyPond 43 | Practice. The code is well-written and the solution is 44 | logically and structurally correct (it's not a workaround). 45 | It can be regarded as a good example of how things should be 46 | done in LilyPond. 47 | -------------------------------------------------------------------------------- /meta/todo.md: -------------------------------------------------------------------------------- 1 | * add instructions on how to work with the repo 2 | with something else than github's web interface 3 | 4 | * add instructions for "uploading" png files 5 | 6 | * add info about branching (when we will have some policy) 7 | 8 | * decide on licensing 9 | 10 | * document generate-pngs.sh 11 | 12 | * mention some cool stuff that may not be obvious to some people: 13 | * that you can easily link to files and folders 14 | 15 | Merge other useful lily repositories, for example: 16 | * https://github.com/mwitmer/LyUtil 17 | * https://github.com/jpvoigt/lalily 18 | * orchestrallily 19 | * i think that we should gather together various lilypond 20 | repositories under the banner of OpenLilyLib. For example 21 | * https://github.com/dliessi/ports 22 | 23 | * "input-shorthands" isn't a very good name either. 24 | -------------------------------------------------------------------------------- /notation-snippets/README.md: -------------------------------------------------------------------------------- 1 | All snippets that produce notation elements, or move them 2 | (as opposed to `input-shorthands`, which are about making 3 | it easier to write LilyPond code) -- and don't fit in the 4 | other categories -- go here. 5 | -------------------------------------------------------------------------------- /notation-snippets/adjust-horizontal-spacing/definitions.ily: -------------------------------------------------------------------------------- 1 | #(ly:set-option 'relative-includes #t) 2 | \include "../../deprecate.ily" 3 | \ollSnippetsIncludeHint #(*location*) 4 | \include "module.ily" 5 | -------------------------------------------------------------------------------- /notation-snippets/adjust-horizontal-spacing/example.ly: -------------------------------------------------------------------------------- 1 | \version "2.16.2" 2 | 3 | \include "oll-core/package.ily" 4 | \loadModule snippets.notation-snippets.adjust-horizontal-spacing 5 | %\include "definitions.ily" 6 | 7 | %%%%%%%%%%%%%%%%%%%%%%%%%% 8 | % usage example: % 9 | %%%%%%%%%%%%%%%%%%%%%%%%%% 10 | 11 | music = \relative c { 12 | \clef "bass" 13 | \key d \minor 14 | \time 3/4 15 | \mergeDifferentlyDottedOn 16 | << 17 | { \slurDashed d8.-\flageolet( e16) e4.-\trill( d16 e) } 18 | \\ 19 | { d4_2 a2 } 20 | >> 21 | \slurDashed 22 | 4. e8( d c) 23 | \slurSolid 24 | bes8 g' f e16( f g_1 a_2 bes_3 d,_2) 25 | } 26 | 27 | \markup { \smaller \typewriter "\horizontalSpacingTight" } 28 | \new Staff { 29 | \horizontalSpacingTight 30 | \music 31 | \horizontalSpacingLoose 32 | \music 33 | } 34 | 35 | \markup { \smaller \typewriter "\stretchHorizontalSpacing #-0.5" } 36 | \new Staff { 37 | \stretchHorizontalSpacing #-0.5 38 | \music 39 | } 40 | \markup "Default spacing:" 41 | \new Staff { 42 | \music 43 | } 44 | 45 | \markup { \smaller \typewriter "\stretchHorizontalSpacing #0.5" } 46 | \new Staff { 47 | \stretchHorizontalSpacing #0.5 48 | \music 49 | } 50 | 51 | \markup { \smaller \typewriter "\horizontalSpacingLoose" } 52 | \new Staff { 53 | \horizontalSpacingLoose 54 | \music 55 | } 56 | 57 | -------------------------------------------------------------------------------- /notation-snippets/adjust-horizontal-spacing/example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openlilylib/snippets/63858cdaf121935a6a2d835058bf24e2cea81a5a/notation-snippets/adjust-horizontal-spacing/example.png -------------------------------------------------------------------------------- /notation-snippets/align-lyrics-on-vowels/definitions.ily: -------------------------------------------------------------------------------- 1 | \version "2.16.2" % absolutely necessary! 2 | 3 | \header { 4 | snippet-title = "Aligning lyrics on vowels" 5 | snippet-author = "" 6 | snippet-description = \markup { 7 | Align lyrics so that the vowel will line up with the note. 8 | } 9 | status = "broken, unfinished, undocumented" 10 | % TODO: 11 | % doesn't work with 2.17.25 - fix. 12 | % Find author. 13 | % Document. 14 | % add vowels from other languages (e.g. polish) 15 | % check if it works with different notehead widths, and if the 16 | % vowel is really centered (regardless of glyph width) 17 | 18 | % add comma-separated tags to make searching more effective: 19 | tags = "lyrics, alignment, vowel, vowel alignment" 20 | } 21 | 22 | %%%%%%%%%%%%%%%%%%%%%%%%%% 23 | % here goes the snippet: % 24 | %%%%%%%%%%%%%%%%%%%%%%%%%% 25 | 26 | #(define vowel-set (list->char-set (string->list "AEIOUYÅÄÖaeiouyåäö"))) 27 | 28 | #(define (width grob text-string) 29 | (let* ( 30 | (layout (ly:grob-layout grob)) 31 | (props (ly:grob-alist-chain grob (ly:output-def-lookup layout 'text-font-defaults)))) 32 | (cdr (ly:stencil-extent (ly:text-interface::interpret-markup layout props (markup text-string)) X)))) 33 | 34 | #(define (center-on-vowel grob) 35 | (let* ((syllable (ly:grob-property-data grob 'text)) 36 | (vowel-count (string-count syllable vowel-set)) 37 | (vowel-position (string-index syllable vowel-set)) 38 | (prevowel (substring syllable 0 vowel-position)) 39 | (vowel (substring syllable vowel-position (+ vowel-position 1))) 40 | (prevowel-width (width grob prevowel)) 41 | (vowel-width (width grob vowel)) 42 | (note-width (interval-length (ly:grob-property 43 | (ly:grob-parent grob X) 44 | 'X-extent)))) 45 | (- (/ (- note-width vowel-width) 2) prevowel-width))) 46 | -------------------------------------------------------------------------------- /notation-snippets/align-lyrics-on-vowels/example.ly: -------------------------------------------------------------------------------- 1 | \version "2.16.2" % absolutely necessary! 2 | 3 | \include "definitions.ily" 4 | 5 | %%%%%%%%%%%%%%%%%%%%%%%%%% 6 | % usage example: % 7 | %%%%%%%%%%%%%%%%%%%%%%%%%% 8 | 9 | chant = 10 | 11 | \relative c'' { 12 | 13 | c4 c4 c4 c4 c4 c4 c4 c4 c4 a2 \bar "|" 14 | c4 c4 c4 \break 15 | 16 | c4 c4 c4 c4 17 | a4 a2 \bar "|" 18 | c4 c4 c4 c4 c4 c4 c4 c2 \break 19 | 20 | c4 b4 a4 c4 c2 \bar "|" 21 | c4 c4 c4 c4 c4 c4 c4 c2 \bar "|" 22 | \break 23 | 24 | } 25 | 26 | words = \lyricmode { 27 | \set stanza = "℣." Lat mig pri -- sa dig he -- li -- ga Jung -- fru. \set stanza = "℟." Ge mig kraft 28 | mot di -- na fi -- en -- der. 29 | \set stanza = "℣." Hell dig Mar -- i -- a, full av nad, Herren _ ar med dig 30 | \set stanza = "℟." Val -- sign -- ad ar du bland kvin -- nor, 31 | } 32 | 33 | \score { 34 | \new Staff 35 | 36 | << 37 | \new Voice = "melody" \chant 38 | \new Lyrics \lyricsto "melody" \words 39 | >> 40 | 41 | \layout { 42 | 43 | \context { 44 | \Score 45 | \remove "Time_signature_engraver" 46 | timing = ##t 47 | \override Stem #'transparent = ##t 48 | } 49 | 50 | \context { 51 | \Staff 52 | \override StaffSymbol #'line-count = #4 53 | \remove "Time_signature_engraver" 54 | \remove "Bar_engraver" 55 | } 56 | \context { 57 | \Voice 58 | \override Stem #'length = #0 59 | \override TextScript #'font-shape = #'italic 60 | \override TextScript #'font-series = #'bold 61 | } 62 | 63 | \context { 64 | \Lyrics 65 | \override LyricText #'X-offset = #center-on-vowel 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /notation-snippets/align-lyrics-on-vowels/example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openlilylib/snippets/63858cdaf121935a6a2d835058bf24e2cea81a5a/notation-snippets/align-lyrics-on-vowels/example.png -------------------------------------------------------------------------------- /notation-snippets/aligning-first-lyric-syllables/definitions.ily: -------------------------------------------------------------------------------- 1 | #(ly:set-option 'relative-includes #t) 2 | \include "../../deprecate.ily" 3 | \ollSnippetsIncludeHint #(*location*) 4 | \include "module.ily" 5 | -------------------------------------------------------------------------------- /notation-snippets/aligning-first-lyric-syllables/example.ly: -------------------------------------------------------------------------------- 1 | \version "2.16.2" 2 | 3 | \include "oll-core/package.ily" 4 | \loadModule snippets.notation-snippets.aligning-first-lyric-syllables 5 | %\include "definitions.ily" 6 | 7 | %%%%%%%%%%%%%%%%%%%%% 8 | % USAGE EXAMPLE % 9 | %%%%%%%%%%%%%%%%%%%%% 10 | 11 | % a shorthand for tagging: 12 | 13 | tagIt = \once \override Lyrics.LyricText #'tagged = ##t 14 | 15 | \layout { 16 | ragged-right = ##f 17 | \context { 18 | \Lyrics 19 | \override LyricText #'X-offset = #X-offset-callback 20 | } 21 | \context { 22 | \Score 23 | \consists #Lyric_text_align_engraver 24 | } 25 | } 26 | 27 | \score { 28 | \new Staff << 29 | \new Voice = A { 30 | \relative c' { 31 | c d e2 \bar "|." 32 | } 33 | } 34 | \new Lyrics \lyricsto A { 35 | \tagIt Do -- mi -- nus, 36 | } 37 | 38 | \new Lyrics \lyricsto A { 39 | Cant -- a me 40 | } 41 | \new Lyrics \lyricsto A { 42 | Syll -- a -- bum! 43 | } 44 | >> 45 | } 46 | -------------------------------------------------------------------------------- /notation-snippets/alternating-time-signatures/alternatingTimeSignatures.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openlilylib/snippets/63858cdaf121935a6a2d835058bf24e2cea81a5a/notation-snippets/alternating-time-signatures/alternatingTimeSignatures.png -------------------------------------------------------------------------------- /notation-snippets/alternating-time-signatures/definitions.ily: -------------------------------------------------------------------------------- 1 | #(ly:set-option 'relative-includes #t) 2 | \include "../../deprecate.ily" 3 | \ollSnippetsIncludeHint #(*location*) 4 | \include "module.ily" 5 | -------------------------------------------------------------------------------- /notation-snippets/alternating-time-signatures/gould-interch.ly: -------------------------------------------------------------------------------- 1 | \version "2.19.6" 2 | 3 | % Goulds recommendation for interchangeable metres 4 | % with one of her examples. 5 | 6 | add-interch-ts = 7 | #(define-scheme-function (parser location ic-ts) 8 | (list?) 9 | (lambda (grob) 10 | (ly:stencil-combine-at-edge 11 | (ly:time-signature::print grob) 0 1 12 | (parenthesize-stencil 13 | (grob-interpret-markup grob 14 | #{ \markup \number \override #'(baseline-skip . 0) 15 | \column { #(map number->string ic-ts) } #}) 16 | 0.1 0.4 0.4 0.1) 0))) 17 | 18 | \relative c'' { 19 | \time 6/8 20 | c4. c8 c c 21 | \once\override Staff.TimeSignature.stencil = \add-interch-ts #'(3 4) 22 | \time 9/8 23 | c4. c8 c c c4 c8 24 | \omit Score.TimeSignature 25 | \time 3/4 26 | c8 c c c c4 27 | } 28 | 29 | -------------------------------------------------------------------------------- /notation-snippets/alternating-time-signatures/gould-sketch.ly: -------------------------------------------------------------------------------- 1 | \version "2.19.6" 2 | 3 | gould-irreg-alt-metres = 4 | #(define-scheme-function (parser location timesignI timesignII) 5 | (list? list?) 6 | (lambda (grob) 7 | (grob-interpret-markup grob 8 | #{ \markup \number \override #'(baseline-skip . 0) 9 | { 10 | \column { #(map number->string timesignI) } 11 | \override #'(thickness . 3.6) 12 | \draw-line #'(-1.1 . 0) 13 | \column { #(map number->string timesignII) } 14 | } #}))) 15 | 16 | \relative c'' { 17 | \once\override Staff.TimeSignature.stencil = 18 | \gould-irreg-alt-metres #'(5 8) #'(6 8) 19 | c1 20 | } 21 | 22 | -------------------------------------------------------------------------------- /notation-snippets/compound-slurs/example-flat-slur.ly: -------------------------------------------------------------------------------- 1 | \version "2.19.48" 2 | 3 | \include "oll-core/package.ily" 4 | \loadModule snippets.notation-snippets.compound-slurs 5 | %\include "compound-slurs.ily" 6 | 7 | 8 | \paper { 9 | indent = 0 10 | ragged-last = ##f 11 | markup-system-spacing.minimum-distance = 35 12 | } 13 | 14 | \header { 15 | title = "Compound Slurs" 16 | subtitle = "Flat slurs using openLilyLib/snippets" 17 | } 18 | 19 | flatSlur = 20 | \compoundSlur \with { 21 | show-grid = ##f 22 | start-angle = 45 23 | end-angle = -45 24 | 25 | inflection = 26 | #'((X-ratio . .1) 27 | (Y-offset . 5) 28 | ) 29 | 30 | inflection = 31 | #'((X-ratio . .9) 32 | (Y-offset . 5) 33 | (angle . 0) 34 | ) 35 | } 36 | 37 | \relative c'' { 38 | c \flatSlur 39 | g' g g 40 | \repeat unfold 12 g 41 | g g g c, ) 42 | } 43 | -------------------------------------------------------------------------------- /notation-snippets/compound-slurs/example-straight.ly: -------------------------------------------------------------------------------- 1 | \version "2.19.48" 2 | 3 | \include "oll-core/package.ily" 4 | \loadModule snippets.notation-snippets.compound-slurs 5 | %\include "compound-slurs.ily" 6 | 7 | 8 | \paper { 9 | indent = 0 10 | ragged-last = ##f 11 | markup-system-spacing.minimum-distance = 25 12 | score-markup-spacing.minimum-distance = 12 13 | page-count = 1 14 | } 15 | 16 | \header { 17 | title = "Compound Slurs With Straight Segments" 18 | subtitle = "Using openLilyLib/snippets" 19 | } 20 | 21 | straight = 22 | ^\compoundSlur \with { 23 | % annotate = ##t 24 | %show-grid = ##t 25 | 26 | start-angle = 60 27 | end-angle = 60 28 | start-ratio = 0.25 29 | end-ratio = 0.3 30 | inflection = 31 | #'((X-ratio . .15) 32 | (Y-offset . 10) 33 | (ratio-left . .5) 34 | (angle . straight) 35 | ) 36 | 37 | 38 | inflection = 39 | #'((X-ratio . .5) 40 | (Y-offset . 10) 41 | (ratio-right . .8) 42 | (angle . 0) 43 | ) 44 | 45 | inflection = 46 | #'((X-ratio . .6) 47 | (Y-offset . 0) 48 | (ratio-left . .5) 49 | ; (angle . straight) 50 | ) 51 | 52 | inflection = 53 | #'((X-ratio . .4) 54 | (Y-offset . -20) 55 | (angle . 0) 56 | ) 57 | } 58 | 59 | 60 | music = \relative c''' { 61 | c -\straight 62 | b a g f e d 63 | c b a g f e d 64 | c d e f g a b 65 | c d e f g a b ) 66 | } 67 | 68 | \score { 69 | \new Staff \music 70 | } -------------------------------------------------------------------------------- /notation-snippets/compound-slurs/example-weird-and-scale.ly: -------------------------------------------------------------------------------- 1 | \version "2.19.48" 2 | 3 | \include "oll-core/package.ily" 4 | \loadModule snippets.notation-snippets.compound-slurs 5 | %\include "compound-slurs.ily" 6 | 7 | 8 | \paper { 9 | indent = 0 10 | ragged-last = ##f 11 | markup-system-spacing.minimum-distance = 15 12 | score-markup-spacing.minimum-distance = 12 13 | page-count = 1 14 | } 15 | 16 | \header { 17 | title = "Compound Slurs" 18 | subtitle = "Using openLilyLib/snippets" 19 | } 20 | 21 | weird= 22 | #(define-event-function (ann? end-x end-y)((boolean?) number? number?) 23 | #{ 24 | ^\compoundSlur \with { 25 | annotate = #ann? 26 | show-grid = #ann? 27 | start-ratio = 0.6 28 | end-point = #`(,end-x . ,end-y) 29 | 30 | inflection = 31 | #'((X-ratio . .25) 32 | (Y-offset . 8) 33 | ) 34 | 35 | inflection = 36 | #'((X-ratio . .15) 37 | (label . "A") 38 | ) 39 | 40 | inflection = 41 | #'((X-ratio . .5) 42 | (Y-offset . 11) 43 | ) 44 | 45 | inflection = 46 | #'((X-ratio . .65) 47 | (Y-offset . 8) 48 | (angle . -30) 49 | (ratio-left . .6) 50 | (label . "B") 51 | ) 52 | 53 | inflection = 54 | #'((X-ratio . .25) 55 | (Y-offset . -5) 56 | (angle . 45) 57 | ) 58 | 59 | 60 | } 61 | #}) 62 | 63 | example = 64 | #(define-scheme-function (ann? end-x end-y)((boolean?) number? number?) 65 | #{ 66 | \score { 67 | \new Staff 68 | 69 | \relative c''' { 70 | c -\weird #ann? #end-x #end-y 71 | b a g f e d 72 | c b a g f e d 73 | c d e f g a b 74 | c d e f g a b ) 75 | } 76 | } 77 | #}) 78 | 79 | \markup \vspace #9 80 | 81 | \markup "Default" 82 | \example ##t 0 0 83 | 84 | \markup \vspace #7 85 | 86 | \markup "Raise by 5" 87 | \example 0 5 88 | 89 | \markup "Raise by 15 and left by 30" 90 | \example #-30 15 91 | 92 | \markup "Lower by 10" 93 | \example 0 #-10 94 | -------------------------------------------------------------------------------- /notation-snippets/divisi/definitions.ily: -------------------------------------------------------------------------------- 1 | #(ly:set-option 'relative-includes #t) 2 | \include "../../deprecate.ily" 3 | \ollSnippetsIncludeHint #(*location*) 4 | \include "module.ily" 5 | -------------------------------------------------------------------------------- /notation-snippets/divisi/example.ly: -------------------------------------------------------------------------------- 1 | \version "2.19.13" 2 | 3 | \include "oll-core/package.ily" 4 | \loadModule snippets.notation-snippets.divisi 5 | %\include "definitions.ily" 6 | 7 | \layout { 8 | short-indent = 2\cm 9 | indent = 2\cm 10 | line-width = 10\cm 11 | } 12 | 13 | music = { 14 | \together 15 | c'4 d' e' f' 16 | << 17 | \tag#'score { s_\markup\italic "balance with winds" } 18 | \sharedStems 19 | { a'4 f' a' g' } 20 | { f' d' f' e' } 21 | >> 22 | \voiceDivisi { 23 | g' b' d' b' 24 | d'' b' g' b'-\tag#'part \upbow 25 | } 26 | { 27 | g'4 e' g' e' 28 | b' g' b' g'-\tag#'part \upbow 29 | } 30 | << 31 | \tag#'editorial {s4\< s s s\f } 32 | \tag#'score { s_\markup\italic "balance " } 33 | \staffDivisi 34 | { g' q b' } 35 | { a' a' q } 36 | >> 37 | \together 38 | c' d' e' f' 39 | \soloI { g' b' d' b' } 40 | \together 41 | 42 | f' e' d' c' 43 | } 44 | 45 | \markup \bold { Violin I part: } 46 | \new Staff \with { 47 | instrumentName = "Violin I" 48 | shortInstrumentName = "V I" 49 | } \keepWithTag divI.editorial.part \music 50 | 51 | \markup \bold { Violin II part: } 52 | \new Staff \with { 53 | instrumentName = "Violin II" 54 | shortInstrumentName = "V II" 55 | } \keepWithTag divII.editorial.part \music 56 | 57 | \markup \bold { Combined: } 58 | \keepWithTag editorial.score \divisibleStaff "Violin" \music 59 | -------------------------------------------------------------------------------- /notation-snippets/fill-line-evenly/definitions.ily: -------------------------------------------------------------------------------- 1 | #(ly:set-option 'relative-includes #t) 2 | \include "../../deprecate.ily" 3 | \ollSnippetsIncludeHint #(*location*) 4 | \include "module.ily" 5 | -------------------------------------------------------------------------------- /notation-snippets/fill-line-evenly/example.ly: -------------------------------------------------------------------------------- 1 | 2 | \include "oll-core/package.ily" 3 | \loadModule snippets.notation-snippets.fill-line-evenly 4 | %\include "definitions.ily" 5 | 6 | \markup \vspace #1 7 | \markup "\fill-line:" 8 | \markup \vspace #1 9 | \markup \fill-line { 10 | foooooooooooooooooooooooooooooooooooooooo bar hi 11 | } 12 | 13 | \markup \vspace #3 14 | \markup "\fill-line-evenly:" 15 | \markup \vspace #1 16 | \markup \fill-line-evenly { 17 | foooooooooooooooooooooooooooooooooooooooo bar hi 18 | } 19 | -------------------------------------------------------------------------------- /notation-snippets/guitar-string-bending/definitions.ily: -------------------------------------------------------------------------------- 1 | #(ly:set-option 'relative-includes #t) 2 | \include "../../deprecate.ily" 3 | \ollSnippetsIncludeHint #(*location*) 4 | \include "module.ily" 5 | -------------------------------------------------------------------------------- /notation-snippets/hairpin-with-text/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openlilylib/snippets/63858cdaf121935a6a2d835058bf24e2cea81a5a/notation-snippets/hairpin-with-text/README.md -------------------------------------------------------------------------------- /notation-snippets/hairpin-with-text/definitions.ily: -------------------------------------------------------------------------------- 1 | #(ly:set-option 'relative-includes #t) 2 | \include "../../deprecate.ily" 3 | \ollSnippetsIncludeHint #(*location*) 4 | \include "module.ily" 5 | -------------------------------------------------------------------------------- /notation-snippets/interchangeable-metres/README.md: -------------------------------------------------------------------------------- 1 | ###Interchangeable metres 2 | In Behind bars p. 174 Gould turns to the topic of interchangeable metres. 3 | 4 | >Use two time signatures for passages that interchange equivalent-beat 5 | simple- and compound-time metres either irregularly or simultaneosly. 6 | 7 | She recommends three alternative time signatures for this: 8 | 2/4 (6/8) or 2/4 / 6/8 or 2/4 = 6/8. (But what she actually uses in her 9 | examples is the first.) 10 | 11 | It was indeed the alternative with the parenthesis that first caught 12 | my attention. But after some more thought I find it potentially 13 | ambigous. I would rather use the parenthesis for e g a passage 14 | that is quite undetermined between 3/4 and 6/8. 15 | ![Excerpt from Leonard Bernstein: America, West Side Story](./america.png) 16 | *Excerpt from Leonard Bernstein: "America", West Side Story* 17 | 18 | I would instead recommend the use of the equal sign which I think is 19 | the clearest of the three alternatives. 20 | 21 | I don't think I'll find use for this myself therefore I leave it in an 22 | unfinished state in the hope that someone will find something useful 23 | in all this. 24 | 25 | Peter Bjuhr 26 | May 2014 27 | -------------------------------------------------------------------------------- /notation-snippets/interchangeable-metres/america.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openlilylib/snippets/63858cdaf121935a6a2d835058bf24e2cea81a5a/notation-snippets/interchangeable-metres/america.png -------------------------------------------------------------------------------- /notation-snippets/interchangeable-metres/definitions.ily: -------------------------------------------------------------------------------- 1 | #(ly:set-option 'relative-includes #t) 2 | \include "../../deprecate.ily" 3 | \ollSnippetsIncludeHint #(*location*) 4 | \include "module.ily" 5 | -------------------------------------------------------------------------------- /notation-snippets/interchangeable-metres/examples.ly: -------------------------------------------------------------------------------- 1 | \version "2.18.2" 2 | 3 | \include "oll-core/package.ily" 4 | \loadModule snippets.notation-snippets.interchangeable-metres 5 | %\include "definitions.ily" 6 | 7 | \paper { 8 | bookTitleMarkup = \markup { 9 | \column { 10 | \fill-line { 11 | \fontsize #7 \bold 12 | \fromproperty #'header:snippet-title 13 | } 14 | \vspace #1 15 | \wordwrap { 16 | \fromproperty #'header:snippet-description 17 | } 18 | } 19 | } 20 | } 21 | 22 | 23 | \markup { \vspace #2 \bold { Alternative i: use equal sign } } 24 | \relative c'' { 25 | \time 6/8 26 | c4. c8 c c 27 | \once\override Staff.TimeSignature.stencil = 28 | \add-interch-ts-eqsg #'(3 4) 29 | \time 9/8 30 | c4. c8 c c c4 c8 31 | \omit Score.TimeSignature 32 | \time 3/4 33 | c8 c c c c4 34 | } 35 | 36 | \markup { \bold { Alternative ii: use parenthesis } } 37 | \relative c'' { 38 | \time 6/8 39 | c4. c8 c c 40 | \once\override Staff.TimeSignature.stencil = 41 | \add-interch-ts-prnt #'(3 4) 42 | \time 9/8 43 | c4. c8 c c c4 c8 44 | \omit Score.TimeSignature 45 | \time 3/4 46 | c8 c c c c4 47 | } 48 | 49 | \markup { \bold { Alternative iii: use dash } } 50 | \relative c'' { 51 | \time 6/8 52 | c4. c8 c c 53 | \once\override Staff.TimeSignature.stencil = 54 | \add-interch-ts-dsh #'(3 4) 55 | \time 9/8 56 | c4. c8 c c c4 c8 57 | \omit Score.TimeSignature 58 | \time 3/4 59 | c8 c c c c4 60 | } -------------------------------------------------------------------------------- /notation-snippets/interchangeable-metres/module.ily: -------------------------------------------------------------------------------- 1 | \version "2.18.2" 2 | 3 | \header { 4 | snippet-title = "Interchangeable metres" 5 | snippet-author = "Peter Bjuhr" 6 | snippet-description = \markup { 7 | Implementation of alternatives for interchangeable metres 8 | with exemples (Gould: Behind Bars p 174). 9 | } 10 | % add comma-separated tags to make searching more effective: 11 | tags = "time signature" 12 | % is this snippet ready? See meta/status-values.md 13 | status = "unfinished" 14 | } 15 | 16 | %%%%%%%%%%%%%%%%%%%%%%%%%% 17 | % here goes the snippet: % 18 | %%%%%%%%%%%%%%%%%%%%%%%%%% 19 | 20 | % 2/4=6/8 21 | add-interch-ts-eqsg = 22 | #(define-scheme-function (parser location ic-ts) 23 | (list?) 24 | (lambda (grob) 25 | (ly:stencil-combine-at-edge 26 | (ly:time-signature::print grob) 0 1 27 | (grob-interpret-markup grob 28 | #{ \markup { 29 | \override #'(baseline-skip . 0) \number { 30 | \hspace #0.2 31 | \general-align #Y #0.1 { = } 32 | \hspace #-0.5 33 | \column { #(map number->string ic-ts) } 34 | } 35 | } 36 | #}) 37 | 0 ))) 38 | 39 | % 2/4(6/8) 40 | add-interch-ts-prnt = 41 | #(define-scheme-function (parser location ic-ts) 42 | (list?) 43 | (lambda (grob) 44 | (ly:stencil-combine-at-edge 45 | (ly:time-signature::print grob) 0 1 46 | (parenthesize-stencil 47 | (grob-interpret-markup grob 48 | #{ \markup { 49 | \override #'(baseline-skip . 0) \number { 50 | \hspace #0.1 51 | \column { #(map number->string ic-ts) } 52 | } 53 | } 54 | #}) 55 | 0.1 0.4 0.4 0.1) 0))) 56 | 57 | % 2/4/6/8 58 | add-interch-ts-dsh = 59 | #(define-scheme-function (parser location ic-ts) 60 | (list?) 61 | (lambda (grob) 62 | (ly:stencil-combine-at-edge 63 | (ly:time-signature::print grob) 0 1 64 | (grob-interpret-markup grob 65 | #{ \markup { 66 | \override #'(baseline-skip . 0) \number { 67 | \hspace #0.5 68 | \general-align #Y #0 { / } 69 | \column { 6 8} 70 | } 71 | } 72 | #}) 73 | 0 ))) -------------------------------------------------------------------------------- /notation-snippets/interval-brackets/definitions.ily: -------------------------------------------------------------------------------- 1 | #(ly:set-option 'relative-includes #t) 2 | \include "../../deprecate.ily" 3 | \ollSnippetsIncludeHint #(*location*) 4 | \include "module.ily" 5 | -------------------------------------------------------------------------------- /notation-snippets/interval-brackets/example.ly: -------------------------------------------------------------------------------- 1 | \version "2.16.2" 2 | 3 | \include "oll-core/package.ily" 4 | \loadModule snippets.notation-snippets.interval-brackets 5 | %\include "definitions.ily" 6 | 7 | \markup \bold \huge "Interval Brackets" 8 | 9 | \relative c' { 10 | \override Staff.TimeSignature #'stencil = ##f 11 | \time 32/4 12 | \intervalBracketsOn 13 | c1\tone 14 | d\semiTone 15 | ees\tone 16 | f\tone 17 | g\semiTone 18 | as\threeSemiTone 19 | b!\semiTone c 20 | \bar "|." 21 | \intervalBracketsOff 22 | } 23 | -------------------------------------------------------------------------------- /notation-snippets/lyric-syllable-magnetic-snap/example.ly: -------------------------------------------------------------------------------- 1 | \version "2.18.0" 2 | 3 | \include "./definitions.ily" 4 | 5 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% EXAMPLES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 6 | 7 | << 8 | \new Voice = "foo" \relative c' { 9 | \repeat unfold 16 { a8 b a2 a8 b } 10 | } 11 | \new Lyrics \lyricsto "foo" { 12 | \override Lyrics.LyricWord.after-line-breaking = #(lyric-word-compressor 0) 13 | \override Lyrics.LyricHyphen.minimum-distance = #0 14 | \override Lyrics.LyricSpace.minimum-distance = #1 15 | \repeat unfold 10 { foo } 16 | \repeat unfold 10 { foo -- \markup \caps bar } 17 | \repeat unfold 10 { \markup \bold syl -- la -- ble } 18 | a \markup \with-color #red ran -- \markup \box dom string of mo -- no -- syl -- la -- bic 19 | and mul -- ti -- \markup \fontsize #5 syl -- la -- bic 20 | \markup \bold \underline ver -- \markup \italic bi -- age 21 | \markup { 22 | \stencil #(make-circle-stencil 0.5 0 #f) 23 | } 24 | } 25 | >> 26 | 27 | << 28 | \new Voice = "foo" \relative c' { 29 | \repeat unfold 16 { a8 b a2 a8 b } 30 | } 31 | \new Lyrics \lyricsto "foo" { 32 | \override Lyrics.LyricWord.after-line-breaking = #(lyric-word-compressor 0.4) 33 | \override Lyrics.LyricHyphen.minimum-distance = #0 34 | \override Lyrics.LyricSpace.minimum-distance = #1 35 | \repeat unfold 10 { foo } 36 | \repeat unfold 10 { foo -- \markup \caps bar } 37 | \repeat unfold 10 { \markup \bold syl -- la -- ble } 38 | a ran -- \markup \box dom string of 39 | \wordunderline mo -- no -- syl -- \markup \underline la -- bic 40 | and \wordbox mul -- ti -- \markup \fontsize #5 syl -- la -- \markup \box bic 41 | \wordunderline ver -- \markup \italic bi -- age 42 | \markup { 43 | \stencil #(make-circle-stencil 0.5 0 #f) 44 | } 45 | } 46 | >> 47 | 48 | \layout { 49 | ragged-last = ##t 50 | \context { 51 | \Global 52 | \grobdescriptions #all-grob-descriptions 53 | } 54 | \context { 55 | \Lyrics 56 | \consists \collectlyricwordEngraver 57 | } 58 | } -------------------------------------------------------------------------------- /notation-snippets/manual-partcombine-for-vocal-parts/definitions.ily: -------------------------------------------------------------------------------- 1 | #(ly:set-option 'relative-includes #t) 2 | \include "../../deprecate.ily" 3 | \ollSnippetsIncludeHint #(*location*) 4 | \include "module.ily" 5 | -------------------------------------------------------------------------------- /notation-snippets/manual-partcombine-for-vocal-parts/example.ly: -------------------------------------------------------------------------------- 1 | \version "2.16.2" % absolutely necessary! 2 | 3 | \include "oll-core/package.ily" 4 | \loadModule snippets.notation-snippets.manual-partcombine-for-vocal-parts 5 | %\include "definitions.ily" 6 | 7 | \markup \justify { 8 | WARNING! in 2.17.26 a special NullVoice context was added to LilyPond. 9 | Using NullVoice makes it possible to use "\partcombine" function 10 | with vocal music - this snippet is probably no longer needed. 11 | } 12 | 13 | % Upper voice. Here partcombining instructions should go. 14 | 15 | tenorI = \relative f { 16 | \unison { 17 | r2 c'4\< c 18 | f4. f8\! f2 19 | d2\mf ( c4) c 20 | b4.( a8 g4) g4\dim 21 | a2 22 | } 23 | c2\p 24 | c c 25 | r d4\mf d 26 | e4. g8 g2 27 | \divided { 28 | g4\f(f2 e4~ 29 | e d2 c4~ 30 | c b2 a4~ 31 | a4 g2) 32 | } 33 | \unison { 34 | f4 35 | f4 ( e8 d e4) e 36 | g2 r 37 | } 38 | } 39 | 40 | % lower voice (lyrics are attached to it): 41 | 42 | tenorII = \relative f { 43 | r2 c'4\< c 44 | f4. f8\! f2 45 | d2\mf ( c4) c 46 | b4.( a8 g4) g4\dim 47 | a2 a2\p 48 | a a 49 | r a4\mf a 50 | c4. e8 e2 51 | a,4\f(f' g, e' 52 | a, d g, c~ 53 | c b2 a4~ 54 | a4 g2) 55 | f4 56 | f4 ( e8 d e4) e 57 | g2 r 58 | } 59 | 60 | % shared staff: 61 | 62 | \new Staff = "tenory" { 63 | \dynamicUp 64 | \tupletUp 65 | \clef "treble_8" 66 | \key c \major 67 | \time 2/2 68 | << 69 | \tenorI 70 | \tenorII 71 | >> 72 | } 73 | \addlyrics { 74 | me -- di -- ta -- bi -- tur 75 | sa -- pi -- en -- ti -- am, 76 | Os ju -- sti me -- di -- ta -- bi -- tur 77 | sa -- pi -- en -- ti -- am, 78 | } 79 | -------------------------------------------------------------------------------- /notation-snippets/manual-partcombine-for-vocal-parts/example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openlilylib/snippets/63858cdaf121935a6a2d835058bf24e2cea81a5a/notation-snippets/manual-partcombine-for-vocal-parts/example.png -------------------------------------------------------------------------------- /notation-snippets/manual-partcombine-for-vocal-parts/module.ily: -------------------------------------------------------------------------------- 1 | \version "2.16.2" % absolutely necessary! 2 | 3 | \header { 4 | snippet-title = "Manual partcombine for vocal parts" 5 | snippet-author = "Janek Warchoł" 6 | snippet-description = \markup { 7 | "\partcombine" function cannot handle staves with lyrics. 8 | Here's a workaround for combining two vocal parts. 9 | } 10 | % add comma-separated tags to make searching more effective: 11 | tags = "partcombine, lyrics, vocal" 12 | % is this snippet ready? See meta/status-values.md 13 | status = "undocumented" 14 | %{ 15 | WARNING! in 2.17.26 a special NullVoice context was added to LilyPond. 16 | Using NullVoice makes it possible to use "\partcombine" function 17 | with vocal music - this snippet is probably no longer needed. 18 | %} 19 | } 20 | 21 | %%%%%%%%%%%%%%%%%%%%%%%%%% 22 | % here goes the snippet: % 23 | %%%%%%%%%%%%%%%%%%%%%%%%%% 24 | 25 | unison = 26 | #(define-music-function (parser location music) 27 | (ly:music?) 28 | #{ 29 | \new Devnull { 30 | #music 31 | } 32 | #}) 33 | 34 | divided = 35 | #(define-music-function (parser location music) 36 | (ly:music?) 37 | #{ 38 | \voiceTwo 39 | \new Voice { 40 | \voiceOne 41 | % we don't want duplicates to show: 42 | \override Hairpin #'stencil = ##f 43 | \override DynamicText #'stencil = ##f 44 | \override DynamicTextSpanner #'stencil = ##f 45 | \override TextScript #'stencil = ##f 46 | #music 47 | } 48 | \oneVoice 49 | #}) 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /notation-snippets/metricmod-function/definitions.ily: -------------------------------------------------------------------------------- 1 | #(ly:set-option 'relative-includes #t) 2 | \include "../../deprecate.ily" 3 | \ollSnippetsIncludeHint #(*location*) 4 | \include "module.ily" 5 | -------------------------------------------------------------------------------- /notation-snippets/metricmod-function/example.ly: -------------------------------------------------------------------------------- 1 | \version "2.17.26" 2 | 3 | \include "oll-core/package.ily" 4 | \loadModule snippets.notation-snippets.metricmod-function 5 | 6 | %%%%%%%%%%%%%%%%%%%%% 7 | % USAGE EXAMPLE(S): % 8 | %%%%%%%%%%%%%%%%%%%%% 9 | { 10 | \time 6/8 11 | c'8 d' e' d'4. | 12 | \mark \markup \metr-mod #"4." #0 #"4" #0 13 | \time 2/4 14 | e'8 d' f' g' c''2 15 | } 16 | { 17 | c'2 \tuplet 3/2 { d'4 e' d' } | 18 | \mark \markup \metr-mod #"4" #3 #"8" #0 19 | \time 6/8 20 | e'8 d' f' g' c''4 21 | } 22 | \relative c'{ 23 | \time 2/2 24 | c8 d e f \tuplet 5/4 {cis d e fis e} | 25 | \mark \markup \metr-mod #"8" #5 #"8" #3 26 | \time 6/8 27 | \tuplet 3/2 { dis e g } fis8 g4. 28 | } 29 | -------------------------------------------------------------------------------- /notation-snippets/metricmod-function/module.ily: -------------------------------------------------------------------------------- 1 | \version "2.17.26" 2 | 3 | \header { 4 | snippet-title = "Metric Modulation Function" 5 | snippet-author = "Peter Bjuhr" 6 | snippet-source = "no source" 7 | snippet-description = \markup { 8 | Function that creates a markup for metric modulation. 9 | The user inputs: 10 | Note-value (uses "\\note", string) 11 | Tuplet value (0 for no tuplet, 3 for triplet, number) 12 | for each side of the metric equation 13 | } 14 | % add comma-separated tags to make searching more effective: 15 | tags = "metric modulation, tempo modulation, metric relationship, 16 | metric relationship, tempo equation, metric equation" 17 | % is this snippet ready? See meta/status-values.md 18 | status = "unknown" 19 | % Thoughts about status and improvements: 20 | % Are the unicode symbols a problem? 21 | % Maybe the arrows need a little padding!? 22 | } 23 | 24 | %%%%%%%%%%%%%%%%%%%%%%%%%% 25 | % here goes the snippet: % 26 | %%%%%%%%%%%%%%%%%%%%%%%%%% 27 | 28 | #(define-markup-command (metr-mod layout props 29 | notI tupI notII tupII ) 30 | (string? number? string? number?) 31 | "Insert a metric modulation with user settings" 32 | (interpret-markup layout props 33 | #{\markup { 34 | \tiny { 35 | \right-column { 36 | \smaller { #(check-left-tupl tupI) } 37 | \concat { 38 | ← 39 | \note #notI #0.9 40 | } }\center-column { \line {" "} \line { = } } 41 | \left-column { 42 | \smaller { #(check-right-tupl tupII) } 43 | \concat { 44 | \note #notII #0.9 45 | → 46 | } } } } 47 | #})) 48 | 49 | #(define (check-left-tupl ltup) 50 | (if (= ltup 0) " " 51 | (string-append (number->string ltup) "⌝"))) 52 | #(define (check-right-tupl rtup) 53 | (if (= rtup 0) " " 54 | (string-append "⌜" (number->string rtup)))) 55 | 56 | -------------------------------------------------------------------------------- /notation-snippets/overriding-stencils/definitions.ily: -------------------------------------------------------------------------------- 1 | \version "2.16.2" 2 | 3 | \header { 4 | snippet-title = "Overriding stencils of objects with markups" 5 | snippet-author = "Janek Warchoł, David Nalesnik" 6 | snippet-source = "link to the mailing list archives or a website, if applicable" 7 | snippet-description = \markup { 8 | } 9 | % add comma-separated tags to make searching more effective: 10 | tags = "stencil, markup" 11 | % is this snippet ready? See meta/status-values.md 12 | status = "unfinished, undocumented" 13 | % TODO: 14 | % - make it work without having to use quotation marks around grob name 15 | % - change syntax to \override Grob.stencil = stencil-from-markup markup ? 16 | } 17 | 18 | customStencilFromMarkup = 19 | #(define-music-function (parser location name mrkup) (string? markup?) 20 | (let* ((name (string-regexp-substitute " " "" name)) ; remove any spaces 21 | (name-components (string-split name #\.)) 22 | (context-name "Voice") 23 | (grob-name #f)) 24 | 25 | (if (> 2 (length name-components)) 26 | (set! grob-name (car name-components)) 27 | (begin 28 | (set! grob-name (cadr name-components)) 29 | (set! context-name (car name-components)))) 30 | #{ 31 | \override $context-name . $grob-name #'stencil = 32 | #(lambda (grob) 33 | (grob-interpret-markup 34 | grob mrkup)) 35 | #})) 36 | 37 | { 38 | \customStencilFromMarkup "Staff.TimeSignature" \markup \vcenter { 39 | \musicglyph #"timesig.mensural34" 40 | \musicglyph #"three" 41 | } 42 | \customStencilFromMarkup "NoteHead" \markup \vcenter { lol } 43 | \customStencilFromMarkup "Dots" \markup \vcenter { * } 44 | \time 6/1 45 | \clef "petrucci-f4" 46 | a\breve. g | f e | 47 | } 48 | -------------------------------------------------------------------------------- /notation-snippets/overriding-stencils/example.ly: -------------------------------------------------------------------------------- 1 | \version "2.16.2" 2 | 3 | \include "oll-core/package.ily" 4 | \loadModule snippets.notation-snippets.overriding-stencils 5 | %\include "./definitions.ily" 6 | 7 | { 8 | \customStencilFromMarkup "Staff.TimeSignature" \markup \vcenter { 9 | \musicglyph #"timesig.mensural34" 10 | \musicglyph #"three" 11 | } 12 | \customStencilFromMarkup "NoteHead" \markup \vcenter { lol } 13 | \customStencilFromMarkup "Dots" \markup \vcenter { * } 14 | \time 6/1 15 | \clef "petrucci-f4" 16 | a\breve. g | f e | 17 | } 18 | -------------------------------------------------------------------------------- /notation-snippets/overriding-stencils/module.ily: -------------------------------------------------------------------------------- 1 | \version "2.16.2" 2 | 3 | \header { 4 | snippet-title = "Overriding stencils of objects with markups" 5 | snippet-author = "Janek Warchoł, David Nalesnik" 6 | snippet-source = "link to the mailing list archives or a website, if applicable" 7 | snippet-description = \markup { 8 | } 9 | % add comma-separated tags to make searching more effective: 10 | tags = "stencil, markup" 11 | % is this snippet ready? See meta/status-values.md 12 | status = "unfinished, undocumented" 13 | % TODO: 14 | % - make it work without having to use quotation marks around grob name 15 | % - change syntax to \override Grob.stencil = stencil-from-markup markup ? 16 | } 17 | 18 | customStencilFromMarkup = 19 | #(define-music-function (parser location name mrkup) (string? markup?) 20 | (let* ((name (string-regexp-substitute " " "" name)) ; remove any spaces 21 | (name-components (string-split name #\.)) 22 | (context-name "Voice") 23 | (grob-name #f)) 24 | 25 | (if (> 2 (length name-components)) 26 | (set! grob-name (car name-components)) 27 | (begin 28 | (set! grob-name (cadr name-components)) 29 | (set! context-name (car name-components)))) 30 | #{ 31 | \override $context-name . $grob-name #'stencil = 32 | #(lambda (grob) 33 | (grob-interpret-markup 34 | grob mrkup)) 35 | #})) 36 | 37 | { 38 | \customStencilFromMarkup "Staff.TimeSignature" \markup \vcenter { 39 | \musicglyph #"timesig.mensural34" 40 | \musicglyph #"three" 41 | } 42 | \customStencilFromMarkup "NoteHead" \markup \vcenter { lol } 43 | \customStencilFromMarkup "Dots" \markup \vcenter { * } 44 | \time 6/1 45 | \clef "petrucci-f4" 46 | a\breve. g | f e | 47 | } 48 | -------------------------------------------------------------------------------- /notation-snippets/pedal-decorations/README.md: -------------------------------------------------------------------------------- 1 | # Pedal Decorations 2 | 3 | This code provides a callback function that provides the ability to add arbitrary user specified cautionary text added to the start of a pedal line at the commencement of a new line, and optionally continuation arrow indicators at the end of lines. 4 | 5 | ### Usage 6 | The callback is named pedal-with-arrows-and-text. 7 | 8 | It must be used by being inserted with before-line-breaking, not after-line-breaking. The text specified is arbitrary, and specified by the user. Passing a boolean in the second argument turns the line ending arrow on or off. Here is an example of the usage: 9 | 10 | \override PianoPedalBracket.before-line-breaking = #(pedal-with-arrows-and-text "(ped)" #t) 11 | 12 | This code obviously can only be used with: 13 | 14 | pedalSustainStyle = #'bracket 15 | 16 | ### Notes 17 | This code has been rewritten to fully support the use of pedal decorations when there is more than one simultaneous pedal line, as occurs in various contemporary scores. 18 | 19 | ### Author 20 | Andrew Bernard 21 | 22 | andrew.bernard@gmail.com 23 | 24 | ### Acknowledgments 25 | Andrew Bernard originally wrote the code, but it has undergone a very substantial rewrite by Thomas Morley, to whom many thanks are due. 26 | -------------------------------------------------------------------------------- /notation-snippets/pedal-decorations/definitions.ily: -------------------------------------------------------------------------------- 1 | #(ly:set-option 'relative-includes #t) 2 | \include "../../deprecate.ily" 3 | \ollSnippetsIncludeHint #(*location*) 4 | \include "module.ily" 5 | -------------------------------------------------------------------------------- /notation-snippets/pedal-decorations/example.ly: -------------------------------------------------------------------------------- 1 | \version "2.19.59" 2 | 3 | \include "oll-core/package.ily" 4 | \loadModule snippets.notation-snippets.pedal-decorations 5 | %\include "./definitions.ily" 6 | 7 | % example usage 8 | pedalWithArrowsAndTextPed = 9 | \override Score.PianoPedalBracket.before-line-breaking = #(pedal-with-arrows-and-text "(ped)" #t) 10 | 11 | pedalWithArrowsAndTextHalfPed = 12 | \override Score.PianoPedalBracket.before-line-breaking = #(pedal-with-arrows-and-text "½ ped" #t) 13 | 14 | pedalWithArrowsAndTextThreeP = 15 | \override Score.PianoPedalBracket.before-line-breaking = #(pedal-with-arrows-and-text "3P" #t) 16 | 17 | pedalWithArrowsAndTextUC = 18 | \override Score.PianoPedalBracket.before-line-breaking = #(pedal-with-arrows-and-text "UC" #t) 19 | 20 | pedalWithTextPed = 21 | \override Score.PianoPedalBracket.before-line-breaking = #(pedal-with-arrows-and-text "(ped)" #f) 22 | 23 | % example music 24 | 25 | treble = { 26 | \clef treble 27 | \time 4/4 28 | c'4 c' c' c' 29 | c' c' c' c' 30 | } 31 | 32 | bass = { 33 | \clef bass 34 | \time 4/4 35 | 36 | c4 37 | \pedalWithArrowsAndTextHalfPed 38 | c\sustainOn c c 39 | c c c c 40 | \break 41 | c c c c 42 | \break 43 | c c c^\sustainOff\sustainOn c 44 | \break 45 | c c c c 46 | \break 47 | c c\sustainOff\sustainOn c c 48 | \break 49 | c c c c 50 | \break 51 | c c c c\sustainOff 52 | c c c c 53 | \break 54 | % turn off decorations 55 | \revert Score.PianoPedalBracket.before-line-breaking 56 | c c\sustainOn c c 57 | c c c c 58 | \break 59 | c c c\sustainOff c 60 | \pedalWithArrowsAndTextThreeP 61 | c\sustainOn c c\sustainOff 62 | c\sustainOn 63 | \break 64 | c c c c 65 | c c c c\sustainOff 66 | \break 67 | c 68 | \pedalWithArrowsAndTextUC 69 | c\sustainOn c c 70 | c c c\sustainOff 71 | \pedalWithTextPed 72 | c\sustainOn 73 | \break 74 | c c c c 75 | c c c\sustainOff c 76 | } 77 | 78 | \score { 79 | 80 | \new PianoStaff 81 | << 82 | \new Staff = "treble" { \treble } 83 | \new Staff = "bass" { \bass } 84 | >> 85 | 86 | \layout { 87 | \context { 88 | \Score 89 | pedalSustainStyle = #'bracket 90 | } 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /notation-snippets/scale-stencils/scaling-stencils.ly: -------------------------------------------------------------------------------- 1 | \version "2.16.2" % absolutely necessary! 2 | 3 | \header { 4 | snippet-title = "Scaling stencils" 5 | snippet-author = "Janek Warchoł" 6 | snippet-description = \markup { 7 | Sometimes you want to scale (stretch or squeeze) an object - 8 | for example, make a flag shorter so that a tie can be placed below it, 9 | or make a lyric syllable narrower so that it won't distort the note 10 | spacing. To do this, you have to override the stencil property of 11 | that object. 12 | Note that you can place such override in a "\layout" block and thus 13 | make, for example, all lyrics in your piece narrower by a certain factor. 14 | } 15 | % add comma-separated tags to make searching more effective: 16 | tags = "scale, stretch, squeeze, lyrics, flag, stencil" 17 | % is this snippet ready? See meta/status-values.md 18 | status = "ready" 19 | 20 | %{ 21 | TODO: 22 | - make the music function accept music (to be used as tweak) 23 | %} 24 | } 25 | 26 | %%%%%%%%%%%%%%%%%%%%%%%%%% 27 | % here goes the snippet: % 28 | %%%%%%%%%%%%%%%%%%%%%%%%%% 29 | 30 | { 31 | 4. 32 | \once \override Flag #'stencil = 33 | #(lambda (grob) 34 | (ly:stencil-scale (ly:flag::print grob) 1 0.8)) 35 | q8~q8 q4. 36 | } 37 | \addlyrics { 38 | long 39 | \override LyricText #'stencil = 40 | #(lambda (grob) 41 | (ly:stencil-scale (lyric-text::print grob) 0.8 1)) 42 | long 43 | long 44 | } 45 | -------------------------------------------------------------------------------- /notation-snippets/scale-stencils/scaling-stencils.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openlilylib/snippets/63858cdaf121935a6a2d835058bf24e2cea81a5a/notation-snippets/scale-stencils/scaling-stencils.png -------------------------------------------------------------------------------- /notation-snippets/scale-vertical-spacing/definitions.ily: -------------------------------------------------------------------------------- 1 | #(ly:set-option 'relative-includes #t) 2 | \include "../../deprecate.ily" 3 | \ollSnippetsIncludeHint #(*location*) 4 | \include "module.ily" 5 | -------------------------------------------------------------------------------- /notation-snippets/scale-vertical-spacing/example.ly: -------------------------------------------------------------------------------- 1 | \version "2.19.13" 2 | 3 | \include "oll-core/package.ily" 4 | \loadModule snippets.notation-snippets.scale-vertical-spacing 5 | % Necessary to prevent read-ahead issue 6 | #(display "") 7 | 8 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9 | % This example shows how "Scale vertical spacing" can be used. 10 | % The implementation is in the file `definitions.ily`. 11 | % The documentation is in the file `README.md`. 12 | 13 | % scale all page layout variables by the same amount 14 | 15 | 16 | \scaleVerticalSpacingPageLayout #1.5 17 | 18 | % scale all "in-system" properties by the same amount, 19 | % except for Lyrics, which is scaled by a different amount 20 | 21 | \scaleVerticalSpacingInSystems 22 | #'((all 1.5) 23 | (Lyrics 1.15)) 24 | 25 | 26 | % EXAMPLE MUSIC 27 | 28 | global = { \key c \major \time 4/4 } 29 | somenotes = \repeat unfold 48 { c8[ c] } 30 | chordNames = \chordmode { \global \repeat unfold 12 { c1:m } } 31 | melody = \relative c'' { \global \somenotes } 32 | verse = \lyricmode { \repeat unfold 48 { la la } } 33 | right = \relative c'' { \global \somenotes } 34 | left = \relative c' { \global \somenotes } 35 | 36 | \score { 37 | << 38 | << 39 | \new ChordNames \chordNames 40 | \new Staff { \melody } 41 | \addlyrics { \verse } 42 | >> 43 | \new PianoStaff << 44 | \new Staff = "right" { \right } 45 | \new Staff = "left" { \clef bass \left } 46 | >> 47 | >> 48 | \layout { } 49 | } 50 | -------------------------------------------------------------------------------- /notation-snippets/shaping-bezier-curves/README.md: -------------------------------------------------------------------------------- 1 | Slur-attachment function and improved `\shape` 2 | ---------------------------------------------- 3 | 4 | Here's a greatly expanded version of the `\shape` function, and another 5 | function for specifying where slur ends should be attached to notes. 6 | 7 | Please see `.pdf` files for more information. 8 | 9 | Both functions are ready to be used, but they need testing; 10 | they are not considered stable yet and their behaviour may change. 11 | 12 | ### TODOs for the future: 13 | 14 | * Implement a mode for specifying control-point positions 15 | relative to NoteColumn's Stem. 16 | 17 | * Avoid collisions with Stems and NoteHeads when using 'head' mode. 18 | 19 | * Implement a mode for specifying inner control-point positions 20 | relative to outer points' positions. 21 | 22 | * for displaying controlpoints - show coordinates of each point, 23 | maybe in the format used? (i.e. polar, offset, absolute...) 24 | -------------------------------------------------------------------------------- /notation-snippets/shaping-bezier-curves/shape-tie-column/README.md: -------------------------------------------------------------------------------- 1 | *shapeTieColumn* Function 2 | ======================= 3 | 4 | This function can adjust each individual tie in a chord using a `\shape`-like syntax. 5 | 6 | \shapeTieColumn #'( ( ) ( ) ... ) 7 | chord_tie_n = ( [] ) 8 | shape_n = ( ) | () 9 | xxx_point = ( . ) 10 | 11 | The function takes a list of lists. The first list (`chord_tie_1`) controls the tie for the first note in the chord. For example, if the chord is ``, then `chord_tie_1` controls the note C. 12 | 13 | Each `chord_tie` takes one or two lists. If there is no break between the starting chord and the final chord (unbroken), only one `shape` is needed. This `shape` will control one tie between two notes. If the tie is broken, `shape_1` will control the tie before the break and `shape_2` will control the tie after. 14 | 15 | Each `shape_n` has the syntax of `\shape`: four pairs of numbers that represent the X and Y of a point. The first is the starting point; the second, the point of the left bend in the curve; the third, the right bend; and the fourth, the ending point. The empty list, `()` is shorthand for no change. 16 | 17 | See also [the original message.](http://www.mail-archive.com/lilypond-user%40gnu.org/msg89506.html) and [the syntax for \shape.](http://lilypond.org/doc/v2.18/Documentation/notation/modifying-shapes) 18 | -------------------------------------------------------------------------------- /notation-snippets/shaping-bezier-curves/shape-tie-column/definition.ily: -------------------------------------------------------------------------------- 1 | #(ly:set-option 'relative-includes #t) 2 | \include "../../../deprecate.ily" 3 | \ollSnippetsIncludeHint #(*location*) 4 | \include "module.ily" 5 | -------------------------------------------------------------------------------- /notation-snippets/shaping-bezier-curves/shape-tie-column/example.ly: -------------------------------------------------------------------------------- 1 | \version "2.18.2" 2 | \include "oll-core/package.ily" 3 | \loadModule snippets.notation-snippets.shaping-bezier-curves.shape-tie-column 4 | %\include "definition.ily" 5 | 6 | { 7 | % Modifying the first and third ties in a chord. () is shorthand for no change 8 | 1 ~ 9 | \shapeTieColumn #'( 10 | ( ((0 . 1) (0 . 1) (0 . 1) (0 . 1)) ) 11 | ( () ) 12 | ( ((0 . -2) (0 . -1) (0 . -1) (0 . -1)) ) ) 13 | q 14 | \break 15 | 16 | % Modifying the broken ties for a chord. Only the second tie before the 17 | % break is modified, but all three are after. 18 | q ~ 19 | \shapeTieColumn #'( 20 | ( () ((0 . 1) (0 . 1) (0 . 1) (0 . 1)) ) 21 | ( ((0 . 0) (0 . 2) (0 . 2) (0 . 0)) 22 | ((0 . -0.1) (0.5 . -0.4) (1.5 . -0.4) (2 . -0.1)) ) 23 | ( () ((0 . -2) (0 . -1) (0 . -1) (0 . -1)) ) ) 24 | \break 25 | q 26 | } 27 | 28 | \layout { 29 | indent = 0 30 | ragged-right = ##t 31 | } -------------------------------------------------------------------------------- /notation-snippets/shaping-bezier-curves/shape-tie-column/module.ily: -------------------------------------------------------------------------------- 1 | \version "2.18.2" 2 | 3 | \header { 4 | snippet-title = "shape-tie-column" 5 | snippet-author = "David Nalesnik" 6 | snippet-source = 7 | "http://www.mail-archive.com/lilypond-user%40gnu.org/msg89506.html" 8 | snippet-description = \markup { 9 | Adjust the shape of each tie in a chord 10 | } 11 | tags = "tie, column, TieColumn, control-points, offset" 12 | status = "ready" 13 | } 14 | 15 | %%%%%%%% function for offsetting control-points of a TieColumn %%%%%%%%%%%%%%%%% 16 | shapeTieColumn = 17 | #(define-music-function (parser location all-offsets) (list?) 18 | #{ 19 | \once \override TieColumn #'after-line-breaking = 20 | #(lambda (grob) 21 | (let ((ties (ly:grob-array->list (ly:grob-object grob 'ties)))) 22 | (for-each 23 | (lambda (tie offsets-for-broken-pair) 24 | (let* ((orig (ly:grob-original tie)) 25 | (siblings (ly:spanner-broken-into orig))) 26 | (for-each 27 | (lambda (piece offsets-for-piece) 28 | (if (pair? offsets-for-piece) 29 | (set! (ly:grob-property piece 'control-points) 30 | (map 31 | (lambda (x y) (coord-translate x y)) 32 | (ly:tie::calc-control-points piece) 33 | offsets-for-piece)))) 34 | (if (null? siblings) 35 | (list orig) 36 | siblings) 37 | offsets-for-broken-pair))) 38 | ties all-offsets))) 39 | #}) -------------------------------------------------------------------------------- /notation-snippets/shaping-bezier-curves/shapeII.ily: -------------------------------------------------------------------------------- 1 | #(ly:set-option 'relative-includes #t) 2 | \include "../../deprecate.ily" 3 | \ollSnippetsIncludeHint #(*location*) 4 | \include "shapeII/module.ily" 5 | -------------------------------------------------------------------------------- /notation-snippets/shaping-bezier-curves/slur-attachments.ily: -------------------------------------------------------------------------------- 1 | #(ly:set-option 'relative-includes #t) 2 | \include "../../deprecate.ily" 3 | \ollSnippetsIncludeHint #(*location*) 4 | \include "slur-attachments/module.ily" 5 | -------------------------------------------------------------------------------- /notation-snippets/slash-beam/definitions.ily: -------------------------------------------------------------------------------- 1 | #(ly:set-option 'relative-includes #t) 2 | \include "../../deprecate.ily" 3 | \ollSnippetsIncludeHint #(*location*) 4 | \include "module.ily" 5 | -------------------------------------------------------------------------------- /notation-snippets/slash-stem/definitions.ily: -------------------------------------------------------------------------------- 1 | #(ly:set-option 'relative-includes #t) 2 | \include "../../deprecate.ily" 3 | \ollSnippetsIncludeHint #(*location*) 4 | \include "module.ily" 5 | -------------------------------------------------------------------------------- /package.cnf: -------------------------------------------------------------------------------- 1 | # 2 | # openLilyLib/snippets package metadata 3 | # 4 | 5 | name: snippets 6 | display-name: openLilyLib Snippets 7 | short-description: Includable extension functionality for GNU LilyPond 8 | description: < 9 | The `snippets` package is a loosely organized collection of code fragments 10 | for use with the GNU LilyPond score writer. 11 | > 12 | oll-core: 0.5.0 13 | maintainers: [ 14 | Urs Liska 15 | ] 16 | version: 0.5.0 17 | license: GPL3 18 | website: https://github.com/openlilylib/snippets 19 | repository: https://github.com/openlilylib/snippets.git 20 | -------------------------------------------------------------------------------- /scheme-lib/README.md: -------------------------------------------------------------------------------- 1 | 2 | scheme-lib 3 | ========== 4 | 5 | If you `\include "scheme-lib/modules.ily"`, you can make use of scheme-module placed inside OLL snippets. 6 | 7 | lalily 8 | ------ 9 | 10 | In the [lalily folder](lalily/) are modules, which originate from the [lalily-project](https://github.com/jpvoigt/lalily). 11 | 12 | 13 | -------------------------------------------------------------------------------- /scheme-lib/lalily/registry.scm: -------------------------------------------------------------------------------- 1 | ;;;; This file is part of the lalily section in openlilylib 2 | ;;;; 3 | ;;;; Copyright (C) 2011--2014 Jan-Peter Voigt 4 | ;;;; 5 | ;;;; lalily is free software: you can redistribute it and/or modify 6 | ;;;; it under the terms of the GNU General Public License as published by 7 | ;;;; the Free Software Foundation, either version 3 of the License, or 8 | ;;;; (at your option) any later version. 9 | ;;;; 10 | ;;;; lalily is distributed in the hope that it will be useful, 11 | ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ;;;; GNU General Public License for more details. 14 | ;;;; 15 | ;;;; You should have received a copy of the GNU General Public License 16 | ;;;; along with lalily. If not, see . 17 | 18 | 19 | ; store values by path 20 | 21 | (define-module (scheme-lib lalily registry)) 22 | 23 | (use-modules (lily)(scheme-lib lalily storage)) 24 | 25 | (define-public (get-registry-val key . def) #f) 26 | (define-public (set-registry-val key val) #f) 27 | (define-public (display-registry) #f) 28 | (let ((vals (tree-create 'registry))) 29 | (set! get-registry-val (lambda (key . def) 30 | (let ((ret (tree-get vals (if (list? key) key (list key))))) 31 | (if ret ret (if (> (length def) 0)(car def) #f))))) 32 | (set! set-registry-val (lambda (key val) (tree-set! vals (if (list? key) key (list key)) val))) 33 | (set! display-registry (lambda () (tree-display vals 34 | `(vformat . 35 | ,(lambda (v) 36 | (let ((str (if (markup? v) 37 | (markup->string v) 38 | (format "~A" v) 39 | ))) 40 | (if (> (string-length str) 79) 41 | (string-append 42 | (substring/read-only str 0 76) " ...") str)) ))))) 43 | ) 44 | 45 | -------------------------------------------------------------------------------- /scheme-lib/modules.ily: -------------------------------------------------------------------------------- 1 | \version "2.18.0" 2 | \include "general-tools/scheme-wrapper/add-guile-path/definitions.ily" 3 | 4 | \addGuilePath ".." 5 | -------------------------------------------------------------------------------- /simple-examples/README.md: -------------------------------------------------------------------------------- 1 | This is a place for posting stuff that isn't doing anything new, 2 | just explains or demonstrates stuff that is already described in 3 | the documentation. In general, short snippets which don't use 4 | custom scheme functions go here (using the one-file template). 5 | Examples: 6 | * [Adding ambitus per voice](http://lsr.dsi.unimi.it/LSR/Item?id=84), 7 | * [Adding an extra staff](http://lsr.dsi.unimi.it/LSR/Item?id=110), 8 | -------------------------------------------------------------------------------- /simple-examples/using-tie-configuration-property.ly: -------------------------------------------------------------------------------- 1 | \version "2.17.25" 2 | 3 | \header { 4 | snippet-title = "Using tie-configuration property" 5 | snippet-author = "Janek Warchoł" 6 | snippet-description = "" 7 | tags = "tie, ties, bezier curve" 8 | status = "undocumented" 9 | } 10 | 11 | % put the snippet here: 12 | 13 | { 14 | b'1 ~ 15 | \override TieColumn #'tie-configuration = #'((2.0 . -1)) 16 | b'1 17 | 1 ~ 18 | \override TieColumn #'tie-configuration = #'((2.0 . -1) (-1.0 . -1)) 19 | q1 20 | } -------------------------------------------------------------------------------- /specific-solutions/README.md: -------------------------------------------------------------------------------- 1 | Are you answering an email on lilypond-user mailing list 2 | with some code that looks like an ugly hack but it works? 3 | Or maybe you think that your code is too specific to be of 4 | general interest? 5 | 6 | Add it here anyway. Even if it really won't be usable to 7 | other people, it could be an inspiration. Or it could be 8 | improved later. 9 | 10 | In general, almost everything can be added here -- if you 11 | think that your code is ugly or that the optimal solution 12 | should be implemented differently, just mention this in 13 | the description. 14 | -------------------------------------------------------------------------------- /specific-solutions/bracket-repeats/definitions.ily: -------------------------------------------------------------------------------- 1 | #(ly:set-option 'relative-includes #t) 2 | \include "../../deprecate.ily" 3 | \ollSnippetsIncludeHint #(*location*) 4 | \include "module.ily" 5 | -------------------------------------------------------------------------------- /specific-solutions/bracket-repeats/example.ly: -------------------------------------------------------------------------------- 1 | \version "2.17.25" 2 | 3 | \include "oll-core/package.ily" 4 | \loadModule snippets.specific-solutions.bracket-repeats 5 | %\include "./definitions.ily" 6 | 7 | %%%%%%%%%%%%%%%%%%%%% 8 | % USAGE EXAMPLE % 9 | %%%%%%%%%%%%%%%%%%%%% 10 | 11 | \relative c'' { 12 | \time 8/4 13 | \override Staff.MeasureCounter.font-encoding = #'latin1 14 | \override Staff.MeasureCounter.font-size = 0 15 | \override Staff.MeasureCounter.stencil = #repeat-stencil 16 | \once \override Staff.MeasureCounter.count-from = 3 17 | \override Staff.DynamicLineSpanner.padding = 2 18 | \startMeasureCount 19 | d!2~\p d16 \noBeam es,\mf bes4 b''!4.\f c,!2.\mp 20 | \stopMeasureCount 21 | d!2\p 22 | } 23 | 24 | \layout { 25 | \context { 26 | \Staff 27 | \consists #Measure_counter_engraver 28 | \remove "Time_signature_engraver" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /specific-solutions/ismn/README.md: -------------------------------------------------------------------------------- 1 | ISMN 2 | ==== 3 | 4 | An ISMN has the same syntax as ISBN and the checksum is calculated like in EAN (european article number). 5 | 6 | Defined are: 7 | 8 | scheme-lambda: (create-ismn publisher title) 9 | scheme-function: \createISMN "" "" 10 | markup-command: \ismn #"" #"" 11 | 12 | If you need the correct ISMN code for your publications, you can use these functions to create the correct string. 13 | 14 | \createISMN "006" "46415" 15 | 16 | yields 17 | 18 | M 006-46415-9 19 | 20 | for "Bärenreiter Verlag, Mass in B-Minor". 21 | 22 | If you have your own publishing business, you can easily create a function that only takes the title number to produces the ISMN-strings for your titles accordingly. 23 | 24 | -------------------------------------------------------------------------------- /specific-solutions/ismn/definitions.ily: -------------------------------------------------------------------------------- 1 | #(ly:set-option 'relative-includes #t) 2 | \include "../../deprecate.ily" 3 | \ollSnippetsIncludeHint #(*location*) 4 | \include "module.ily" 5 | -------------------------------------------------------------------------------- /specific-solutions/ismn/example.ly: -------------------------------------------------------------------------------- 1 | \version "2.17.97" 2 | 3 | \include "oll-core/package.ily" 4 | \loadModule snippets.specific-solutions.ismn 5 | %\include "definitions.ily" 6 | 7 | %%%%%%%%% 8 | % Example 9 | 10 | % create "M 700337-00-1" 11 | myismn = \createISMN "700337" "00" 12 | #(ly:message "created ismn: ~A" myismn) 13 | 14 | % use ismn in markup 15 | \markup \column { 16 | "Bärenreiter, J.S.B., \"Mass in B Minor\"" 17 | \ismn #"006" #"46415" 18 | "Musikverlag Jan-Peter Voigt, Thomas Dittmann, \"Geistliche Chormusik\"" 19 | \ismn #"700337" #"00" 20 | } 21 | -------------------------------------------------------------------------------- /specific-solutions/ismn/module.ily: -------------------------------------------------------------------------------- 1 | \version "2.17.97" 2 | % should work in earlier versions 3 | 4 | \header { 5 | snippet-title = "Calculate ISMN checksum" 6 | snippet-author = "Jan-Peter Voigt" 7 | snippet-description = \markup { 8 | \wordwrap { 9 | Calculate the checksum for an ISM-Number with a given publisher and title number and return a string 10 | \concat { "\"M " \italic "-" \italic "-" \italic }. 11 | } 12 | } 13 | tags = "ismn, scheme" 14 | status = "ready" 15 | } 16 | 17 | % create ISMN string with publisher number and title number 18 | #(define-public (create-ismn publisher title) 19 | "produce a string 'M ' where pppp is the publisher number, tttt the title number and c the checksum." 20 | (let ((ismn-list (string->list "9790")) 21 | (check 0)) 22 | ; append character lists from publisher and title to ISMN key "9790" 23 | (set! ismn-list (append ismn-list (string->list publisher))) 24 | (set! ismn-list (append ismn-list (string->list title))) 25 | ; calculate checksum as described in http://en.wikipedia.org/wiki/International_Article_Number_%28EAN%29 26 | (let ((p 0)(i 0)) 27 | (for-each (lambda (c)(let ((n (- (char->integer c)(char->integer #\0)))) 28 | (set! i (1+ i)) 29 | (if (= 0 (modulo i 2))(set! n (* 3 n))) 30 | (set! p (+ p n)) 31 | )) ismn-list) 32 | (set! check (modulo (- 10 (modulo p 10)) 10) ) 33 | ) 34 | ; create string 35 | (string-append "M " publisher "-" title "-" (number->string check)) 36 | )) 37 | 38 | % wrap scheme-function 39 | createISMN = #(define-scheme-function (parser location publisher title)(string? string?)(create-ismn publisher title)) 40 | 41 | % markup command 42 | #(define-markup-command (ismn layout props publisher title)(string? string?) 43 | (interpret-markup layout props (create-ismn publisher title))) 44 | 45 | -------------------------------------------------------------------------------- /specific-solutions/xelatex-markup-list/.gitignore: -------------------------------------------------------------------------------- 1 | *.tex 2 | *.sh 3 | *.pages 4 | *.aux 5 | -------------------------------------------------------------------------------- /specific-solutions/xelatex-markup-list/README.md: -------------------------------------------------------------------------------- 1 | Including Xelatex 2 | ================= 3 | 4 | The provided command provides a markup-list-command to add one EPS-stencil per page of the resulting PDF file. 5 | This might be used for other programs, creating PDF files. 6 | 7 | The command produces a bash-script "xelatex-.sh", which actually creates the PDF. 8 | The given tex-source MUST be a document body, meaning the text between 9 | 10 | \begin{document} 11 | 12 | and 13 | 14 | \end{document} 15 | 16 | The template is given by the commmand to supply the right dimensions without margins. That way, the xelatex-markup matches the layout of the rest of the document. 17 | 18 | ToDo: 19 | ----- 20 | 21 | - While calling the xelatex command, lilypond sets a lot of environment variables which affect xelatex and all ghostscript-dependant commmands. 22 | This leads to a lot of warnings and is *not* really solved. 23 | - It might be better, to use pandoc. Pandoc /can/ use templates for PDF creation and it can read several formats beside latex, like, for example, markdown. 24 | 25 | Notes: 26 | ----- 27 | 28 | - The file is split into EPS-files with `pdftops -eps -f -l `, because `pdf2ps "%d.eps"` rasterizes the PDF-source. 29 | 30 | -------------------------------------------------------------------------------- /specific-solutions/xelatex-markup-list/definitions.ily: -------------------------------------------------------------------------------- 1 | #(ly:set-option 'relative-includes #t) 2 | \include "../../deprecate.ily" 3 | \ollSnippetsIncludeHint #(*location*) 4 | \include "module.ily" 5 | -------------------------------------------------------------------------------- /specific-solutions/xelatex-markup-list/example.ly: -------------------------------------------------------------------------------- 1 | \version "2.18.0" 2 | \include "oll-core/package.ily" 3 | \loadModule snippets.specific-solutions.xelatex-markup-list 4 | %\include "definitions.ily" 5 | 6 | text = \readComment 7 | %{ 8 | \twocolumn{} \sloppy{} 9 | It was a night to remember. 10 | All of a sudden the door opened with dark noise and he, yes HE, came in. 11 | 12 | We all were waiting for something, but we all didn't know what it was. 13 | I was first to say "`Hello Sir"'. 14 | 15 | -- \textit{silence} --- 16 | 17 | It seemed like an invasion of something alien. 18 | No one knows, if it is evil or just some kind of short intermission. 19 | 20 | %} 21 | 22 | \markuplist { 23 | \override-lines #'(tex-height . 55) % 55mm for tex output 24 | % Make sure the font selected in the next line is available 25 | \override-lines #'(font-name . "Century Schoolbook L") 26 | \xelatexInclude #text 27 | \score { \relative c'' { c4 b gis g } \addlyrics { where is your mind? } \layout {} } 28 | } 29 | 30 | -------------------------------------------------------------------------------- /stylesheets/README.md: -------------------------------------------------------------------------------- 1 | A place for collections of user-designed layout settings. 2 | Have you found a combination of settings that works well 3 | for a particular type of music? Place it here. 4 | 5 | Have you desgined a custom header layout? Place it here. 6 | 7 | Do you use a "house style" for all your scores? Place it 8 | here! 9 | 10 | If it turns out that some settings are used repeatedly by 11 | majority of users, maybe we will make them the default in 12 | LilyPond. 13 | -------------------------------------------------------------------------------- /stylesheets/modern/README.md: -------------------------------------------------------------------------------- 1 | This stylesheet attempts to make LilyPond output more similar to what 2 | people are used to see from publishers nowadays (I mean general style, 3 | not sloppiness of engraving) - for example, relatively flat beams seem 4 | to be the standard. 5 | 6 | As of 2013-12-05, this is in very early stage of development. 7 | -------------------------------------------------------------------------------- /stylesheets/modern/example.ly: -------------------------------------------------------------------------------- 1 | \version "2.16.2" 2 | 3 | \include "settings.ily" 4 | 5 | \relative f' { 6 | c8 d e f g a b c 7 | c, e g r d f a r 8 | } 9 | \relative c'' { 10 | aeses4 aes fisis fis 11 | } -------------------------------------------------------------------------------- /stylesheets/modern/settings.ily: -------------------------------------------------------------------------------- 1 | \version "2.16.2" 2 | 3 | \layout { 4 | \context { 5 | \Score 6 | % I dislike it, but many modern editions have quite flat beams. 7 | \override Beam #'damping = #2.5 8 | extraNatural = ##f 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /stylesheets/old-style/README.md: -------------------------------------------------------------------------------- 1 | This stylesheet attempts to make LilyPond output even more similar 2 | to old engravings. In particular, some elements are extra thick. 3 | 4 | As of 2013-12-05, this is in very early stage of development. 5 | -------------------------------------------------------------------------------- /stylesheets/old-style/example.ly: -------------------------------------------------------------------------------- 1 | \version "2.16.2" 2 | 3 | \include "settings.ily" 4 | 5 | \relative f' { 6 | c8 d e f g a b c 7 | c, e g r d f a r 8 | } 9 | \relative c'' { 10 | aeses4 aes fisis fis 11 | } -------------------------------------------------------------------------------- /stylesheets/old-style/settings.ily: -------------------------------------------------------------------------------- 1 | \version "2.16.2" 2 | 3 | \layout { 4 | \context { 5 | \Score 6 | % old editions often have beams almost totally parallel to the notes. 7 | \override Beam #'damping = #0.5 8 | extraNatural = ##t 9 | % heavier appearance 10 | \override StaffSymbol #'thickness = #1.2 11 | \override Beam #'beam-thickness = #0.55 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /templates/README.md: -------------------------------------------------------------------------------- 1 | Here is the place for examples showing how to structure 2 | your files and content, especially in a bigger project. 3 | Not only score templates can be placed here - i imagine 4 | that music function templates could be added as well, 5 | or engraver templates. 6 | 7 | There may be many templates showing how to the same thing - 8 | for example theree are many ways in which the structure 9 | of a SATB choral piece can be written. Thus, please write 10 | an explanation highlighting the "design goals" of your 11 | particular template. Why have you written it this way? 12 | What are its strengths, how does it differ feom other ones? 13 | -------------------------------------------------------------------------------- /templates/SATB-choir-on-2-or-4-staves/SATB-choir-on-2-or-4-staves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openlilylib/snippets/63858cdaf121935a6a2d835058bf24e2cea81a5a/templates/SATB-choir-on-2-or-4-staves/SATB-choir-on-2-or-4-staves.png -------------------------------------------------------------------------------- /templates/adjustable-centered-stanzas/definitions.ily: -------------------------------------------------------------------------------- 1 | #(ly:set-option 'relative-includes #t) 2 | \include "../../deprecate.ily" 3 | \ollSnippetsIncludeHint #(*location*) 4 | \include "module.ily" 5 | -------------------------------------------------------------------------------- /templates/adjustable-centered-stanzas/example.ly: -------------------------------------------------------------------------------- 1 | \version "2.19.3" 2 | 3 | \include "oll-core/package.ily" 4 | \loadModule snippets.templates.adjustable-centered-stanzas 5 | %\include "definitions.ily" 6 | 7 | stanzaII = \markup \column { 8 | Supercalifragilisticexpialidocious! 9 | Supercalifragilisticexpialidocious! 10 | } 11 | stanzaIII = \markup \column{ 12 | "La la la laaaaaa" 13 | "pam pam pam paaam" 14 | } 15 | stanzaIV = \markup \column { 16 | foo 17 | foo 18 | foo 19 | } 20 | stanzaV = \markup { 21 | bar 22 | } 23 | 24 | \markup "Stanzas in a single column:" 25 | \markup \draw-hline 26 | \markup \vspace #2 27 | 28 | \markup \stanzas-in-columns #1 { \stanzaII \stanzaIII \stanzaIV \stanzaV } 29 | 30 | \markup \vspace #2 31 | \markup "Stanzas in two columns:" 32 | \markup \draw-hline 33 | \markup \vspace #2 34 | 35 | \markup \stanzas-in-columns #2 { \stanzaII \stanzaIII \stanzaIV \stanzaV } 36 | 37 | \markup \vspace #2 38 | \markup "Stanzas in two columns with some settings overridden:" 39 | \markup \draw-hline 40 | \markup \vspace #2 41 | 42 | \markup 43 | \override #'(horizontal-spacing . 0.3) 44 | \override #'(vertical-spacing . 0.6) 45 | \override #'(first-number . 1) 46 | \stanzas-in-columns #2 { \stanzaII \stanzaIII \stanzaIV \stanzaV } 47 | -------------------------------------------------------------------------------- /templates/lalily/definitions.scm: -------------------------------------------------------------------------------- 1 | ;;;; This file is part of lalily, an extension to lilypond . 2 | ;;;; 3 | ;;;; Copyright (C) 2011--2013 Jan-Peter Voigt 4 | ;;;; 5 | ;;;; lalily is free software: you can redistribute it and/or modify 6 | ;;;; it under the terms of the GNU General Public License as published by 7 | ;;;; the Free Software Foundation, either version 3 of the License, or 8 | ;;;; (at your option) any later version. 9 | ;;;; 10 | ;;;; lalily is distributed in the hope that it will be useful, 11 | ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ;;;; GNU General Public License for more details. 14 | ;;;; 15 | ;;;; You should have received a copy of the GNU General Public License 16 | ;;;; along with lalily. If not, see . 17 | 18 | (define-module (templates lalily definitions)) 19 | 20 | (define-public lalily:paper:global-staff-size '(lalily paper global-staff-size)) 21 | (define-public lalily:paper:default '(lalily paper default)) 22 | 23 | (define-public lalily:test-predicate '(lalily runtime test-predicate)) 24 | (define-public lalily:create '(lalily runtime create)) 25 | 26 | (define-public lalily:store:path-variables '(lalily runtime store path variables)) 27 | (define-public lalily:get-music-load-callbacks '(lalily runtime store load callbacks)) 28 | (define-public lalily:get-music-store-callbacks '(lalily runtime store store callbacks)) 29 | -------------------------------------------------------------------------------- /templates/lalily/example-book.ly: -------------------------------------------------------------------------------- 1 | \version "2.18.0" 2 | 3 | % TODO: these two commands are defined in lalily, but not here! 4 | tocPart = #tocItem 5 | tocCollection = #tocItem 6 | 7 | #(set-global-staff-size 16) 8 | \paper { 9 | ragged-last-bottom = ##f 10 | } 11 | 12 | \include "definitions.ily" 13 | \include "example-satb.ly" 14 | \include "example-choir-cont.ly" 15 | 16 | \setMusicFolder music.choral 17 | \setTitle "Two Pieces in one book" 18 | 19 | % add some tweaks for this book 20 | % editions added by the includes are still active! (sheet) 21 | \addEdition book 22 | % if a current music-folder is set, editionMod paths are relative to that path! 23 | \editionMod book 17 0/1 altatrinita.Score.A \break % yields in music.choral.altatrinita.Score.A 24 | \editionMod book 7 3/4 psalmXLVI.choir.cantus.Voice.A \shape #'((0 . 0)(0 . 1)(0 . 1)(0 . 0)) Slur 25 | \editionMod book 7 3/4 psalmXLVI.choir.cantus.Voice.A \once \override Slur.color = #red 26 | 27 | % add table of contents to book 28 | \bookpart { 29 | \markuplist \table-of-contents 30 | } 31 | 32 | \optionsInit opts 33 | % if we define an option 'keys', the bookpart will loop through all music-folders current.music.folder. 34 | \optionsAdd opts keys #'(altatrinita psalmXLVI) 35 | % alternatively, we can define a list with music-folders 36 | %\optionsAdd opts music #'((music choral altatrinita) (music choral psalmXLVI)) 37 | % create a bookpart containing all declared scores 38 | \lalilyBookpart #opts 39 | % lalilyTestBookpart will only act, if output-name and location match - if this is not included 40 | -------------------------------------------------------------------------------- /templates/lalily/example-transpose.ly: -------------------------------------------------------------------------------- 1 | \version "2.18.0" 2 | \include "example-satb.ly" 3 | 4 | % prepare options 5 | \optionsInit opts 6 | \optionsAdd opts mirror-path #'(..) 7 | 8 | % we inluded example-satb and the music-folder is still set to music.choral.altatrinita 9 | % \musicPath G sets it to music.choral.altatrinita.G 10 | % the lalily.mirror template creates the music from the given (relative) mirror-path, 11 | % which is here #'(..) -> music.choral.altatrinita 12 | % \setTransposedTemplate wraps the given template in a transposition 13 | \setTransposedTemplate f g \musicPath G lalily.mirror #opts 14 | % inheritAllHeaders gets and sets all headers from given (relative) path 15 | \inheritAllHeaders LY_UP 16 | 17 | % engrave it 18 | \lalilyTest 19 | % ... and now we have the included music in a transposed version :) 20 | -------------------------------------------------------------------------------- /templates/lalily/example.ly: -------------------------------------------------------------------------------- 1 | \version "2.18.0" 2 | 3 | % show all automatic includes 4 | includePatternVerbose = ##t 5 | 6 | \include "definitions.ily" 7 | 8 | \setMusicFolder musik.test.trumpet 9 | \setTemplate lalily.instrument.brass.trumpet 10 | \setOption #'transposition #(ly:make-pitch -1 2 -1/2) % instrument transposition e flat (b flat is default for trumpet) 11 | \setOption #'input-concert-pitch ##t % music input in concert pitch (default) 12 | \setOption #'output-concert-pitch ##f % music output in instrument transposition (default) 13 | 14 | % alternatively you prepare options and set them: 15 | % 16 | % \optionsInit opts 17 | % % instrument transposition e flat (b flat is default for template lalily.instrument.trumpet) 18 | % \optionsAdd opts transposition #(ly:make-pitch -1 2 -1/2) 19 | % % music input in concert pitch (default #t) 20 | % \optionsAdd opts input-concert-pitch ##t 21 | % % music output in instrument transposition (default #f) 22 | % \optionsAdd opts output-concert-pitch ##f 23 | % \setOptions #'() #opts 24 | % 25 | % or you combine setMusicFolder, setTemplate and setOptions (with a prepared a-list) to 26 | % \setDefaultTemplate musik.test.trumpet lalily.instrument.trumpet #opts 27 | 28 | \putMusic LY_UP.meta { 29 | \key f \major \time 2/4 s1 \bar "|." 30 | } 31 | \putMusic \relative c'' { 32 | bes4 a c b 33 | } 34 | 35 | \addEdition trumpEs 36 | \editionMod trumpEs 2 0/4 Voice.A \once \override NoteHead.color = #red 37 | 38 | \lalilyTest 39 | -------------------------------------------------------------------------------- /templates/lalily/init.scm: -------------------------------------------------------------------------------- 1 | (use-modules 2 | (scheme-lib lalily parser-location) 3 | ) 4 | 5 | ; make this file run once! 6 | (if (not (and (defined? 'lalily-templates) lalily-templates)) 7 | (begin 8 | (module-define! (current-module) 'lalily-templates #f) 9 | (load "store-init.scm") 10 | )) 11 | (export lalily-templates) 12 | (set! lalily-templates #t) 13 | -------------------------------------------------------------------------------- /templates/lalily/templates/tools.ily: -------------------------------------------------------------------------------- 1 | \version "2.18.0" 2 | 3 | Path = 4 | #(define-scheme-function (parser location p)(list?) p) 5 | PathS = 6 | #(define-scheme-function (parser location s p)((char? #\/) string?) 7 | (map (lambda (e) (if (> (string-length e) 0) (string->symbol e) '/)) (string-split p s))) 8 | Pair = 9 | #(define-scheme-function (parser location p)(list?) 10 | (cond 11 | ((>= (length p) 2) 12 | (if (> (length p) 2) 13 | (ly:input-warning location "more than 2 elements: ~A" p)) 14 | (cons (car p) (cadr p))) 15 | ((> (length p) 0) (cons (car p) #f)) 16 | (else '(#f . #f)) 17 | )) 18 | PairS = 19 | #(define-scheme-function (parser location s p)((char? #\|) string?) 20 | (ly:music-function-exec Pair parser location 21 | (string-split p s))) 22 | -------------------------------------------------------------------------------- /templates/predefined-instruments/example.ly: -------------------------------------------------------------------------------- 1 | \version "2.19.1" 2 | 3 | \include "instrument-context-definitions.ily" 4 | 5 | sopranomelody = \relative c'' { 6 | c b a f 7 | } 8 | altomelody = \relative f' { 9 | f g a c, 10 | } 11 | tenormelody = \relative c' { 12 | c a c c 13 | } 14 | bassmelody = \relative f { 15 | f e d c 16 | } 17 | text = \lyricmode { 18 | la la la la 19 | } 20 | 21 | \score { 22 | \new ChoirStaff << 23 | \new SopranoVoice = sop \sopranomelody 24 | % cannot use \addlyrics \text because it would result 25 | % in ordinary Voice being created (instead of SopranoVoice) 26 | \new Lyrics \lyricsto sop \text 27 | 28 | \new AltoVoice = alt \altomelody 29 | \new Lyrics \lyricsto alt \text 30 | 31 | \new TenorVoice = ten \tenormelody 32 | \new Lyrics \lyricsto ten \text 33 | 34 | \new BassVoice = bas \bassmelody 35 | \new Lyrics \lyricsto bas \text 36 | >> 37 | \layout { 38 | \override Staff.NoteHead #'color = #blue 39 | \override AltoStaff.NoteHead #'color = #red 40 | \override SopranoVoice.Stem #'color = #green 41 | \override VocalStaff.Stem #'thickness = #4 42 | } 43 | \midi { 44 | % it would be nice if eg. \set SopranoStaff.midiInstrument 45 | % affected all voices living in SopranoStaves 46 | \set Voice.midiInstrument = #"acoustic grand" 47 | \set SopranoVoice.midiInstrument = #"clarinet" 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /templates/predefined-instruments/example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openlilylib/snippets/63858cdaf121935a6a2d835058bf24e2cea81a5a/templates/predefined-instruments/example.png -------------------------------------------------------------------------------- /templates/predefined-instruments/ideas-for-the-future.md: -------------------------------------------------------------------------------- 1 | Below are my ideas for future developments that may follow predefined instrument 2 | contexts. However, this won't happen before the function for easy creating custom 3 | contexts is finished and accepted into widespread use. 4 | 5 | After creating custom contexts, i'd like to push the idea even further 6 | and create a new abstraction layer: instruments. An instrument has the 7 | following properties: 8 | 9 | - it can consist of one or multiple staves, or it may share a staff with other 10 | instruments (e.g. Soprano and Alto sharing a staff in a choir). Staffing changes 11 | may happen during the piece (i.e. an instrument may temporarily split into 12 | multiple staves and then they could join) 13 | - similarly with voices 14 | - an instrument (which corresponds almost(?) directly to a musician) always begins 15 | at the beginning of the piece, and always ends at the end of a piece. It may be 16 | resting for long periods of time, but it exists continuously. This is much unlike 17 | voices, which - particularly in piano music - pop in and out of existence all time. 18 | (note that staves sometimes also pop in and out of existence). 19 | 20 | QUESTION: can an instrument split? What happens when we have Sopranos in the choir 21 | and they temporarily split into 2 (or even 3) subSopranos? Are these subsintruments 22 | of Soprano instrument, or rather all of these should be treated as instruments and 23 | it's the Sopranos that are an instrument group sharing a staff? 24 | 25 | 26 | Problems with instruments: 27 | -------------------------- 28 | 29 | - if there should be multiple score blocks in the file, how does lilypond know 30 | where each instrument belongs? E.g. we have a piece which traditionally 31 | would be defined with the following structure: 32 | 33 | \score { something } 34 | \markup { narrator } 35 | \score { something } 36 | \markup { narrator } 37 | \score { something } 38 | \markup { narrator } 39 | 40 | If we're to ditch traditional \score blocks and have all the structure inferred 41 | from instruments, how will lilypond know in which "part" to put each instrument? 42 | 43 | - How to handle instruments sharing a staff, AND instruments being partcombined?? 44 | -------------------------------------------------------------------------------- /templates/predefined-instruments/instrument-context-definitions.ily: -------------------------------------------------------------------------------- 1 | \version "2.19.10" 2 | 3 | \include "context-creating-function.ily" 4 | 5 | \newInstrument "Vocal" 6 | \with { 7 | \consists "Ambitus_engraver" 8 | instrumentName = "Vocals" 9 | shortInstrumentName = "Voc." 10 | \dynamicUp 11 | \tupletUp 12 | \remove "Staff_performer" 13 | } 14 | \with { 15 | \consists "Staff_performer" 16 | midiInstrument = "voice oohs" 17 | } 18 | "default" 19 | 20 | \newInstrument "Soprano" 21 | \with { 22 | instrumentName = "Soprano" 23 | shortInstrumentName = "S" 24 | \clef G 25 | } 26 | "Vocal" 27 | 28 | \newInstrument "Alto" 29 | \with { 30 | instrumentName = "Alto" 31 | shortInstrumentName = "A" 32 | \clef G 33 | } 34 | "Vocal" 35 | 36 | \newInstrument "Tenor" 37 | \with { 38 | instrumentName = "Tenor" 39 | shortInstrumentName = "T" 40 | \clef "G_8" 41 | } 42 | "Vocal" 43 | 44 | \newInstrument "Bass" 45 | \with { 46 | instrumentName = "Bass" 47 | shortInstrumentName = "B" 48 | \clef F 49 | } 50 | "Vocal" 51 | -------------------------------------------------------------------------------- /test/.automated-tests-include: -------------------------------------------------------------------------------- 1 | # Dummy test file pointing to Nirvana 2 | # (expected to fail) 3 | #wtf.ly 4 | -------------------------------------------------------------------------------- /test/TEST-RESULTS.md: -------------------------------------------------------------------------------- 1 | Results of automated tests in openLilyLib 2 | ========================================= 3 | 4 | The `results` directory holds test results produced by the `openLilyLib` automated 5 | test suite. After the tests have been completed successfully the result 6 | files can be picked up to generate documentation. 7 | 8 | The result files are written to a directory structure representing that of the 9 | original `openLilyLib` hierarchy, `results` corresponding to the root directory. 10 | 11 | Before the tests start the directory is cleared completely, so please don't 12 | store anything in there manually. -------------------------------------------------------------------------------- /test/common_functions.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import collections 5 | 6 | # File configuring the requested LilyPond versions 7 | lily_versions_file = "./test/LILYPOND-VERSIONS" 8 | 9 | ########################### 10 | # Determine the environment 11 | # This script doesn't have to be platform independent as it only runs on Linux machines 12 | 13 | # Home directory, serves as root for several paths 14 | home_dir = os.getenv("HOME") 15 | # base directory where two LilyPond versions are installed and cached 16 | install_root = "{}/.lilypond".format(home_dir) 17 | 18 | 19 | def load_lily_versions(): 20 | """Read requested LilyPond versions from a file. 21 | Return an ordered dictionary.""" 22 | versions = collections.OrderedDict() 23 | with open(lily_versions_file, 'r') as versions_file: 24 | for line in versions_file.readlines(): 25 | version_line = line.strip() 26 | # The following "parsing" could use more care ;-) 27 | if not version_line.startswith("#") and len(version_line) > 0: 28 | target, version = version_line.split('=') 29 | versions[target] = version 30 | return versions 31 | 32 | def print_separator(): 33 | print "" 34 | print "="*79, "\n" 35 | -------------------------------------------------------------------------------- /test/install_lilypond.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import sys 5 | 6 | from lilycmd import LilyCmd 7 | from common_functions import print_separator 8 | 9 | ############################################################# 10 | # Load environment variables 11 | # at the same time checking if we're running on the CI server 12 | 13 | try: 14 | is_ci = os.environ["CI"] 15 | lily_platform = os.environ["LILY_PLATFORM"] 16 | lily_version = os.environ["LILY_VERSION"] 17 | except: 18 | sys.exit('\nScript can only be run in CI mode. Aborting\n') 19 | 20 | ######################### 21 | # Actual script execution 22 | 23 | if __name__ == "__main__": 24 | print_separator() 25 | print "=============================" 26 | print "openLilyLib automated testing" 27 | print "=============================" 28 | print "Step 1:" 29 | print "check LilyPond installation." 30 | print "Requested LilyPond version: {}".format(lily_version) 31 | 32 | LilyCmd.install(lily_platform, lily_version) 33 | -------------------------------------------------------------------------------- /test/results/.forcedir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openlilylib/snippets/63858cdaf121935a6a2d835058bf24e2cea81a5a/test/results/.forcedir --------------------------------------------------------------------------------