lilypond-user
[Top][All Lists]
Advanced

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

help with doublebreve function


From: Kieren MacMillan
Subject: help with doublebreve function
Date: Thu, 9 Apr 2009 07:36:12 -0400

Hi all,

I've come up with a way (music function) of generating double-breves of which I'm somewhat proud:

%%%%%%%%%%
\version "2.12.2"
dbreve =
        #(define-music-function (parser location note) (ly:music?)
                #{
                        \once \override ParenthesesItem #'stencil = 
#ly:text-interface::print
                        \once \override ParenthesesItem #'text =
\markup { \translate #'(-0.4 . -0.45) \override #'(thickness . 2) \draw-line #'(0 . 0.9)
                                        \hspace #1.86 \translate #'(-0.4 . 
-0.45)
                                        \override #'(thickness . 2) \draw-line 
#'(0 . 0.9)  }
                        \parenthesize $note
                #})
\score { \relative { \dbreve b'\breve*2 \dbreve g\breve*2 } }
%%%%%%%%%%

Short of Lilypond *actually* having a doublebreve -- which is so rare in the wild, it's not worth spending any time on a native duration -- I think this is pretty cool. Of course, I'd much rather just say

    b'\dbreve

How can I make that happen? I've used \displayMusic to see what's necessary given the current function... but I don't know how to "reverse time" and apply the ParenthesesItem tweaks from "the other side". Any help would be greatly appreciated -- once this is done, I think it might make a useful snippet.

Thanks,
Kieren.




reply via email to

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