lilypond-user
[Top][All Lists]
Advanced

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

Re: Dynamics for both staves


From: Knute Snortum
Subject: Re: Dynamics for both staves
Date: Fri, 3 Feb 2023 08:41:03 -0800

On Fri, Feb 3, 2023 at 12:21 AM Paulo Matos <pmatos@igalia.com> wrote:
>
> Hi,
>
> I am trying to apply dynamic marking like piano and so forth to both
> staves.
[...]
> i.e. start a new group called Dynamics and add the dynamics there but
> this seems suboptimal as it makes the typesetting separate from the
> notes _and_ as far as I understand it, doesn't affect MIDI - and the
> first solution does.
> Is there a better solution to this?

What I do is have a separate dynamics variable, then include that
variable in both staves of the piano staff in the midi block.  Then I
switch the dynamic performer to the staff level.  It looks like this
(for only one staff):

\version "2.25.2"

music = { c''4 4 4 4 }

dyn = { s4\f s\mf s\mp s\p }

\score {
  <<
    \new Staff \music
    \new Dynamics \dyn
  >>
  \layout {}
}

\score {
  \new Staff << \music \dyn >>
  \midi {
      \context {
      \Staff
      \consists "Dynamic_performer"
    }
    \context {
      \Voice
      \remove "Dynamic_performer"
    }
  }
}

-- 
Knute Snortum



reply via email to

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