From: Han-Wen Nienhuys Date: Thu, 30 Mar 2006 10:33:12 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: release/2.9.1~9 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=cd586e589daa7a550fa39200a78cb2012e853d99;p=lilypond.git *** empty log message *** --- diff --git a/ChangeLog b/ChangeLog index 041f45732f..b5c080d99a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-03-30 Joe Neeman + + * lily/stem-tremolo.cc (print): for whole notes (and breves, etc.) + position the tremolo based on the position of the notehead. + + * input/regression/stem-tremolo.ly: add example of unbeamed eighth + notes and update the texidoc line with the new positioning rules. + 2006-03-30 Han-Wen Nienhuys * lily/ttf.cc (print_trailer): don't always use uXXX glyphname. @@ -2618,7 +2626,7 @@ * scm/music-functions.scm: Make phrasing slurs follow voice direction * scripts/lilypond-book.py: Introduce option - --preserve-line-breaks, for usage with srcltx + --preserve-line-breaks, for usage with srcltx 2005-12-06 Han-Wen Nienhuys @@ -5285,7 +5293,7 @@ * ly/init.ly: * scm/lily-library.scm (print-score-with-defaults): renamed $globalheader to $defaultheader - + * Documentation/user/global.itely (Creating titles): added short explanation that multiple headers are useable. @@ -6449,7 +6457,7 @@ * ly/property-init.ly: Added tieDashed. - * THANKS: Added some bughunters for 2.5. + * THANKS: Added some bughunters for 2.5. 2005-06-09 Han-Wen Nienhuys @@ -7382,8 +7390,8 @@ 2005-05-11 Heikki Junes - * Documentation/topdocs/{AUTHORS.texi,INSTALL.texi,README.texi}: - Specify `@documentencoding utf-8' for html, ignore warnings. + * Documentation/topdocs/{AUTHORS.texi,INSTALL.texi,README.texi}: + Specify `@documentencoding utf-8' for html, ignore warnings. 2005-05-11 Erik Sandberg diff --git a/THANKS b/THANKS index f6551fb492..0a1c4ec169 100644 --- a/THANKS +++ b/THANKS @@ -12,6 +12,7 @@ Mats Bengtsson - Support Guru CONTRIBUTORS +Joe Neeman SPONSORS @@ -27,6 +28,8 @@ Juergen Reuter BUG HUNTERS/SUGGESTIONS J. Leung +Orm Finnendahl +Stephen Carter Werner Lemberg diff --git a/input/regression/stem-tremolo.ly b/input/regression/stem-tremolo.ly index 738649dda4..6cc2729daf 100644 --- a/input/regression/stem-tremolo.ly +++ b/input/regression/stem-tremolo.ly @@ -5,7 +5,13 @@ Stem tremolos or rolls are tremolo signs that look like beam segments crossing stems. If the stem is in a beam, the tremolo must be parallel to the beam. If the stem is invisible (e.g. on a whole note), the -tremolo must be centered on the note. +tremolo must be centered on the note. If the note has a flag (eg. an +unbeamed 8th note), the tremolo should be shortened if the stem is up +and tilted extra if the stem is down. + +The tremolos should be positioned a fixed distance from the end of the +stems unless there is no stem, in which case they should be positioned +a fixed distance from the note head. " } @@ -27,7 +33,7 @@ tremolo must be centered on the note. c,16:32 c: c c a16:32 a: a a c8:16 g: d: a: c8:32 f: b: e: - \transpose c c { f''8:256[ f'8: f'':] } + f8:256[ f,8: f':] f: \noBeam f,,: \noBeam c16:32 \noBeam c'': } diff --git a/lily/stem-tremolo.cc b/lily/stem-tremolo.cc index 05de18bab7..b3ea13d30d 100644 --- a/lily/stem-tremolo.cc +++ b/lily/stem-tremolo.cc @@ -175,6 +175,7 @@ Stem_tremolo::print (SCM grob) Spanner *beam = Stem::get_beam (stem); Direction stemdir = get_grob_direction (stem); + bool whole_note = Stem::duration_log (stem) <= 0; if (stemdir == 0) stemdir = UP; @@ -183,8 +184,11 @@ Stem_tremolo::print (SCM grob) ? Beam::get_beam_translation (beam) : 0.81; + /* for a whole note, we position relative to the notehead, so we want the + stencil aligned on the flag closest to the head */ + Direction stencil_dir = whole_note ? -stemdir : stemdir; Stencil mol = raw_stencil (me, robust_scm2double (me->get_property ("slope"), - 0.25), stemdir); + 0.25), stencil_dir); Interval mol_ext = mol.extent (Y_AXIS); Real ss = Staff_symbol_referencer::staff_space (me); @@ -207,6 +211,14 @@ Stem_tremolo::print (SCM grob) if (stemdir == UP) end_y -= stemdir * beam_translation * 0.5; } + if (whole_note) + { + /* we shouldn't position relative to the end of the stem since the stem + is invisible */ + vector nhp = Stem::note_head_positions (stem); + Real note_head = (stemdir == UP ? nhp.back () : nhp[0]); + end_y = note_head + stemdir * 2.0; + } mol.translate_axis (end_y, Y_AXIS); return mol.smobbed_copy ();