- int min_fret = gh_number_p(min_fret_scm) ? gh_scm2int(min_fret_scm) : 0;
-
- while(!string_found) {
- int fret = unsmob_pitch(scm_pitch)->semitone_pitch()
- - gh_scm2int(gh_list_ref(stringTunings,gh_int2scm(tab_string-1)));
- if(fret<min_fret)
- tab_string--;
- else
- string_found = true;
- }
-
- SCM text = gh_call3 (proc, gh_int2scm (tab_string), stringTunings, scm_pitch);
-
- int pos = 2 * tab_string - 2; // No tab-note between the string !!!
-
- if (number_of_strings % 2) { // odd number of string
- pos++;
- }
-
-
- note->set_grob_property ("text", text);
- SCM c0 = get_property ("centralCPosition");
- if (gh_number_p (c0)) pos += gh_scm2int (c0);
-
-
- note->set_grob_property ("staff-position", gh_int2scm (pos));
- announce_grob (note, req->self_scm());
- notes_.push (note);
+ int min_fret = scm_is_number (min_fret_scm) ? scm_to_int (min_fret_scm) : 0;
+
+ while (!string_found)
+ {
+ int fret = unsmob_pitch (scm_pitch)->semitone_pitch ()
+ - scm_to_int (scm_list_ref (stringTunings, 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);
+
+ 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);