Hi,

I beam lots of stuff manually. This leads to frequently setting
stemLeftBeamCount and stemRightBeamCount.

%%% BEGIN EX 1 %%%

\version "2.10.0"

\new Score {
  c'64[
  \set stemLeftBeamCount = #4
  \set stemRightBeamCount = #2
  c'64
  \set stemLeftBeamCount = #2
  \set stemRightBeamCount = #4
  c'64
  c'64]
}

%%% END EX 1 %%%


I've often wondered why there isn't some setting like

 \set stemBeamCount = #'(4 . 2)

to set both stemLeftCount and stemRightBeamCount together.

However, following the third example in section 12.1.2 "Simple
substitution functions" produces the helper function below, with
cleaner code.

%%% BEGIN EX 2 %%%

\version "2.10.0"

beam = #(define-music-function (parser location left right) (number? number?)
  #{
     \set stemLeftBeamCount = #$left
     \set stemRightBeamCount = #$right
  #})

\new Score {
  c'64[
  \beam #4 #2
  c'64
  \beam #2 #4
  c'64
  c'64]
}

%%% END EX 2 %%%

Might help clean up someone else's code somewhere, too.


--
Trevor Bača
[EMAIL PROTECTED]
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to