Re: Understanding how \tag works in \relative pitched music

2017-08-04 Thread Guy Stalnaker
So it's an Order of Operations issue. Pitches entered using \relative are
first converted to absolute then the selection using \tag conditional.

Which suggests that \tag used with \relative will never work.

Thanks.

On Aug 4, 2017 10:45 PM, "David Wright"  wrote:

> On Fri 04 Aug 2017 at 15:41:34 (-0500), Guy Stalnaker wrote:
> > All,
> >
> > Why is this output being created? I would expect to get exactly the same
> > pitches on all three staffs, but since not, my expectations are obviously
> > wrong.
> >
> > %% SNIPPET %%
> > ​straightMusic = \relative c' {
> >   a2 _\markup { no tag, relative pitch } cis4 e |
> >   fis1 |
> > }
> >
> > clarinetOneMusic = \relative c' {
> >   \set Score.markFormatter = #format-mark-box-numbers
> >   \tag #'mark { \mark \default a2 _\markup { tag mark, relative pitch }
> > cis4 e | }
> >   \tag #'no-mark { a2 _\markup { tag no-mark, relative pitch } cis4 e | }
> >   fis1 |
> > }
>
> Here are the pitches you have entered:
>
> straightMusic = \relative c' { a2 cis4 e fis1 }
>
> clarinetOneMusic = \relative c' { a2 cis4 e a2 cis4 e fis1 }
>
> These pitches are interpreted during _input_ of the source and
> become absolute pitches as they are read. They are now absolute
> and stay that way.
>
> You have then selected a different set of notes (each with an absolute
> pitch) for each staff by using tags, and then transposed them.
>
> In other words, \relative { … } is a one-shot, immediate input process
> for making melodic input more convenient (for those of us who like it).
>
> Bear in mind that if \relative { … } contains notes that are already
> absolute, eg,
> \relative { … \absolute { A } … \transpose { T } … \relative { R } … }
> the outer \relative does not reprocess A, T and R because they're
> already absolute. (R is processed by the inner \relative first.)
> Only the "…" notes are processed by the outer \relative.
>
> Cheers,
> David.
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Understanding how \tag works in \relative pitched music

2017-08-04 Thread David Wright
On Fri 04 Aug 2017 at 15:41:34 (-0500), Guy Stalnaker wrote:
> All,
> 
> Why is this output being created? I would expect to get exactly the same
> pitches on all three staffs, but since not, my expectations are obviously
> wrong.
> 
> %% SNIPPET %%
> ​straightMusic = \relative c' {
>   a2 _\markup { no tag, relative pitch } cis4 e |
>   fis1 |
> }
> 
> clarinetOneMusic = \relative c' {
>   \set Score.markFormatter = #format-mark-box-numbers
>   \tag #'mark { \mark \default a2 _\markup { tag mark, relative pitch }
> cis4 e | }
>   \tag #'no-mark { a2 _\markup { tag no-mark, relative pitch } cis4 e | }
>   fis1 |
> }

Here are the pitches you have entered:

straightMusic = \relative c' { a2 cis4 e fis1 }

clarinetOneMusic = \relative c' { a2 cis4 e a2 cis4 e fis1 }

These pitches are interpreted during _input_ of the source and
become absolute pitches as they are read. They are now absolute
and stay that way.

You have then selected a different set of notes (each with an absolute
pitch) for each staff by using tags, and then transposed them.

In other words, \relative { … } is a one-shot, immediate input process
for making melodic input more convenient (for those of us who like it).

Bear in mind that if \relative { … } contains notes that are already
absolute, eg,
\relative { … \absolute { A } … \transpose { T } … \relative { R } … }
the outer \relative does not reprocess A, T and R because they're
already absolute. (R is processed by the inner \relative first.)
Only the "…" notes are processed by the outer \relative.

Cheers,
David.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Understanding how \tag works in \relative pitched music

2017-08-04 Thread Martin Neubauer
Maybe someone more well-versed with the inner workings of lilypond might
correct me here, but as I understand it, the pitches depend on the
sequence of notes in the input, regardless of any tags that might be
attached to some of them. Conversely, when \keepWithTag (or any of the
related commands) get evaluated, the pitches are already fixed.

On 04/08/2017 22:41, Guy Stalnaker wrote:
> All,
> 
> Why is this output being created? I would expect to get exactly the same
> pitches on all three staffs, but since not, my expectations are
> obviously wrong.
> 
> %% SNIPPET %%
> ​straightMusic = \relative c' {
>   a2 _\markup { no tag, relative pitch } cis4 e |
>   fis1 |
> }
> 
> clarinetOneMusic = \relative c' {
>   \set Score.markFormatter = #format-mark-box-numbers
>   \tag #'mark { \mark \default a2 _\markup { tag mark, relative pitch }
> cis4 e | }
>   \tag #'no-mark { a2 _\markup { tag no-mark, relative pitch } cis4 e | }
>   fis1 |
> }
Not tested, but this might achieve what you want, while being somewhat
more predictable:

clarinetOneMusic = \relative c' {
  \set Score.markFormatter = #format-mark-box-numbers
  \tag #'mark { \mark \default <> _\markup { tag mark, relative pitch }}
  \tag #'no-mark { <> _\markup { tag no-mark, relative pitch } }
  a2 cis4 e |
  fis1 |
}
> 
> \score {
>   <<
> \new Staff {
>   \transpose bes c' \straightMusic
> }
> \new Staff {
>   \keepWithTag #'mark
>   \transpose bes c' \clarinetOneMusic
> }
> \new Staff {
>   \keepWithTag #'no-mark
>   \transpose bes c' \clarinetOneMusic
> }
>   >>
>   \layout { }
> }
> %% SNIPPET %%​
> 
> ​Inline image 1​
> 
> 
> Guy Stalnaker
> jimmyg...@gmail.com 
> 
> 
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
> 
-- 
Good People Wanted and Managers too!



