X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Ftab-note-heads-engraver.cc;h=4fb33f7199b8ff4698d7d501b060c03baf0802f9;hb=af770f3440264c18ce01525dce1aa76b86ace0d5;hp=7870c0218a74b44fb3e64178c90124b66d0307b6;hpb=13a8e28de140702edbb0629002073972008e17ad;p=lilypond.git diff --git a/lily/tab-note-heads-engraver.cc b/lily/tab-note-heads-engraver.cc index 7870c0218a..4fb33f7199 100644 --- a/lily/tab-note-heads-engraver.cc +++ b/lily/tab-note-heads-engraver.cc @@ -1,9 +1,7 @@ /* tab-note-heads-engraver.cc -- part of GNU LilyPond - based on note-heads-engraver.cc, by Jean-Baptiste Lamy , - - (c) 2002--2006 + (c) 2002--2006 Han-Wen Nienhuys, Jean-Baptiste Lamy , */ #include @@ -20,6 +18,7 @@ using namespace std; #include "rhythmic-head.hh" #include "stream-event.hh" #include "warn.hh" +#include "context.hh" #include "translator.icc" @@ -67,8 +66,8 @@ Tab_note_heads_engraver::process_music () vsize j = 0; for (vsize i = 0; i < note_events_.size (); i++) { - SCM stringTunings = get_property ("stringTunings"); - int number_of_strings = scm_ilength (stringTunings); + SCM string_tunings = get_property ("stringTunings"); + int number_of_strings = scm_ilength (string_tunings); bool high_string_one = to_boolean (get_property ("highStringOne")); Stream_event *event = note_events_[i]; @@ -114,23 +113,27 @@ Tab_note_heads_engraver::process_music () while (!string_found) { - int fret = unsmob_pitch (scm_pitch)->semitone_pitch () - - scm_to_int (scm_list_ref (stringTunings, scm_from_int (tab_string - 1))); + int fret = unsmob_pitch (scm_pitch)->rounded_semitone_pitch () + - scm_to_int (scm_list_ref (string_tunings, scm_from_int (tab_string - 1))); if (fret < min_fret) tab_string += high_string_one ? 1 : -1; else string_found = true; } - SCM text = scm_call_3 (proc, scm_from_int (tab_string), stringTunings, scm_pitch); + SCM text = scm_call_3 (proc, scm_from_int (tab_string), + context ()->self_scm (), + event->self_scm ()); + note->set_property ("text", text); + int pos = 2 * tab_string - number_of_strings - 1; // No tab-note between the string !!! if (to_boolean (get_property ("stringOneTopmost"))) pos = -pos; - note->set_property ("text", text); - note->set_property ("staff-position", scm_from_int (pos)); + + notes_.push_back (note); } }