X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Documentation%2Fincluded%2Fdisplay-predefined-string-tunings.ly;h=fd3df5378a9e25967e815dfe848e6b56808e26f0;hb=fc40563cfed21eb5508b60b3892c57f9d2560a63;hp=6216fbe12331f5b1d4c2e3e9d1e01762a46607bf;hpb=2055f35c47a045a50a01ff4dba8524322cfc3b48;p=lilypond.git diff --git a/Documentation/included/display-predefined-string-tunings.ly b/Documentation/included/display-predefined-string-tunings.ly index 6216fbe123..fd3df5378a 100644 --- a/Documentation/included/display-predefined-string-tunings.ly +++ b/Documentation/included/display-predefined-string-tunings.ly @@ -1,4 +1,4 @@ -\version "2.14.0" +\version "2.19.22" #(define (filter-instrument instrument-name tuning-alist) (filter (lambda (entry) @@ -7,33 +7,21 @@ tuning-alist)) #(define (chord-display tuning-alist-entry) - (let* ((ch-mus (cdr tuning-alist-entry)) - (tuning-symbol (car tuning-alist-entry)) - (ev-chord (car (extract-named-music - ch-mus - 'EventChord))) - (elts (ly:music-property ev-chord 'elements))) - (music-map (lambda (m) - (begin - (if (not (null? (ly:music-property m 'duration))) - (ly:music-set-property! - m - 'duration - (ly:make-duration 0 0 1 1))) - m)) - ev-chord) - (let ((elts (ly:music-property ev-chord 'elements)) - (script (make-music 'TextScriptEvent - 'direction 1 - 'text (symbol->string tuning-symbol)))) - (ly:music-set-property! - ev-chord - 'elements - (cons script elts))) - ev-chord)) + (let* ((tuning-symbol (car tuning-alist-entry)) + (pitches (cdr tuning-alist-entry))) + (make-music 'EventChord + 'elements + (cons (make-music 'TextScriptEvent + 'direction 1 + 'text (symbol->string tuning-symbol)) + (map (lambda (pitch) + (make-music 'NoteEvent + 'duration (ly:make-duration 0 0 1/1) + 'pitch pitch)) + pitches))))) displayInstrumentDefaultTunings = -#(define-music-function (parser location instrument) (string?) +#(define-music-function (instrument) (string?) (let* ((filtered-instruments (filter-instrument instrument defaultStringTunings)) (display-elements (map chord-display filtered-instruments))) (make-music 'SequentialMusic 'elements display-elements))) @@ -43,7 +31,7 @@ displayInstrumentDefaultTunings = { \new Staff { \textLengthOn - \override Score.RehearsalMark #'self-alignment-X = #LEFT + \override Score.RehearsalMark.self-alignment-X = #LEFT \mark \markup {\left-align "Guitar tunings"} \clef "treble_8"