Would please someone push the attached patches?

Thanks
Urs


-------- Original-Nachricht --------
Betreff: Re: Issue 3890 in lilypond: Patch: Add dodecaphonic-first accidental style
Datum:  Tue, 01 Apr 2014 15:31:31 +0000
Von:    lilyp...@googlecode.com
An:     lilyli...@googlemail.com



Updates:
        Labels: -Patch-countdown Patch-push

Comment #6 on issue 3890 by pkx166h: Patch: Add dodecaphonic-first
accidental style
http://code.google.com/p/lilypond/issues/detail?id=3890

Patch counted down - please push (Note: Do we need some extra doc for
anything, if so can you create a new tracker?)

--
You received this message because you are the owner of the issue.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

Reply to this email to add a comment or make updates.



>From 80962fe2631ebefb2c285a75e2d33d262d8183e9 Mon Sep 17 00:00:00 2001
From: Rutger Hofmann <rut...@cs.vu.nl>
Date: Tue, 25 Mar 2014 11:57:59 +0100
Subject: [PATCH 1/2] Issue 3890: Add dodecaphonic-first accidental style

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.
---
 scm/music-functions.scm |   24 ++++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)

diff --git a/scm/music-functions.scm b/scm/music-functions.scm
index c77c1dc..068376e 100644
--- a/scm/music-functions.scm
+++ b/scm/music-functions.scm
@@ -1419,14 +1419,16 @@ Returns @code{#f} or the reason for the invalidation, a symbol."
          (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
-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
@@ -1484,7 +1486,7 @@ specifies whether accidentals should be canceled in different octaves."
         (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))
@@ -1511,7 +1513,13 @@ is, to the end of current measure.  A positive integer means that the
 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}.
@@ -1724,6 +1732,14 @@ as a 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.
-- 
1.7.9.5

>From 0034e6dec57ad71f3e49968c3ae0a5741d56d52a Mon Sep 17 00:00:00 2001
From: Urs Liska <g...@ursliska.de>
Date: Tue, 25 Mar 2014 11:59:54 +0100
Subject: [PATCH 2/2] Issue 3890: Add doc for dodecaphonic-first accidental
 style

---
 Documentation/notation/pitches.itely |   60 ++++++++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)

diff --git a/Documentation/notation/pitches.itely b/Documentation/notation/pitches.itely
index 5d24686..b5cc662 100644
--- a/Documentation/notation/pitches.itely
+++ b/Documentation/notation/pitches.itely
@@ -2502,6 +2502,66 @@ musicB = {
 @end lilypond
 
 
+@item dodecaphonic-first
+
+@cindex dodecaphonic accidental style
+@cindex dodecaphonic style, neo-modern
+
+@funindex dodecaphonic-first
+
+Similar to the dodecaphonic accidental style @emph{every} pitch
+gets an accidental sign, but only the first time it is encountered
+in a measure.  Accidentals are only remembered for the actual octave
+but throughout voices.
+
+@lilypond[quote]
+musicA = {
+  <<
+    \relative c' {
+      cis'8 fis, bes4 <a cis>8 f bis4 |
+      cis2. <c, g'>4 |
+    }
+    \\
+    \relative c' {
+      ais'2 cis, |
+      fis8 b a4 cis2 |
+    }
+  >>
+}
+
+musicB = {
+  \clef bass
+  \new Voice {
+    \voiceTwo \relative c' {
+      <fis, a cis>8[ <fis a cis>
+      \change Staff = up
+      cis' cis
+      \change Staff = down
+      <fis, a> <fis a>]
+      \showStaffSwitch
+      \change Staff = up
+      dis'4 |
+      \change Staff = down
+      <fis, a cis>4 gis <f a d>2 |
+    }
+  }
+}
+
+\new PianoStaff {
+  <<
+    \context Staff = "up" {
+      \accidentalStyle dodecaphonic-first
+      \musicA
+    }
+    \context Staff = "down" {
+      \accidentalStyle dodecaphonic-first
+      \musicB
+    }
+  >>
+}
+@end lilypond
+
+
 @item teaching
 
 @cindex teaching accidental style
-- 
1.7.9.5

_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to