3 % Here are two types of pianobrackets available, they are absolute compatible,
4 % so choose this one you prefer (search for '%!!!')
10 thin_pen:= pencircle scaled max(1,.2pt+blacker);
11 med_pen:= pencircle scaled med;
14 message ("<big braces>");
17 firstbrace:=20; % smallest brace is 2*20 pt (\simeq 14mm)
18 lastbrace:=67; % largest brace is 2*67 pt (\simeq 47mm)
20 %%% from Stanislav Kneifl
22 def drawpianobracket (expr height) =
23 u# := 1nhh#/5pt# * 1pt#;
24 v# := (height/40) * 1pt#;
26 % beginchar (height-firstbrace, 1.25nhh#, 0, 0);
27 beginchar (height-firstbrace, 0, 0, 0);
34 penpos1 (max(1,0.1u), 125);
39 penpos6 (max(2,0.3u), 150);
40 penstroke z1e{dir 35}..z2e..z3e..z4e..z5e..{dir 60}z6e;
41 currenttransform := identity reflectedabout ((0,0),(1,0));
42 penstroke z1e{dir 35}..z2e..z3e..z4e..z5e..{dir 60}z6e;
43 currenttransform := identity;
45 currentpicture:=currentpicture shifted (round(-1.75nhh), 0);
50 def bigbrace(expr v) =
51 beginchar (v-firstbrace, 0, 0, 0);
52 " brace vsize "&decimal round(2v*pt#)&"pt";
54 hwidth:=max(.1vwidth,3.25pt);
55 hwidth:=min(hwidth,6.5pt);
58 x2l=-.8hwidth; y2=2/3vwidth;
59 x3r=.2hwidth; y3=1/3vwidth;
61 penpos1(max(1,.25pt),-35);
62 penpos2(1.5med+actwidth,40);
63 penpos3(1.75med+actwidth,45);
64 penpos4(max(1,.2pt),-90);
65 penstroke z1e..z2e..z3e..{left+sw}z4e;
66 currentpen:= pencircle; draw z1..z2..z3..{left+sw}z4;
67 addto currentpicture also currentpicture reflectedabout (origin, right);
69 currentpicture:= currentpicture shifted (round(-.75nhh), 0);
73 %!!! comment the line 'bigbrace' and uncomment the line 'drawpianobracket'
74 % or leave it like it is !!!
76 for v=firstbrace upto lastbrace :
78 % drawpianobracket (v);
82 message ("<glissandi-elements>");
84 % glissando{slide} (slope [degree])
86 def glissando (expr theta)=
87 x1=-1; y1=0; z2=z1+(.5nhw,0); z3=z1+(nhw+1,0);
88 p:= z1{1.25up+right}..{1.25down+right}z2{1.25down+right}..{1.25up+right}z3;
89 pickup penrazor scaled (.075nhw+thick) rotated (theta+65);
96 beginchar(56+slope-1, (cosd(10slope))*nhw#,(sind(10slope))*nhw#, 0);
97 " glissando element slope "&decimal (10slope)&" degree";
99 save_pic:= currentpicture;
102 beginchar(64+slope-1, (cosd(10slope))*nhw#, (sind(10slope))*nhw#, 0);
103 " glissando element slope "&decimal (-10slope)&" degree";
104 currentpicture:= save_pic reflectedabout (origin, right);
110 message ("<guitar chords>");
112 def tabulatur (expr nd)=
114 x1=x2=y2=y3=0; x3=w; y1=-nd;
115 fill unitsquare xscaled (w+2thinwidth) yscaled (med+.2pt)
116 shifted(-thinwidth,0);
119 draw (z2--z3) shifted (0,v*-hwidth);
123 draw (z1--z2) shifted (v*hwidth,0);
128 %beginchar(72, 15/4nhw#, 0, 0);" grid";
129 % tabulatur (54/10nhh);
132 %beginchar(73, 15/8nhw#, 0, 0); " dot";
133 % fill fullcircle scaled .675nhh shifted (w,-.45nhh);
136 %beginchar(74, 15/4nhw#, 0, 0); " bar";
137 % fill unitsquare xscaled w yscaled .3nhh shifted (0,-.6nhh);
141 def Circle (expr nh)=
142 x1l=.1w; x2=x4=.5w; x3l=.9w;
143 y1=y3=.5nh+shift; y2=.1nh+shift; y4=.9nh+shift;
145 penpos2(thinwidth,90);
147 penpos4(thinwidth, 270);
148 penstroke z1e..z2e..z3e..z4e..cycle;
149 pickup pencircle; draw z1..z2..z3..z4..cycle;
152 %beginchar(75, 3/4nhw#, 0, 0); " circle";
157 x1=x3=.2w; x2=x4=.8w;
158 y1=y4=.2nh+shift; y2=y3=nh-.2nh+shift;
160 draw z1--z2; draw z3--z4;
164 %beginchar(76, 3/4nhw#, 0, 0); " cross";
168 %beginchar(77, 3/4nhw#, 0, 0); " blank";
171 beginchar(72, 3nhw#, 0, 0);" small grid";
172 tabulatur (108/25nhh);
175 beginchar(73, 3/2nhw#, 0, 0); " small dot";
176 fill fullcircle scaled .54nhh shifted (w,-.36nhh);
179 beginchar(74, 3nhw#, 0, 0); " small bar";
180 fill unitsquare xscaled w yscaled .24nhh shifted (0,-.48nhh);
183 beginchar(75, 3/5nhw#, 0, 0); " small circle";
187 beginchar(76, 3/5nhw#, 0, 0); " small cross";
191 % the next seems to be senseless, but it isn't
193 beginchar(77, 3/5nhw#, 0, 0); " small blank";