Jump to content

Instrument name as staff lines (alternative)

From LilyPond wiki

Instrument name as staff lines (alternative)

\version "2.24.0"

%%http://lsr.di.unimi.it/LSR/Item?id=983
% Credits: PPS, March 2015.

\paper {
  indent = 0
  tagline = ##f
}

\header {
  opus = \markup \fontsize #4 "BWV 1009"
  piece = \markup \fontsize #4 "Suite 3"
  %{ %% alternative font:
  opus = \markup
          \override #'(font-name . "Purisa bold")
          \concat {
            \fontsize #5  "BWV"
            \hspace #1
            \fontsize #7 "1009"
          }

  piece = \markup
          \override #'(font-name . "Purisa bold")
          \concat {
            \fontsize #5  "Suite"
            \hspace #.6
            \fontsize #7 "3"
          }
  %}
}

\score {
  \new Voice
  \relative c' {
    \once\omit Staff.Clef
    \once\omit Staff.TimeSignature
    \time 4/4
    \textLengthOn
      s1
      -\tweak extra-offset #'(-1 . -4.25)
      ^\markup \concat {
        \fontsize #4
        \scale #'(0.99 . 1.32)
        "Prélude"
       %{ %% alternative font:
          -\tweak extra-offset #'(-1 . -4.5)
          ^\markup \concat {
            \fontsize #4
            \scale #'(0.82 . 1.3)
            \override #'(font-name . "Purisa bold")
            "Prélude"
       %}
      }
    \once\hide Staff.BarLine
    \once\override Staff.Clef.full-size-change = ##t
    \set Score.currentBarNumber = #1
    \tempo "(Presto)"
    \clef F
    \time 3/4
    c8 b16 a g f e d c g e g |
    c,4~ c16 d e f g a b c   |
    d c b a g a b c d e f d  |
    \break
    e f e d c d e f g a b c |
    d c b a g a b c d e f d |
    e f e d c c b a g f e d |
  }
  \layout {
    \context {
      \Staff
      %instrumentName = \markup { \prelude }
%      \override InstrumentName.self-alignment-X = #RIGHT
%      \override InstrumentName.self-alignment-Y = ##f
%      \override InstrumentName.padding = #-.2
    }
  }
}