]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.5.2
authorfred <fred>
Wed, 27 Mar 2002 01:20:32 +0000 (01:20 +0000)
committerfred <fred>
Wed, 27 Mar 2002 01:20:32 +0000 (01:20 +0000)
19 files changed:
Documentation/topdocs/index.tely
input/GNUmakefile
input/ascii-art/GNUmakefile
input/template/GNUmakefile [new file with mode: 0644]
input/template/README [new file with mode: 0644]
input/template/melody-lyrics-chords.ly [new file with mode: 0644]
input/template/melody-lyrics.ly [new file with mode: 0644]
input/template/melody.ly [new file with mode: 0644]
input/template/piano-4-voices.ly [new file with mode: 0644]
input/template/piano-lyrics.ly [new file with mode: 0644]
input/template/piano-melody-lyrics.ly [new file with mode: 0644]
input/template/piano.ly [new file with mode: 0644]
input/test/chord-banter.ly [new file with mode: 0644]
input/test/title.ly
lily/chord.cc
lily/parser.yy
scm/chord-name.scm
scripts/lilypond-book.py
stepmake/bin/text2html.py

index a75fb37c1a3f50359d025423e9361964751ab47f..1b26344f9e21d23c780baa6d12275fd64a2dfe18 100644 (file)
@@ -7,7 +7,10 @@
 
 @html
 <p align=center>
-<img src="Documentation/pictures/out-www/lelie-logo.png" alt="[logo]">
+<a href="Documentation/pictures/out-www/lelie-logo.png">
+<img border=0 src="Documentation/pictures/out-www/lelie-logo.png"
+ alt="[picture of lily-cello-girl]">
+</a>
 @end html
 
 
index 3f3951d288085b9e7df790bc397c19526b2b130a..9cf5f1fd688588ad6a9bda0fc3d81d6d4ee7b575 100644 (file)
@@ -1,6 +1,6 @@
 depth = ..
 
-SUBDIRS=bugs test regression tutorial no-notation ascii-art
+SUBDIRS=bugs test regression tutorial no-notation ascii-art template
 
 # nereides is tweaked a lot, can't do (read webpage)
 examples=trip star-spangled-banner paddy twinkle #nereides
index 9c2b9f48fe6809a4c3508352db43adcc6be54aa7..516974621f73dd8a4ed41e47b7653ff07c6bacd5 100644 (file)
@@ -1,8 +1,5 @@
-# input/bugs/Makefile
-
 depth = ../..
 
 LOCALSTEPMAKE_TEMPLATES=ly mutopia
 include $(depth)/make/stepmake.make 
 
