Re: custom markup help
On 23 May 2015, at 13:11, Klaus Blum wrote: Hi Damian, aah, Nick was faster than me... :-) The easiest way I've found would be this: % --- \version 2.18.0 #(define-markup-command (sd layout props sdnum) (markup?) Put a number with a carat above the note. (interpret-markup layout props #{\markup { \override #'(baseline-skip . 0.5) \column { \small {^ #sdnum }} } #})) {g^\markup \sd 3} % --- If you dont want to use \markup every time, you also could work like this: % --- \version 2.18.0 sd = #(define-music-function (parser location sdnum) (markup?) Put a number with a carat above the note. #{ -\markup { \override #'(baseline-skip . 0.5) \column { \small {^ #sdnum }} } #}) {g^\sd 3} % --- Cheers, Klaus Thanks Klaus now to combine yours and Nick's version so that I can override the baseline-skip set by your music-function Damian ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: custom markup help
On 23 May 2015, at 12:51, Nick Payne wrote: On 23/05/2015 21:24, Damian leGassick wrote: \version 2.18.0 #(define-markup-command (sd layout props sdnum) (markup?) #:properties ((baseline-skip 0.5)) Put a number with a carat above the note. (interpret-markup layout props #{\markup \override #`(baseline-skip . ,baseline-skip) \column { \small {^ #sdnum }}#})) {g^\markup {\sd 3}} Don't use the name baseline-skip for the baseline-skip value. Change it to something else and it works: \version 2.18.0 #(define-markup-command (sd layout props sdnum) (markup?) #:properties ((skip 0.5)) Put a number with a carat above the note. (interpret-markup layout props #{\markup \override #`(baseline-skip . ,skip) \column { \small {^ #sdnum }}#})) {g^\markup {\sd 3}} skip.png___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user Thanks Nick it works, but I don't see why my version doesn't I though that I was setting a property with a default value rather than creating a variable my assumption is based on the example given at http://www.lilypond.org/doc/v2.18/Documentation/extending/new-markup-command-definition #(define-markup-command (double-box layout props text) (markup?) #:properties ((inter-box-padding 0.4) (box-padding 0.6)) Draw a double box around text. (interpret-markup layout props #{\markup \override #`(box-padding . ,inter-box-padding) \box \override #`(box-padding . ,box-padding) \box { #text } #})) \markup \double-box A \markup \override #'(inter-box-padding . 0.8) \double-box A \markup \override #'(box-padding . 1.0) \double-box A Damian___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: custom markup help
Hmmm... AFAIK there is no way to use properties like you can do with define-markup-command. Maybe someone with a deeper knowledge than me can chime in here? :) At least, I found a way to call the function without using the carat: % --- \version 2.18.0 sd = #(define-event-function (parser location sdnum) (markup?) Put a number with a carat above the note. #{ ^\markup { \override #'(baseline-skip . 0.5) \column { \small {^ #sdnum }} } #}) {g\sd 3} % --- Cheers, Klaus -- View this message in context: http://lilypond.1069038.n5.nabble.com/custom-markup-help-tp176923p176976.html Sent from the User mailing list archive at Nabble.com. ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: custom markup help
On 23/05/2015 21:24, Damian leGassick wrote: \version 2.18.0 #(define-markup-command (sd layout props sdnum) (markup?) #:properties ((baseline-skip 0.5)) Put a number with a carat above the note. (interpret-markup layout props #{\markup \override #`(baseline-skip . ,baseline-skip) \column { \small {^ #sdnum }}#})) {g^\markup {\sd 3}} Don't use the name baseline-skip for the baseline-skip value. Change it to something else and it works: \version 2.18.0 #(define-markup-command (sd layout props sdnum) (markup?) #:properties ((skip 0.5)) Put a number with a carat above the note. (interpret-markup layout props #{\markup \override #`(baseline-skip . ,skip) \column { \small {^ #sdnum }}#})) {g^\markup {\sd 3}} ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: custom markup help
Hi Damian, aah, Nick was faster than me... :-) The easiest way I've found would be this: % --- \version 2.18.0 #(define-markup-command (sd layout props sdnum) (markup?) Put a number with a carat above the note. (interpret-markup layout props #{\markup { \override #'(baseline-skip . 0.5) \column { \small {^ #sdnum }} } #})) {g^\markup \sd 3} % --- If you dont want to use \markup every time, you also could work like this: % --- \version 2.18.0 sd = #(define-music-function (parser location sdnum) (markup?) Put a number with a carat above the note. #{ -\markup { \override #'(baseline-skip . 0.5) \column { \small {^ #sdnum }} } #}) {g^\sd 3} % --- Cheers, Klaus -- View this message in context: http://lilypond.1069038.n5.nabble.com/custom-markup-help-tp176923p176926.html Sent from the User mailing list archive at Nabble.com. ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user