Skip to main content
Removed the so-called "Known Failure." A counterexample was easily found in the documentation.
Source Link
Neal
  • 3.5k
  • 1
  • 13
  • 30

Question:

Is there a way to change how the score title appears based on whether it’s on an odd or even page?

Given:

% --- paper.ily
\paper {
  scoreTitleMarkup = \markup \column {
    \fill-line {
      \box \fromproperty #'header:order
      \bold \fromproperty #'header:title
      \null
    }
    \fill-line {
      \null
      \italic \fromproperty #'header:author
    }
  }
}
% --- score.ily
\score {
  <<
    \new Staff \music
  >>
  \header {
    title = \title
    order = \order
    author = \author
  }
}
% --- compile.ly
title = "Good Afternoon"
order = "1"
author = "Santa"
music = {
  % ...
}
\include "./score.ily"

title = "Good Evening"
order = "2"
author = "Elves"
music = {
  % ...
}
\include "./score.ily"

title = "Good Night"
order = "3"
author = "Truman"
music = {
  % ...
}
\include "./score.ily"

Result:

two sheet music pages side-by-side, all score titles look the same

Contrived Example:

(Notice the order and author are on reversed sides on the right-hand page.)

two sheet music pages side-by-side, scores look different on odd and even pages

Known Failures:

  • Unless I am doing something wrong, \if and \unless conditions only work with the [even|odd][Header|Footer]Markup variables, affecting the top and bottom of the page — not the score. Therefore, the first thing I thought of that would be awesome to work… won’t work.

Question:

Is there a way to change how the score title appears based on whether it’s on an odd or even page?

Given:

% --- paper.ily
\paper {
  scoreTitleMarkup = \markup \column {
    \fill-line {
      \box \fromproperty #'header:order
      \bold \fromproperty #'header:title
      \null
    }
    \fill-line {
      \null
      \italic \fromproperty #'header:author
    }
  }
}
% --- score.ily
\score {
  <<
    \new Staff \music
  >>
  \header {
    title = \title
    order = \order
    author = \author
  }
}
% --- compile.ly
title = "Good Afternoon"
order = "1"
author = "Santa"
music = {
  % ...
}
\include "./score.ily"

title = "Good Evening"
order = "2"
author = "Elves"
music = {
  % ...
}
\include "./score.ily"

title = "Good Night"
order = "3"
author = "Truman"
music = {
  % ...
}
\include "./score.ily"

Result:

two sheet music pages side-by-side, all score titles look the same

Contrived Example:

(Notice the order and author are on reversed sides on the right-hand page.)

two sheet music pages side-by-side, scores look different on odd and even pages

Known Failures:

  • Unless I am doing something wrong, \if and \unless conditions only work with the [even|odd][Header|Footer]Markup variables, affecting the top and bottom of the page — not the score. Therefore, the first thing I thought of that would be awesome to work… won’t work.

Question:

Is there a way to change how the score title appears based on whether it’s on an odd or even page?

Given:

% --- paper.ily
\paper {
  scoreTitleMarkup = \markup \column {
    \fill-line {
      \box \fromproperty #'header:order
      \bold \fromproperty #'header:title
      \null
    }
    \fill-line {
      \null
      \italic \fromproperty #'header:author
    }
  }
}
% --- score.ily
\score {
  <<
    \new Staff \music
  >>
  \header {
    title = \title
    order = \order
    author = \author
  }
}
% --- compile.ly
title = "Good Afternoon"
order = "1"
author = "Santa"
music = {
  % ...
}
\include "./score.ily"

title = "Good Evening"
order = "2"
author = "Elves"
music = {
  % ...
}
\include "./score.ily"

title = "Good Night"
order = "3"
author = "Truman"
music = {
  % ...
}
\include "./score.ily"

Result:

two sheet music pages side-by-side, all score titles look the same

Contrived Example:

(Notice the order and author are on reversed sides on the right-hand page.)

two sheet music pages side-by-side, scores look different on odd and even pages

Source Link
Neal
  • 3.5k
  • 1
  • 13
  • 30

LilyPond - Can I change the scoreTitleMarkup style/content depending on the page number?

Question:

Is there a way to change how the score title appears based on whether it’s on an odd or even page?

Given:

% --- paper.ily
\paper {
  scoreTitleMarkup = \markup \column {
    \fill-line {
      \box \fromproperty #'header:order
      \bold \fromproperty #'header:title
      \null
    }
    \fill-line {
      \null
      \italic \fromproperty #'header:author
    }
  }
}
% --- score.ily
\score {
  <<
    \new Staff \music
  >>
  \header {
    title = \title
    order = \order
    author = \author
  }
}
% --- compile.ly
title = "Good Afternoon"
order = "1"
author = "Santa"
music = {
  % ...
}
\include "./score.ily"

title = "Good Evening"
order = "2"
author = "Elves"
music = {
  % ...
}
\include "./score.ily"

title = "Good Night"
order = "3"
author = "Truman"
music = {
  % ...
}
\include "./score.ily"

Result:

two sheet music pages side-by-side, all score titles look the same

Contrived Example:

(Notice the order and author are on reversed sides on the right-hand page.)

two sheet music pages side-by-side, scores look different on odd and even pages

Known Failures:

  • Unless I am doing something wrong, \if and \unless conditions only work with the [even|odd][Header|Footer]Markup variables, affecting the top and bottom of the page — not the score. Therefore, the first thing I thought of that would be awesome to work… won’t work.