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 00:56:53 +0200

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:


\version "2.19.13"

ottavaLineUp = {
  \override Staff.OttavaBracket.stencil = #ly:line-spanner::print
  \override Staff.OttavaBracket.bound-details = #`((left . ((Y . 0)
                                                            (stencil-align-dir-y . ,UP)))
                                                   (right . ((Y . 0)
                                                             (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
  \override Staff.OttavaBracket.minimum-length = ##f
}

ottavaLineDown = {
  \override Staff.OttavaBracket.stencil = #ly:line-spanner::print
  \override Staff.OttavaBracket.bound-details = #`((left . ((Y . 0)
                                                            (stencil-align-dir-y . ,DOWN)))
                                                   (right . ((Y . 0)
                                                             (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'' {
  c1
  \ottava #1 c c
  \ottava #-1 c c
  \ottava #0 c
  \ottava #1 c
  \ottava #-1 c
  \break
  \ottava #0 c
  \ottavava c c
  \ottavavb c c
  \ottava #0 c
  \ottavava c
  \ottavavb c
}


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.

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

Attachment: ottavaBracket.jpg
Description: JPEG image


reply via email to

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