Here's another try: \version "2.20.0"
toneCluster = #(define-music-function (note1 note2) (ly:music? ly:music?) #{ { \once\override NoteHead.stem-attachment = #'(0 . 0) \once \override Stem.length = #(lambda (grob) (- (ly:stem::calc-length grob) 4.5)) \once\override Stem.thickness = #8 < #note1 #note2 > } #}) %% Test: { a' \toneCluster a a'' a' \toneCluster a cis'''' } Anything better? Cheers, Pierre Le mer. 20 mai 2020 à 13:38, Pierre Perol-Schneider < pierre.schneider.pa...@gmail.com> a écrit : > Hi All, > > I have this function to make a tone cluster: > > %%%% > \version "2.20.0" > > toneCluster = #(define-music-function > (note1 note2) (ly:music? ly:music?) > #{ > << > { #note1 } > { > \once\override NoteHead.stem-attachment = #'(0 . > 0) > \once\override Stem.length = #14 % <= Manually > set. > \once\override Stem.thickness = #7 > #note2 > } > >> > #}) > > % Test: > { > a' \toneCluster a a'' a' \toneCluster a cis'''' > } > %%%% > > How could I set the stem length automagically according to the pitch > difference? > > Cheers, > Pierre >