lilypond-user
[Top][All Lists]
Advanced

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

Fwd: Re: parenthesizing arpeggios


From: Urs Liska
Subject: Fwd: Re: parenthesizing arpeggios
Date: Mon, 23 Apr 2012 10:22:04 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20120329 Thunderbird/11.0.1

Thanks again very much. I checked it out and it works perfectly!

Just for the record (or anybody who searches), this is what I did:

\version "2.15.36"

parenthArpeggio= {
  \once \override Arpeggio #'stencil = #(lambda (grob)
    (parenthesize-stencil (ly:arpeggio::print grob) 0.1 0.5 0.5 0.2))
  \once \override Arpeggio #'before-line-breaking = #(lambda (grob)
    (set! (ly:grob-property grob 'X-extent)
          (ly:stencil-extent (ly:grob-property grob 'stencil) X)))
}
parenthArpeggioDraft = {
  \parenthArpeggio  
  \once \override Arpeggio #'color = #red
}
\relative c' {
  \repeat unfold 4 {
    <c g' e'>-\arpeggio
  } 
\parenthArpeggio <cis dis fis gis cis dis gis>-\arpeggio
  <cis dis fis gis cis dis>-\arpeggio
  \parenthArpeggioDraft <cis dis fis gis cis>-\arpeggio
  <cis dis fis gis>-\arpeggio
}
Hope it helps somebody ...
Best
Urs

-------- Original-Nachricht --------
Betreff: Re: parenthesizing arpeggios
Datum: Sun, 22 Apr 2012 20:23:01 -0500
Von: David Nalesnik <address@hidden>
An: Urs Liska <address@hidden>
Kopie (CC): Lilypond-User <address@hidden>


Hi again!


Here's something that works for arpeggios.  The attached file is a bit large because I needed to include several functions from stencil.scm to draw the parentheses.

Oh, what ever was I thinking!  No need at all for all that duplicated code...

This is all you need:

\version "2.15.36"

\relative c' {
  \override Arpeggio #'stencil = #(lambda (grob)
    (parenthesize-stencil (ly:arpeggio::print grob) 0.1 0.5 0.5 0.2))
  \override Arpeggio #'before-line-breaking = #(lambda (grob)
    (set! (ly:grob-property grob 'X-extent)
          (ly:stencil-extent (ly:grob-property grob 'stencil) X)))
  \repeat unfold 4 {
  <c g' e'>-\arpeggio
  } 
  <cis dis fis gis cis dis gis>-\arpeggio
  <cis dis fis gis cis dis>-\arpeggio
  <cis dis fis gis cis>-\arpeggio
  <cis dis fis gis>-\arpeggio
}

-David

Attachment: parenthArpeggio.preview.png
Description: PNG image


reply via email to

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