signature.asc
Description: OpenPGP digital signature
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: making all grobs breakable (for easier polymetric scores)

2017-08-04 Thread Kieren MacMillan
Hi Malte,

> \set Staff.barAlways = ##t
> \set Staff.defaultBarType = ""
> 
> This sets a "" barline after every rhythmical event that occurs in the score 
> (not only the current staff). You then need to set the “real” barlines by 
> hand, something like:
> 
> \new Staff <<
>  { \time 3/2 c''1 2 1 2 }
>  \repeat unfold 2 { s1. \bar "|" }
> >>

OOH! All of this is quite helpful!

> to allow breaking in the middle of sounding notes you’ll need
> \remove Forbid_line_break_engraver
> in the Voice context(s).

Is there a way to turn that engraver on and off at will, rather than removing 
it entirely? Using

  \set Voice.forbidBreak = ##f

doesn't seem to work.

Thanks!
Kieren.


Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: i...@kierenmacmillan.info


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: making all grobs breakable (for easier polymetric scores)

2017-08-04 Thread Malte Meyn



Am 04.08.2017 um 19:33 schrieb Kieren MacMillan:

Is there any way to avoid this? I'd like to say, in effect, "during this passage, 
every (e.g.) eighth note should be considered a breakable point for the purposes of 
layout calculations".


\set Staff.barAlways = ##t
\set Staff.defaultBarType = ""

This sets a "" barline after every rhythmical event that occurs in the 
score (not only the current staff). You then need to set the “real” 
barlines by hand, something like:


\new Staff <<
  { \time 3/2 c''1 2 1 2 }
  \repeat unfold 2 { s1. \bar "|" }
>>


All notes would maintain their original duration (at least visually), all beaming would 
stay as expected, etc. — it would just allow breaking "everywhere". A command 
like


Hm … the solution from above breaks beaming because autobeaming never 
sets beams across barlines.



Any thoughts/comments would be appreciated — code that solves my problem, even 
more so!


The code above just inserts "" barlines; to allow breaking in the middle 
of sounding notes you’ll need


\remove Forbid_line_break_engraver

in the Voice context(s).

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Understanding how \tag works in \relative pitched music

2017-08-04 Thread Guy Stalnaker
All,

Why is this output being created? I would expect to get exactly the same
pitches on all three staffs, but since not, my expectations are obviously
wrong.

%% SNIPPET %%
​straightMusic = \relative c' {
  a2 _\markup { no tag, relative pitch } cis4 e |
  fis1 |
}

clarinetOneMusic = \relative c' {
  \set Score.markFormatter = #format-mark-box-numbers
  \tag #'mark { \mark \default a2 _\markup { tag mark, relative pitch }
cis4 e | }
  \tag #'no-mark { a2 _\markup { tag no-mark, relative pitch } cis4 e | }
  fis1 |
}

\score {
  <<
\new Staff {
  \transpose bes c' \straightMusic
}
\new Staff {
  \keepWithTag #'mark
  \transpose bes c' \clarinetOneMusic
}
\new Staff {
  \keepWithTag #'no-mark
  \transpose bes c' \clarinetOneMusic
}
  >>
  \layout { }
}
%% SNIPPET %%​

​[image: Inline image 1]​


Guy Stalnaker
jimmyg...@gmail.com
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


making all grobs breakable (for easier polymetric scores)

2017-08-04 Thread Kieren MacMillan
Hi all,

In the attached snippet, I must adjust the [non-visual] duration of the whole 
note and manually add an explicit \bar "" command in order to break the line 
where I want it.

Is there any way to avoid this? I'd like to say, in effect, "during this 
passage, every (e.g.) eighth note should be considered a breakable point for 
the purposes of layout calculations". All notes would maintain their original 
duration (at least visually), all beaming would stay as expected, etc. — it 
would just allow breaking "everywhere". A command like

   \override Score.NonMusicalPaperColumn.line-break-interval = #(ly:make-moment 
1/8)

would be amazing. I do a lot of polymetric passages, some with mixed meters on 
each staff, so doing layout work becomes a challenge when you have to keep 
adjusting durations, adding \bar-s, etc.

Any thoughts/comments would be appreciated — code that solves my problem, even 
more so!

Thanks,
Kieren.

%%%  SNIPPET BEGINS
\version "2.19"

\layout {
  line-width = 3\in
  ragged-right = ##f
  indent = 0
  \context {
\Score
\remove "Timing_translator"
\remove "Default_bar_line_engraver"
  }
  \context {
\Staff
\consists "Timing_translator"
\consists "Default_bar_line_engraver"
  }
}

<<
  \new Staff { \time 3/2 c''1 2 }
  \new Staff { \time 3/4 c''4 4 4 \break 4 4 4}
>>

<<
  \new Staff { \time 3/2 c''1*3/4 \bar "" s4 c''2 }
  \new Staff { \time 3/4 c''4 4 4 \break 4 4 4}
>>
%%%  SNIPPET ENDS


Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: i...@kierenmacmillan.info


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


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

2017-08-04 Thread Thomas Morley
d

2017-08-03 19:05 GMT+02:00 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: i...@kierenmacmillan.info


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"

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

2017-08-04 Thread 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: i...@kierenmacmillan.info


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user