3

example hole diagram Hi there, A code for changing woodwind diagram from six holes into seven holes is shown below. Can someone help to change it to eight holes as shown in picture below?

\version "2.22.1"
% LilyBin
#(define-markup-command
  (woodwind-diagram-x layout props 
   instrument user-draw-commands)
  (symbol? list?)
  #:properties ((upper-hole1 #f)
   (size 1)
                (thickness 0.1)
                (graphical #t))
  (let* ((ww-diagram
          (interpret-markup layout props
            (make-woodwind-diagram-markup
             instrument user-draw-commands)))
         (hole-circle
          (make-circle-stencil size thickness upper-hole1))
         (midline
          (make-line-stencil (* thickness 2) (* -0.80 size) 0 (* 0.80 size) 0))
         (upper-circle-and-midline
          (ly:stencil-combine-at-edge hole-circle Y DOWN midline (* 0.80 size))))
    (ly:stencil-combine-at-edge
     upper-circle-and-midline Y DOWN ww-diagram (* 0.80 size))
    ))
\markup {
  \center-column {
  \override #'(upper-hole1. #f) 
    \override #'(size . 0.7) {
      \woodwind-diagram-x #'flute
      #'((cc . (oneF two three four five six))
         (lh . ())
         (rh . ()))
    }
  }
}
\markup \vspace #2.0
\markup {
  \center-column {
   \override #'(upper-hole1 . #t)
    \override #'(size . 0.7) {
      \woodwind-diagram-x #'flute
      #'((cc . (oneF two three four five six))
         (lh . ())
         (rh . ()))
    }
  }
}

1 Answer 1

4

The original woodwind diagrams are quite difficult to customize, since they include some kind of user interface that allows you to individually select the (half-) closed holes. But you could draw your own diagrams, for example like follows (with inspiration from here):

\version "2.18.2"

wwOpenHole = \markup {
  \with-dimensions #'(-0.5 . 0.5) #'(-0.5 . 0.5)
  \postscript #"
    0.15 setlinewidth
    0.5 0 moveto
    0 0 0.5 0 360 arc
    closepath stroke"
}

wwClosedHole = \markup {
  \with-dimensions #'(-0.5 . 0.5) #'(-0.5 . 0.5)
  \postscript #"
    0.15 setlinewidth
    0.5 0 moveto
    0 0 0.5 0 360 arc
    closepath stroke
    0.15 setlinewidth
    0.5 0 moveto
    0 0 0.5 0 360 arc
    closepath fill"
}

wwHalfHole = \markup {
  \with-dimensions #'(-0.5 . 0.5) #'(-0.5 . 0.5)
  \postscript #"
    0.15 setlinewidth
    0.5 0 moveto
    0 0 0.5 0 360 arc
    closepath stroke
    0 0.5 moveto
    0 0 0.5 90 270 arc
    0 0.5 lineto
    closepath fill"
}

wwDiaLower = \markup {
  \center-column { 
    \vspace #-0.5 \draw-line #' ( 1.5 . 0)
    \vspace #-0.5 \wwClosedHole
    \vspace #-0.5 \wwClosedHole
    \vspace #-0.5 \wwClosedHole
    \vspace #-0.5 \wwClosedHole
    \vspace #-0.5 \wwClosedHole
    \vspace #-0.5 \wwClosedHole
    \vspace #-0.5 \wwClosedHole
  }
}

wwDiaClosed = \markup {
  \center-column { 
    \wwClosedHole
    \wwDiaLower
  }
}

wwDiaHalf = \markup {
  \center-column { 
    \wwHalfHole
    \wwDiaLower
  }
}

wwDiaOpen = \markup {
  \center-column { 
    \wwOpenHole
    \wwDiaLower
  }
}

{ c'4^\wwDiaOpen c'4^\wwDiaHalf c'4^\wwDiaClosed }

enter image description here

1
  • Great, perfect :-) Thaks a lot.
    – Tommy_tsa
    Nov 4, 2021 at 5:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.