\version "2.19.58" % functions ====== setBeamPosAll = #(define-music-function (left right) (number? number?) "Manually set beam position for following groups." #{ \override Beam.positions = #(cons left right) #}) setBeams = #(define-music-function (left right) (number? number?) "Set the number of beams on each side of a beamed note. Only designed to be used for 'normal' cases. Specify the number of beams for the left and the number for the right side." (define seq ;; (seq start count) ;; make a sequence of integers, as a list ;; start: starting integer ;; count: how many elements (lambda (start count) (let r ((i (+ start (- count 1))) (lis '())) (if (< i start) lis (r (- i 1) (cons i lis)))))) #{ \once \override Stem.beaming = #(cons (seq 0 left) (seq 0 right)) #}) setBeaming = #(define-music-function (positions) (pair?) "Specify left and right beaming and individual beams. Arg is a pair of lists of beam positions." #{ \once \override Stem.beaming = #(cons (car positions) (cdr positions)) #}) % abbreviations ====== #(define t tuplet) #(define sb setBeams) #(define sbm setBeaming) % stems and staff changes tsd = { \change Staff = treble \stemDown } tsu = { \change Staff = treble \stemUp } bsu = { \change Staff = bass \stemUp } bsd = { \change Staff = bass \stemDown } #(define su stemUp) #(define sd stemDown) % exmaple ====== treble = { \clef "treble^8" \cadenzaOn % just remove barlines to declutter example \su \setBeamPosAll 8 8 b'''16[ \t 5/4 { \sb 1 2 dis''' cis'' dis''' b'' \sb 2 1 f''' } \t 5/4 { \sb 1 2 d'' f''' bes'' f''' \sb 2 1 gis'' } \sb 1 2 b'' g'''^> \bsu \clef "treble^8" \sbm #'((0 1 2) . (14 15 16)) dis'''32 \tsd \revert Beam.positions \sbm #'((0 1 2 ) . (1 0)) fis''''32 \bsu \sbm #'((0 1) . (-1 0 1)) gis''' \tsd \sbm #'((-1 -2) . (-1 -2)) a''''16 cis'''' cis'''' \sb 3 1 a''''32 \bsu \sbm #'((0) . (0 -1 -2)) dis'''' \tsd \sb 3 2 g'''' \bsu \sbm #'((0 1) . (1 0 -1)) cis'''' \tsd bes''''] } bass = { \clef bass s4 * 6 } \score { \new PianoStaff \with { \override VerticalAxisGroup.staff-staff-spacing = #'((basic-distance . 14) (minimum-distance . 4) (padding . 1) (stretchability . 8)) } << \new Staff = "treble" \with { } { \treble } \new Staff = "bass" \with { } { \bass } >> \layout { \context { \Score \accidentalStyle Score.dodecaphonic } } }