]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.5.17
authorfred <fred>
Wed, 27 Mar 2002 02:03:38 +0000 (02:03 +0000)
committerfred <fred>
Wed, 27 Mar 2002 02:03:38 +0000 (02:03 +0000)
Documentation/user/refman.itely
input/regression/arpeggio.ly
lily/arpeggio.cc
lily/include/separating-group-spanner.hh
lily/separating-group-spanner.cc
lily/system-start-delimiter.cc
ly/engraver-init.ly
mf/feta-schrift.mf
scm/grob-property-description.scm
scm/interface-description.scm
tex/lilyponddefs.tex

index fac04df277f0078928d233fc68fb886d4d0415be..093637d504935221eaba543c8602465c771e5107 100644 (file)
@@ -1621,6 +1621,13 @@ the specified number of repeats.
 }
 @end lilypond
 
+@subsection Unfolding repeats for MIDI output.
+
+@cindex expanding repeats
+
+See @file{input/test/unfold-all-repeats.ly}. 
+
+
 @refbugs
 
 Notice that timing information is not remembered at the start of an
@@ -1907,6 +1914,34 @@ to the chords in both staves, and set
 This command creates @code{Voice.Arpeggio} grobs.  Cross staff arpeggios
 are @code{PianoStaff.Arpeggio}.
 
+To add an arrow head to explicitly specify the direction of the
+arpeggio, you should set the arpeggio grob property
+@code{arpeggio-type}.
+
+@lilypond[fragment,relative,verbatim]
+  \context Voice {
+     \property Voice.Arpeggio \override #'arpeggio-direction = #1
+     <c\arpeggio e g c>
+     \property Voice.Arpeggio \override #'arpeggio-direction = #-1
+     <c\arpeggio e g c>
+  }
+@end lilypond
+
+@ignore
+A square bracket on the left indicates that the player should not
+arpeggiate the chord.
+
+@lil ypond[fragment,relative,verbatim]
+  \context PianoStaff <
+    \property PianoStaff.connectArpeggios = ##t
+    \property PianoStaff.Arpeggio \override #'arpeggio-direction = #'bracket
+    \context Voice = one  { <c'\arpeggio e g c> }
+    \context Voice = other { \clef bass  <c,,\arpeggio e g>}
+  >  
+@ e nd lilypond
+@end ignore
+
+
 @refbugs
 
 It is not possible to mix connected arpeggios and unconnected arpeggios
index 1f956f90a070e5773a3ba3d8ed06c38629a91c2d..405098dd6c4ebb2db73ab3860966cb218e3b8a99 100644 (file)
@@ -11,6 +11,8 @@ Arpeggios are supported, both cross-staff and broken single staff.
     \context PianoStaff < 
         \context Staff=one \notes\relative c''{
            \context Voice < fis,-\arpeggio  d a >
+           \property Staff.Arpeggio \override #'arpeggio-direction = #1 
+           \context Voice < fis,-\arpeggio  d a >          
             %%\property PianoStaff.SpanArpeggio \override #'connect = ##t
             \property PianoStaff.connectArpeggios = ##t
             <fis,\arpeggio a c>
@@ -18,6 +20,8 @@ Arpeggios are supported, both cross-staff and broken single staff.
         \context Staff=two \notes\relative c{
             \clef bass
            \context Voice < g b d-\arpeggio   >
+           \property Staff.Arpeggio \override #'arpeggio-direction = #-1           
+           \context Voice < g b d-\arpeggio   >            
             <g\arpeggio b d>
         }
     >
index 5b0e755577b254f27b611484f4a51ef5ceb56732..931030a16cd9228ff6c2133050f6b20b98ed8982 100644 (file)
@@ -66,18 +66,30 @@ Arpeggio::brew_molecule (SCM smob)
        */
       return SCM_EOL;
     }
+
+  Direction dir = CENTER;
+  if (isdir_b (me->get_grob_property ("arpeggio-direction")))
+    {
+      dir = to_dir (me->get_grob_property ("arpeggio-direction"));
+    }
   
   Molecule mol;
-  Molecule arpeggio = Font_interface::get_default_font (me)->find_by_name ("scripts-arpeggio");
+  Font_metric *fm =Font_interface::get_default_font (me);
+  Molecule squiggle = fm->find_by_name ("scripts-arpeggio");
 
+  Real arrow_space = (dir) ? Staff_symbol_referencer::staff_space (me)  : 0.0;
+  
   Real y = heads[LEFT];
-  while (y < heads[RIGHT])
+  while (y < heads[RIGHT] - arrow_space)
     {
-      mol.add_at_edge (Y_AXIS, UP,arpeggio, 0.0);
-      y+= arpeggio. extent (Y_AXIS).length ();
+      mol.add_at_edge (Y_AXIS, UP,squiggle, 0.0);
+      y+= squiggle. extent (Y_AXIS).length ();
     }
   mol.translate_axis (heads[LEFT], Y_AXIS);
-
+  if (dir)
+    mol.add_at_edge (Y_AXIS, dir,
+                    fm->find_by_name ("scripts-arpeggio-arrow-" + to_str (dir)), 0.0);
+  
   return mol.smobbed_copy () ;
 }
 
