This accidental style assigns accidentals to _all_ pitches
(just as dodecaphonic does) but remembers them throughout
a whole measure.
This style is useful for different styles of contemporary notation
that want to make use of the non-tonal dodecaphonic style but don't
want to print so many redundant accidentals.
(car alteration-def))
(else 0)))
(car alteration-def))
(else 0)))
-(define (check-pitch-against-signature context pitch barnum laziness octaveness)
+(define (check-pitch-against-signature context pitch barnum laziness octaveness all-naturals)
"Checks the need for an accidental and a @q{restore} accidental against
@code{localKeySignature}. The @var{laziness} is the number of measures
for which reminder accidentals are used (i.e., if @var{laziness} is zero,
only cancel accidentals in the same measure; if @var{laziness} is three,
we cancel accidentals up to three measures after they first appear.
@var{octaveness} is either @code{'same-octave} or @code{'any-octave} and
"Checks the need for an accidental and a @q{restore} accidental against
@code{localKeySignature}. The @var{laziness} is the number of measures
for which reminder accidentals are used (i.e., if @var{laziness} is zero,
only cancel accidentals in the same measure; if @var{laziness} is three,
we cancel accidentals up to three measures after they first appear.
@var{octaveness} is either @code{'same-octave} or @code{'any-octave} and
-specifies whether accidentals should be canceled in different octaves."
+specifies whether accidentals should be canceled in different octaves.
+If @var{all-naturals} is ##t, notes that do not occur in @code{keySignature}
+also get an accidental."
(let* ((ignore-octave (cond ((equal? octaveness 'any-octave) #t)
((equal? octaveness 'same-octave) #f)
(else
(let* ((ignore-octave (cond ((equal? octaveness 'any-octave) #t)
((equal? octaveness 'same-octave) #f)
(else
(let* ((prev-alt (extract-alteration previous-alteration))
(this-alt (ly:pitch-alteration pitch)))
(let* ((prev-alt (extract-alteration previous-alteration))
(this-alt (ly:pitch-alteration pitch)))
- (if (not (= this-alt prev-alt))
+ (if (or (and all-naturals (eq? #f previous-alteration)) (not (= this-alt prev-alt)))
(begin
(set! need-accidental #t)
(if (and (not (= this-alt 0))
(begin
(set! need-accidental #t)
(if (and (not (= this-alt 0))
accidental lasts over that many bar lines. @w{@code{-1}} is `forget
immediately', that is, only look at key signature. @code{#t} is `forever'."
accidental lasts over that many bar lines. @w{@code{-1}} is `forget
immediately', that is, only look at key signature. @code{#t} is `forever'."
- (check-pitch-against-signature context pitch barnum laziness octaveness))
+ (check-pitch-against-signature context pitch barnum laziness octaveness #f))
+
+(define-public ((make-accidental-dodecaphonic-rule octaveness laziness) context pitch barnum measurepos)
+ "Variation on function make-accidental-rule that creates an dodecaphonic
+accidental rule."
+
+ (check-pitch-against-signature context pitch barnum laziness octaveness #t))
(define (key-entry-notename entry)
"Return the pitch of an @var{entry} in @code{localKeySignature}.
(define (key-entry-notename entry)
"Return the pitch of an @var{entry} in @code{localKeySignature}.
,dodecaphonic-no-repeat-rule)
'()
context))
,dodecaphonic-no-repeat-rule)
'()
context))
+ ;; Variety of the dodecaphonic style. Each note gets an accidental,
+ ;; except notes that were already handled in the same measure.
+ ((equal? style 'dodecaphonic-first)
+ (set-accidentals-properties #f
+ `(Staff ,(make-accidental-dodecaphonic-rule 'same-octave 0))
+ '()
+ context))
+
;; Multivoice accidentals to be read both by musicians playing one voice
;; and musicians playing all voices.
;; Accidentals are typeset for each voice, but they ARE canceled across voices.
;; Multivoice accidentals to be read both by musicians playing one voice
;; and musicians playing all voices.
;; Accidentals are typeset for each voice, but they ARE canceled across voices.