lilypond-user
[Top][All Lists]
Advanced

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

Re: Multiple instances of same articulation/bowing on one note


From: Jean Abou Samra
Subject: Re: Multiple instances of same articulation/bowing on one note
Date: Wed, 1 Feb 2023 04:07:42 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0

On 01/02/2023 03:51, Ahanu Banerjee wrote:
> It's obviously not a bug. Jean, thanks for pointing out where the relevant 
> instruction is.
> 
> What would be the easiest way to modify this behavior for a single score? 


It's a bit of a weird thing to do, but you could consider

\version "2.24.0"

allowMultipleArticulations =
#(define-music-function (mus) (ly:music?)
   (let ((syms '()))
     (for-each
      (lambda (art)
        (let* ((sym (ly:music-property art 'articulation-type))
               (fresh (make-symbol "unique-articulation")))
          (set! syms (acons fresh sym syms))
          (ly:music-set-property! art 'articulation-type fresh)))
      (extract-typed-music mus 'articulation-event))
     #{
       \context Bottom \applyContext
         #(lambda (context)
            (let* ((defs (ly:context-property context 'scriptDefinitions))
                   (defs-hash ((@ (ice-9 hash-table) alist->hashq-table)
                               defs))
                   (new-defs (append (map (lambda (p)
                                            (cons (car p)
                                                  (hashq-ref defs-hash (cdr 
p))))
                                          syms)
                                     defs)))
              (ly:context-set-property! context 'scriptDefinitions new-defs)))
       #mus
     #}))

\language "english"

\allowMultipleArticulations
{ g8 g_\upbow ^\upbow g g % fails
  g8 g_\upbow ^\downbow g g % works
}



If you have several voices, you must apply the function to each of them
separately.

Jean


Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

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