]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scm/music-functions.scm (voicify-music): add \context Staff for
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 7 Feb 2004 00:41:06 +0000 (00:41 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 7 Feb 2004 00:41:06 +0000 (00:41 +0000)
<< \\ >> polyphony.

* lily/parser.yy (verbose_command_req): \skip now creates
SkipMusic, and does not lead to spurious staves.

* scm/define-music-types.scm (music-descriptions): rename
NonEventSkip to SkipMusic

ChangeLog
Documentation/user/refman.itely
input/test/staff-container.ly
lily/note-spacing.cc
lily/parser.yy
scm/define-music-types.scm
scm/music-functions.scm
scripts/convert-ly.py

index 730b35772a21a1958024d11ed983d430aaa72a2c..06e11708160497d9f087546838f56afde5b4b0dd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2004-02-07  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
+       * scm/music-functions.scm (voicify-music): add \context Staff for
+       << \\ >> polyphony.
+
+       * lily/parser.yy (verbose_command_req): \skip now creates
+       SkipMusic, and does not lead to spurious staves.
+
+       * scm/define-music-types.scm (music-descriptions): rename
+       NonEventSkip to SkipMusic
+
        * input/no-notation/midi-lyric-barcheck.ly: new file.
 
        * input/regression/collision-dots-invert.ly: new file.
index 467b40f3afc846728bafdbe85cac5410f89c0877..56a31c8c0b75dfdb1d07bc244e930ed41048260c 100644 (file)
@@ -250,7 +250,7 @@ with note name `@code{s}' or with @code{\skip @var{duration}}:
 a2 s4 a4 \skip 1 a4 
 @end lilypond
 
-The @code{s} syntax is only available in Note mode and Chord mode.  In
+The @code{s} syntax is only available in note mode and chord mode.  In
 other situations, you should use the @code{\skip} command:
 
 @lilypond[raggedright,verbatim]
@@ -265,9 +265,19 @@ other situations, you should use the @code{\skip} command:
 The skip command is merely an empty musical placeholder.  It does not
 produce any output, not even transparent output.
 
+The @code{s} skip command does create @internalsref{Staff} and
+@internalsref{Voice} when necessary, similar to note and rest
+commands. For example, the following results in an empty staff.
+
+@lilypond[raggedright,verbatim]
+\score { \notes { s4 } } 
+@end lilypond
+
+The same fragment using @code{\skip} results in an empty page.
+
 @seealso
 
-Internals: @internalsref{SkipEvent}.
+Internals: @internalsref{SkipEvent}, @internalsref{SkipMusic}.
 
 
 
index 8ef7ab4bd20df496d59da8d0c79dbbeaae9842b9..8ad2a1753e642f230e370a46ac915ee25cc995a0 100644 (file)
@@ -1,4 +1,4 @@
-\version "2.1.7"
+\version "2.1.20"
 
 \header {
 
@@ -21,7 +21,7 @@ what you would expect.
 %% 
 %% s4 would create a staff.
 %%
-quarterSkip = #(make-nonevent-skip (ly:make-duration 2 0))
+quarterSkip = #(make-skip-music (ly:make-duration 2 0))
 
 \score  {
  \notes \relative c'' <<
index 1b60b1cec59bc725ffefa23d2b126d0bfc52d748..40cb91d5ba79727d05542d814a9ed9e1940978cb 100644 (file)
 #include "accidental-placement.hh"
 #include "paper-def.hh"
 
+
+/*
+
+TODO: detect hshifts due to collisions, and account for them in
+spacing?
+
+*/ 
+
 void
 Note_spacing::get_spacing (Grob *me, Item* right_col,
                           Real base_space, Real increment, Real *space, Real *fixed)
index 15b37c198892b0bad666200612c9250280916a69..c9dace074fda70a5b4f69810105a83cfcae349b4 100644 (file)
@@ -385,9 +385,8 @@ yylex (YYSTYPE *s,  void * v)
 %type <scm> Music_list
 %type <scm> property_operation context_mod translator_mod optional_context_mod
 %type <outputdef>  music_output_def_body music_output_def_head
-%type <music> shorthand_command_req
 %type <music>  post_event tagged_post_event
-%type <music> command_req verbose_command_req
+%type <music> command_req 
 %type <music> string_number_event
 %type <scm>    string bare_number number_expression number_term number_factor 
 %type <score>  score_block score_body
@@ -1317,6 +1316,12 @@ command_element:
                $$-> set_spot (THIS->here_input ());
                $1-> set_spot (THIS->here_input ());
        }
+       | SKIP duration_length {
+               Music * skip = MY_MAKE_MUSIC("SkipMusic");
+               skip->set_mus_property ("duration", $2);
+
+               $$ = skip;
+       }
        | OCTAVE { THIS->push_spot (); }
          pitch {
                Music *l = MY_MAKE_MUSIC("RelativeOctaveCheck");
@@ -1406,31 +1411,16 @@ command_element:
        ;
 
 command_req:
-       shorthand_command_req   { $$ = $1; }
-       | verbose_command_req   { $$ = $1; }
-       ;
-
-shorthand_command_req:
        BREATHE {
                $$ = MY_MAKE_MUSIC("BreathingSignEvent");
        }
        | E_TILDE {
                $$ = MY_MAKE_MUSIC("PesOrFlexaEvent");
        }
-       ;
-
-verbose_command_req:
-       MARK DEFAULT  {
+       | MARK DEFAULT  {
                Music * m = MY_MAKE_MUSIC("MarkEvent");
                $$ = m;
        }
-       
-       | SKIP duration_length {
-               Music * skip = MY_MAKE_MUSIC("SkipEvent");
-               skip->set_mus_property ("duration", $2);
-
-               $$ = skip;
-       }
        | tempo_event {
                $$ = $1;
        }
index 878086a91c4a24ed5ef16a36676d0a2df3951e03..a85ea9bc1152b0dad3cd02bb2cc23f93586c1811 100644 (file)
@@ -531,9 +531,12 @@ For example, transposed music.")
        (types . (general-music event))
        ))
 
-    (NonEventSkip
+    (SkipMusic
      . (
-       (description .  "Filler that takes up duration, but does not print anything. This also does not create any event-accepting contexts. ")
+       (description .  "Filler that takes up duration, does not print anything, and also
+does not create staffs or voices implicitly.
+
+Syntax: @code{\\skip }@var{duration}.")
        (internal-class-name . "Music")
        (length . ,ly:music-duration-length)
        (iterator-ctor . ,Simple_music_iterator::constructor)
@@ -542,12 +545,13 @@ For example, transposed music.")
      
     (SkipEvent
      . (
-       (description .  "Filler that takes up duration, but does not print anything.")
+       (description .  "Filler that takes up duration, but does not print anything.
+
+Syntax: @code{s}@var{duration}")
 
        (internal-class-name . "Event")
        (types . (general-music event rhythmic-event skip-event))
        ))
-    
     (SpanEvent
      . (
        (description .  "Event for anything that is started at a different time than stopped.")
index f343098560427d4214ff48de2ee7d325e733286d..7693d1b7745531fb899234c5c413de098bc8d59e 100644 (file)
@@ -283,8 +283,8 @@ i.e.  this is not an override"
     ))
 
 
-(define-public (make-nonevent-skip dur)
-  (let*  ((m (make-music-by-name 'NonEventSkip)))
+(define-public (make-skip-music dur)
+  (let*  ((m (make-music-by-name 'SkipMusic)))
     (ly:set-mus-property! m 'duration dur)
     m
   ))
@@ -501,8 +501,6 @@ Rest can contain a list of beat groupings
 
 
 ;;; splitting chords into voices.
-;; todo: spec \context Staff for  <<\\>>
-;;
 (define (voicify-list lst number)
    "Make a list of Musics.
 
index fd8aa4e5c4f895d68c29a5c1b154470d99f0a2cb..47b8b60cd188fd55587923223c2db2b0e0abdb56 100644 (file)
@@ -1815,6 +1815,15 @@ def conv (str):
 conversions.append (((2,1,19), conv, """Drum notation changes, Removing \chordmodifiers, \notenames.
 Harmonic notes. Thread context removed. Lyrics context removed."""))
 
+def conv (str):
+       str = re.sub (r'nonevent-skip', 'skip-music', str)
+       return str
+
+conversions.append (((2,1,20), conv, """nonevent-skip -> skip-music""" ))
+
+
+
+
 ################################
 #      END OF CONVERSIONS      
 ################################