trying to solve "cyclic chain in pure-Y-offset callbacks" error in custom (ScoreMarks) context

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

trying to solve "cyclic chain in pure-Y-offset callbacks" error in custom (ScoreMarks) context

Kieren MacMillan
Hello all,

In the snippet included below, I'm using a custom ScoreMarks context to show MetronomeMarks (plus, in the real world, RehearsalMarks and other things) above the system. The problem is, in order to have the MetronomeMark align correctly with the TimeSignature, I must (?) include the TimeSignature in some form or other. But I don't want the actual grob to appear, or affect spacing in any way *other than* helping with alignment.

All the attempts I've tried (\omit-s, stencil tweaks, etc.) throw "cyclic chain in pure-Y-offset callbacks" errors, which I have just been ignoring (for years now). But I'd like to solve this once and for all, if possible…

1. Is the error more serious than a simply aesthetic problem?

2. If not, is there some way to avoid seeing the errors?

3. In any case, is there a better way of doing what I'm trying to do (i.e., one that won't cause the error in the first place)?

Thanks,
Kieren.

%%%  SNIPPET BEGINS
\version "2.19"

\layout {
  \context {
    \type "Engraver_group"
    \name ScoreMarks
    \consists "Staff_collecting_engraver"
    \consists "Axis_group_engraver"
    \override VerticalAxisGroup.staff-affinity = #DOWN
    \consists "Metronome_mark_engraver"
    \override MetronomeMark.break-align-symbols =
      #'(left-edge staff-bar clef time-signature key-signature)
    \override MetronomeMark.non-break-align-symbols =
      #'(paper-column-interface)
  }
  \context {
    \Score
    \remove "Metronome_mark_engraver"
    \remove "Mark_engraver"
    \accepts ScoreMarks
  }
}

global = {
  \tempo "Testing"
  \time 2/2
  s1
}

\markup "No TimeSignature in ScoreMarks = incorrect alignment:"
\score {
  <<
    \new ScoreMarks \global
    \new Staff << \global c''1 >>
  >>
}

\markup "TimeSignature in ScoreMarks = correct alignment + unwanted grob + error:"
\score {
  <<
    \new ScoreMarks \global
    \new Staff << \global c''1 >>
  >>
  \layout {
    \context {
      \ScoreMarks
      \consists "Time_signature_engraver"
    }
  }
}

\markup "TimeSignature included in and then \omit-ed from ScoreMarks = correct alignment + error:"
\score {
  <<
    \new ScoreMarks \global
    \new Staff << \global c''1 >>
  >>
  \layout {
    \context {
      \ScoreMarks
      \consists "Time_signature_engraver"
      \omit TimeSignature
    }
  }
}
%%%  SNIPPET ENDS

________________________________

Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: [hidden email]


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: trying to solve "cyclic chain in pure-Y-offset callbacks" error in custom (ScoreMarks) context

Toine Schreurs-3
> In the snippet included below, I'm using a custom ScoreMarks context to show MetronomeMarks (plus, in the real world, RehearsalMarks and other things) above the system. The problem is, in order to have the MetronomeMark align correctly with the TimeSignature, I must (?) include the TimeSignature in some form or other. But I don't want the actual grob to appear, or affect spacing in any way *other than* helping with alignment.

>
> All the attempts I've tried (\omit-s, stencil tweaks, etc.) throw "cyclic chain in pure-Y-offset callbacks" errors, which I have just been ignoring (for years now). But I'd like to solve this once and for all, if possible…
>
> 1. Is the error more serious than a simply aesthetic problem?
>
> 2. If not, is there some way to avoid seeing the errors?
>
> 3. In any case, is there a better way of doing what I'm trying to do (i.e., one that won't cause the error in the first place)?

What about:
\layout {
  \context {
    \Score
    \remove Staff_collecting_engraver
  }
}

This apparently removes the errors/warnings. I have no idea about other
implications.

Toine Schreurs

