From: Han-Wen Nienhuys Date: Wed, 4 Feb 2004 18:00:06 +0000 (+0000) Subject: remove octave-duplicate.ly X-Git-Tag: release/2.1.23~101 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=0cb0757dbcc60f9cb92731657dfb29394fee6db7;p=lilypond.git remove octave-duplicate.ly --- diff --git a/ChangeLog b/ChangeLog index ee2abefe42..a8de456371 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2004-02-04 Han-Wen Nienhuys + + * input/test: remove octave-duplicate.ly + 2004-02-04 Jan Nieuwenhuizen * scripts/filter-lilypond-book.py: Speed-up and clean-ups. diff --git a/input/test/engraver-one-by-one.ly b/input/test/engraver-one-by-one.ly index cf40b9689c..ac13389031 100644 --- a/input/test/engraver-one-by-one.ly +++ b/input/test/engraver-one-by-one.ly @@ -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" diff --git a/input/test/hymn.ly b/input/test/hymn.ly index f327e902b9..846b0fd218 100644 --- a/input/test/hymn.ly +++ b/input/test/hymn.ly @@ -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 index 4f47a22524..0000000000 --- a/input/test/octave-duplicate.ly +++ /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 { } -} - diff --git a/input/test/part-combine.ly b/input/test/part-combine.ly index c37ab7c06a..15fe3beb9c 100644 --- a/input/test/part-combine.ly +++ b/input/test/part-combine.ly @@ -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 index e69de29bb2..0000000000 diff --git a/lily/output-property-music-iterator.cc b/lily/output-property-music-iterator.cc index 6b7cfca88a..5931c8806b 100644 --- a/lily/output-property-music-iterator.cc +++ b/lily/output-property-music-iterator.cc @@ -14,7 +14,6 @@ class Output_property_music_iterator : public Simple_music_iterator { public: DECLARE_SCHEME_CALLBACK(constructor, ()); - /* construction */ protected: virtual void process (Moment); }; diff --git a/ly/declarations-init.ly b/ly/declarations-init.ly index a321fddf3a..97a45982b1 100644 --- a/ly/declarations-init.ly +++ b/ly/declarations-init.ly @@ -110,7 +110,6 @@ paperTwentysix = \paper { \paper { \paperTwenty } - partCombineListener = \paper { \translator { \VoiceContext diff --git a/scm/lily.scm b/scm/lily.scm index e819bf653a..65e40d0c2b 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -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 () (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 ) file) (display (when x) file) @@ -28,39 +26,31 @@ (display (events x) file) (display " active = " file) (display (span-state x) file) - (display "\n" file) - ) + (display "\n" file) ) (define-method (note-events (vs )) (define (f? x) (equal? (ly:get-mus-property x 'name) 'NoteEvent)) (filter f? (events vs))) -(define-class () - (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 )) (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 () + (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 ) f) @@ -69,11 +59,19 @@ (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:momentvector (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 (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 diff --git a/scripts/convert-ly.py b/scripts/convert-ly.py index 986f588778..c2908d0698 100644 --- a/scripts/convert-ly.py +++ b/scripts/convert-ly.py @@ -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)