]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix determine-frets-and-strings so that ignored notes are ignored
authorCarl Sorensen <c_sorensen@byu.edu>
Thu, 26 May 2011 04:06:23 +0000 (22:06 -0600)
committerCarl Sorensen <c_sorensen@byu.edu>
Thu, 26 May 2011 04:09:05 +0000 (22:09 -0600)
lily/tab-note-heads-engraver.cc
scm/translation-functions.scm

index 958c85d3e7d5b55bdecd2c33d5a19c1483c40c23..4e3f393a2df30766b0fc7cef612f15e1956703b8 100644 (file)
@@ -116,18 +116,21 @@ Tab_note_heads_engraver::process_music ()
       {
        note_entry = scm_list_ref (string_fret_finger, scm_from_int (i));
        string_number = scm_car (note_entry);
-       fret = scm_cadr (note_entry);
-       fret_label = scm_call_3 (fret_procedure,
-                                context ()->self_scm (),
-                                string_number,
-                                fret);
-       index = length_changed ? 0 : i;
-       Item *note = make_item ("TabNoteHead", note_events_[index]->self_scm ());
-       note->set_property ("text", fret_label);
-       staff_position = scm_call_2 (staff_line_procedure,
-                                    context ()->self_scm (),
-                                    string_number);
-       note->set_property ("staff-position", staff_position);
+        if (string_number != SCM_BOOL_F)
+          {
+           fret = scm_cadr (note_entry);
+           fret_label = scm_call_3 (fret_procedure,
+                                    context ()->self_scm (),
+                                    string_number,
+                                    fret);
+           index = length_changed ? 0 : i;
+           Item *note = make_item ("TabNoteHead", note_events_[index]->self_scm ());
+           note->set_property ("text", fret_label);
+           staff_position = scm_call_2 (staff_line_procedure,
+                                        context ()->self_scm (),
+                                        string_number);
+           note->set_property ("staff-position", staff_position);
+          }
       }
 }
 
index 2d9d456067cc1954e8584a66a12c96cdb2b6416c..58deabc753faf6ff665deb35afc2616f993aafa0 100644 (file)
@@ -413,12 +413,22 @@ the current tuning?"
                                  (_ "Requested string for pitch requires negative fret: string ~a pitch ~a")
                                  string
                                  pitch)
-                              (ly:warning (_ "Ignoring string request."))
+                              (ly:warning (_ "Ignoring string requesti and recalculating."))
                                (list-set! string-fret-fingers
                                           (cdr pitch-entry)
                                           (if (null? finger)
                                               (list '() #f)
-                                              (list '() #f finger)))))))))))
+                                              (list '() #f finger)))))
+                           ((eq? handle-negative 'ignore)
+                            (begin
+                               (ly:warning
+                                 (_ "Requested string for pitch requires negative fret: string ~a pitch ~a")
+                                 string
+                                 pitch)
+                              (ly:warning (_ "Ignoring note in tablature."))
+                               (list-set! string-fret-fingers
+                                          (cdr pitch-entry)
+                                          (list #f #t))))))))))
         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