I'm looking for a way to set a hairpin's to-barline property depending on 
whether the terminating grob it is attached to is a note or a rest. I'd like 
hairpins which end on a rest to stop at the barline (to-barline = ##t), and 
hairpins which end on a note to continue to the notehead column (to-barline = 
##f).

In a grob-transformer function, how do I lookup the terminating grob?

MWE:

{
  \override Hairpin.minimum-length = #5
  \override Hairpin.to-barline = ##t
  r2
  e'2\ff\>~ 2~ 2~\p-\tweak color red \<^\markup \tiny "wrong: continue to 
notehead" 8\! r8 r4
  e'2\ff\>~ 2~ 2\p\<^\markup \tiny "correct: stop at barline" r2\!
  \break
  \override Hairpin.to-barline = ##f
  e'2\ff\>~ 2~ 2~\p\<^\markup \tiny "correct: continue to notehead" 8\! r8 r4
  e'2\ff\>~ 2~ 2\p-\tweak color red \< ^\markup \tiny "wrong: stop at barline" 
r2\!
}



--
Mark Knoop

Reply via email to