Thomas Morley <[email protected]> writes: > 2012/10/16 David Nalesnik <[email protected]>: >> Hi Janek, >> >>>> David Nalesnik's function correcting tuplet number placement on kneed >>>> beams throws an error with Lilypond 2.17.5 (it works with 2.16.0): >>>> >>>> Drawing systems.../home/janek/desk/tuplet_numers_on_kneed_beams.ily:44:26: >>>> In procedure * in expression (* 0.5 (ly:grob-property beam #)): >>>> /home/janek/desk/tuplet_numers_on_kneed_beams.ily:44:26: Wrong type: () >>>> >>>> line 44 reads: >>>> (beam-gap (* 0.5 (ly:grob-property beam 'gap))) >> >> >> Checking the Internals Reference, it looks like 'gap has been renamed >> 'beam-gap, so changing that line should fix the problem. >> >> -David > > Hi David, > > 'beam-gap is now a pair. > So I'm not sure if it should be > (car (ly:grob-property grob 'beam-gap)) > or > (interval-length (ly:grob-property grob 'beam-gap)) > > Currently I haven't found a proper documentation: > > git grep beam-gap > > Documentation/misc/CHANGES-1.3:beams on whole notes. 'beam-gap' had > been rename > Documentation/misc/ChangeLog-2.1: lines for falling into beam-gap. > lily/beam.cc: Interval gap_lengths = robust_scm2interval > (me->get_property ("be > lily/beam.cc: "beam-gap " > scm/define-grob-properties.scm: (beam-gap ,number-pair? "Size of a gap in > a > scm/define-grobs.scm: (beam-gap . ,ly:beam::calc-beam-gap) > >
> * Chord tremolo fixes: shift beams vertically on whole notes. Center > beams on whole notes. 'beam-gap' had been renamed to 'gap', but only > for reading. > > I'm investigating further. commit d8dfa746ead381a80901106b9c9b079dc9b5d004 Author: Mike Solomon <[email protected]> Date: Fri Aug 31 09:27:17 2012 +0200 Uses a heuristic to determine if chord tremolos collide with accidentals. This heuristic makes several assumptions about when a chord tremolo will collide with accidentals. It must be between whole notes, it must be in the staff, and it must be an ascending major third or lower. The heuristic is entirely contained in Beam::whole_note_close_chord_tremolo, which should be modified if other cases involving chord tremolos arise. I just love it when only loosely related API and functionality changes are sneaked in with other stuff. The only documentation is + (beam-gap ,number-pair? "Size of a gap in a @code{Beam}.") without any explanation of why a size would be a number _pair_. The whole commit contains two comment lines among several hundred lines of code. One is the following: +//------ for whole note chord tremolos + +bool +Beam::whole_note_close_chord_tremolo (Grob *me) +{ + if (!scm_is_integer (me->get_property ("gap-count"))) + return false; + + extract_grob_set (me, "stems", stems); + for (vsize i = 0; i < stems.size (); i++) + if (Stem::duration_log (stems[i])) + return false; + + Grob *staff = Staff_symbol_referencer::get_staff_symbol (me); + if (staff) + { + Grob *outside_stems[2] = {Stem::extremal_heads (stems[0])[DOWN], + Stem::extremal_heads (stems.back ())[DOWN]}; + + Interval lines = Staff_symbol::line_span (staff); + for (int i = 0; i < 2; i++) + { + Real my_pos = Staff_symbol_referencer::get_position (outside_stems[i]); + if (my_pos > lines[UP] + 1) + return false; + else if (my_pos < lines[DOWN] - 1) + return false; + } + } + + return (Staff_symbol_referencer::get_position (Stem::extremal_heads (stems.back ())[DOWN]) + - Staff_symbol_referencer::get_position (Stem::extremal_heads (stems[0])[DOWN])) + < 2; +} Which obviously fully and exhaustively explains what the function is supposed to be doing, how it fits with the rest of the code, what the rationale for writing it was, and what and how it does this based on what assumptions. Of course, the change of the beam API is mentioned nowhere. Not even in the commit message. -- David Kastrup _______________________________________________ lilypond-user mailing list [email protected] https://lists.gnu.org/mailman/listinfo/lilypond-user