index c394821df4856c69b17ecda16129fdf2f46dc873..848b42910468da3bfb4c8599f439bcad3d926bc8 100644 (file)
@@ -21,6 +21,7 @@ public:
   static bool has_interface (Grob*);
   static void find_musical_sequences (Grob*);
   DECLARE_SCHEME_CALLBACK (set_spacing_rods, (SCM ));
+  DECLARE_SCHEME_CALLBACK (set_spacing_rods_and_seqs, (SCM ));
 };
 
 #endif /* SEPARATING_GROUP_SPANNER_HH */
index f989389674047ee63cfbe12071bb4df9f1c40e4a..66935cbd4affb0c63c00838d651d0162aee5ceae 100644 (file)
@@ -71,6 +71,15 @@ Separating_group_spanner::find_rods (Item * r, SCM next)
     }
 }
 
+MAKE_SCHEME_CALLBACK (Separating_group_spanner,set_spacing_rods_and_seqs,1);
+SCM
+Separating_group_spanner::set_spacing_rods_and_seqs (SCM smob)
+{
+  set_spacing_rods (smob);
+  find_musical_sequences (unsmob_grob (smob));
+  return SCM_UNSPECIFIED;
+}
+
 MAKE_SCHEME_CALLBACK (Separating_group_spanner,set_spacing_rods,1);
 SCM
 Separating_group_spanner::set_spacing_rods (SCM smob)
@@ -96,6 +105,7 @@ Separating_group_spanner::set_spacing_rods (SCM smob)
        find_rods (rb, ly_cdr (s));
     }
   find_musical_sequences (me);
+
 #if 0
   /*
     TODO; restore this.
@@ -162,14 +172,33 @@ Separating_group_spanner::find_musical_sequences (Grob *me)
                  && lrank - rank == 1
                  && llmus && !lmus && mus)
                {
+                 /*
+                   these columns are adjacent, so set spacing-sequence in
+                   IT.
+                   
+                    Q     Q+1    Q+2   (rank)
+                   Note  Clef   Note
+
+                   IT    LAST   LLAST  
+                   
+                  */
                  SCM seq = col->get_grob_property ("spacing-sequence");
                  col->set_grob_property ("spacing-sequence",
                                          gh_cons (gh_cons (it->self_scm (), last->self_scm ()), seq));
