[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lilypond-user
Subject:    Re: Harp lever changes
From:       David Nalesnik <david.nalesnik () gmail ! com>
Date:       2012-01-29 15:22:28
Message-ID: CANn-nXnHqp=Fs5AqwQRN_y+kLdjQPMqFne-5=Hjt2z-LPbQY9g () mail ! gmail ! com
[Download RAW message or body]

Hi Helge,


> On 29 January 2012 09:44, Helge Kruse <Helge.Kruse-nospam@gmx.net> wrote:
> > Hello,
> >
> > I want to write a score for the lever harp. To indicate a pedal change
> you
> > can write the new pedal position as note names as described in NR "2.2.4
> > Harp". While the pedal changes the pitch of all octaves you have to set
> the
> > levers for each individual string. This is indicated within the staff.
> >
> > To indicate that this notes are not part of the melody, it is surrounded
> by
> > a rectangle and sometimes by a different head shape. This is a but
> > complicated  since this rectangle should
> > - have it's own place (no notes or rest above or below it)
> > - ignored in any beat calculation, since it does not sound at all
> >
> > The attached examples show only one note per rectangle but are from a
> usual
> > score.
> >
> > Do you see a way to achieve this requirements with Lilypond?
>

One way to do it is to change the stencil of the note head to incorporate
the accidental, and then add the box to this..  (Unfortunately, adding the
box to a note which really has an accidental will displace it.  I don't
know how to accommodate this -- so the "F#" in the box in the example I've
attached is really an F# and not an F.)

I believe that if you use 2.14.2, the horizontal spacing won't be adjusted
if you change the box size. I'm using a recent development version and
accommodation is made.

The last example you show could be approached in a similar way, by adding a
clef stencil to the note head stencil, along with the accidental as I've
done.

I've typeset the boxed note as a grace note from which I've removed the
stem.

You can change the size of the box by changing the number in the override
of NoteHead #'stencil.

I hope you find this helpful (at least for single notes in boxes)!

-David

 \version "2.15.24"

#(define (boxed-note acc padding)
   (lambda (grob)
     (let ((note-stencil (ly:note-head::print grob))
           (accidental
             (cond ((string=? acc "sharp") (markup #:musicglyph
"accidentals.sharp"))
                   ((string=? acc "flat") (markup #:musicglyph
"accidentals.flat"))
                   ((string=? acc "natural") (markup #:musicglyph
"accidentals.natural")))))

       (set! note-stencil
         (ly:stencil-combine-at-edge
           (grob-interpret-markup grob accidental)
            X RIGHT
            note-stencil 0.2))

       (box-stencil note-stencil 0.1 padding))))

top = \relative c' {
  \time 2/4
  r16 f b f r e a e
}

bottom = \relative c {
  \clef bass
  <d b'>8 r <c c'> r
}

pedalChange = \relative c {
  \override Stem #'stencil = ##f
  \override NoteHead #'stencil = #(boxed-note "sharp" 0.5)
  s4. \afterGrace s8 f4
}

\new PianoStaff <<
  \new Staff {
    \top
  }
  \new Staff <<
    \new Voice {
      \bottom
    }
    \new Voice {
      \pedalChange
    }
  >>
>>

>

