]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scripts/musedata2ly.py (): idem
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 24 Dec 2002 21:54:43 +0000 (21:54 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 24 Dec 2002 21:54:43 +0000 (21:54 +0000)
* scripts/midi2ly.py (dump_chord): idem

* scripts/etf2ly.py (version): idem

* scripts/pmx2ly.py (Slur.calculate): new chord syntax

* scripts/mup2ly.py (pre_processor_commands): new chord syntax

ChangeLog
input/mutopia/J.S.Bach/baerenreiter-sarabande.ly
scripts/abc2ly.py
scripts/etf2ly.py
scripts/midi2ly.py
scripts/mup2ly.py
scripts/musedata2ly.py
scripts/pmx2ly.py

index 71c214f373a75bae21c84512570ce7f9de3df31e..e205bf3e1c64028b8075af91d235f64d71f9d16a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2002-12-24  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
 
+       * scripts/musedata2ly.py (): idem
+
+       * scripts/midi2ly.py (dump_chord): idem
+
+       * scripts/etf2ly.py (version): idem 
+
+       * scripts/pmx2ly.py (Slur.calculate): new chord syntax
+
+       * scripts/mup2ly.py (pre_processor_commands): new chord syntax
+
        * scm/tex.scm (tex-output-expression): remove eval compat
        glut. Other output files too.
 
index 073ab9f836d1b92985a16b06ec41f8b0a9f51fa4..b73bd54e7e601820f4931af24c285c3c99327078 100644 (file)
@@ -146,12 +146,7 @@ sarabandeCelloGlobal =  \notes{
 sarabandeCelloScripts =  \notes{
 }
 
-  #(warn "FIXME: Setting beamed lengths")
 sarabandeCelloStaff =  \context Staff <
-  %%#(warn "FIXME: Setting beamed lengths")
-  %%\notes c4*0-#(warn "FIXME: Setting beamed lengths")
-  \property Staff.Stem \set #'beamed-lengths = #'(3.26)
-  
   \sarabandeA
   \sarabandeCelloGlobal
   \sarabandeCelloScripts
index eac86759a21c1cfda5e4d0129734ab6553de4d9a..296bb48407cdf3acdf97048334b4a4c3564c2587 100644 (file)
 
 
 #TODO:
+#
+# Convert to new chord styles.
+#
 # UNDEF -> None
+#
   
   
 program_name = 'abc2ly'
@@ -924,7 +927,6 @@ def try_parse_note (str, parser_state):
 
        (str, num,den,current_dots) = parse_duration (str, parser_state)
 
-
        if re.match('[ \t]*\)', str):
                str = string.lstrip (str)
        
@@ -934,9 +936,6 @@ def try_parse_note (str, parser_state):
                str = str[1:]
 
        
-       if slur_end:
-               voices_append ('%s' % ')' *slur_end )
-
        bar_acc = get_bar_acc(notename, octave, parser_state)
        pit = pitch_to_lilypond_name(notename, acc, bar_acc, global_key[notename])
        oct = octave_to_lilypond_quotes (octave)
@@ -960,7 +959,10 @@ def try_parse_note (str, parser_state):
                if not parser_state.parsing_tuplet:
                        voices_append ("}")
        if slur_begin:
-               voices_append ('%s' % '(' * slur_begin )
+               voices_append ('-(' * slur_begin )
+       if slur_end:
+               voices_append ('-)' *slur_end )
+
 
 
        return str
index 4219f1d8df054b35bdfa51bf31e58c7effe756ef..df3b6d35046109032eb938d5c464ea2568419777 100644 (file)
@@ -233,8 +233,9 @@ class Slur:
                        if not cs or not ce:
                                raise IndexError
                        
-                       cs.note_suffix = '(' + cs.note_suffix 
-                       ce.note_prefix = ce.note_prefix + ')'
+                       cs.note_suffix = '-(' + cs.note_suffix 
+                       ce.note_suffix = ce.note_suffix + '-)'
+                       
                except IndexError:
                        sys.stderr.write ("""\nHuh? Slur no %d between (%d,%d), with %d notes""" % (self.number,  startnote, endnote, len (chords)))
                                         
@@ -700,15 +701,18 @@ class Chord:
                        if rest:
                                nn = rest
                                
-                       s = s + '%s%d%s' % (nn, self.duration[0], '.'* self.duration[1])
+                       s = s + nn 
 
                if not self.pitches:
-                       s  = 'r%d%s' % (self.duration[0] , '.'* self.duration[1])
-               s = self.note_prefix + s + self.note_suffix
+                       s  = 'r'
                if len (self.pitches) > 1:
-                       s = '<%s>' % s
+                       s = '<< %s >>' % s
+
+               s = s + '%d%s' % (self.duration[0], '.'* self.duration[1])
+               s = self.note_prefix + s + self.note_suffix
                
                s = self.chord_prefix + s + self.chord_suffix
+
                return s
 
 
index a6c3acd926a19f279b9c60415b6967d3e083b6cd..3b3f00dd9eb7a0ddd886b67acbb3036ef7ca6701 100644 (file)
@@ -429,7 +429,7 @@ class Note:
 
                return (o, n, a)
                
-       def dump (self):
+       def dump (self, dump_dur = 1):
                global reference_note
                s = chr ((self.notename + 2)  % 7 + ord ('a'))
                s = s + self.alteration_names[self.alteration + 2]
@@ -450,9 +450,9 @@ class Note:
                elif commas < 0:
                        s = s + "," * -commas
 
-               if explicit_durations_p \
+               if and dump_dur (explicit_durations_p \
                   or Duration.compare (self.duration,
-                                       reference_note.duration):
+                                       reference_note.duration)):
                        s = s + self.duration.dump ()
 
                reference_note = self
@@ -788,12 +788,14 @@ def dump_chord (ch):
                s = s + dump (notes[0])
        elif len (notes) > 1:
                global reference_note
-               s = s + '<'
-               s = s + notes[0].dump ()
+               s = s + '<<'
+               s = s + notes[0].dump (dump_dur = 0)
                r = reference_note
                for i in notes[1:]:
-                       s = s + i.dump ()
-               s = s + '>'
+                       s = s + i.dump (dump_dur = 0 )
+               s = s + '>>'
+
+               s = s + notes[0].duration.dump()
                reference_note = r
        return s
 
index 88868a8e03f5f13f5c4468add89df1f0bf24fd45..2630c4931d9ab2b9b19fb0dd40f22907e161968e 100644 (file)
@@ -455,8 +455,8 @@ class Slur:
                e= self.end_chord
 
                if e and s:
-                       s.note_suffix = s.note_suffix + '('
-                       e.note_prefix = ')' + e.note_prefix
+                       s.note_suffix = s.note_suffix + '-('
+                       e.note_prefix = e.note_suffix + "-)"
                else:
                        sys.stderr.write ("\nOrphaned slur")
                        
@@ -721,19 +721,21 @@ class Chord:
                for p in self.pitches:
                        if str:
                                str = str + ' ' 
-                       str = str + pitch_to_lily_string (p) + sd
+                       str = str + pitch_to_lily_string (p)
 
-               for s in self.scripts:
-                       str = str + '-' + s
 
                str = self.note_prefix +str  + self.note_suffix
                
                if len (self.pitches) > 1:
-                       str = '<%s>' % str
+                       str = '<<%s>>' % str
                elif self.multimeasure:
-                       str = 'R' + sd
+                       str = 'R'
                elif len (self.pitches) == 0:
-                       str = 'r' + sd
+                       str = 'r'
+
+               str = str + sd
+               for s in self.scripts:
+                       str = str + '-' + s
 
                str = self.chord_prefix + str + self.chord_suffix
                
index 99d74fb764298e516d08a4bac2a29d3dd6b9b800..dd6eaabdb569a8d6492b10eba293256cec803372 100644 (file)
@@ -226,27 +226,22 @@ class Chord:
 
                sd = sd + '.' * self.dots
 
-               str = ')' * len (self.slurstart) + str
-               
                for p in self.pitches:
                        if str:
                                str = str + ' ' 
-                       str = str + pitch_to_lily_string (p) + sd
-               str = str + '(' * len (self.slurstart)
+                       str = str + pitch_to_lily_string (p) 
                
+               if len (self.pitches) > 1:
+                       str = '<<%s>>' % str
+               elif len (self.pitches) == 0:
+                       str = 'r'
 
+               str = str + sd + '-(' * len (self.slurstart) + '-)' * len (self.slurstart) 
                for s in self.scripts:
                        str = str + '-' + s
 
                str = self.note_prefix +str  + self.note_suffix
-               
-               if len (self.pitches) > 1:
-                       str = '<%s>' % str
-               elif len (self.pitches) == 0:
-                       str = 'r' + sd
-
                str = self.chord_prefix + str + self.chord_suffix
-               
                return str
 
 class Measure_start:
index 412906db09cefafd35d2115a870553b01b315569..c462713be9350feef777773315d948eba58ec76d 100644 (file)
@@ -135,11 +135,12 @@ class Slur:
                e= self.end_chord
 
                if e and s:
-                       s.note_suffix = s.note_suffix + '('
-                       e.note_prefix = ')' + e.note_prefix
+                       s.note_suffix = s.note_suffix + '-('
+                       e.note_prefix = e.note_suffix + '-)' 
                else:
                        sys.stderr.write ("\nOrphaned slur")
-                       
+
+
 class Voice:
        def __init__ (self):
                self.entries = []
@@ -337,18 +338,18 @@ class Chord:
                for p in self.pitches:
                        if str:
                                str = str + ' ' 
-                       str = str + pitch_to_lily_string (p) + sd
-
-               for s in self.scripts:
-                       str = str + '-' + s
+                       str = str + pitch_to_lily_string (p) 
 
-               str = self.note_prefix +str  + self.note_suffix
-               
                if len (self.pitches) > 1:
-                       str = '<%s>' % str
+                       str = '<<%s>>' % str
                elif len (self.pitches) == 0:
-                       str = 'r' + sd
+                       str = 'r'
+
+               str = str + sd
+               for s in self.scripts:
+                       str = str + '-' + s
 
+               str = self.note_prefix + str + self.note_suffix
                str = self.chord_prefix + str + self.chord_suffix
                
                return str