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

_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to