justify top left
nocheck notime unfinished

draw test
  0 sin 0 cos 2 sqrt
  45 dup sin exch cos 
  30 dup sin exch cos 
  60 dup sin exch cos 
  pstack
  9 { pop } repeat 
enddraw

heading draw test   

*define TL 4    @ tag length
*define TW 1.5  @ tag width

draw flag
  dup
  headright exch {1.4 sub}{3.545 sub} ifelse
  exch {stemtop}{stembottom &TW add} ifelse moveto 
  dup 
  sin &TL mul /lsin exch def
  cos dup &TL mul /lcos exch def 
  lcos lsin rlineto
  &TW exch div neg 0 exch rlineto
  lcos neg lsin neg rlineto   
  fill  
enddraw

*define fu(0) [draw &&1 1 flag] 
*define fd(0) [draw &&1 0 flag] 

[stave 1 treble 1 stems central noteheads circular]

&fu a &fu(5) a &fu(10) a &fu(15) a &fu(20) a &fu(25) a &fu(30) a &fu(35) a 
&fu(40) a |
[newline]
&fu a &fu(-5) a &fu(-10) a &fu(-15) a &fu(-20) a &fu(-25) a &fu(-30) a 
&fu(-35) a &fu(-40) a |
[newline]
&fd c' &fd(5) c' &fd(10) c' &fd(15) c' &fd(20) c' &fd(25) c' &fd(30) c' &fd(35) c' 
&fd(40) c' |
[newline]
&fd c' &fd(-5) c' &fd(-10) c' &fd(-15) c' &fd(-20) c' &fd(-25) c' &fd(-30) c' 
&fd(-35) c' &fd(-40) c' |
[endstave]


[newmovement]
unfinished
notime nocheck

[stave 1 treble 1]
[stems central]
g g\sl2\ g\sl-2\ [x] g [h] g [c] g [o] |
c' c'\sl2\ c'\sl-2\ [x] c' [h] c' [c] c' [o] | 
g-g-; g-b-; [x] g-b-; [h] c'-a-; [o] |
c'-c'-; c'-a-; [x] c'-a-; [h] c'-a-; [o] |
g=g=; g=b=; [x] g=b=; [h] c'=a=; [o] |
g=g-; g=b-; [x] g=b-; [h] c'=a-; [o] |
g-g=; g-b=; [x] g-b=; [h] c'-a=; [o] |
g-g=g=g-; | c'-c'=c'=c'-; |
g=g=
[endstave]


[newmovement]
unfinished
notime nocheck

[stave 1 treble 1 noteheads circular]
g g- c' c'-; g-g-; c'-x; G C' g G+ | (ceg) |
[endstave]


[newmovement]
unfinished notime nocheck

[stave 1 treble 1 stems central]
a a\sl4\ [h] a\sl4\ A\sl4\ [c] a\sl4\ [c stems central] a\sl4\ [x] a\sl4\ [o] |
a a\sl-4\ [h] a\sl-4\ A\sl-4\ [c] a\sl-4\ A\sl-4\ [x] a\sl-4\ [o] |
c' c'\sl4\ [h] c'\sl4\ C'\sl4\ [c] c'\sl4\ C'\sl4\ [x] c'\sl4\ |
c' c'\sl-4\ [h] c'\sl-4\ C'\sl-4\ [c] c'\sl-4\ [c] C'\sl-4\ [x] c'\sl-4\ |
[noteheads harmonic]
c'-a-; c-e-; c'-\M\a-\M\; c-\M\e-\M\; |
[noteheads circular]
c'-a-; c-e-; c'-\M\a-\M\; c-\M\e-\M\; |
[noteheads normal]
c'-a-; c-e-; c'-\M\a-\M\; c-\M\e-\M\; |
[endstave]

[newmovement]
unfinished nocheck notime
barnumbers 1

[stave 1 treble 1]
[barnumber] ffgg | [2] ffgg | [nocount barnumber] ffgg | ffgg |
[endstave]


[newmovement]
nocheck notime unfinished

draw dtest
  0 20 moveto
  40 0 rlineto
  10 10 setdash
  currentpoint
  stroke
  moveto
  40 0 rlineto
  0 0 setdash
  currentpoint
  stroke
  moveto
  10 0 rmoveto
  30 0 rlineto
  4 2 setdash 
  stroke    
enddraw

draw dtest2
  0 -8 moveto
  40 0 rlineto
  stroke
enddraw

heading "Top"
heading draw dtest

[stave 1 treble 1]
[draw dtest] g [draw dtest2] g |
[newline] [overdraw dtest] g [overdraw dtest2] g
[endstave]


[newmovement]
nocheck notime unfinished

draw colourtest
  0 0 moveto
  10 0 rlineto
  4 setlinewidth
  0.5 setgrey
  currentpoint stroke moveto 4 0 rmoveto
  10 0 rlineto
  1 0 0 setcolour
  currentpoint stroke moveto 4 0 rmoveto
  10 0 rlineto
  0.3 0.59 0.11 setcolor
  currentpoint stroke moveto 4 0 rmoveto
  10 0 rlineto
  currentgrey setgray
  currentpoint stroke moveto 4 0 rmoveto
  "Text in draw" 0 1 0 setcolor show 
enddraw

draw overcolourtext
  0 -10 moveto
  "Text in overdraw" 0 0 1 setcolour show
enddraw    

heading "Top"
heading draw colourtest 10

[stave 1 treble 1]
[overdraw overcolourtext] g
[endstave]


[newmovement]
nocheck
rehearsalmarks roundboxed
barnumbers 1000
heading 2 ""

draw bs
  0 -15 moveto "A"/box show
  0 -30 moveto "A"/rbox pstack show
enddraw    

draw a
  0 0 moveto 0 -30 rlineto 3 setlinewidth stroke
enddraw

draw b
  0 0 moveto 0 -30 rlineto stroke
enddraw

[stave 1 treble 1] 
["A"] "\rm\A"/rbox g [draw bs] g g [overdraw bs] g |
["A"/ul] g ["B"/u10 draw a] g ["C"/S2/r10 draw b]  g |
[endstave]


[newmovement]
nocheck
barnumbers roundboxed 1

[stave 1 treble 1 text underlay]
[line/u10] gg [linegap/"1 2 3"/rbox] ggg [endline] 
[line/u10] gg [linegap/"42"/rbox/S6] ggg [endline] |
ggg |
[endstave]

