lilypond-user
[Top][All Lists]
Advanced

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

Re: Whole-note tremolo beams


From: Thomas Morley
Subject: Re: Whole-note tremolo beams
Date: Thu, 19 Mar 2020 12:08:34 +0100

Am Do., 19. März 2020 um 11:12 Uhr schrieb Leo Correia de Verdier
<address@hidden>:
>
> For the sake of clarity, a MWE:
>
> %%%%%%%%%%%
>
> \version "2.20.0"
> \repeat tremolo 16 {dis'32 dis’’}
>
> %%%%%%%%%%%
>
> > 19 mars 2020 kl. 11:01 skrev Leo Correia de Verdier <address@hidden>:
> >
> > Dear list!
> >
> > I’m working on a piece with a lot of whole note tremolos and was wondering 
> > if any of you have a nice workaround for the beams (issues 318 and 704). I 
> > would like them slanted (with the same slope as a regular beam), centered 
> > between the noteheads and avoiding accidentals on the second note column, 
> > but if you have code producing any of these results it would be welcome. 
> > Harm’s code from this tread does unfortunately not seem to work any longer 
> > http://lilypond.1069038.n5.nabble.com/Tremolos-between-two-whole-notes-tt57577.html#a57580
> >  . I’ll start hacking something together, but if any of you already have 
> > invented this wheel it would be nice not to reinvent it.
> >
> > Thanks a lot!
> > /Leo
>
>

Hi,

here an updated version of my ancient code, along with a function to
supress warnings.

\version "2.20.0"

\paper { line-width = 120 }

tweakWholeNoteTremolo =
#(define-music-function (parser location gap y-off-pair)((number? 0.8) pair?)
#{
  \once \override Beam.gap = $gap
  \once \override Beam.positions =
    #(lambda (grob)
      (let* ((pos (beam::place-broken-parts-individually grob)))
        (cons
          (+ (car pos) (car y-off-pair))
          (+ (cdr pos) (car y-off-pair) (cdr y-off-pair)))))
#})

%--- test

suppressWarning =
#(define-void-function (amount message)(number? string?)
  (for-each
    (lambda (warning) (ly:expect-warning message))
    (iota amount 1 1)))

\suppressWarning 3 "weird stem size"

\score {
  \relative c'' {
  \tweakWholeNoteTremolo #'(-2.4 . 1.2)
  \repeat tremolo 16  { gis32 dis' }
  %\break

  \tweakWholeNoteTremolo #'(-3.6 . 1.7)
  \repeat tremolo 32  { <e, gis b>64 d' }

  \tweakWholeNoteTremolo #1.3 #'(4.4 . -3.0)
  \repeat tremolo 16  { a'32 a, }

  }
}


\new PianoStaff <<
  \new Staff = "right" {
    \repeat tremolo 16  {

    \tweakWholeNoteTremolo #'(11.2 . -19)
     e'''32
    \change Staff = "left"
     a,,
    }
  }
  \new Staff = "left" {
    \clef bass
    s1
  }
>>

It will not avoid possible accidentals at right NoteColumn, though.
Not saying it would be impossible, rather I've not the time to dive
into it deeper...

Cheers,
  Harm



reply via email to

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