Re: Cello fingering indications

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Cello fingering indications

pkx166h
On 04/09/14 01:46, MarcM wrote:

> Anyone knows why the following snippet does not print the spanner with
> version 2.19.10 ?
>
> fingering_restez.ly
> <http://lilypond.1069038.n5.nabble.com/file/n166031/fingering_restez.ly>
>
>
>
> Colin Campbell-8 wrote
>> On 11-10-31 08:33 PM, David Nalesnik wrote:
>>> Hi Colin,
>>>
>>> On Sun, Oct 30, 2011 at 9:50 PM, Colin Campbell &lt;
>> cpkc@
>>  
>> &gt; &lt;mailto:
>> cpkc@
>> &gt;> wrote:
>>>      Further Googling gives http://lsr.dsi.unimi.it/LSR/Snippet?id=616
>>>      which is closer in appearance, but I haven't the Scheme fu to
>>>      modify the stringNumberSpanner function to incorporate the
>>>      startTextSpan and number of notes. Ideally, one would wind up with
>>>      something like a8\fSpan {"5" 4} which would extend a line for 4 of
>>>      the note value of the starting note.
>>>
>>>
>>> This seems to do the trick:
>>>
>>>   \version "2.14.2"
>>>
>>> stringNumberSpanner =
>>> #(define-music-function (parser location StringNumber music)
>>>     (string? ly:music?)
>>>    #{
>>>       \override Voice.TextSpanner #'style = #'solid
>>>       \override Voice.TextSpanner #'font-size = #-5
>>>       \override TextSpanner #'(bound-details left stencil-align-dir-y)
>>> = #CENTER
>>>       \override TextSpanner #'(bound-details left text) = \markup {
>>> \circle \number $StringNumber }
>>>       #(begin
>>>          (let* ((elts (ly:music-property $music 'elements)))
>>>            (set! (ly:music-property (car elts) 'elements)
>>>              (cons (make-music 'TextSpanEvent 'span-direction -1)
>>>                    (ly:music-property (car elts) 'elements)))
>>>            (set! (ly:music-property (car (reverse elts)) 'elements)
>>>              (cons (make-music 'TextSpanEvent 'span-direction 1)
>>>                    (ly:music-property (car (reverse elts)) 'elements)))
>>>            (ly:export (make-music 'SequentialMusic 'elements (list
>>> $music)))))
>>>    #})
>>> \relative c {
>>>   \clef "treble_8"
>>>   \textSpannerDown
>>>   \stringNumberSpanner "5" { a8 b c d e f }
>>>   \stringNumberSpanner "4" { g a bes4 a g2 }
>>> }
>>>
>>> Happy practicing!
>>>
>>> -David
>>
>> Brilliant, David, simply brilliant!  No wonder I rave about this group
>> every chance I get.
>>
>> Thanks!
>>
>> Colin
>>
>> --
>> I've learned that you shouldn't go through life with a catcher's mitt on
>> both hands.
>> You need to be able to throw something back.
>> -Maya Angelou, poet (1928- )
>>
>>
>> _______________________________________________
>> lilypond-user mailing list
>> lilypond-user@
>> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
>
Could it be this checkin?

http://git.savannah.gnu.org/gitweb/?p=lilypond.git;a=commit;h=6d611627eaef3fb5c754bdde106cd16c1ed23f31

James

_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Cello fingering indications

David Kastrup
James <[hidden email]> writes:

> On 04/09/14 01:46, MarcM wrote:
>> Anyone knows why the following snippet does not print the spanner with
>> version 2.19.10 ?

>> <http://lilypond.1069038.n5.nabble.com/file/n166031/fingering_restez.ly>

(labelled as 2.19.7 but unlikely to work there).

>> Colin Campbell-8 wrote
>>> On 11-10-31 08:33 PM, David Nalesnik wrote:
>>>> Hi Colin,
>>>>
>>>> On Sun, Oct 30, 2011 at 9:50 PM, Colin Campbell &lt;
>>> cpkc@
>>>   &gt; &lt;mailto:
>>> cpkc@
>>> &gt;> wrote:
>>>>      Further Googling gives http://lsr.dsi.unimi.it/LSR/Snippet?id=616
>>>>      which is closer in appearance, but I haven't the Scheme fu to
>>>>      modify the stringNumberSpanner function to incorporate the
>>>>      startTextSpan and number of notes. Ideally, one would wind up with
>>>>      something like a8\fSpan {"5" 4} which would extend a line for 4 of
>>>>      the note value of the starting note.
>>>>
>>>>
>>>> This seems to do the trick:
>>>>
>>>>   \version "2.14.2"

(!)

>>>> stringNumberSpanner =
>>>> #(define-music-function (parser location StringNumber music)
>>>>     (string? ly:music?)
>>>>    #{
>>>>       \override Voice.TextSpanner #'style = #'solid
>>>>       \override Voice.TextSpanner #'font-size = #-5
>>>>       \override TextSpanner #'(bound-details left stencil-align-dir-y)
>>>> = #CENTER
>>>>       \override TextSpanner #'(bound-details left text) = \markup {
>>>> \circle \number $StringNumber }
>>>>       #(begin
>>>>          (let* ((elts (ly:music-property $music 'elements)))
>>>>            (set! (ly:music-property (car elts) 'elements)
>>>>              (cons (make-music 'TextSpanEvent 'span-direction -1)
>>>>                    (ly:music-property (car elts) 'elements)))

[...]

> Could it be this checkin?
>
> http://git.savannah.gnu.org/gitweb/?p=lilypond.git;a=commit;h=6d611627eaef3fb5c754bdde106cd16c1ed23f31

That definitely touches code exercised by this snippet.  But the
question was about version 2.19.10 and the commit is present only
starting with version 2.19.13.

The problem quite looks like the old friend issue 2240, version 2.15.28.
The LSR should provide an updated snippet by now I should think.  If
not, ask back.  A lame workaround would be to make sure that the first
element of the music following stringNumberSpanner is a chord, like

\stringNumberSpanner #3 { <c>8 ... }

The lame workaround can be automated by starting the function body
(right *before* #{ ... #}) with
(set! music (event-chord-wrap! music parser))

This results in music consisting of "chords only".  Unless you do
further processing with the music (like \displayLilyMusic ...) this
usually is no problem.

--
David Kastrup

_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Cello fingering indications

MarcM

This function apparently worked in version 2.14.
I tried in 2.18 and the line is not printed so the change is not due to a recent commit.

I just want to implement a simple function for the music directive "restez" (*) which is usually indicated with the text "restez" and a line that spans a list of notes.

(*) restez [French]
A directive to the performer of a stringed instrument to perform the indicated passage of a composition remaining on he same note, on the same string or in the same finger position.
http://dictionary.onmusic.org/terms/2880-restez
Reply | Threaded
Open this post in threaded view
|

Re: Cello fingering indications

Robbie24
In reply to this post by pkx166h
You know last week, I had noticed the way in which cellist move their fingers to play cell or violins. That was amazing playing style of them, by God..Only a best cello player can play it as in this form.
Reply | Threaded
Open this post in threaded view
|

Re: Cello fingering indications

David Kastrup
In reply to this post by MarcM
MarcM <[hidden email]> writes:

> This function apparently worked in version 2.14.
> I tried in 2.18 and the line is not printed so the change is not due to a
> recent commit.
>
> I just want to implement a simple function for the music directive "restez"
> (*) which is usually indicated with the text "restez" and a line that spans
> a list of notes.
>
> (*) restez [French]
> A directive to the performer of a stringed instrument to perform the
> indicated passage of a composition remaining on he same note, on the same
> string or in the same finger position.
> http://dictionary.onmusic.org/terms/2880-restez
The old code presents a few other challenges to convert-ly (it converts
anything containing ly:export to a version using $(...) instead of
#(...) and that goes wrong in this case), but it's essentially issue
2240 and would (after changing $ back to #), as stated previously, yield
to using event-chord-wrap!  at the start of the music function.

At any rate, here is a "nice" version without such workarounds.
add-event seems to be a frequent enough use case to figure out a nice
global name for it and provide it in LilyPond proper.


 \version "2.18.0"

stringNumberSpanner =
#(define-music-function (parser location StringNumber music)
   (markup? ly:music?)
   (define (add-event mus event)
     (let ((prop (if (music-is-of-type? mus 'rhythmic-event)
                     'articulations 'elements)))
       (set! (ly:music-property mus prop)
             (append (ly:music-property mus prop) (list event)))))
   (let ((elts (extract-typed-music music '(rhythmic-event event-chord))))
     (if (pair? elts)
         (begin
           (add-event (first elts)
                      #{
                        \tweak style #'solid
                        \tweak font-size #-5
                        \tweak bound-details.left.stencil-align-dir-y #CENTER
                        \tweak bound-details.left.text
                           \markup { \circle \number $StringNumber }
                        \startTextSpan
                      #})
           (add-event (last elts) #{ \stopTextSpan #}))))
   music)

\relative c {
 \clef "treble_8"
 \textSpannerDown
 \stringNumberSpanner "5" { a8 b c d e f }
 \stringNumberSpanner "4" { g a bes4 a g2 }
}


--
David Kastrup

_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Cello fingering indications

David Nalesnik
On Thu, Nov 27, 2014 at 3:24 AM, David Kastrup <[hidden email]> wrote:

>
> add-event seems to be a frequent enough use case to figure out a nice
> global name for it and provide it in LilyPond proper.
>

I agree.

--David
_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel