3

In a score, I would like to have my instrument names center aligned and the part numbers right-aligned, so that they are flush against the bracket. How would I do this? (Preferably without using the \translate or other markup fuctions like that). Shown below is what I currently have.

enter image description here

1 Answer 1

2

Wrap each of your instrument names in \hcenter-in #12 { … }. This will centre them horizontally in a box of width 12.
I chose a value for the width to be 12 because this leaves a nice-sized gap after the longest instrument name, but if yours is longer or shorter then you should change this value (but do use the same value for each instrument).

Put the instrument numbers after this.
Instruments that don’t have numbers (piccolo in my example) will need to account for the space with \hspace.

\version "2.24.0"

%% Piccolo
piccolo = {
    \new Staff {
        \set Staff.instrumentName = 
            \markup {
                \hcenter-in #12 {
                    "Piccolo"
                }
                \hspace #1.8
            }
            c'''
    }
}

%% Flutes
flutes = {
    \new Staff {
        \set Staff.instrumentName =
            \markup {
                \hcenter-in #12 {
                    "Flute"
                }
                \small
                \center-column {
                    \vspace #-0.5
                    "1" "2"
                    \vspace #-0.5
                }
            }
            \partCombine
            % flute one
                { c''' }
            % flute two
                { c'' }
    }
}

%% Oboes
oboes = {
    \new Staff {
        \set Staff.instrumentName =
            \markup {
                \hcenter-in #12 {
                    "Oboe"
                }
                \small
                \center-column {
                    \vspace #-0.5
                    "1" "2"
                    \vspace #-0.5
                }
            }
            \partCombine
            % oboe one
                { c'' }
            % oboe two
                { c' }
    }
}

%% Clarinets
clarinets = {
    \new Staff {
        \set Staff.instrumentName =
            \markup {
                \hcenter-in #12 {
                    \center-column {
                        \vspace #-0.3
                        \line {"Clarinet"}
                        \vspace #-0.4
                        \tiny \concat {"in B"\flat}
                        \vspace #-1
                    }
                }
                \small
                \center-column {
                    \vspace #-0.5
                    "1" "2"
                    \vspace #-0.5
                }
            }
        \key d \major
            \partCombine
            % clarinet one
                { d'' }
            % clarinet two
                { d' }
    }
}

%% Bassoons
bassoons = {
    \new Staff {
        \set Staff.instrumentName =
            \markup {
                \hcenter-in #12 {
                    "Bassoon"
                }
                \small
                \center-column {
                    \vspace #-0.5
                    "1" "2"
                    \vspace #-0.5
                }
            }
        \clef "bass"
            \partCombine
            % bassoon one
                { c }
            % bassoon two
                { c, }
    }
}

%% CONTENTS
contents = {
    \new StaffGroup {
        <<
            \new StaffGroup {
                \set StaffGroup.systemStartDelimiter = #'SystemStartSquare
                <<
                    \piccolo
                    \flutes
                >>
            }
            \oboes
            \clarinets
            \bassoons
        >>
    }
}

%% PAPER
\paper {
    left-margin = 1\in
}

%% PDF
\score {
    \contents
    \layout { }
}

Woodwind section with all instrument names horizontally centred about the same position and instrument numbers flush to the right.

3
  • Thank you! Looks perfect.
    – nat
    Commented May 3 at 19:47
  • Sorry to unearth an old question. What would be the easiest way to adjust the horizontal position of the numbers?
    – nat
    Commented May 22 at 23:31
  • 1
    @nat You could place say \hspace #1 before the \center-column block (and \small), and \hspace #-1 after the \center-column block. Commented May 23 at 0:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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