> %%%  SNIPPET BEGINS
> \version "2.19"
>
> \layout {
>   \context {
>     \type "Engraver_group"
>     \name ScoreMarks
>     \consists "Staff_collecting_engraver"
>     \consists "Axis_group_engraver"
>     \override VerticalAxisGroup.staff-affinity = #DOWN
>     \consists "Metronome_mark_engraver"
>     \override MetronomeMark.break-align-symbols =
>       #'(left-edge staff-bar clef time-signature key-signature)
>     \override MetronomeMark.non-break-align-symbols =
>       #'(paper-column-interface)
>   }
>   \context {
>     \Score
>     \remove "Metronome_mark_engraver"
>     \remove "Mark_engraver"
>     \accepts ScoreMarks
>   }
> }
>
> global = {
>   \tempo "Testing"
>   \time 2/2
>   s1
> }
>
> \markup "No TimeSignature in ScoreMarks = incorrect alignment:"
> \score {
>   <<
>     \new ScoreMarks \global
>     \new Staff << \global c''1 >>
>   >>
> }
>
> \markup "TimeSignature in ScoreMarks = correct alignment + unwanted grob + error:"
> \score {
>   <<
>     \new ScoreMarks \global
>     \new Staff << \global c''1 >>
>   >>
>   \layout {
>     \context {
>       \ScoreMarks
>       \consists "Time_signature_engraver"
>     }
>   }
> }
>
> \markup "TimeSignature included in and then \omit-ed from ScoreMarks = correct alignment + error:"
> \score {
>   <<
>     \new ScoreMarks \global
>     \new Staff << \global c''1 >>
>   >>
>   \layout {
>     \context {
>       \ScoreMarks
>       \consists "Time_signature_engraver"
>       \omit TimeSignature
>     }
>   }
> }
> %%%  SNIPPET ENDS

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: trying to solve "cyclic chain in pure-Y-offset callbacks" error in custom (ScoreMarks) context

Kieren MacMillan
Hi Toine,

>> 3. In any case, is there a better way of doing what I'm trying to do (i.e., one that won't cause the error in the first place)?
>
> What about:
> \layout {
>  \context {
>    \Score
>    \remove Staff_collecting_engraver
>  }
> }

Whoa… that looks… potentially problematic. (Admittedly, that's just an instinct, and I have no knowledge or evidence to back it up!) It sure seems like there should be a less 'nuclear' option than that to solve my little alignment problem!

> This apparently removes the errors/warnings.

That's a good thing.

> I have no idea about other implications.

This is what I'm worried about… I'll wait to see if anyone weighs in with more details/info.

Thanks for the possible solution, in any case!
Kieren.
________________________________

Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: [hidden email]


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: trying to solve "cyclic chain in pure-Y-offset callbacks" error in custom (ScoreMarks) context

Thomas Morley-2
In reply to this post by Kieren MacMillan
d

2017-08-03 19:05 GMT+02:00 Kieren MacMillan <[hidden email]>:

> Hello all,
>
> In the snippet included below, I'm using a custom ScoreMarks context to show MetronomeMarks (plus, in the real world, RehearsalMarks and other things) above the system. The problem is, in order to have the MetronomeMark align correctly with the TimeSignature, I must (?) include the TimeSignature in some form or other. But I don't want the actual grob to appear, or affect spacing in any way *other than* helping with alignment.
>
> All the attempts I've tried (\omit-s, stencil tweaks, etc.) throw "cyclic chain in pure-Y-offset callbacks" errors, which I have just been ignoring (for years now). But I'd like to solve this once and for all, if possible…
>
> 1. Is the error more serious than a simply aesthetic problem?
>
> 2. If not, is there some way to avoid seeing the errors?
>
> 3. In any case, is there a better way of doing what I'm trying to do (i.e., one that won't cause the error in the first place)?
>
> Thanks,
> Kieren.
>
> %%%  SNIPPET BEGINS
> \version "2.19"
>
> \layout {
>   \context {
>     \type "Engraver_group"
>     \name ScoreMarks
>     \consists "Staff_collecting_engraver"
>     \consists "Axis_group_engraver"
>     \override VerticalAxisGroup.staff-affinity = #DOWN
>     \consists "Metronome_mark_engraver"
>     \override MetronomeMark.break-align-symbols =
>       #'(left-edge staff-bar clef time-signature key-signature)
>     \override MetronomeMark.non-break-align-symbols =
>       #'(paper-column-interface)
>   }
>   \context {
>     \Score
>     \remove "Metronome_mark_engraver"
>     \remove "Mark_engraver"
>     \accepts ScoreMarks
>   }
> }
>
> global = {
>   \tempo "Testing"
>   \time 2/2
>   s1
> }
>
> \markup "No TimeSignature in ScoreMarks = incorrect alignment:"
> \score {
>   <<
>     \new ScoreMarks \global
>     \new Staff << \global c''1 >>
>   >>
> }
>
> \markup "TimeSignature in ScoreMarks = correct alignment + unwanted grob + error:"
> \score {
>   <<
>     \new ScoreMarks \global
>     \new Staff << \global c''1 >>
>   >>
>   \layout {
>     \context {
>       \ScoreMarks
>       \consists "Time_signature_engraver"
>     }
>   }
> }
>
> \markup "TimeSignature included in and then \omit-ed from ScoreMarks = correct alignment + error:"
> \score {
>   <<
>     \new ScoreMarks \global
>     \new Staff << \global c''1 >>
>   >>
>   \layout {
>     \context {
>       \ScoreMarks
>       \consists "Time_signature_engraver"
>       \omit TimeSignature
>     }
>   }
> }
> %%%  SNIPPET ENDS
>
> ________________________________
>
> Kieren MacMillan, composer
> ‣ website: www.kierenmacmillan.info
> ‣ email: [hidden email]


