Jump to content

Flat and sharp symbols in text-markups: Difference between revisions

From LilyPond wiki
Import snippet from LSR
 
m Replace version="2.24.0" with version="2.24" now that the LilyWiki extension supports auto-selecting the latest release in a stable series
Line 1: Line 1:
If you want to use flat or sharp symbols in text, you may want to adjust the horizontal and vertical position of the \flat or \sharp.
If you want to use flat or sharp symbols in text, you may want to adjust the horizontal and vertical position of the \flat or \sharp.


<lilypond version="2.24.0">
<lilypond version="2.24">
%% http://lsr.di.unimi.it/LSR/Item?id=288
%% http://lsr.di.unimi.it/LSR/Item?id=288



Revision as of 18:53, 16 November 2025

If you want to use flat or sharp symbols in text, you may want to adjust the horizontal and vertical position of the \flat or \sharp.

\version "2.24"

%% http://lsr.di.unimi.it/LSR/Item?id=288


raisedFlat = \markup { \translate #(cons -0.4 0.5) \smaller \flat  }

\new Staff {
  \set Staff.instrumentName = \markup { 
    \center-column  {
      \line {  Solo Clar. }   
      \line { "in B"\raisedFlat } 
    }
  }
  \relative c' { 
    des1^\markup { "D" \translate #(cons -0.3 0.4) \flat "major" } ~  | des | 
    dis1^\markup { "D" \translate #(cons -0.3 0.9) \sharp "minor" } ~ | dis1 
    \bar "||"
 } 
}

\paper {
  ragged-right = ##t 
}