1 %!PS-Adobe-1.0: lily.ps
3 % Functions for direct and embedded PostScript
10 1 copy mul exch 1 copy mul add sqrt
13 /draw_beam % width slope thick
15 2 div /beam_thick exch def
18 beam_slope beam_wd mul /beam_ht exch def
19 0 beam_thick neg moveto
20 beam_wd beam_ht rlineto
21 0 beam_thick 2 mul rlineto
26 /draw_repeat_slash % width slope thick
31 beamthick beamthick slope div euclidean_length
35 width slope width mul rlineto
37 % width neg width angle sin mul neg rlineto
41 /draw_hairpin % width start_h end_h thick
55 /draw_tuplet % height gap dx dy thick dir
65 tuplet_dy tuplet_dx div tuplet_gapx mul /tuplet_gapy exch def
69 0 tuplet_h dir mul lineto
70 tuplet_dx tuplet_gapx sub 2 div
71 tuplet_dy tuplet_gapy sub 2 div tuplet_h dir mul add lineto
72 tuplet_dx tuplet_gapx add 2 div
73 tuplet_dy tuplet_gapy add 2 div tuplet_h dir mul add moveto
74 tuplet_dx tuplet_dy tuplet_h dir mul add lineto
75 tuplet_dx tuplet_dy lineto
79 /difficult_draw_ez_ball % ch letter_col ball_col font
82 findfont 0.7 scalefont setfont
86 0.5 0 0.5 0 360 arc closepath fill stroke
91 0.5 0 0.4 0 360 arc closepath
96 % 0.25 is empiric centering. Change to taste
102 % Simple, but does it work everywhere?
103 % The filled circles are drawn by setting the linewidth
104 % to 2*radius and drawing a point. Is that (defined to be)
105 % a nice filled circle?
106 /draw_ez_ball % ch letter_col ball_col font
109 findfont 0.85 scalefont setfont
110 /origin { 0.45 0 } def
122 % 0.25 is empiric centering. Change to taste
129 /draw_volta % h w thick vert_start vert_end
143 volta_w volta_h lineto
150 % this is for drawing slurs.
151 /draw_bezier_sandwich % thickness controls
164 /draw_dashed_line % dash thickness dx dy
175 /draw_dashed_slur % dash thickness controls
192 /traject_alpha exch def
193 traject_ds traject_alpha sin mul add
195 traject_ds traject_alpha cos mul add
206 bracket_thick arch_height add half_height arch_thick sub arch_width add
207 arch_angle arch_height -0.15 mul bracket_traject
209 bracket_thick 0.5 mul half_height
210 0 arch_height 0.5 mul bracket_traject
214 bracket_thick half_height arch_thick sub
215 0 arch_height 0.4 mul bracket_traject
217 bracket_thick arch_height add half_height arch_thick sub arch_width add
218 arch_angle arch_height -0.25 mul bracket_traject
220 bracket_thick arch_height add half_height arch_thick sub arch_width add
222 bracket_thick half_height arch_thick sub
241 /draw_bracket % arch_angle arch_width arch_height bracket_height arch_thick bracket_thick
245 /bracket_thick exch def
247 /bracket_height exch def
248 /arch_height exch def
252 bracket_height 2 div bracket_thick add /half_height exch def
253 bracket_thick 0.5 mul setlinewidth