X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Ftranslation-functions.scm;h=314e66ff59b8783263efcbcaa36f0f721a240f18;hb=4ccfb61ecfa8b32f8c5d87e75c569171bbc54ba6;hp=58deabc753faf6ff665deb35afc2616f993aafa0;hpb=12fcdcc0c4fc64d822d14f332c59a8b0b3ec4ff3;p=lilypond.git diff --git a/scm/translation-functions.scm b/scm/translation-functions.scm index 58deabc753..314e66ff59 100644 --- a/scm/translation-functions.scm +++ b/scm/translation-functions.scm @@ -355,6 +355,9 @@ the current tuning?" (cdr pitch-entry) (list string this-fret finger)))) + (define (kill-note! string-fret-fingers note-index) + (list-set! string-fret-fingers note-index (list #f #t))) + (define string-fret-fingers (map (lambda (string finger) (if (null? finger) @@ -413,7 +416,7 @@ the current tuning?" (_ "Requested string for pitch requires negative fret: string ~a pitch ~a") string pitch) - (ly:warning (_ "Ignoring string requesti and recalculating.")) + (ly:warning (_ "Ignoring string request and recalculating.")) (list-set! string-fret-fingers (cdr pitch-entry) (if (null? finger) @@ -426,9 +429,8 @@ the current tuning?" string pitch) (ly:warning (_ "Ignoring note in tablature.")) - (list-set! string-fret-fingers - (cdr pitch-entry) - (list #f #t)))))))))) + (kill-note! string-fret-fingers + (cdr pitch-entry)))))))))) pitch-alist string-fret-fingers) ;; handle notes without strings assigned -- sorted by pitch, so ;; we need to use the alist to have the note number available @@ -448,9 +450,12 @@ the current tuning?" (if (not (list-ref string-fret-finger 1)) (if fit-string (set-fret! pitch-entry fit-string finger) - (ly:warning (_ "No string for pitch ~a (given frets ~a)") - pitch - specified-frets))))) + (begin + (ly:warning (_ "No string for pitch ~a (given frets ~a)") + pitch + specified-frets) + (kill-note! string-fret-fingers + (cdr pitch-entry))))))) (sort pitch-alist (lambda (pitch-entry-a pitch-entry-b) (ly:pitchplacement-list - string-frets string-count)))) + (filter (lambda (entry) + (car entry)) + string-frets) + string-count)))) (if (null? grob) (placement-list->string-frets predefined-fretboard) (create-fretboard context grob predefined-fretboard))))) @@ -557,7 +565,7 @@ only ~a fret labels provided") (define-public (fret-number-tablature-format context string-number fret-number) (make-vcenter-markup - (format "~a" fret-number))) + (format #f "~a" fret-number))) ;; The 5-string banjo has got a extra string, the fifth (duh), which ;; starts at the fifth fret on the neck. Frets on the fifth string