lilypond-user
[Top][All Lists]
Advanced

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

Re: Merging a markup-command with an event-function


From: David Nalesnik
Subject: Re: Merging a markup-command with an event-function
Date: Sat, 14 Mar 2015 13:03:49 -0500

Hi Pierre,

On Sat, Mar 14, 2015 at 12:42 PM, Pierre Perol-Schneider <address@hidden> wrote:
Hi,

In order to make a new guitar barré function, I'm trying to merge the attached markup-command with an event-function (without success - problem is on line #90):

%%%%%%%%%%%%%%%%%
\version "2.18.2"

Prefix = \markup {
  %% uncomment/comment these lines for C, C slashed, B or B slashed prefix :
  \roman C
  %\combine \roman C \translate #'(0.65 . -0.25) \override #'(thickness . 1.2) \draw-line #'(0 . 1.8)
  %\roman B
  %\combine \roman B \translate #'(0.65 . -0.25) \override #'(thickness . 1.2) \draw-line #'(0 . 1.8)
  %%%%%%%%%%%%
  \hspace #0.2
}

#(define-markup-command (prefix layout props string-qty) (integer?)
    (interpret-markup layout props
      (case string-qty
            ((2) #{
                    \markup {
                      \override #'(font-family . typewriter)
                      \concat {
                      \raise #.15
                      \fontsize #-6
                        {
                          \raise #.5 "1"
                          \hspace #-.2
                          \raise #.2 "/"
                          \hspace #-.2
                          "3"
                        }
                        \Prefix
                      }
                    }
                 #})
            ((3) #{
                    \markup {
                      \override #'(font-family . typewriter)
                      \concat {
                      \raise #.15
                      \fontsize #-6
                        {
                          \raise #.5 "1"
                          \hspace #-.2
                          \raise #.2 "/"
                          \hspace #-.2
                          "2"
                        }
                        \Prefix
                      }
                    }
                 #})
            ((4) #{
                    \markup {
                      \override #'(font-family . typewriter)
                      \concat {
                      \raise #.15
                      \fontsize #-6
                        {
                          \raise #.5 "2"
                          \hspace #-.2
                          \raise #.2 "/"
                          \hspace #-.2
                          "3"
                        }
                        \Prefix
                      }
                    }
                 #})
            ((5) #{
                    \markup {
                      \override #'(font-family . typewriter)
                      \concat {
                      \raise #.15
                      \fontsize #-6
                        {
                          \raise #.5 "5"
                          \hspace #-.2
                          \raise #.2 "/"
                          \hspace #-.2
                          "6"
                        }
                        \Prefix
                      }
                    }
                 #})
            (else
             #{ \markup\Prefix #}))))

startBarre =
#(define-event-function (parser location arg-string-qty fret-nbr) (integer? markup?)
   ;; here's the problem ??

Nope, the line below is fine.  However, why don't you subsume this in the let-block?
 
  (define string-qty arg-string-qty)
  ;; hereunder should be fine:
  (let* ((mrkp (markup #:upright #:concat (prefix fret-nbr))))

You've defined Prefix with a capital "P" above.
 
    (let* ((mrkp (markup #:upright #:concat (#:lower 0.08 prefix #:lower 0.05 fret-nbr #:hspace 0.3))))

Same problem here.  By the way, why the two assignments to mrkp?  This one will shadow the one above.

HTH,
David


reply via email to

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