%% Generated by lilypond-book
%% Options: [exampleindent=10.16\mm,indent=0\mm,line-width=160\mm,paper-height=845.047\pt,paper-width=597.508\pt,papersize='(cons (* 597.508 pt) (* 845.047 pt))]
\include "lilypond-book-preamble.ly"


% ****************************************************************
% Start cut-&-pastable-section
% ****************************************************************

#(ly:set-option 'eps-box-padding 3.000000)



\paper {
  #(set-paper-size '(cons (* 597.508 pt) (* 845.047 pt)))
  indent = 0\mm
  line-width = 160\mm
  % offset the left padding, also add 1mm as lilypond creates cropped
  % images with a little space on the right
  line-width = #(- line-width (* mm  3.000000) (* mm 1))
}

\layout {
  
}




% ****************************************************************
% ly snippet:
% ****************************************************************
\sourcefilename "/lilypond-2.26.0/input/regression/drum-scripts.ly"
\sourcefileline 0
\version "2.23.6"

\header {
  texidoc = "Pitches for drums may have a defined articulation sign.  This test
checks the predefined drum styles and prints only drum pitches with an
articulation sign."
}

\paper { indent = 35 }

% The currently predefined styles, see `ly/drumpitch-init.ly`.
#(define predefined-drumstyles
   '(drums-style
     agostini-drums-style
     weinberg-drums-style
     timbales-style
     congas-style
     bongos-style
     percussion-style))

$@(map
   (lambda (predefined-style)
     (let* (;; `predefined-drumstyles` is a symbol list, thus look up the style
            ;; in `(current-module)`.
            (current-style-hash-table
             (module-ref (current-module) predefined-style))
            ;; Transform the hash table into an alist and sort it to ensure
            ;; reproducibility.
            (current-style
             (sort
              (hash-table->alist current-style-hash-table)
              (lambda (p q)
                (symbol<? (car p) (car q)))))
            ;; Keep only drum pitches with scripts, and add labels with
            ;; appropriate names.
            (relevant-drum-notes
             (filter-map
              (lambda (entry)
                (if (third entry)
                    (make-music
                     'NoteEvent
                     'articulations
                     (list (make-music
                            'TextScriptEvent
                            'direction DOWN
                            'text (object->string (car entry))))
                     'drum-type (car entry)
                     'duration (ly:make-duration 2))
                    #f))
              current-style)))

       #{
         \new DrumStaff \with {
           instrumentName = #(symbol->string predefined-style)
           drumStyleTable = #current-style-hash-table
           \textLengthOn
         } \drummode {
           \cadenzaOn
           % For styles where no scripts are defined, print a spacer and a
           % remark.
           #@(if (null? relevant-drum-notes)
                 (list #{ s1^"No scripts defined" #})
                 relevant-drum-notes)
           \bar "||"
         }
       #}))
   predefined-drumstyles)



% ****************************************************************
% end ly snippet
% ****************************************************************
