lilypond-user
[Top][All Lists]
Advanced

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

Re: String pressure notation


From: Archer Endrich
Subject: Re: String pressure notation
Date: Tue, 16 Apr 2024 11:41:07 +0100
User-agent: Mozilla Thunderbird

Hello Richard,

Your bow-pressure graphic looks great, and I hope your question about horizontal proportions can be answered soon.

Another feature of your illustration is relevant to my wish list:  the downward-pointing brackets with 9" in the middle.  I've been trying to find a way to do this for some time.  Could you forward the code for this feature?  Perhaps it is just something basic that I've missed.

Thanks,

Archer


On 15/04/2024 04:45, Richard Davis wrote:
Hello all,

I am new (as of today) to this mailing list, and new (as of a few months
ago) to this software, so please forgive me if I ask obvious or
poorly-worded questions.

I am looking for a way to achieve the standard graphic notation for bow
pressure on string instruments, as shown in the attached image. I asked
on reddit and was able to get a suggestion as follows:

\version "2.25.13"

#(define ((bow-pressure-stencil shape) grob)
   (let* ((lbi (ly:grob-property grob 'left-bound-info '()))
          (rbi (ly:grob-property grob 'right-bound-info '()))
          (lbx (ly:assoc-get 'X lbi 0))
          (rbx (ly:assoc-get 'X rbi 0))
          (ss (ly:staff-symbol-staff-space grob)))
     (set! shape (append '((1 . 0) (0 . 0)) shape))
     (set! shape
       (map
         (lambda (pt) (let ((x (car pt)) (y (cdr pt)))
           (cons (* x (- rbx lbx)) (* -2/3 ss y))))
         shape))
     (grob-interpret-markup grob
       #{ \markup \polygon #shape #})))

startBowSpan =
#(define-event-function (shape) (number-pair-list?) #{
   -\tweak stencil #(bow-pressure-stencil shape)
    \startTextSpan #})
stopBowSpan = \stopTextSpan

{ b'4-\tweak to-barline ##t
       \startBowSpan #'((0 . 0.5) (0.25 . 1))
   4 2 <>\stopBowSpan \fine }

 From what I've been able to understand, this solution stretches the
shape specified by the call to \startBowSpan across the distance
specified by the ending position of \stopBowSpan. This is quite a useful
solution, but it has a few limitations, most glaringly that I have to
guess as to horizontal proportions and that those may not be the same in
parts as in the score.

Ideally I'd want to be able to anchor specific levels along this spanner
to rhythmic events, perhaps by specifying "levels" of pressure like so:

{
   c4\startBowSpan 0.0 c4\pressure 1.0 c4\pressure 0.5 c4\stopBowSpan 0.0
}

In my head, whatever implementation this requires would somehow
"collect" these levels and generate the final shape as
necessary. However, I don't know nearly enough scheme to even know where
to begin on this. The reddit contributor to the original did suggest
using DynamicLineSpanners may be more productive, but I also don't quite
understand how to go about that.

I apologize for the lengthy question; I hope it makes sense. Any help
would be greatly appreciated!

Sincerely,
Richard




reply via email to

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