]> git.donarmstrong.com Git - lilypond.git/commitdiff
*** empty log message ***
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 4 Nov 2002 00:52:16 +0000 (00:52 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 4 Nov 2002 00:52:16 +0000 (00:52 +0000)
ChangeLog
buildscripts/new-chords.py [new file with mode: 0644]
input/les-nereides.ly
input/mutopia/F.Schubert/standchen.ly
ly/spanners-init.ly
scm/music-types.scm
scripts/convert-ly.py

index e7ce3cb0cc6c32b7fcb78b8a68be0d44cdd077ca..1d4dc97a204c2f721ce40832dc4b7fc378bd686a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2002-11-03  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
+
+       * scripts/convert-ly.py: more uniformization substitutions.
+
+       * buildscripts/new-chords.py (sub_chords): new file.
+
 2002-11-03  Jan Nieuwenhuizen  <janneke@gnu.org>
 
        * mf/GNUmakefile: Bugfix: Use actual fontname (.AFM FontName) for
diff --git a/buildscripts/new-chords.py b/buildscripts/new-chords.py
new file mode 100644 (file)
index 0000000..47f4023
--- /dev/null
@@ -0,0 +1,129 @@
+
+# to nwe chord syntax.  
+import re
+import string
+import sys
+
+def sub_chord (m):
+       str = m.group(1)
+
+       if re.search (r'\\\\', str):
+               return '<%s>' % str
+
+       if re.match (r'^\s*\)?\s*\\[a-zA-Z]+', str):
+               return '<%s>' % str
+
+       durs = []
+       def sub_durs (m):
+               durs.append(m.group(2))
+               return m.group (1)
+
+       str = re.sub ("([a-z]+[,'!? ]*)([0-9.]+)", sub_durs, str)
+       dur_str = ''
+
+       for d in durs:
+               if dur_str == '':
+                       dur_str = d
+               if dur_str <> d:
+                       return '<%s>' % m.group (1)
+
+
+       dyns = ['']
+       def sub_dyn_end (m):
+               dyns.append (' -\!')
+               return m.group(2)
+
+       str = re.sub (r'(\\!)\s*([a-z]+)', sub_dyn_end, str)
+
+       slur_strs = ['']
+       def sub_slurs(m):
+               if '-)' not in slur_strs:
+                       slur_strs.append ( '-)')
+               return m.group(1)
+       def sub_p_slurs(m):
+               if '-\)' not in slur_strs:
+                       slur_strs.append ( '-\)')
+               return m.group(1)
+       str = re.sub (r"\)[ ]*([a-z]+)", sub_slurs, str)
+       str = re.sub (r"\\\)[ ]*([a-z]+)", sub_p_slurs, str)
+       def sub_begin_slurs(m):
+               if '-(' not in slur_strs:
+                       slur_strs.append ( '-(')
+               return m.group(1)
+       str = re.sub (r"([a-z]+[,'!?0-9 ]*)\(", sub_begin_slurs, str)
+       def sub_begin_p_slurs(m):
+               if '-\(' not in slur_strs:
+                       slur_strs.append ( '-\(')
+               return m.group(1)
+
+       str = re.sub (r"([a-z]+[,'!?0-9 ]*)\\\(", sub_begin_p_slurs, str)
+
+       def sub_dyns (m):
+               s = m.group(0)
+               if s == '@STARTCRESC@':
+                       slur_strs.append ("-\\<")
+               elif s == '@STARTDECRESC@':
+                       slur_strs.append ("-\\>")
+               elif s == r'-?\\!':
+                       slur_strs.append ('-\\!')
+               return ''
+               
+       str = re.sub (r'@STARTCRESC@', sub_dyns, str)
+       str = re.sub (r'-?\\!', sub_dyns, str)
+       
+       def sub_articulations (m):
+               a = m.group(1)
+               if a not in slur_strs:
+                       slur_strs.append (a)
+               return ''
+       
+       str = re.sub (r"([_^-]\@ACCENT\@)", sub_articulations, str)
+       str = re.sub (r"([_^-]\\[a-z]+)", sub_articulations, str)
+       str = re.sub (r"([_^-][>_.+|^-])", sub_articulations, str)
+       
+       pslur_strs = ['']
+       def sub_pslurs(m):
+               slur_strs.append ( ' -\\)')
+               return m.group(1)
+       str = re.sub (r"\\\)[ ]*([a-z]+)", sub_pslurs, str)
+
+       suffix = string.join (slur_strs, '') + string.join (pslur_strs, '') \
+                + string.join (dyns, '')
+
+       return '@STARTCHORD@%s@ENDCHORD@%s%s' % (str , dur_str, suffix)
+
+
+
+
+simend = '}'
+simstart = "\n\\simultaneous {"
+chordstart = '<'
+chordend = '>'
+
+old_syntax = 1
+
+if old_syntax:
+       simend = '>'
+       simstart = "<" 
+       chordstart = '<<'
+       chordend = '>>'
+
+
+
+def sub_chords (str):
+       str= re.sub (r'\\<', '@STARTCRESC@', str)
+       str= re.sub (r'\\>', '@STARTDECRESC@', str)
+       str= re.sub (r'([_^-])>', r'\1@ACCENT@', str)
+       str = re.sub ('<([^<>{}]+)>', sub_chord, str)
+
+       str = re.sub ('<([^?])', r'%s\1' % simstart, str)
+       str = re.sub ('>([^?])', r'%s\1' % simend,  str)
+       str= re.sub ('@STARTCRESC@', r'\\<', str)
+       str= re.sub ('@STARTDECRESC@', r'\\>' ,str)
+       str= re.sub ('@STARTCHORD@', chordstart, str)
+       str= re.sub ('@ENDCHORD@', chordend, str)
+       str= re.sub (r'@ACCENT@', '>', str)
+       return str
+
+
+print  sub_chords (open (sys.argv[1]).read())
index cfe88880a2142c37aecf6ecc35763251ea6f287b..a63109f0f97b28ebfe62dd824ae066ee6ae264ba 100644 (file)
@@ -1,4 +1,4 @@
-\version "1.7.3"
+\version "1.7.4"
 
 \header {
     composer =   "ARTHUR GRAY"
     description = "Nastiest piece of competition at http://www.orphee.com/comparison/study.html, see http://www.orphee.com/comparison/gray.pdf"
 }
 
-#(ly:set-point-and-click! 'line-column)
-#(set! point-and-click line-column-location)
-
+#(ly:set-point-and-click 'line-column)
 #(define (make-text-checker text)
   (lambda (elt) (equal? text (ly:get-grob-property elt 'text))))
 
-global =  \notes{
-    \partial 2
-    \key a \major
-    \skip 2
-    \skip 1*2
-    \skip 1
-    \bar "||"
-}
 
 treble =  \context Voice=treble \notes\relative c''{
+\key a \major
     % Broken?
     \property Voice.NoteColumn \override #'horizontal-shift = #0
     \outputproperty #(make-type-checker 'text-interface) 
@@ -34,9 +25,9 @@ treble =  \context Voice=treble \notes\relative c''{
     %2
     \property Voice.Stem \revert #'direction
     \property Voice.Stem \override #'direction = #1
-    r4 <cis\arpeggio eis a cis> r2
+    r4 <cis-\arpeggio eis a cis> r2
     %3
-    r4 <cis\arpeggio fis a cis> r8.
+    r4 <cis-\arpeggio fis a cis> r8.
 
     % Urg, this lifts us up to staff context
     \translator Staff=bass
@@ -85,7 +76,7 @@ treble =  \context Voice=treble \notes\relative c''{
            
     % currently, this can't be (small) italic, because in the paperblock
     % we set italic_magnifictation to get large italics.
-    cis''''4^"m.g."\arpeggio #(ly:export (make-span-event 'TextSpanEvent START)) (
+    cis''''4^"m.g."-\arpeggio #(ly:export (make-span-event 'TextSpanEvent START)) (
 
     \property Voice.Stem \revert #'direction
 
@@ -104,7 +95,10 @@ treble =  \context Voice=treble \notes\relative c''{
     cis'4()bis
     r8
     <a'8( a,> <gis gis,> <fis fis,> <gis gis,> <fis fis,> )e^" "^1^4^5 r|
-    r<a8( a,> <gis gis,> <fis fis,> <gis gis,> <fis fis,> )e r|
+    r <a8( a,> <gis gis,> <fis fis,> <gis gis,> <fis fis,> )e r|
+
+    \bar "||"
+
 }
 
 trebleTwo =  \context Voice=trebleTwo \notes\relative c''{
@@ -114,7 +108,7 @@ trebleTwo =  \context Voice=trebleTwo \notes\relative c''{
     s4
     \property Voice.Stem \revert #'direction
     \property Voice.Stem \override #'direction = #-1
-    <cis'4\arpeggio a fis dis>
+    <cis'4-\arpeggio a fis dis>
 
     \property Voice.NoteColumn \override #'force-hshift = #-0.2
     <e,2 gis, e d!>
@@ -132,6 +126,9 @@ trebleTwo =  \context Voice=trebleTwo \notes\relative c''{
 
 bass =  \context Voice=bass \notes\relative c{
     % Allow ugly slurs
+    \partial 2
+    \key a \major
+    
     \property Voice.Slur \override #'beautiful = #5.0
     \property Voice.Slur \override #'attachment-offset = #'((0 . 3) . (0 . -4))
     \property Voice.Stem \revert #'direction
@@ -147,7 +144,7 @@ bass =  \context Voice=bass \notes\relative c{
     \property Voice.Stem \revert #'direction
     \property Voice.Stem \override #'direction = #-1
     \property Voice.Slur \override #'attachment = #'(stem . stem)
-    <)a''4\arpeggio eis cis> 
+    <)a''4-\arpeggio eis cis> 
     %\stemBoth
     \property Voice.Slur \revert #'attachment
     % Huh, urg?  Implicit \context Staff lifts us up to Staff context???
@@ -171,7 +168,7 @@ bass =  \context Voice=bass \notes\relative c{
     \property Voice.Stem \revert #'length
     \property Voice.Stem \revert #'direction
     \property Voice.Stem \override #'direction = #-1
-    <)a'\arpeggio fis cis>
+    <)a'-\arpeggio fis cis>
     % Huh, urg?  Implicit \context Staff lifts us up to Staff context???
     \translator Staff=bass
     % Get back
@@ -189,7 +186,7 @@ bass =  \context Voice=bass \notes\relative c{
     \property Voice.Stem \override #'direction = #0
     <
         %urg: staff-change: ! on dis
-        <cis''\arpeggio a fis dis!>
+        <cis''-\arpeggio a fis dis!>
 %      { s8. \clef bass}
     >
 
@@ -258,52 +255,48 @@ middleDynamics =  \context Dynamics=middle \notes{
 lowerDynamics =  \context Dynamics=lower \notes{
     s2
     %2
-    s2\sustainDown s8. s16\sustainUp s4
+    s2-\sustainDown s8. s16-\sustainUp s4
     %3
-    s2\sustainDown s8. s16\sustainUp s4
+    s2-\sustainDown s8. s16-\sustainUp s4
     %3
 
-    s4\sustainDown s16
-    s32 s s\sustainUp s
-    s32\sustainDown s s s
+    s4-\sustainDown s16
+    s32 s s-\sustainUp s
+    s32-\sustainDown s s s
     s8
 
     \property Dynamics.pedalSustainStrings = #'("Ped." "*Ped." "")
-    s4 s16. s32\sustainUp
+    s4 s16. s32--\sustainUp
 
     %5
-    s8\sustainDown s s
+    s8-\sustainDown s s
     \property Dynamics.pedalSustainStrings = #'("Ped." "-P" "*")
-    s s\sustainUp\sustainDown s s
-    s\sustainUp
+    s s-\sustainUp-\sustainDown s s
+    s-\sustainUp
 
     %6
     \property Dynamics.pedalSustainStrings = #'("Ped." "*Ped." "")
-    s8\sustainDown s s
+    s8-\sustainDown s s
     \property Dynamics.pedalSustainStrings = #'("Ped." "-P" "*")
-    s s\sustainUp\sustainDown s s
-    s\sustainUp
+    s s-\sustainUp-\sustainDown s s
+    s-\sustainUp
 }
 
 \score{
     \context PianoStaff <
         \context Staff=treble <
-           \global
            \treble
            \trebleTwo
         >
        \context Dynamics=middle <
-           \global
            \middleDynamics
        >
         \context Staff=bass <
            \clef bass
-           \global
            \bass
            \bassTwo
         >
        \context Dynamics=lower <
-           \global
            \lowerDynamics
        >
     >
index 38d990c90a3bfa62da01025d089d22db7301738f..75539d4c18a7349b76c28ddab6369940fa026a7d 100644 (file)
@@ -152,20 +152,14 @@ trebleVerseOne =  \notes\relative c{
        r8 <f g b> <g b d> <f g b> <g b d> <f g b> |
        r8 <es g c> <g c es> <es g c> <g c es> <es g c> |
        <g''4.( b,> <)f8 d>
-       % manual beam override bug
-       %\times 2/3 { < [f( d> <es c> <)d b] > } |
        \times 2/3 < { [ f( es )d ] } { d c b } > |
        %10
        <c2. es> |
        r8 <g, c> <c es> <g c> <c es> <g c> |
        r8 <f c'> <c' d> <f, c'> <c' d> <f, c'> |
        r8 <f as bes> <as bes d> <f as bes> <as bes d> <f as bes> |
-       % manual beam override bug
-       % r8 < [ es g bes> <g bes es> <es g bes> <g bes es ] > 
        r8 < { [ es g es g ] } { g bes g bes } { bes es bes es } >
        <{ es'( )  d4.() f8}{ c' | bes4.  as8 } >
-       % manual beam override bug
-       % \times 2/3 { < [f( as> <es g> <)d f] > } |
        \times 2/3 < { [ f( es )d ] } { as' g f } > |
        %16
        <es2. g> |
index 166108f4ad16761db9964075775062dcc465b1d4..4d022cc0d74e28f5ba336783661d77a72768decc 100644 (file)
@@ -49,8 +49,8 @@ endcresc = \spanevent \stop "crescendo"
 %}
 
 % better name sustainstart/stop? 
-sustainUp = #(make-span-event 'SustainPedalEvent STOP)
-sustainDown = #(make-span-event 'SustainPedalEvent START)
+sustainUp = #(make-span-event 'SustainEvent STOP)
+sustainDown = #(make-span-event 'SustainEvent START)
 
 unaCorda = #(make-span-event 'UnaCordaEvent START)
 treCorde = #(make-span-event 'UnaCordaEvent STOP)
index 5f4a5e99687f9b86bc2c8c2f87179c74a8b19531..e4830dc527693a7b639e1d6aa4167eb07097b4ad 100644 (file)
@@ -421,7 +421,7 @@ is an articulation (such as @code{-.}, @code{->}, @code{\\tenuto},
        (internal-class-name . "Event")
        (types . (general-music event))
        )) 
-    (SustainPedalEvent
+    (SustainEvent
      . (
        (description . "")
        (internal-class-name . "Event")
index 0543fbf05d2e76e8cab9da7d0f784b918fc711db..00b50c3adda226c61a9e32d28a2346ca74abb76c 100644 (file)
@@ -1079,6 +1079,22 @@ if 1:
                str = re.sub (r'<<', '< <', str)
                str = re.sub (r'>>', '> >', str)
 
+               kws =   ['arpeggio',
+                        'sustainDown',
+                        'sustainUp',
+                        'f',
+                        'p',
+                        'pp',
+                        'ppp',
+                        'fp',
+                        'ff',
+                        'mf',
+                        'mp',
+                        'sfz',
+                        ]
+
+               origstr = string.join (kws, '|')
+               str = re.sub (r'([^-])\\(%s)\b' % origstr, r'\1-\\\2', str)
                return str
        
        conversions.append (((1,7,4), conv, '<< >> -> < <  > >'))