Hi Kieren,

if I understand correctly, consisting "Staff_collecting_engraver" is
part of the Problem.
This makes sense only if ScoreMarks would be of type staff, which it
isn't currently.
More, your setting of \override VerticalAxisGroup.staff-affinity =
#DOWN let me think you don't _want_ it to be of type staff.
See NR 4.4.1:
"Setting staff-affinity to UP, CENTER, or DOWN causes a staff to be
spaced as a non-staff line."
Other problem is MetronomeMark.break-align-symbols can't do proper
aligning to time-signature if "Time_signature_engraver" is not in
ScoreMarks.

So delete the "Staff_collecting_engraver" from ScoreMarks, consist the
"Time_signature_engraver" and omit TimeSignature

If you really want the "Staff_collecting_engraver" in, consists
"Staff_symbol_engraver" and do
\override StaffSymbol.line-count = #0
Probably, don't set staff-affinity and space ScoreMarks vertically
with staff-staff-spacing.


\layout {
  \context {
    \type "Engraver_group"
    \name ScoreMarks
    \consists "Axis_group_engraver"
    \override VerticalAxisGroup.staff-affinity = #DOWN
    \override VerticalAxisGroup.nonstaff-relatedstaff-spacing.padding = 10
    \consists "Time_signature_engraver"
    \omit TimeSignature
    \consists "Metronome_mark_engraver"
    \override MetronomeMark.break-align-symbols =
      #'(left-edge staff-bar clef time-signature key-signature)
    \override MetronomeMark.non-break-align-symbols =
      #'(paper-column-interface)
  }
%% Or:
%{
  \context {
    \type "Engraver_group"
    \name ScoreMarks
    \consists "Staff_collecting_engraver"
    \consists "Staff_symbol_engraver"
    \override StaffSymbol.line-count = #0

    \consists "Axis_group_engraver"
    \override VerticalAxisGroup.staff-staff-spacing.padding = 10
    \consists "Time_signature_engraver"
    \omit TimeSignature
    \consists "Metronome_mark_engraver"
    \override MetronomeMark.break-align-symbols =
      #'(left-edge staff-bar clef time-signature key-signature)
    \override MetronomeMark.non-break-align-symbols =
      #'(paper-column-interface)
  }
%}
  \context {
    \Score
    \remove "Metronome_mark_engraver"
    \remove "Mark_engraver"
    \accepts ScoreMarks
  }
}

global = {
  \tempo "Testing"
  \time 2/2
  s1
}

\markup "correct"
\score {
  <<
    \new ScoreMarks \global
    \new Staff << \global c''1 >>
  >>
}



HTH,
  Harm

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: trying to solve "cyclic chain in pure-Y-offset callbacks" error in custom (ScoreMarks) context

Kieren MacMillan
Hi Harm,

> if I understand correctly, consisting "Staff_collecting_engraver" is part of the Problem.

Thanks! This solves the problem, with no obvious negative side-effects.

> This makes sense only if ScoreMarks would be of type staff, which it isn't currently.
> More, your setting of \override VerticalAxisGroup.staff-affinity =
> #DOWN let me think you don't _want_ it to be of type staff.

Correct.

I *vaguely* remember that I added the "Staff_collecting_engraver" a few years ago, when I was trying to find a way to "couple" each ScoreMark context with its associated StaffGroup, so that the marks disappeared along with the *last visible context* of that StaffGroup when french-ed. No doubt recent improvements in that area (keep-alive-together engravers etc.) make that moot — but I will have to look into it further when that use case comes up again (as it surely will).

In any case, your first fix is the answer I was looking for right now:

> \layout {
>  \context {
>    \type "Engraver_group"
>    \name ScoreMarks
>    \consists "Axis_group_engraver"
>    \override VerticalAxisGroup.staff-affinity = #DOWN
>    \override VerticalAxisGroup.nonstaff-relatedstaff-spacing.padding = 10
>    \consists "Time_signature_engraver"
>    \omit TimeSignature
>    \consists "Metronome_mark_engraver"
>    \override MetronomeMark.break-align-symbols =
>      #'(left-edge staff-bar clef time-signature key-signature)
>    \override MetronomeMark.non-break-align-symbols =
>      #'(paper-column-interface)
>  }

Many thanks!
Kieren.
________________________________

Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: [hidden email]


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Loading...