lilypond-user
[Top][All Lists]
Advanced

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

Re: how to avoid double sharps in \transpose?


From: Kenneth Flak
Subject: Re: how to avoid double sharps in \transpose?
Date: Sat, 04 Feb 2023 20:07:52 +0000


--
Roosna & Flak - Contemporary Dance & Music
Web: roosnaflak.com
Code: {github,gitlab}.com/kflak
Mastodon: @kf@sonomu.club
On  4 Feb 2023  13:55, David Kastrup wrote:
>Kenneth Flak <kennethflak@protonmail.com> writes:
>
>> Hi list,
>>
>> I have this:
>>
>> \version "2.24.0"
>>
>> \language english
>>
>>
>> patright = {
>>      <b d' g'>2 <c' e' g'> |
>> }
>>
>> patleft = {
>>    g2 c
>> }
>>
>> right = {
>>    \patright
>>    \transpose c df \patright
>>    \transpose c d \patright
>>    \transpose c ef \patright
>>    \transpose c e \patright
>>    \transpose c f \patright
>>    \transpose c fs \patright
>>    \transpose c g \patright
>>    \transpose c gs \patright
>>    \transpose c a \patright
>>    \transpose c bf \patright
>>    \transpose c b \patright
>> }
>>
>> left = {
>>    \clef bass
>>    \patleft
>>    \transpose c df \patleft
>>    \transpose c d \patleft
>>    \transpose c ef \patleft
>>    \transpose c e \patleft
>>    \transpose c f \patleft
>>    \transpose c fs \patleft
>>    \transpose c g \patleft
>>    \transpose c gs \patleft
>>    \transpose c a \patleft
>>    \transpose c bf \patleft
>>    \transpose c b \patleft
>> }
>>
>> \score {
>>    \new PianoStaff
>>    <<
>>      \new Staff = "right" \right
>>      \new Staff = "left" \left
>>    >>
>> }
>>
>> It gives me a few instances of double sharps as well as some e
>> sharps. How can I do that?
>
>You mean, how can you avoid that?  Don't transpose to gs instead of af.
>
>> Also, the programmer in me squeals upon seeing all these duplications,
>> so I was curious how to reduce this to something a bit more sensible?
>
>Try using
>
>{
>#@(map (lambda (p) #{ \transpose c #p \patleft #})
>       (event-chord-pitches #{ <c df d ef e f fs g af a bf b> #}))
>}
>
Trying to make this work, and I am partly successful...

This comes out correctly:

patright = {
     <b d' g'>2 <c' e' g'> |
}

right  = {
#@(map (lambda (p) #{ \transpose c #p \patright #})
        (event-chord-pitches #{ <c df d ef e f fs g af a bf b> #}))
}

This, however, transposes the g c sequence to b e instead on the first 
iteration:

patleft = {
   g'2 c'
}

left = {
#@(map (lambda (p) #{ \transpose c #p \patleft #})
        (event-chord-pitches #{ <c df d ef e f fs g af a bf b> #}))
}

(note I also have to transpose patleft up one octave to get it on the same 
stave as before...)

I don't find any docs for event-chord-pitches anywhere...

Best,
Kenneth




reply via email to

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