Menu

#3865 Change to ottavation text

Accepted
nobody
None
Ugly
2015-10-30
2014-02-16
Anonymous
No

Originally created by: *anonymous

Originally created by: PhilEHol...@googlemail.com

Joram Berger said:

considering the statement by Gould below and my personal findings, I would like to see the following change to the ottavation bracket be added to LilyPond like proposed in this thread:
http://lists.gnu.org/archive/html/lilypond-user/2014-02/msg00321.html

An example of how this could look is below, and an image is attached.

\version "2.18.0"

ottavaaI = { % this is an alternative proposal to all the rest
  \ottava 1
  \set Staff.ottavation = \markup  \concat {
   \bold "8" \fontsize #-2 \translate-scaled #'(0 . 0.85) "va"
  }
}

ottavaa = {
  \ottava 1
  \set Staff.ottavation = \markup  \concat {
   \bold "8" \fontsize #-2 \translate-scaled #'(0 . 0.85) "va"
  }
}

ottavab = {
  \ottava -1
  \set Staff.ottavation = \markup \bold \concat{
    "8" \fontsize #-2 "vb" }
}

ottavac = {
  \ottava 2
  \set Staff.ottavation = \markup \bold \concat{
    "15" \fontsize #-2 \translate-scaled #'(0 . 0.85) "ma"
  }
}

ottavad = {
  \ottava -2
  \set Staff.ottavation = \markup \bold \concat{
    "15" \fontsize #-2 "mb" }
}

ottavae = {
  \ottava 3
  \set Staff.ottavation = \markup \bold \concat {
    "22" \tiny \translate-scaled #'(0 . 0.85) "ma"
  }
}

ottavaf = {
  \ottava -3
  \set Staff.ottavation = \markup \bold \concat {
    "22"\fontsize #-2 "mb"
  }
}

<<
  \new Staff \relative c''' {
    \ottava #1 a a
    \ottava #-1 a,, a
    \ottava #2 a''' a
    \ottava #-2 a,,,, a
    \ottava #3 a''''' a
    \ottava #-3 a,,,,,, a
    \ottava #0
  }
  \new Staff \relative c''' {
    \ottavaa a a
    \ottavab a,, a
    \ottavac a''' a
    \ottavad a,,,, a
    \ottavae a''''' a
    \ottavaf a,,,,,, a
    \ottavaaI a'''' a
  }
>>
1 Attachments

Related

Issues: #3866

