- (half-thickness (* sth 0.5))
- (gap (- size sth))
- (fret-line (ly:make-stencil (list 'draw-line sth half-thickness size (- fret-length half-thickness) size)
- (cons 0 fret-length)
- (cons (- size half-thickness) (+ size half-thickness)))))
- (if (= fret-count 1)
- fret-line
- (ly:stencil-combine-at-edge fret-line Y UP
- (draw-fret-lines (- fret-count 1) string-count th size)
- gap 0))))
-
-(define (draw-thick-top-fret props string-count th size)
- "Draw a thick top fret for a fret diagram whose base fret is not 1."
- (let* ((sth (* th size))
-; (top-fret-thick (* sth (chain-assoc-get 'top-fret-thickness props 3.0)))
- (top-fret-thick (* sth 3.0))
-; (top-half-thick (* top-fret-thick 0.5))
- (half-thick (* sth 0.5))
- (x1 half-thick)
- (x2 (+ half-thick (* size (- string-count 1))))
- (y1 (- half-thick))
- (y2 (+ top-fret-thick half-thick))
- (x-extent (cons (- x1) x2))
- (y-extent (cons 0 y2)))
- (ly:make-stencil (list 'round-filled-box x1 x2 y1 y2 sth)
- x-extent y-extent)))
-
-
-(define (draw-frets layout props fret-range string-count th size)
- "Draw the frets (horizontal lines) for a fret diagram with
+ (half-thickness (* sth 0.5)))
+ (if (eq? orientation 'normal)
+ (ly:make-stencil (list 'draw-line sth half-thickness size
+ (- fret-length half-thickness) size)
+ (cons 0 fret-length)
+ (cons (- half-thickness) half-thickness))
+ (ly:make-stencil (list 'draw-line sth 0 half-thickness
+ 0 (- fret-length half-thickness))
+ (cons (- half-thickness) half-thickness)
+ (cons 0 fret-length)))))
+
+(define (draw-thick-zero-fret props string-count th size orientation)
+ "Draw a thick zeroth fret for a fret diagram whose base fret is not 1."
+ (let* ((sth (* th size))
+ ; (top-fret-thick (* sth (chain-assoc-get 'top-fret-thickness props 3.0)))
+ (top-fret-thick (* sth 3.0))
+ ; (top-half-thick (* top-fret-thick 0.5))
+ (half-thick (* sth 0.5))
+ (x1 half-thick)
+ (x2 (+ half-thick (* size (- string-count 1))))
+ (y1 (- half-thick))
+ (y2 (+ top-fret-thick half-thick))
+ (x-extent (cons (- x1) x2))
+ (y-extent (cons 0 y2)))
+ (if (eq? orientation 'normal)
+ (ly:make-stencil (list 'round-filled-box x1 x2 y1 y2 sth)
+ x-extent y-extent)
+ (ly:make-stencil (list 'round-filled-box y1 y2 x1 x2 sth)
+ y-extent x-extent))))
+
+
+(define (draw-frets layout props fret-range string-count th size orientation)
+ "Draw the fret lines for a fret diagram with