]> git.donarmstrong.com Git - lilypond.git/commitdiff
* input/test/improv.ly: update: do not use Thread switching.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 5 Feb 2004 11:11:51 +0000 (11:11 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 5 Feb 2004 11:11:51 +0000 (11:11 +0000)
* lily/pitch-squash-engraver.cc (acknowledge_grob): only squash if
squashedPosition is a number

* Documentation/user/refman.itely (Automatic note splitting):
remove Thread references.

* Documentation/user/refman.itely (Percussion staves): update doco.

ChangeLog
Documentation/user/introduction.itely
Documentation/user/lilypond.tely
Documentation/user/music-glossary.tely
Documentation/user/refman.itely
input/test/improv.ly
lily/change-iterator.cc
lily/include/my-lily-lexer.hh
lily/lexer.ll
lily/parser.yy
lily/pitch-squash-engraver.cc

index 3e9478e5cc93b7b025736024c8165713aa24e47e..40547e3a51ec9b63cc888f7de975fb067c35f081 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2004-02-05  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
+       * input/test/improv.ly: update: do not use Thread switching. 
+
+       * lily/pitch-squash-engraver.cc (acknowledge_grob): only squash if
+       squashedPosition is a number  
+
        * Documentation/user/refman.itely (Automatic note splitting):
        remove Thread references.
 
index 22ff44c216dc03a87f85edb27e6ed2a4623ad497..5e9af3ffb0fb505a57d89e978ba6dc202202a88c 100644 (file)
@@ -543,7 +543,7 @@ By adding chord names and lyrics we obtain a lead sheet:
 \score { <<
   \context ChordNames \chords  { c2 c f2 c }
   \notes \relative c' { \time 2/4 c4 c g'4 g a4 a g2 }
-  \context Lyrics \lyrics  { twin4 kle twin kle lit tle star2 } >> }
+  \context LyricsVoice \lyrics  { twin4 kle twin kle lit tle star2 } >> }
 @end lilypond
 
 Polyphonic notation and piano music can also be printed. The following
index 1e3964cef8562e82c0eec30f527eea1655fbc088..c891847585290ae91c10715444d73697aeed556d 100644 (file)
@@ -94,7 +94,7 @@ Copyright @copyright{} 1999--2003 by the authors
 
   
 @lilypond[singleline]
