[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: best practice for score structure

From: Claire Meyer
Subject: Re: best practice for score structure
Date: Mon, 6 Jul 2020 14:46:57 +0200

Thank you all for your responses and the templates.


On Sun, Jul 5, 2020 at 9:50 PM Paolo Prete <> wrote:


In general I don't suggest you use the dynamics centered between the staves for new scores. In my knowledge it is an obsolete engraving practice that has side effects.

<disclaimer> this is * not the truth * but it's * my * knowledge. Of course I can explain why this practice can be counterproductive, but in any case feel free to hear different opinions or to ignore my observation. </disclaimer>

This said, if you want to use it (for example because you are copying an old score) the approach in my opinion is the following

1) group the bars of the piano into blocks, so that you can read fragments of code that are not too long from left to right and then move on to the next line.
As it is convenient for all programming languages.

2) avoid explicitly writing a redundancy layer (---> many skips), so that the code is less verbose.

To do these things, AFAIK Lilypond does not provide native tools.

So I'll show you a possible idea of mine. It consists in extracting the dynamics automatically from the lower staff, and automatically creating a Dynamics layer with them. 
However, my Scheme code is ugly, *strongly* incomplete and I don't want to expand it because otherwise it gets even worse. I don't even know if my idea works in general or has side effects, because I don't use the Dynamics layer, so I haven't examined the problem in detail.
Consequently, the opinion of the Scheme Gurus in this ML is needed for these things (there are several. For example Aaron and Harm)

In any case, here is the template. As you can see I removed the redundancy layer. The code must be written only in the part with the tag "WRITE MUSIC HERE"





staffUp = \change Staff = "Staff_pfUpper"
staffDown = \change Staff = "Staff_pfLower"

removeDynamics = #(define-scheme-function (parser location mus) (ly:music?)
  (map-some-music (lambda (y)
    (let ((name (ly:music-property y 'name)))
        ((or (eq? name 'NoteEvent)(eq? name 'EventChord)(eq? name 'RestEvent)(eq? name 'SkipEvent))
          (map-some-music (lambda (z)
            (let ((name (ly:music-property z 'name)))
                ((eq? name 'AbsoluteDynamicEvent)
                  (set! z '())
                (else #f))))
        (else #f))))
#{ $mus #})

createDynamicsLayerFromMus = #(define-scheme-function (parser location mus) (ly:music?)
(let ((newSkip '())
 (newMus #{ #}))
            (map-some-music (lambda (q)
                  ((not (eq? (ly:music-property q 'context-id) '()))
                      (map-some-music (lambda (y)
  (let ((name (ly:music-property y 'name))
                         (newSkip '())
                              (assocDyn '()))

                           ((or (eq? name 'NoteEvent)(eq? name 'EventChord)(eq? name 'RestEvent)(eq? name 'SkipEvent))    
                            (map-some-music (lambda (z)
                              (let ((name2 (ly:music-property z 'name)))  
                                  ((eq? name2 'AbsoluteDynamicEvent)
                                    (set! assocDyn z)
                                  (else #f))))
                            (set! newSkip (make-music 'SkipEvent 'length (ly:music-length y) ))
                            (if (not (eq? assocDyn '()))
                              (ly:music-set-property! newSkip
                              'articulations (list (make-music 'AbsoluteDynamicEvent
                              'text (ly:music-property assocDyn 'text)))))
                            (set! newMus #{ #newMus #newSkip #})        


                          ((eq? name 'ContextChange)
                              (set! y '())

                          (else #f))                        
                      )) q)                        
                  (else #f)
            ) mus)

#{ $newMus #}))

pianoBlock = #(define-scheme-function (parser location mus1 mus2) (ly:music? ly:music?)
#{ << { #mus1 } \\ \new Voice = "sotto" { \staffDown #mus2 } >> #})

%%%%%%%%%%%%  WRITE MUSIC HERE %%%%%%%%%%%%%%%%

upper = {

{ c''4 c'' c'' c'' }
{ a\mf_"foobar" a\mp b b }

{ r1 r }
{ a\pp a }



lower = { }

\score {
  \new PianoStaff = "PianoStaff_pf" <<
    \new Staff = "Staff_pfUpper" << \removeDynamics \upper >>
    \new Dynamics = "Dynamics_pf" << \createDynamicsLayerFromMus \upper >>
    \new Staff = "Staff_pfLower" << \lower >>
  \layout { }

On Sun, Jul 5, 2020 at 5:03 PM Claire Meyer <> wrote:
Hi everybody,

I'm a new user (~1 month old) wondering about best practice for score structure. Let's say I've got a piano score, with two voices per hand, and the occasional third voice here and there, and all my dynamics  between the two staves of the piano. Then I'll probably write it with :
- four variables for my four voices (and add the occasional additional voices in those when needed)
- one variable for the dynamics

And round everything nicely in my score (with some intermediate variables, like one for each hand etc...).

But I have yet to find a place that seems like good practice (let alone best practice) for the structural aspects of my score, like bars and voltas, especially when they stop being trivial. I don't mind much when I've got one "||" bar at the end of my score to put it wherever. But when I have several voltas, dal segnos, alternative ends, special bars, etc... I wonder where is the best place to write that. Maybe in a null voice, like for lyrics that aren't aligned with any written rhythm ? Should I write it in each voice ?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]