lilypond-user
[Top][All Lists]
Advanced

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

Changing slur behavior


From: R. Padraic Springuel
Subject: Changing slur behavior
Date: Mon, 23 Mar 2020 13:32:29 -0400

I’m trying to copy some music (chant) in which slurs are not indicated by 
bezier curves, but by changing the spacing between the notes (bringing them 
much closer together).  Now, while I’ve been able to figure out how to get the 
visual look, I’m not happy with the interface at the moment, as it requires 
inserting extra commands into the music so to turn on and off the tight 
spacing.  Furthermore, if I only have the tight spacing, then each note gets 
its own word when I start adding lyrics with \lyricsto.  What I’d like to do, 
therefore, is high-jack the existing slur notation so that the source looks 
“normal” but then instead of the usual curve, my spacing changes are applied 
instead (or at least in addition to).  Is there a way to accomplish this?

In the MWE below, \starttight and \endtight are my first pass attempts which 
apply the spacing, but don’t mark the notes as slurred (resulting in the words 
being applied wrong and messing up the spacing).  \startslur and \endslur apply 
both my spacing and the usual slur, allowing the lyrics to be assigned right 
(and the spacing preserved properly when that happens), but also causing the 
normal bezier curve to show up.

%%%%% MWE

\version "2.19.84"

% remove stems and auto bar lines
chant = { 
    \set Score.timing = ##f
    \omit Stem
} 

starttight = { \newSpacingSection \override 
Score.SpacingSpanner.base-shortest-duration = #(ly:make-moment -2) }
endtight = { \newSpacingSection \revert 
Score.SpacingSpanner.base-shortest-duration }

startslur = #(define-music-function (note) (ly:music?)
                  (set! (ly:music-property note 'articulations)
                      (cons (make-music 'SlurEvent 'span-direction -1)
                          (ly:music-property note 'articulations)
                      )
                  )
                 (make-music 'SequentialMusic 'elements 
                     (list 
                          #{ \newSpacingSection \override 
Score.SpacingSpanner.base-shortest-duration = #(ly:make-moment -2) #}
                          note
                     )
                 )
             )

endslur = #(define-music-function (note) (ly:music?)
                (set! (ly:music-property note 'articulations)
                      (cons (make-music 'SlurEvent 'span-direction 1)
                          (ly:music-property note 'articulations)
                      )
                  )
                 (make-music 'SequentialMusic 'elements 
                     (list 
                          #{ \newSpacingSection \revert 
Score.SpacingSpanner.base-shortest-duration #}
                          note
                     )
                 )
             )

music = { \chant
  a' g'
  a'( g')
  \starttight a' \endtight g'
  \startslur a' \endslur g'
}

words = \lyricmode { Some words to go under my notes }

\displayMusic \music

\new Staff <<
     \new Voice = "mel" { \music }
     \new Lyrics \lyricsto "mel" { \words }
>>



✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝
Fr. Samuel, OSB
(R. Padraic Springuel)
St. Anselm’s Abbey
4501 South Dakota Ave, NE
Washington, DC, 20017
202-269-2300
(c) 202-853-7036

PAX ☧ ΧΡΙΣΤΟΣ




reply via email to

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