lilypond-user
[Top][All Lists]
Advanced

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

Re: creating a slur with markup


From: Thomas Morley
Subject: Re: creating a slur with markup
Date: Fri, 28 Jun 2013 03:06:42 +0200

2013/6/27 Rachael Thomas <address@hidden>:

> I think I found the correct syntax.  Thank you for your help!
>
> \new TabVoice {
>   \tabFullNotation
>   \stemDown
>
>   <c' e d a,>8\2\4\5\6\repeatTie-\withMusicProperty #'spanner-id #"g" \tweak
> #'extra-offset #'(0 . -2.5) (( <b d>-\withMusicProperty #'spanner-id #"g" ))
>   <fis' a>\1\3\repeatTie-\withMusicProperty #'spanner-id #"g" \tweak
> #'extra-offset #'(0 . -2.4) (( <e' g>\1\3-\withMusicProperty #'spanner-id
> #"g" ))
>   }
>
> Rachael

Hi Rachael,

I had completely forgotten the possibility to write _)^) and I never
used \withMusicProperty myself.
Though, this is ofcourse much better than my initial idea, apart from
the high typing-effort.
So I tried to find some way to put it in an event-function.

Below you'll find a first (working) sketch. There's still some work to
do. For example I'd like to avoid these repeated (0 . 0), if no offset
is needed and to solve some other problems.

Perhaps tomorrow.

Usage:
\multipleSlurs has an integer as first argument, representing the
count of slurs. Setting the 'spanner-id is automated,
The second is a list of pairs for extra-offsetting them.
The third is the music, i.e the opening or closing slur-sign "(" or ")"

One draw-back: you need a newer devel-version.

\version "2.17.20"

multipleSlurs =
#(define-event-function (parser location how-much offsets slurs)
  (integer? list? ly:music?)

  ;(if (null? offsets)
  ;    (set! offsets (make-list how-much '(0 . 0))))

  (set! (ly:music-property slurs 'elements)
    (map
      (lambda (x y)
         #{
           -\tweak #'extra-offset #y
           % For testing:
           %-\tweak #'extra-offset #(cons 0 (* -1 x))
           -\withMusicProperty
               #'spanner-id #(number->string x)
               #(ly:music-deep-copy slurs)
         #})
      (iota how-much) offsets))

  (set! (ly:music-property slurs 'types) '(post-event post-event-wrapper))

  slurs)

%\displayMusic
\new Voice
{
  c'' \multipleSlurs #3 #'((0 . 0)(0 . 1)(0 . 2)) ^(
  c'' \multipleSlurs #3 #'((0 . 0)(0 . 0)(0 . 0))    )
}


\new TabVoice {
  \tabFullNotation
  \stemDown

  <c' e d a,>8\2\4\5\6\repeatTie
     \multipleSlurs #2 #'((0 . -2.4)(0 . 0))
     (
     <b d>
     \multipleSlurs #2 #'((0 . 0)(0 . 0))
     )
  <fis' a>\1\3\repeatTie
     \multipleSlurs #2 #'((0 . -2.4)(0 . 0))
     (
  <e' g>\1\3
     \multipleSlurs #2 #'((0 . 0)(0 . 0))
     )
  }

Cheers,
  Harm



reply via email to

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