lilypond-user
[Top][All Lists]
Advanced

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

Re: instrumentSwitch and addInstrumentDefinition use


From: Keith OHara
Subject: Re: instrumentSwitch and addInstrumentDefinition use
Date: Sun, 18 Jan 2015 13:29:32 -0800
User-agent: Opera Mail/12.16 (Win32)

On Tue, 13 Jan 2015 05:54:48 -0800, Kieren MacMillan <address@hidden> wrote:

I understand that in realistic cases you probably have the notes in one 
variable and options for arrangements in another parallel sequence
 flute_notes = {c'2 c'' .... }
 arrangementB = {s1*4 \prep_alto_flute s1*4 \switch_alto_flute s1*8 }
and it is not so convenient to break flute_notes into segments for the 
individual \transpose{}s.

Correct on both counts.
(n.b. I *do* break flute_notes up when absolutely necessary… but I definitely 
wouldn’t call it “convenient”.)

You have to admit that this does (accidentally) make it sound a bit like you 
are looking for a convenient way to write music with no regard for the 
instrument.

I do see, though, that the convenience also makes it easier to make drafts and 
see how the fingerings work out on alto flute or C flute, whether it is easier 
to switch instruments a few measures earlier, etc.

I tried to make a concrete enhancement request
http://code.google.com/p/lilypond/issues/detail?id=4264

Well, if the notes are right there, and you can put them in {},
 \instrument_alto_flute { ... }  \instrument_tenor_sax { ... }
then we (including the braver non-programmers among us) can write music 
functions to set up for the new instrument and transposes the stuff in {} using 
the usual LilyPond commands.

Is that the best way?

I think the best way needs no music functions, just variables to set up the 
instrument-switches.  If you type in concert pitch you can apply a \transpose 
to written-pitch directly to the input notes.

prepClarinet = { \set Staff.shortInstrumentName="Clar"
                   <>^\markup\italic\center-align "pick up clarinet" }
switchClarinet = { <>^\markup\bold"Clarinet"
                \once\set Staff.whichBar = "||"
                \transpositionUpdateKey bes }

reedPlayer = \transpose c c' {
     c4 d e f
    \prepClarinet
     R1
    \switchClarinet
    \transpose bes c' {
     c4 d e f
    } }

This does have the variable reedPlayer storing written pitches, where we recommend 
storing concert pitches in the manual, but that causes no problem once we learn to use 
\tranposition bes .  For example \addQuote "reed" \reedPlayer supplies 
cue-notes that will be printed in concert pitch for, say, the violin player to time his 
entry.

I happen to like to include \key changes with the notes, so I would have a \key 
after the \switchClarinet, but you might prefer to have \transpositionUpdateKey 
generate that.

You can think primarily in concert pitch, run \new Staff \reedPlayer through 
Lilypond to see how the fingerings work out, and move \switchClarinet and the 
\transpose {...} around as needed to make the arrangement work out.


The instrumentSwitch mechanism we had before seemed less convenient than the 
way you wrote your \play_alto above, and it did not handle the transpositions 
which is the tricky bit.

Yes… After Han-Wen had completed the sponsored programming (back in 2006, I 
believe), I came to that sad realization.


We can't blame your sponsorship for this one.
You reported that LilyPond stopped noticing \set Staff.instrumentName during 
the music
    http://lists.gnu.org/archive/html/lilypond-devel/2006-06/msg00277.html
and, while fixing that, the programmers added the unnecessary instrumentSwitch 
package.




reply via email to

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