Hi Aaron,

thank you for your reply. I’ll try that later. Perhaps I should consider
having a separate dynamics variable in the long run though. Potential
issues like this could be so avoided by simply changing the problematic
line of code. That would also allow me to have both the “normal” dynamics
and the vertical aligned ones as needed, as suggested by other members in
my other threads.

Cheers
Martín.

On Fri 11. Sep 2020 at 12:25 Aaron Hill <lilyp...@hillvisions.com> wrote:

> On 2020-09-11 1:56 am, Martín Rincón Botero wrote:
>
> > Hello,
>
> >
>
> > sorry to bother again. I've been further exploring the Dynamics
>
> > context. I
>
> > just noticed that when there's a polyphonic passage, not only dynamics
>
> > don't align anymore, but also \remove engravers fails to do its job. Is
>
> > this a bug or is there any other engraver I should remove from the
>
> > Dynamics
>
> > context so that notes and text are not duplicated in polyphonic
>
> > passages?
>
>
>
> The issue seems to be with the << \\ >> construct implicitly referencing
>
> named Voice contexts.  Events within the Dynamics context are
>
> unintentionally leaking into the existing contexts and doubling the
>
> notes.  Consider:
>
>
>
> %%%%
>
> \version "2.20.0"
>
>
>
> musicI = << b'2\f \\ { g'4 4 } >>
>
> << \new Voice \musicI \new Dynamics \musicI >>
>
>
>
> musicII = << \context Voice = "1" { \voiceOne b'2\f }
>
>               \context Voice = "2" { \voiceTwo g'4 4 } >>
>
> << \new Voice \musicII \new Dynamics \musicII >>
>
> %%%%
>
>
>
> While I may be overlooking some details, the above expressions are
>
> logically equivalent.  That makes the << \\ >> construct tricky when
>
> being reused for Dynamics.
>
>
>
> Stripping out the VoiceSeparator *might* work:
>
>
>
> %%%%
>
> removeVoiceSeparator =
>
> #(define-music-function (music) (ly:music?)
>
>    (define (not-music-separator? m) (not (music-separator? m)))
>
>    (music-filter not-music-separator? music))
>
>
>
> << \new Voice \musicI
>
>     \new Dynamics \removeVoiceSeparator \musicI >>
>
> %%%%
>
>
>
> Whether this brings about new issues, I could not say.
>
>
>
>
>
> -- Aaron Hill
>
>
>
> --
www.martinrinconbotero.com

Reply via email to