I've been experimenting with midiPanPosition: http://lilypond.org/doc/v2.19/Documentation/notation/context-properties-for-midi-effects

I find the following works:

\version "2.19.83"

\include "english.ly"
sopStaff = \new Staff = "sop" {
  \set Staff.midiPanPosition = #-1.0
  \relative c' { e4 f g a }
}
altoStaff = \new Staff = "alto" {
  \set Staff.midiPanPosition = #1.0
  \relative c' { c4 d e f }
}
\score {
  <<
    \sopStaff
    \altoStaff
  >>
  \midi {  }
}

... with a wav built like this:

$ lilypond midiPanPosition.ly
$ fluidsynth -O s32 -F midiPanPosition.wav /opt/local/share/sounds/sf2/GeneralUser_GS_v1.471.sf2 midiPanPosition.mid

But it doesn't work if I try to set the midiPanPosition inside a midi context block like this:

\version "2.19.83"

\include "english.ly"
sopStaff = \new Staff = "sop" {
  \relative c' { e4 f g a }
}
altoStaff = \new Staff = "alto" {
  \relative c' { c4 d e f }
}
\score {
  <<
    \sopStaff
    \altoStaff
  >>
  \midi {
    \context Staff = "sop" {
      \set Staff.midiPanPosition = #1.0
      \set Staff.midiBalance = #1.0
    }
    \context Staff = "alto" {
      \set Staff.midiPanPosition = #-1.0
      \set Staff.midiBalance = #-1.0
    }
  }
}

Furthermore, the result of doing this is that both staffs are played through the left, and nothing on the right.

Am I doing something wrong?

I want to do the setting in the midi context block because I require different pan positions for a staff depending on which score it appears in.

---
Matt Wallis

Reply via email to