Re: \markup on "topmost" voice in a Frenched score?

2019-03-14 Thread Aaron Hill

On 2019-03-14 10:35 am, N. Andrew Walsh wrote:
On Thu, Mar 14, 2019 at 4:36 PM Aaron Hill  
wrote:
Seems like \mark would work.  RehearsalMarks belong to the Score and 
are

by default placed above the entire system regardless of any staves.

This does seem like it wold work well. Is there a way to have a \mark 
that
includes both the \default command and a \markup block at the same 
point?
The client wants Roman-numeral rehearsal marks, but at some of them 
also

wants these section titles.


Well, you can always \override the stencil of the RehearsalMark.  Using 
grob-transformer, it is possible to reuse the original value when 
building the new one.  Consider the following:



\version "2.19.82"

#(define ((align-and-combine axis direction parent self padding) first 
second)

  "Aligns and combines two stencils.  The @var{axis} and @var{direction}
arguments specify on which side of the first stencil the second stencil
will be placed.  The @var{parent} and @var{self} arguments establish the
reference points on the first and second stencils, respectively, that
will be aligned on the opposite axis."
  (if (and (ly:stencil? first) (ly:stencil? second))
(ly:stencil-combine-at-edge first axis direction
  (ly:stencil-translate-axis
(ly:stencil-aligned-to second (- 1 axis) self)
(interval-index (ly:stencil-extent first (- 1 axis)) parent) (- 
1 axis))

  padding)))

%% Here are some convenience procedures using align-and-combine.
#(define centered-above (align-and-combine Y UP CENTER CENTER 1))
#(define as-superscript (align-and-combine X RIGHT UP DOWN 0))
#(define left-aligned-below (align-and-combine Y DOWN LEFT LEFT 1))

combineWithMark = #(define-music-function (proc arg)
  ((procedure? centered-above) markup?)
  "Combines the specified markup with an existing RehearsalMark.