-\score { \context Lyrics \notes {
+\score { \context LyricsVoice \notes {
     \property Score.RehearsalMark \set #'self-alignment-X = #LEFT
 
 \mark #(ly:export    (string-append "(For LilyPond version "
index 4b2f2b0d1ea8f2995f31412d9314ccef06e3b03d..453e6895f95805066b33e4496c6ecda4fc1407dc 100644 (file)
@@ -186,7 +186,7 @@ accidental.
 \context Staff \notes\relative c'' {
   gis1 s s gisis s s ges s s geses s s g!
 }
-\context Lyrics \lyrics {
+\context LyricsVoice \lyrics {
   \property Lyrics . LyricText \set #'self-alignment-X = #-1
   "sharp  " "db. sharp  " "flat  " "db. flat  " natural
 }
@@ -685,7 +685,7 @@ lines.
   \clef tenor c s s
   \clef baritone c s s
 }
-\context Lyrics \lyrics {
+\context LyricsVoice \lyrics {
   \property Lyrics . LyricText \override #'self-alignment-X = #-1
   "Soprano  " "Mezzosoprano  " "Alto  " "Tenor  " Baritone
 }
@@ -784,7 +784,7 @@ chords are denoted open chords
   <g b d f> s s
   <g b d f a> s s
 }
-\context Lyrics \lyrics{
+\context LyricsVoice \lyrics{
   \property Lyrics . LyricText \set #'self-alignment-X = #-1
   "major  " "minor  " "diminished  " "augmented  "
   "seventh-chord  " "ninth-chord  "
@@ -1186,7 +1186,7 @@ also to some extent in newer jazz music.
     \property Voice.TextScript \set #'padding = #-4
     e^"~~ S" f g a b^"~~ S" c
   }
-  \context Lyrics \lyrics {
+  \context LyricsVoice \lyrics {
     Ionian
   }
 @end lilypond
@@ -1201,7 +1201,7 @@ also to some extent in newer jazz music.
     \property Voice.TextScript \set #'padding = #-4
     e^"~~ S" f g a b^"~~ S" c d
   }
-  \context Lyrics \lyrics {
+  \context LyricsVoice \lyrics {
     Dorian
   }
 @end lilypond
@@ -1215,7 +1215,7 @@ also to some extent in newer jazz music.
     \property Voice.TextScript \set #'padding = #-4
     e1^"~~ S" f g a b^"~~ S" c d e
   }
-  \context Lyrics \lyrics {
+  \context LyricsVoice \lyrics {
     Phrygian
   }
 @end lilypond
@@ -1230,7 +1230,7 @@ also to some extent in newer jazz music.
     \property Voice.TextScript \set #'padding = #-4
     b^"~~ S" c d e^"~~ S" f
   }
-  \context Lyrics \lyrics {
+  \context LyricsVoice \lyrics {
     Lydian
   }
 @end lilypond
@@ -1244,7 +1244,7 @@ also to some extent in newer jazz music.
     g1 a
     \property Voice.TextScript \set #'padding = #-4
     b^"~~ S" c d e^"~~ S" f g }
-  \context Lyrics \lyrics {
+  \context LyricsVoice \lyrics {
     Mixolydian
   }
 @end lilypond
@@ -1259,7 +1259,7 @@ also to some extent in newer jazz music.
     \property Voice.TextScript \set #'padding = #-4
     b^"~~ S" c d e^"~~ S" f g a
   }
-  \context Lyrics \lyrics {
+  \context LyricsVoice \lyrics {
     Aeolian
   }
 @end lilypond
@@ -1279,7 +1279,7 @@ harmonic minor scale type an augmented second (A) occurs between the 6th and
     \property Voice.TextScript \set #'padding = #-4
     e^"~~ S" f g a b^"~~ S" c
   }
-  \context Lyrics \lyrics {
+  \context LyricsVoice \lyrics {
     Major
   }
 @end lilypond
@@ -1294,7 +1294,7 @@ harmonic minor scale type an augmented second (A) occurs between the 6th and
     \property Voice.TextScript \set #'padding = #-4
     b^"~~ S" c d e^"~~ S" f g a
   }
-  \context Lyrics \lyrics {
+  \context LyricsVoice \lyrics {
     "ancient minor"
   }
 @end lilypond
@@ -1309,7 +1309,7 @@ harmonic minor scale type an augmented second (A) occurs between the 6th and
     \property Voice.TextScript \set #'padding = #-4
     b^"~~ S" c d e^"~~ S" f!^"~~ A" gis^"~~ S" a
   }
-  \context Lyrics \lyrics {
+  \context LyricsVoice \lyrics {
     "Harmonic minor"
   }
 @end lilypond
@@ -1325,7 +1325,7 @@ harmonic minor scale type an augmented second (A) occurs between the 6th and
     b^"~~ S" c d e fis gis^"~~ S"
     a g! f!^"~~ S" e d c^"~~ S" b a
   }
-  \context Lyrics \lyrics {
+  \context LyricsVoice \lyrics {
     "Melodic minor"
   }
 @end lilypond
@@ -1667,7 +1667,7 @@ but equal pitch.
 \context Staff \notes\relative c'' {
   gis1 s s as s s <des g,!> s s <cis g!> s s
 }
-\context Lyrics \lyrics {
+\context LyricsVoice \lyrics {
   \property Lyrics . LyricText \set #'self-alignment-X = #-1
   "g sharp  " "a flat  " "dim fifth  " "augm fourth"
 }
@@ -1748,7 +1748,7 @@ symbol indicates playing an octave lower (for example on double bass
   \clef "F_8"
   f1
 }
-\context Lyrics \lyrics {
+\context LyricsVoice \lyrics {
   \property Lyrics . LyricText \set #'self-alignment-X = #-1
   "baritone  "
   "bass  "
@@ -1916,7 +1916,7 @@ variants of the base chords.
 \context Voice \notes\relative c'' {
   <g e c >1 < a f d > < b g e >
   <c a f > < d b g > < e c a > < f d b > }
-\context Lyrics \lyrics { T Sp Dp S D Tp "D{\\kern-5pt}$\\mid$" }
+\context LyricsVoice \lyrics { T Sp Dp S D Tp "D{\\kern-5pt}$\\mid$" }
 @end lilypond
 
 @aitem{G}
@@ -1962,7 +1962,7 @@ scores are notated like that).
   \clef "G_8"
   g s s
 }
-\context Lyrics \lyrics {
+\context LyricsVoice \lyrics {
   \property Lyrics . LyricText \set #'self-alignment-X = #-1
   "french violin clef  "
   "violin clef  "
@@ -2083,7 +2083,7 @@ section.  @aref{functional harmony}.
     \partial 4 c4 | f, g c2
     \bar "|."
   }
-  \context Lyrics \lyrics {
+  \context LyricsVoice \lyrics {
     T S D T
   }
 >>
@@ -2179,7 +2179,7 @@ of such two forms an octave.
   < g b! >^"major" s
   < g bis >^"augm" s
 }
-\context Lyrics \lyrics {
+\context LyricsVoice \lyrics {
   "unisone  " "second  " "second  " "second  "
   "third   " "third  " "third  " "third  "
 }
@@ -2200,7 +2200,7 @@ of such two forms an octave.
   < g e'! >^"major"  s
   < g eis' >^"augm"  s
 }
-\context Lyrics \lyrics {
+\context LyricsVoice \lyrics {
   "fourth  " "fourth  " "fifth  " "fifth  "
   "sixth  " "sixth  " "sixth  " "sixth  "
 }
@@ -2221,7 +2221,7 @@ of such two forms an octave.
   < g bes' >^"minor"  s
   < g b'! >^"major"  s
 }
-\context Lyrics \lyrics {
+\context LyricsVoice \lyrics {
   "seventh  " "seventh  " "seventh  " "octave  "
   "none  " "none  " "decime  " "decime  "
 }
@@ -2363,7 +2363,7 @@ unlike (b) @emph{leggiero} or @emph{non-legato}, (c) @emph{portato} and
   c4-.-( d-. e-.-) \bar "||"
   c4-. d-. e-. \bar "||"
 }
-\context Lyrics \lyrics {
+\context LyricsVoice \lyrics {
 %  \property Lyrics . LyricText \set #'font-style = #'large
   a
   b "" ""
@@ -3371,7 +3371,7 @@ sub@-do@-mi@-nant (S) and V = dominant (D).
 \context Staff \notes\relative c' {
   c1 d e f g a b c
 }
-\context Lyrics \lyrics {
+\context LyricsVoice \lyrics {
   << { I II III IV V VI VII I }
     { T "" ""  S  D } >>
 }
@@ -3984,9 +3984,8 @@ with figures designating the chief @aref{interval}s and
     \key es \major
     es8 c d bes c as bes16 as g f | es4
   }
-  \context Lyrics \lyrics {
-%    \property Lyrics . LyricText \set #'font-style = #'Large
-    \property Lyrics . VerticalAlign \override #'threshold = #'(6 . 12)
+  \context LyricsVoiceVoice \lyrics {
+    \property LyricsVoiceVoice . VerticalAlign \override #'threshold = #'(6 . 12)
     << { "" "6" "" "4" "" "6" "" "" "6" "4" }
       { "" ""  "" "2" "" ""  "" "" ""  "2" } >>
   }
index a9094bb1d5aaf8cd21ecd369fbc3144d45f6c10e..ff2743627612108bd1f07d14f3b8ac0090ba14aa 100644 (file)
@@ -2810,7 +2810,7 @@ mus = \drums  { cymc cyms cymr hh | hhc hho hhho hhp | \break cb hc
             Stem \set #'Y-extent-callback =  ##f
             minimumVerticalExtent = #'(-4.0 . 5.0)
     } \mus
-        \context Lyrics \nam 
+        \context LyricsVoice \nam 
     >>
     \paper {
     %% need to do this, because of indented @itemize
@@ -2843,7 +2843,7 @@ mus = \drums  { timh ssh timl ssl cb s16 }
             minimumVerticalExtent = #'(-3.0 . 4.0)
             drumStyleTable = #timbales-style
         } \mus
-        \context Lyrics \nam 
+        \context LyricsVoice \nam 
     >>
 }
 @end lilypond
@@ -2866,7 +2866,7 @@ mus = \drums  { cgh cgho cghm ssh cgl cglo cglm ssl s16 }
             Stem \set #'transparent =  ##t
             Stem \set #'Y-extent-callback =  ##f
         } \mus
-        \context Lyrics \nam 
+        \context LyricsVoice \nam 
     >>
 }
 @end lilypond
@@ -2889,7 +2889,7 @@ mus = \drums  { boh boho bohm ssh bol bolo bolm ssl s16 }
             Stem \set #'transparent =  ##t
             Stem \set #'Y-extent-callback =  ##f
         } \mus
-        \context Lyrics \nam 
+        \context LyricsVoice \nam 
     >>
 }
 @end lilypond
@@ -2909,7 +2909,7 @@ mus = \drums  { tri trio trim gui guis guil cb cl tamb cab mar hc s16 }
             Stem \set #'transparent =  ##t
             Stem \set #'Y-extent-callback =  ##f
         } \mus
-        \context LyricsVoice \nam 
+        \context LyricsVoiceVoice \nam 
     >>
 }
 @end lilypond
@@ -3368,7 +3368,7 @@ The definition of lyrics mode is too complex.
 
 Lyrics are printed by interpreting them in a @internalsref{LyricsVoice} context:
 @example
- \context LyricsVoice \lyrics @dots{}
+ \context LyricsVoiceVoice \lyrics @dots{}
 @end example
 
 @cindex automatic syllable durations
@@ -3394,9 +3394,9 @@ For different or more complex orderings, the best way is to setup the
 hierarchy of staves and lyrics first, e.g.
 @example
 \context ChoirStaff \notes <<
-  \context LyricsVoice = sopranoLyrics @{ s1 @}
+  \context LyricsVoiceVoice = sopranoLyrics @{ s1 @}
   \context Voice = soprano @{ @emph{music} @}
-  \context LyricsVoice = tenor @{ s1 @}
+  \context LyricsVoiceVoice = tenor @{ s1 @}
   \context Voice = tenorLyrics @{ @emph{music} @}
 >>
 @end example
@@ -3503,9 +3503,9 @@ that identity followed by a dash.  In the preceding example, the
 @internalsref{Voice} identity is @code{duet}, so the identities of the
 @internalsref{LyricsVoice}s are marked @code{duet-1} and @code{duet-2}:
 @example
-  \context LyricsVoice = "duet-1" @{
+  \context LyricsVoiceVoice = "duet-1" @{
     Hi, my name is bert. @}
-  \context LyricsVoice = "duet-2" @{
+  \context LyricsVoiceVoice = "duet-2" @{
     Ooooo, ch\'e -- ri, je t'aime. @}
 @end example
 
@@ -7431,7 +7431,7 @@ The following are supported
         _\verylongfermata
         r
     }
-    \context Lyrics \lyrics {
+    \context LyricsVoice \lyrics {
       "shortfermata" "fermata"  "longfermata" "verylongfermata"
     } >>
 }
index 4304dbabeb1d6b77d806147c17113a7c52d7ad66..6420562d94ebbcbf9dd1fd0868398cff01687da1 100644 (file)
@@ -1,56 +1,51 @@
 \version "2.1.7"
 \header {
 
-texidoc =
+    texidoc =
+"
 
+In improvisation, noteheads do not have a pitch, and have different
+shapes. In this example, this is achieved by adding
+@code{Pitch_squash_engraver} and setting @code{squashedPosition} when the
+improvisation is active.
 
-"@cindex improvisation
-
-
-Noteheads for improvisation have a different shape.
+"
 
+}
 
-" }
 
+improOn = \notes {
+    \property Voice.squashedPosition = #0
+    \property Voice.NoteHead \override #'style = #'slash
+}
 
-improOn = \notes {\change Voice = impro }
-improOff = \notes {\change SquashVoice = melo }
+improOff = \notes {
+    \property Voice.squashedPosition \unset
+    \property Voice.NoteHead \revert #'style
+}
 
 global = \notes { s1*3 \bar "|." }
 
 \score {
-  <<
-    \context ChordNames \chords {e8*7:m7 a2.:m7 bes4:m7 b1:m7 e8:m }
-    \context Staff \notes <<
-      \context SquashVoice = impro { \global }
-      \context Voice = melo \transpose c c' {
-       e8 e g a a16(bes)(a8) g \improOn e8
-       ~e2~e8 f4 fis8
-       ~fis2 \improOff a16(bes) a8 g e
-      }
+    <<
+       \context ChordNames \chords {
+           e8*7:m7 a2.:m7 bes4:m7 b1:m7 e8:m
+       }
+       \notes <<
+           \context Voice = melo \transpose c c' {
+               e8 e g a a16(bes)(a8) g \improOn
+               e8
+               ~e2~e8 f4 fis8
+               ~fis2 \improOff a16(bes) a8 g e
+           }
+       >>
     >>
-  >>
-  \paper { 
-    \translator {
-      \VoiceContext
-      \name SquashVoice
-      \alias Voice
-      \consists Pitch_squash_engraver
-      squashedPosition = #0
-      NoteHead \override #'style = #'slash
-    }
-
-    \translator {
-      \VoiceContext
-      \alias SquashVoice
-    }
-    
-    \translator {
-      \StaffContext
-      \remove "Accidental_engraver"
-      \accepts SquashVoice
+    \paper { 
+       \translator {
+           \VoiceContext
+           \consists Pitch_squash_engraver
+       }
+       raggedright = ##t
     }
-    raggedright = ##t
-  }
 }
 
index 7d594273fd5038cd552cc9c277d33e572b16432d..1c2431b1b7412fee8d6a5c5f529dbd66cbca084e 100644 (file)
@@ -16,8 +16,8 @@
 void
 Change_iterator::error (String reason)
 {
-  String to_type = ly_scm2string (get_music ()->get_mus_property ("change-to-type"));
-  String to_id =  ly_scm2string (get_music ()->get_mus_property ("change-to-id"));
+  String to_type = ly_symbol2string (get_music ()->get_mus_property ("change-to-type"));
+  String to_id = ly_scm2string (get_music ()->get_mus_property ("change-to-id"));
 
   String warn1 = _f ("can't change `%s' to `%s'", to_type, to_id) 
     + ": " + reason;
index 68c50f332c1ea4c68e8018006ca736648604f206..80c706d1ebad804b287b5bf73240059e30fc5c47 100644 (file)
@@ -57,9 +57,9 @@ public:
 
   SCM lookup_identifier (String s);
   void push_note_state (SCM tab);
+  void push_chord_state (SCM tab);
   void push_markup_state ();
   void push_figuredbass_state ();
-  void push_chord_state ();
   void push_lyric_state ();
   void pop_state ();
   void LexerError (char const *);
index bf829eab8082b17558251ad3902bfdbf589279fc..5aff58c66fa3170eeb718c38919479cd4dd61408 100644 (file)
@@ -618,8 +618,9 @@ My_lily_lexer::push_figuredbass_state()
        yy_push_state (figures);
 }
 void
-My_lily_lexer::push_chord_state ()
+My_lily_lexer::push_chord_state (SCM tab)
 {
+       pitchname_tab_stack_ = gh_cons (tab, pitchname_tab_stack_);
        yy_push_state (chords);
 }
 
@@ -638,7 +639,7 @@ My_lily_lexer::push_markup_state ()
 void
 My_lily_lexer::pop_state ()
 {
-       if (YYSTATE == notes)
+       if (YYSTATE == notes || YYSTATE == chords)
                pitchname_tab_stack_ = gh_cdr (pitchname_tab_stack_);
        yy_pop_state ();
 }
@@ -682,7 +683,9 @@ My_lily_lexer::scan_bare_word (String str)
 {
        SCM sym = ly_symbol2scm (str.to_str0 ());
        if ((YYSTATE == notes) || (YYSTATE == chords)) {
-               SCM handle = scm_hashq_get_handle (gh_car (pitchname_tab_stack_), sym);
+               SCM handle = SCM_BOOL_F;
+               if (gh_pair_p (pitchname_tab_stack_))
+                       handle = scm_hashq_get_handle (gh_car (pitchname_tab_stack_), sym);
                
                if (gh_pair_p (handle)) {
                        yylval.scm = ly_cdr (handle);
index de1b8e81c137caff4a8ad886435fa6dc09843b96..de733ff58cf6bd8cec313eaa200959e06ed856a6 100644 (file)
@@ -1050,13 +1050,13 @@ basic music objects too, since the meaning is different.
 
                  THIS->lexer_->pop_state ();
        }
-       | CHORDS
-               {
+       | CHORDS {
                SCM nn = THIS->lexer_->lookup_identifier ("chordmodifiers");
                THIS->lexer_->chordmodifier_tab_ = alist_to_hashq (nn);
-               THIS->lexer_->push_chord_state (); }
-       Music
-               {
+               nn = THIS->lexer_->lookup_identifier ("pitchnames");
+               THIS->lexer_->push_chord_state (alist_to_hashq (nn));
+
+       } Music {
                  Music * chm = MY_MAKE_MUSIC("UnrelativableMusic");
                  chm->set_mus_property ("element", $3->self_scm ());
                  scm_gc_unprotect_object ($3->self_scm());
index 98607e15bb05b264a2c4c4bbd83dc6acd53beddc..b974bb894261ff9856f87db769fbc2737f9c4e6d 100644 (file)
@@ -22,7 +22,8 @@ void
 Pitch_squash_engraver::acknowledge_grob (Grob_info i)
 {
   SCM newpos = get_property ("squashedPosition");
-  if (Note_head::has_interface (i.grob_))
+  if (gh_number_p (newpos)
+      && Note_head::has_interface (i.grob_))
     {
       i.grob_->set_grob_property ("staff-position", newpos);
     }