[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