lilypond-user
[Top][All Lists]
Advanced

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

Auto-panner


From: Vaughan McAlley
Subject: Auto-panner
Date: Mon, 27 Jan 2014 23:54:43 +1100

I was so excited by \set Score.midiPanPosition that I was inspired to
write a function in Scheme that spreads the voices evenly from left to
right. It can’t look ahead to find the number of voices or staves,
that needs to be specified at the start or before a new \score
definition:

\version "2.18.0"

\include "autopan.ly"
\SetTotalAutopanStaves #4

myMusic = \relative c' {
   \time 4/4
   c4 d e f g1
}

\score {
   <<
      \new Staff {
         \autopan
         \transpose c bes \myMusic
      }
      \new Staff {
         \autopan
         \transpose c g \myMusic
      }
      \new Staff {
         \autopan
         \transpose c e \myMusic
      }
      \new Staff {
         \autopan
         \transpose c c \myMusic
      }
   >>
   \layout {}
   \midi {}
}

%%%%%%%%%%%%%%

Because I’m lazy, I’d love to include the \autopan command in \global,
but it looks like when \global is evaluated, the function is evaluated
and its return value is permanently made part of \global, which means
everything is panned to the far left. Is there a way to make the
function run every time \global appears?

Vaughan

Attachment: autopan.ly
Description: Binary data


reply via email to

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