Hi Robert,

Try:

%%% BEGIN %%%

\version "2.25.19"

example = \relative c''
{
  \clef treble
  \key f \major
  \time 5/4
  <<
    \new Voice {
      \voiceOne
      \stemDown <a c>2 \stemNeutral <f a>4 <f a>2
    }
    \new Voice {
      \voiceTwo
      % \after 2 \< \after 8*7 \!\> \after 2 \!    % <== old
      \after 2 \< \after 8*7 \> \after 1 * 5/4 \!  % <== new
      % s2 d8 ( c b2 )     % <== old
      { s2 d8 ( c b2 ) }   % <== new
    }
  >>
}

{ \example }

%%% END %%%

[image: after-positioning.png]


HTH,

Trevor.

On Tue, May 7, 2024 at 2:19 PM Robert Garrigos <rob...@garrigos.cat> wrote:

> I have this code which uses \after to position dynamic marks in the right
> place where I want them:
>
> \version "2.25.14"
> \language "english"
>
> example = \relative c' {
>   \clef treble
>   \key c \major
>   \time 5/4
>   {
>     \after 2\< \after 8*7 \>
>     \repeat unfold 10 {e16 f} \!|
>   }
> }
>
> \score {
>   \new Staff \example
> }
>
> which prints:
>
>
> Trying it with a two voices fragment, doesn’t work:
>
> \version "2.25.14"
> \language "english"
>
> example = \relative c'' {
>   \clef treble
>   \key f \major
>   \time 5/4
> <<
>     \new Voice {
>       \voiceOne
>       \stemDown <a c>2 \stemNeutral <f a>4 <f a>2
>     }
>     \new Voice {
>       \voiceTwo
>       \after 2 \< \after 8*7 \!\> \after 2 \!
>       s2 d8(c b2)
>     }
>   >>
> }
>
> \score {
>   \new Staff \example
> }
>
> which prints wrong music:
>
>
> commenting out the \after line, prints the right music:
>
> \version "2.25.14"
> \language "english"
>
> example = \relative c'' {
>   \clef treble
>   \key f \major
>   \time 5/4
> <<
>     \new Voice {
>       \voiceOne
>       \stemDown <a c>2 \stemNeutral <f a>4 <f a>2
>     }
>     \new Voice {
>       \voiceTwo
>       % \after 2 \< \after 8*7 \!\> \after 2 \!
>       s2 d8(c b2)
>     }
>   >>
> }
>
> \score {
>   \new Staff \example
> }
>
>
> How can I have the dynamics in the same place as the first example in the
> two voices fragment?
>
> Thanks.
>
> Robert



-- 
Trevor Bača
www.trevorbaca.com
soundcloud.com/trevorbaca

Reply via email to