Hello Greg,
Maybe something like this?

Cheers,
Valentin

Am Freitag, 7. Jänner 2022, 22:05:23 CET schrieb Gregory Hollands:
> Lukas,
> 
> This solution sounds ideal.
> I would prefer to add the articulations directly to the music and just
> filter them out when necessary.
> 
> -Greg
> 
> On Fri, Jan 7, 2022 at 3:13 PM Lukas-Fabian Moser <[email protected]> wrote:
> > Hi Gregory,
> > 
> > > My goal is to be able to turn articulations on and off easily,
> > > especially for different versions of the same score.
> > > 
> > > Questions
> > > 1. Is this the best way to separate articulations from the melody?
> > > 2. Is there a better way to turn articulations on and off?
> > > 3. How do I avoid collisions between the articulations and the note
> > 
> > stems?
> > 
> > I think I'd just add the articulations directly to the music and filter
> > them out at a later stage. It's not hard to write a scheme function
> > that, for example, removes articulations of given types (here
> > downbow/upbow), and there were similar examples recently on this list.
> > (A recent change I made to LilyPond itself made that still easier, but
> > these will only be available publicly when 2.23.6 is released.)
> > 
> > Before I give an example: Would this method be acceptable for you?
> > 
> > Lukas
\version "2.22"

chooseArticulations =
#(define-music-function (arts music) (list? ly:music?)
   (define (predicate music)
     (if (music-is-of-type? music 'articulation-event)
         (let ((type (ly:music-property music
                                        'articulation-type)))
           (member type arts)) #t))
   (music-filter predicate music))

Chords = \chords {
   \set chordChanges = ##t
   c1 c1 f2 g2 c1
}

Music = \relative c' {
   e8\downbow dis e g\upbow ~ g4 e\downbow
   g8 a g c ~ c8 b c d
   e d c b c d4 c8 ~
   c2. r4
}




\chooseArticulations #'("downbow") <<
  \Chords
  \new Staff \new Voice <<
    \Music
  >>
>>

\chooseArticulations #'("upbow") <<
  \Chords
  \new Staff \new Voice <<
    \Music
  >>
>>

\chooseArticulations #'("downbow" "upbow") <<
  \Chords
  \new Staff \new Voice <<
    \Music
  >>
>>

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to