2 % WARNING: don't leave blank lines in the PS-code; they are
3 % transformed into \par
7 % Should put in a lily-ps.ps header?
12 % header info (macros/defs, etc) should go into a \special{! ... },
13 % note the ! sign. See dvips.info for details.
17 % /foo { operatorname } bind def
19 % ``compiles'' operatorname binding in the body of foo, making
20 % the code faster, and more reliable (less flexible)
23 % transplant a TeX dimension into the PS output.
24 \def\PSsetTeXdimen#1{\expandafter\special{! /#1 (\the\csname #1\endcsname) deftexdimen}}
26 \def\turnOnPostScript{
28 % This sets CTM so that you get to the currentpoint
29 % by executing a 0 0 moveto
30 \special{ps: @beginspecial @setspecial ##1 @endspecial}
34 % width, slope, height
36 \special{! % round cappings
40 2 div /beam_thick exch def
43 beam_slope beam_wd mul /beam_ht exch def
44 0 beam_thick neg moveto
45 beam_wd beam_ht rlineto
46 0 beam_thick 2 mul rlineto
50 % PS helper: convert (0.2pt) to the token 0.2
51 /settexdimen { /thestring exch def
52 thestring 0 thestring length 2 sub
65 \PSsetTeXdimen{staffrulethickness}
66 \PSsetTeXdimen{staffheight}
70 staffrulethickness setlinewidth
75 cresc_wd cresc_cont moveto
78 cresc_wd cresc_cont neg moveto
90 cresc_wd cresc_ht lineto
92 0 cresc_cont neg moveto
93 cresc_wd cresc_ht neg lineto
98 1 copy mul exch 1 copy mul add sqrt
102 staffrulethickness setlinewidth
106 staffheight 2 div /plet_gap exch def
107 staffheight 4 div dir mul /plet_h exch def
109 plet_dy plet_dx lily_distance /plet_w exch def
110 plet_dy plet_dx atan rotate
113 plet_w plet_gap sub 2 div plet_h lineto
114 plet_w plet_gap add 2 div plet_h moveto
121 /slurhtlimit exch def
122 /slurratio 0.3333 def
124 % (b*ratio)/(1 + b / htlimit)
127 slurhtlimit 90 div /slur_alpha exch def
128 slurratio 60 div slur_alpha div /slur_beta exch def
129 slur_beta mul 1 atan slur_alpha mul
131 staffrulethickness 1.5 mul /slur_thick exch def
134 staffrulethickness setlinewidth
139 slur_dy slur_dx lily_distance /slur_b exch def
140 slur_b getslurcontrol
141 slur_dir mul /slur_ht exch def
142 slur_b getslurcontrol /slur_indent exch def
144 slur_dy slur_dx atan rotate
146 slur_b slur_indent sub slur_ht
150 slur_indent neg slur_ht slur_dir slur_thick mul sub
151 slur_indent slur_b sub slur_ht slur_dir slur_thick mul sub
164 \def\turnOnExperimentalFeatures{
165 % draw a slur in embedded postscript