lilypond-user
[Top][All Lists]
Advanced

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

Re: Get string number from TabStaff note


From: address@hidden
Subject: Re: Get string number from TabStaff note
Date: Fri, 23 Jan 2015 23:57:16 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

On 2015-01-23 23:53, Thomas Morley wrote:
2015-01-23 23:03 GMT+01:00 Thomas Morley <address@hidden>:
2015-01-21 15:54 GMT+01:00 address@hidden <address@hidden>:
Is it possible to know which string a note is placed on in a TabStaff.


Or maybe something at the lines of

\version "2.18.0"

boo =
#(define-music-function (parser location mus)(ly:music?)
(music-map
   (lambda (m)
    (let ((strgnr '()))
     (if (music-is-of-type? m 'note-event)
         (begin
           (for-each
             (lambda (e)
              (if (music-is-of-type? e 'string-number-event)
                  (begin
                    ;(display (ly:music-property e 'string-number))
                    (set! strgnr (ly:music-property e 'string-number))
                    e)
                  e))
           (ly:music-property m 'articulations))
           (begin
             ;(display strgnr)
             (if (= strgnr 6)
                 #{ \transpose c cis, $m #}
                 m)
                  ))
         m)))
    mus))

m =
\relative c, {
   e f g
   \boo
   a\6 b c
   d e f
   g\4 a
   b c d
   e f g
}

<<
  \new Staff { \clef "G_8" \m }
  \new TabStaff \m


Cheers,
   Harm

Hello Harm,

This second version is exactly what I needed!!!!

Now I will try to understand how it works also...

Thank you VERY much!

// Anders



--
English isn't my first language.
So any error or strangeness is due to the translation.
Please correct my English so that I may become better.



reply via email to

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