Eyeglasses as markup: Difference between revisions

Import snippet from LSR
 
Postscript version now removed
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
To insert alternative eyeglasses into a score (strongly indicating that one should look at the conductor), one has to insert self-defined path code as a markup.
The <code>\eyeglasses</code> markup command displays eyeglasses, strongly indicating that one should look at a conductor. This snippet defines an <code>\altEyeglasses</code> command with a different style.


myEyeglasses support svg ouput.
Credit: Pierre Perol-Schneider on March 2015


<lilypond version="2.24.0" full>
<lilypond version="2.24.0">
%% http://lsr.di.unimi.it/LSR/Item?id=982
altEyeglassesMarkup =
%% see also http://lsr.di.unimi.it/LSR/Item?id=435
  \markup
 
  \override #'(line-cap-style . butt)
% Credit: PPS on March 2015
  \path #0.15
 
   #'((moveto  -3.57  1.80)
\paper { tagline = ##f }
 
#(define my-eyeglassespath
   '((moveto  -3.57  1.80)
     (curveto  -3.65  1.90  -3.55  2.22  -3.33  2.22)
     (curveto  -3.65  1.90  -3.55  2.22  -3.33  2.22)
     (curveto  -3.17  2.22  -3.15  2.15  -3.10  2.10)
     (curveto  -3.17  2.22  -3.15  2.15  -3.10  2.10)
Line 32: Line 28:
     (moveto    0.12  1.68)
     (moveto    0.12  1.68)
     (lineto  -1.10  2.69)
     (lineto  -1.10  2.69)
     (curveto  -1.50  3.05  -1.80  2.75  -1.71  2.45)))
     (curveto  -1.50  3.05  -1.80  2.75  -1.71  2.45))
 
#(define-markup-command (myEyeglasses layout props)
  ()
"Prints out alternative eyeglasses, indicating strongly to look at the conductor."
  (interpret-markup layout props
    #{
      \markup
      \override #'(line-cap-style . butt)
      \path #0.15
      \my-eyeglassespath
    #}))


%%%% Example:
% Turn it into an actual markup command rather than
% variable set to a markup object.
#(define-markup-command (altEyeglasses layout props) ()
  (interpret-markup layout props altEyeglassesMarkup))


\markup\italic "Standard eyeglasses"  
\markup "Standard eyeglasses"  
%% as defined in define-markup-commands.scm
\relative c'' {  
\relative c'' {  
   c2^\markup\eyeglasses   
   c2^\markup\eyeglasses   
Line 54: Line 41:
}
}


\markup\italic "Alternative eyeglasses"
\markup "Alternative eyeglasses"
\relative c'' {  
\relative c'' {  
   c2^\markup\myEyeglasses  
   c2^\markup\altEyeglasses  
   a2_\markup\myEyeglasses
   a2_\markup\altEyeglasses
}
}
</lilypond>
</lilypond>