The @var{proc} argument specifies how the stencils are to be combined."
  #{ \once \override Score.RehearsalMark.stencil =
   #(grob-transformer 'stencil (lambda (grob old)
 (proc old (grob-interpret-markup grob arg #} )

\paper { line-width = 5\in }
{
  % Default is #centered-above.
  \combineWithMark \markup \italic "centered-above"
  \mark \default \repeat unfold 5 { b'1 } \bar "."
  \once \override Score.RehearsalMark.self-alignment-X = #RIGHT
  \combineWithMark #as-superscript \markup \italic "as-superscript"
  \mark \default \repeat unfold 5 { b'1 } \bar "."
  \once \override Score.RehearsalMark.self-alignment-X = #LEFT
  \combineWithMark #left-aligned-below \markup \italic 
"left-aligned-below"

  \mark \default \repeat unfold 5 { b'1 }
}



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


Re: \markup on "topmost" voice in a Frenched score?

2019-03-14 Thread N. Andrew Walsh
Hi Aaron,

On Thu, Mar 14, 2019 at 4:36 PM Aaron Hill  wrote:

>
> Seems like \mark would work.  RehearsalMarks belong to the Score and are
> by default placed above the entire system regardless of any staves.
>
>
This does seem like it wold work well. Is there a way to have a \mark that
includes both the \default command and a \markup block at the same point?
The client wants Roman-numeral rehearsal marks, but at some of them also
wants these section titles.

Thanks for the help!

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


Re: \markup on "topmost" voice in a Frenched score?

2019-03-14 Thread Ben

On 3/14/2019 11:32 AM, Aaron Hill wrote:

On 2019-03-14 7:12 am, N. Andrew Walsh wrote:

Hi List,

I have a small chamber setting that includes section titles that the 
client
wants at the top of systems (stuff like "Interlude," "Finale," etc.). 
The

problem I'm having is, as this is a "Frenched" score the topmost voice
isn't always the same one. So I can't attach a \markup to a specific 
voice,
but I want to find a way to apply them to whichever voice happens to 
be at

the top of the score *at that point*.

Is there a way to do that? Is there some conditional formatting that 
can be
applied to achieve something like that? I imagine this would also 
apply to

tempo indications and other similar score instructions.


Seems like \mark would work.  RehearsalMarks belong to the Score and 
are by default placed above the entire system regardless of any staves.



-- Aaron Hill



That is very clever, Aaron - thank you! I'm going to make a note of this...

\version "2.19.80"

\new Staff
{
  \once \override Score.RehearsalMark.Y-offset = #10
  \mark "Interlude" s1
}

\paper {
  top-margin = 0.5\in
  left-margin = 0.75\in
  right-margin = 0.75\in
  bottom-margin = 0.5\in
}

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


Re: \markup on "topmost" voice in a Frenched score?

2019-03-14 Thread Aaron Hill

On 2019-03-14 7:12 am, N. Andrew Walsh wrote:

Hi List,

I have a small chamber setting that includes section titles that the 
client
wants at the top of systems (stuff like "Interlude," "Finale," etc.). 
The

problem I'm having is, as this is a "Frenched" score the topmost voice
isn't always the same one. So I can't attach a \markup to a specific 
voice,
but I want to find a way to apply them to whichever voice happens to be 
at

the top of the score *at that point*.

Is there a way to do that? Is there some conditional formatting that 
can be
applied to achieve something like that? I imagine this would also apply 
to

tempo indications and other similar score instructions.


Seems like \mark would work.  RehearsalMarks belong to the Score and are 
by default placed above the entire system regardless of any staves.



-- Aaron Hill

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


Re: \markup on "topmost" voice in a Frenched score?

2019-03-14 Thread Ben

On 3/14/2019 10:12 AM, N. Andrew Walsh wrote:

Hi List,

I have a small chamber setting that includes section titles that the 
client wants at the top of systems (stuff like "Interlude," "Finale," 
etc.). The problem I'm having is, as this is a "Frenched" score the 
topmost voice isn't always the same one. So I can't attach a \markup 
to a specific voice, but I want to find a way to apply them to 
whichever voice happens to be at the top of the score *at that point*.


Is there a way to do that? Is there some conditional formatting that 
can be applied to achieve something like that? I imagine this would 
also apply to tempo indications and other similar score instructions.


Thanks for the help,

A


Hello,

I can't quite picture exactly what you're describing, but if you're 
trying to attach markup like section titles, maybe you could just attach 
the markup to something like time signatures instead, and then adjust 
the location to taste? (see attached)


If you have any code to share from your example though, please :) 
Frenched scores can vary a good amount depending on where and how you 
cutaway, etc.


Here's an example of what I mean. Hope this helps:

\version "2.19.80"

\new Staff
{
  \numericTimeSignature
  \tweak stencil
  #(grob-transformer 'stencil (lambda (grob default)
    (grob-interpret-markup grob
  #{ \markup \column {
    \stencil #default
    \vspace #-3.5
    \small \with-color #black "FINALE"
  } #})))
  \time 4/4 s1
}

\paper {
  top-margin = 0.5\in
  left-margin = 0.75\in
  right-margin = 0.75\in
  bottom-margin = 0.5\in
}

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


\markup on "topmost" voice in a Frenched score?

2019-03-14 Thread N. Andrew Walsh
Hi List,

I have a small chamber setting that includes section titles that the client
wants at the top of systems (stuff like "Interlude," "Finale," etc.). The
problem I'm having is, as this is a "Frenched" score the topmost voice
isn't always the same one. So I can't attach a \markup to a specific voice,
but I want to find a way to apply them to whichever voice happens to be at
the top of the score *at that point*.

Is there a way to do that? Is there some conditional formatting that can be
applied to achieve something like that? I imagine this would also apply to
tempo indications and other similar score instructions.

Thanks for the help,

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