[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Get string number from TabStaff note
From: |
Thomas Morley |
Subject: |
Re: Get string number from TabStaff note |
Date: |
Sat, 24 Jan 2015 00:14:11 +0100 |
2015-01-23 23:57 GMT+01:00 address@hidden <address@hidden>:
> 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
>
Please note, it's only a sketch giving some hints, _not_ a proper coding!
I've currently not the time to do it thoroughly ...
Cheers,
Harm