]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/included/display-predefined-string-tunings.ly
Imported Upstream version 2.16.0
[lilypond.git] / Documentation / included / display-predefined-string-tunings.ly
index 6216fbe12331f5b1d4c2e3e9d1e01762a46607bf..642993fe8ad26e2b998ec73ceb35d96f1f8205e4 100644 (file)
@@ -1,4 +1,4 @@
-\version "2.14.0"
+\version "2.16.0"
 
 #(define (filter-instrument instrument-name tuning-alist)
    (filter (lambda (entry)
@@ -7,30 +7,18 @@
            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?)