[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: change custom notehead for different stem direction
From: |
Orm Finnendahl |
Subject: |
Re: change custom notehead for different stem direction |
Date: |
Wed, 8 Sep 2021 21:01:28 +0200 |
Hi Lukas,
thanks, looks excellent, will adopt to that style!
Best,
Orm
----------------------------------------------------------------------
Prof. Orm Finnendahl
Komposition
Hochschule für Musik und Darstellende Kunst
Eschersheimer Landstr. 29-39
60322 Frankfurt am Main
https://www.youtube.com/watch?v=2rWha1HTfFE&list=PLiGfneJSWmNw6dTUvcTHbTkCYOOTiB_N6
Am Mittwoch, den 08. September 2021 um 16:49:00 Uhr (+0200) schrieb
Lukas-Fabian Moser:
> Hi Orm,
>
> Am 08.09.21 um 13:23 schrieb Orm Finnendahl:
> > below is a working example for the record. You can tweak the
> > linewidth changing "setlinewidth 1" in flpizzleft and flpizzright or
> > the angles/proportions of the lines in the line containing the moveto,
> > lineto and stroke. Even if you don't know Postscript it should be
> > fairly obvious. When changing the linewidth you might have to adjust
> > the connection points for the stems accordingly.
>
> Motivated in part by recent discussions on -devel on whether or not there's
> a long-term need for \postscript support, I rewrote your code without
> postscript, stream-lining a bit along the way:
>
> \version "2.22.0"
>
> flpizz =
> \markup
> \with-dimensions #'(0 . 0.9) #'(-0.4 . 0.4)
> \path #0.2 #'((moveto 0.9 0.4)
> (lineto 0 0)
> (lineto 0.9 -0.4))
>
> %{
> % Uncomment if \flpizzleft and \flpizzright are both needed e.g. in markups
>
> #(define-markup-command (Xflip layout props arg) (markup?)
> "Flips a markup horizontally keeping its extents (absolute positions)"
> (let* ((orig (interpret-markup layout props arg))
> (extent (ly:stencil-extent orig X)))
> (ly:stencil-translate-axis
> (ly:stencil-scale orig -1 1)
> (+ (car extent) (cdr extent))
> X)))
>
> flpizzleft = \flpizz
> flpizzright = \markup \Xflip \flpizzleft
> %}
>
> flutepizz = \temporary {
> \override NoteHead.stencil =
> #(lambda (grob)
> (let*
> ((notehead (grob-interpret-markup grob flpizz))
> (notecolumn (ly:grob-parent grob X))
> (stem (ly:grob-object notecolumn 'stem))
> (direction (ly:grob-property stem 'direction)))
> (if (positive? direction)
> (ly:stencil-scale notehead -1 1)
> notehead)))
> \override NoteHead.stem-attachment = #'(1.223 . -0.1)
> }
>
> flutepizzOff = \undo\flutepizz
>
> {
> \flutepizz c''4 f'16 c' d' cis'' \flutepizzOff d''4
> }
>
> Lukas
>