Questions tagged [lily-scheme]

Scheme is a programming language in the Lisp family, it is used internally by the higher level language LilyPond — for music engraving.

LilyPond uses the Scheme programming language, both as part of the input syntax, and as internal mechanism to glue modules of the program together.

— from the LilyPond documentation - Scheme tutorial.

Scheme is a functional programming language. It is designed to provide a mathematically well-founded language based on lambda calculus (with eager evaluation).

It follows a minimalist design philosophy specifying a small standard core with powerful tools for language extension. Its compactness and elegance have made it popular with educators, language designers, programmers, implementors, and hobbyists.

The Scheme language belongs to the lisp Family. Since Scheme uses a single namespace for naming functions and other values, it is called a lisp-1.

— from Stack Overflow's Tag Info page.


Question on Scheme that are not related to LilyPond are not on-topic for SE: MP&T. These questions should be asked on Stack Overflow.

31 questions
9
votes
1 answer

Define custom chord voicings in lilypond

What I'd like to do is define custom, specific chord voicings in lilypond, and to be able to attach note-durations to them, along the lines of voicing = < g a c e a > % dom7, with 7th in bass \new Staff { % play the whole chord for two…
Dave
  • 17,721
  • 8
  • 59
  • 96
8
votes
2 answers

Lilypond function to interpolate two notes

I want to define a Lilypond function that will interpolate two notes. The function should take as inputs: the first note, the last note, the step (in semitones), and whether flats or sharps should be used. For example: \sequence a g 1 sharp should…
scaramouche
  • 231
  • 1
  • 3
6
votes
1 answer

How to pass duration to lilypond function

I defined a simple function: disdn = #(define-music-function (d) (ly:duration?) #{ #d #}) I am calling it as follows: \disdn #8 I am getting an error: wrong type for argument 1. Expecting duration, found 8 What…
kargirwar
  • 245
  • 6
6
votes
1 answer

How to display Alt chords in Lilypond?

I can get Lilypond to display Alt chords on a lead sheet by explicitly spelling the Alt chord, but this seems like a real nuisance. Here is an example: \version "2.22.2" \header { title = "Alt Chords" } % Is there a better way to get Alt chords…
user87182
5
votes
1 answer

Conditionally transpose up versus down in LilyPond?

In version 2.19.x, how can I make LilyPond decide whether – and by how much – to transpose up or down, depending on a target octave/range for one of the transposed notes (I'll call that note the "reference note")? All the other notes are to be…
Joan Eliot
  • 301
  • 1
  • 5
5
votes
2 answers

LilyPond: How to avoid pitch-squashed chords ending up as colliding noteheads?

On the guitar it is common, both, to follow staff notation, as well as to strum chords given by their names. Using Lilypond, I am trying to notate explicit notes in staff notation and named chords with an indication of rhythm, both in a single…
rfbw
  • 361
  • 1
  • 8
5
votes
3 answers

Get the current time signature numerator/denominator

I'm transcribing a piece with extremely frequent time changes. Some parts have a lot of full-measure rests. I'm trying to define a function that produces a full-measure rest based on the current time signature, but as a relative Lilypond Scheme…
Thom Smith
  • 425
  • 2
  • 7
4
votes
1 answer

Include \markup in define-music-function

I want a custom \breathe sign that can be freely positioned, like: I have some shortcut code for this: place = #(define-music-function (parser location xy) (pair?) #{ \once \override TextScript.extra-offset = #xy …
Patrik
  • 143
  • 3
4
votes
1 answer

LilyPond: passing music symbols as arguments to a function / markup-command

I am preparing in LilyPond a music book divided into many sections, each having a title. I want to keep the formatting of all titles in a single place, to make future format changes easier, and know two methods to do so: using…
Buchuck
  • 63
  • 3
4
votes
1 answer

How can I create a rest the same length as a block of music?

I'm typesetting music (a set of versicles and responses), some of which are accompanied and some of which aren't, and I'm using some custom Scheme functions to collect pieces in parallel (and automatically insert common elements). For the…
4
votes
2 answers

How do I define an Lilypond/Scheme alist as cons of two a lists?

I have pitch names defined as a alist in Lilypond as below and it works fine. \version "2.18.2" pitchname = #`( (saa . , (ly:make-pitch -1 0 NATURAL)) (raa . , (ly:make-pitch -1 1 FLAT)) (sa . ,…
Jay Vara
  • 81
  • 1
4
votes
2 answers

"Wrong number of arguments to #" when trying to execute a snippet from Lilypond Documentation

I'm trying to use the code from a snippet found on the official documentation on "Displaying pitches" (scroll down to "Known issues and warnings"): \version "2.18.2" forget = #(define-music-function (music) (ly:music?) #{ \accidentalStyle forget …
Glorfindel
  • 3,612
  • 5
  • 21
  • 36
4
votes
2 answers

LilyPond: modifying woodwind diagrams

Regarding woodwind diagram in LilyPond such as: \markup { \center-column { \override #'(size . 0.7) { \woodwind-diagram #'flute #'((cc . (oneF two three four five six)) (lh . ()) (rh . ()))…
Tommy_tsa
  • 405
  • 2
  • 7
4
votes
2 answers

LilyPond: parenthesized hairpin

I found LilyPond code to place a hairpin between parenthesis like this: You can see that the result overlaps with the bar line. The code that does it is some hard-core Scheme hackery. One obviously has to know Scheme and the guts LilyPond to write…
facetus
  • 693
  • 2
  • 7
3
votes
4 answers

Custom dynamic mark

I am in the process of engraving a sheet of piano music. I wrote a custom dynamic mark — the look of which I am very happy with, but the behavior, not totally. It is the following: mff = \tweak DynamicText.self-alignment-X #LEFT …
MacroController
  • 545
  • 3
  • 9
1
2 3