From f9190dbeef516bfa931447ba46bbae6eaa941c4e Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Thu, 12 Feb 2004 02:05:54 +0000 Subject: [PATCH] * lily/chord-name.cc: remove props chord, bass, inversion. * Documentation/user/appendices.itely: add Scheme functions, context-properties and layout properties to manual. * scm/part-combiner.scm (determine-split-list): include rests in a solo1/2 sequence. * lily/new-part-combine-iterator.cc (substitute_both): new function. (class New_pc_iterator): add separate Voice=solo context, fixes autobeams going from chords to solo. --- ChangeLog | 15 ++++ Documentation/user/GNUmakefile | 4 + Documentation/user/appendices.itely | 12 ++- Documentation/user/cheatsheet.itely | 2 +- Documentation/user/internals.itely | 2 +- Documentation/user/introduction.itely | 2 +- Documentation/user/lilypond.tely | 2 +- Documentation/user/music-glossary.tely | 50 ++++++------ Documentation/user/tutorial.itely | 14 ++-- lily/chord-name.cc | 2 +- lily/new-part-combine-iterator.cc | 91 +++++++++++++++------- scm/define-grob-properties.scm | 29 ++++--- scm/define-translator-properties.scm | 10 +-- scm/document-backend.scm | 11 ++- scm/document-translation.scm | 18 ++--- scm/documentation-generate.scm | 55 +++++++++++++ scm/lily.scm | 3 +- scm/part-combiner.scm | 104 +++++++++++++++---------- 18 files changed, 282 insertions(+), 144 deletions(-) diff --git a/ChangeLog b/ChangeLog index 085a51ba29..2cf3e805fd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2004-02-12 Han-Wen Nienhuys + + * lily/chord-name.cc: remove props chord, bass, inversion. + + * Documentation/user/appendices.itely: add Scheme functions, + context-properties and layout properties to manual. + + * scm/part-combiner.scm (determine-split-list): include rests in a + solo1/2 sequence. + + * lily/new-part-combine-iterator.cc (substitute_both): new + function. + (class New_pc_iterator): add separate Voice=solo context, fixes + autobeams going from chords to solo. + 2004-02-11 Jan Nieuwenhuizen * Documentation/user/invoking.itexi (Editor support): Fix typo. diff --git a/Documentation/user/GNUmakefile b/Documentation/user/GNUmakefile index 79124a0347..09192b7e5a 100644 --- a/Documentation/user/GNUmakefile +++ b/Documentation/user/GNUmakefile @@ -60,6 +60,10 @@ extra-local-help: # Generic rule using % twice not possible? # $(outdir)/%/%.html: $(outdir)/%.texi +$(outdir)/lilypond.texi: $(outdir)/lilypond-internals.texi +$(outdir)/lilypond.nexi: $(outdir)/lilypond-internals.texi + + $(outdir)/lilypond/lilypond.html: $(outdir)/lilypond.texi mkdir -p $(dir $@) $(MAKEINFO) -I$(outdir) --output=$(outdir)/lilypond --html $< diff --git a/Documentation/user/appendices.itely b/Documentation/user/appendices.itely index eb0229825d..429c634401 100644 --- a/Documentation/user/appendices.itely +++ b/Documentation/user/appendices.itely @@ -4,7 +4,10 @@ @menu * Chord name chart:: * MIDI instruments:: -* The Feta font:: +* The Feta font:: +* Scheme functions:: +* Layout property overview:: +* Context property overview:: @end menu @@ -76,3 +79,10 @@ accessed directly using text markup such as @lilypondfile[noindent]{parmesan16list.ly} +@include scheme-functions.tely + +@include context-properties.tely + +@include layout-properties.tely + + diff --git a/Documentation/user/cheatsheet.itely b/Documentation/user/cheatsheet.itely index 44507391dd..3946457dc8 100644 --- a/Documentation/user/cheatsheet.itely +++ b/Documentation/user/cheatsheet.itely @@ -234,7 +234,7 @@ a\> a a\! @tab @lilypond[fragment,relative=1] \notes { g'4 g } - \lyricsto "" \new LyricsVoice \lyrics { twin -- kle } + \lyricsto "" \new Lyrics \lyrics { twin -- kle } @end lilypond @item @code{\chords @{ c:dim f:maj7 @}} diff --git a/Documentation/user/internals.itely b/Documentation/user/internals.itely index 9a0a738c4f..cf5f347b08 100644 --- a/Documentation/user/internals.itely +++ b/Documentation/user/internals.itely @@ -72,7 +72,7 @@ regularly. For example, beaming behavior is tuned with These use mixed-caps naming: @code{autoBeamSettings}, @code{ignoreMelismata}. They are assigned as follows: @example - \property LyricsVoice.ignoreMelismata = ... + \property Lyrics.ignoreMelismata = ... @end example @item Layout properties diff --git a/Documentation/user/introduction.itely b/Documentation/user/introduction.itely index ae051f5720..f86fed7764 100644 --- a/Documentation/user/introduction.itely +++ b/Documentation/user/introduction.itely @@ -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 LyricsVoice \lyrics { twin4 kle twin kle lit tle star2 } >> } + \context Lyrics \lyrics { twin4 kle twin kle lit tle star2 } >> } @end lilypond Polyphonic notation and piano music can also be printed. The following diff --git a/Documentation/user/lilypond.tely b/Documentation/user/lilypond.tely index b83b0dc075..cba83e5918 100644 --- a/Documentation/user/lilypond.tely +++ b/Documentation/user/lilypond.tely @@ -93,7 +93,7 @@ Copyright @copyright{} 1999--2004 by the authors @lilypond[raggedright] \score { - \context LyricsVoice \notes { + \context Lyrics \notes { \property Score.RehearsalMark \set #'self-alignment-X = #LEFT \mark #(ly:export (string-append "(For LilyPond version " (lilypond-version) ")")) diff --git a/Documentation/user/music-glossary.tely b/Documentation/user/music-glossary.tely index 08a60f90a1..570eeeff71 100644 --- a/Documentation/user/music-glossary.tely +++ b/Documentation/user/music-glossary.tely @@ -218,7 +218,7 @@ accidental. \context Staff \notes\relative c'' { gis1 s s gisis s s ges s s geses s s g! } -\context LyricsVoice \lyrics { +\context Lyrics \lyrics { \property Lyrics . LyricText \set #'self-alignment-X = #-1 "sharp " "db. sharp " "flat " "db. flat " natural } @@ -717,7 +717,7 @@ lines. \clef tenor c s s \clef baritone c s s } -\context LyricsVoice \lyrics { +\context Lyrics \lyrics { \property Lyrics . LyricText \override #'self-alignment-X = #-1 "Soprano " "Mezzosoprano " "Alto " "Tenor " Baritone } @@ -816,7 +816,7 @@ chords are denoted open chords s s s s } -\context LyricsVoice \lyrics{ +\context Lyrics \lyrics{ \property Lyrics . LyricText \set #'self-alignment-X = #-1 "major " "minor " "diminished " "augmented " "seventh-chord " "ninth-chord " @@ -1218,7 +1218,7 @@ also to some extent in newer jazz music. \property Voice.TextScript \set #'padding = #-4 e^"~~ S" f g a b^"~~ S" c } - \context LyricsVoice \lyrics { + \context Lyrics \lyrics { Ionian } @end lilypond @@ -1233,7 +1233,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 LyricsVoice \lyrics { + \context Lyrics \lyrics { Dorian } @end lilypond @@ -1247,7 +1247,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 LyricsVoice \lyrics { + \context Lyrics \lyrics { Phrygian } @end lilypond @@ -1262,7 +1262,7 @@ also to some extent in newer jazz music. \property Voice.TextScript \set #'padding = #-4 b^"~~ S" c d e^"~~ S" f } - \context LyricsVoice \lyrics { + \context Lyrics \lyrics { Lydian } @end lilypond @@ -1276,7 +1276,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 LyricsVoice \lyrics { + \context Lyrics \lyrics { Mixolydian } @end lilypond @@ -1291,7 +1291,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 LyricsVoice \lyrics { + \context Lyrics \lyrics { Aeolian } @end lilypond @@ -1311,7 +1311,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 LyricsVoice \lyrics { + \context Lyrics \lyrics { Major } @end lilypond @@ -1326,7 +1326,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 LyricsVoice \lyrics { + \context Lyrics \lyrics { "ancient minor" } @end lilypond @@ -1341,7 +1341,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 LyricsVoice \lyrics { + \context Lyrics \lyrics { "Harmonic minor" } @end lilypond @@ -1357,7 +1357,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 LyricsVoice \lyrics { + \context Lyrics \lyrics { "Melodic minor" } @end lilypond @@ -1699,7 +1699,7 @@ but equal pitch. \context Staff \notes\relative c'' { gis1 s s as s s s s s s } -\context LyricsVoice \lyrics { +\context Lyrics \lyrics { \property Lyrics . LyricText \set #'self-alignment-X = #-1 "g sharp " "a flat " "dim fifth " "augm fourth" } @@ -1780,7 +1780,7 @@ symbol indicates playing an octave lower (for example on double bass \clef "F_8" f1 } -\context LyricsVoice \lyrics { +\context Lyrics \lyrics { \property Lyrics . LyricText \set #'self-alignment-X = #-1 "baritone " "bass " @@ -1948,7 +1948,7 @@ variants of the base chords. \context Voice \notes\relative c'' { 1 < a f d > < b g e > < d b g > < e c a > < f d b > } -\context LyricsVoice \lyrics { T Sp Dp S D Tp "D{\\kern-5pt}$\\mid$" } +\context Lyrics \lyrics { T Sp Dp S D Tp "D{\\kern-5pt}$\\mid$" } @end lilypond @aitem{G} @@ -1994,7 +1994,7 @@ scores are notated like that). \clef "G_8" g s s } -\context LyricsVoice \lyrics { +\context Lyrics \lyrics { \property Lyrics . LyricText \set #'self-alignment-X = #-1 "french violin clef " "violin clef " @@ -2115,7 +2115,7 @@ section. @aref{functional harmony}. \partial 4 c4 | f, g c2 \bar "|." } - \context LyricsVoice \lyrics { + \context Lyrics \lyrics { T S D T } >> @@ -2211,7 +2211,7 @@ of such two forms an octave. < g b! >^"major" s < g bis >^"augm" s } -\context LyricsVoice \lyrics { +\context Lyrics \lyrics { "unisone " "second " "second " "second " "third " "third " "third " "third " } @@ -2232,7 +2232,7 @@ of such two forms an octave. < g e'! >^"major" s < g eis' >^"augm" s } -\context LyricsVoice \lyrics { +\context Lyrics \lyrics { "fourth " "fourth " "fifth " "fifth " "sixth " "sixth " "sixth " "sixth " } @@ -2253,7 +2253,7 @@ of such two forms an octave. < g bes' >^"minor" s < g b'! >^"major" s } -\context LyricsVoice \lyrics { +\context Lyrics \lyrics { "seventh " "seventh " "seventh " "octave " "none " "none " "decime " "decime " } @@ -2395,7 +2395,7 @@ unlike (b) @emph{leggiero} or @emph{non-legato}, (c) @emph{portato} and c4-.-( d-. e-.-) \bar "||" c4-. d-. e-. \bar "||" } -\context LyricsVoice \lyrics { +\context Lyrics \lyrics { % \property Lyrics . LyricText \set #'font-style = #'large a b "" "" @@ -3403,7 +3403,7 @@ sub@-do@-mi@-nant (S) and V = dominant (D). \context Staff \notes\relative c' { c1 d e f g a b c } -\context LyricsVoice \lyrics { +\context Lyrics \lyrics { << { I II III IV V VI VII I } { T "" "" S D } >> } @@ -4016,8 +4016,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 LyricsVoice \lyrics { - \property LyricsVoice . VerticalAlign \override #'threshold = #'(6 . 12) + \context Lyrics \lyrics { + \property Lyrics . VerticalAlign \override #'threshold = #'(6 . 12) << { "" "6" "" "4" "" "6" "" "" "6" "4" } { "" "" "" "2" "" "" "" "" "" "2" } >> } diff --git a/Documentation/user/tutorial.itely b/Documentation/user/tutorial.itely index 217bb4551e..d1e66e494f 100644 --- a/Documentation/user/tutorial.itely +++ b/Documentation/user/tutorial.itely @@ -1062,9 +1062,9 @@ surrounding them with @code{\lyrics @{ @dots{} @}}, for example, Like notes, lyrics are also a form of music, but they must not be printed on a staff, which is the default way to print music. To print -them as lyrics, they must be marked with @code{ \new LyricsVoice}: +them as lyrics, they must be marked with @code{ \new Lyrics}: @example - \new LyricsVoice \lyrics @{ I want to break free @} + \new Lyrics \lyrics @{ I want to break free @} @end example The melody for this song is as follows: @@ -1077,7 +1077,7 @@ The melody for this song is as follows: The lyrics can be set to these notes, combining both with the @code{\lyricsto} keyword: @example - \lyricsto "@var{name}" \new LyricsVoice @dots{} + \lyricsto "@var{name}" \new Lyrics @dots{} @end example where @var{name} identifies to which melody the lyrics should be aligned. In this case, there is only one melody, so we can leave it @@ -1092,7 +1092,7 @@ The final result is c8 \times 2/3 { f g g } \times 2/3 { g4( a2) } } - \lyricsto "" \new LyricsVoice \lyrics { I want to break free } + \lyricsto "" \new Lyrics \lyrics { I want to break free } >> \paper{ } } @@ -1114,7 +1114,7 @@ line}. It is entered as two underscores, i.e. \partial 8 c8 \times 2/3 { f g g } \times 2/3 { g4( a2) } } - \lyricsto "" \new LyricsVoice \lyrics { I want to break free __ } + \lyricsto "" \new Lyrics \lyrics { I want to break free __ } >> \paper{ } } @@ -1188,7 +1188,7 @@ a lead sheet, for example, << \context ChordNames \chords @{ @emph{chords} @} \notes @emph{the melody} - \lyricsto "" \new LyricsVoice \lyrics @{ @emph{the text} @} + \lyricsto "" \new Lyrics \lyrics @{ @emph{the text} @} >> \paper @{ @} @} @@ -1201,7 +1201,7 @@ a lead sheet, for example, \partial 8 c8 \times 2/3 { f g g } \times 2/3 { g4( a2) } } - \new LyricsVoice \lyricsto "" \lyrics { I want to break free __ } + \new Lyrics \lyricsto "" \lyrics { I want to break free __ } >> \paper{ raggedright = ##t } } diff --git a/lily/chord-name.cc b/lily/chord-name.cc index cfb21d18e9..50c5c43a76 100644 --- a/lily/chord-name.cc +++ b/lily/chord-name.cc @@ -36,5 +36,5 @@ Chord_name::after_line_breaking (SCM smob) ADD_INTERFACE (Chord_name, "chord-name-interface", "generate a chord name", - "pitches chord style inversion bass begin-of-line-visible"); + "begin-of-line-visible"); diff --git a/lily/new-part-combine-iterator.cc b/lily/new-part-combine-iterator.cc index 05fc2fa6b0..c45b7fd463 100644 --- a/lily/new-part-combine-iterator.cc +++ b/lily/new-part-combine-iterator.cc @@ -48,10 +48,17 @@ private: Status state_; Status playing_state_; + /* + TODO: this is getting of hand... + */ Interpretation_context_handle one_; Interpretation_context_handle two_; Interpretation_context_handle null_; Interpretation_context_handle shared_; + Interpretation_context_handle solo_; + + void substitute_both (Translator_group * to1, + Translator_group * to2); void kill_mmrest (Translator_group*); void chords_together (); @@ -98,13 +105,13 @@ New_pc_iterator::do_quit () if (second_iter_) second_iter_->quit(); + null_.set_translator (0); one_ .set_translator (0); two_.set_translator (0); shared_.set_translator (0); + solo_.set_translator (0); } - - Moment New_pc_iterator::pending_moment () const { @@ -133,10 +140,8 @@ New_pc_iterator::chords_together () { playing_state_ = TOGETHER; state_ = TOGETHER; - first_iter_->substitute_outlet (one_.get_outlet (), shared_.get_outlet ()); - first_iter_->substitute_outlet (null_.get_outlet (), shared_.get_outlet ()); - second_iter_->substitute_outlet (two_.get_outlet (), shared_.get_outlet ()); - second_iter_->substitute_outlet (null_.get_outlet (), shared_.get_outlet ()); + + substitute_both (shared_.get_outlet (), shared_.get_outlet()); } } @@ -162,11 +167,9 @@ New_pc_iterator::solo1 () else { state_ = SOLO1; - first_iter_->substitute_outlet (null_.get_outlet (), shared_.get_outlet ()); - first_iter_->substitute_outlet (one_.get_outlet (), shared_.get_outlet ()); - - second_iter_->substitute_outlet (two_.get_outlet (), null_.get_outlet ()); - second_iter_->substitute_outlet (shared_.get_outlet (), null_.get_outlet ()); + substitute_both (solo_.get_outlet (), + null_.get_outlet ()); + kill_mmrest (two_.get_outlet ()); kill_mmrest (shared_.get_outlet ()); @@ -181,6 +184,36 @@ New_pc_iterator::solo1 () playing_state_ = SOLO1; } } + +void +New_pc_iterator::substitute_both (Translator_group * to1, + Translator_group * to2) +{ + Translator_group *tos[] = {to1,to2}; + Music_iterator *mis[] = {first_iter_, second_iter_}; + Interpretation_context_handle *hs[] = { + &null_, + &one_, &two_, + &shared_, &solo_, + 0 + }; + + for (int i = 0; i < 2 ; i++) + { + for (int j = 0; hs[j]; j++) + if (hs[j]->get_outlet () != tos[i]) + mis[i]->substitute_outlet (hs[j]->get_outlet (), tos[i]); + } + + for (int j = 0; hs[j]; j++) + { + Translator_group* t = hs[j]->get_outlet (); + if (t != to1 && t != to2) + kill_mmrest (t); + } +} + + void New_pc_iterator::unisono (bool silent) { @@ -190,12 +223,8 @@ New_pc_iterator::unisono (bool silent) return; else { + substitute_both (shared_.get_outlet (), null_.get_outlet ()); - first_iter_->substitute_outlet (null_.get_outlet (), shared_.get_outlet ()); - first_iter_->substitute_outlet (one_.get_outlet (), shared_.get_outlet ()); - - second_iter_->substitute_outlet (two_.get_outlet (), null_.get_outlet ()); - second_iter_->substitute_outlet (shared_.get_outlet (), null_.get_outlet ()); kill_mmrest (two_.get_outlet ()); kill_mmrest (shared_.get_outlet ()); @@ -222,13 +251,7 @@ New_pc_iterator::solo2 () { state_ = SOLO2; - second_iter_->substitute_outlet (null_.get_outlet (), shared_.get_outlet ()); - second_iter_->substitute_outlet (two_.get_outlet (), shared_.get_outlet ()); - - first_iter_->substitute_outlet (one_.get_outlet (), null_.get_outlet ()); - first_iter_->substitute_outlet (shared_.get_outlet (), null_.get_outlet ()); - kill_mmrest (one_.get_outlet ()); - kill_mmrest (shared_.get_outlet ()); + substitute_both (null_.get_outlet (), solo_.get_outlet ()); if (playing_state_ != SOLO2) { @@ -253,14 +276,11 @@ New_pc_iterator::apart (bool silent) else { state_ = APART; - - first_iter_->substitute_outlet (null_.get_outlet (), one_.get_outlet ()); - first_iter_->substitute_outlet (shared_.get_outlet (), one_.get_outlet ()); - - second_iter_->substitute_outlet (null_.get_outlet (), two_.get_outlet ()); - second_iter_->substitute_outlet (shared_.get_outlet (), two_.get_outlet ()); } + substitute_both (one_.get_outlet (), two_.get_outlet ()); + } } + void New_pc_iterator::construct_children () { @@ -277,8 +297,19 @@ New_pc_iterator::construct_children () = get_outlet ()->find_create_translator (ly_symbol2scm ("Voice"), "shared",props); - shared_ .set_translator (tr); + shared_.set_translator (tr); + + /* + If we don't, we get a new staff for every Voice. + */ set_translator (tr); + + Translator_group *solo_tr + = get_outlet ()->find_create_translator (ly_symbol2scm ("Voice"), + "solo",props); + + solo_ .set_translator (solo_tr); + Translator_group *null = get_outlet ()->find_create_translator (ly_symbol2scm ("Devnull"), "", SCM_EOL); diff --git a/scm/define-grob-properties.scm b/scm/define-grob-properties.scm index 9a653f51b8..4386324049 100644 --- a/scm/define-grob-properties.scm +++ b/scm/define-grob-properties.scm @@ -20,7 +20,7 @@ ) ;; put this in an alist? -(define +(define-public all-user-grob-properties (map @@ -84,7 +84,6 @@ original molecule drawer to draw the balloon around.") (base-shortest-duration ,ly:moment? "Spacing is based on the shortest notes in a piece. Normally, pieces are spaced as if notes at least as short as this are present.") (baseline-skip ,ly:dimension? "Baseline skip to use for multiple lines of text.") - (bass ,list? " musical-pitch, optional.") (beam-thickness ,ly:dimension? "thickness, measured in staffspace.") (beam-width ,ly:dimension? "width of the tremolo sign.") (beamed-lengths ,list? "list of stem lengths given beam multiplicity .") @@ -231,7 +230,7 @@ exactly a factor 2 larger. Fractional values are allowed.") (force-hshift ,number? "amount of collision_note_width that overides automatic collision settings. This is used by -@ref{note-collision-interface}.") +@internalsref{note-collision-interface}.") (fraction ,number-pair? "fraction of a time signature.") (french-beaming ,boolean? "Use French @@ -251,7 +250,6 @@ name of character within font.") (grow-direction ,ly:dir? "crescendo or ,decrescendo?.") (hair-thickness ,number? "thickness, measured in linethickness.") - (head-pair ,pair? "Pair of grob pointers, pointing to the two heads of the tie.") (height ,ly:dimension? "in staffspace.") (height-limit ,ly:dimension? "Maximum slur height: the longer the @@ -259,11 +257,10 @@ slur, the closer it is to this height.") (horizontal-shift ,integer? "integer that identifies ranking of note-column for horizontal shifting. This is used by -@ref{note-collision-interface}.") +@internalsref{note-collision-interface}.") (ideal-distances ,list? "(OBJ . (DIST . STRENGTH)) pairs.") (inclinatum ,boolean? "is this neume an ,inclinatum?.") (interfaces ,list? "list of symbols indicating the interfaces supported by this object. Is initialized from the @code{meta} field.") - (inversion ,list? " musical-pitch, optional.") (join-heads ,boolean? "Whether to join the noteheads of an ambitus grob with a vertical line.") (kern ,ly:dimension? "amount of extra white space to add. For barline, space after a thick line.") @@ -300,12 +297,12 @@ measure. Used in some spacing situations.") noteheads in collisions, even if they have different note heads. The smaller of the two heads will be rendered invisible. This used polyphonic guitar notation. The value of this setting is used by -@ref{note-collision-interface} .") +@internalsref{note-collision-interface} .") (merge-differently-dotted ,boolean? " Merge noteheads in collisions, even if they have a different number of dots. This normal notation for some types of polyphonic music. The -value of this setting is used by @ref{note-collision-interface} .") +value of this setting is used by @internalsref{note-collision-interface} .") (meta ,list? "Contains meta information. It is an alist with the entries @code{name} and @code{interfaces}.") @@ -346,7 +343,6 @@ as a real penalty.") (pitch-max ,ly:pitch? "FIXME, JUNKME") (pitch-min ,ly:pitch? "FIXME, JUNKME") - (pitches ,list? "list of musical-pitch.") (quilisma ,boolean? "is this neume a ,quilisma?.") (positions ,pair? @@ -383,7 +379,7 @@ reference point. This is used in spacing. Making this larger will make the score tighter.") (shortest-duration-space ,ly:dimension? "Start with this much space for the shortest duration. This is explessed in @code{spacing-increment} as unit. See also -@ref{spacing-spanner-interface}.") +@internalsref{spacing-spanner-interface}.") (shortest-playing-duration ,ly:moment? "duration of the shortest playing in that column.") (shortest-starter-duration ,ly:moment? "duration of the shortest notes that starts exactly in this column.") (side-relative-direction ,ly:dir? "if set: get the direction from a different object, and multiply by this.") @@ -397,7 +393,7 @@ minimum-space or extra-space.") (spacing-increment ,number? "Add this much space for a doubled duration. Typically, the width of a note head. See also -@ref{spacing-spanner-interface}.") +@internalsref{spacing-spanner-interface}.") (spacing-procedure ,procedure? "procedure taking grob as argument. This is called after before-line-breaking-callback, but @@ -496,7 +492,7 @@ duration of a measure is a breve or longer.") ) -(define all-internal-grob-properties +(define-public all-internal-grob-properties (map (lambda (x) (apply define-internal-grob-property x)) @@ -560,10 +556,10 @@ did it's job. This ensures that a positioning is only done once.") ;; TODO: use interface for this! (chord-tremolo ,boolean? "if set, this beam is a tremolo. ") - (chord ,pair? "?") - (begin-of-line-visible ,boolean? "?") - (quant-score ,number? "Beam quanting score --- can be stored for debugging") + (begin-of-line-visible ,boolean? "Used for marking ChordNames that should only show changes.") + (head-pair ,pair? "Pair of grob pointers, pointing to the two heads of the tie.") + (quant-score ,number? "Beam quanting score -- can be stored for +debugging") (least-squares-dy ,number? "ideal beam slope, without damping.") (ligature-primitive-callback ,procedure? "callback that brews ligature head.") @@ -592,3 +588,4 @@ functions set spanner positions.") (append all-internal-grob-properties all-user-grob-properties)) + diff --git a/scm/define-translator-properties.scm b/scm/define-translator-properties.scm index 060d40599f..7e6ca259a5 100644 --- a/scm/define-translator-properties.scm +++ b/scm/define-translator-properties.scm @@ -21,7 +21,7 @@ symbol ) -(define all-user-translation-properties +(define-public all-user-translation-properties (map (lambda (x) (apply translator-property-description x)) @@ -180,7 +180,7 @@ for the full staff.") highest pitch on the instrument. This used by the automatic string selector for tab notation.") - (ignoreMelismata ,boolean? "Ignore melismata for this @ref{Lyrics}.") + (ignoreMelismata ,boolean? "Ignore melismata for this @internalsref{Lyrics}.") (instr ,markup? "see @code{instrument}") (instrument ,markup? "The name to print left of a staff. The @@ -375,11 +375,11 @@ Example: @end example This will create a start-repeat bar in this staff only. -Valid values are described in @ref{bar-line-interface}. +Valid values are described in @internalsref{bar-line-interface}. ") ))) -(define all-internal-translation-properties +(define-public all-internal-translation-properties (map (lambda (x) (set-object-property! (car x) 'internal-translation #t) @@ -443,7 +443,7 @@ Description of scripts. This is used by Script_engraver for typesetting note-sup ) )) -(define all-translation-properties +(define-public all-translation-properties (append all-user-translation-properties all-internal-translation-properties)) diff --git a/scm/document-backend.scm b/scm/document-backend.scm index 6ae393c7e5..12432f1422 100644 --- a/scm/document-backend.scm +++ b/scm/document-backend.scm @@ -170,21 +170,24 @@ node." (map interface-doc interface-description-alist) )) -(define (all-backend-properties-doc) +(define (backend-properties-doc-string lst) (let* ( - (ps (sort (map symbol->string all-backend-properties) stringstring lst) stringsymbol prop) 'backend #f)) ps)) (texi (description-list->texi descs)) ) + texi)) + +(define (all-backend-properties-doc) (make #:name "All backend properties" #:desc "All grob properties in a big list" - #:text texi) - )) + #:text (backend-properties-doc-string all-backend-properties))) + ;(dump-node (grob-doc (cdadr all-grob-descriptions)) (current-output-port) 0 ) (define (backend-doc-node) (make diff --git a/scm/document-translation.scm b/scm/document-translation.scm index b37bca9d98..d0de542f8d 100644 --- a/scm/document-translation.scm +++ b/scm/document-translation.scm @@ -274,24 +274,24 @@ #:children (map engraver-doc all-engravers-list))) -(define (all-translation-properties-doc) - +(define (translation-properties-doc-string lst) (let* - ( - (ps (sort (map symbol->string all-translation-properties) stringstring lst) stringsymbol ps)) (propdescs (map (lambda (x) (document-property x 'translation #f)) sortedsyms)) - (texi (description-list->texi propdescs)) - ) + (texi (description-list->texi propdescs))) + texi + )) +(define (all-translation-properties-doc) (make #:name "Context properties" - #:desc "All context properties" - #:text texi) - )) + #:desc "All context properties" + #:text (translation-properties-doc-string all-translation-properties)) + ) ;(dump-node (all-contexts-doc) (current-output-port) 0 ) diff --git a/scm/documentation-generate.scm b/scm/documentation-generate.scm index c0c0b13521..add5959e91 100644 --- a/scm/documentation-generate.scm +++ b/scm/documentation-generate.scm @@ -17,6 +17,8 @@ ;;;;;;;;;;;;;;;; TODO : make modules of these! ;;;;;;;;;;;;;;;; +; todo: naming: grob vs. layout property + (define load-files '("documentation-lib.scm" "document-functions.scm" "document-translation.scm" @@ -75,6 +77,34 @@ @end ifinfo +@macro internalsref{NAME} +@ref{\\NAME\\} +@end macro + +@ifhtml + +@macro inputfileref{DIR,NAME} +@uref{../../../../\\DIR\\/out-www/collated-files.html#\\NAME\\,@file{\\DIR\\/\\NAME\\}}@c +@end macro + +@end ifhtml + +@ifinfo + +@macro inputfileref{DIR,NAME} +@file{\\DIR\\/\\NAME\\} +@end macro + +@end ifinfo + +@iftex +@macro inputfileref{DIR,NAME}@c +@file{\\DIR\\/\\NAME\\}@c +@end macro +@end iftex + + + @ignore @omftitle LilyPond internals @omfcreator Han-Wen Nienhuys and Jan Nieuwenhuizen @@ -121,3 +151,28 @@ (dump-node top-node out-port 0) (newline (current-error-port)) + + +(dump-node (all-scheme-functions-doc) + (open-output-file "scheme-functions.tely") + 2) + +(dump-node + (make + #:name "Layout property overview" + #:desc "All user serviceable layout properties" + #:text (backend-properties-doc-string all-user-grob-properties)) + + (open-output-file "layout-properties.tely") + 2) + +(dump-node + (make + #:name "Context property overview" + #:desc "All user serviceable context properties" + #:text (translation-properties-doc-string all-user-translation-properties)) + + (open-output-file "context-properties.tely") + 2) + + diff --git a/scm/lily.scm b/scm/lily.scm index f678459426..7c86d27f24 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -443,6 +443,7 @@ L1 is copied, L2 not. (,boolean? . "boolean") (,char? . "char") (,grob-list? . "list of grobs") + (,hash-table? . "hash table") (,input-port? . "input port") (,integer? . "integer") (,list? . "list") @@ -450,7 +451,7 @@ L1 is copied, L2 not. (,ly:dimension? . "dimension, in staff space") (,ly:dir? . "direction") (,ly:duration? . "duration") - (,ly:grob? . "grob (GRaphical OBject)") + (,ly:grob? . "layout object") (,ly:input-location? . "input location") (,ly:input-location? . "input location") (,ly:moment? . "moment") diff --git a/scm/part-combiner.scm b/scm/part-combiner.scm index 82aaa7672c..10efcedce0 100644 --- a/scm/part-combiner.scm +++ b/scm/part-combiner.scm @@ -48,12 +48,13 @@ (define-class () (configuration #:init-value '() #:accessor configuration) (when-moment #:accessor when #:init-keyword #:when) + + ; voice-states are states starting with the Split-state or later + ; (is #:init-keyword #:voice-states #:accessor voice-states) (synced #:init-keyword #:synced #:init-value #f #:getter synced?) ) - - (define-method (write (x ) f) (display (when x) f) (display " = " f) @@ -449,81 +450,102 @@ Only set if not set previously. )) (define (put-range x a b) - (display (list "put range " x a b "\n")) +; (display (list "put range " x a b "\n")) (do ((i a (1+ i))) ((> i b) b) (set! (configuration (vector-ref result i)) x) )) + (define (put x) - - (display (list "putting " x "\n")) - (set! (configuration (vector-ref result ri)) x)) - +; (display (list "putting " x "\n")) + + (set! (configuration (vector-ref result ri)) x)) + + (define (current-voice-state now-state voice-num) + (define vs ((if (= 1 voice-num) car cdr) + (voice-states now-state) ) ) + (if (equal? (when now-state) (when vs)) + vs + (previous-voice-state vs) + )) + (define (try-solo type start-idx current-idx) "Find a maximum stretch that can be marked as solo. Only set the mark when there are no spanners active." (if (< current-idx (vector-length result)) (let* ((now-state (vector-ref result current-idx)) - (solo-state ((if (equal? type 'solo1) car cdr) (voice-states now-state))) - (silent-state ((if (equal? type 'solo1) cdr car) (voice-states now-state))) + (solo-state (current-voice-state now-state (if (equal? type 'solo1) 1 2))) + + (silent-state (current-voice-state now-state (if (equal? type 'solo1) 2 1))) (silent-notes (if silent-state (note-events silent-state) '())) (solo-notes (if solo-state (note-events solo-state) '())) + (soln (length solo-notes)) (siln (length silent-notes))) + (display (list "trying " type " at " (when now-state) solo-state silent-state "\n")) (cond ((not (equal? (configuration now-state) 'apart)) current-idx) - ((= soln 0) current-idx) - ((> siln 0) current-idx) - ((null? (span-state solo-state)) + ((> siln 0) start-idx) + + ((and + ; + ; This includes rests. This isn't a problem: long rests + ; will be shared with the silent voice, and be marked + ; as unisilence. Therefore, long rests won't + ; accidentally be part of a solo. + ; + (null? (span-state solo-state))) (put-range type start-idx current-idx) - current-idx) + (try-solo type (1+ current-idx) (1+ current-idx))) (else (try-solo type start-idx (1+ current-idx))) )) - (1- current-idx))) - + start-idx)) ; try-solo + + (define (analyse-moment ri) - "Analyse 'apart starting at RI. Return next index. " + "Analyse 'apart starting at RI. Return next index. " (let* ((now-state (vector-ref result ri)) - (vs1 (car (voice-states now-state))) - (vs2 (cdr (voice-states now-state))) + (vs1 (current-voice-state now-state 1)) + (vs2 (current-voice-state now-state 2)) +; (vs1 (car (voice-states now-state))) +; (vs2 (cdr (voice-states now-state))) (notes1 (if vs1 (note-events vs1) '())) (notes2 (if vs2 (note-events vs2) '())) (n1 (length notes1)) (n2 (length notes2)) ) - (display (list "analysing " (when now-state) - "\n1= " vs1 - "\n2= " vs2 - "\n")) + (display (list "analyzing step " ri " moment " (when now-state) vs1 vs2 "\n")) + - (cond - ((and (= n1 0) (= n2 0)) - (put 'apart-silence) - (1+ ri) ) - - ((and (= n2 0) - (equal? (when vs1) (when now-state)) - (null? (previous-span-state vs1))) - (try-solo 'solo1 ri ri)) - ((and (= n1 0) - (equal? (when vs2) (when now-state)) - (null? (previous-span-state vs2))) - (try-solo 'solo2 ri ri)) - (else - (1+ ri)) - ))) + (max ; we should always increase. + (cond + ((and (= n1 0) (= n2 0)) + (put 'apart-silence) + (1+ ri) ) + + ((and (= n2 0) + (equal? (when vs1) (when now-state)) + (null? (previous-span-state vs1))) + (try-solo 'solo1 ri ri)) + ((and (= n1 0) + (equal? (when vs2) (when now-state)) + (null? (previous-span-state vs2))) + (try-solo 'solo2 ri ri)) + (else (1+ ri) )) + (1+ ri)) + )) ; analyse-moment (if (< ri (vector-length result)) (if (equal? (configuration (vector-ref result ri)) 'apart) (analyse-solo12 (analyse-moment ri)) - (analyse-solo12 (1+ ri)))) ) + (analyse-solo12 (1+ ri)))) ) ; analyse-solo12 (analyse-spanner-states voice-state-vec1) @@ -541,7 +563,7 @@ the mark when there are no spanners active." (analyse-time-step 0) ; (display result) -; (analyse-a2 0) + (analyse-a2 0) ; (display result) (analyse-solo12 0) (display result) @@ -550,7 +572,7 @@ the mark when there are no spanners active." (lambda (x) (cons (when x) (configuration x))) (vector->list result))) - (if pc-debug (display result)) +; (if pc-debug (display result)) result)) -- 2.39.5