[Attachment #3 (text/html)]

Hi Helge,<br><br><div class="gmail_quote"><blockquote class="gmail_quote" \
style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div \
class="h5"><br> On 29 January 2012 09:44, Helge Kruse &lt;<a \
href="mailto:Helge.Kruse-nospam@gmx.net">Helge.Kruse-nospam@gmx.net</a>&gt; \
wrote:<br> &gt; Hello,<br>
&gt;<br>
&gt; I want to write a score for the lever harp. To indicate a pedal change you<br>
&gt; can write the new pedal position as note names as described in NR \
&quot;2.2.4<br> &gt; Harp&quot;. While the pedal changes the pitch of all octaves you \
have to set the<br> &gt; levers for each individual string. This is indicated within \
the staff.<br> &gt;<br>
&gt; To indicate that this notes are not part of the melody, it is surrounded by<br>
&gt; a rectangle and sometimes by a different head shape. This is a but<br>
&gt; complicated  since this rectangle should<br>
&gt; - have it&#39;s own place (no notes or rest above or below it)<br>
&gt; - ignored in any beat calculation, since it does not sound at all<br>
&gt;<br>
&gt; The attached examples show only one note per rectangle but are from a usual<br>
&gt; score.<br>
&gt;<br>
&gt; Do you see a way to achieve this requirements with \
Lilypond?<br></div></div></blockquote><div><br></div><div>One way to do it is to \
change the stencil of the note head to incorporate the accidental, and then add the \
box to this..  (Unfortunately, adding the box to a note which really has an \
accidental will displace it.  I don&#39;t know how to accommodate this -- so the \
&quot;F#&quot; in the box in the example I&#39;ve attached is really an F# and not an \
F.)</div> <div><br></div><div>I believe that if you use 2.14.2, the horizontal \
spacing won&#39;t be adjusted if you change the box size. I&#39;m using a recent \
development version and accommodation is made.</div><div><br></div><div> The last \
example you show could be approached in a similar way, by adding a clef stencil to \
the note head stencil, along with the accidental as I&#39;ve \
done.</div><div><br></div><div>I&#39;ve typeset the boxed note as a grace note from \
which I&#39;ve removed the stem.</div> <div><br></div><div>You can change the size of \
the box by changing the number in the override of NoteHead \
#&#39;stencil.</div><div><br></div><div>I hope you find this helpful (at least for \
single notes in boxes)!</div><div> <br></div><div>-David</div><div><br></div><div> \
\version &quot;2.15.24&quot;</div><div><br></div><div>#(define (boxed-note acc \
padding)</div><div>   (lambda (grob)</div><div>     (let ((note-stencil \
(ly:note-head::print grob))</div> <div>           (accidental</div><div>             \
(cond ((string=? acc &quot;sharp&quot;) (markup #:musicglyph \
&quot;accidentals.sharp&quot;))</div><div>                   ((string=? acc \
&quot;flat&quot;) (markup #:musicglyph &quot;accidentals.flat&quot;))</div> <div>     \
((string=? acc &quot;natural&quot;) (markup #:musicglyph \
&quot;accidentals.natural&quot;)))))</div><div><br></div><div>       (set! \
note-stencil</div><div>         (ly:stencil-combine-at-edge</div> <div>           \
(grob-interpret-markup grob accidental)</div><div>            X RIGHT</div><div>      \
note-stencil 0.2))</div><div><br></div><div>       (box-stencil note-stencil 0.1 \
padding))))</div><div><br></div> <div>top = \relative c&#39; {</div><div>  \time \
2/4</div><div>  r16 f b f r e a e</div><div>}</div><div><br></div><div>bottom = \
\relative c {</div><div>  \clef bass</div><div>  &lt;d b&#39;&gt;8 r &lt;c c&#39;&gt; \
r</div> <div>}</div><div><br></div><div>pedalChange = \relative c {</div><div>  \
\override Stem #&#39;stencil = ##f</div><div>  \override NoteHead #&#39;stencil = \
#(boxed-note &quot;sharp&quot; 0.5)</div><div>  s4. \afterGrace s8 f4</div> \
<div>}</div><div><br></div><div>\new PianoStaff &lt;&lt;</div><div>  \new Staff \
{</div><div>    \top</div><div>  }</div><div>  \new Staff &lt;&lt;</div><div>    \new \
Voice {</div><div>      \bottom</div><div>    }</div><div>  \new Voice {</div><div>   \
\pedalChange</div><div>    }</div><div>  &gt;&gt;</div><div>&gt;&gt;</div><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div><div class="h5"> </div></div></blockquote></div><font \
color="#888888"><br></font>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic