I am writing an article about Stockhausen's Plus-Minus and I wanted to take this chance to write some snippets in LilyPond. Is there anyone willing to help me to transcribe this image?

five groups of notes across two staves, note stems join into one with a single slashed grace note flag

This is what I managed to achieve until now:

\version "2.24.1"
\paper { top-margin = 20\mm}
\language italiano

\score {
    \new PianoStaff  = "Subsidiary Notes"  {<<
        \new Staff {
            \clef "treble"
            \override Stem.length = 15
            \relative {
                << sold''4 la>> 
                    \once \override Stem.length = 20
                    \single \override Stem.X-offset = #-2
                    \single \override NoteHead.X-offset = #-3 
                    \single \override NoteHead.X-offset = #-2 
                    \once \override Stem.length = 17
                    \single \override Stem.X-offset = #-15
                    \single \override NoteHead.X-offset = #-16
                    \single \override Stem.X-offset = #-15
                    \single \override NoteHead.X-offset = #-15
                \once \override Stem.length = 10
                \once \override NoteHead.no-ledgers = ##t
                \once \override NoteHead.transparent = ##t 
                \once \override Stem.X-offset = #-27
                \once \override Flag.stroke-style = #"grace"
        \new Staff {
            \override Stem.length = 45
            \clef "bass"
            \once \override Stem.length = 50 \crossStaff<<fad,,4 sol,,>>
                \once \override Stem.X-offset = #-4
                \single \override NoteHead.X-offset = #-5
                \single \override NoteHead.X-offset = #-4 
    \layout {
        \context {
            \override SpacingSpanner.spacing-increment = 5
            \consists #Span_stem_engraver 

which gives this result:

five groups of notes across two staves, withs stems reaching a common height, and slashed grace note flag above (disconnected)

I am a new LilyPond user so, I hope that it is not to messy. I guess there is a way to templating all these \overrides and to be more congruent in the use of \single and \once.


Probably another approach would be using 1/8th notes and creating a stencil for the beam. This does look way tidier indeed:

\new PianoStaff  = "Subsidiary Notes"  {
        \time 5/8
        \new Staff = "high" {
            \clef "treble"
               \override Beam.positions = #'(9 . 9)
            \relative {
                <sold'' la>8^[
                \change Staff = "low" 
                <fad,,,, sol>
                <red' mi>
                \change Staff = "high" 
                <lad''' si>
                <re mib>]
            \revert Beam.positions
        \new Staff = "low" {
            \clef "bass"
five groups of notes across two staves, with stems reaching a common height, beamed together


Well I managed to come up with a solution for the Beam! First I set it higher than the default one and the a make it invisible:

% inside Staff = "high"
\override Beam.positions = #'(9 . 9)
\override Beam.transparent = ##t

then at the end of the note group I draw the lines using a a customized \markup statement that I called samplePath:

% outside the score
samplePath = 
        (moveto -13.45 6.4)
        (lineto -6 8)
        (moveto -10.95 6.4)
        (lineto -6 8)
        (moveto -6.35 6.4)
        (lineto -6 8)
        (moveto -2.96 6.4)
        (lineto -6 8)
        (moveto 1.25 6.4)
        (lineto -6 8)
% the last chord of the group inside the Staff = "high" 
<re mib>]^\markup \path #0.1 #samplePath

and I get this:

five groups of notes across two staves, beamed together by independent lines

How would I position the slashed grace note flag above the line? I have been looking into the glyphs but there is no such symbol and I couldn't even align it properly. Maybe an image of it? But how would I position it correctly? Placing it in the next bar does and adding an negative X-offset does not work because it moves the lines.


It would be great to keep the \time 5/8 so that I could even generate a correct MIDI file out of it

  • What does this notation mean? What is the "4" for? Are all these notes meant to be played at the same time or not? Aug 20 at 19:11
  • 2
    This is the "4"th of 6 groups of what Stockhausen in this score calls "Accidental Notes". They are not supposed to be played as written, but rather to be used for composing a "possible version" of the score. The rules of Plus-Minus are quite complex. To simplify: there are 7 pages of simbols and seven pages of notes. The symbols indicate how to use these "Accidentals Notes" in combination of the rest of the provided material. This article gives a more detailed analysis of the piece
    – ddgg
    Aug 20 at 19:39

1 Answer 1


A general proof of concept of how this could be done:

#(define (grob-extent2 grob ref axis just dir)
   (let* ((cref (ly:grob-common-refpoint grob ref axis))
          (ext (ly:grob-extent grob cref axis))
          (rext (ly:grob-extent ref cref axis))
          (rext2 (ly:grob-extent ref (ly:grob-parent ref axis) axis))
          (just (/ (1+ just) 2))
          (justv1 (+ (* just (cdr rext)) (* (- 1 just) (car rext))))
          (justv2 (if (= dir UP) (car rext2) (cdr rext2)))
          (justv (- justv2 justv1)))
     (cons (+ (car ext) justv) (+ (cdr ext) justv))))

#(define (stem-alignment stem-expr)
   (if (equal? (car stem-expr) 'translate-stencil)
       (let ((offset (list-ref stem-expr 1))
             (align (stem-alignment (list-ref stem-expr 2))))
         (if align
             (+ (car offset) align)
       (if (equal? (car stem-expr) 'combine-stencil)
           (let ((align (filter (lambda (x) x) (map stem-alignment (cdr stem-expr)))))
             (if (null? align) #f (car align)))
           (if (and (equal? (car stem-expr) 'grob-cause)
                    (member 'stem-interface (ly:grob-interfaces (list-ref stem-expr 1))))

  \override Beam.after-line-breaking =
  #(lambda (grob)
     (let* ((stems (ly:grob-array->list (ly:grob-object grob 'stems)))
            (dir (ly:grob-property (car stems) 'direction))
            (exts-x (map (lambda (stem) (grob-extent2 stem grob X LEFT RIGHT)) stems))
            (exts-y (map (lambda (stem) (grob-extent2 stem grob Y CENTER dir)) stems))
            (cy (map (lambda (ext) (if (= DOWN dir) (car ext) (cdr ext))) exts-y))
            (cx (map interval-center exts-x))
            (lx (map interval-length exts-x))
            (bx (/ (+ (first cx) (last cx)) 2))
            (by (+ (/ (apply + cy) (length cy)) (* 0.5 dir)))
            (lines (map (lambda (x y w) (make-line-stencil w x y bx by)) cx cy lx))
            (stem (grob-interpret-markup grob #{
              \markup \rhythm { \omit NoteHead \override Stem.direction = #dir \slashedGrace c8 } 
            (stem (ly:make-stencil (ly:stencil-expr stem) (stencil-true-extent stem X) (stencil-true-extent stem Y)))
            (stem (ly:stencil-translate-axis stem (- ( stem-alignment (ly:stencil-expr stem))) X))
            (stem (ly:stencil-aligned-to stem Y (- dir)))
            (stem (ly:stencil-translate stem (cons bx by))))
       (ly:grob-set-property! grob 'stencil (apply ly:stencil-add stem lines))))
  g'8 c' e' g'
  c'' e'' f'' c''

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.