LilyPond snippets: Winds

# Winds

Wind instruments

## Changing the size of woodwind diagrams

The size and thickness of woodwind diagrams can be changed.

    \relative c'' {
      \textLengthOn
      c1^\markup
        \woodwind-diagram
          #'piccolo
          #'()

      c^\markup
        \override #'(size . 1.5) {
          \woodwind-diagram
            #'piccolo
            #'()
        }
      c^\markup
        \override #'(thickness . 0.15) {
          \woodwind-diagram
            #'piccolo
            #'()
        }
    }

## Fingering symbols for wind instruments

Special symbols can be achieved by combining existing glyphs, which is useful for wind instruments.

    centermarkup = {
      \once \override TextScript #'self-alignment-X = #CENTER
      \once \override TextScript #'X-offset =#(ly:make-simple-closure
        `(,+
          ,(ly:make-simple-closure (list
            ly:self-alignment-interface::centered-on-x-parent))
          ,(ly:make-simple-closure (list
            ly:self-alignment-interface::x-aligned-on-self))))
    }
    \score
    {\relative c'
      {
        g\open
        \once \override TextScript #'staff-padding = #-1.0 \centermarkup
        g^\markup{\combine \musicglyph #"scripts.open" \musicglyph
        #"scripts.tenuto"}
        \centermarkup g^\markup{\combine \musicglyph #"scripts.open"
        \musicglyph #"scripts.stopped"}
        g\stopped
      }
    }

## Flute slap notation

It is possible to indicate special articulation techniques such as a flute “tongue slap” by replacing the note head with the appropriate glyph.

    slap =
    #(define-music-function (parser location music) (ly:music?)
    #{
      \override NoteHead #'stencil =
      #(lambda (grob)
         (grob-interpret-markup grob
          (markup #:musicglyph "scripts.sforzato")))
      \override NoteHead #'stem-attachment =
      #(lambda (grob)
         (let* ((thickness (ly:staff-symbol-line-thickness grob))
                (stem (ly:grob-object grob 'stem))
                (dir (ly:grob-property stem 'direction UP)))
           (cons 1 (+ (if (= dir DOWN)
                          0.5
                          0)
                      (/ thickness 2)))))
      $music
      \revert NoteHead #'stencil
      \revert NoteHead #'stem-attachment
    #})

    \relative c' {
      c4 \slap c d r
      \slap { g4 a } b r
    }

## Graphical and text woodwind diagrams

In may cases, the keys other than the central column can be displayed by key name as well as by graphical means.

    \relative c'' {
      \textLengthOn
      c1^\markup
        \woodwind-diagram
          #'piccolo
          #'((cc . (one three))
             (lh . (gis))
             (rh . (ees)))

      c^\markup
        \override #'(graphical . #f) {
          \woodwind-diagram
            #'piccolo
            #'((cc . (one three))
               (lh . (gis))
               (rh . (ees)))
        }
    }

## Recorder fingering chart

The following example demonstrates how fingering charts for wind instruments can be realized.

    % range chart for paetzold contrabass recorder

    centermarkup = {
      \once \override TextScript #'self-alignment-X = #CENTER
      \once \override TextScript #'X-offset =#(ly:make-simple-closure
      `(,+
      ,(ly:make-simple-closure (list
      ly:self-alignment-interface::centered-on-x-parent))
      ,(ly:make-simple-closure (list
      ly:self-alignment-interface::x-aligned-on-self))))
    }

    \score {
      \new Staff \with {
        \remove "Time_signature_engraver"
        \override Stem #'stencil = ##f
        \consists "Horizontal_bracket_engraver"
      }
      {
        \clef bass
        \set Score.timing = ##f
        f,1*1/4 \glissando
        \clef violin
        gis'1*1/4
        \stemDown a'4^\markup{1)}
        \centermarkup
        \once \override TextScript #'padding = #2
        bes'1*1/4_\markup{\override #'(baseline-skip . 1.7) \column
          { \fontsize #-5 \slashed-digit #0 \finger 1 \finger 2 \finger 3 \finger 4
        \finger 5 \finger 6 \finger 7} }
        b'1*1/4
        c''4^\markup{1)}
        \centermarkup
        \once \override TextScript #'padding = #2
        cis''1*1/4
        deh''1*1/4
        \centermarkup
        \once \override TextScript #'padding = #2
        \once \override Staff.HorizontalBracket #'direction = #UP
        e''1*1/4_\markup{\override #'(baseline-skip . 1.7) \column
          { \fontsize #-5 \slashed-digit #0 \finger 1 \finger 2 \finger 4
        \finger 5} }\startGroup
        f''1*1/4^\markup{2)}\stopGroup
      }
    }

## Woodwind diagrams key lists

The snippet below produces a list of all possible keys and key settings for woodwind diagrams as defined in ‘`scm/define-woodwind-diagrams.scm`’. The list will be displayed on the console and in the log file, but not in the music.

    #(print-keys-verbose 'piccolo)
    #(print-keys-verbose 'flute)
    #(print-keys-verbose 'flute-b-extension)
    #(print-keys-verbose 'oboe)
    #(print-keys-verbose 'clarinet)
    #(print-keys-verbose 'bass-clarinet)
    #(print-keys-verbose 'low-bass-clarinet)
    #(print-keys-verbose 'saxophone)
    #(print-keys-verbose 'baritone-saxophone)
    #(print-keys-verbose 'bassoon)
    #(print-keys-verbose 'contrabassoon)

## Woodwind diagrams listing

The following music shows all of the woodwind diagrams currently defined in LilyPond.

    \relative c' {
      \textLengthOn
      c1^
      \markup {
        \center-column {
          'piccolo
          " "
           \woodwind-diagram
                      #'piccolo
                      #'()
        }
      }

      c1^
      \markup {
        \center-column {
           'flute
           " "
           \woodwind-diagram
              #'flute
              #'()
        }
      }
      c1^\markup {
        \center-column {
          'oboe
          " "
          \woodwind-diagram
            #'oboe
            #'()
        }
      }

      c1^\markup {
        \center-column {
          'clarinet
          " "
          \woodwind-diagram
            #'clarinet
            #'()
        }
      }

      c1^\markup {
        \center-column {
          'bass-clarinet
          " "
          \woodwind-diagram
            #'bass-clarinet
            #'()
        }
      }

      c1^\markup {
        \center-column {
          'saxophone
          " "
          \woodwind-diagram
            #'saxophone
            #'()
        }
      }

      c1^\markup {
        \center-column {
          'bassoon
          " "
          \woodwind-diagram
            #'bassoon
            #'()
        }
      }

      c1^\markup {
        \center-column {
          'contrabassoon
          " "
          \woodwind-diagram
            #'contrabassoon
            #'()
        }
      }
    }

#### LilyPond — Snippets