Hi Kieren,

I modified the example for the auto-transpose engraver a bit, so it uses a music and a global variable. I merged them in one Voice, so that the cue names are not printed twice. But that is not necessary for the transposition. If the music is in concert-pitch and transposed to instrument-pitch midi is OK. In the other direction print is OK, but midi is wrong. That is no problem to me, as I mostly enter music in concert-pitch and just have to display it in instrument pitch. One thing to take care of: When music is used twice - for example via repeat unfold - every event is transposed multiple times.
That should be changed.

HTH
time to sleep now ;)
Best, Jan-Peter


Am 09.09.14 14:55, schrieb Kieren MacMillan:
Hi Jan-Peter,

may I again mention the auto-transpose snippet.
Does the key signature get changed automatically, even if the key-signatures 
are defined “externally” (i.e., in a variable) and change DURING THE TIME the 
player is on the second (or third) instrument?

If so, this would solve a HUGE problem I’ve been struggling with for years.

Thanks,
Kieren.
_______________________

Kieren MacMillan, composer
www:  <http://www.kierenmacmillan.info>
email:  i...@kierenmacmillan.info

\version "2.18.2"
\include "editorial-tools/auto-transpose/definitions.ily"
\include "editorial-tools/edition-engraver/definitions.ily"
\include "deutsch.ly"

% some music to insert into example
bach = \relative c'' { b a c h }

% add two transposing instrument-definitions
\addInstrumentDefinition #"eb-clarinet"
  #`((instrumentTransposition . ,(ly:make-pitch 0 2 -1/2))
     (shortInstrumentName . "Es-Kl")
     (clefGlyph . "clefs.G")
     (middleCPosition . -6)
     (clefPosition . -2)
     (instrumentCueName . "Es-Kl")
     (midiInstrument . "clarinet"))

\addInstrumentDefinition #"b-clarinet"
  #`((instrumentTransposition . ,(ly:make-pitch -1 6 -1/2))
     (shortInstrumentName . "Kl")
     (clefGlyph . "clefs.G")
     (middleCPosition . -6)
     (clefPosition . -2)
     (instrumentCueName . "Kl")
     (midiInstrument . "clarinet"))

%%% create demo score

\addEdition transp
\editionMod transp 2 0/1 switch.instrument.Staff.A \instrumentSwitch 
"b-clarinet"
\editionMod transp 3 0/1 switch.instrument.Staff.A \instrumentSwitch 
"eb-clarinet" 

music = { $bach $bach $bach <>^"note get transposed multiple times!" \repeat 
unfold 4 c''4 }
global = { \key f \major s1 \key f \major s1 \key f \major s1 }
\score {
  \new Staff \with {
    \autoTranspose
    \consists \editionEngraver switch.instrument
  } \new Voice <<
    \global
    \music
  >>
  \layout {}
  \midi { \tempo 4=150 }
}


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

Reply via email to