lilypond-user
[Top][All Lists]
Advanced

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

Re: Note duration line (contemporary)


From: Jeffrey Trevino
Subject: Re: Note duration line (contemporary)
Date: Wed, 28 Nov 2012 16:02:12 -0800

Thanks, Harm! That does just what we were trying to get at, I think.

It's a long-term goal of mine to learn enough about the Scheme side of Lilypond to be able to design stencils, and custom notational constructs more broadly, like you've just done. It seems like graphic flexibility with \markup is documented really well, but I've yet to get the basics of how I can use Scheme to control Lilypond at a low-level graphically as you've just done. Do you -- or anyone else reading -- have a suggestion about which source code or documentation I should take a look at to start learning how? It seems like these are the basic things I need to learn how to do:

0. learn the most basic line and shape drawing functions included in Lilypond.
1. learn to access the position data of a staff's conventionally notated elements (skip, rest, chord, or note, most importantly).
2. learn to describe the position of new lines, shapes, and glyphs, with data from #1 acting as a sort of backbone for the new notations created relative to them, in order to use the system's spacing algorithms effectively.
3. learn to parameterize these constructs with hard-coded or user-specified arguments that determine the extent, proportions, and appearance of #2, especially to correlate the x-extent of a construct with a conventionally specified duration (as a series of skips, for example).

This would be a way of creating custom notations as a sort of decoration of simple elements on a staff, but maybe there's another paradigm that someone with more experience might recommend as an alternative to this model.

thanks for all your help,
Jeff

On Wed, Nov 28, 2012 at 2:41 PM, Thomas Morley <address@hidden> wrote:
2012/11/28 Jeffrey Trevino <address@hidden>:
> Hi all,
>
> It's good to know how to do this. For metric notation, I found that it's
> also useful to stop the duration line before the barline, instead of
> continuing it to a subsequent notehead, if the following note is in the next
> bar:
>
>
> #(define flat-gliss
>   (lambda (grob)
>     (let ((left-Y (assoc-get 'Y (ly:grob-property grob 'left-bound-info))))
>       (ly:grob-set-nested-property! grob '(right-bound-info Y) left-Y))))
>
> \relative c'' {
>   \override Glissando #'after-line-breaking = #flat-gliss
>   \override Glissando #'thickness = #8
>   \override Glissando #'to-barline = ##t
>
>   c1\glissando
>   g'\glissando
>   g,
> }
>
> There's one more important tweak, remaining, though, and I can't figure it
> out: Is there a way to make the ends of the lines square instead of round? I
> don't see a property for this in line-interface.
>
> best,
> Jeff

AFAIK, there is none.
But you can construct a new stencil via `make-filled-box-stencil´

\version "2.17.6"

#(define flat-gliss
  (lambda (grob)
    (let* ((left-Y (assoc-get 'Y (ly:grob-property grob 'left-bound-info)))
           (stencil (ly:line-spanner::print grob))
           (stencil-x-ext (ly:stencil-extent stencil X))
           (line-thickness (ly:staff-symbol-line-thickness grob))
           (staff-space (ly:staff-symbol-staff-space grob))
           (half-gliss-thick (- (/ staff-space 2) line-thickness))
           (new-stencil (make-filled-box-stencil
                        (interval-widen stencil-x-ext (* line-thickness 1))
                        (interval-widen (cons left-Y left-Y) half-gliss-thick))))

          (ly:grob-set-property! grob 'stencil new-stencil)
          (ly:grob-set-nested-property! grob '(right-bound-info Y) left-Y))))

\relative c'' {
  \override Glissando #'after-line-breaking = #flat-gliss
  \override Glissando #'to-barline = ##t

  c1\glissando
  g'\glissando
  g,
  f'2\glissando
  e'
}

Please note: I hardcoded the Glissando-thickness depending on
staff-space and staff-symbol-line-thickness.
This could be done for 'to-barline, too.
Or create a function to gain more flexibility.

Cheers,
  Harm



--
《〠》】〶【〖〠〗〶〛〷〚
Jeff Treviño
PhD Candidate in Music Composition
@ the University of California, San Diego
〖〠〗〶〛〷〚《〠》】〶
Skype: jeffreytrevino
E-mail: address@hidden
〚《〠》】〶【〖〠〗〶〛〷
9310H Redwood Dr.
La Jolla, CA 92037
USA
〖〠〗〶〛〷〚《〠》】〶【


reply via email to

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