]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.1.27.jcn3: geen genade
authorJan Nieuwenhuizen <janneke@gnu.org>
Sun, 7 Feb 1999 19:15:41 +0000 (20:15 +0100)
committerJan Nieuwenhuizen <janneke@gnu.org>
Sun, 7 Feb 1999 19:15:41 +0000 (20:15 +0100)
pl 27.jcn3
- bf's: zero-length repeats
- Auto beamer:
  * turned on by default
  * input/test/auto-beam*.ly
  * support for time-defaults
- Chords:
  * input/just-friends.ly
  * ChordNameContext
  * bf's: chord mode: accept STRINGS, rests
  * bf's: banter_str
- new bool \property Score.barAtLineStart

28 files changed:
Documentation/tex/tutorial.yo
NEWS
VERSION
input/bugs/time-grouping.ly [new file with mode: 0644]
input/just-friends.ly [new file with mode: 0644]
input/opus-130.ly
input/star-spangled-banner.ly
input/test/auto-beam-override.ly [new file with mode: 0644]
input/test/auto-beam.ly
lily/auto-beam-engraver.cc
lily/bar-engraver.cc
lily/bar.cc
lily/chord.cc
lily/include/bar.hh
lily/include/chord.hh
lily/lexer.ll
lily/repeat-engraver.cc
ly/auto-beam.ly [new file with mode: 0644]
ly/engraver.ly
ly/property.ly
mutopia/E.Satie/petite-ouverture-a-danser.ly
mutopia/J.S.Bach/Petites-Preludes/preludes-1.ly
mutopia/J.S.Bach/Petites-Preludes/preludes-2.ly
mutopia/J.S.Bach/Petites-Preludes/preludes-4.ly
mutopia/J.S.Bach/Petites-Preludes/preludes-5.ly
mutopia/J.S.Bach/Petites-Preludes/preludes-6.ly
mutopia/J.S.Bach/Solo-Cello-Suites/scs-paper.ly
mutopia/J.S.Bach/wtk1-fugue2.ly