+
+                 /*
+                   lcol can not be a loose column, so we make sure
+                   that is and will not be marked as such.
+                 */
+                 lcol->set_grob_property ("between-cols" ,  SCM_BOOL_F);
                }
              else if (!lmus)
                {
                  SCM between = lcol->get_grob_property ("between-cols");
 
+                 if (between == SCM_BOOL_F)
+                   continue;
+                 
                  if (!gh_pair_p (between))
                    {
                      between = gh_cons (it->self_scm (), llast->self_scm ());
index 48522d74c6aea3e4420fcaf7e6918c3b598b7a4c..ef0b23afee873a22c72d4a4d27c181f3a6e85d97 100644 (file)
@@ -143,11 +143,11 @@ System_start_delimiter::staff_brace (Grob*me, Real y)
             name.  This is better than using find_font directly,
             esp. because that triggers mktextfm for non-existent
             fonts. */
-         SCM alist = scm_list_n (gh_cons (ly_symbol2scm ("font-family"),
-                                       ly_symbol2scm ("braces")),
-                              gh_cons (ly_symbol2scm ("font-relative-size"),
-                                       gh_int2scm (i)),
-                              SCM_UNDEFINED);
+         SCM br = ly_symbol2scm ("braces");
+         SCM fam = gh_cons (ly_symbol2scm ("font-family"), br);
+         SCM sz = gh_cons (ly_symbol2scm ("font-relative-size"), gh_int2scm (i));
+
+         SCM alist = scm_list_n (fam, sz, SCM_UNDEFINED);
          fm = Font_interface::get_font (me, scm_list_n (alist, SCM_UNDEFINED));
          /* Hmm, if lookup fails, we get cmr10 anyway */
          if (ly_scm2string (ly_car (fm->description_)) == "cmr10")
index 450d5b7784079e36b15b17bc1e19be7d24c87adb..c70ccf51f93d0ea42fcc47984a59074f12ecd74d 100644 (file)
@@ -18,7 +18,8 @@ StaffContext=\translator {
 %      \consists "Repeat_engraver"
        \consists "Volta_engraver"
        \consists "Separating_line_group_engraver"      
-
+       SeparatingGroupSpanner \override #'spacing-procedure
+         =  #Separating_group_spanner::set_spacing_rods_and_seqs
 
 
        \consists "Clef_engraver"
index bdb0ef87571255a68716dca3fe76b26f7b1f6bf5..b0481341a7a4c33c4234264b4a8286d7786ee811 100644 (file)
@@ -782,8 +782,60 @@ fet_beginchar("Trill-element","trill-element","trill-element");
        currentpicture := currentpicture shifted (height/2, width/2);
        fet_endchar;
 
+
+
+%
+% Arpeggio arrow by Chris Jackson <chris@fluffhouse.org.uk>
+%
+
+def draw_arpeggio_arrow =
+        save thinness, height, width, overshoot, se, sw, ne, nw, alpha;
+       pair ne, nw, se, sw;
+        height# = staff_space#;
+        width# = 0.8height#;
+        overshoot# = 0.25 staff_space#;
+        define_pixels (height,overshoot,width);
+       set_char_box(0, width#, 0, height#);
+        alpha := -40;
+       nw = dir (alpha+180);
+        sw = dir (alpha-90); se = dir alpha;
+
+        penpos1(rthin,     alpha+90);
+       penpos2(5/4 rthick, alpha);
+        penpos3(5/4 rthick,     0);
+
+        z1 = (width/2, height) - overshoot*se; % numbering is consistent with the arpeggio symbol
+        z2 = 2[z4,(width/2,height/2)];
+        z3 = (0.5 width, 0.5 height);
+        z4 = (0.25 staff_space, rthin);
+       z6 = z2l + 1/2rthin*sw;
+        z9 = (width/2, height) + overshoot*se;
+        fill z1l {se}..{se} z6 .. z3l .. z3r.. z9{nw} ..{nw} z1r.. cycle;
+
+       bot z10 = ( 0.5w,  0   );
+       lft z11 = (-0.3w,  0.8h);
+       rt z12  = ( 1.3w,  0.8h);
+       pickup pencircle scaled 0.5 rthin;
+       filldraw z3 -- z12 {dir -130} ..  {dir -110} z10 {dir 110} ..  {dir 130} z11 -- cycle;
+enddef;
+
+fet_beginchar("Arpeggio arrow down", "arpeggio-arrow--1", "arpeggioarrowdown");
+       draw_arpeggio_arrow;
+fet_endchar;
+
+
+fet_beginchar("Arpeggio arrow up", "arpeggio-arrow-1", "arpeggioarrowup");
+        draw_arpeggio_arrow;
+        currentpicture := currentpicture scaled -1 shifted (0.8staff_space, staff_space);
+fet_endchar;
+
+
+
+
 % Hmm
 input feta-slag;
 
+
+
 fet_endgroup("scripts");
 
index 85a6b931f412d0650d18af3ff804e7a7b8530fe2..6920e911beefd81a786db8308924713ec0c46af6 100644 (file)
@@ -45,6 +45,8 @@ This procedure is called (using dependency resolution) after line breaking. Retu
 (grob-property-description 'arch-width number? "width of the hook of a system brace.")
 (grob-property-description 'arithmetic-basicspace number? "see @ref{spacing-spanner-interface}.")
 (grob-property-description 'arithmetic-multiplier number? "see @ref{spacing-spanner-interface}.")
+(grob-property-description 'arpeggio-direction dir? "If set, put an
+arrow on the arpeggio squiggly line.")
 (grob-property-description 'attachment pair? "cons of symbols, '(LEFT-TYPE . RIGHT-TYPE), where both types may be alongside-stem, stem, head or loose-end.")
 
 (grob-property-description 'stem-attachment-function procedure? "Where
index 9d2249cac2d4eb3de7ac11c9f6364c9da09c92a5..60b76f8d795936db81618b48c21544c30c675927 100644 (file)
@@ -374,7 +374,7 @@ padding -- horizontal padding. This is useful if a crescendo is set next to a te
 (lily-interface
  'arpeggio-interface
  "Functions and settings for drawing an arpeggio symbol (a wavy line left to noteheads."
- '(stems))
+ '(stems arpeggio-direction))
 
 
 
index 0b00c76eb1a6c18897ce6da38830d335b68c3558..bc30d5403992e4508e9902a36b5b8c49ebc06ebd 100644 (file)
         \botalign{\hbox{\raise #1\leftalign{\kern #2{}#3}}}}%
 
 % Are we using PDFTeX?  If so, use pdf definitions.
+% MiKTeX checks \pdfoutput the wrong way, makes our
+% check more complicated.
 \ifx\pdfoutput\undefined  
   \input lily-ps-defs
 \else
-  \pdfoutput=1
-  \input lily-pdf-defs
+  \ifx\pdfoutput\relax
+    \input lily-ps-defs
+  \else
+    \pdfoutput=1
+    \input lily-pdf-defs
+  \fi
 \fi
 
 \def\EndLilyPondOutput{%