Re: Upline articulation
2018-04-02 3:17 GMT+02:00 Andrew Bernard : > Hi Malte and Thomas, > > This is all really great and appreciated. > > But where are these functions located, or, dare I ask, documented? > > Andrew Hi Andrew, The Extending Manual 2.5 "Markup functions" is not that bad in explaining what happens. The `what-ever-name-markup' procedures themselves are not documented or listed otherwise. You may read most of them (but not all) compiling: #(pretty-print (sort (map car (filter (lambda (x) (markup-command-signature (cdr x))) (ly:module->alist (resolve-module '(lily) symbolhttps://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Upline articulation
Hi Malte and Thomas, This is all really great and appreciated. But where are these functions located, or, dare I ask, documented? Andrew On 2 April 2018 at 04:54, Thomas Morley wrote: > 2018-04-01 18:11 GMT+02:00 Malte Meyn : > > > > > > Am 01.04.2018 um 17:00 schrieb Andrew Bernard: > >> > >> I cannot recall where I obtained this code from. But I want to have the > >> line thicker. I don't know how to modify this. Grepping the lilypond > >> installation I am unable to find the function make-draw-line-markup. > Where > >> does that come from? Can I use another function that takes a thickness > as an > >> additional parameter? > > > > > > The function make-draw-line-markup is the markup command draw-line > > If I understand correctly, that's not entirely correct. > > In general, a markup-command is done by the macro `define-markup-command'. > We get two procedures from it, in this case: `draw-line-markup' and > `make-draw-line-markup'. > > See: > #(format #t "\ndraw-line-markup:\n~y" > draw-line-markup) > #(format #t "\nmake-draw-line-markup:\n~y" > make-draw-line-markup) > > As you can see from the displayed results `draw-line-markup' needs > three arguments. Two of them are the default `layout' and `props' > `make-draw-line-markup' only one. The default ones are already done. > > That's the reason why we can do > $(make-draw-line-markup '(0 . 1)) without anything else. > > Using `draw-line-markup' would need to have those defaults arguments > supplied. > In ly-syntax this automatically happens while doing > \markup \draw-line ... > But it's possible to use 'draw-line-markup' directly: > { > \override Beam.stencil = > #(draw-line-markup > $defaultpaper > (list (ly:output-def-lookup $defaultpaper 'text-font-defaults)) > '(1 . 1)) > > c'8[] > } > A little strange and inconvenient, but possible... > > So I think it's important to know that while using > `make-draw-line-markup' we use a procedure. > Whereas $(markup #:draw-line '(0 . 1)) will be transformed. > Makes a difference for some involved scheme-coding... > > That said, for the most use-cases below is fine and doable: > > > that can > > be used as > > #(make-draw-line-markup '(0 . 1)) > > or > > \markup \draw-line #'(0 . 1) > > or > > #(markup #:draw-line '(0 . 1) > > Same for all other markup commands. > > > > So you can just replace the line > > (make-draw-line-markup '(0 . 1))) > > in your original code by > > (make-override-markup '(thickness . 3) > > (make-draw-line-markup '(0 . 1) > > or by > > (markup #:override '(thickness . 3) > > #:draw-line '(0 . 1 > > or by > > #{ \markup \override #'(thickness . 3) > > \draw-line #'(0 . 1) #})) > > Cheers, > Harm > > P.S. I hope I made myself clear, not that easy for me to explain > complex stuff as a non-native speaker. > > ___ > lilypond-user mailing list > lilypond-user@gnu.org > https://lists.gnu.org/mailman/listinfo/lilypond-user > ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Upline articulation
2018-04-01 18:11 GMT+02:00 Malte Meyn : > > > Am 01.04.2018 um 17:00 schrieb Andrew Bernard: >> >> I cannot recall where I obtained this code from. But I want to have the >> line thicker. I don't know how to modify this. Grepping the lilypond >> installation I am unable to find the function make-draw-line-markup. Where >> does that come from? Can I use another function that takes a thickness as an >> additional parameter? > > > The function make-draw-line-markup is the markup command draw-line If I understand correctly, that's not entirely correct. In general, a markup-command is done by the macro `define-markup-command'. We get two procedures from it, in this case: `draw-line-markup' and `make-draw-line-markup'. See: #(format #t "\ndraw-line-markup:\n~y" draw-line-markup) #(format #t "\nmake-draw-line-markup:\n~y" make-draw-line-markup) As you can see from the displayed results `draw-line-markup' needs three arguments. Two of them are the default `layout' and `props' `make-draw-line-markup' only one. The default ones are already done. That's the reason why we can do $(make-draw-line-markup '(0 . 1)) without anything else. Using `draw-line-markup' would need to have those defaults arguments supplied. In ly-syntax this automatically happens while doing \markup \draw-line ... But it's possible to use 'draw-line-markup' directly: { \override Beam.stencil = #(draw-line-markup $defaultpaper (list (ly:output-def-lookup $defaultpaper 'text-font-defaults)) '(1 . 1)) c'8[] } A little strange and inconvenient, but possible... So I think it's important to know that while using `make-draw-line-markup' we use a procedure. Whereas $(markup #:draw-line '(0 . 1)) will be transformed. Makes a difference for some involved scheme-coding... That said, for the most use-cases below is fine and doable: > that can > be used as > #(make-draw-line-markup '(0 . 1)) > or > \markup \draw-line #'(0 . 1) > or > #(markup #:draw-line '(0 . 1) > Same for all other markup commands. > > So you can just replace the line > (make-draw-line-markup '(0 . 1))) > in your original code by > (make-override-markup '(thickness . 3) > (make-draw-line-markup '(0 . 1) > or by > (markup #:override '(thickness . 3) > #:draw-line '(0 . 1 > or by > #{ \markup \override #'(thickness . 3) > \draw-line #'(0 . 1) #})) Cheers, Harm P.S. I hope I made myself clear, not that easy for me to explain complex stuff as a non-native speaker. ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Upline articulation
Am 01.04.2018 um 17:00 schrieb Andrew Bernard: I cannot recall where I obtained this code from. But I want to have the line thicker. I don't know how to modify this. Grepping the lilypond installation I am unable to find the function make-draw-line-markup. Where does that come from? Can I use another function that takes a thickness as an additional parameter? The function make-draw-line-markup is the markup command draw-line that can be used as #(make-draw-line-markup '(0 . 1)) or \markup \draw-line #'(0 . 1) or #(markup #:draw-line '(0 . 1) Same for all other markup commands. So you can just replace the line (make-draw-line-markup '(0 . 1))) in your original code by (make-override-markup '(thickness . 3) (make-draw-line-markup '(0 . 1) or by (markup #:override '(thickness . 3) #:draw-line '(0 . 1 or by #{ \markup \override #'(thickness . 3) \draw-line #'(0 . 1) #})) ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Upline articulation
I need a custom articulation common in 18 c scores which is a short vertical line above the note. I have the following code which works just fine: upline = #(let ((m (make-articulation "stopped"))) (set! (ly:music-property m 'tweaks) (acons 'font-size 3 (acons 'stencil (lambda (grob) (grob-interpret-markup grob (make-draw-line-markup '(0 . 1 (ly:music-property m 'tweaks m) I cannot recall where I obtained this code from. But I want to have the line thicker. I don't know how to modify this. Grepping the lilypond installation I am unable to find the function make-draw-line-markup. Where does that come from? Can I use another function that takes a thickness as an additional parameter? Andrew ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user