-
diff --git a/input/template/GNUmakefile b/input/template/GNUmakefile
new file mode 100644 (file)
index 0000000..cba7839
--- /dev/null
@@ -0,0 +1,7 @@
+depth = ../..
+
+LOCALSTEPMAKE_TEMPLATES=ly mutopia
+EXTRA_DIST_FILES=README
+
+include $(depth)/make/stepmake.make 
+
diff --git a/input/template/README b/input/template/README
new file mode 100644 (file)
index 0000000..b3c24f9
--- /dev/null
@@ -0,0 +1,57 @@
+
+* Mention this somewhere in documentation (Tutorial)
+
+* Better comment-out most header entries, or
+  move to template/title.ly altogether?
+
+* Naming conventions for voices/staffs
+  (think: \autochange, \partcombine)?
+
+* Add (commented-out) stuff like \time 3/4
+  \property Staff.TimeSignature \set #'style = #xxx?
+
+* Handy emacs shortcuts to (these) templates?
+
+* Mutopia headers?
+
+* Another approach would be to not include any music in the templates,
+  and standardise the naming of the music, so that you'd do:
+
+    title = 'Piano piece'
+    upper = \notes { ... }
+    lower = \notes { ... }
+
+    \include "template/piano.ly"
+
+  In this case, we'd also need one simple music example file per
+  template.  This approach can be even easier to use, but is not very
+  flexible, it only works for simple and uniform pieces.
+
+* Possibly some of you already have created something like this?  I was
+  thinking of having templates for:
+
+  single melody  = melody.ly
+  melody with lyrics = melody-lyrics.ly 
+  melody with lyrics and chords = melody-lyrics-chords.ly
+  piano = piano.ly
+  piano with several voices = piano-4-voices.ly
+  piano with lyrics (between staffs) = piano-lyrics.ly
+  piano with melody and lyrics = piano-melody-lyrics.ly
+
+TODO (Choral templates, anyone?)
+  piano with lyrics and chords
+  (string) duet 
+  (string) duet parts
+  string quartet
+  string quintet parts
+  orchestral score
+  orchestral parts
+  choral score
+  choral score with piano reduction (i.e., the piano staves have the
+          same notes as the choral parts)
+  choral score with piano accompaniment
+  choral parts
+
+
+
+
diff --git a/input/template/melody-lyrics-chords.ly b/input/template/melody-lyrics-chords.ly
new file mode 100644 (file)
index 0000000..80dcd6c
--- /dev/null
@@ -0,0 +1,45 @@
+\version "1.5.1"
+
+\header {
+  dedication = "dedication"
+  title = "Title"
+  subtitle = "Subtitle"
+  subsubtitle = "Subsubtitle"
+  composer = "Composer (xxxx-yyyy)"
+  opus = "Opus 0"
+  piece = "Piece I"
+  instrument = "Instrument"
+  arranger = "Arranger"
+  poet = "Poet"
+  texttranslator = "Translator"
+  copyright = "public domain"
+  enteredby = "jcn"
+  source =  "urtext"
+}
+
+melody = \notes \relative c' {
+  a b c d
+}
+
+text = \lyrics {
+  Aaa Bee Cee Dee
+}
+
+accompaniment = \chords {
+  a2: c2
+}
+
+\score {
+  <
+    \context ChordNames \accompaniment
+    \addlyrics
+      \context Staff = one {
+        \property Staff.noAutoBeaming = ##t
+        \property Staff.automaticMelismata = ##t
+        \melody
+      }
+      \context Lyrics \text
+  >
+  \paper { }
+  \midi  { }
+}
diff --git a/input/template/melody-lyrics.ly b/input/template/melody-lyrics.ly
new file mode 100644 (file)
index 0000000..613fa72
--- /dev/null
@@ -0,0 +1,40 @@
+\version "1.5.1"
+
+\header {
+  dedication = "dedication"
+  title = "Title"
+  subtitle = "Subtitle"
+  subsubtitle = "Subsubtitle"
+  composer = "Composer (xxxx-yyyy)"
+  opus = "Opus 0"
+  piece = "Piece I"
+  instrument = "Instrument"
+  arranger = "Arranger"
+  poet = "Poet"
+  texttranslator = "Translator"
+  copyright = "public domain"
+  enteredby = "jcn"
+  source =  "urtext"
+}
+
+melody = \notes \relative c'' {
+  a b c d
+}
+
+text = \lyrics {
+  Aaa Bee Cee Dee
+}
+
+\score {
+  <
+    \addlyrics
+      \context Staff = one {
+        \property Staff.noAutoBeaming = ##t
+        \property Staff.automaticMelismata = ##t
+        \melody
+      }
+      \context Lyrics \text
+  >
+  \paper { }
+  \midi  { }
+}
diff --git a/input/template/melody.ly b/input/template/melody.ly
new file mode 100644 (file)
index 0000000..8073941
--- /dev/null
@@ -0,0 +1,28 @@
+\version "1.5.1"
+
+\header {
+  dedication = "dedication"
+  title = "Title"
+  subtitle = "Subtitle"
+  subsubtitle = "Subsubtitle"
+  composer = "Composer (xxxx-yyyy)"
+  opus = "Opus 0"
+  piece = "Piece I"
+  instrument = "Instrument"
+  arranger = "Arranger"
+  poet = "Poet"
+  texttranslator = "Translator"
+  copyright = "public domain"
+  enteredby = "jcn"
+  source =  "urtext"
+}
+
+melody = \notes \relative c' {
+  a b c d
+}
+
+\score {
+  \context Staff \melody
+  \paper { }
+  \midi  { }
+}
diff --git a/input/template/piano-4-voices.ly b/input/template/piano-4-voices.ly
new file mode 100644 (file)
index 0000000..a5bfe1e
--- /dev/null
@@ -0,0 +1,55 @@
+\version "1.5.1"
+
+\header {
+  dedication = "dedication"
+  title = "Title"
+  subtitle = "Subtitle"
+  subsubtitle = "Subsubtitle"
+  composer = "Composer (xxxx-yyyy)"
+  opus = "Opus 0"
+  piece = "Piece I"
+  instrument = "Instrument"
+  arranger = "Arranger"
+  poet = "Poet"
+  texttranslator = "Translator"
+  copyright = "public domain"
+  enteredby = "jcn"
+  source =  "urtext"
+}
+
+upperOne = \notes\relative c'' {
+  \voiceOne
+  a b c d
+}
+
+upperTwo = \notes\relative c' {
+  \voiceTwo
+  a2 c
+}
+
+lowerOne = \notes\relative c {
+  \voiceOne
+  a2 c
+}
+
+lowerTwo = \notes\relative c {
+  \voiceTwo
+  a1
+}
+
+\score {
+  \context PianoStaff <
+    %\time 4/4
+    \context Staff = upper <
+      \context Voice = one \upperOne
+      \context Voice = two \upperTwo
+    >  
+    \context Staff = lower <
+      \clef bass
+      \context Voice = one \lowerOne
+      \context Voice = two \lowerTwo
+    >  
+  >
+  \paper { }  
+  \midi { }  
+}
\ No newline at end of file
diff --git a/input/template/piano-lyrics.ly b/input/template/piano-lyrics.ly
new file mode 100644 (file)
index 0000000..1d519ed
--- /dev/null
@@ -0,0 +1,54 @@
+\version "1.5.1"
+
+\header {
+  dedication = "dedication"
+  title = "Title"
+  subtitle = "Subtitle"
+  subsubtitle = "Subsubtitle"
+  composer = "Composer (xxxx-yyyy)"
+  opus = "Opus 0"
+  piece = "Piece I"
+  instrument = "Instrument"
+  arranger = "Arranger"
+  poet = "Poet"
+  texttranslator = "Translator"
+  copyright = "public domain"
+  enteredby = "jcn"
+  source =  "urtext"
+}
+
+upper = \notes\relative c'' {
+  a b c d
+}
+
+lower = \notes\relative c {
+  a2 c
+}
+
+text = \lyrics {
+  Aaa Bee Cee Dee
+}
+
+\score {
+  \context GrandStaff <
+    \addlyrics
+      \context Staff = upper \upper
+      \context Lyrics \text
+    \context Staff = lower <
+      \clef bass
+      \lower
+    >  
+  >
+  \paper {
+    \translator {
+      \GrandStaffContext
+      \accepts "Lyrics"
+    }
+    \translator {
+      %\LyricsVoiceContext
+      \LyricsContext
+      \consists "Bar_engraver"
+    }
+  }  
+  \midi { }  
+}
\ No newline at end of file
diff --git a/input/template/piano-melody-lyrics.ly b/input/template/piano-melody-lyrics.ly
new file mode 100644 (file)
index 0000000..a1c2c3e
--- /dev/null
@@ -0,0 +1,58 @@
+\version "1.5.1"
+
+\header {
+  dedication = "dedication"
+  title = "Title"
+  subtitle = "Subtitle"
+  subsubtitle = "Subsubtitle"
+  composer = "Composer (xxxx-yyyy)"
+  opus = "Opus 0"
+  piece = "Piece I"
+  instrument = "Instrument"
+  arranger = "Arranger"
+  poet = "Poet"
+  texttranslator = "Translator"
+  copyright = "public domain"
+  enteredby = "jcn"
+  source =  "urtext"
+}
+
+melody = \notes \relative c'' {
+  a b c d
+}
+
+text = \lyrics {
+  Aaa Bee Cee Dee
+}
+
+upper = \notes\relative c'' {
+  a b c d
+}
+
+lower = \notes\relative c {
+  a2 c
+}
+
+\score {
+  <
+    \addlyrics
+      \context Staff = mel {
+        \property Staff.noAutoBeaming = ##t
+        \property Staff.automaticMelismata = ##t
+        \melody
+      }
+      \context Lyrics \text
+
+    \context PianoStaff <
+      \context Staff = upper \upper
+      \context Staff = lower <
+       \clef bass
+       \lower
+      >
+    >
+  >
+  \paper {
+    \translator { \HaraKiriStaffContext }
+  }  
+  \midi { }  
+}
\ No newline at end of file
diff --git a/input/template/piano.ly b/input/template/piano.ly
new file mode 100644 (file)
index 0000000..497c8c2
--- /dev/null
@@ -0,0 +1,39 @@
+\version "1.5.1"
+
+\header {
+  dedication = "dedication"
+  title = "Title"
+  subtitle = "Subtitle"
+  subsubtitle = "Subsubtitle"
+  composer = "Composer (xxxx-yyyy)"
+  opus = "Opus 0"
+  piece = "Piece I"
+  instrument = "Instrument"
+  arranger = "Arranger"
+  poet = "Poet"
+  texttranslator = "Translator"
+  copyright = "public domain"
+  enteredby = "jcn"
+  source =  "urtext"
+}
+
+upper = \notes\relative c'' {
+  a b c d
+}
+
+lower = \notes\relative c {
+  a2 c
+}
+
+\score {
+  \context PianoStaff <
+    %\time 4/4
+    \context Staff = upper \upper
+    \context Staff = lower <
+      \clef bass
+      \lower
+    >  
+  >
+  \paper { }  
+  \midi { }  
+}
\ No newline at end of file
diff --git a/input/test/chord-banter.ly b/input/test/chord-banter.ly
new file mode 100644 (file)
index 0000000..74327da
--- /dev/null
@@ -0,0 +1,54 @@
+\version "1.3.146"
+\header{
+filename =     "chord-table.ly"
+copyright =    "public domain"
+enteredby =    "jcn"
+}
+
+tab =  \notes\transpose c'''\chords{
+       c1 c:m c:4 c:m4 c:5+ \break
+       c:5- c:dim c:5-.5+ c:6 c:m6\break
+       c:4.6 c:7 c:m7 c:4.7 c:m4.7\break
+       c:5+.7 c:5-.7 c:m5-.7 c:maj c:m.maj\break
+       c:4.maj c:m4.maj c:5+.maj c:m4+.maj c:5-.maj\break
+       c1:m5-.maj c:dim7 c:5-.5+.7 c:6.maj c:m6.maj\break
+       c:4.6.maj c:9 c:m9 c:4.9 c:m.4.9\break
+}
+
+\score{
+%      \context StaffGroup <
+        <
+               \context Staff=c \notes\transpose c\tab
+               \context ChordNames=c \notes\transpose c\tab
+%{             
+               \context Staff=cis \notes\transpose cis\tab
+               \context ChordNames=cis \notes\transpose cis\tab
+               \context Staff=des \notes\transpose des\tab
+               \context ChordNames=des \notes\transpose des\tab
+               \context Staff=d \notes\transpose d\tab
+               \context ChordNames=d \notes\transpose d\tab
+               \context Staff=es \notes\transpose es\tab
+               \context ChordNames=es \notes\transpose es\tab
+               \context Staff=e \notes\transpose e\tab
+               \context ChordNames=e \notes\transpose e\tab
+               \context Staff=fis \notes\transpose fis\tab
+               \context ChordNames=fis \notes\transpose fis\tab
+               \context Staff=g \notes\transpose g\tab
+               \context ChordNames=g \notes\transpose g\tab
+               \context Staff=as \notes\transpose as\tab
+               \context ChordNames=as \notes\transpose as\tab
+               \context Staff=a \notes\transpose a\tab
+               \context ChordNames=a \notes\transpose a\tab
+               \context Staff=bes \notes\transpose bes,\tab
+               \context ChordNames=bes \notes\transpose bes,\tab
+               \context Staff=b \notes\transpose b,\tab
+               \context ChordNames=b \notes\transpose b,\tab
+%}             
+       >
+       \paper{
+               textheight = \vsize - 4.0 * \staffheight
+       }
+
+}
+
+
index 176829a4c5dc31aa25cce0cdbab0589d077d1698..9ef39c0dc5fff35d907768d93158c5ffb29db3f4 100644 (file)
@@ -6,6 +6,7 @@
   subtitle = "Subtitle"
   subsubtitle = "Subsubtitle"
   composer = "Composer (xxxx-yyyy)"
+  instrument = "Instrument"
   arranger = "Arranger"
   poet = "Poet"
   % ugr: warning: Identifier name is a keyword: `translator'
@@ -14,7 +15,6 @@
   copyright = "public domain"
   enteredby = "jcn"
   source =  "urtext"
-  instrument = "Instrument"
 }
 
 \score {
index dd20c964eeb35c87b1bfc0d112d545bf0ccdf09a..233c5722d24e8f87d88227f257a56c85d6196b3f 100644 (file)
@@ -298,6 +298,10 @@ Chord::tonic_add_sub_to_pitches (SCM tonic, SCM add, SCM sub)
   for (SCM i = add; gh_pair_p (i); i = gh_cdr (i))
     {
       Pitch* p = unsmob_pitch (gh_car (i));
+      /* Ugr
+       This chord modifier stuff should really be fixed
+       Cmaj7 yields C 7/7-
+      */
       if (p->octave_i ()  == -100)
         {
           p->octave_i_ = 0;
@@ -322,7 +326,10 @@ Chord::tonic_add_sub_to_pitches (SCM tonic, SCM add, SCM sub)
   if (highest_step < 5)
     tmp = ly_snoc (fifth, tmp);
   else if (dim_b)
-    add = lower_step (tonic, add, gh_int2scm (5));
+    {
+      add = lower_step (tonic, add, gh_int2scm (5));
+      add = lower_step (tonic, add, gh_int2scm (7));
+    }
 
   /* find missing thirds */
   SCM missing = missing_thirds (tmp);
@@ -392,7 +399,7 @@ Chord::get_chord (SCM tonic, SCM add, SCM sub, SCM inversion, SCM bass, SCM dur)
          n->set_mus_property ("duration", dur);
          n->set_mus_property ("inversion", SCM_BOOL_T);
          list = gh_cons (n->self_scm (), list);
-         scm_unprotect_object (n->self_scm ());
+         scm_gc_unprotect_object (n->self_scm ());
        }
       else
        warning (_f ("invalid inversion pitch: not part of chord: %s",
@@ -407,7 +414,7 @@ Chord::get_chord (SCM tonic, SCM add, SCM sub, SCM inversion, SCM bass, SCM dur)
       n->set_mus_property ("duration", dur);
       n->set_mus_property ("bass", SCM_BOOL_T);
       list = gh_cons (n->self_scm (), list);
-      scm_unprotect_object (n->self_scm ());
+      scm_gc_unprotect_object (n->self_scm ());
     }
   
   for (SCM i = pitches; gh_pair_p (i); i = gh_cdr (i))
@@ -416,7 +423,7 @@ Chord::get_chord (SCM tonic, SCM add, SCM sub, SCM inversion, SCM bass, SCM dur)
       n->set_mus_property ("pitch", gh_car (i));
       n->set_mus_property ("duration", dur);
       list = gh_cons (n->self_scm (), list);
-      scm_unprotect_object (n->self_scm ());
+      scm_gc_unprotect_object (n->self_scm ());
     }
 
   Simultaneous_music*v = new Request_chord (SCM_EOL);
index 46db204f928cac7de02ca5a69e6dd5d7a3a99696..4f4747ab5a0d41edfd1ebe050219bb9203e54df6 100644 (file)
@@ -336,7 +336,7 @@ toplevel_expression:
        }
        | lilypond_header {
                if (global_header_p)
-                       scm_unprotect_object (global_header_p->self_scm ());
+                       scm_gc_unprotect_object (global_header_p->self_scm ());
                global_header_p = $1;
        }
        | score_block {
@@ -440,22 +440,22 @@ all objects can be unprotected as soon as they're here.
 identifier_init:
        score_block {
                $$ = $1->self_scm ();
-               scm_unprotect_object ($$);
+               scm_gc_unprotect_object ($$);
        }
        | output_def {
                $$ = $1->self_scm ();
-               scm_unprotect_object ($$);
+               scm_gc_unprotect_object ($$);
        }
        | translator_spec_block {
                $$ = $1;
        }
        | Music  {
                $$ = $1->self_scm ();
-               scm_unprotect_object ($$);
+               scm_gc_unprotect_object ($$);
        }
        | post_request {
                $$ = $1->self_scm ();
-               scm_unprotect_object ($$);
+               scm_gc_unprotect_object ($$);
        }
        | explicit_duration {
                $$ = $1;
@@ -555,7 +555,7 @@ score_body:
        
                $$->set_spot (THIS->here_input ());
                SCM m = $1->self_scm ();
-               scm_unprotect_object (m);
+               scm_gc_unprotect_object (m);
                $$->music_ = m;
        }
        | SCORE_IDENTIFIER {
@@ -563,7 +563,7 @@ score_body:
                $$->set_spot (THIS->here_input ());
        }
        | score_body lilypond_header    {
-               scm_unprotect_object ($2->self_scm ()); 
+               scm_gc_unprotect_object ($2->self_scm ()); 
                $$->header_p_ = $2;
        }
        | score_body output_def {
@@ -659,7 +659,7 @@ Music_list: /* empty */ {
        | Music_list Music {
                SCM s = $$;
                SCM c = gh_cons ($2->self_scm (), SCM_EOL);
-               scm_unprotect_object ($2->self_scm ()); /* UGH */
+               scm_gc_unprotect_object ($2->self_scm ()); /* UGH */
                if (gh_pair_p (gh_cdr (s)))
                        gh_set_cdr_x (gh_cdr (s), c); /* append */
                else
@@ -703,7 +703,7 @@ Repeated_music:
                if (beg)
                        {
                        r-> set_mus_property ("body", beg->self_scm ());
-                       scm_unprotect_object (beg->self_scm ());
+                       scm_gc_unprotect_object (beg->self_scm ());
                        }
                r->set_mus_property ("repeat-count", gh_int2scm (times >? 1));
 
@@ -711,9 +711,9 @@ Repeated_music:
                        {
                        alts->truncate (times);
                        r-> set_mus_property ("alternatives", alts->self_scm ());
-                       scm_unprotect_object (alts->self_scm ());  
+                       scm_gc_unprotect_object (alts->self_scm ());  
                        }
-               SCM func = scm_eval2 (ly_symbol2scm ("repeat-name-to-ctor"), SCM_EOL);
+               SCM func = scm_primitive_eval (ly_symbol2scm ("repeat-name-to-ctor"));
                SCM result = gh_call1 (func, $2);
 
                set_music_properties (r, result);
@@ -787,7 +787,7 @@ Composite_music:
        CONTEXT STRING Music    {
                Context_specced_music *csm =  new Context_specced_music (SCM_EOL);
                csm->set_mus_property ("element", $3->self_scm ());
-               scm_unprotect_object ($3->self_scm ());
+               scm_gc_unprotect_object ($3->self_scm ());
 
                csm->set_mus_property ("context-type",$2);
                csm->set_mus_property ("context-id", ly_str02scm (""));
@@ -799,7 +799,7 @@ Composite_music:
                chm->set_mus_property ("element", $3->self_scm ());
                chm->set_mus_property ("iterator-ctor", Auto_change_iterator::constructor_cxx_function);
 
-               scm_unprotect_object ($3->self_scm ());
+               scm_gc_unprotect_object ($3->self_scm ());
                chm->set_mus_property ("what", $2); 
 
                $$ = chm;
@@ -821,14 +821,14 @@ Composite_music:
                if (stopm) {
                        stopm = stopm->clone ();
                        ms = gh_cons (stopm->self_scm (), ms);
-                       scm_unprotect_object (stopm->self_scm ());
+                       scm_gc_unprotect_object (stopm->self_scm ());
                }
                ms = gh_cons ($2->self_scm (), ms);
-               scm_unprotect_object ($2->self_scm());
+               scm_gc_unprotect_object ($2->self_scm());
                if (startm) {
                        startm = startm->clone ();
                        ms = gh_cons (startm->self_scm () , ms);
-                       scm_unprotect_object (startm->self_scm ());
+                       scm_gc_unprotect_object (startm->self_scm ());
                }
 
                Music* seq = new Sequential_music (SCM_EOL);
@@ -836,11 +836,11 @@ Composite_music:
 
                $$ = new Grace_music (SCM_EOL);
                $$->set_mus_property ("element", seq->self_scm ());
-               scm_unprotect_object (seq->self_scm ());
+               scm_gc_unprotect_object (seq->self_scm ());
 #else
                $$ = new Grace_music (SCM_EOL);
                $$->set_mus_property ("element", $2->self_scm ());
-               scm_unprotect_object ($2->self_scm ());
+               scm_gc_unprotect_object ($2->self_scm ());
 #endif
 
 
@@ -848,7 +848,7 @@ Composite_music:
        | CONTEXT string '=' string Music {
                Context_specced_music *csm =  new Context_specced_music (SCM_EOL);
                csm->set_mus_property ("element", $5->self_scm ());
-               scm_unprotect_object ($5->self_scm ());
+               scm_gc_unprotect_object ($5->self_scm ());
 
                csm->set_mus_property ("context-type", $2);
                csm->set_mus_property ("context-id", $4);
@@ -869,7 +869,7 @@ Composite_music:
 
 
                $$->set_mus_property ("element", mp->self_scm ());
-               scm_unprotect_object (mp->self_scm ());
+               scm_gc_unprotect_object (mp->self_scm ());
                $$->set_mus_property ("numerator", gh_int2scm (n));
                $$->set_mus_property ("denominator", gh_int2scm (d));
                $$->compress (Moment (n,d));
@@ -885,7 +885,7 @@ Composite_music:
 
                p->transpose (pit);
                $$->set_mus_property ("element", p->self_scm ());
-               scm_unprotect_object (p->self_scm ());
+               scm_gc_unprotect_object (p->self_scm ());
        }
        | TRANSPOSE steno_tonic_pitch Music {
                $$ = new Transposed_music (SCM_EOL);
@@ -894,7 +894,7 @@ Composite_music:
 
                p->transpose (pit);
                $$->set_mus_property ("element", p->self_scm ());
-               scm_unprotect_object (p->self_scm ());
+               scm_gc_unprotect_object (p->self_scm ());
        
        }
        | APPLY embedded_scm Music  {
@@ -941,7 +941,7 @@ relative_music:
                $$ = new Relative_octave_music (SCM_EOL);
 
                $$->set_mus_property ("element", p->self_scm ());
-               scm_unprotect_object (p->self_scm ());
+               scm_gc_unprotect_object (p->self_scm ());
 
                $$->set_mus_property ("last-pitch", p->to_relative_octave (pit).smobbed_copy ());
 
@@ -953,8 +953,8 @@ re_rhythmed_music:
          Lyric_combine_music * l = new Lyric_combine_music (SCM_EOL);
          l->set_mus_property ("music", $2->self_scm ());
          l->set_mus_property ("lyrics", $3->self_scm ());
-         scm_unprotect_object ($3->self_scm ());
-         scm_unprotect_object ($2->self_scm ());
+         scm_gc_unprotect_object ($3->self_scm ());
+         scm_gc_unprotect_object ($2->self_scm ());
          $$ = l;
        }
        ;
@@ -967,8 +967,8 @@ part_combined_music:
                p->set_mus_property ("one", $3->self_scm ());
                p->set_mus_property ("two", $4->self_scm ());  
 
-               scm_unprotect_object ($3->self_scm ());
-               scm_unprotect_object ($4->self_scm ());  
+               scm_gc_unprotect_object ($3->self_scm ());
+               scm_gc_unprotect_object ($4->self_scm ());  
 
 
                $$ = p;
@@ -995,7 +995,7 @@ property_def:
                Context_specced_music *csm = new Context_specced_music (SCM_EOL);
 
                csm->set_mus_property ("element", t->self_scm ());
-               scm_unprotect_object (t->self_scm ());
+               scm_gc_unprotect_object (t->self_scm ());
 
                $$ = csm;
                $$->set_spot (THIS->here_input ());
@@ -1011,7 +1011,7 @@ property_def:
 
                Context_specced_music *csm = new Context_specced_music (SCM_EOL);
                csm->set_mus_property ("element", t->self_scm ());
-               scm_unprotect_object (t->self_scm ());
+               scm_gc_unprotect_object (t->self_scm ());
 
                $$ = csm;
                $$->set_spot (THIS->here_input ());
@@ -1028,7 +1028,7 @@ property_def:
                t->set_mus_property ("grob-value", $8);
                Context_specced_music *csm = new Context_specced_music (SCM_EOL);
                csm->set_mus_property ("element", t->self_scm ());
-               scm_unprotect_object (t->self_scm ());
+               scm_gc_unprotect_object (t->self_scm ());
                $$ = csm;
                $$->set_spot (THIS->here_input ());
 
@@ -1043,7 +1043,7 @@ property_def:
                t->set_mus_property ("grob-value", $8);
                Context_specced_music *csm = new Context_specced_music (SCM_EOL);
                csm->set_mus_property ("element", t->self_scm ());
-               scm_unprotect_object (t->self_scm ());
+               scm_gc_unprotect_object (t->self_scm ());
 
                $$ = csm;
                $$->set_spot (THIS->here_input ());
@@ -1059,7 +1059,7 @@ property_def:
 
                Context_specced_music *csm = new Context_specced_music (SCM_EOL);
                csm->set_mus_property ("element", t->self_scm ());
-               scm_unprotect_object (t->self_scm ());
+               scm_gc_unprotect_object (t->self_scm ());
 
                $$ = csm;
                $$->set_spot (THIS->here_input ());
@@ -1104,7 +1104,7 @@ command_element:
 
                Context_specced_music *csm = new Context_specced_music (SCM_EOL);
                csm->set_mus_property ("element", t->self_scm ());
-               scm_unprotect_object (t->self_scm ());
+               scm_gc_unprotect_object (t->self_scm ());
 
                $$ = csm;
                $$->set_spot (THIS->here_input ());
@@ -1117,13 +1117,13 @@ command_element:
 
                Context_specced_music * sp = new Context_specced_music (SCM_EOL);
                sp->set_mus_property ("element", p->self_scm ());
-               scm_unprotect_object (p->self_scm ());
+               scm_gc_unprotect_object (p->self_scm ());
 
                $$ =sp ;
                sp-> set_mus_property ("context-type", ly_str02scm ( "Score"));
        }
        | CLEF STRING  {
-               SCM func = scm_eval2 (ly_symbol2scm ("clef-name-to-properties"), SCM_EOL);
+               SCM func = scm_primitive_eval (ly_symbol2scm ("clef-name-to-properties"));
                SCM result = gh_call1 (func, $2);
 
                SCM l = SCM_EOL;
@@ -1131,14 +1131,14 @@ command_element:
                        Music * p = new Music (SCM_EOL);
                        set_music_properties (p, gh_car (s));
                        l = gh_cons (p->self_scm (), l);
-                       scm_unprotect_object (p->self_scm ());
+                       scm_gc_unprotect_object (p->self_scm ());
                }
                Sequential_music * seq = new Sequential_music (SCM_EOL);
                seq->set_mus_property ("elements", l);
 
                Context_specced_music * sp = new Context_specced_music (SCM_EOL);
                sp->set_mus_property ("element", seq->self_scm ());
-               scm_unprotect_object (seq->self_scm ());
+               scm_gc_unprotect_object (seq->self_scm ());
 
                $$ =sp ;
                sp-> set_mus_property ("context-type", ly_str02scm ("Staff"));
@@ -1166,10 +1166,10 @@ command_element:
 
                
 
-               scm_unprotect_object (p3->self_scm ());
-               scm_unprotect_object (p2->self_scm ());
-               scm_unprotect_object (p1->self_scm ());
-               scm_unprotect_object (seq->self_scm ());
+               scm_gc_unprotect_object (p3->self_scm ());
+               scm_gc_unprotect_object (p2->self_scm ());
+               scm_gc_unprotect_object (p1->self_scm ());
+               scm_gc_unprotect_object (seq->self_scm ());
 
                $$ = sp;
 
@@ -1825,10 +1825,11 @@ chord_step:
                $$ = gh_cons ($1, SCM_EOL);
        }
        | CHORDMODIFIER_PITCH {
-               $$ = gh_cons ($1, SCM_EOL);
+               $$ = gh_cons (unsmob_pitch ($1)->smobbed_copy (), SCM_EOL);
        }
        | CHORDMODIFIER_PITCH chord_note { /* Ugh. */
-               $$ = gh_list ($1, $2, SCM_UNDEFINED);
+               $$ = gh_list (unsmob_pitch ($1)->smobbed_copy (),
+                       $2, SCM_UNDEFINED);
        }
        ;
 
@@ -1959,7 +1960,7 @@ string:
                $$ = $1;
        }
        | string '+' string {
-               $$ = scm_string_append (scm_listify ($1, $3, SCM_UNDEFINED));
+               $$ = scm_string_append (scm_list_n ($1, $3, SCM_UNDEFINED));
        }
        ;
 
index 98a92708750095693e34a96c3b0568ce404ce7de..004aededa266461b6e0171626f8d5b80a3df96a9 100644 (file)
        (((0 . 0) (3 . 0) (4 . 0)) . ("" (super "4") " " ))
        ;; Cdim iso Cm5-
        (((0 . 0) (2 . -1) (4 . -1)) . ("dim"))
-       ; Co iso Cm5-7-
+       ; URG: Simply C:m5-/maj7 iso Cdim maj7
+       (((0 . 0) (2 . -1) (4 . -1) (6 . 0)) . ("m" (super "5-/maj7" " ")))
+       ; URG: Simply C:m5-/7 iso Cdim7
+       (((0 . 0) (2 . -1) (4 . -1) (6 . -1)) . ("m" (super "5-/7" " ")))
+       ; Co iso C:m5-/7-
         (((0 . 0) (2 . -1) (4 . -1) (6 . -2)) . ("" (super "o") " "))
        ; Cdim9
        (((0 . 0) (2 . -1) (4 . -1) (6 . -2) (1 . -1)) . ("dim" (super "9") " "))
    * TODO: any uneven step that's lower than an uneven step which is
      chromatically altered
   "
-  (write-me "adds: " 
   (let ((evens (filter-list (lambda (x) (!= 0 (modulo (cadr x) 2))) steps))
        (altered-unevens
         (filter-list (lambda (x)
                       '()))))
     ;; Hmm, what if we have a step twice, can we ignore that?
     (uniq-list (sort (apply append evens altered-unevens highest)
-                    pitch::<)))))
+                    pitch::<))))
        
      
 ;; FIXME: unLOOP, see ::additions
 ;; find the pitches that are missing from `normal' chord
 (define (chord::subtractions chord-pitches)
-  (write-me "subs: " (let ((tonic (car chord-pitches)))
+  (let ((tonic (car chord-pitches)))
     (let loop ((step 1) (pitches chord-pitches) (subtractions '()))
       (if (pair? pitches)
        (let* ((pitch (car pitches))
            (if (= p-step step)
              (loop (+ step 2) (cdr pitches) subtractions)
              (loop step (cdr pitches) subtractions)))))
-       (reverse subtractions))))))
+       (reverse subtractions)))))
 
 (define (chord::additions->text-banter additions subtractions)
   (if (pair? additions)
 ;; additions, subtractions and bass or inversion into chord name
 (define (chord::inner-name-banter tonic exception-part additions subtractions
                                  bass-and-inversion steps)
-  (let ((tonic-text (pitch->chord-name-text-banter tonic steps))
-       (except-text exception-part)
-       (sep-text (if (and (string-match "super" (format "~s" exception-part))
+  (let* ((tonic-text (pitch->chord-name-text-banter tonic steps))
+        (except-text exception-part)
+        (sep-text (if (and (string-match "super" (format "~s" except-text))
                            (or (pair? additions)
                                (pair? subtractions)))
                       (list simple-super "/")))
-       (adds-text (chord::additions->text-banter additions subtractions))
-       (subs-text (chord::subtractions->text-banter subtractions))
-       (b+i-text (chord::bass-and-inversion->text-banter bass-and-inversion)))
+        (adds-text (chord::additions->text-banter additions subtractions))
+        (subs-text (chord::subtractions->text-banter subtractions))
+        (b+i-text (chord::bass-and-inversion->text-banter bass-and-inversion)))
     (text-append
-     tonic-text except-text sep-text
-     (list (list simple-super) adds-text subs-text)
+     tonic-text except-text " " sep-text
+     ;;(list (list simple-super) adds-text subs-text)
+     (list (list '((raise . 1) (font-relative-size . -1))) adds-text subs-text)
      b+i-text)))
 
 (define (chord::name-banter tonic exception-part unmatched-steps
                              bass-and-inversion steps)))
 
 (define (chord::restyle name style)
-  (ly-eval (string->symbol
+  (primitive-eval (string->symbol
            (string-append (symbol->string name)
                           (symbol->string style)))))
 
 ;; return (MATCHED-EXCEPTION . BASE-CHORD-WITH-UNMATCHED-STEPS)
 ;; BASE-CHORD-WITH-UNMATCHED-STEPS always includes (tonic 3 5)
 (define (chord::exceptions-lookup style steps)
-  (write-me "xl: " (let* ((result (chord::exceptions-lookup-helper
+  (let* ((result (chord::exceptions-lookup-helper
                  (chord::restyle 'chord::names-alist- style)
                  steps '() #f))
           (exception-part (car result))
                        ((= i 0) base)
                      ())
                    unmatched-steps)))
-    (list exception-part unmatched-with-1-3-5))))
+    (list exception-part unmatched-with-1-3-5)))
 
 
 (define (chord::name->text style tonic steps bass-and-inversion)
index e4efd1652a2ce5353b791c0201e10797bff20007..e70fe1037f794e1f09e48356abb687e771466f4c 100644 (file)
@@ -401,7 +401,9 @@ output_dict= {
 @end tex
 @html
 <p>
-<img src="%(fn)s.png" alt="">
+<a href="%(fn)s.png">
+<img border=0 src="%(fn)s.png" alt="[picture of music]">
+</a>
 @end html
 """,
                }
index b7f9c922c2ef2eaef1fe893a2defd45d19da3e34..c2424deebae123b816f415ddd9223a9a4bf4589b 100644 (file)
@@ -1,8 +1,24 @@
 #@PYTHON@
 import os
+import re
 import string
 import sys
 
+
+entities = {
+       "&" : 'amp',
+       "`" : 'apos',
+       '>' : 'gt',
+       '<' : 'lt',
+       '"' : 'quot',
+       }
+
+def txt2html (s):
+       for i in entities.keys ():
+               s = re.sub (i, '\001' + entities[i] + ';', s);
+       s = re.sub ('\001', '&', s);
+       return s
+
 for a in sys.argv[1:]:
        # hmm, we need: text2html out/foe.txt -> out/foe.html,
        # -o is a bit overkill?
@@ -18,7 +34,7 @@ for a in sys.argv[1:]:
 <html><body><pre>
 %s
 </pre></body></html>
-""" % open (a).read ()
+""" % txt2html (open (a).read ())
        open (outfile, 'w').write (s)