Re: Part of Key signature in bracket

2015-09-10 Thread David Kastrup
Andreas Stenberg  writes:

> Hi!
>
> I'm editing an 18-th century piece with several voices and "movements"
> where the source; an early print, has a printing error for the first
> movement of the pice. In all the Voices for that movement the key is
> given as G-major when it obviously should be D- major as in the rest
> of the movements. Is there any way to get a bracket on the c- sharp in
> the key signature for D - major?
> (I'v allready found the snippet for putting a bracket around the whole
> key signature and can use that as an emergency stoppgapp solution but
> i would like a neater more exakt notation showing exaktly what has ben
> editorialy added. )

I think that in the last three weeks or so somebody posted a Scheme
version of the key signature engraver here.  That would likely be the
go-to solution for fudging a bracket in.

A hand-grown solution would be to replace the code putting the key
signature in with something that adds the bracket on top (experimenting
until one has it positioned correctly).

I'm a bit at a loss about what a nice _user_ interface for achieving
that kind of thing should look like.

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Part of Key signature in bracket

2015-09-10 Thread Thomas Morley
2015-09-10 20:32 GMT+02:00 Simon Albrecht :
> Hello Andreas,
>
> Am 10.09.2015 um 19:38 schrieb Andreas Stenberg:
>>
>> Hi!
>>
>> I'm editing an 18-th century piece with several voices and "movements"
>> where the source; an early print, has a printing error for the first
>> movement of the piece. In all the Voices for that movement the key is given
>> as G-major when it obviously should be D- major as in the rest of the
>> movements.
>
>
> In the Baroque period it was still fairly common to allude to church modes
> in key signature, e.g.
> – d ‘minor’ without a flat or { \key d \dorian } (also with other minor
> keys)
> – e ‘minor’ without a sharp or { \key e \phrygian }.
> From this point of view, I think (without knowing the exact context of
> course) it’s possible that it was not by mistake that the editor wrote {
> \key g \mixolydian }.
>
> But this doesn’t impede the editorial decision to use two sharps in your
> print. (It might lead to confusion with ambiguous notes, though.)
>
>> Is there any way to get a bracket on the c- sharp in the key signature for
>> D - major?
>
>
> With LilyPond, all things are possible! It just depends on the amount of
> programming involved… In this case, the actual programming has already been
> done by David Nalesnik (kudos!) for the thread starting here
> :
> providing an alternative print routine for KeySignature (and
> KeyCancellation, which you’re likely not going to need), which allows
> individual handling of the accidentals.
> I modified this such that it doesn’t do coloring, but parenthesizing.
>


Also available:
http://lilypond.1069038.n5.nabble.com/change-the-key-signature-td148427.html#a149165
David's engraver is much nicer, though.

Cheers,
  Harm

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Part of Key signature in bracket

2015-09-10 Thread Andreas Stenberg

Hi!

I'm editing an 18-th century piece with several voices and "movements" 
where the source; an early print, has a printing error for the first 
movement of the pice. In all the Voices for that movement the key is 
given as G-major when it obviously should be D- major as in the rest of 
the movements. Is there any way to get a bracket on the c- sharp in the 
key signature for D - major?
(I'v allready found the snippet for putting a bracket around the whole 
key signature and can use that as an emergency stoppgapp solution but i 
would like a neater more exakt notation showing exaktly what has ben 
editorialy added. )


Yours Andrea Stenberg

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Part of Key signature in bracket

2015-09-10 Thread Simon Albrecht

Hello Andreas,

Am 10.09.2015 um 19:38 schrieb Andreas Stenberg:

Hi!

I'm editing an 18-th century piece with several voices and "movements" 
where the source; an early print, has a printing error for the first 
movement of the piece. In all the Voices for that movement the key is 
given as G-major when it obviously should be D- major as in the rest 
of the movements.


In the Baroque period it was still fairly common to allude to church 
modes in key signature, e.g.
– d ‘minor’ without a flat or { \key d \dorian } (also with other minor 
keys)

– e ‘minor’ without a sharp or { \key e \phrygian }.
From this point of view, I think (without knowing the exact context of 
course) it’s possible that it was not by mistake that the editor wrote { 
\key g \mixolydian }.


But this doesn’t impede the editorial decision to use two sharps in your 
print. (It might lead to confusion with ambiguous notes, though.)


Is there any way to get a bracket on the c- sharp in the key signature 
for D - major?


With LilyPond, all things are possible! It just depends on the amount of 
programming involved… In this case, the actual programming has already 
been done by David Nalesnik (kudos!) for the thread starting here 
: 
providing an alternative print routine for KeySignature (and 
KeyCancellation, which you’re likely not going to need), which allows 
individual handling of the accidentals.

I modified this such that it doesn’t do coloring, but parenthesizing.

Yours, Simon
\version "2.19.23"
% courtesy of David Nalesnik
% http://lists.gnu.org/archive/html/lilypond-user/2015-08/msg00414.html
%
% adapted for parenthesizing by Simon Albrecht

#(define key-signature-parenthesize `(
   ((0 . ,SHARP) . #t) ; C
  ))


#(define key-signature::special-print
   (lambda (grob)
 (let* ((inter (/ (ly:staff-symbol-staff-space grob) 2.0))
(mol empty-stencil)
(c0s (ly:grob-property grob 'c0-position))
(is-cancellation? (grob::has-interface grob 'key-cancellation-interface))
(pos empty-interval)
(overlapping-pos empty-interval)
(padding-pairs (ly:grob-property grob 'padding-pairs))
(fm (ly:grob-default-font grob))
(alist (ly:grob-property grob 'glyph-name-alist))) (display (ly:grob-property grob 'alteration-alist)) (newline)
   (let loop ((s (ly:grob-property grob 'alteration-alist))
  (stil mol)
  (last-glyph-name #f))
 (if (pair? s)
 (let* ((alt (if is-cancellation? 0 (cdar s)))
(glyph-name (ly:assoc-get alt alist)))
   (if (not (string? glyph-name))
   (begin
(ly:warning "No glyph found for alteration: ~a" alt)
(loop (cdr s) stil last-glyph-name))
   (let ((acc (ly:font-get-glyph fm glyph-name)))
 (if (equal? acc empty-stencil)
 (begin 
  (ly:warning "alteration not found")
  (loop (cdr s) stil last-glyph-name))
 (let ((column empty-stencil)
   (pos empty-interval))
   (let inner ((pos-list
(key-signature-interface::alteration-positions
 (car s) c0s grob)))
 (if (pair? pos-list)
 (let* ((p (car pos-list))
(pitch (car s))
(paren? (assoc-get pitch key-signature-parenthesize))
(acc
 (if paren?
 (parenthesize-stencil acc 0.065 0.4 0.4 0.1)
 acc)))
   (set! pos (add-point pos p))
   (set! column
 (ly:stencil-add column
   (ly:stencil-translate-axis acc (* p inter) Y)))
   (inner (cdr pos-list
 (let* ((padding (ly:grob-property grob 'padding 0.0))
(handle (assoc (cons glyph-name last-glyph-name) padding-pairs))
(padding
 (cond
  ((pair? handle) (cdr handle))
  ((and
(string=? glyph-name "accidentals.natural")
(not (interval-empty?
  (interval-intersection overlapping-pos pos
   (+ padding 0.3))