lilypond-user
[Top][All Lists]
Advanced

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

Re: Vertical placement of ottava line


From: Peter Crighton
Subject: Re: Vertical placement of ottava line
Date: Tue, 7 Oct 2014 01:52:15 +0200

2014-10-07 0:56 GMT+02:00 Peter Crighton <address@hidden>:
2014-10-05 16:13 GMT+02:00 Thomas Morley <address@hidden>:
2014-10-05 15:45 GMT+02:00 Peter Crighton <address@hidden>:
> Does anybody have more ideas for this (see below)? How can I move the
> beginning and end of OttavaBrackets horizontally, or rather change their
> alignment to the note head?


Maybe try the code below.

Thanks for your help, but that is not what I need anymore. Vertical placement was fixed for me by Pierre a few emails before. (Maybe I confused you with what I quoted.)

I now have this code:

[…]

This works great for the vertical placement, but horizontal alignment is different than with default \ottava. This leads to a faulty display of the ottavaBracket concerning only one single note.
I’ll attach an image of the problem.

What I am looking for is a way to alter horizontal alignment of the ottavaBracket to the NoteHeads(, which works with the above overrides). So that the 8 begins not at the center of the first note head, but a bit left of it, and the bracket ends not at the center of the last note head, but a bit right of it.

Okay, I got it, sorry for the noise. I had to add (attach-dir . ,LEFT) and (attach-dir . ,RIGHT), respectively to the bound-details. This doesn’t solve the problem with the bracket spanning only one note, but at least I now know how to manually override it to fix it for those occurences.

Anyway, now I’ve stumbled upon another problem related to this code. When I have overriden the ottavaBracket in this manner, after a line break it starts at the beginning of the line and not above the first note. Also, the 8va is not repeated at the beginning of the new line.


\version "2.19.13"

ottavaLineUp = {
  \override Staff.OttavaBracket.stencil = #ly:line-spanner::print
  \override Staff.OttavaBracket.bound-details = #`((left . ((Y . 0)
                                                            (attach-dir . ,LEFT)
                                                            (stencil-align-dir-y . ,UP)))
                                                   (right . ((Y . 0)
                                                             (attach-dir . ,RIGHT)
                                                             (text . ,(make-draw-dashed-line-markup (cons 0 -1.2))))))
  \override Staff.OttavaBracket.left-bound-info = #ly:line-spanner::calc-left-bound-info-and-text
  \override Staff.OttavaBracket.right-bound-info = #ly:line-spanner::calc-right-bound-info
}

ottavaLineDown = {
  \override Staff.OttavaBracket.stencil = #ly:line-spanner::print
  \override Staff.OttavaBracket.bound-details = #`((left . ((Y . 0)
                                                            (attach-dir . ,LEFT)
                                                            (stencil-align-dir-y . ,DOWN)))
                                                   (right . ((Y . 0)
                                                             (attach-dir . ,RIGHT)
                                                             (text . ,(make-draw-dashed-line-markup (cons 0 1.2))))))
  \override Staff.OttavaBracket.left-bound-info = #ly:line-spanner::calc-left-bound-info-and-text
  \override Staff.OttavaBracket.right-bound-info = #ly:line-spanner::calc-right-bound-info
}

#(define-markup-command (topAlign layout props arg)
   (markup?)
   (let* ((mol (interpret-markup layout props arg)))
     (ly:stencil-aligned-to mol Y 1)))

ottavava = {
  \ottavaLineUp
  \ottava #1
  \set Staff.ottavation = \markup \concat \bold \topAlign { "8" \tiny "va" }
}

ottavavb = {
  \ottavaLineDown
  \ottava #-1
  \set Staff.ottavation = \markup \concat \bold { "8" \tiny "vb" }
}

\relative c'' {
  \ottavava c1 \break
  c
}


How can the line-breaking behaviour be restored, so it is displayed like with \ottava #1?
Is it possible to alter the (attach-dir . ) again after a line break? That would fix the start point, but of course would not bring back the 8va.

And as a side note: Why does (attach-dir . ) not work with decimals? I can enter -1 or -2, but I’d rather like it to be something like -1.5 …


--
Peter Crighton | Musician & Music Engraver based in Mainz, Germany
http://www.petercrighton.de


reply via email to

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