lilypond-user
[Top][All Lists]
Advanced

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

Re: multi-instrument parts


From: Keith OHara
Subject: Re: multi-instrument parts
Date: Wed, 16 Jan 2013 03:23:49 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Kieren MacMillan <kieren_macmillan <at> sympatico.ca> writes:

> Has anyone successfully written multi-instrument player parts [...]
> using \addInstrumentDefinition and \switchInstrument [...] ?

Almost certainly not.  \addInstrumentDefinition is inconvenient.
Google says: No results found for instrumentSwitch site:mutopiaproject.org

> \addInstrumentDefinition #"clarinet_bf"
>   #`((instrumentTransposition . ,(ly:make-pitch 0 0 -200))

The third argument to make-pitch is in equal-tempered whole-tones,
so you would think you want (ly:make-pitch -1 6 -1/2) for B-flat 
if instrumentTransposition works like \transposition

However, from trial-and-error, it seems instrumentTransposition needs
the pitch written for the instrument that /sounds/ concert C, so D for
a soprano clarinet (instrumentTransposition . ,(ly:make-pitch 0 1 0))

> global = {
>   \key d \major
>   %% flute
>     s1
>   %% clarinet
>     s1

Setting the "transposition" in LilyPond tells her that the music sounds
at a different pitch than written, for purposes of quoting, cue-ing, and 
MIDI.  Only \transpose changes the pitches that are printed. 

> \score {
>   \new Staff << \global \windMusic >>
> }

The instrumentSwitch applies to the whole Staff, and the instumentCueName
is printed for each Voice, in your case it is printed once for \windMusic
and once for \global.  You could say 
\new Staff \new Voice << \global windMusic >>

Printing for each Voice is silly, so a bug is tracked as issue 2835,
but I don't see any way to fix that bug without breaking Reinhold's 
OrchestraLily system, which explicitly sets the name on a single voice
  \set Voice.instrumentCueName = "Violin"

So the best I can do is below.  The manual method is easier.
=====
\version "2.16.0"
\addInstrumentDefinition #"flute"
  #`((instrumentTransposition . ,(ly:make-pitch 0 0 0))
     (shortInstrumentName . "Fl.")
     (clefGlyph . "clefs.G")
     (middleCPosition . -6)
     (clefPosition . -2)
     (instrumentCueName . ,(make-bold-markup "fl."))
     (midiInstrument . "flute"))

\addInstrumentDefinition #"clarinet_bf"
  #`((instrumentTransposition . ,(ly:make-pitch 0 1 0))
     (shortInstrumentName . "Cl.")
     (clefGlyph . "clefs.G")
     (middleCPosition . -6)
     (clefPosition . -2)
     (instrumentCueName . ,(make-bold-markup "cl."))
     (midiInstrument . "clarinet"))

windMusic = {
  \instrumentSwitch "flute"
  \key d \major
  \relative d' {
    d8 e fis g a b cis d }
  \instrumentSwitch "clarinet_bf"
  \transpose bes c' \relative d' { 
    \key d\major
    d e fis g a b cis d 
    \bar "||" 
    \key f \major
    d, e fis g a b cis d  }
  \instrumentSwitch "flute"
  \key f \major
  \relative d' {
    d e fis g a b cis d } }

\score {
  \new Staff \windMusic
  \layout {}
  \midi {} }




reply via email to

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