lilypond-user
[Top][All Lists]
Advanced

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

Re: list of stencils


From: Massimiliano Viel
Subject: Re: list of stencils
Date: Mon, 4 Dec 2017 19:41:28 +0100

Thank you very much!
With time I’ll be able to get the details of it. In the meanwhile I can use it… 
and go on studying!

Best!

massimiliano

> On 4 Dec 2017, at 19:21, Edward Neeman <address@hidden> wrote:
> 
> Thanks for clarifying!
> 
> You'll want to look over here:
> https://github.com/lilypond/lilypond/blob/master/scm/stencil.scm
> 
> That is not the most user-friendly place to search out stencils,
> admittedly! You can also try the \displayMusic and \displayScheme
> functions to see how lilypond is processing your file.
> 
> Try starting with this:
> 
> slashedNoteHead =
> \once \override NoteHead.stencil = #(lambda (grob)
>    (let* ((note (ly:note-head::print grob))
>           (combo-stencil (ly:stencil-add
> note
> 
>               (make-line-stencil 0.08 -1 -0.5 2.5 1))))
>          (ly:make-stencil (ly:stencil-expr combo-stencil)
>            (ly:stencil-extent note X)
>            (ly:stencil-extent note Y))))
> 
> %%%%
> 
> Here's the relevant section in stencils.scm:
> 
> (define-public (make-line-stencil width startx starty endx endy)
> "Make a line stencil of given linewidth and set its extents accordingly."
> (let ((xext (cons (min startx endx) (max startx endx)))
> (yext (cons (min starty endy) (max starty endy))))
> (ly:make-stencil
> (list 'draw-line width startx starty endx endy)
> ;; Since the line has rounded edges, we have to / can safely add half the
> ;; width to all coordinates!
> (interval-widen xext (/ width 2))
> (interval-widen yext (/ width 2)))))
> 
> Best,
> Edward
> --------------
> 
> Dr. Edward Neeman
> Adjunct Instructor, South Georgia State College
> Collaborative Pianist, Valdosta State University, Georgia
> Artist Faculty, ELMS Conservatory, Jakarta
> address@hidden
> www.neemanpianoduo.com
> 
> 
> On Mon, Dec 4, 2017 at 12:54 PM, Massimiliano Viel <address@hidden> wrote:
>> Hi,
>> at the moment I solved the problem with postscript as I couldn’t properly
>> deal with the vertical lining of the note-glyph and the line of the markup
>> (it seems to me difficult to move a markup over a staff).
>> Here is what I did:
>> 
>> dblacknote = {
>>  \once \override NoteHead.stencil = #ly:text-interface::print
>>  \once \override NoteHead.text = \markup {
>>    \combine
>>    \musicglyph #"noteheads.s2"
>>    \postscript #"
>>        newpath
>>        0.13 setlinewidth
>>        -0.3 -0.6 moveto
>>        1.6 0.6 lineto
>>        stroke"
>>  }
>> }
>> 
>> dwhitenote = {
>>  \once \override NoteHead.stencil = #ly:text-interface::print
>>  \once \override NoteHead.text = \markup {
>>    \combine
>>    \musicglyph #"noteheads.s1"
>>    \postscript #"
>>        newpath
>>        0.13 setlinewidth
>>        -0.3 -0.6 moveto
>>        1.7 0.7 lineto
>>        stroke"
>>  }
>> }
>> 
>> The snippet I was referring to was:
>> 
>> circle =
>> \once \override NoteHead.stencil = #(lambda (grob)
>> 
>>    (let* ((note (ly:note-head::print grob))
>>           (combo-stencil (ly:stencil-add
>> 
>> note
>> 
>>               (circle-stencil note 0.1 0.8))))
>>          (ly:make-stencil (ly:stencil-expr combo-stencil)
>> 
>>            (ly:stencil-extent note X)
>>            (ly:stencil-extent note Y))))
>> 
>> { \circle c' }
>> 
>> So I wanted to substitute the circle-stencil with some dash-stencil…
>> only… where should I look for a complete list of stencils?
>> Is it even a proper question?
>> 
>> Thank you for all the help.
>> 
>> massimiliano
>> 
>> On 4 Dec 2017, at 18:33, Edward Neeman <address@hidden> wrote:
>> 
>> Hi Massimiliano, can you include some examples of your lilypond code?
>> 
>> The list of symbols in lilypond
>> http://lilypond.org/doc/v2.18/Documentation/notation/the-feta-font.en.html
>> 
>> Normally I would create a line as a graphic:
>> \markup { \draw-line #'(2 . 1)}
>> 
>> See this page
>> http://lilypond.org/doc/v2.18/Documentation/notation/graphic.en.html
>> 
>> Best
>> Edward
>> 
>> --------------
>> 
>> 
>> Dr. Edward Neeman
>> Adjunct Instructor, South Georgia State College
>> Collaborative Pianist, Valdosta State University, Georgia
>> Artist Faculty, ELMS Conservatory, Jakarta
>> address@hidden
>> www.neemanpianoduo.com
>> 
>> 
>> 
>> On Dec 4, 2017 10:42 AM, "Massimiliano Viel" <address@hidden> wrote:
>> Hi everybody,
>> I’m a newbie but already with a, at least for me, not elementary problem.
>> I want to realise a note head with the original note glyph plus a slash on
>> hte note.
>> I’ve seen a couple of way to do it: one by overriding the note head stencil
>> with a lambda function and another one by using a combine with a markup.
>> But, in both cases I need to modify the examples…
>> and here is the question:  in the first solution, which appears to me the
>> most suitable one, I should modify the stencil… but where do I find a list
>> of all the available stencils (such as the diagonal line)?
>> 
>> Thank you for all the help
>> 
>> Massimiliano
>> 
>> 
>> 
>> 
>> 
>> _______________________________________________
>> 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]