From: Carl Sorensen Date: Thu, 26 May 2011 04:06:23 +0000 (-0600) Subject: Fix determine-frets-and-strings so that ignored notes are ignored X-Git-Tag: release/2.13.62-1~3 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=fc0ff228fdd12e0ff6c831814744a838669ef06a;p=lilypond.git Fix determine-frets-and-strings so that ignored notes are ignored --- diff --git a/lily/tab-note-heads-engraver.cc b/lily/tab-note-heads-engraver.cc index 958c85d3e7..4e3f393a2d 100644 --- a/lily/tab-note-heads-engraver.cc +++ b/lily/tab-note-heads-engraver.cc @@ -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); + } } } diff --git a/scm/translation-functions.scm b/scm/translation-functions.scm index 2d9d456067..58deabc753 100644 --- a/scm/translation-functions.scm +++ b/scm/translation-functions.scm @@ -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