lilypond-user
[Top][All Lists]
Advanced

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

Re: placement sostenuto


From: David Nalesnik
Subject: Re: placement sostenuto
Date: Sun, 25 Sep 2011 14:42:52 -0500


Hi Harm,

On Sun, Sep 25, 2011 at 1:01 PM, Thomas Morley <address@hidden> wrote:


2011/9/24 David Nalesnik <address@hidden>

I don't know if I've gotten at the name of the articulation in the best way, but this works.  One drawback is that there can only be one override of 'after-line-breaking at a time.  
 
'before-line-breaking works too (see code below).

Aha -- good to know! 


[ . . . ] I'd prefer to store several properties in an alist, but I couldn't figure out how to read-out and call.

p.e.:
#(define ls '(
    ("staccato" . ((color . (1 0 0))))
    ("accent" . ((font-size . 4)(color . (1 0 0))))
    ("tenuto" . ((rotation . (45 0 0))))
    ("staccatissimo" . ((padding . -10) (color . (1 0 0))))
    ))

Any idea?

You could change the function to map ly:grob-set-property! onto the alist if a match is found: 

 \version "2.14.2"

#(define ls '(
    ("staccato" . ((color . (0 1 0))))
    ("accent" . ((font-size . 4)(color . (1 0 0))))
    ("tenuto" . ((rotation . (45 0 0)) (padding . 2)))
    ("staccatissimo" . ((padding . -10) (color . (0 0 1))))
    ))
 
#(define ((custom-script-tweaks type) grob)
   (map 
     (lambda (arg)
       (let ((lst (assoc-ref ls arg)))
         (if (equal? arg (ly:prob-property (assoc-ref (ly:grob-properties grob) 'cause) 'articulation-type))
             (for-each (lambda (x) (ly:grob-set-property! grob (car x) (cdr x))) lst)
             '())))
     type))  
   
  
\relative c'' {
  f1--
  f1--
  \override  Script #'before-line-breaking = 
      #(custom-script-tweaks '("staccato" "tenuto" "accent" "staccatissimo"))
    
  f-. f-| f-> f-> f-- f-|

  \revert Script #'before-line-breaking
  f-> f-.

-David


reply via email to

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