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: Tue, 20 Jan 2015 00:05:19 -0800
User-agent: Opera Mail/12.16 (Win32)

On Sun, 18 Jan 2015 19:34:24 -0800, Kieren MacMillan <address@hidden> wrote:

This does have the variable reedPlayer storing written pitches, where we 
recommend storing concert pitches

I would much rather code in concert pitches.

What I was suggesting, and what I put into the example, had all the typed input 
in concert pitch.

By saying "reedPlayer stores written pitches", I meant only that the 
\transpose{...} operations, to tell LilyPond which notes should be printed at which 
transposition, were included in the variable reedPlayer.


Still, I think I must be missing something fundamental… It really seems to me 
that \addInstrumentDefinition already has [almost?] everything we need: the 
shortInstrumentName is there, the clef is there (in case a change is needed), 
the cue name is there, the transposition is there, etc.

So what is stopping us from making something very similar to the OP’s original 
code Do The Right Thing™?


LilyPond has the information, but it takes some work to teach her to 
consistently use it differently than she does now, and differently than the 
original poster still wants her to.

You could try the attached modification (to avoid transposition of cues) of 
Jan-Peter's method.
LilyPond transposes your input by 'instrumentTransposition when generating cue 
notes, so leave instrumentTransposition at its default.

Instead, the attached engraver uses a new property 'printTransposition to shift 
your concert-pitch input to printed pitches.   Key-signature changes are not 
always appropriate, but you can type \key\default to reprint the current 
key-signature and have it transposed for the instrument.

(This second *-Transposition setting would be confusing to new users of 
LilyPond, so any real patch would require re-writing some internals of LilyPond 
so we can select the desired behavior using just the old 
'instrumentTransposition to describe the instrument pitch.)

part = { g'4 b' d'' fis'' R1
         \instrumentSwitch "cl Bflat" \bar"||"\key\default
         g'4 b' d'' fis'' R1
         \instrumentSwitch "flute" \bar"||"\key\default
         g'4 b' d'' fis'' R1 }
global = { \key g\major s1*4  }

\new Staff \with { \printTransposition }
  \new Voice << \global \part >>

Attachment: fromJanPeterAutoTranspose.ly
Description: Text Data


reply via email to

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