lilypond-user
[Top][All Lists]
Advanced

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

Re: Beam direction with \new Voice


From: Mark Polesky
Subject: Re: Beam direction with \new Voice
Date: Sat, 8 Aug 2009 10:22:29 -0700 (PDT)

Kieren MacMillan wrote:
> \version "2.13"
> #(ly:set-option 'point-and-click #f)
>
> split = #(define-music-function (parser location upper lower) (ly:music?
> ly:music?)
> #{ << { \voiceOne $upper } \context Voice = "2" { \voiceTwo $lower } >>
> \oneVoice #})
>
> splitMusic = \relative
> {
>   c'4 b a b \split { c1 b4( a) g2 } { c,4 d e f g1 }
> }
>
> theWords = \lyricmode {
>   This is how we split mu -- sic!
> }
>
> \score
> {
>   <<
>     \new Voice = "melody" \splitMusic
>     \new Lyrics \lyricsto "melody" { \theWords }
>   >>
> }

Impressive, Kieren. Looks like your "Autumn of LilyPond" will
leave us with another clever schemer! One suggestion, though. Make
a good example for the newbies... format and indent your code as
clearly as you can. Over e-mail (and especially with multiple
reply "> " columns), long lines get chopped up quickly and become
even harder to read. You can see this already in the reply block
above. And even without reply columns, some e-mail clients wrap to
a thinner width than you might expect, and then single-line
comments get split and cause headaches. For e-mail, I try to keep
lines 66 characters max. In the source code, I do 72. And avoid
tabs in e-mail, they come out weird in the gnu archives:
http://lists.gnu.org/archive/html/lilypond-devel/2009-06/msg00210.html

I made some small changes to your code, just as an example. I
removed redundant curly braces, pulled lone left "{" braces up one
line, and used two \split commands to maintain the "one measure
per line of code" guideline.

I don't mean to pick on you, but I've seen enough examples of
problems caused by formatting, and I know that even a little
carelessness can cause big confusion.

Nice macro, though!
- Mark

\version "2.13"

#(ly:set-option 'point-and-click #f)

split =
#(define-music-function
  (parser location upper lower)
  (ly:music? ly:music?)
  #{
    <<
      \voiceOne $upper
      \context Voice = "2" { \voiceTwo $lower }
    >>
    \oneVoice
  #})

splitMusic = \relative {
  c'4 b a b
  \split { c1 }
         { c,4 d e f }
  \split { b4( a) g2 }
         { g1 }
}

theWords = \lyricmode {
  This is how we split mu -- sic!
}

\score {
  <<
    \new Voice = "melody" \splitMusic
    \new Lyrics \lyricsto "melody" \theWords
  >>
}


      




reply via email to

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