From: Han-Wen Nienhuys Date: Fri, 13 Jun 2003 18:55:10 +0000 (+0000) Subject: * scm/chord-generic-names.scm: move from X-Git-Tag: release/1.7.21~11 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=2cdd314bb0c89ace31c26e5c96c1627618a8bfbc;p=lilypond.git * scm/chord-generic-names.scm: move from double-plus-new-chord-name.scm * input/test/orchestscore.ly: remove file * Documentation/user/refman.itely (Vocal music): update documentation. * scm/define-translator-properties.scm (chordNoteNamer): remove chordNameStyle * scm/chord-name.scm (set-chord-name-style): remove set-chord-name-style. --- diff --git a/ChangeLog b/ChangeLog index 806eb8c8bc..841ca088be 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2003-06-13 Han-Wen Nienhuys + + * scm/chord-generic-names.scm: move from + double-plus-new-chord-name.scm + + * input/test/orchestscore.ly: remove file + + * Documentation/user/refman.itely (Vocal music): update documentation. + + * scm/define-translator-properties.scm (chordNoteNamer): remove + chordNameStyle + + * scm/chord-name.scm (set-chord-name-style): remove + set-chord-name-style. + 2003-06-12 Han-Wen Nienhuys * Documentation/user/lilypond-book.itely (Integrating LaTeX and @@ -262,6 +277,8 @@ 2003-05-26 Han-Wen Nienhuys + * VERSION: release 1.7.20 + * lily/text-spanner.cc (brew_molecule): clean up function. This fixes bugs with broken 8va spanners. diff --git a/Documentation/user/appendices.itely b/Documentation/user/appendices.itely index f1a661120a..86c0a5fe29 100644 --- a/Documentation/user/appendices.itely +++ b/Documentation/user/appendices.itely @@ -12,27 +12,6 @@ @node Lyrics mode definition @section Lyrics mode definition -The definition of lyrics mode is ludicrous, and this will remain so -until the authors of LilyPond acquire a deeper understanding of -character encoding, or someone else steps up to fix this. - - -A word in Lyrics mode begins with: an alphabetic character, @code{_}, -@code{?}, @code{!}, @code{:}, @code{'}, the control characters @code{^A} -through @code{^F}, @code{^Q} through @code{^W}, @code{^Y}, @code{^^}, -any 8-bit character with ASCII code over 127, or a two-character -combination of a backslash followed by one of @code{`}, @code{'}, -@code{"}, or @code{^}. - -Subsequent characters of a word can be any character that is not a digit -and not white space. One important consequence of this is that a word -can end with `@code{@}}', which may be confusing. However, LilyPond will -issue a warning. Any @code{_} character which appears in an unquoted -word is converted to a space. This provides a mechanism for introducing -spaces into words without using quotes. Quoted words can also be used -in Lyrics mode to specify words that cannot be written with the above -rules. - @node American Chords @section American Chords diff --git a/Documentation/user/refman.itely b/Documentation/user/refman.itely index 09572cdd07..2f87bb7dfa 100644 --- a/Documentation/user/refman.itely +++ b/Documentation/user/refman.itely @@ -56,7 +56,6 @@ * Skips:: * Durations:: * Ties:: -* Automatic note splitting :: * Tuplets:: * Easy Notation note heads :: @end menu @@ -504,6 +503,7 @@ shown on screen. See @ref{Point and click} for more information. * Relative octaves:: * Bar check:: * Skipping corrected music:: +* Automatic note splitting :: @end menu @@ -2968,111 +2968,201 @@ The associated object is @internalsref{VoiceFollower}. @node Vocal music @section Vocal music -For a discussion of how to put lyrics into a score, see section -@code{Printing lyrics} in the tutorial. +This section discusses how to enter, and print lyrics. -@cindex context variables -@cindex setting context variables -An interpretation context has variables that tune its behavior. These -variables are also called @emph{properties}. The @code{autoBeaming} -variable in a @code{Staff} controls whether 8th and shorter notes are -beamed automatically. Setting the variable to @code{##f}, which is the -boolean value @var{false}, turns it off. +@menu +* Entering lyrics:: +* The Lyrics context:: +* More stanzas:: +* Ambitus:: +@end menu +@node Entering lyrics +@subsection Entering lyrics -This will create an extender, which is a line -that extends over the entire duration of the lyric. This line will -run all the way to the start of the next lyric, so you may want to -shorten it by using a blank lyric (using @code{_}). -@cindex lyric mode +@cindex lyrics @cindex @code{\lyrics} +@cindex punctuation + +Lyrics are entered in a special input mode. This mode is is introduced +by the keyword @code{\lyrics}. In this mode you can enter lyrics, with +punctuation and accents without any hassle. Syllables are entered like +notes, but with pitches replaced by text. For example, +@example + \lyrics @{ Twin-4 kle4 twin- kle litt- le star2 @} +@end example - To get them printed, you must do two -things: indicate that lyrics are entered with @code{\lyrics}, and -indicate that this type of music must be interpreted as texts (and not -notes). This is done with @code{\context Lyrics}. +A word in Lyrics mode begins with: an alphabetic character, @code{_}, +@code{?}, @code{!}, @code{:}, @code{'}, the control characters @code{^A} +through @code{^F}, @code{^Q} through @code{^W}, @code{^Y}, @code{^^}, +any 8-bit character with ASCII code over 127, or a two-character +combination of a backslash followed by one of @code{`}, @code{'}, +@code{"}, or @code{^}. + +Subsequent characters of a word can be any character that is not a digit +and not white space. One important consequence of this is that a word +can end with @code{@}}. The following example is usually a bug. The +syllable includes a @code{@}}, and hence the opening brace is not balanced. +@example + \lyrics @{ twinkle@} +@end example +which may be confusing. -You can enter lyrics in a special input mode of LilyPond. This mode is -called Lyrics mode, and it is introduced by the keyword -@code{\lyrics}. In this mode you can enter lyrics, with punctuation -and accents without any hassle. Syllables are entered like notes, but -with pitches replaced by text. For example, +@cindex @code{\property}, in @code{\lyrics} +Similarly, a period following a alphabetic sequence, is included in the +resulting string. As a consequence, spaces must be inserted around +@code{\property} commands: @example - Twin- kle twin- kle + \property Lyrics . LyricText \set #'font-shape = #'italic @end example +@cindex @code{_} +@cindex spaces, in lyrics +@cindex quotes, in lyrics +Any @code{_} character which appears in an unquoted word is converted +to a space. This provides a mechanism for introducing spaces into words +without using quotes. Quoted words can also be used in Lyrics mode to +specify words that cannot be written with the above rules: +@example + \lyrics @{ He said: "\"Let" my peo ple "go\"" @} +@end example -You can use ordinary hyphens at the end of a syllable, i.e. +@cindex hyphens +Hyphens can be entered as ordinary hyphens at the end of a syllable, i.e. @example soft- ware @end example -but then the hyphen will be attached to the end of the first syllable. - -If you want them centered between syllables you can use the special -`@code{-}@code{-}' lyric as a separate word between syllables. The -hyphen will have variable length depending on the space between -the syllables and it will be centered between the syllables. +These will be attached to the end of the first syllable. +Centered hyphens are entered using the special `@code{-}@code{-}' lyric +as a separate word between syllables. The hyphen will have variable +length depending on the space between the syllables and it will be +centered between the syllables. +@cindex melisma +@cindex extender -Normally the notes that you enter are transformed into note heads. -Note heads alone make no sense. They need surrounding information: a -key signature, a clef, staff lines, etc. They need @emph{context}. -In LilyPond, these symbols are created by objects called -`interpretation contexts'. Interpretation contexts exist for -generating notation (`notation context') and for generating sound -(`performance context'). These objects only exist while LilyPond is -executing. For lyrics, the command -@example - \context Lyrics -@end example -must be used to interpret a set of syllables as lyrics. +When a lyric is sung over many notes (this is called a melisma), this is +indicated with a horizontal line centered between a syllable and the +next one. Such a line is called an extender line, and it is entered as +@code{__}. + +@seealso + +@internalsref{LyricEvent}, @internalsref{HyphenEvent}, +@internalsref{ExtenderEvent}. +@refbugs +The definition of lyrics mode is too complex. -@cindex context -@cindex interpretation context -@cindex notation context +@node The Lyrics context +@subsection The Lyrics context +Lyrics are printed by interpreting them in @internalsref{Lyrics} +context: +@example + \context Lyrics \lyrics @dots{} +@end example +@cindex automatic syllable durations +@cindex @code{\addlyrics} +@cindex lyrics and melodies -The melody and the lyrics can be combined with the @code{\addlyrics}: +This will place the lyrics according to the durations that were +entered. The lyrics can also be aligned under a given melody +automatically. In this case, it is no longer necessary to enter the +correct duration for each syllable. This is achieved by combining the +melody and the lyrics with the @code{\addlyrics} expression @example \addlyrics - \notes \relative c' @dots{} - \context Lyrics \lyrics @dots{} + \notes @dots{} + \context Lyrics @dots{} @end example -[TODO: Move lyrics section from tutorial to here?] +@cindex staff order, with @code{\addlyrics} + +Normally, this will put the lyrics below the staff. For different or +more complex orderings, the best way is to setup the hierarchy of +staffs and lyrics first, e.g. +@example +\context ChoirStaff \notes < + \context Lyrics = LA @{ s1 @} + \context Staff = SA @{ s1 @} + \context Lyrics = LB @{ s1 @} + \context Staff = SB @{ s1 @} +> +@end example +and then combine the appropriate melodies and lyric lines: +@example + \addlyrics + \context Staff = SA @emph{the music} + \context Lyrics = LA @emph{the lyrics} +@end example -See also the sections on @ref{Slurs} and @ref{Breath marks}. +putting both together, you would get +@example +\context ChoirStaff \notes < + \context Lyrics = LA @dots{} + \context Staff = SB @dots{} + \addlyrics @dots{} +> +@end example -[TODO: Move slurs / breath marks section to here?] +@cindex SATB +@cindex choral score -[TODO: Write subsection upon usage of ChoirStaff.] +An example of a SATB score setup is in the file +@inputfileref{input/template,satb}. -@menu -* More stanzas:: -* Ambitus:: -@end menu +@seealso + +@internalsref{LyricCombineMusic}, @internalsref{Lyrics}, +@inputfileref{input/template,satb}. + +@refbugs + +@code{\addlyrics} is not automatic enough: melismata are not detected +automatically, and melismata are not stopped when they hit a rest. @node More stanzas @subsection More stanzas -@cindex phrasing +@cindex phrasing, in lyrics + +When multiple stanzas are printed underneath each other, the vertical +groups of syllables should be aligned around punctuation. This can be +done automatically when corresponding lyric lines and melodies are +marked. + +To this end, give the @internalsref{Voice} context an identity, +@example +\context Voice = duet @{ + \time 3/4 + g2 e4 a2 f4 g2. @} +@end example -If you have multiple stanzas printed underneath each other, the vertical -groups of syllables should be aligned around punctuation. LilyPond can -do this if you tell it which lyric lines belong to which melody. -We show how you can do this by showing how you could print a frivolous -fragment of a fictional Sesame Street duet. +Then set the @internalsref{LyricsVoice} contexts to names starting with +that identity followed by a dash. In the preceding example, the +@internalsref{Voice} identity is @code{duet}, so the identities of the +@internalsref{LyricsVoices} are marked @code{duet-1} and @code{duet-2}. +@example + \context LyricsVoice = "duet-1" @{ + Hi, my name is bert. @} + \context LyricsVoice = "duet-2" @{ + Ooooo, ch\'e -- ri, je t'aime. @} +@end example +The convention for naming @internalsref{LyricsVoice} and +@internalsref{Voice} must also be used to get melismata on rests +correct. +The complete example is shown here. @lilypond[singleline,verbatim] \score { \addlyrics @@ -3089,30 +3179,10 @@ fragment of a fictional Sesame Street duet. } @end lilypond -To this end, give the Voice context an identity, and set the -LyricsVoice to a name starting with that identity followed by a dash. -In the following example, the Voice identity is @code{duet}, -@example -\context Voice = duet @{ - \time 3/4 - g2 e4 a2 f4 g2. @} -@end example -and the -identities of the LyricsVoices are @code{duet-1} and @code{duet-2}. -@example - \context LyricsVoice = "duet-1" @{ - Hi, my name is bert. @} - \context LyricsVoice = "duet-2" @{ - Ooooo, ch\'e -- ri, je t'aime. @} -@end example -The convention for naming @code{LyricsVoice} and @code{Voice} must -also be used to get melismata on rests correct. - - -We add the names of the singers. This can be done by setting +Stanza numbers, or the names of the singers can be added by setting @code{LyricsVoice.Stanza} (for the first system) and -@code{LyricsVoice.stz} for the following systems. You must -surround dots with spaces in @code{\lyrics} mode. +@code{LyricsVoice.stz} for the following systems. Notice how dots are +surrounded with spaces in @code{\lyrics} mode. @example \property LyricsVoice . stanza = "Bert" @@ -3120,17 +3190,9 @@ surround dots with spaces in @code{\lyrics} mode. \property LyricsVoice . stanza = "Ernie" @end example - - - -For entering quotes in Lyrics mode, use the following -@example -"\"God\"" is "`King'" -@end example - You can use empty syllables, e.g. @code{_4} or @code{" "4} to enter lyrics. This can confuse the LilyPond -- for example, this might put -(empty) lyrics under rests. To remedy this, use @code{\skip}. +(empty) lyrics under rests. To remedy this, use @code{\skip} instead. diff --git a/input/test/chord-names-dpnj.ly b/input/test/chord-names-dpnj.ly index 8a6f06e838..8efebb5989 100644 --- a/input/test/chord-names-dpnj.ly +++ b/input/test/chord-names-dpnj.ly @@ -101,8 +101,7 @@ epartial = #(sequential-music-to-chord-exceptions epartialmusic #f) %% FIXME %%\property ChordNames.chordNoteNamer = #'step->markup-ignatzek %%chordRootNamer = #note-name->markup - - #(set-chord-name-style 'jazz) + \property ChordNames.chordNameFunction = #jazz-chord-names \chs } diff --git a/input/test/coriolan-margin.ly b/input/test/coriolan-margin.ly index 1d4f8605eb..65f7d7bf0a 100644 --- a/input/test/coriolan-margin.ly +++ b/input/test/coriolan-margin.ly @@ -14,7 +14,7 @@ texidoc = "@cindex Orchestra Score @cindex Coriolan Score -Demonstration of how to set up an orchestral score (Bethoven's Coriolan overture). +Demonstration of how to set up an orchestral score (Beethoven's Coriolan overture). " } raisedFlat = \markup { \raise #0.4 \smaller \smaller \musicglyph #"accidentals--1" } @@ -37,7 +37,6 @@ oboi = \notes \relative c' { } clarinetti = \notes \relative c' { -% \property Staff.instrument = #`("Clarinetti in B" ,text-flat) \property Staff.instrument = \markup { \column << "Clarinetti" { "in B" \raisedFlat } >> } \property Staff.instr diff --git a/input/test/dpncnt.ly b/input/test/dpncnt.ly index b224175325..4d7f5e7b9f 100644 --- a/input/test/dpncnt.ly +++ b/input/test/dpncnt.ly @@ -1,8 +1,10 @@ \version "1.7.18" \header { - texidoc = "test file for new-new-chord names, ie, double-plus-new-chord-name -" + +texidoc = "test file for new-new-chord names, ie, chord-generic-names + " + } efullmusic = \notes { @@ -94,13 +96,9 @@ ch = \notes \transpose c c' \score{ < \context ChordNames { - % #(set-chord-name-style 'jazz) - % #(set-chord-name-style 'double-plus-new-banter) - % #(set-chord-name-style 'double-plus-new-jazz) - - #(set-chord-name-style 'banter) + \property ChordNames.chordNameFunction = #banter-chord-names \ch - #(set-chord-name-style 'jazz) + \property ChordNames.chordNameFunction = #jazz-chord-names \ch } diff --git a/input/test/equaliser.ly b/input/test/equaliser.ly index be6dd85d4e..af0859756d 100644 --- a/input/test/equaliser.ly +++ b/input/test/equaliser.ly @@ -21,8 +21,8 @@ oboi = \notes \relative c' { clarinetti = \notes \relative c' { \property Staff.midiInstrument = #"clarinet" - \property Staff.instrument = #`(lines "2 Clarinetti" (columns "(B" (music "accidentals--1") ")")) - \property Staff.instr = #`(lines "Cl."(columns "(B" (music "accidentals--1") ")")) + \property Staff.instrument = #"Clarinetti" + \property Staff.instr = #"Cl" R1*2 c1 R1*8 } @@ -38,16 +38,16 @@ fagotti = \notes \relative c' { corni = \notes \relative c' { \property Staff.midiInstrument = #"french horn" - \property Staff.instrument = #`(lines "2 Corni" (columns "(E" (music "accidentals--1") ")")) - \property Staff.instr = #`(lines "Cor." (columns "(E" (music "accidentals--1") ")")) + \property Staff.instrument = #"Corni" + \property Staff.instr = #"Cor" R1*4 c1 R1*6 } trombe = \notes \relative c' { \property Staff.midiInstrument = #"trumpet" - \property Staff.instrument = #'(lines "2 Trombe" "(C)") - \property Staff.instr = #'(lines "Tbe." "(C)") + \property Staff.instrument = #"Trombe" + \property Staff.instr = #"Tp." \clef bass R1*5 c1 R1*5 @@ -55,7 +55,7 @@ trombe = \notes \relative c' { timpani = \notes \relative c' { \property Staff.midiInstrument = #"timpani" - \property Staff.instrument = #'(lines "Timpani" "(C-G)") + \property Staff.instrument = #"Timpani" \property Staff.instr = #"Timp." R1*6 c1 R1*4 @@ -89,8 +89,8 @@ viola = \notes \relative c' { violoncello = \notes \relative c' { \property Staff.midiInstrument = #"cello" %\property Staff.midiInstrument = #"contrabass" - \property Staff.instrument = #'(lines "Violoncello" "e" "Contrabasso") - \property Staff.instr = #'(lines "Vc." "Cb.") + \property Staff.instrument = #"Violoncello" + \property Staff.instr = #"Vc." \clef bass R1*10 c1 diff --git a/input/test/orchestscore.ly b/input/test/orchestscore.ly deleted file mode 100644 index 76ff1a0ab6..0000000000 --- a/input/test/orchestscore.ly +++ /dev/null @@ -1,116 +0,0 @@ -\version "1.7.19" -\header{ - latexpackages="graphicx" -} - - - -m = \notes \relative c''{ - -c1 | c2 c | c c | c c | \break c c | c c | c c | c c | -} - -M = \notes \relative c''{ - -c1 | c2 c | c c | R1*5 -} - -\score{ < - \context StaffGroup = wood < - \context Staff = flauto < - %"\\rotatebox[origin=c]{90}{Flauto}" - - \property Staff.instrument = "Flauto" - \property Staff.instr = "Fl." - \m - > - \context Staff = oboe < - \property Staff.instrument = "Oboe" - \property Staff.instr = "Ob." - \m - > - \context Staff = clarI < - \property Staff.instrument = "Clarinetto I" - \property Staff.instr = "Cl. I" - \m - > - \context Staff = clarII < - \property Staff.instrument = "Clarinetto II" - \property Staff.instr = "Cl. II" - \m - > - \context Staff = fagotto < - \property Staff.instrument = "Fagotto" - \property Staff.instr = "Fg." - \m - > - > - \context StaffGroup = brass < - \context Staff = cor < - \property Staff.instrument = "2 Corni in F" - \property Staff.instr = "Cor." - \context Voice = corI { \stemUp \M } - \context Voice = corII { \stemDown \M } - > - \context Staff = trp < - \property Staff.instrument = #`(columns "2 Trp. in B " (music "accidentals--1")) - \property Staff.instr = "Trp." - \context Voice = trpI { \stemUp \M } - \context Voice = trpII { \stemDown \M } - > - > - \context StaffGroup = percussion <\context Staff = timpani < - \property Staff.instrument = "Timpani" - \property Staff.instr = "Timp." - \notes{c''1 R1*8} - > - > - \context StaffGroup = strings < - \context GrandStaff = violins < - \context Staff = viI < - \property Staff.instrument = "Violin I" - \property Staff.instr = "Vi. I" - \m - > - \context Staff = viII < - \property Staff.instrument = "Violin II" - \property Staff.instr = "Vi. II" - \m - > - > - \context Staff = vla < - \property Staff.instrument = "Viola" - \property Staff.instr = "Vla." - \m - > - \context Staff = vlc < - %% \property Staff.instrument = "Violoncello" - \property Staff.instrument = #'(lines "Violoncello" "e" "Contrabasso") - \property Staff.instr = "Vlc" - \m - > - \context Staff = cb < - \property Staff.instrument = "Contrabasso" - \property Staff.instr = "C.B." - \m - > - > -> - \paper { -% \paperSixteen - linewidth = 185.\mm - textheight = 260.\mm - \translator { - \OrchestralScoreContext - skipBars = ##t - RehearsalMark \override #'padding = #4 - BarNumber \override #'padding = #3 - RestCollision \override #'maximum-rest-count = #1 - %% FIXME marginScriptHorizontalAlignment = #1 - } - \translator { \RemoveEmptyStaffContext - } - } -} - -%% new-chords-done %% diff --git a/input/test/part-combine-score.ly b/input/test/part-combine-score.ly index 32db7e5316..7d7f33c8c2 100644 --- a/input/test/part-combine-score.ly +++ b/input/test/part-combine-score.ly @@ -5,9 +5,11 @@ texidoc="Template for part-combining orchestral scores" } \include "paper16.ly" -% \include "mutopia/Coriolan/coriolan-paper.ly" -#(define text-flat '((font-relative-size . -2 ) (music "accidentals--1"))) + +raisedFlat = \markup { \raise #0.4 \smaller \smaller \musicglyph #"accidentals--1" } + + End = { \skip 1*9 \bar "|." } @@ -45,11 +47,11 @@ flautiStaff = \notes \context VoiceCombineStaff = flauti < % \property VoiceCombineStaff.instrument = #"2 Flauti" % \property VoiceCombineStaff.instr = #"Fl." - \property VoiceCombineStaff.instrument = #`((kern . 0.5) (lines - "2 Clarinetti" (columns "(B" ,text-flat ")"))) + \property VoiceCombineStaff.instrument = + \markup { \column << "Clarinetti" { "in B" \raisedFlat } >> } - \property VoiceCombineStaff.instr = #`((kern . 0.5) (lines - "Cl." (columns "(B" ,text-flat ")"))) + \property VoiceCombineStaff.instr + = \markup { \smaller { "Cl(B" \raisedFlat ")" } } %\global \context VoiceCombineVoice=one \partcombine VoiceCombineVoice @@ -148,10 +150,9 @@ bassiGroup = \context PianoStaff = bassi_group \notes < \property StaffCombineStaff.midiInstrument = #"cello" % Ugh, markup burps - \property StaffCombineStaff.instrument = #'((kern . 0.5) - (lines "Violoncello" (columns " e") (columns "Contrabasso"))) + \property StaffCombineStaff.instrument = \markup \column << "Violoncello" "e" "Contrabasso" >> + \property StaffCombineStaff.instr = \markup \column << "Vc." "Cb." >> - \property StaffCombineStaff.instr = #"Vc." %\clef "bass" % Ugh, clef broken in 1.3.125 diff --git a/input/test/trill.ly b/input/test/trill.ly index 3ef7a2c3a2..afdd4c4f9d 100644 --- a/input/test/trill.ly +++ b/input/test/trill.ly @@ -12,15 +12,17 @@ texidoc="show trill line type" \property Voice.Stem \override #'transparent = ##t \property Voice.TextSpanner \set #'type = #'dotted-line \property Voice.TextSpanner \set #'edge-height = #'(0 . 1.5) - \property Voice.TextSpanner \set #'edge-text = #'("8va " . "") + \property Voice.TextSpanner \set #'edge-text = #'("bla " . "") a#(ly:export (make-span-event 'TextSpanEvent START)) b c a #(ly:export (make-span-event 'TextSpanEvent STOP)) %\property Voice.TextSpanner \set #'font-family = #'music \property Voice.TextSpanner \set #'type = #'trill \property Voice.TextSpanner \set #'edge-height = #'(0 . 0) - \property Voice.TextSpanner \set #'edge-text = #'((line (music "scripts-trill") " ") . "") + \property Voice.TextSpanner \set #'edge-text + = #(cons (make-musicglyph-markup "scripts-trill") "") a#(ly:export (make-span-event 'TextSpanEvent START)) b c a #(ly:export (make-span-event 'TextSpanEvent STOP)) } \paper { } } + %% new-chords-done %% diff --git a/lily/note-collision.cc b/lily/note-collision.cc index 989a9265a9..ad06f67663 100644 --- a/lily/note-collision.cc +++ b/lily/note-collision.cc @@ -203,7 +203,7 @@ check_meshing_chords (Grob*me, else if (upball_type > dnball_type) wipe_ball = nu; - if (wipe_ball) + if (wipe_ball && wipe_ball->live ()) { wipe_ball->set_grob_property ("transparent", SCM_BOOL_T); wipe_ball->set_grob_property ("molecule", SCM_EOL); diff --git a/lily/system.cc b/lily/system.cc index 2d62e26df9..e30a91505e 100644 --- a/lily/system.cc +++ b/lily/system.cc @@ -362,11 +362,6 @@ System::add_column (Paper_column*p) Axis_group_interface::add_element (me, p); } - - -/* - TODO: use scm_map iso. for loops. - */ void System::pre_processing () { diff --git a/ly/property-init.ly b/ly/property-init.ly index ae13649de6..6946a6d981 100644 --- a/ly/property-init.ly +++ b/ly/property-init.ly @@ -64,8 +64,6 @@ tupletBoth = { \property Voice.TupletBracket \revert #'direction } - - cadenzaOn = \property Timing.timing = ##f cadenzaOff = { \property Timing.timing = ##t @@ -251,19 +249,21 @@ setMmRestFermata = hideNotes =\sequential { - % hide notes, accidentals, etc. - \property Voice.NoteHead \override #'transparent = ##t - \property Voice.Stem \override #'transparent = ##t - \property Voice.Beam \override #'transparent = ##t - \property Staff.Accidental \override #'transparent = ##t + % hide notes, accidentals, etc. + \property Voice.Dots \override #'transparent = ##t + \property Voice.NoteHead \override #'transparent = ##t + \property Voice.Stem \override #'transparent = ##t + \property Voice.Beam \override #'transparent = ##t + \property Staff.Accidental \override #'transparent = ##t } unHideNotes = \sequential { -\property Voice.NoteHead \revert #'transparent -\property Voice.Stem \revert #'transparent -\property Voice.Beam \revert #'transparent -\property Staff.Accidental \revert #'transparent + \property Staff.Accidental \revert #'transparent + \property Voice.Beam \revert #'transparent + \property Voice.Stem \revert #'transparent + \property Voice.NoteHead \revert #'transparent + \property Voice.Dots \revert #'transparent } germanChords = { diff --git a/scm/chord-generic-names.scm b/scm/chord-generic-names.scm new file mode 100644 index 0000000000..fb9c1d3b10 --- /dev/null +++ b/scm/chord-generic-names.scm @@ -0,0 +1,283 @@ +;;;; double-plus-new-chord-name.scm -- Compile chord names +;;;; +;;;; source file of the GNU LilyPond music typesetter +;;;; +;;;; (c) 2003 Jan Nieuwenhuizen + + +;;;; NOTE: this is experimental code +;;;; Base and inversion are ignored. +;;;; Naming of the base chord (steps 1-5) is handled by exceptions only +;;;; see input/test/chord-names-dpnj.ly + +(define (markup-or-empty-markup markup) + "Return MARKUP if markup, else empty-markup" + (if (markup? markup) markup empty-markup)) + +(define (conditional-kern-before markup bool amount) + "Add AMOUNT of space before MARKUP if BOOL is true." + (if bool + (make-line-markup + (list (make-hspace-markup amount) + markup)) + markup)) + +(define-public (banter-chord-names pitches bass inversion context) + (ugh-compat-double-plus-new-chord->markup + 'banter pitches bass inversion context '()) + ) + + +(define-public (jazz-chord-names pitches bass inversion context) + (ugh-compat-double-plus-new-chord->markup + 'jazz pitches bass inversion context '()) + ) + + +(define-public (ugh-compat-double-plus-new-chord->markup + style pitches bass inversion context options) + "Entry point for New_chord_name_engraver. + +FIXME: func, options/context have changed + See +double-plus-new-chord-name.scm for the signature of STYLE. PITCHES, +BASS and INVERSION are lily pitches. OPTIONS is an alist-alist (see +input/test/dpncnt.ly). + " + + + (define (step-nr pitch) + (let* ((pitch-nr (+ (* 7 (ly:pitch-octave pitch)) + (ly:pitch-notename pitch))) + (root-nr (+ (* 7 (ly:pitch-octave (car pitches))) + (ly:pitch-notename (car pitches))))) + (+ 1 (- pitch-nr root-nr)))) + + (define (next-third pitch) + (ly:pitch-transpose pitch + (ly:make-pitch 0 2 (if (or (= (step-nr pitch) 3) + (= (step-nr pitch) 5)) + -1 0)))) + + (define (step-alteration pitch) + (let* ((diff (ly:pitch-diff (ly:make-pitch 0 0 0) (car pitches))) + (normalized-pitch (ly:pitch-transpose pitch diff)) + (alteration (ly:pitch-alteration normalized-pitch))) + (if (= (step-nr pitch) 7) (+ alteration 1) alteration))) + + (define (pitch-unalter pitch) + (let ((alteration (step-alteration pitch))) + (if (= alteration 0) + pitch + (ly:make-pitch (ly:pitch-octave pitch) (ly:pitch-notename pitch) + (- (ly:pitch-alteration pitch) alteration))))) + + (define (step-even-or-altered? pitch) + (let ((nr (step-nr pitch))) + (if (!= (modulo nr 2) 0) + (!= (step-alteration pitch) 0) + #t))) + + (define (step->markup-plusminus pitch) + (make-line-markup + (list + (make-simple-markup (number->string (step-nr pitch))) + (make-simple-markup + (case (step-alteration pitch) + ((-2) "--") + ((-1) "-") + ((0) "") + ((1) "+") + ((2) "++")))))) + + (define (step->markup-accidental pitch) + (make-line-markup + (list (accidental->markup (step-alteration pitch)) + (make-simple-markup (number->string (step-nr pitch)))))) + + (define (step->markup-ignatzek pitch) + (make-line-markup + (if (and (= (step-nr pitch) 7) + (= (step-alteration pitch) 1)) + (list (ly:get-context-property context 'majorSevenSymbol)) + (list (accidental->markup (step-alteration pitch)) + (make-simple-markup (number->string (step-nr pitch))))))) + + ;; tja, kennok + (define (make-sub->markup step->markup) + (lambda (pitch) + (make-line-markup (list (make-simple-markup "no") + (step->markup pitch))))) + + (define (step-based-sub->markup step->markup pitch) + (make-line-markup (list (make-simple-markup "no") (step->markup pitch)))) + + (define (get-full-list pitch) + (if (<= (step-nr pitch) (step-nr (tail pitches))) + (cons pitch (get-full-list (next-third pitch))) + '())) + + (define (get-consecutive nr pitches) + (if (pair? pitches) + (let* ((pitch-nr (step-nr (car pitches))) + (next-nr (if (!= (modulo pitch-nr 2) 0) (+ pitch-nr 2) nr))) + (if (<= pitch-nr nr) + (cons (car pitches) (get-consecutive next-nr (cdr pitches))) + '())) + '())) + + (define (full-match exceptions) + (if (pair? exceptions) + (let* ((e (car exceptions)) + (e-pitches (car e))) + (if (equal? e-pitches pitches) + e + (full-match (cdr exceptions)))) + #f)) + + (define (partial-match exceptions) + (if (pair? exceptions) + (let* ((e (car exceptions)) + (e-pitches (car e))) + (if (equal? e-pitches (first-n (length e-pitches) pitches)) + e + (partial-match (cdr exceptions)))) + #f)) + + (if #f (begin + (write-me "pitches: " pitches))) + (let* ((full-exceptions + (ly:get-context-property context 'chordNameExceptionsFull)) + (full-exception (full-match full-exceptions)) + (full-markup (if full-exception (cadr full-exception) '())) + (partial-exceptions + (ly:get-context-property context 'chordNameExceptionsPartial)) + (partial-exception (partial-match partial-exceptions)) + (partial-pitches (if partial-exception (car partial-exception) '())) + (partial-markup-prefix + (if partial-exception (markup-or-empty-markup + (cadr partial-exception)) empty-markup)) + (partial-markup-suffix + (if (and partial-exception (pair? (cddr partial-exception))) + (markup-or-empty-markup (caddr partial-exception)) empty-markup)) + (root (car pitches)) + (full (get-full-list root)) + ;; kludge alert: replace partial matched lower part of all with + ;; 'normal' pitches from full + ;; (all pitches) + (all (append (first-n (length partial-pitches) full) + (butfirst-n (length partial-pitches) pitches))) + + (highest (tail all)) + (missing (list-minus full (map pitch-unalter all))) + (consecutive (get-consecutive 1 all)) + (rest (list-minus all consecutive)) + (altered (filter-list step-even-or-altered? all)) + (cons-alt (filter-list step-even-or-altered? consecutive)) + (base (list-minus consecutive altered))) + + + (if #f (begin + (write-me "full:" full) + ;; (write-me "partial-pitches:" partial-pitches) + (write-me "full-markup:" full-markup) + (write-me "partial-markup-perfix:" partial-markup-prefix) + (write-me "partial-markup-suffix:" partial-markup-suffix) + (write-me "all:" all) + (write-me "altered:" altered) + (write-me "missing:" missing) + (write-me "consecutive:" consecutive) + (write-me "rest:" rest) + (write-me "base:" base))) + + (case style + ((banter) + ;; root + ;; + steps:altered + (highest all -- if not altered) + ;; + subs:missing + + (let* ((root->markup (assoc-get-default + 'root->markup options note-name->markup)) + (step->markup (assoc-get-default + 'step->markup options step->markup-plusminus)) + (sub->markup (assoc-get-default + 'sub->markup options + (lambda (x) + (step-based-sub->markup step->markup x)))) + (sep (assoc-get-default + 'separator options (make-simple-markup "/")))) + + (if + (pair? full-markup) + (make-line-markup (list (root->markup root) full-markup)) + + (make-line-markup + (list + (root->markup root) + partial-markup-prefix + (make-normal-size-super-markup + (markup-join + (apply append + (map step->markup + (append altered + (if (and (> (step-nr highest) 5) + (not + (step-even-or-altered? highest))) + (list highest) '()))) + (list partial-markup-suffix) + (list (map sub->markup missing))) + sep))))))) + + + ((jazz) + ;; root + ;; + steps:(highest base) + cons-alt + ;; + 'add' + ;; + steps:rest + (let* ((root->markup (assoc-get-default + 'root->markup options note-name->markup)) + (step->markup + (assoc-get-default + ;; FIXME: ignatzek + ;;'step->markup options step->markup-accidental)) + 'step->markup options step->markup-ignatzek)) + (sep (assoc-get-default + 'separator options (make-simple-markup " "))) + (add-prefix (assoc-get-default 'add-prefix options + (make-simple-markup " add")))) + + (if + (pair? full-markup) + (make-line-markup (list (root->markup root) full-markup)) + + (make-line-markup + (list + (root->markup root) + partial-markup-prefix + (make-normal-size-super-markup + (make-line-markup + (list + + ;; kludge alert: omit <= 5 + ;;(markup-join (map step->markup + ;; (cons (tail base) cons-alt)) sep) + + ;; This fixes: + ;; c C5 -> C + ;; c:2 C5 2 -> C2 + ;; c:3- Cm5 -> Cm + ;; c:6.9 C5 6add9 -> C6 add 9 (add?) + ;; ch = \chords { c c:2 c:3- c:6.9^7 } + (markup-join (map step->markup + (let ((tb (tail base))) + (if (> (step-nr tb) 5) + (cons tb cons-alt) + cons-alt))) sep) + + (if (pair? rest) + add-prefix + empty-markup) + (markup-join (map step->markup rest) sep) + partial-markup-suffix)))))))) + + (else empty-markup)))) diff --git a/scm/chord-name.scm b/scm/chord-name.scm index 9814f04c37..1e308e0a2a 100644 --- a/scm/chord-name.scm +++ b/scm/chord-name.scm @@ -139,21 +139,3 @@ FOOBAR-MARKUP) if OMIT-ROOT. molecule) )) -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(define-public (set-chord-name-style sym) - "Return music expressions that set the chord naming style. For -inline use in .ly file" - - (define (chord-name-style-setter function style) - (context-spec-music - (make-sequential-music - (list (make-property-set 'chordNameFunction function) - (make-property-set 'chordNameStyle style))) - "ChordNames")) - - (ly:export - (case sym - ((ignatzek) (chord-name-style-setter ignatzek-chord-names 'foobar)) - ((banter) (chord-name-style-setter double-plus-new-chord->markup 'banter)) - ((jazz) (chord-name-style-setter double-plus-new-chord->markup 'jazz))))) diff --git a/scm/define-translator-properties.scm b/scm/define-translator-properties.scm index 5384fcf21b..e659ff3d7b 100644 --- a/scm/define-translator-properties.scm +++ b/scm/define-translator-properties.scm @@ -156,9 +156,6 @@ into one staff.") (translator-property-description 'chordNameFunction procedure? "The function that converts lists of pitches to chord names.") -(translator-property-description - 'chordNameStyle symbol? - "The chord name style: ignatzek, banter or jazz.") (translator-property-description 'chordNoteNamer procedure? "Function that converts from a pitch object to a text markup. Used for single pitches.") diff --git a/scm/double-plus-new-chord-name.scm b/scm/double-plus-new-chord-name.scm deleted file mode 100644 index e495bdcd2a..0000000000 --- a/scm/double-plus-new-chord-name.scm +++ /dev/null @@ -1,278 +0,0 @@ -;;;; double-plus-new-chord-name.scm -- Compile chord names -;;;; -;;;; source file of the GNU LilyPond music typesetter -;;;; -;;;; (c) 2003 Jan Nieuwenhuizen - - -;;;; NOTE: this is experimental code -;;;; Base and inversion are ignored. -;;;; Naming of the base chord (steps 1-5) is handled by exceptions only -;;;; see input/test/chord-names-dpnj.ly - -(define (markup-or-empty-markup markup) - "Return MARKUP if markup, else empty-markup" - (if (markup? markup) markup empty-markup)) - -(define (conditional-kern-before markup bool amount) - "Add AMOUNT of space before MARKUP if BOOL is true." - (if bool - (make-line-markup - (list (make-hspace-markup amount) - markup)) - markup)) - -(define-public (double-plus-new-chord->markup - pitches bass inversion context) - (let ((options '()) - (style (ly:get-context-property context 'chordNameStyle))) - (ugh-compat-double-plus-new-chord->markup - style pitches bass inversion context options))) - -(define-public (ugh-compat-double-plus-new-chord->markup - style pitches bass inversion context options) - "Entry point for New_chord_name_engraver. - -FIXME: func, options/context have changed - See -double-plus-new-chord-name.scm for the signature of STYLE. PITCHES, -BASS and INVERSION are lily pitches. OPTIONS is an alist-alist (see -input/test/dpncnt.ly). - " - - - (define (step-nr pitch) - (let* ((pitch-nr (+ (* 7 (ly:pitch-octave pitch)) - (ly:pitch-notename pitch))) - (root-nr (+ (* 7 (ly:pitch-octave (car pitches))) - (ly:pitch-notename (car pitches))))) - (+ 1 (- pitch-nr root-nr)))) - - (define (next-third pitch) - (ly:pitch-transpose pitch - (ly:make-pitch 0 2 (if (or (= (step-nr pitch) 3) - (= (step-nr pitch) 5)) - -1 0)))) - - (define (step-alteration pitch) - (let* ((diff (ly:pitch-diff (ly:make-pitch 0 0 0) (car pitches))) - (normalized-pitch (ly:pitch-transpose pitch diff)) - (alteration (ly:pitch-alteration normalized-pitch))) - (if (= (step-nr pitch) 7) (+ alteration 1) alteration))) - - (define (pitch-unalter pitch) - (let ((alteration (step-alteration pitch))) - (if (= alteration 0) - pitch - (ly:make-pitch (ly:pitch-octave pitch) (ly:pitch-notename pitch) - (- (ly:pitch-alteration pitch) alteration))))) - - (define (step-even-or-altered? pitch) - (let ((nr (step-nr pitch))) - (if (!= (modulo nr 2) 0) - (!= (step-alteration pitch) 0) - #t))) - - (define (step->markup-plusminus pitch) - (make-line-markup - (list - (make-simple-markup (number->string (step-nr pitch))) - (make-simple-markup - (case (step-alteration pitch) - ((-2) "--") - ((-1) "-") - ((0) "") - ((1) "+") - ((2) "++")))))) - - (define (step->markup-accidental pitch) - (make-line-markup - (list (accidental->markup (step-alteration pitch)) - (make-simple-markup (number->string (step-nr pitch)))))) - - (define (step->markup-ignatzek pitch) - (make-line-markup - (if (and (= (step-nr pitch) 7) - (= (step-alteration pitch) 1)) - (list (ly:get-context-property context 'majorSevenSymbol)) - (list (accidental->markup (step-alteration pitch)) - (make-simple-markup (number->string (step-nr pitch))))))) - - ;; tja, kennok - (define (make-sub->markup step->markup) - (lambda (pitch) - (make-line-markup (list (make-simple-markup "no") - (step->markup pitch))))) - - (define (step-based-sub->markup step->markup pitch) - (make-line-markup (list (make-simple-markup "no") (step->markup pitch)))) - - (define (get-full-list pitch) - (if (<= (step-nr pitch) (step-nr (tail pitches))) - (cons pitch (get-full-list (next-third pitch))) - '())) - - (define (get-consecutive nr pitches) - (if (pair? pitches) - (let* ((pitch-nr (step-nr (car pitches))) - (next-nr (if (!= (modulo pitch-nr 2) 0) (+ pitch-nr 2) nr))) - (if (<= pitch-nr nr) - (cons (car pitches) (get-consecutive next-nr (cdr pitches))) - '())) - '())) - - (define (full-match exceptions) - (if (pair? exceptions) - (let* ((e (car exceptions)) - (e-pitches (car e))) - (if (equal? e-pitches pitches) - e - (full-match (cdr exceptions)))) - #f)) - - (define (partial-match exceptions) - (if (pair? exceptions) - (let* ((e (car exceptions)) - (e-pitches (car e))) - (if (equal? e-pitches (first-n (length e-pitches) pitches)) - e - (partial-match (cdr exceptions)))) - #f)) - - (if #f (begin - (write-me "pitches: " pitches))) - (let* ((full-exceptions - (ly:get-context-property context 'chordNameExceptionsFull)) - (full-exception (full-match full-exceptions)) - (full-markup (if full-exception (cadr full-exception) '())) - (partial-exceptions - (ly:get-context-property context 'chordNameExceptionsPartial)) - (partial-exception (partial-match partial-exceptions)) - (partial-pitches (if partial-exception (car partial-exception) '())) - (partial-markup-prefix - (if partial-exception (markup-or-empty-markup - (cadr partial-exception)) empty-markup)) - (partial-markup-suffix - (if (and partial-exception (pair? (cddr partial-exception))) - (markup-or-empty-markup (caddr partial-exception)) empty-markup)) - (root (car pitches)) - (full (get-full-list root)) - ;; kludge alert: replace partial matched lower part of all with - ;; 'normal' pitches from full - ;; (all pitches) - (all (append (first-n (length partial-pitches) full) - (butfirst-n (length partial-pitches) pitches))) - - (highest (tail all)) - (missing (list-minus full (map pitch-unalter all))) - (consecutive (get-consecutive 1 all)) - (rest (list-minus all consecutive)) - (altered (filter-list step-even-or-altered? all)) - (cons-alt (filter-list step-even-or-altered? consecutive)) - (base (list-minus consecutive altered))) - - - (if #f (begin - (write-me "full:" full) - ;; (write-me "partial-pitches:" partial-pitches) - (write-me "full-markup:" full-markup) - (write-me "partial-markup-perfix:" partial-markup-prefix) - (write-me "partial-markup-suffix:" partial-markup-suffix) - (write-me "all:" all) - (write-me "altered:" altered) - (write-me "missing:" missing) - (write-me "consecutive:" consecutive) - (write-me "rest:" rest) - (write-me "base:" base))) - - (case style - ((banter) - ;; root - ;; + steps:altered + (highest all -- if not altered) - ;; + subs:missing - - (let* ((root->markup (assoc-get-default - 'root->markup options note-name->markup)) - (step->markup (assoc-get-default - 'step->markup options step->markup-plusminus)) - (sub->markup (assoc-get-default - 'sub->markup options - (lambda (x) - (step-based-sub->markup step->markup x)))) - (sep (assoc-get-default - 'separator options (make-simple-markup "/")))) - - (if - (pair? full-markup) - (make-line-markup (list (root->markup root) full-markup)) - - (make-line-markup - (list - (root->markup root) - partial-markup-prefix - (make-normal-size-super-markup - (markup-join - (apply append - (map step->markup - (append altered - (if (and (> (step-nr highest) 5) - (not - (step-even-or-altered? highest))) - (list highest) '()))) - (list partial-markup-suffix) - (list (map sub->markup missing))) - sep))))))) - - - ((jazz) - ;; root - ;; + steps:(highest base) + cons-alt - ;; + 'add' - ;; + steps:rest - (let* ((root->markup (assoc-get-default - 'root->markup options note-name->markup)) - (step->markup - (assoc-get-default - ;; FIXME: ignatzek - ;;'step->markup options step->markup-accidental)) - 'step->markup options step->markup-ignatzek)) - (sep (assoc-get-default - 'separator options (make-simple-markup " "))) - (add-prefix (assoc-get-default 'add-prefix options - (make-simple-markup " add")))) - - (if - (pair? full-markup) - (make-line-markup (list (root->markup root) full-markup)) - - (make-line-markup - (list - (root->markup root) - partial-markup-prefix - (make-normal-size-super-markup - (make-line-markup - (list - - ;; kludge alert: omit <= 5 - ;;(markup-join (map step->markup - ;; (cons (tail base) cons-alt)) sep) - - ;; This fixes: - ;; c C5 -> C - ;; c:2 C5 2 -> C2 - ;; c:3- Cm5 -> Cm - ;; c:6.9 C5 6add9 -> C6 add 9 (add?) - ;; ch = \chords { c c:2 c:3- c:6.9^7 } - (markup-join (map step->markup - (let ((tb (tail base))) - (if (> (step-nr tb) 5) - (cons tb cons-alt) - cons-alt))) sep) - - (if (pair? rest) - add-prefix - empty-markup) - (markup-join (map step->markup rest) sep) - partial-markup-suffix)))))))) - - (else empty-markup)))) diff --git a/scm/lily.scm b/scm/lily.scm index 64f5eaecf9..707a403c34 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -383,7 +383,7 @@ is the first to satisfy CRIT "c++.scm" "chord-ignatzek-names.scm" "chord-entry.scm" - "double-plus-new-chord-name.scm" + "chord-generic-names.scm" "molecule.scm" "new-markup.scm" "bass-figure.scm"