lilypond-user
[Top][All Lists]
Advanced

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

Re: BendSpanner-engraver


From: Thomas Morley
Subject: Re: BendSpanner-engraver
Date: Tue, 4 Oct 2016 10:37:19 +0200

2016-10-04 6:21 GMT+02:00 Federico Bruni <address@hidden>:
> Il giorno dom 2 ott 2016 alle 19:30, Thomas Morley
> <address@hidden> ha scritto:
>>
>> Hi Marc et all,
>>
>> 2016-09-18 16:55 GMT+02:00 Marc Hohl <address@hidden>:
>>>>
>>>>  I'd prefer to solve that slow down first, otoh it's little effort to
>>>>  do a new tarball.
>>>
>>>
>>>
>>>  If the estimated work on the slowdown is not that huge, I think it is ok
>>>  to get a grip on that first and release a new version afterwards.
>>
>>
>> it turned out it was _much_ harder then expected.
>>
>> I ended up writing a second engraver which sets the new defined
>> grob-property "TabNoteHead.bend-me", which decides whether a string is
>> bendable.
>>
>> To get there, I used the context-property `noteToFretFunction'. Using
>> it in the engraver leads to the need to give it the appropiate
>> arguments.
>> Disadvantage: Actually `noteToFretFunction' is now used twice, in my
>> BendMeEngraver _and_ in the default Tab_note_heads_engraver.
>> If someone knows a better method please shout!
>>
>> Nevertheless, it's now 4 times faster than before.
>
>
> Thanks Harm, indeed it's faster. These are the times I got in 5 (small)
> pieces:
>
> 1st version --> 2nd version
> 2,2" --> 1,8"
> 2,3" --> 2,1"
> 3,3" --> 2,3"
> 2,0" --> 1,7"
> 1,7" --> 1,5"

On my not so powerful laptop compiling whole bend-test.ly decresed
from >60' down to 16'

> I noticed that I get this warning:
>
> warning: no notes to start a bend from found. If you want to bend
> an open string, consider override/tweak like: TabNoteHead.bend-me = ##t

Hm, this text needs fixing, per current default open strings can't
serve as start _or_ end of a bend.

> if I don't specify the string of a default open string like b on second
> string:
> ais\startBend b\stopBend
>
> So I must use b\3\stopBend even if it's the note where the bending _ends_?
> The bend can take place only between notes (explicitely) on the same string,
> right?


Not exactly.
Per current default open strings are excluded,yes, but you have
several possibilities to do it different:

%% current default
%% open strings are not bendable, neither starting nor ending a bend
%% it's possible to set single notes bendable
\new TabVoice
  {
        ais\startBend \tweak bend-me ##t b\stopBend
        <d ais>\startBend <d \tweak bend-me ##t b>\stopBend
  }

%% most brute-force: remove BendMeEngraver
%% excluding notes from bend doesn't work any more
\new TabVoice
  \with { \remove \BendMeEngraver }
  { ais\startBend b\stopBend }

%% current default
%% but set all notes bendable in \with
\new TabVoice
  \with { \override TabNoteHead.bend-me = ##t }
  {
        ais\startBend b\stopBend
        <d ais>\startBend <d b>\stopBend
  }

%% set all notes bendable in \with
%% exclude single notes
%% make this the default?
\new TabVoice
  \with { \override TabNoteHead.bend-me = ##t }
  {
        ais\startBend  b\stopBend
        <\tweak bend-me ##f d ais>\startBend
        <\tweak bend-me ##f d b>\stopBend
  }


I noticed a bug/oversight, though.

In bend-grob-defs.ly

#(for-each
  (lambda (x)
    (apply define-grob-property x))
    `((bend-me
      ,list?
      "DOCME")))

Needs to be changed to:

#(for-each
  (lambda (x)
    (apply define-grob-property x))
    `((bend-me
      ,boolean?  ;; <-----------
      "DOCME")))


HTH,
  Harm



reply via email to

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