lilypond-user
[Top][All Lists]
Advanced

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

Re: midiPanPosition in midi context block


From: karl
Subject: Re: midiPanPosition in midi context block
Date: Fri, 8 Nov 2019 15:05:38 +0100 (CET)

Matt Wallis:
...
> 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 {  }
> }
...
> But it doesn't work if I try to set the midiPanPosition inside a midi 
> context block like this:
...
>    \midi {
>      \context Staff = "sop" {
>        \set Staff.midiPanPosition = #1.0
>        \set Staff.midiBalance = #1.0
>      }

If you partition the code to a few files, you can do it in another way:

%%% file song.ily
musSop = \relative c' { e4 f g a }
musAlt = \relative c' { c4 d e f }

voiceSop  = \context Voice = voiceSop { \musSop }
staffSop  = \new Staff << \voiceSop >>
mstaffSop = \new Staff << \midiSop \voiceSop >>

voiceAlt  = \context Voice = voiceAlt { \musAlt }
staffAlt  = \new Staff << \voiceAlt >>
mstaffAlt = \new Staff << \midiAlt \voiceAlt >>

\score {
  \unfoldRepeats
  <<
      \mstaffSop
      \mstaffAlt
      \mstaffTen
      \mstaffBas
  >>
  \midi { }
}

%%% file song_a.ly
\version "2.19.83"
midiSop = { \set Staff.midiPanPosition = #-1.0 }
midiAlt = { \set Staff.midiPanPosition = #1.0 }

\include "song.ily"

%%% file song_b.ly
\version "2.19.83"
midiSop = { \set Staff.midiPanPosition = #-0.5 }
midiAlt = { \set Staff.midiPanPosition = #0.5 }

\include "song.ily"

%%%

I.e. when running lilypond on song_a.ly vs. song_b.ly,
you will get different pan positions.

 There is little more complex example in:
http://aspodata.se/git/musik/anonymous/es_ist_ein_ros_entsprungen/

Regards,
/Karl Hammar





reply via email to

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