* 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.
2004-02-05 Han-Wen Nienhuys <hanwen@xs4all.nl>
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.
* Documentation/user/refman.itely (Automatic note splitting):
remove Thread references.
\score { <<
\context ChordNames \chords { c2 c f2 c }
\notes \relative c' { \time 2/4 c4 c g'4 g a4 a g2 }
\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
@end lilypond
Polyphonic notation and piano music can also be printed. The following
-\score { \context Lyrics \notes {
+\score { \context LyricsVoice \notes {
\property Score.RehearsalMark \set #'self-alignment-X = #LEFT
\mark #(ly:export (string-append "(For LilyPond version "
\property Score.RehearsalMark \set #'self-alignment-X = #LEFT
\mark #(ly:export (string-append "(For LilyPond version "
\context Staff \notes\relative c'' {
gis1 s s gisis s s ges s s geses s s g!
}
\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
}
\property Lyrics . LyricText \set #'self-alignment-X = #-1
"sharp " "db. sharp " "flat " "db. flat " natural
}
\clef tenor c s s
\clef baritone c s s
}
\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
}
\property Lyrics . LyricText \override #'self-alignment-X = #-1
"Soprano " "Mezzosoprano " "Alto " "Tenor " Baritone
}
<g b d f> s s
<g b d f a> s s
}
<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 "
\property Lyrics . LyricText \set #'self-alignment-X = #-1
"major " "minor " "diminished " "augmented "
"seventh-chord " "ninth-chord "
\property Voice.TextScript \set #'padding = #-4
e^"~~ S" f g a b^"~~ S" c
}
\property Voice.TextScript \set #'padding = #-4
e^"~~ S" f g a b^"~~ S" c
}
- \context Lyrics \lyrics {
+ \context LyricsVoice \lyrics {
\property Voice.TextScript \set #'padding = #-4
e^"~~ S" f g a b^"~~ S" c d
}
\property Voice.TextScript \set #'padding = #-4
e^"~~ S" f g a b^"~~ S" c d
}
- \context Lyrics \lyrics {
+ \context LyricsVoice \lyrics {
\property Voice.TextScript \set #'padding = #-4
e1^"~~ S" f g a b^"~~ S" c d e
}
\property Voice.TextScript \set #'padding = #-4
e1^"~~ S" f g a b^"~~ S" c d e
}
- \context Lyrics \lyrics {
+ \context LyricsVoice \lyrics {
\property Voice.TextScript \set #'padding = #-4
b^"~~ S" c d e^"~~ S" f
}
\property Voice.TextScript \set #'padding = #-4
b^"~~ S" c d e^"~~ S" f
}
- \context Lyrics \lyrics {
+ \context LyricsVoice \lyrics {
g1 a
\property Voice.TextScript \set #'padding = #-4
b^"~~ S" c d e^"~~ S" f g }
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
Mixolydian
}
@end lilypond
\property Voice.TextScript \set #'padding = #-4
b^"~~ S" c d e^"~~ S" f g a
}
\property Voice.TextScript \set #'padding = #-4
b^"~~ S" c d e^"~~ S" f g a
}
- \context Lyrics \lyrics {
+ \context LyricsVoice \lyrics {
\property Voice.TextScript \set #'padding = #-4
e^"~~ S" f g a b^"~~ S" c
}
\property Voice.TextScript \set #'padding = #-4
e^"~~ S" f g a b^"~~ S" c
}
- \context Lyrics \lyrics {
+ \context LyricsVoice \lyrics {
\property Voice.TextScript \set #'padding = #-4
b^"~~ S" c d e^"~~ S" f g a
}
\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
"ancient minor"
}
@end lilypond
\property Voice.TextScript \set #'padding = #-4
b^"~~ S" c d e^"~~ S" f!^"~~ A" gis^"~~ S" a
}
\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
"Harmonic minor"
}
@end lilypond
b^"~~ S" c d e fis gis^"~~ S"
a g! f!^"~~ S" e d c^"~~ S" b a
}
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
"Melodic minor"
}
@end lilypond
\context Staff \notes\relative c'' {
gis1 s s as s s <des g,!> s s <cis g!> s s
}
\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"
}
\property Lyrics . LyricText \set #'self-alignment-X = #-1
"g sharp " "a flat " "dim fifth " "augm fourth"
}
-\context Lyrics \lyrics {
+\context LyricsVoice \lyrics {
\property Lyrics . LyricText \set #'self-alignment-X = #-1
"baritone "
"bass "
\property Lyrics . LyricText \set #'self-alignment-X = #-1
"baritone "
"bass "
\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 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$" }
-\context Lyrics \lyrics {
+\context LyricsVoice \lyrics {
\property Lyrics . LyricText \set #'self-alignment-X = #-1
"french violin clef "
"violin clef "
\property Lyrics . LyricText \set #'self-alignment-X = #-1
"french violin clef "
"violin clef "
\partial 4 c4 | f, g c2
\bar "|."
}
\partial 4 c4 | f, g c2
\bar "|."
}
- \context Lyrics \lyrics {
+ \context LyricsVoice \lyrics {
< g b! >^"major" s
< g bis >^"augm" s
}
< g b! >^"major" s
< g bis >^"augm" s
}
-\context Lyrics \lyrics {
+\context LyricsVoice \lyrics {
"unisone " "second " "second " "second "
"third " "third " "third " "third "
}
"unisone " "second " "second " "second "
"third " "third " "third " "third "
}
< g e'! >^"major" s
< g eis' >^"augm" s
}
< g e'! >^"major" s
< g eis' >^"augm" s
}
-\context Lyrics \lyrics {
+\context LyricsVoice \lyrics {
"fourth " "fourth " "fifth " "fifth "
"sixth " "sixth " "sixth " "sixth "
}
"fourth " "fourth " "fifth " "fifth "
"sixth " "sixth " "sixth " "sixth "
}
< g bes' >^"minor" s
< g b'! >^"major" s
}
< g bes' >^"minor" s
< g b'! >^"major" s
}
-\context Lyrics \lyrics {
+\context LyricsVoice \lyrics {
"seventh " "seventh " "seventh " "octave "
"none " "none " "decime " "decime "
}
"seventh " "seventh " "seventh " "octave "
"none " "none " "decime " "decime "
}
c4-.-( d-. e-.-) \bar "||"
c4-. d-. e-. \bar "||"
}
c4-.-( d-. e-.-) \bar "||"
c4-. d-. e-. \bar "||"
}
-\context Lyrics \lyrics {
+\context LyricsVoice \lyrics {
% \property Lyrics . LyricText \set #'font-style = #'large
a
b "" ""
% \property Lyrics . LyricText \set #'font-style = #'large
a
b "" ""
\context Staff \notes\relative c' {
c1 d e f g a b c
}
\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 } >>
}
<< { I II III IV V VI VII I }
{ T "" "" S D } >>
}
\key es \major
es8 c d bes c as bes16 as g f | es4
}
\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" } >>
}
<< { "" "6" "" "4" "" "6" "" "" "6" "4" }
{ "" "" "" "2" "" "" "" "" "" "2" } >>
}
Stem \set #'Y-extent-callback = ##f
minimumVerticalExtent = #'(-4.0 . 5.0)
} \mus
Stem \set #'Y-extent-callback = ##f
minimumVerticalExtent = #'(-4.0 . 5.0)
} \mus
+ \context LyricsVoice \nam
>>
\paper {
%% need to do this, because of indented @itemize
>>
\paper {
%% need to do this, because of indented @itemize
minimumVerticalExtent = #'(-3.0 . 4.0)
drumStyleTable = #timbales-style
} \mus
minimumVerticalExtent = #'(-3.0 . 4.0)
drumStyleTable = #timbales-style
} \mus
+ \context LyricsVoice \nam
Stem \set #'transparent = ##t
Stem \set #'Y-extent-callback = ##f
} \mus
Stem \set #'transparent = ##t
Stem \set #'Y-extent-callback = ##f
} \mus
+ \context LyricsVoice \nam
Stem \set #'transparent = ##t
Stem \set #'Y-extent-callback = ##f
} \mus
Stem \set #'transparent = ##t
Stem \set #'Y-extent-callback = ##f
} \mus
+ \context LyricsVoice \nam
Stem \set #'transparent = ##t
Stem \set #'Y-extent-callback = ##f
} \mus
Stem \set #'transparent = ##t
Stem \set #'Y-extent-callback = ##f
} \mus
- \context LyricsVoice \nam
+ \context LyricsVoiceVoice \nam
Lyrics are printed by interpreting them in a @internalsref{LyricsVoice} context:
@example
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
@end example
@cindex automatic syllable durations
hierarchy of staves and lyrics first, e.g.
@example
\context ChoirStaff \notes <<
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 Voice = soprano @{ @emph{music} @}
- \context LyricsVoice = tenor @{ s1 @}
+ \context LyricsVoiceVoice = tenor @{ s1 @}
\context Voice = tenorLyrics @{ @emph{music} @}
>>
@end example
\context Voice = tenorLyrics @{ @emph{music} @}
>>
@end example
@internalsref{Voice} identity is @code{duet}, so the identities of the
@internalsref{LyricsVoice}s are marked @code{duet-1} and @code{duet-2}:
@example
@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" @{
- \context LyricsVoice = "duet-2" @{
+ \context LyricsVoiceVoice = "duet-2" @{
Ooooo, ch\'e -- ri, je t'aime. @}
@end example
Ooooo, ch\'e -- ri, je t'aime. @}
@end example
- \context Lyrics \lyrics {
+ \context LyricsVoice \lyrics {
"shortfermata" "fermata" "longfermata" "verylongfermata"
} >>
}
"shortfermata" "fermata" "longfermata" "verylongfermata"
} >>
}
\version "2.1.7"
\header {
\version "2.1.7"
\header {
+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 {
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
void
Change_iterator::error (String reason)
{
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;
String warn1 = _f ("can't change `%s' to `%s'", to_type, to_id)
+ ": " + reason;
SCM lookup_identifier (String s);
void push_note_state (SCM tab);
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_markup_state ();
void push_figuredbass_state ();
- void push_chord_state ();
void push_lyric_state ();
void pop_state ();
void LexerError (char const *);
void push_lyric_state ();
void pop_state ();
void LexerError (char const *);
yy_push_state (figures);
}
void
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);
}
yy_push_state (chords);
}
void
My_lily_lexer::pop_state ()
{
void
My_lily_lexer::pop_state ()
{
+ if (YYSTATE == notes || YYSTATE == chords)
pitchname_tab_stack_ = gh_cdr (pitchname_tab_stack_);
yy_pop_state ();
}
pitchname_tab_stack_ = gh_cdr (pitchname_tab_stack_);
yy_pop_state ();
}
{
SCM sym = ly_symbol2scm (str.to_str0 ());
if ((YYSTATE == notes) || (YYSTATE == chords)) {
{
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);
if (gh_pair_p (handle)) {
yylval.scm = ly_cdr (handle);
THIS->lexer_->pop_state ();
}
THIS->lexer_->pop_state ();
}
SCM nn = THIS->lexer_->lookup_identifier ("chordmodifiers");
THIS->lexer_->chordmodifier_tab_ = alist_to_hashq (nn);
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());
Music * chm = MY_MAKE_MUSIC("UnrelativableMusic");
chm->set_mus_property ("element", $3->self_scm ());
scm_gc_unprotect_object ($3->self_scm());
Pitch_squash_engraver::acknowledge_grob (Grob_info i)
{
SCM newpos = get_property ("squashedPosition");
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);
}
{
i.grob_->set_grob_property ("staff-position", newpos);
}