lilypond-user
[Top][All Lists]
Advanced

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

Substitution function for setting stemLeftBeamCount and stemRightBeamCou


From: Trevor Bača
Subject: Substitution function for setting stemLeftBeamCount and stemRightBeamCount at the same time
Date: Mon, 27 Nov 2006 07:09:31 -0600

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
address@hidden

reply via email to

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