Discussion

  • Simon Albrecht

    Simon Albrecht - 2015-10-30

    In this thread, Gilberto Agostinho and I made a sample implementation of this. The current state is:

    \version "2.19.28"
    \paper { #(set-paper-size "a8landscape") indent = 0 }
    #(ly:set-option 'point-and-click #f)
    \header { tagline = ##f }
    
    #(define-markup-command
      (format-ottava layout props dir interval)
      (integer? integer?)
      "Output a markup for use in { \\set Staff.ottavation }.
    Takes as input the direction of ottavation (-1 or 1)
     and the interval (one of the numbers 8, 15, 22, 29)"
      (let* ((upward? (positive? dir))
             (number (number->string interval))
             (text (case interval
                     ((8) "va")
                     ((15) "ma")
                     ((22) "da")
                     ((29) "na")))
             (text (markup #:small text)))
        (interpret-markup layout props
          (markup
           #:concat (
                      number
                      #:raise (if upward? 0.6 0) text
                      )))))
    
    ottavation =
    #(define-music-function (number) (integer?)
       (let* ((direction (if (positive? number) UP DOWN))
              (right-text (make-draw-line-markup (cons 0 (if (> number 0) -.8 .8))))
              (interval (+ 1 (* 7 (abs number))))
              (ottavation-markup (make-format-ottava-markup direction interval)))
         (if
          (= number 0)
          #{
            \ottava #0
          #}
          #{
            \override Staff.OttavaBracket.stencil = #ly:line-spanner::print
            \override Staff.OttavaBracket.bound-details =
            #`((left . ((Y . 0.0)
                        (attach-dir . ,LEFT)
                        (padding . 0)
                        (stencil-align-dir-y . ,direction)))
               (right . ((Y . 0.0) ; Change the integer here
                          (padding . 0)
                          (attach-dir . ,RIGHT)
                          (text . ,right-text))))
            \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
            \ottava $number
            \set Staff.ottavation = $ottavation-markup
          #}
          )))
    
    \relative c' {
      \ottavation #1
      c'4 c c c
      \ottavation #2
      c'4 c c c
      \ottavation #4
      c''4 c c c
      \ottavation #-1
      c,,,,,4 c c c
      \ottavation #-3
      c,,4 c c c
      \ottavation #0
      R1
    }
    

    Hopefully, this will be of some help in implementing this in core LilyPond.

     
    • Simon Albrecht

      Simon Albrecht - 2015-10-30

      This also addresses issue 3866.

       

      Related

      Issues: #3866

      • Simon Albrecht

        Simon Albrecht - 2015-10-30

        Joram kindly pointed out that the endings should read ‘22ma’ and ‘29ma’. I wrongly inferred this from Latin :-)
        So, lines 14–18 of my code should be changed to read

        ~~~~
        :::Scheme
        (text (case interval
        ((8) "va")
        ((15 22 29) "ma")))
        ~~~~

         
  • J Noeck

    J Noeck - 2015-10-30

    A few more comments:

    • I would change line 14-18 directly to (text (if (= interval 8) "va" "ma")) thus allowing arbitrary octaves.
    • Another option would be to use 'vb' for \ottava -1 (for lines 14-18 again):
      (text (if upward? (if (= interval 8) "va" "ma") (if (= interval 8) "vb" "mb")))
      Well, I see that Gould uses '8va' for ottava bassa, so I am undecided here.
    • Can the text 'va' etc. be made optional or overrideable? (besides 8va, typical choices are 8, 8a; and this could open it for users to choose 8vb, too)
    • If #(make-music 'OttavaMusic 'ottava-number number) is used instead of \ottava $number, this function could be called \ottava and be used as a replacement in ly/music-functions-init.ly.
    • While bold and medium font-series are possible, I would suggest (along with the look of E. Gould's examples) to use bold octavation numbers as default.
     
    • Simon Albrecht

      Simon Albrecht - 2015-10-30

      I would change line 14-18 directly to (text (if (= interval 8) "va" "ma")) thus allowing arbitrary octaves.

      I see that the ‘va’ in ‘ottava’ is definitely the only exception here, so that’s perfectly fine.

      Another option would be to use 'vb' for \ottava -1 (for lines 14-18 again):
      (text (if upward? (if (= interval 8) "va" "ma") (if (= interval 8) "vb" "mb")))
      Well, I see that Gould uses '8va' for ottava bassa, so I am undecided here.

      Now you say it: I used to prefer vb/mb. On the other hand, ‘8va’ doesn’t mean ‘ottava alta’ either, but simply ottava – the direction is made clear enough through the placement above/below staff and the alignment of the line. So ‘8vb’ is unnecessary and actually inconsistent.

      Can the text 'va' etc. be made optional or overrideable? (besides 8va, typical choices are 8, 8a; and this could open it for users to choose 8vb, too)

      I’m not quite sure what a good interface would look like. Certainly we should allow omitting the suffix (e.g. through a boolean grob property like display-suffix?), but too much configurability could obfuscate matters, and it’s pretty pointless also – or does it make a relevant difference, if vb or va is used?

      If #(make-music 'OttavaMusic 'ottava-number number) is used instead of \ottava $number, this function could be called \ottava and be used as a replacement in ly/music-functions-init.ly.

      Good point, though I think there’s some way to go before having it in the codebase…

      While bold and medium font-series are possible, I would suggest (along with the look of E. Gould's examples) to use bold octavation numbers as default.

      Too bad we don’t have semibold at hand – bold is definitely too much in my eyes…

      I attach an updated version of the code.

       
      • J Noeck

        J Noeck - 2015-10-30

        Concering the interface, how about providing different markup commands like your format-ottava and a grob property text-style (or similar) which accepts such functions? That would offer a lot of flexibility while still providing the correct numbers and the line settings.

        Good point, though I think there’s some way to go before having it in the codebase…

        Of course, but this #(make-music ... can be used right away, no matter whether the function is called \octavation or \ottava.

         
  • J Noeck

    J Noeck - 2015-10-30

    One more note: The 0.6 in line 24 depends on the font, Linux Libertine would need something more like 0.5.

     
    • Simon Albrecht

      Simon Albrecht - 2015-10-30

      That’s where the coding definitely needs to be improved.

       
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.