Dear Christian,

Many thanks indeed - I hadn't thought of using \transpose for this purpose,
although I have indeed used it for other reasons.   Several of the initial
responses to my query recommended \transpose as well.  It still means
though that I need a separate declaration for every score block, or for
every invocation of \global_two.  In this sense, although it's a much more
efficient and flexible approach, it requires the same amount of work as
changing the relative pitch for each \new \Voice for part two. I was hoping
there was some neat way of including the relative pitch in the global
declaration of the parts (global_one and global_two in my example).  But I
do like the neatness of your method and of your function.

The idea of reading through the notation manual systematically is
excellent.  The issue for me is that I only really have time to explore and
use Lilypond a few times a year (I get too busy the rest of the time), and
my notational needs are generally fairly simple.

Thank you again,
Alasdair

On Thu, Feb 10, 2022 at 7:27 PM Christian <[email protected]>
wrote:

> Hi Alasdair!
>
> Two pretty easy options here as transposing a whole lot of stuff is pretty
> straight forward in lilypond:
>
> You could exchange the lines like
>    \new Staff << \global \global_two \global_prelude \prelude_two >>
> with
>    \new Staff << \transpose #FROM #TO { \global \global_two
> \global_prelude \prelude_two } >>
> with #FROM and #TO being the respective pitches you want to transpose the
> music.
>
> Or you could use a custom transpose function, that you define at the
> beginning, for example:
>    tsp =
>       #(define-music-function (parser location msc) (ly:music?)
>          #{
>             \transpose #FROM #TO #msc
>          #}
>    )
> and exchange the same line from before with
>    \new Staff << \tsp { \global \global_two \global_prelude \prelude_two }
> >>
>
> In the first option you'd have to exchange the transposition for every
> movement, in the second version only at the one point in the beginning of
> the document.
>
> Hope this helps,
> Christian
>
> PS: I really recommend you to work through the notation manual
> systematically even though you may not need most of it right now.
>
> Am Do., 10. Feb. 2022 um 00:18 Uhr schrieb Alasdair McAndrew <
> [email protected]>:
>
>> Thank you all so much for your help and advice.  Given that there might
>> have been some confusion about what I was asking, I've added below a sort
>> of template of what I'm doing.  Note that this is a duet, and the notes for
>> the first part (first instrument) are given as variables *_one; and for the
>> second part (second instrument) as *_two.
>>
>> The use of the "french" clef is just to check with the original - they
>> will be changed to "\clef treble" before final typesetting.
>>
>> What I want to do is to produce a version of this where the second part
>> is taken by a bass instrument.  This will require two things: first a
>> change of the \global_two decoration, and second a change of relative pitch
>> in its music.
>>
>> There are 8 movements, which would mean - in my example - changing the
>> relative pitch for each variable containing music for this second part.
>> Given that I like to separate the notes from the movement and instrument
>> descriptions, I was hoping that this could be done "in one go" as it were.
>> I was wondering if it would be possible to define one's own version of
>> \Voice in such a way that included a relative pitch - maybe using a Scheme
>> function.
>>
>> Anyway, I shall read all your messages with greater focus later today.
>> Again, many thanks.
>>
>> Alasdair
>>
>> --
>> global_one = {
>>   \set Staff.instrumentName = #"Recorder"
>>   \override Staff.InstrumentName.self-alignment-X = #RIGHT
>>   \set Staff.midiInstrument = #"recorder"
>>   \clef french
>> }
>>
>> global_two = {
>>   \set Staff.instrumentName = #"Recorder"
>>   \override Staff.InstrumentName.self-alignment-X = #RIGHT
>>   \set Staff.midiInstrument = #"recorder"
>>   \clef french
>> }
>>
>> global_prelude = {
>>   \time 4/4
>>   \key c \major
>> }
>>
>> global_menuet = {
>>   \time 3/4
>>   \key c \minor
>> }
>>
>> prelude_one = \new Voice \relative c'' {
>>   notes notes notes
>> }
>>
>> prelude_two = \new Voice \relative c'' {
>>   notes notes notes
>> }
>>
>> menuet_one = \new Voice \relative c'' {
>>   notes notes notes
>> }
>>
>> menuet_two = \new Voice \relative c'' {
>>   notes notes notes
>> }
>>
>> \score {
>> \new StaffGroup <<
>>    \new Staff << \global \global_one \global_prelude \prelude_one >>
>>    \new Staff << \global \global_two \global_prelude \prelude_two >>
>>   >>
>>   \layout { }
>>   \header{
>>     piece = \markup {\fontsize #2 {Prelude}}
>>   }
>>   \midi {
>>   \tempo 4 = 144}
>> }
>>
>> \score {
>> \new StaffGroup <<
>>    \new Staff << \global \global_one \global_menuet \menuet_one >>
>>    \new Staff << \global \global_two \global_menuet \menuet_two >>
>>   >>
>>   \layout { }
>>   \header{
>>     piece = \markup {\fontsize #2 {Menuet}}
>>   }
>>   \midi {
>>   \tempo 4 = 144}
>> }
>>
>> On Wed, Feb 9, 2022 at 6:16 PM Alasdair McAndrew <[email protected]>
>> wrote:
>>
>>> I'm sorry about all these damn-fool queries of mine; I promise to go
>>> back
>>> under my rock soon.  Anyway:
>>> In the current 18th century suite I'm typesetting (for two treble
>>> instruments without bass), there is a separate variable (containing the
>>> notes) for each part of each movement.  Then there are global
>>> declarations
>>> about the instruments, and the key and time-signature of each movement;
>>> and
>>> these are all brought together in score blocks.
>>>
>>> The one thing I don't know how to do is to declare the relative pitch
>>> globally.  Thus, each music variable looks like
>>>
>>> movement1_part1 = \new Voice \relative c'' { notes, notes, and more
>>> notes }
>>>
>>> The difficulty is that I want to re-set the second part for a bass
>>> instrument, so it might start off as
>>>
>>> movement1_part2 = \new Voice \relative c { notes, notes, and more notes }
>>>
>>> Currently this means changing the relative pitch for each movement
>>> individually.  It would be much more efficient to be able to do this
>>> just
>>> once at the beginning, with an appropriate global declaration.  Can this
>>> be
>>> done?  Is there a way to set the relative pitch of some music in a
>>> \global
>>> block?
>>>
>>> (Note, I have indeed RTFM, but it's quite hard - even with the search
>>> function - to find answers to this, or examples of such use.  Hence this
>>> message...)
>>>
>>> Thank you,
>>> Alasdair
>>> --
>>> 0432 854 858
>>> https://numbersandshapes.net
>>>
>>
>>
>> --
>> Alasdair McAndrew
>> mob: 0432 854 858
>>
>> https://numbersandshapes.net
>>
>

-- 
Alasdair McAndrew
mob: 0432 854 858

https://numbersandshapes.net

Reply via email to