Autor Thema: accidentalStyle bei Tonarten mit vielen Vorzeichen  (Gelesen 2911 mal)

Arnold

  • Gast
accidentalStyle bei Tonarten mit vielen Vorzeichen
« am: Montag, 5. März 2012, 10:54 »
Hallo,

während die von mir bevorzugte Vorzeichendarstellungsart entweder "modern-cautionary" oder "modern-voice-cautionary" ist, schreibe ich gerne bei fünf oder sechs Vorzeichen in der Tonart vor den verbleibenden nicht alternierten Noten eingeklammerte Auflösungszeichen.
Für 2.15.30 habe ich schon mal eine Testroutine (\fiveKeysRemAccidentalStyle statt \accidentalStyle) zusammengebaut, damit ich nicht mehr unterscheiden muß, ob ich die Stimme nun als A- oder als B-Klarinette darstelle:
\version "2.15.30"
% copied from scm/music-functions.scm:

#(define (key-entry-bar-number entry)
  "Return the bar number of an entry in localKeySignature (or #f if the entry does not
  have a bar number)."
  (and (pair? (car entry)) (caddr entry)))

#(define (key-entry-measure-position entry)
  "Return the measure position of an entry in localKeySignature (or #f if the entry does
  not have a measure position)."
  (and (pair? (car entry)) (cdddr entry)))

#(define (key-entry-alteration entry)
  "Return the alteration of an entry in localKeySignature.

For convenience, returns @code{0} if entry is @code{#f}."
  (if entry
      (if (number? (car entry))
  (cdr entry)
  (cadr entry))
      0))

% New special rule:

#(define-public (five-keys-accidental-rule context pitch barnum measurepos)
  "An accidental rule that typesets a cautionary accidental if it is
included in the key signature @emph{and} does not directly follow a note
on the same staff line."
  (let* ((keysig (ly:context-property context 'localKeySignature))
         (gkeysig (ly:context-property context 'keySignature))
         (ksl (length gkeysig))
         (manykeys (>= ksl 5))
         (entrytf (find-pitch-entry keysig pitch #t #f))
         (entry (find-pitch-entry keysig pitch #t #t))
         (zeigenswert (and (not entrytf) manykeys))
         (folgeton (if (not entry) #f (let*
            ((entrymp (key-entry-measure-position entry))
             (entrybn (key-entry-bar-number entry)))
            (and (equal? entrybn barnum) (equal? entrymp measurepos)))))
         (zeigen (and zeigenswert (not folgeton))))
    (cons #f zeigen)
  )
 )

#(define-public (set-five-keys-accidental-style style . rest)
  "Set accidental style to @var{style}.  Optionally take a context
argument, e.g. @code{'Staff} or @code{'Voice}.  The context defaults
to @code{Staff}, except for piano styles, which use @code{GrandStaff}
as a context."
  (let ((context (if (pair? rest)
     (car rest) 'Staff))
(pcontext (if (pair? rest)
      (car rest) 'GrandStaff)))
    (cond
      ;; Arnold W.
      ;; When five or six accidentals are written in the (global) key signature,
      ;; then remind me of the remaining naturals
      ((equal? style 'modern-cautionary)
       (set-accidentals-properties #f
   `(Staff ,(make-accidental-rule 'same-octave 0))
   `(Staff ,(make-accidental-rule 'any-octave 0)
   ,(make-accidental-rule 'same-octave 1)
                                           ,five-keys-accidental-rule)
   context))
      (else
       (ly:warning (_ "unknown accidental style for five_Keys_Rem[ind_of_naturals] mode: ~S") style)
       (make-sequential-music '())))))

fiveKeysRemAccidentalStyle =
#(define-music-function
   (parser location context style) ((symbol?) string?)
   (_i "Set accidental style to @var{style}, a string.  If an optional
@var{context} symbol is given, e.g. @code{#'Staff} or @code{#'Voice},
the settings are applied to that context.  Otherwise, the context
defaults to @samp{Staff}, except for piano styles, which use
@samp{GrandStaff} as a context.
For comfortable music notation at key signatures with five or six
accidentals remind the player/reader of the remaining naturals." )
   (if context
       (set-five-keys-accidental-style (string->symbol style) context)
       (set-five-keys-accidental-style (string->symbol style))))
Habt ihr ähnliche Angewohnheiten?