[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dynamics context

From: Martín Rincón Botero
Subject: Re: Dynamics context
Date: Tue, 8 Sep 2020 11:17:36 +0200

Hi Kieren,

thank you for your answer. Here a MWE:

\version "2.20.0"

scoreAViolinI = \relative c'' {
r2 r4 d,16-.\p\< dis'-. e-. g-.
fis,4:32->\ff\>^"sul pont." r\! r2

\score {
  \new Voice \with { \remove "Dynamic_engraver" } \scoreAViolinI
    \new Dynamics \scoreAViolinI  >>
 \layout {
     \context {
    \override VerticalAxisGroup.nonstaff-relatedstaff-spacing.basic-distance = #0

For I which I get the attached result. Weirdly, with this minimal example I'm also getting a bunch of "script direction not yet known". I don't think that was happening before. Anyways, the visual result is the same I was getting with the full code, with duplicated articulations and text.

Am Mo., 7. Sept. 2020 um 18:27 Uhr schrieb Kieren MacMillan <>:
Hi Martín,

> I wanted to ask if using the Dynamics context is the simplest way available in Lilypond for achieving this kind of vertically aligned dynamics.

I believe so.

> The huge drawback of the Dynamics context is that it disrupts the syntax, since dynamics can’t be used next to the first note they’re attached to, but instead they need a separate variable, reducing readability of the actual “music”.

I imagine three possible ways to solve this problem, while being able to enter all input (notes, dynamics, etc.) in a single variable:

1. Send the variable into two different contexts, one (the "Staff") which strips all dynamic events, and one (the "Dynamics") which contains only dynamic events. It seems like this is what you tried to do, but failed at — perhaps if you include a MWE, we can all work with it and see how it can be improved.

2. Have a mechanism like "\change Staff" which allows you to "push" dynamic events into a separate context (the way that staff changes "pushes" notes into a different staff context).

3. Write an engraver that does the extraction/removal/addition automagically.

I have not put a lot of effort (or even thought) into seeing which of these is even possible in Lilypond… but maybe this thread will inspire the community (including me) to do so?


Kieren MacMillan, composer (he/him/his)
‣ website:
‣ email:


Attachment: Example.png
Description: PNG image

reply via email to

[Prev in Thread] Current Thread [Next in Thread]