]> git.donarmstrong.com Git - lilypond.git/commitdiff
remove octave-duplicate.ly
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 4 Feb 2004 18:00:06 +0000 (18:00 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 4 Feb 2004 18:00:06 +0000 (18:00 +0000)
ChangeLog
input/test/engraver-one-by-one.ly
input/test/hymn.ly
input/test/octave-duplicate.ly [deleted file]
input/test/part-combine.ly
lily/include/output-property-music-iterator.hh [deleted file]
lily/output-property-music-iterator.cc
ly/declarations-init.ly
scm/lily.scm
scm/part-combiner.scm
scripts/convert-ly.py

index ee2abefe429f06e34af80a3fe1a221557d33ba79..a8de456371f7752b4577c23a0c41d60c6ac47396 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2004-02-04  Han-Wen Nienhuys   <hanwen@xs4all.nl>
+
+       * input/test: remove octave-duplicate.ly
+
 2004-02-04  Jan Nieuwenhuizen  <janneke@gnu.org>
 
        * scripts/filter-lilypond-book.py: Speed-up and clean-ups.
index cf40b9689cd054326d752772decb5cdd6c73926a..ac1338903112b7825ed43a14d46c6b9cef171682 100644 (file)
@@ -89,7 +89,6 @@ MyVoiceContext = \translator {
        \consists "Font_size_engraver"
        
        % must come before all
-       \consists "Voice_devnull_engraver"
        \consists "Output_property_engraver"    
        \consists "Arpeggio_engraver"
        \consists "Multi_measure_rest_engraver"
@@ -121,7 +120,6 @@ MyVoiceContext = \translator {
        \consists "Tie_engraver"
        \consists "Tie_engraver"
        \consists "Tuplet_engraver"
-       \consists "A2_engraver"
 
        \consists "Skip_event_swallow_translator"
        \accepts Thread % bug if you leave out this!
@@ -137,7 +135,6 @@ MyThreadContext = \translator{
     style of individual note heads.
 "
        \consists "Font_size_engraver"  
-       \consists "Thread_devnull_engraver"
        \consists "Note_heads_engraver"
        \consists "Rest_engraver"
 
index f327e902b95fd49ef80227be37d8bbc0487659ab..846b0fd218c8d47cee24ed25f4f34d69094d4591 100644 (file)
@@ -1,5 +1,5 @@
 
-\version "2.1.7"
+\version "2.1.18"
 
 \header { texidoc = "
 
@@ -12,13 +12,13 @@ texts, so they should be switched off.
 \score{
        \context Staff <<
                \time 4/4
-               \context Voice=one \partcombine Voice
-                       \context Thread=one \notes\relative c'' {
+               \partcombine 
+                       \notes\relative c'' {
                                a4 c4.(g8) a4 |
                                g4 e' g(f) | 
                                b, a c2
                        }
-                       \context Thread=two \notes\relative c'' {
+                       \notes\relative c'' {
                                g4 e4.(d8) c4 |
                                g'4 c, e(f) |
                                d2 a
diff --git a/input/test/octave-duplicate.ly b/input/test/octave-duplicate.ly
deleted file mode 100644 (file)
index 4f47a22..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-
-\version "2.1.7"
-\header { texidoc="@cindex Octave Doubling
-Octave doubling parts of music. "
-}
-
-upperOne = \notes\relative c'' {
-  a4 a a a
-  a4 a a a
-  a4 a a a
-  a4 a a a
-}
-
-upperOctave = \notes <<
-  \context Thread=upperOne { \transpose c' c \upperOne }
-  \context Thread=upperOne {
-    \property Thread.devNullThread = #'allways s1*2
-    \property Thread.devNullThread = #'() s1*2
-  }
->>
-
-lowerOne = \notes\relative c {
-  a8 a a a  a a a a
-  a8 a a a  a a a a
-  a8 a a a  a a a a
-  a8 a a a  a a a a
-}
-  
-firstEight = \notes { 
-  \property Thread.devNullThread = #'() s8
-  \property Thread.devNullThread = #'allways s8*7
-}
-
-lowerOctave = \notes <<
-  \context Thread=lowerOne { \transpose c' c  \lowerOne }
-  \context Thread=lowerOne {
-    \repeat "unfold" 4 { \firstEight }
-  }
->>
-
-\score {
-  <<
-    \context PianoStaff <<
-      \context Staff=upper <<
-        \context Voice=upperOne <<
-          \upperOne
-          \upperOctave
-        >>
-      >>
-      \context Staff=lower <<
-        \clef bass
-       \context Voice=lowerOne <<
-         \lowerOne
-         \lowerOctave
-       >>
-      >>
-    >>
-  >>  
-  \paper { }
-}
-
index c37ab7c06ad7f0e4750f3876aa11ee0ccaa7407b..15fe3beb9c20e1c782c76ef92a4913a20312c4f5 100644 (file)
@@ -1,5 +1,5 @@
 
-\version "2.1.7"
+\version "2.1.18"
 
 \header{ texidoc="@cindex Part Combine
 In orchestral scores and hymns, voices are traditionally combined onto
@@ -11,13 +11,13 @@ voices according to actual rhythm and pitch.  User-defined texts such as
 \score{
    \notes \context Staff = flauti <<
     \time 4/4
-    \context Voice=one \partcombine Voice
-    \context Thread=one\relative c'' {
+    \partcombine
+    \relative c'' {
       c4 d e f | b,4 d c d | r2 e4 f | c4 d e f |
       c4 r e f | c4 r e f | c4 r a r | a a r a |
       a2 \property Voice.soloADue = ##f a |
     }
-    \context Thread=two\relative c'' {
+    \relative c'' {
       g4 b d f | r2 c4 d | a c c d | a4. b8 c4 d
       c r e r | r2 s2 | a,4 r a r | a r r a |
       a2 \property Voice.soloADue = ##f a |
@@ -25,15 +25,6 @@ voices according to actual rhythm and pitch.  User-defined texts such as
   >>
   \paper{
        raggedright = ##t
-    linewidth = 80 * \staffspace
-    \translator{
-      \ThreadContext
-      \consists Rest_engraver
-    }
-    \translator{
-      \VoiceContext
-      \remove Rest_engraver
-    }
   }
 }
 
diff --git a/lily/include/output-property-music-iterator.hh b/lily/include/output-property-music-iterator.hh
deleted file mode 100644 (file)
index e69de29..0000000
index 6b7cfca88aacf3b599e09d241542b9fca1863d0c..5931c8806bec4b77f9259241df83686849ba158e 100644 (file)
@@ -14,7 +14,6 @@ class Output_property_music_iterator : public Simple_music_iterator
 {
 public:  
   DECLARE_SCHEME_CALLBACK(constructor, ());
-  /* construction */
 protected:
   virtual void process (Moment);
 };
index a321fddf3a81adfe7eaf1f69d18ece3d6f536b47..97a45982b1a73fc24cbb67061fc5b8002d99b3f0 100644 (file)
@@ -110,7 +110,6 @@ paperTwentysix = \paper {
 
 \paper { \paperTwenty }
 
-
 partCombineListener = \paper {
  \translator {
          \VoiceContext
index e819bf653a574990051edad8671ed39c5a0250e4..65e40d0c2b4cfb7b6a0d6b060f56684f131599be 100644 (file)
@@ -10,6 +10,7 @@
 
 (use-modules (ice-9 regex)
             (ice-9 safe)
+            (oop goops)
             (srfi srfi-1)  ; lists
             (srfi srfi-13)) ; strings
 
@@ -83,6 +84,9 @@
 
 (define-public ZERO-MOMENT (ly:make-moment 0 1)) 
 
+(define-public (moment-min a b)
+  (if (ly:moment<? a b) a b))
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; lily specific variables.
 (define-public default-script-alist '())
@@ -433,3 +437,5 @@ L1 is copied, L2 not.
    (,symbol? . "symbol")
    (,vector? . "vector")
    ))
+
+
index 80bc8245179f61f0617bec5107cadaa22a621ec2..513477965985a6636ed3197199268cf508f93883 100644 (file)
@@ -1,12 +1,11 @@
 
 
+;; todo: figure out how to make module,
+;; without breaking nested ly scopes
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; part-combiner.
 
-(use-modules (oop goops))
-
-;; todo: make module.
-
 (define-class <Voice-state> ()
   (event-list #:init-value '() #:accessor events #:init-keyword #:events)
   (when-moment #:accessor when #:init-keyword #:when)
@@ -19,8 +18,7 @@
   ; spanner-state is an alist
   ; of (SYMBOL . RESULT-INDEX), which indicates where
   ; said spanner was started.
-  (spanner-state #:init-value '() #:accessor span-state)
-  )
+  (spanner-state #:init-value '() #:accessor span-state) )
   
 (define-method (write (x <Voice-state> ) file)
   (display (when x) file)
   (display (events x) file)
   (display " active = " file)
   (display (span-state x) file)
-  (display "\n" file)
-  )
+  (display "\n" file) )
 
 (define-method (note-events (vs <Voice-state>))
   (define (f? x)
     (equal? (ly:get-mus-property  x 'name) 'NoteEvent))
   (filter f? (events vs)))
 
-(define-class <Split-state> ()
-  (configuration #:init-value '() #:accessor configuration)
-  (when-moment #:accessor when #:init-keyword #:when)
-  (is #:init-keyword #:voice-states #:accessor voice-states)
-  (synced  #:init-keyword #:synced #:init-value  #f #:getter synced?)
-  )
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
 (define-method (previous-voice-state (vs <Voice-state>))
   (let* ((i (slot-ref vs 'vector-index))
-        (v (slot-ref vs 'state-vector))
-        )
+        (v (slot-ref vs 'state-vector)) )
     (if (< 0 i)
        (vector-ref v (1- i))
        #f)
   ))
-                                    
-(define (previous-span-state vs)
-        (let*
-            ((p (previous-voice-state vs)))
 
-          (if p (span-state p)
-              '())
-        ))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(define-class <Split-state> ()
+  (configuration #:init-value '() #:accessor configuration)
+  (when-moment #:accessor when #:init-keyword #:when)
+  (is #:init-keyword #:voice-states #:accessor voice-states)
+  (synced  #:init-keyword #:synced #:init-value  #f #:getter synced?) )
+                            
+
 
 
 (define-method (write (x <Split-state> ) f)
   (display (configuration x) f)
   (if (synced? x)
       (display " synced "))
-  (display "\n" f)
-  )
+  (display "\n" f) )
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
+
+(define (previous-span-state vs)
+        (let*
+            ((p (previous-voice-state vs)))
+
+          (if p (span-state p)
+              '())
+        ))
+
 (define (make-voice-states evl)
   (let
       ((vec
@@ -93,9 +91,6 @@
     )))
 
 
-(define (moment-min a b)
-  (if (ly:moment<? a b) a b))
-
 (define (make-split-state vs1 vs2)
   "Merge lists VS1 and VS2, containing Voice-state objects into vector
 of Split-state objects, crosslinking the Split-state vector and
@@ -120,8 +115,7 @@ Voice-state objects
                #:when min
                #:voice-states (cons s1 s2)
                #:synced (= inc1 inc2)
-               ) #f))
-        )
+               ) #f)) )
       (if s1
          (set! (split-index s1) ss-idx))
       (if s2
@@ -132,14 +126,12 @@ Voice-state objects
                  (cons ss-object ss-list)
                  (+ idx1 inc1)
                  (+ idx2 inc2))
-         ss-list
-         )
+         ss-list )
       ))
 
     (list->vector
      (reverse!
-      (helper 0 '() 0  0) '()))
-    )
+      (helper 0 '() 0  0) '())) )
       
 
 
@@ -184,8 +176,7 @@ Voice-state objects
                 ((equal? name 'CrescendoEvent) 'cresc)
                 ((equal? name 'DecrescendoEvent) 'decr)
                 (else #f)) )
-          (sp (ly:get-mus-property ev 'span-direction))
-          )
+          (sp (ly:get-mus-property ev 'span-direction)) )
 
        (if (and (symbol? key) (ly:dir? sp))
            (if (= sp STOP)
@@ -237,13 +228,10 @@ Voice-state objects
          (set! (span-state (vector-ref voice-state-vec index))
                (list-copy active))
 
-         (helper (1+ index) active)))
-    )
+         (helper (1+ index) active))) )
 
 
-  (helper 0 '())
-  
-  )
+  (helper 0 '()) )
 
 
        
@@ -293,8 +281,7 @@ Voice-state objects
        (chord-threshold 8)
        (voice-state-vec1 (make-voice-states evl1))
        (voice-state-vec2 (make-voice-states evl2))
-       (result (make-split-state voice-state-vec1 voice-state-vec2))
-       )
+       (result (make-split-state voice-state-vec1 voice-state-vec2)) )
 
 
   (define (analyse-time-step ri)
@@ -321,13 +308,11 @@ Only set if not set previously.
        (let*
            ((idx (cdr key-idx))
             (prev-ss (vector-ref result idx))
-            (prev (configuration prev-ss))
-            )
+            (prev (configuration prev-ss)) )
          (if (symbol? prev)
              (put prev))))
       
-      (map copy-one-state (span-state vs))
-      )
+      (map copy-one-state (span-state vs)) )
 
     (define (analyse-notes now-state) 
       (let*
@@ -342,8 +327,7 @@ Only set if not set previously.
           (notes2 (note-events vs2))
           (durs2     (sort (map (lambda (x) (ly:get-mus-property x 'duration)) notes2) ly:duration<?))
           (pitches2 (sort
-                     (map (lambda (x) (ly:get-mus-property x 'pitch)) notes2) ly:pitch<?))
-          )
+                     (map (lambda (x) (ly:get-mus-property x 'pitch)) notes2) ly:pitch<?)) )
        
        (cond
         ((> (length notes1) 1) (put 'apart))
@@ -396,9 +380,7 @@ Only set if not set previously.
                 (active2 (previous-span-state vs2))
 
                 (new-active1 (span-state vs1))
-                (new-active2 (span-state vs2))
-
-                )
+                (new-active2 (span-state vs2)) )
              (if
               pc-debug
               (display (list (when now-state) ri
@@ -416,8 +398,7 @@ Only set if not set previously.
 
                  ;; active states different:
                  (put 'apart)
-                 )
-             )
+                 ))
 
                                        ; go to the next one, if it exists.
            (analyse-time-step (1+ ri))
@@ -428,16 +409,14 @@ Only set if not set previously.
        (let*
            ((now-state (vector-ref result ri))
             (vs1 (car (voice-states now-state)))
-            (vs2 (cdr (voice-states now-state)))
-            )
+            (vs2 (cdr (voice-states now-state))) )
          
          (if (and (equal? (configuration now-state) 'chords)
                   vs1 vs2)
 
              (let*
                  ((notes1 (note-events vs1)) 
-                  (notes2 (note-events vs2))
-                  )
+                  (notes2 (note-events vs2)) )
                (cond
                 ((and
                   (= 1 (length notes1))
@@ -461,8 +440,7 @@ Only set if not set previously.
      (define (previous-config vs)
        (let*  ((pvs (previous-voice-state vs))
               (spi (if pvs (split-index pvs) #f))
-              (prev-split (if spi (vector-ref result spi) #f))
-              )
+              (prev-split (if spi (vector-ref result spi) #f)) )
         
         (if prev-split
             (configuration prev-split)
@@ -514,14 +492,12 @@ Only set if not set previously.
            (notes1 (if vs1 (note-events vs1) '()))
            (notes2 (if vs2 (note-events vs2) '()))
            (n1 (length notes1))
-           (n2 (length notes2))
-           )
+           (n2 (length notes2)) )
 
          (cond
           ((and (= n1 0) (= n2 0))
            (put 'apart-silence)
-           (1+ ri)
-           )
+           (1+ ri) )
 
           ((and (= n2 0)
                 (equal? (when vs1) (when now-state))
@@ -538,8 +514,7 @@ Only set if not set previously.
      (if (< ri (vector-length result))
         (if (equal? (configuration (vector-ref result ri)) 'apart)
             (analyse-solo12 (analyse-moment ri))
-            (analyse-solo12 (1+ ri))))
-     )
+            (analyse-solo12 (1+ ri)))) )
      
    
    (analyse-spanner-states voice-state-vec1)
@@ -585,9 +560,7 @@ Only set if not set previously.
                              evs))
             (pitch (if (pair? notes)
                        (ly:get-mus-property (car notes) 'pitch)
-                       #f))
-            )
-
+                       #f)) )
 
        ;; tail recursive.
        (if (and pitch (not (= (ly:pitch-steps pitch) 0)))
@@ -601,14 +574,12 @@ Only set if not set previously.
   (let*
       ((m (make-music-by-name 'AutoChangeMusic))
        (context (ly:run-translator music part-combine-listener))
-       (evs (last-pair noticed))
-       )
+       (evs (last-pair noticed)) )
 
     (ly:set-mus-property! m 'element music)
     (ly:set-mus-property!
      m 'split-list
-     (generate-split-list (if (pair? evs) (reverse! (cdar evs) '()) '()))
-     )
+     (generate-split-list (if (pair? evs) (reverse! (cdar evs) '()) '())) )
     
     (set! noticed '())
     m
index 986f58877852a70d3d5ad0e84bbde4901a0d22ba..c2908d0698e5a418eee451a08de8943b1f49444b 100644 (file)
@@ -1748,7 +1748,11 @@ def conv (str):
        if re.search (r'\\partcombine', str):
                sys.stderr.write ('Warning: \\partcombine has been changed. '
                                  +'Check conversion manually!')
-       
+
+               raise FatalConversionError()
+
+       # this rule doesn't really work,
+       # too lazy to figure out why.
        str = re.sub (r'\\context\s+Voice\s*=\s*one\s*\\partcombine\s+Voice\s*\\context\s+Thread\s*=\s*one(.*)\s*'
                      + r'\\context\s+Thread\s*=\s*two',
                      '\\\\newpartcombine\n\\1\n', str)