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.

Filter by
Sorted by
Tagged with
1 vote
1 answer
43 views

Align \markup and fermata in make-music-function?

The end goal is to have some function that takes a rest and optional text and outputs the rest with a fermata, boxed "vocals", and the optional key words. Inspired by this question, I was ...
  • 1,083
2 votes
1 answer
55 views

Using conditionals in LilyPond scheme functions

I have a software development background, but I'm new to LilyPond. I'm trying to create a function that will allow me to pass in a number and then return some text depending on which number is passed ...
  • 123
1 vote
3 answers
50 views

How does one recall the current context properties for MIDI effects in Lilypond?

After setting the a context property for a MIDI effect, for example \set Staff.midiChorusLevel = #2, how would I save this value into a variable inside a Scheme function, should I want to temporarily ...
  • 11
6 votes
1 answer
160 views

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 =...
user avatar
1 vote
1 answer
55 views

creating a bookpart generating scheme function in lilypond

I am creating a piano book in LilyPond, which I am using for the first time. I am separating each piece into its own \bookpart, and if any of them have multiple movements, then each movement is in a ...
  • 87
5 votes
3 answers
118 views

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 ...
3 votes
2 answers
54 views

Lyluatex Reuse code: Stylesheet or newcommand

I want to color all the stanza numbers of many hymns with red. I would like to keep the color definition in a stylesheet and only pass "the number and dot" of the stanza as a parameter. I ...
  • 171
2 votes
1 answer
87 views

Replace note name with variable - lilypond [closed]

nl = \break % it's true, ok! a = \axyz % this is wrong with output time adds 1 2 4 8 16 .. \axyz16 \axyz4 % etc. Is it possible to build variable to replace notes? Maybe with Scheme? I would like to ...
  • 51
3 votes
1 answer
83 views

Create new \score-like context/template in Lilypond

My current project is to create a number of short snippets for doumbek. To create each snippet, I use the following \score block: \header { piece = "Name here" } % different for each ...
  • 1,083
2 votes
1 answer
71 views

Lilypond Scheme Substitution function not using its arguments properly?

I would like to create a Lilypond music function that allows me to express this MWE: { \override Score.SpacingSpanner.base-shortest-duration = #(ly:make-moment 1/30) a b c } as \spn #1 #30 { a b c } ...
  • 514
4 votes
2 answers
374 views

"Wrong number of arguments to #<procedure #f (music)>" 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" ...
  • 3,472
3 votes
1 answer
131 views

lilypond scheme function optional argument

How do I make an argument in a scheme function optional? This says A Scheme type predicate for which argN must return #t. There is also a special form (predicate? default) for specifying optional ...
  • 708
2 votes
1 answer
162 views

correctly calling a lilypond scheme function

I have some general questions regarding calling a scheme function which I will ask using the following example code (which gives no errors and produces an output pdf): \version "2.20.0" ...
  • 708
4 votes
2 answers
120 views

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)) (...
  • 395
3 votes
1 answer
139 views

How to change the MIDI tempo with scheme?

I would like to create a function which would automate some tempo changes in my score (it would be hidden on the score with something like \override Score.MetronomeMark #'transparent = ##t, indeed the ...
  • 133
2 votes
0 answers
98 views

Lilypond - Slur arrow-heads changable between left and right side

I found this code for slur-arrows in this question and adapted this answer to make it look nicer. \version "2.22.0" slurArrow = \once \override Slur.stencil = #(lambda (grob) (let* ((...
  • 1,717
4 votes
2 answers
141 views

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 ...
  • 621
3 votes
3 answers
107 views

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 ...
4 votes
1 answer
118 views

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?) #{ \...
  • 43
4 votes
1 answer
162 views

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 ...
  • 63
5 votes
1 answer
427 views

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 "...
4 votes
1 answer
172 views

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 ...
3 votes
2 answers
970 views

How to define a LilyPond function to return set of notes given a pitch?

I'm working on a song with a repetitive rhythm that changes pitch. As this would normally involve a large amount of repeated typing, so I would like to define a LilyPond function to do this for me. I'...
  • 354
8 votes
2 answers
323 views

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 ...
4 votes
2 answers
325 views

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:...
9 votes
1 answer
526 views

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 \...
  • 17.6k