index 25f8d74ea662a8daa4952c0c25dfef831313baf4..69545dfc7b1d374dedd76721fa4c1d4e84ebaed8 100644 (file)
@@ -98,16 +98,16 @@ mudela(verbatim)(
            \time 3/4;          
 
        \repeat 2 {
-           d4 [g,8 a b c] d4 g, g |
-           e'4 [c8 d e fis] g4 g, g |
-           c4 [d8( )c b a( ] )b4 [c8 b a g] |
-           a4 [b8 a g fis] g2.  |
+           d4 g,8 a b c d4 g, g |
+           e'4 c8 d e fis g4 g, g |
+           c4 d8( )c b a( )b4 c8 b a g |
+           a4 b8 a g fis g2.  |
        }
 
-        b'4 [g8 a b g]
-        a4 [d,8 e fis d] |
-        g4 [e8 fis g d] cis4 [b8 cis] a4 |
-        [a8-. b-. cis-. d-. e-. fis-. ] 
+        b'4 g8 a b g
+        a4 d,8 e fis d |
+        g4 e8 fis g d cis4 b8 cis a4 |
+        a8-. b-. cis-. d-. e-. fis-.
         g4 fis e |
         fis a,  r8 cis8
         d2.-\fermata
@@ -223,16 +223,6 @@ verb(
 code(c''), the real pitch of this note is code(d'').  The 4 
 designates the duration of the note (it is a quarter note). COMMENT(
 
-)verb(
-        [g,8
-)COMMENT(
-
-)The open bracket starts a beam.  Lily can set beams automatically,
-but we want to specify them ourselves.  This bracket is connected to the
-following note, which is an eighth with pitch code(g') (remember
-relative mode for pitches!)
-COMMENT(
-
 )verb(
         a b
 )COMMENT(
@@ -242,16 +232,6 @@ duration is the same as the code(g), there is no need to enter the
 duration (It is not illegal to enter it anyway.  You would then enter
 code(a8 b8)) COMMENT(
 
-)verb(
-          c]
-) COMMENT(
-
-) This ends the beam started four notes earlier, at the code(g).  In
-the output, you will notice a measure bar following this note.  You do
-not have to enter anything to make LilyPond create a bar.  Instead
-Lily will deduce where bars have to be by comparing durations of notes with
-the current time signature.  COMMENT(
-
 )verb(
           d4 g, g |
 ) COMMENT(
@@ -260,7 +240,7 @@ the current time signature.  COMMENT(
 music, LilyPond will check  that barchecks are found at the start of
 a bar.  This can help you track down notes you forgot to enter. 
 verb(
-        e'4 [c8 d e fis]
+        e'4 c8 d e fis
 ) COMMENT(
 
 ) So far, no notes were chromatically altered.  Here is the first one
@@ -269,17 +249,16 @@ that is: code(fis). Mudela by default uses Dutch note names, and
 sharp sign in the output. The program keeps track of key signatures,
 and will only print accidentals if they are needed.
 verb(
-        c4 [d8( )c b a( ] )b4 [c8 b a g] |
+        c4 d8( )c b a( )b4 c8 b a g |
 ) COMMENT(
 
 ) The next line shows something new: In mudela, one enters a slur by
 marking the beginning and ending note of the slur with an opening and
 closing parenthesis respectively.  In the line shown above this is
 done for two slurs.  Note that parentheses (slur markers) are between
-the notes, and the brackets (beam markers) around the notes. As you
-can see, the brackets and parentheses do not have to nest.
+the notes.  As you can see, parentheses do not have to nest.
 verb(
-        a4 [b8 a g fis] g2.  |
+        a4 b8 a g fis g2.  |
 ) COMMENT(
 
 ) A duration that is to be augmented with a duration dot, is notated
@@ -291,14 +270,14 @@ verb(
 
 ) The end of the repeated music.  LilyPond will typset a repeat bar.
 verb(
-     cis'4 [b8 cis] a4 |
+     cis'4 b8 cis a4 |
 ) COMMENT(
 
 ) This line shows that Lily will print an accidental if that is
 needed: the first C sharp will be printed with an accidental, the
 second one without.  COMMENT(
 
-)verb( [a8-. b-. cis-. d-. e-. fis-. ] % try some super and subscripts.)COMMENT(
+)verb( a8-. b-. cis-. d-. e-. fis-. % try some super and subscripts.)COMMENT(
 
 )There is more to music than just pitches and rhythms.  An important
 aspect is articulation.  You can enter articulation signs either in an
@@ -1256,7 +1235,10 @@ perfor0mable: COMMENT(
 
 )mudela(fragment,verbatim)(
   <
-    \type Staff  { c''8. c''16 bes'8. a'16 g'4 f'8 g'4. }
+    \type Staff  { 
+      \property Voice.beamAuto = "0" % no beams in melody
+      c''8. c''16 bes'8. a'16 g'4 f'8 g'4. 
+    }
     \type Lyrics \lyrics { 'got8. me16 on8. my16 knees,4 Le-8 lie!4. }
   >
 ) COMMENT(
@@ -1276,7 +1258,10 @@ urg
 )COMMENT(
 
 )mudela(fragment,verbatim)(<
-  \type Staff  { c''8. c''16 bes'8. a'16 g'4 f'8 g'4. }
+  \type Staff  { 
+    \property Voice.beamAuto = "0" % no beams in melody
+    c''8. c''16 bes'8. a'16 g'4 f'8 g'4. 
+  }
   \type Lyrics \lyrics { 'got8 me8 on8. m$\cal_Y$16 "3s,"4 Le-8 lie!4.}
 >
 )COMMENT(
@@ -1684,9 +1669,14 @@ COMMENT(
 
 Of course, you can also use different ratios, and use beamed notes or
 rests:
+COMMENT( BROKEN
+
+lilypond: score-element.cc:134: class Paper_def * Score_element::paper() const: Assertion `pscore_l_' failed.
+
 mudela(fragment)(
        \type Voice \times 4/5 { [c''8 c''16 c''16] r8 [g'8 g'8] }
 )
+)
 If you make a tuplet of  beamed notes, where the beam is as wide as
 the bracket, the bracket is omitted.
 
diff --git a/NEWS b/NEWS
index 6e5bc437317e6684f32f333b8012a90166fefb00..8faa209c890dfcf57e25c3f0b7987d8ceed6e642 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,16 @@
+pl 27.jcn3
+       - bf's: zero-length repeats
+       - Auto beamer:
+         * turned on by default
+         * input/test/auto-beam*.ly
+         * support for time-defaults
+       - Chords:
+         * input/just-friends.ly
+         * ChordNameContext
+         * bf's: chord mode: accept STRINGS, rests
+         * bf's: banter_str
+       - new bool \property Score.barAtLineStart
+
 pl 27.jcn2
        - grand renaming: Duration vs Moment / Rational
 
diff --git a/VERSION b/VERSION
index 690b6a39317aa6cd9fb798aef2429a32908b2179..473f3f5b37934f6c518b36bf8968409880ad39c2 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=1
 PATCH_LEVEL=27
-MY_PATCH_LEVEL=jcn2
+MY_PATCH_LEVEL=jcn3
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
diff --git a/input/bugs/time-grouping.ly b/input/bugs/time-grouping.ly
new file mode 100644 (file)
index 0000000..b0cc682
--- /dev/null
@@ -0,0 +1,16 @@
+%{
+  wierd grouping bug
+%}
+
+\score{
+    \notes \relative c''{
+       % be sure it's not related to auto-beamer
+       \property Voice.beamAuto = "0"
+       \time 1/2;
+       [ c8 c c c ]
+       \time 1/4;
+       [ c8 c ]
+    }
+    \paper{
+    }
+}
diff --git a/input/just-friends.ly b/input/just-friends.ly
new file mode 100644 (file)
index 0000000..8082c7b
--- /dev/null
@@ -0,0 +1,58 @@
+\header {
+  filename =    "just-friends.ly";
+  title =       "Just Friends";
+  description = "Jazz chords example with bar lines";
+  opus =        "";
+  source =      "mutex@gmd.de";
+  composer =    "";
+  enteredby =   "jcn";
+  copyright =   "Public Domain";
+}
+
+%{
+In response to
+
+Message-Id: <19990206153950.A7474@gil.physik.rwth-aachen.de>
+Date: Sat, 6 Feb 1999 15:39:50 +0100
+From: Christoph Kukulies <kuku@gilberto.physik.RWTH-Aachen.DE>
+Subject: chord bars
+
+I was looking out for a FAQ on the www.gmd.de/Misc/Music page but didn't
+find any so bear with me when asking a FAQ question:
+
+I want to generate some sheets that contain only the chords (changes)
+of a certain tune (Jazz, Real Book, for example), like
+
+              Just Friends
+
+[...]
+
+%}
+
+\score{
+       \type ChordNames \chords{
+               \property Score.chordInversion = 1
+               \property Score.barAtLineStart = 1
+               \repeat 2 {
+                       f1-maj f-maj f-7 bes-7
+                       c-maj c-maj es es
+                       d-7 g-7 b2-7/fis e-7 a1-7\break
+                       d-7 d-7 d-7 g2-7 ges-7
+
+                       f1-maj f1-maj f-7 bes-7
+                       c-maj c-maj es es
+                       d-7 g-7 b2-7/fis e-7 a1-7\break
+                       d-7 d2-7 g-7 c1-6 g2-7 c-7
+               }
+       }
+       \paper{
+               indent = 0.0\mm;
+               linewidth = 100.0\mm;
+               \translator{
+                       \ChordNameContext
+                       barAuto = "1";
+                       \consists Bar_engraver;
+                       \consists "Repeat_engraver";
+               }
+       }
+}
index 0bb12e66c0920e88a95a60ea593293292dea843c..bd01cf52e2f1cd902630f1f6c35c12a11e16ac30 100644 (file)
@@ -63,12 +63,6 @@ cello = \notes\relative c'{
        >
        \paper{
                \translator { \OrchestralScoreContext }
-               \translator {
-                       \VoiceContext
-                       \consists Auto_beam_engraver;
-                       beamAuto = 1.;
-                       beamAutoEnd = "3/8";
-               }
        }
        \midi{ \tempo 4 = 160; }
 }
index d05c396cfa5beea4a2a93ef7ff8cf32221a18730..f5b05d1e3525efd6e602df580337f680451ced1a 100644 (file)
@@ -114,13 +114,6 @@ global = \notes {
                \translator {
                        \BarNumberingStaffContext
                }
-               \translator{
-                       \VoiceContext
-                       \consists Auto_beam_engraver;
-                       beamAuto = 1.;
-                       beamAutoEnd8 = "1/4";
-                       beamAutoEnd16 = "1/4";
-               }
        }
 }
 
diff --git a/input/test/auto-beam-override.ly b/input/test/auto-beam-override.ly
new file mode 100644 (file)
index 0000000..ad378a5
--- /dev/null
@@ -0,0 +1,38 @@
+%{
+  Currently (1.1.27.jcn3), the auto-beam engraver will only engrave
+  sensible beams, which means that it will end a beam when:
+    * a rest is encountered
+    * another beam (entered manually) is encountered
+    * there's a 'gap' in the beam note's durations
+
+  The beam will be ended also when
+
+    now / beamAutoEnd = 0
+%}
+       
+\score{
+    \notes \relative c''{
+       \time 2/4;
+       % one beam per measure
+       c8 c c c
+       c16 c c c c c c c
+       % from here on consider ending beam every 1/4 note
+       \property Voice.beamAutoEnd = "1/4"
+       c8 c c c
+       % manually override autobeam with weird beaming
+       c8 [c c] c
+       c8 c c r
+       c8 c c4
+       r8 c c c
+       % no autobeaming
+       \property Voice.beamAuto = "0"
+       c8 c c c
+    }
+    \paper{
+       \translator{
+           \VoiceContext
+           % consider ending beam at every 1/2 note
+           beamAutoEnd = "1/2";
+       }
+    }
+}
index 02e7711dbad2e7d2764ed592cab0fb2ed1d74b4e..6839be66002153275db80220a48ff497bfbcd6df 100644 (file)
@@ -1,49 +1,62 @@
 %{
-  Currently (1.1.22.jcn5), the auto-beam engraver will only engrave
-  sensible beams (hopefully), which means that it will give up the
-  whole beam if:
-    * a rest is encountered
-    * another beam (entered manually) is encountered
-    * there's a 'gap' in the beam note's durations
-
-  There's no smart algorithm, beginning a beam is considered when
-   
-    now / beamAutoBegin = 0
-
-  the beam will be ended when
-
-    * now / beamAutoEnd = 0
+  The auto-beam engraver has presets for common time signatures.
 %}
-       
+
 \score{
     \notes \relative c''{
-       \time 2/4;
-       % one beam per measure
-       c8 c c c
-       c16 c c c c c c c
-       % from here on two beams per measure
-       \property Voice.beamAutoEnd = "1/4";
-       c8 c c c
-       % manually override autobeam with weird beaming
-       c8 [c c] c
-       c8 c c r
-       c8 c c4
-       r8 c c c
-       % no autobeaming
-       \property Voice.beamAuto = "0"
-       c8 c c c
+%{
+       % urg: something breaks in grouping ; see input/bugs/time-grouping.ly
+       \time 1/2;
+       c8 c c c
+       c16 c c c c c c c
+       c32 c c c c c c c c c c c c c c c
+       \time 1/4;
+       c8 c 
+       c16 c c c
+       c32 c c c c c c c
+       \time 1/8;
+       c8
+       c16 c
+       c32 c c c
+%}
+       \time 2/2;
+       c8 c c c c c c c
+       c16 c c c c c c c c c c c c c c c
+       c32 c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c
+       \time 2/4;
+       c8 c c c
+       c16 c c c c c c c
+       c32 c c c c c c c c c c c c c c c
+       \time 2/8;
+       c8 c
+       c16 c c c
+       c32 c c c c c c c
+       \time 3/2;
+       c8 c c c c c c c c c c c
+       c16 c c c c c c c c c c c c c c c c c c c c c c c
+       \time 3/4;
+       c8 c c c c c
+       c16 c c c c c c c c c c c
+       c32 c c c c c c c c c c c c c c c c c c c c c c c
+       \time 3/8;
+       c8 c c
+       c16 c c c c c
+       c32 c c c c c c c c c c c
+       \time 4/4;
+       c8 c c c c c c c
+       c16 c c c c c c c c c c c c c c c
+       c32 c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c
+       \time 4/8;
+       c8 c c c
+       c16 c c c c c c c
+       c32 c c c c c c c c c c c c c c c
+       \time 6/8;
+       c8 c c c c c
+       c16 c c c c c c c c c c c
+       \time 9/8;
+       c8 c c c c c c c c
+       c16 c c c c c c c c c c c c c c c c c
     }
     \paper{
-       \translator{
-           \VoiceContext
-           % add experimental auto-beaming
-           \consists Auto_beam_engraver;
-           % switch it on (perhaps a bit double, but we want to be able 
-           % to switch it off conveniently
-           beamAuto = 1.;
-           % consider starting beam at every 4 note
-           % beamAutoBegin = "1/4";
-           beamAutoEnd = "1/2";
-       }
     }
 }
index 9536e17aceeaf50aa0d0eb2fc9a9914471925751..2ce8813b6d229d8e2f08b374651244a5e87fc67f 100644 (file)
@@ -22,6 +22,7 @@ ADD_THIS_TRANSLATOR (Auto_beam_engraver);
 Auto_beam_engraver::Auto_beam_engraver ()
 {
   beam_p_ = 0;
+  mult_i_ = 0;
   finished_beam_p_ = 0;
   finished_grouping_p_ = 0;
   grouping_p_ = 0;
@@ -37,22 +38,92 @@ void
 Auto_beam_engraver::consider_end_and_begin ()
 {
   Time_description const *time = get_staff_info().time_C_;
+  int num = time->whole_per_measure_ / time->one_beat_;
+  int den = time->one_beat_.den_i ();
+  String time_str = String ("time") + to_str (num) + "_" + to_str (den);
+  int type = 1 << (mult_i_ + 2);
+  String type_str = to_str (type);
+
+  /*
+    Determine end moment for auto beaming (and begin, mostly 0==anywhere) 
+    In order of increasing priority:
+
+    i.   every beat <den>
+    ii.  time<num>_<den>beamAutoEnd
+    iii. time<num>_<den>beamAutoEnd<type>
+    iv.  beamAutoEnd
+    v.   beamAutoEnd<type>
+
+
+    Rationale:
+
+    [to be defined in config file]
+    i.   easy catch-all rule
+    ii.  exceptions for time signature
+    iii. exceptions for time signature, for specific duration type
 
-  Scalar begin = get_property ("beamAutoBegin", 0);
-  Moment begin_mom = begin.to_rat ();
+    [user override]
+    iv.  generic override
+    v.   override for specific duration type
+
+    The user overrides should be required for common cases.
+   */
   
-  Scalar end = get_property ("beamAutoEnd", 0);
-  Moment end_mom = end.to_rat ();
+  /*
+    first guess: begin beam at any position
+  */
+  Moment begin_mom (0);
+  /*
+    first guess: end beam at end of beat
+  */
+  Moment end_mom = time->one_beat_;
+
+  /*
+    second guess: property generic time exception
+  */
+  Scalar begin = get_property (time_str + "beamAutoBegin", 0);
+  if (begin.length_i ())
+    begin_mom = begin.to_rat ();
 
+  Scalar end = get_property (time_str + "beamAutoEnd", 0);
+  if (end.length_i ())
+    end_mom = end.to_rat ();
+
+  /*
+    third guess: property time exception, specific for duration type
+  */
+  if (mult_i_)
+    {
+      Scalar end_mult = get_property (time_str + "beamAutoEnd" + type_str, 0);
+      if (end_mult.length_i ())
+       end_mom = end_mult.to_rat ();
+      Scalar begin_mult = get_property (time_str + "beamAutoBegin" + type_str, 0);
+      if (begin_mult.length_i ())
+       begin_mom = begin_mult.to_rat ();
+    }
+
+  /*
+    fourth guess [user override]: property plain generic
+  */
+  begin = get_property ("beamAutoBegin", 0);
+  if (begin.length_i ())
+    begin_mom = begin.to_rat ();
+  
+  end = get_property ("beamAutoEnd", 0);
+  if (end.length_i ())
+    end_mom = end.to_rat ();
+
+  /*
+    fifth guess [user override]: property plain, specific for duration type
+  */
   if (mult_i_)
     {
-      int type = 1 << (mult_i_ + 2);
-      Scalar end_mult = get_property (String ("beamAutoEnd")
-                                     + to_str (type), 0);
+      Scalar end_mult = get_property (String ("beamAutoEnd") + type_str, 0);
       if (end_mult.length_i ())
        end_mom = end_mult.to_rat ();
-      else if (Moment (type, 4) / end_mom > Moment (4))
-       end_mom /= Moment (type, 8);
+      Scalar begin_mult = get_property (String ("beamAutoBegin") + type_str, 0);
+      if (begin_mult.length_i ())
+       begin_mom = begin_mult.to_rat ();
     }
 
   Real f;
index d81cafb29462f34783ac25d571f0d1d3423b5ac1..41a4330de48e58d621115151a7bd63cd9086911b 100644 (file)
@@ -61,6 +61,11 @@ Bar_engraver::create_bar ()
        {
          bar_p_->type_str_ = default_type;
        }
+      Scalar prop = get_property ("barAtLineStart", 0);
+      if (prop.to_bool ())
+       {
+         bar_p_->at_line_start_b_ = true;
+       }
       announce_element (Score_element_info (bar_p_, bar_req_l_));
     }
 }
@@ -68,6 +73,13 @@ Bar_engraver::create_bar ()
 void
 Bar_engraver::request_bar (String type_str)
 {
+  Scalar prop = get_property ("barAtLineStart", 0);
+  if (!now_mom ())
+    {
+      Scalar prop = get_property ("barAtLineStart", 0);
+      if (!prop.to_bool ())
+       return;
+    }
   create_bar ();
   if (((type_str == "|:") && (bar_p_->type_str_ == ":|"))
     || ((type_str == ":|") && (bar_p_->type_str_ == "|:")))
index 824e2316a1116f6f545408250a30eee448727ca3..d8a3d2f72d8877b241b8add804042378417419a1 100644 (file)
@@ -18,6 +18,7 @@ Bar::Bar ()
 {
   breakable_b_ = true;
   type_str_ = "|";
+  at_line_start_b_ = false;
 }
 
 void
@@ -59,7 +60,13 @@ Bar::do_pre_processing ()
   for (int i=0; bar_breaks[i][0]; i++) 
     {
       if (bar_breaks[i][1] == type_str_)
-       type_str_ = bar_breaks[i][break_status_dir ()+1];
+       {
+         type_str_ = bar_breaks[i][break_status_dir ()+1];
+         if (at_line_start_b_ && (break_status_dir_ == 1) && (type_str_ == ""))
+           {
+             type_str_ = "|";
+           }
+       }
     }
   
   /*
index c21e30825fca543b4e580c41ed2ca76744d81918..c85ea0610a58be729dc22cd449f2ecd74d8840bf 100644 (file)
@@ -218,17 +218,10 @@ Chord::Chord (Musical_pitch tonic, Array<Musical_pitch>* add_arr_p, Array<Musica
     }
 }
 
-String
-Chord::banter_str (Musical_pitch* inversion) const
+void
+Chord::find_additions_and_subtractions(Array<Musical_pitch>* add_arr_p, Array<Musical_pitch>* sub_arr_p)
 {
   Musical_pitch tonic = pitch_arr_[0];
-
-  //urg, should do translation in scheme.
-  char const *acc[] = {"\\textflat\\textflat ", "\\textflat ", "", "\\textsharp " , "\\textsharp\\textsharp "};
-  String tonic_str = tonic.str ();
-  tonic_str = tonic_str.left_str (1).upper_str ()
-    + acc[tonic.accidental_i_ + 2];
-
   /*
     all the triads that should be there
    */
@@ -238,8 +231,6 @@ Chord::banter_str (Musical_pitch* inversion) const
   all_arr.concat (missing_triads_pitch_arr (&all_arr));
   all_arr.sort (Musical_pitch::compare);
   
-  Array<Musical_pitch> add_arr;
-  Array<Musical_pitch> sub_arr;
   int i = 0;
   int j = 0;
   while ((i < all_arr.size ()) || (j < pitch_arr_.size ()))
@@ -255,12 +246,12 @@ Chord::banter_str (Musical_pitch* inversion) const
        }
       else if ((p < a) || (p.notename_i_ == a.notename_i_))
        {
-         add_arr.push (p);
+         add_arr_p->push (p);
          j++;
        }
       else
        {
-         sub_arr.push (a);
+         sub_arr_p->push (a);
          i++;
        }
     }
@@ -269,7 +260,23 @@ Chord::banter_str (Musical_pitch* inversion) const
     add highest addition, because it names chord
    */
   if (trap_i (tonic, pitch_arr_.top () > 5))
-    add_arr.push (pitch_arr_.top ());
+    add_arr_p->push (pitch_arr_.top ());
+}
+
+String
+Chord::banter_str (Musical_pitch* inversion) const
+{
+  Musical_pitch tonic = pitch_arr_[0];
+
+  //urg, should do translation in scheme.
+  char const *acc[] = {"\\textflat\\textflat ", "\\textflat ", "", "\\textsharp " , "\\textsharp\\textsharp "};
+  String tonic_str = tonic.str ();
+  tonic_str = tonic_str.left_str (1).upper_str ()
+    + acc[tonic.accidental_i_ + 2];
+
+  Array<Musical_pitch> add_arr;
+  Array<Musical_pitch> sub_arr;
+  find_additions_and_subtractions (&add_arr, &sub_arr);
                           
   Array<Musical_pitch> scale;
   scale.push (Musical_pitch (0)); // c
@@ -278,8 +285,11 @@ Chord::banter_str (Musical_pitch* inversion) const
   scale.push (Musical_pitch (3)); // f
   scale.push (Musical_pitch (4)); // g
   scale.push (Musical_pitch (5)); // a
+  scale.push (Musical_pitch (6)); // b
   // 7 always means 7-...
-  scale.push (Musical_pitch (6, -1)); // b
+  //  scale.push (Musical_pitch (6, -1)); // b
+
+  rebuild_transpose (tonic, &scale);
   
   bool has3m_b = false;
   bool has4_b = false;
@@ -333,7 +343,7 @@ Chord::banter_str (Musical_pitch* inversion) const
     {
       inversion_str = inversion->str ();
       inversion_str = "/" + inversion_str.left_str (1).upper_str ()
-       + acc[tonic.accidental_i_ + 2];
+       + acc[inversion->accidental_i_ + 2];
 
     }
 
index 1bd1d6d8e6572f46c078d544f0f5e351b46645d8..c315e2137aa143452c91beccb4c8520d1d5c4fc8 100644 (file)
@@ -15,6 +15,7 @@
 class Bar:public Item {
 public:
   String type_str_;
+  bool at_line_start_b_;
 
   
   VIRTUAL_COPY_CONS(Score_element);
index f43f23b212fb3de466bc90723ee33c46510a778e..a863e76572e3d341e14b5ea9602d61adc0355a72 100644 (file)
@@ -27,6 +27,7 @@ public:
   int find_tonic_i () const;
   int find_pitch_i (Musical_pitch p) const;
   int find_notename_i (Musical_pitch p) const;
+  void find_additions_and_subtractions(Array<Musical_pitch>* add_arr_p, Array<Musical_pitch>* sub_arr_p);
 
   Array<Musical_pitch> pitch_arr_;
 };
index e2de809d0196bf0bbaad96d5c101fc2377963f9f..e9a0c10371b4a4058317ea1056693b3e0dee2d5c 100644 (file)
@@ -180,13 +180,13 @@ EXTENDER  __
        cerr << _ ("missing end quote") << endl;
        exit (1);
 }
-<notes>{RESTNAME}      {
+<chords,notes>{RESTNAME}       {
        const char *s = YYText ();
        yylval.string = new String (s); 
        DOUT << "rest:"<< yylval.string;
        return RESTNAME;
 }
-<notes>R               {
+<chords,notes>R                {
        return MEASURES;
 }
 <INITIAL,chords,lyrics,notes>\\\${BLACK}*{WHITE}       {
@@ -294,6 +294,9 @@ EXTENDER    __
                yylval.i = String_convert::dec2_i (String (YYText ()));
                return UNSIGNED;
        }
+       \" {
+               start_quote ();
+       }
        . {
                return yylval.c = YYText ()[0];
        }
index 2fb69d16af2805140672e4feff9b3b813b17afc7..feb62472678c46e9d692e053f83d37f78c239179 100644 (file)
@@ -36,29 +36,34 @@ Repeat_engraver::do_try_music (Music* m)
         return true;
  
       Music_sequence* alt = r->alternative_p_;
-      Moment stop_mom = now_mom () + r->repeat_p_->length_mom ();
-      for (PCursor<Music*> i (alt->music_p_list_p_->top ()); i.ok () && (i != alt->music_p_list_p_->bottom ()); i++)
+      Moment repeat_length_mom = r->repeat_p_->length_mom ();
+      Moment stop_mom = now_mom () + repeat_length_mom;
+      Moment alt_mom = now_mom () + repeat_length_mom;
+      if (repeat_length_mom)
        {
-         stop_mom += i->length_mom ();
-         if (dynamic_cast<Simultaneous_music *> (alt))
-           break;
+         for (PCursor<Music*> i (alt->music_p_list_p_->top ()); i.ok () && (i != alt->music_p_list_p_->bottom ()); i++)
+           {
+             stop_mom += i->length_mom ();
+             if (dynamic_cast<Simultaneous_music *> (alt))
+               break;
+           }
+         repeated_music_arr_.push (r);
+         stop_mom_arr_.push (stop_mom);
+         /*
+           TODO: 
+           figure out what we don't want.
+           
+           we don't want to print more than one set of
+           |: :| and volta brackets on one staff.
+           
+           counting nested repeats, it seems safest to forbid
+           two pieces of alternative music to start at the same time.
+         */
        }
-      Moment alt_mom = now_mom () + r->repeat_p_->length_mom ();
-      /*
-        TODO: 
-         figure out what we don't want.
-
-         we don't want to print more than one set of
-         |: :| and volta brackets on one staff.
-
-         counting nested repeats, it seems safest to forbid
-         two pieces of alternative music to start at the same time.
-       */
       for (int i = 0; i < alternative_start_mom_arr_.size (); i++)
         if (alternative_start_mom_arr_[i] == alt_mom)
          return false;
-      repeated_music_arr_.push (r);
-      stop_mom_arr_.push (stop_mom);
+      // moved stop_mom_arr_.push (stop_mom);
       for (PCursor<Music*> i (alt->music_p_list_p_->top ()); i.ok (); i++)
         {
          alternative_music_arr_.push (i.ptr ());
@@ -106,7 +111,7 @@ Repeat_engraver::do_process_requests ()
     (daddy_grav_l ()->get_simple_translator ("Bar_engraver"));
   for (int i = bar_b_arr_.size (); i < repeated_music_arr_.size (); i++)
     {
-      if (bar_engraver_l && (now > Moment (0)))
+      if (bar_engraver_l)
        bar_engraver_l->request_bar ("|:");
       bar_b_arr_.push (true);
     }
@@ -168,22 +173,5 @@ Repeat_engraver::do_pre_move_processing ()
 void 
 Repeat_engraver::do_post_move_processing ()
 {
-#if 0
-  Time_description const *time = get_staff_info().time_C_;
-  Moment now = now_mom ();
-  for (int i = volta_p_arr_.size (); i--; )
-    {
-      if ((now > alternative_stop_mom_arr_[i])
-         && !time->whole_in_measure_)
-        {
-         volta_p_arr_[i] = 0;
-         volta_p_arr_.del (i);
-         alternative_music_arr_[i] = 0;
-         alternative_music_arr_.del (i);
-         alternative_start_mom_arr_.del (i);
-         alternative_stop_mom_arr_.del (i);
-       }
-    }
-#endif
 }
 
diff --git a/ly/auto-beam.ly b/ly/auto-beam.ly
new file mode 100644 (file)
index 0000000..d528021
--- /dev/null
@@ -0,0 +1,24 @@
+%
+% setup for auto beamer
+%
+time2_8beamAutoEnd = "2/8";
+time3_2beamAutoEnd = "1/2";
+time3_2beamAutoEnd16 = "1/4";
+time3_2beamAutoEnd32 = "1/8";
+time3_4beamAutoBegin = "1/4";
+time3_4beamAutoEnd8 = "3/4";
+time3_4beamAutoEnd32 = "1/8";
+time3_8beamAutoBegin = "1/8";
+time3_8beamAutoEnd = "3/8";
+time4_4beamAutoEnd8 = "1/2";
+time4_4beamAutoEnd32 = "1/8";
+time4_8beamAutoEnd8 = "1/4";
+time4_8beamAutoEnd16 = "1/4";
+time4_8beamAutoEnd32 = "1/8";
+time4_16beamAutoEnd = "1/8";
+time6_8beamAutoEnd8 = "3/8";
+time6_8beamAutoEnd16 = "3/8";
+time6_8beamAutoEnd32 = "1/8";
+time9_8beamAutoEnd8 = "3/8";
+time9_8beamAutoEnd16 = "3/8";
+time6_8beamAutoEnd32 = "1/8";
index 6db19042b6a378b57bfa4a78bf3a3519710c56e9..4205c319922b5cc8db09944b2ceae89df551b49c 100644 (file)
@@ -95,11 +95,14 @@ VoiceContext = \translator {
        \type "Engraver_group_engraver";
        \consists "Dynamic_engraver";
        \name Voice ;
+       beamAuto = "1";
        
        \consists "Rest_engraver";
        \consists "Dot_column_engraver";
        \consists "Stem_engraver";
        \consists "Beam_engraver";
+       \consists "Auto_beam_engraver";
+       \include "auto-beam.ly";
        \consists "Abbreviation_beam_engraver";
 %      \consists "Multi_measure_rest_engraver";
 
@@ -176,12 +179,14 @@ GrandStaffContext=\translator{
        \consists "Chord_name_engraver";
 }
 
-\translator {
+
+ChordNameContext = \translator {
        \type "Line_group_engraver_group";
        \name ChordNames;
        \consists "Vertical_align_engraver";
        \accepts "ChordNameVoice";
-}
+};
+\translator { \ChordNameContext }
 
 ScoreContext = \translator {
        \type Score_engraver;
index d572351c07e2e624e11165b0b061fa68c8be3752..0ee196761bc6a739777b2137e7bbb809e2bfe2b1 100644 (file)
@@ -56,6 +56,7 @@ barAlways             1       generate bar at every moment
 [Staff]
 barAuto                        0       none
 barAuto                        1       auto-generate bar every measure
+barAtLineStart         0/1     generate bar at beginning of line
 
 [Staff]
 beamAuto                0/1     auto-beam on/off
index 46256868619f607ec7b1c3055909d407f72a7d11..498d09a1b65ff0e02e63086e056583eb205d9107 100644 (file)
@@ -152,8 +152,6 @@ lower = \type Staff \notes \relative c{
     \translator{ \OrchestralScoreContext }
     \translator{
            \VoiceContext
-           \consists Auto_beam_engraver;
-           beamAuto = 1.;
            beamAutoEnd8 = "1/4";
            beamAutoEnd16 = "1/4";
     }
index 2b1d22055e4c8bcdabe1d617e56f1df0a80beaa2..757db58c92f86b5e848b84ccd6099868351d242f 100644 (file)
@@ -133,13 +133,6 @@ global = \notes{
                        minVerticalAlign = 3.0*\staffheight;
                        maxVerticalAlign = 3.0*\staffheight;
                }
-               \translator{
-                       \VoiceContext
-                       \consists Auto_beam_engraver;
-                       beamAuto = "1";
-                       beamAutoEnd8 = "1/2";
-                       beamAutoEnd16 = "1/4";
-               }
        }
        \midi{ \tempo 4 = 80; }
        \header {
index d8bf07e30026ddd8f1bbee9fae224e4ff216cc65..91b3d1eab89daa9e074cdea1b97484193d151a2a 100644 (file)
@@ -114,13 +114,6 @@ global = \notes{
        \paper{
                \include "preludes-paper.ly";
                gourlay_maxmeasures = 4.0;
-               \translator{
-                       \VoiceContext
-                       \consists Auto_beam_engraver;
-                       beamAuto = "1";
-                       beamAutoEnd8 = "1/2";
-                       beamAutoEnd16 = "1/4";
-               }
        }
        \midi{ \tempo 4 = 100; }
        \header {
index 88b12333034c33d18207cf0da67e30f4efc2f235..757de5889b6ade39084a6561df9a7626717a5fd2 100644 (file)
@@ -210,13 +210,6 @@ global = \notes{
                        minVerticalAlign = 3.0*\staffheight;
                        maxVerticalAlign = 3.0*\staffheight;
                }
-               \translator{
-                       \VoiceContext
-                       \consists Auto_beam_engraver;
-                       beamAuto = "1";
-                       beamAutoEnd8 = "1/2";
-                       beamAutoEnd16 = "1/4";
-               }
        }
        \midi{ \tempo 4 = 70; }
        \header{
index 7f7c3b03ffdd8f9a879a88abd8055ffc09b19831..7073930a1e7cecd7de0984faf645b9647b7f5c23 100644 (file)
@@ -205,13 +205,6 @@ global = \notes{
                        minVerticalAlign = 3.0*\staffheight;
                        maxVerticalAlign = 3.0*\staffheight;
                }
-               \translator{
-                       \VoiceContext
-                       \consists Auto_beam_engraver;
-                       beamAuto = "1";
-                       beamAutoEnd8 = "3/4";
-                       beamAutoEnd16 = "1/4";
-               }
        }
        \midi{ \tempo 4 = 90; }
        \header{
index 1a11dcfc489683bee2a8dc13b5ff2850dbd39811..dd1472ae6a2a110633884ad6ccb4d4560ab9265b 100644 (file)
@@ -124,14 +124,6 @@ global = \notes{
                        minVerticalAlign = 3.0*\staffheight;
                        maxVerticalAlign = 3.0*\staffheight;
                }
-               \translator{
-                       \VoiceContext
-                       \consists Auto_beam_engraver;
-                       beamAuto = "1";
-                       beamAutoEnd8 = "1/2";
-                       beamAutoEnd16 = "1/4";
-                       beamAutoEnd32 = "1/4";
-               }
        }
        \midi{ \tempo 4 = 40; }
        \header{
index 3c909d4daf754f0f6f2023c0160ac3b241b89e5e..145e9737475834484c42386d80edcf224ab375f7 100644 (file)
@@ -1,11 +1,3 @@
 linewidth = 180.\mm;
 gourlay_maxmeasures = 10.0;
 \translator { \BarNumberingStaffContext }
-\translator {
-       \VoiceContext
-       \consists Auto_beam_engraver;
-       beamAuto = 1.0;
-       beamAutoEnd8 = "1/4";
-       beamAutoEnd16 = "1/4";
-       beamAutoEnd32 = "1/4";
-}
index 3ae97919be75f17ccc2043b922e677caa1d9bbf1..7166c55fdb3660d093354afe12f76e23e2984196 100644 (file)
@@ -194,13 +194,6 @@ bassdux = \type Voice=three \notes \relative c' {
            minVerticalAlign = 3.0*\staffheight;
            maxVerticalAlign = 3.0*\staffheight;
        }
-       \translator {
-           \VoiceContext
-           \consists Auto_beam_engraver;
-           beamAuto = 1.;
-           % eights end at 1/2, 16 at 1/4
-           beamAutoEnd = "1/2";
-       }
     }
     \header{
        opus = "BWV 847";