lilypond-user
[Top][All Lists]
Advanced

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

Re: Beamed Tremolo + Fermata


From: Thomas Morley
Subject: Re: Beamed Tremolo + Fermata
Date: Tue, 29 Dec 2015 14:49:32 +0100

2015-12-29 0:11 GMT+01:00 Thomas Morley <address@hidden>:
> 2015-12-28 23:47 GMT+01:00 David Kastrup <address@hidden>:
>
>>>   \once \override TupletNumber.text =
>>>   #(lambda (grob)
>>>     (let ((dir (ly:grob-property grob 'direction)))
>>                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ That one calls
>>                  Tuplet_bracket::get_default_dir which references a
>>                  whole lot of other callbacks and properties and then
>>                  caches the resulting value.  I'm not sure this will
>>                  always be correct.
>
> Hmmm.
> Up to now I found no problematic case,

I wrote a test-function:

%%%%%%%%%%%%%%%%%%%%%%%%%

\version "2.19.32"

%% some helpers for nicer output, tighter coding, displaying values
\layout { indent = 30 }

formatInstrumentName =
#(define-scheme-function (p1 p2)(ly:pitch? ly:pitch?)
#{
  \markup
    \tiny
    \override #'(baseline-skip . 2)
    \center-column {
      #(format #f "~a" p1)
      "and"
      #(format #f "~a " p2)
    }
#})

displayBeamDirection =
\override Beam.after-line-breaking =
  #(lambda (grob)
    (write-me "\n\tbeam-dir " (ly:grob-property grob 'direction)))

%% the test-function
testTupletsBeams =
#(define-music-function (pitch ev-chrd) (ly:pitch? ly:music?)
"Prints tuplets, beams and slurs for testing their direction.
Test the combination of each element of @var{ev-chord} and @var{pitch}
"
#{
  <<
   $@(map
      (lambda (p)
        #{
          \new Staff \with { instrumentName = \formatInstrumentName $p $pitch }
          {
            \override TupletBracket.bracket-visibility = ##t
            \times 1/1 { $p 2( $pitch ) }
            %\once
            %\displayBeamDirection
            \times 1/1 \repeat tremolo 16 { $p 32( $pitch ) }
            $p 8[( $pitch ])
            \times 1/1 { $p 8[( $pitch ]) }
            $p 4( $pitch )
          }
        #})
      (event-chord-pitches ev-chord))
  >>
#})

ev-chord =
<
%%%% Observations for pitch = a' in `testTupletsBeams'
%%
%% TupletBracket and Beam are above
       %c' d' e' f' g' a'
%% using b' returns:
%% programming error: Grob direction requested while calculation in progress.
%% warning: weird stem size, check for narrow beams
%% will print both TupletBrackets above, first Beam-direction is zero (sic!),
%% second Beam is printed above
       b'
%% using c'' will print first TupletBracket above, but Beam and
%% second TupletBracket below
       c''
%% TupletBracket and Beam are below
       %d'' e'' f'' g'' a''
>

\testTupletsBeams a' \ev-chord


%%%%%%%%%%%%%%%%%%%%%%%%%

I commented all but the somehow problematic cases.

(1)
Pitches c'' and a'
I thought a while about it, but I think LilyPond does correct here.
Although that means the fermataOverTremolo-function has to be revised

(2)
Piches b' and a'
Beam-direction in tremolo is zero (!), causing a programming-error and a warning
Single code-line to trigger it:
\repeat tremolo 16 { b' 32 a' }

I'm not aware that a zero-Beam-direction is ever useful. Even kneed
Beams don't have zero-direction

{
  %\displayBeamDirection
  %% returns 1 for both
  f8 f''8 f8 f''8
  f''8 f8 f''8 f8
}

I'd call it a bug, \repeat tremolo 16 { b' 32 a' } should have
Beam.direction UP, imho.


Cheers,
  Harm

Attachment: tremolo-beam-test-01.png
Description: PNG image


reply via email to

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