lilypond-user
[Top][All Lists]
Advanced

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

Re: Can an augmentation dot be parenthesized?


From: Lukas-Fabian Moser
Subject: Re: Can an augmentation dot be parenthesized?
Date: Wed, 24 May 2017 19:47:41 +0200

Hi Robert,
 
I would tather like to parenthesize these added augmenation dots but I've not found a way to do that.

I don't know how to parenthesize them, but here is a solution yielding brackets around them:

\version "2.19.44"

#(define (special-bracketify original-stencil len thick protusion padding)
  (let* (
         (left-bracket (ly:bracket Y (cons (- len) len) thick (- protusion)))
         (right-bracket (ly:bracket Y (cons (- len) len) thick protusion)))
    (set! original-stencil
 (ly:stencil-combine-at-edge original-stencil X RIGHT right-bracket (- -0.73 padding)))
    (set! original-stencil
(ly:stencil-combine-at-edge original-stencil X RIGHT left-bracket padding))
    original-stencil))

bracketDot = \once \override Dots.stencil = #(lambda (grob)
    (special-bracketify (ly:dots::print grob) 0.4 0.1 0.2 0)) 
% first number (0.4): bracket length
% second number (0.1): thickness
% third number (0.2): protrusion
% fourth number (0.1): space between dot and brackets


 {
  c''4.
  r8
  \bracketDot
  a'4.
  r8


Question to the experts: If I unterstand my own code correctly :-), the right-hand edge of the dot stencil (used by stencil-combine-at-edge) is the right-most part of the dot itself, while the left-hand edge seems to be the right-most part of the note the dot is attached to.
For this reason I took (for the left bracket) the *right* hand edge of the dot and added offsets with trial-and-error, which should be fine since I assume the dot will have the same size wherever it occurs. But nevertheless there must be a more conceptual way?

Best
Lukas

reply via email to

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