Parenthesized second key signature

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

Parenthesized second key signature

Tyler Mitchell
I'm trying to figure out how to add a "parenthesized" second key
signature to my music, something like this:

        https://www.ldx.ca/tmp/paren-key-1.png

I experimented with adding two \key commands one after the other,
but I get the error:

        foo.ly:5:9: warning: Two simultaneous key-change events, junking this one

The following comes somewhat close, though there's a bit of an
undesirable gap between the two key signatures; and I can't figure
out how to increase the size of the parentheses; and I have to use
the 'second' key signature throughout to avoid a lot of unneeded
accidentals; and I wouldn't be able to use a time signature, as it
would be stuck between these two key signatures.

\version "2.18.2"

\relative c'' {
  \key a \major
  \once\override NoteHead.stencil = ##f
  \once\override Stem.stencil = ##f
  a4    
  % Doesn't seem to have any effect:
  \override ParenthesesItem.font-size = #5
  \parenthesize
  \key aes \major
  aes4  
}

\layout { \context { \Staff printKeyCancellation = ##f \remove Time_signature_engraver } }

Any suggestions for how I should approach this?

A "stretch goal" would be to have accidentals handled automatically
in the same way, eg:

        https://www.ldx.ca/tmp/paren-key-2.png

But this seems a bit more involved (and unneeded, at least
initially).

Many thanks,
Tyler

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Parenthesized second key signature

Andrew Bernard
Hi Tyler,

Pardon my appalling kindergarten level ignorance, but what does this even mean, to have two key sigs. together? I realise I am making a fool of myself here!

Andrew


On Thu, 29 Nov 2018 at 21:57, Tyler Mitchell <[hidden email]> wrote:
I'm trying to figure out how to add a "parenthesized" second key
signature to my music, something like this:


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

RE: Parenthesized second key signature

Mark Stephen Mrotek

Andrew,

 

Perhaps the purpose is to indicate the possibility of singing in two difference keys. Here D major and Db major.

 

Mark

 

From: lilypond-user [mailto:lilypond-user-bounces+carsonmark=[hidden email]] On Behalf Of Andrew Bernard
Sent: Thursday, November 29, 2018 5:33 AM
To: lilypond-user Mailinglist <[hidden email]>
Subject: Re: Parenthesized second key signature

 

Hi Tyler,

 

Pardon my appalling kindergarten level ignorance, but what does this even mean, to have two key sigs. together? I realise I am making a fool of myself here!

 

Andrew

 

 

On Thu, 29 Nov 2018 at 21:57, Tyler Mitchell <[hidden email]> wrote:

I'm trying to figure out how to add a "parenthesized" second key
signature to my music, something like this:


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Parenthesized second key signature

David Wright
In reply to this post by Andrew Bernard
On Fri 30 Nov 2018 at 00:32:34 (+1100), Andrew Bernard wrote:
> Hi Tyler,
>
> Pardon my appalling kindergarten level ignorance, but what does this even
> mean, to have two key sigs. together? I realise I am making a fool of
> myself here!

It gives you instant transposition of a semitone. And if you're a
keyboard player who doesn't like playing in five flats, you can cheat
and pretend the piece is in two sharps (but don't tell the singers!).

> On Thu, 29 Nov 2018 at 21:57, Tyler Mitchell <[hidden email]> wrote:
>
> > I'm trying to figure out how to add a "parenthesized" second key
> > signature to my music, something like this:

Cheers,
David.

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Parenthesized second key signature

Thomas Morley-2
In reply to this post by Tyler Mitchell
Am Do., 29. Nov. 2018 um 11:57 Uhr schrieb Tyler Mitchell <[hidden email]>:

>
> I'm trying to figure out how to add a "parenthesized" second key
> signature to my music, something like this:
>
>         https://www.ldx.ca/tmp/paren-key-1.png
>
> I experimented with adding two \key commands one after the other,
> but I get the error:
>
>         foo.ly:5:9: warning: Two simultaneous key-change events, junking this one
>
> The following comes somewhat close, though there's a bit of an
> undesirable gap between the two key signatures; and I can't figure
> out how to increase the size of the parentheses; and I have to use
> the 'second' key signature throughout to avoid a lot of unneeded
> accidentals; and I wouldn't be able to use a time signature, as it
> would be stuck between these two key signatures.
>
> \version "2.18.2"
>
> \relative c'' {
>   \key a \major
>   \once\override NoteHead.stencil = ##f
>   \once\override Stem.stencil = ##f
>   a4
>   % Doesn't seem to have any effect:
>   \override ParenthesesItem.font-size = #5
>   \parenthesize
>   \key aes \major
>   aes4
> }
>
> \layout { \context { \Staff printKeyCancellation = ##f \remove Time_signature_engraver } }
>
> Any suggestions for how I should approach this?
>
> A "stretch goal" would be to have accidentals handled automatically
> in the same way, eg:
>
>         https://www.ldx.ca/tmp/paren-key-2.png
>
> But this seems a bit more involved (and unneeded, at least
> initially).
>
> Many thanks,
> Tyler

Hi,

I once made below (here a little lifted up):

\version "2.19.82"

alternativeKey =
#(define-music-function (p-1 p-2 scale-def)
     (ly:pitch? ly:pitch? number-pair-list?)
#{
  \override Staff.KeySignature.stencil =
   #(lambda (grob)
      (let* ((staff-space (ly:staff-symbol-staff-space grob))
             (line-thickness (ly:staff-symbol-line-thickness grob))
             (th line-thickness)
             (default-stil (ly:key-signature-interface::print grob))
             ;; To avoid programming error @code{(markup #:null)} is returned if
             ;; the scale would not result in a printed KeySignature.
             ;; TODO: add the other scales: ionian, locrian etc
             (stil-to-add
               (grob-interpret-markup grob
                 (if (or (and (= (ly:pitch-notename p-2) 5)
                              (= (ly:pitch-alteration p-2) 0)
                              (eq? scale-def minor))
                         (and (= (ly:pitch-notename p-2) 0)
                              (= (ly:pitch-alteration p-2) 0)
                              (eq? scale-def major)))
                 (markup #:null)
                 #{
                   \markup
                     \score {
                       { \key $p-2 $scale-def }
                       \layout {
                         \override Staff.TimeSignature #'stencil = ##f
                         \override Staff.Clef #'stencil = ##f
                         \override Staff.StaffSymbol #'line-count = #0
                         indent = 0
                       }
                   }
                 #})
                 ))
             (stil-to-add-x-ext (ly:stencil-extent stil-to-add X))
             (stil-to-add-y-ext (ly:stencil-extent stil-to-add Y)))
    (if (< 0 (interval-length stil-to-add-x-ext))
        (if (or (and (= (ly:pitch-notename p-1) 5)
                     (= (ly:pitch-alteration p-1) 0)
                     (eq? scale-def minor))
                (and (= (ly:pitch-notename p-1) 0)
                     (= (ly:pitch-alteration p-1) 0)
                     (eq? scale-def major)))
            (bracketify-stencil
              (ly:make-stencil
                (ly:stencil-expr stil-to-add)
                ;; left bracket is to far away
                ;; trimmed a little
                (cons
                   (+ (car stil-to-add-x-ext) (* 0.7 staff-space) )
                   (cdr stil-to-add-x-ext))
                ;; adjusting the top and bottom ending of the bracket
                (cons
                   (+ (car stil-to-add-y-ext) (* 0.2 staff-space))
                   (- (cdr stil-to-add-y-ext) (* 0.5 staff-space))))
              Y th (* 2.5 th) th)
            (ly:stencil-combine-at-edge
              default-stil
              X
              RIGHT
              (bracketify-stencil
                (ly:make-stencil
                  (ly:stencil-expr stil-to-add)
                  ;; left bracket is to far away
                  ;; trimmed a little
                  (cons
                     (+ (car stil-to-add-x-ext) (* 0.7 staff-space) )
                     (cdr stil-to-add-x-ext))
                  ;; adjusting the top and bottom ending of the bracket
                  (cons
                     (+ (car stil-to-add-y-ext) (* 0.2 staff-space))
                     (- (cdr stil-to-add-y-ext) (* 0.5 staff-space))))
                Y th (* 2.5 th) th)
                1))
      default-stil)))

  \key $p-1 $scale-def
#})

%%%%%%%%%%%%%%
% EXAMPLES
%%%%%%%%%%%%%%
%%{
\relative c' {
    \alternativeKey c f \major
    c1
    \alternativeKey b c \major
    c
    \alternativeKey e ees \major
    c
    \alternativeKey a aes \major
    c
    \alternativeKey d des \major
    c
    \alternativeKey g ges \major
    c
    \alternativeKey c ces \major
    c
    \alternativeKey ges g \major
    c1
    \alternativeKey des d \major
    c
    \alternativeKey aes a \major
    c
    \alternativeKey ees e \major
    c
    \alternativeKey bes b \major
    c
    \alternativeKey f fis \major
    c
    \alternativeKey ces cis \major
    c
}

Current limitation: both keys need to use the same scale, i.e.
supported is neither something like a \minor a \major or other scales
like \dorian etc


HTH,
  Harm

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Parenthesized second key signature

Andrew Bernard
In reply to this post by Mark Stephen Mrotek
HI Mark,

Yes I note in both examples the key sigs are a semitone apart. Is this some convention in some church music? OP, help us out. I don't even know what to google for!

Andrew


On Fri, 30 Nov 2018 at 02:55, Mark Stephen Mrotek <[hidden email]> wrote:

 

Perhaps the purpose is to indicate the possibility of singing in two difference keys. Here D major and Db major.



_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Parenthesized second key signature

bobroff@centrum.is
Alternative key signatures like this are also used to save space in a book of musical exercises.  Rather than print out the exact same think in a key a half-step away, both keys are indicated.



----- Original Message -----
> From: "Andrew Bernard" <[hidden email]>
> To: "Lillypond Users Mailing List" <[hidden email]>
> Sent: Friday, November 30, 2018 7:14:20 AM
> Subject: Re: Parenthesized second key signature

> HI Mark,
>
> Yes I note in both examples the key sigs are a semitone apart. Is this some
> convention in some church music? OP, help us out. I don't even know what to
> google for!
>
> Andrew
>
>
> On Fri, 30 Nov 2018 at 02:55, Mark Stephen Mrotek < [
> mailto:[hidden email] | [hidden email] ] > wrote:
>
>
>
>
>
>
>
> Perhaps the purpose is to indicate the possibility of singing in two difference
> keys. Here D major and Db major.
>
>
>
> _______________________________________________
> lilypond-user mailing list
> [hidden email]
> https://lists.gnu.org/mailman/listinfo/lilypond-user

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Parenthesized second key signature

Tyler Mitchell
In reply to this post by Thomas Morley-2
On Thu, Nov 29, 2018 at 10:10:16PM +0100, Thomas Morley wrote:
> Hi,
>
> I once made below (here a little lifted up):
>
[...snip...]
>
> HTH,
>   Harm

Thanks, Harm, I'll give it a try, but it looks like I'll need to
get on the -devel branch first. (I quickly attempted it on 2.18.2
but it didn't work.)

I can see the general method you're using -- interesting. Hope you
won't mind if I ask some follow-up questions, once I figure out a
bit more how this works. :-)

Many thanks,
Tyler

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Parenthesized second key signature

Tyler Mitchell
In reply to this post by Andrew Bernard
On Fri, Nov 30, 2018 at 06:14:20PM +1100, Andrew Bernard wrote:
> HI Mark,
>
> Yes I note in both examples the key sigs are a semitone apart. Is this some
> convention in some church music? OP, help us out. I don't even know what to
> google for!
>
> Andrew

Yes, Mark and David have it right -- it's more or less a 'hint' to
the accompanist that the piece can be played in either key. I say
'hint' because this is true whether the parenthetical key signature
is printed or not.

In my personal experience, I have only seen this in chant
accompaniments, though others here have mentioned other
possibilities.

I've often thought that the idea is to make it easier for the
singer (lower pitch) and/or the accompanist (fewer sharps or
flats), but sometimes it does neither (eg Bb Maj -> B Maj). I
suppose for some singers, higher is actually better.

The second example I gave is from here (in case you want to see
more):

http://www.ccwatershed.org/blog/2013/mar/19/1947-bragers-graduale-organ/

I don't know what the 'rules' are for when it's printed or not;
there are a number of chant accompaniments with an Eb Major key
signature which seem playable in E Major, but there was no
secondary key signature given.

(* And yes, I know chant isn't in, eg, "E Major", I'm just writing
it this way for the sake of simplicity.)

Cheers
Tyler

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Parenthesized second key signature

Tyler Mitchell
In reply to this post by Andrew Bernard
By the way, I don't know what this is called, properly -- I've been
using words like 'parenthesized' or 'parenthetical' or 'second' or
'secondary' key signature, but if there is a proper name for it
(and while I'm wishing, the rules for when to print it or not), I'd
like to know, too.

Tyler

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Parenthesized second key signature

Thomas Morley-2
In reply to this post by Tyler Mitchell
Am Fr., 30. Nov. 2018 um 09:19 Uhr schrieb Tyler Mitchell <[hidden email]>:

>
> On Thu, Nov 29, 2018 at 10:10:16PM +0100, Thomas Morley wrote:
> > Hi,
> >
> > I once made below (here a little lifted up):
> >
> [...snip...]
> >
> > HTH,
> >   Harm
>
> Thanks, Harm, I'll give it a try, but it looks like I'll need to
> get on the -devel branch first. (I quickly attempted it on 2.18.2
> but it didn't work.)

Probably it's enough to use the music-function-default-arguments,
which can be omitted with newer versions, i.e.:

alternativeKey =
#(define-music-function (parser location p-1 p-2 scale-def)
     (ly:pitch? ly:pitch? number-pair-list?)
...

Cheers,
  Harm

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Parenthesized second key signature

Tyler Mitchell
On Fri, Nov 30, 2018 at 11:09:52AM +0100, Thomas Morley wrote:

> Probably it's enough to use the music-function-default-arguments,
> which can be omitted with newer versions, i.e.:
>
> alternativeKey =
> #(define-music-function (parser location p-1 p-2 scale-def)
>      (ly:pitch? ly:pitch? number-pair-list?)
> ...
>
> Cheers,
>   Harm

Thanks, that worked perfectly!

Tyler

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Parenthesized second key signature

Thomas Morley-2
Am Fr., 30. Nov. 2018 um 12:02 Uhr schrieb Tyler Mitchell <[hidden email]>:

>
> On Fri, Nov 30, 2018 at 11:09:52AM +0100, Thomas Morley wrote:
> > Probably it's enough to use the music-function-default-arguments,
> > which can be omitted with newer versions, i.e.:
> >
> > alternativeKey =
> > #(define-music-function (parser location p-1 p-2 scale-def)
> >      (ly:pitch? ly:pitch? number-pair-list?)
> > ...
> >
> > Cheers,
> >   Harm
>
> Thanks, that worked perfectly!
>
> Tyler

I've put a revised snippet in the LSR.
Available here:
http://lsr.di.unimi.it/LSR/Item?u=1&id=1075


Cheers,
  Harm

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Parenthesized second key signature

David Wright
In reply to this post by Andrew Bernard
On Fri 30 Nov 2018 at 18:14:20 (+1100), Andrew Bernard wrote:
> HI Mark,
>
> Yes I note in both examples the key sigs are a semitone apart. Is this some
> convention in some church music? OP, help us out. I don't even know what to
> google for!

In my experience, the convention in church music in Britain is that
organists can transpose, to varying standards of expertise, along with
talents like playing counterpoint written on individual staves,
extemporising on Anglican chants, etc. Things that are sorely missed
over here.

Cheers,
David.

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Parenthesized second key signature

Andrew Bernard
Hi David,

We have a similar tradition in Australia (British colony?) in organ playing. That's why I thought the other key sig. is redundant.

Andrew


On Sun, 2 Dec 2018 at 09:38, David Wright <[hidden email]> wrote:

In my experience, the convention in church music in Britain is that
organists can transpose, to varying standards of expertise, along with
talents like playing counterpoint written on individual staves,
extemporising on Anglican chants, etc. Things that are sorely missed
over here.


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Parenthesized second key signature

Shane Brandes
A.G.O, American guild of organists has sight transposition tests for
their certification program, but I think they only go a third from the
printed key.

regards,
Shane
On Sat, Dec 1, 2018 at 10:14 PM Andrew Bernard <[hidden email]> wrote:

>
> Hi David,
>
> We have a similar tradition in Australia (British colony?) in organ playing. That's why I thought the other key sig. is redundant.
>
> Andrew
>
>
> On Sun, 2 Dec 2018 at 09:38, David Wright <[hidden email]> wrote:
>>
>>
>> In my experience, the convention in church music in Britain is that
>> organists can transpose, to varying standards of expertise, along with
>> talents like playing counterpoint written on individual staves,
>> extemporising on Anglican chants, etc. Things that are sorely missed
>> over here.
>>
> _______________________________________________
> lilypond-user mailing list
> [hidden email]
> https://lists.gnu.org/mailman/listinfo/lilypond-user

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user