lilypond-user
[Top][All Lists]
Advanced

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

Re: Change the shape of treble clef


From: Pierre Perol-Schneider
Subject: Re: Change the shape of treble clef
Date: Thu, 8 Feb 2018 08:58:45 +0100

Hi Klose,
Here's a possibility (v.2.19) :

%%%%%
\version "2.19"

%% Defs:
#(define-markup-command (gClef layout props thk mlt) (number? number?)
  (interpret-markup layout props
   (markup
    (#:stencil
     (make-path-stencil
      '(M 1.117 -2.778
        C 0.73 -2.782 0.363 -2.364 0.484 -1.981
        C 0.566 -1.641 1.043 -1.54 1.285 -1.786
        C 1.504 -1.997 1.418 -2.395 1.141 -2.513
        C 0.996 -2.567 0.836 -2.583 1.09 -2.614
        C 1.379 -2.673 1.703 -2.559 1.828 -2.278
        C 1.969 -1.911 1.82 -1.395 1.766 -1.024
        C 1.031 -1.169 0.277 -0.903 0.031 -0.196
        C -0.129 0.323 -0.043 0.917 0.25 1.366
        C 0.492 1.737 0.832 1.999 1.152 2.3
        C 1.07 2.886 1 3.468 1.203 4.034
        C 1.297 4.292 1.484 4.503 1.68 4.687
        C 1.898 4.886 2.117 4.335 2.211 4.062
        C 2.398 3.601 2.227 2.839 1.934 2.323
        C 1.816 2.105 1.637 1.929 1.457 1.757
        C 1.5 1.523 1.539 1.288 1.586 1.054
        C 2.117 1.077 2.477 0.792 2.602 0.359
        C 2.766 -0.134 2.516 -0.766 1.953 -0.977
        C 2.004 -1.423 2.16 -1.927 2.004 -2.313
        C 1.902 -2.567 1.656 -2.766 1.379 -2.778
        C 1.293 -2.798 1.203 -2.79 1.117 -2.782
        M 1.734 -0.919
        C 1.621 -0.306 1.574 0.026 1.5 0.464
        C 1.164 0.433 0.973 0.066 1.09 -0.22
        C 1.141 -0.345 1.223 -0.407 1.359 -0.485
        C 1.492 -0.563 1.387 -0.657 1.297 -0.618
        C 1.031 -0.509 0.664 -0.188 0.758 0.269
        C 0.816 0.569 1.059 0.917 1.398 1.023
        C 1.359 1.261 1.332 1.378 1.297 1.612
        C 0.887 1.234 0.332 0.753 0.348 0.155
        C 0.363 -0.532 0.746 -1.071 1.734 -0.919
        M 1.688 0.48
        C 1.762 0.105 1.844 -0.509 1.926 -0.88
        C 2.656 -0.462 2.438 0.534 1.688 0.48
        M 2.016 3.776
        C 1.984 4.378 1.691 4.058 1.5 3.706
        C 1.313 3.366 1.273 2.894 1.352 2.468
        C 1.945 3.066 2.031 3.409 2.016 3.776
        Z)
       thk mlt mlt #t)))))

\layout {
  \context {
    \Score
    \override Clef.stencil =
      #(lambda (grob)
         (let* ((sz (ly:grob-property grob 'font-size 0.00))
                (mlt (magstep sz))
                (glyph (ly:grob-property grob 'glyph-name)))
               (cond
                ((equal? glyph "clefs.G")
                 (grob-interpret-markup grob
                  (markup #:scale(cons mlt mlt)#:gClef 0 1)))
                ((equal? glyph "clefs.G_change")
                 (grob-interpret-markup grob
                  (markup #:scale(cons mlt mlt)#:gClef .01 .8)))
                (else (ly:clef::print grob)))))
     \override ClefModifier.extra-offset = #'(.3 . 0)
  }
}

%% Test:
{ c' }
     
     
%%%%

Cheers,
Pierre

2018-02-08 8:48 GMT+01:00 Jacques Menu Muzhic <address@hidden>:


> Le 8 févr. 2018 à 07:39, klose <address@hidden> a écrit :
>
> Hi Andrew,
>
> Thank you for your reply but it looks like the ink is dead?

Intended pun, given the post subject?

JM


_______________________________________________
lilypond-user mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user


reply via email to

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