3

I am preparing in LilyPond a music book divided into many sections, each having a title. I want to keep the formatting of all titles in a single place, to make future format changes easier, and know two methods to do so: using \define-scheme-function, and using \define-markup-command -

#(define-markup-command (section_title_MC layout props text) (markup?)
  (interpret-markup layout props
   #{ 
     \markup \bold \fontsize #3 { #text } 
   #}))

section_title_SF = #(define-scheme-function
     (parser location text)(markup?)
   #{
      \markup \column {
      \bold \fontsize #3 { #text }
      }
   #})

\markup \section_title_MC "Etudes in C Major"

{
  \key c \major
  c'1
}


\section_title_SF "Etudes in G Major"

{
  \key g \major
  g'1
}

enter image description here

My problem is that neither method seem to respect music symbols, such as \flat and \sharp:

\markup \section_title_MC "Etudes in B \flat Major"

{
  \key bes \major
  bes'1
}

\section_title_SF "Etudes in E \flat Major"

{
  \key ees \major
  ees'1
}

enter image description here

Compare this with “direct” markup:

\markup {\bold \fontsize #3 { Etudes in B \flat Major }}

{
  \key bes \major
  bes'1
}

enter image description here

Will appreciate any help. Thanks!

4

A string is a string.

#(define-markup-command (section_title_MC layout props text) (markup?)
  (interpret-markup layout props
   #{ 
     \markup \bold \fontsize #3 { #text } 
   #}))

section_title_SF = #(define-scheme-function
     (parser location text)(markup?)
   #{
      \markup \column {
      \bold \fontsize #3 { #text }
      }
   #})

\markup \section_title_MC \line { Etudes in \concat { B \raise #1 \flat } Major }

{
  \key bes \major
  bes'1
}


\section_title_SF \markup { Etudes in \concat { E \raise #1 \flat } Major }

{
  \key ees \major
  ees'1
}
| improve this answer | |
  • Thanks! That solved my problem. – Buchuck Jan 18 at 15:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.