From: Joe Neeman Date: Mon, 18 Dec 2006 13:47:03 +0000 (+0200) Subject: Merge branch 'jneeman' of git+ssh://jneem@git.sv.gnu.org/srv/git/lilypond into jneeman X-Git-Tag: release/2.11.16-1^2~16 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=9e69cb84d6ee5b0a861cd97869b10e3bdf0c833c;hp=6f664e0e318a1651f6fe9317a842bf9c7f476f08;p=lilypond.git Merge branch 'jneeman' of git+ssh://jneem@git.sv.gnu.org/srv/git/lilypond into jneeman --- diff --git a/.gitignore b/.gitignore index 64f8beaac7..2489b9e8d2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,35 +1,41 @@ config.hh -config.make -config.status -config.status.lineno -config.log -*~ -GNUmakefile -aclocal.m4 -autom4te.cache -configure -*.ps +*-midi.ly +*-systems.tex +*-systems.texi +*.afm +*.aux *.eps +*.log +*.midi +*.orig *.pdf -TAGS -tags +*.ps +*.pyc +*.rej +*.svg +*.tfm +*~ +.dotest .gdbinit +.htaccess +/.sconf_temp +/.sconsign.dblite +/scons.cache ?.* -*.midi +AUTHORS.txt +/GNUmakefile +INSTALL.txt +TAGS \#* -lily-[0-9][0-9][0-9]* -gcstat*.scm -*.aux -*.svg -*.pyc -*.log -.htaccess -*.tfm -*.afm -*.orig -*.rej -*-systems.texi -*-systems.tex -*-midi.ly a.out -.dotest +aclocal.m4 +autom4te.cache +config.log +config.make +config.status +config.status.lineno +configure +gcstat*.scm +lily-[0-9][0-9][0-9]* +out-scons +tags diff --git a/COPYING b/COPYING index c00538b2f9..32f7714f79 100644 --- a/COPYING +++ b/COPYING @@ -1,4 +1,4 @@ -If you want to redistribute LilyPond, you must comply with the the GNU +If you want to redistribute LilyPond, you must comply with the GNU General Public License (reproduced below). This license applies to LilyPond with the following exceptions: diff --git a/Documentation/GNUmakefile b/Documentation/GNUmakefile index 64605cb980..55f0809885 100644 --- a/Documentation/GNUmakefile +++ b/Documentation/GNUmakefile @@ -1,7 +1,8 @@ depth = .. NAME = documentation -SUBDIRS=user bibliography pictures topdocs misc +LANGS = fr # don't enable unpolished or broken translations +SUBDIRS=user bibliography pictures topdocs misc po $(LANGS) STEPMAKE_TEMPLATES=documentation texinfo tex LOCALSTEPMAKE_TEMPLATES=lilypond ly LILYPOND_BOOK_FLAGS=--extra-options '-e "(ly:set-option (quote internal-type-checking) \#t)"' @@ -27,3 +28,19 @@ OUT_TXT_FILES = $(addprefix $(outdir)/, $(addsuffix .txt, $(README_TOP_FILES))) # cd $(outdir) rule gets bit hairy for --srcdir configure builds txt-to-html: $(PYTHON) $(step-bindir)/text2html.py $(OUT_TXT_FILES) + +ifneq ($(ISOLANG),) +new-lang: + @if (( $$(file -b $(ISOLANG)) == directory )) 2>/dev/null; \ + then echo "Error: $(ISOLANG) directory already exists. Exiting." ; \ + exit 3 ; \ + fi + mkdir -p $(ISOLANG)/user + cp fr/GNUmakefile $(ISOLANG) + cp fr/user/GNUmakefile $(ISOLANG)/user + sed -i -e 's/ISOLANG *= *fr/ISOLANG = $(ISOLANG)/' $(ISOLANG)/GNUmakefile $(ISOLANG)/user/GNUmakefile + $(PYTHON) $(depth)/buildscripts/texi-langutils.py -d $(outdir) -b "UNTRANSLATED NODE: IGNORE ME" -o doc.pot --skeleton --gettext ../user/lilypond.tely + mv $(outdir)/*.*tely $(ISOLANG)/user + msgmerge -U po/lilypond-doc.pot $(outdir)/doc.pot + cp po/lilypond-doc.pot po/$(ISOLANG).po +endif \ No newline at end of file diff --git a/Documentation/fr/GNUmakefile b/Documentation/fr/GNUmakefile new file mode 100644 index 0000000000..296c7209d3 --- /dev/null +++ b/Documentation/fr/GNUmakefile @@ -0,0 +1,5 @@ +ISOLANG = fr +depth = ../.. +SUBDIRS = user +STEPMAKE_TEMPLATES = documentation +include $(depth)/make/stepmake.make diff --git a/Documentation/fr/user/GNUmakefile b/Documentation/fr/user/GNUmakefile new file mode 100644 index 0000000000..e492cfeb9c --- /dev/null +++ b/Documentation/fr/user/GNUmakefile @@ -0,0 +1,5 @@ +ISOLANG = fr +depth = ../../.. +LOCALSTEPMAKE_TEMPLATES = lilypond ly doclang +include $(depth)/make/stepmake.make + diff --git a/Documentation/fr/user/advanced-notation.itely b/Documentation/fr/user/advanced-notation.itely new file mode 100644 index 0000000000..e1f82f0748 --- /dev/null +++ b/Documentation/fr/user/advanced-notation.itely @@ -0,0 +1,269 @@ +@node Advanced notation +@chapter Advanced notation + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Text:: +* Preparing parts:: +* Orchestral music:: +* Contemporary notation:: +* Educational use:: +@end menu +@node Text +@section Text + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Text scripts:: +* Text spanners:: +* Text marks:: +* Text markup:: +* Nested scores:: +* Overview of text markup commands:: +* Font selection:: +* New dynamic marks:: +@end menu +@node Text scripts +@subsection Text scripts + +UNTRANSLATED NODE: IGNORE ME + +@node Text spanners +@subsection Text spanners + +UNTRANSLATED NODE: IGNORE ME + +@node Text marks +@subsection Text marks + +UNTRANSLATED NODE: IGNORE ME + +@node Text markup +@subsection Text markup + +UNTRANSLATED NODE: IGNORE ME + +@node Nested scores +@subsection Nested scores + +UNTRANSLATED NODE: IGNORE ME + +@node Overview of text markup commands +@subsection Overview of text markup commands + +UNTRANSLATED NODE: IGNORE ME + +@node Font selection +@subsection Font selection + +UNTRANSLATED NODE: IGNORE ME + +@node New dynamic marks +@subsection New dynamic marks + +UNTRANSLATED NODE: IGNORE ME + +@node Preparing parts +@section Preparing parts + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Multi measure rests:: +* Metronome marks:: +* Rehearsal marks:: +* Bar numbers:: +* Instrument names:: +* Instrument transpositions:: +* Ottava brackets:: +* Different editions from one source:: +@end menu +@node Multi measure rests +@subsection Multi measure rests + +UNTRANSLATED NODE: IGNORE ME + +@node Metronome marks +@subsection Metronome marks + +UNTRANSLATED NODE: IGNORE ME + +@node Rehearsal marks +@subsection Rehearsal marks + +UNTRANSLATED NODE: IGNORE ME + +@node Bar numbers +@subsection Bar numbers + +UNTRANSLATED NODE: IGNORE ME + +@node Instrument names +@subsection Instrument names + +UNTRANSLATED NODE: IGNORE ME + +@node Instrument transpositions +@subsection Instrument transpositions + +UNTRANSLATED NODE: IGNORE ME + +@node Ottava brackets +@subsection Ottava brackets + +UNTRANSLATED NODE: IGNORE ME + +@node Different editions from one source +@subsection Different editions from one source + +UNTRANSLATED NODE: IGNORE ME + +@node Orchestral music +@section Orchestral music + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Automatic part combining:: +* Hiding staves:: +* Quoting other voices:: +* Formatting cue notes:: +* Aligning to cadenzas:: +@end menu +@node Automatic part combining +@subsection Automatic part combining + +UNTRANSLATED NODE: IGNORE ME + +@node Hiding staves +@subsection Hiding staves + +UNTRANSLATED NODE: IGNORE ME + +@node Quoting other voices +@subsection Quoting other voices + +UNTRANSLATED NODE: IGNORE ME + +@node Formatting cue notes +@subsection Formatting cue notes + +UNTRANSLATED NODE: IGNORE ME + +@node Aligning to cadenzas +@subsection Aligning to cadenzas + +UNTRANSLATED NODE: IGNORE ME + +@node Contemporary notation +@section Contemporary notation + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Polymetric notation:: +* Time administration:: +* Proportional notation:: +* Clusters:: +* Special noteheads:: +* Feathered beams:: +* Improvisation:: +* Selecting notation font size:: +@end menu +@node Polymetric notation +@subsection Polymetric notation + +UNTRANSLATED NODE: IGNORE ME + +@node Time administration +@subsection Time administration + +UNTRANSLATED NODE: IGNORE ME + +@node Proportional notation +@subsection Proportional notation + +UNTRANSLATED NODE: IGNORE ME + +@node Clusters +@subsection Clusters + +UNTRANSLATED NODE: IGNORE ME + +@node Special noteheads +@subsection Special noteheads + +UNTRANSLATED NODE: IGNORE ME + +@node Feathered beams +@subsection Feathered beams + +UNTRANSLATED NODE: IGNORE ME + +@node Improvisation +@subsection Improvisation + +UNTRANSLATED NODE: IGNORE ME + +@node Selecting notation font size +@subsection Selecting notation font size + +UNTRANSLATED NODE: IGNORE ME + +@node Educational use +@section Educational use + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Balloon help:: +* Blank music sheet:: +* Hidden notes:: +* Shape note heads:: +* Easy Notation note heads:: +* Analysis brackets:: +* Coloring objects:: +* Parentheses:: +@end menu +@node Balloon help +@subsection Balloon help + +UNTRANSLATED NODE: IGNORE ME + +@node Blank music sheet +@subsection Blank music sheet + +UNTRANSLATED NODE: IGNORE ME + +@node Hidden notes +@subsection Hidden notes + +UNTRANSLATED NODE: IGNORE ME + +@node Shape note heads +@subsection Shape note heads + +UNTRANSLATED NODE: IGNORE ME + +@node Easy Notation note heads +@subsection Easy Notation note heads + +UNTRANSLATED NODE: IGNORE ME + +@node Analysis brackets +@subsection Analysis brackets + +UNTRANSLATED NODE: IGNORE ME + +@node Coloring objects +@subsection Coloring objects + +UNTRANSLATED NODE: IGNORE ME + +@node Parentheses +@subsection Parentheses + +UNTRANSLATED NODE: IGNORE ME + diff --git a/Documentation/fr/user/basic-notation.itely b/Documentation/fr/user/basic-notation.itely new file mode 100644 index 0000000000..d7c1bccb57 --- /dev/null +++ b/Documentation/fr/user/basic-notation.itely @@ -0,0 +1,381 @@ +@node Basic notation +@chapter Basic notation + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Pitches:: +* Rhythms:: +* Multiple notes at once:: +* Staff notation:: +* Connecting notes:: +* Expressive marks:: +* Repeats:: +@end menu +@node Pitches +@section Pitches + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Normal pitches:: +* Accidentals:: +* Cautionary accidentals:: +* Micro tones:: +* Notes names in other languages:: +* Relative octaves:: +* Octave check:: +* Transpose:: +* Rests:: +* Skips:: +@end menu +@node Normal pitches +@subsection Normal pitches + +UNTRANSLATED NODE: IGNORE ME + +@node Accidentals +@subsection Accidentals + +UNTRANSLATED NODE: IGNORE ME + +@node Cautionary accidentals +@subsection Cautionary accidentals + +UNTRANSLATED NODE: IGNORE ME + +@node Micro tones +@subsection Micro tones + +UNTRANSLATED NODE: IGNORE ME + +@node Notes names in other languages +@subsection Notes names in other languages + +UNTRANSLATED NODE: IGNORE ME + +@node Relative octaves +@subsection Relative octaves + +UNTRANSLATED NODE: IGNORE ME + +@node Octave check +@subsection Octave check + +UNTRANSLATED NODE: IGNORE ME + +@node Transpose +@subsection Transpose + +UNTRANSLATED NODE: IGNORE ME + +@node Rests +@subsection Rests + +UNTRANSLATED NODE: IGNORE ME + +@node Skips +@subsection Skips + +UNTRANSLATED NODE: IGNORE ME + +@node Rhythms +@section Rhythms + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Durations:: +* Augmentation dots:: +* Tuplets:: +* Scaling durations:: +* Bar check:: +* Barnumber check:: +* Automatic note splitting:: +@end menu +@node Durations +@subsection Durations + +UNTRANSLATED NODE: IGNORE ME + +@node Augmentation dots +@subsection Augmentation dots + +UNTRANSLATED NODE: IGNORE ME + +@node Tuplets +@subsection Tuplets + +UNTRANSLATED NODE: IGNORE ME + +@node Scaling durations +@subsection Scaling durations + +UNTRANSLATED NODE: IGNORE ME + +@node Bar check +@subsection Bar check + +UNTRANSLATED NODE: IGNORE ME + +@node Barnumber check +@subsection Barnumber check + +UNTRANSLATED NODE: IGNORE ME + +@node Automatic note splitting +@subsection Automatic note splitting + +UNTRANSLATED NODE: IGNORE ME + +@node Multiple notes at once +@section Multiple notes at once + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Chords:: +* Stems:: +* Basic polyphony:: +* Explicitly instantiating voices:: +* Collision Resolution:: +@end menu +@node Chords +@subsection Chords + +UNTRANSLATED NODE: IGNORE ME + +@node Stems +@subsection Stems + +UNTRANSLATED NODE: IGNORE ME + +@node Basic polyphony +@subsection Basic polyphony + +UNTRANSLATED NODE: IGNORE ME + +@node Explicitly instantiating voices +@subsection Explicitly instantiating voices + +UNTRANSLATED NODE: IGNORE ME + +@node Collision Resolution +@subsection Collision Resolution + +UNTRANSLATED NODE: IGNORE ME + +@node Staff notation +@section Staff notation + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Clef:: +* Key signature:: +* Time signature:: +* Partial measures:: +* Bar lines:: +* Unmetered music:: +* System start delimiters:: +* Staff symbol:: +* Writing music in parallel:: +@end menu +@node Clef +@subsection Clef + +UNTRANSLATED NODE: IGNORE ME + +@node Key signature +@subsection Key signature + +UNTRANSLATED NODE: IGNORE ME + +@node Time signature +@subsection Time signature + +UNTRANSLATED NODE: IGNORE ME + +@node Partial measures +@subsection Partial measures + +UNTRANSLATED NODE: IGNORE ME + +@node Bar lines +@subsection Bar lines + +UNTRANSLATED NODE: IGNORE ME + +@node Unmetered music +@subsection Unmetered music + +UNTRANSLATED NODE: IGNORE ME + +@node System start delimiters +@subsection System start delimiters + +UNTRANSLATED NODE: IGNORE ME + +@node Staff symbol +@subsection Staff symbol + +UNTRANSLATED NODE: IGNORE ME + +@node Writing music in parallel +@subsection Writing music in parallel + +UNTRANSLATED NODE: IGNORE ME + +@node Connecting notes +@section Connecting notes + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Ties:: +* Slurs:: +* Phrasing slurs:: +* Laissez vibrer ties:: +* Automatic beams:: +* Manual beams:: +* Grace notes:: +@end menu +@node Ties +@subsection Ties + +UNTRANSLATED NODE: IGNORE ME + +@node Slurs +@subsection Slurs + +UNTRANSLATED NODE: IGNORE ME + +@node Phrasing slurs +@subsection Phrasing slurs + +UNTRANSLATED NODE: IGNORE ME + +@node Laissez vibrer ties +@subsection Laissez vibrer ties + +UNTRANSLATED NODE: IGNORE ME + +@node Automatic beams +@subsection Automatic beams + +UNTRANSLATED NODE: IGNORE ME + +@node Manual beams +@subsection Manual beams + +UNTRANSLATED NODE: IGNORE ME + +@node Grace notes +@subsection Grace notes + +UNTRANSLATED NODE: IGNORE ME + +@node Expressive marks +@section Expressive marks + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Articulations:: +* Fingering instructions:: +* Dynamics:: +* Breath marks:: +* Trills:: +* Glissando:: +* Arpeggio:: +* Falls and doits:: +@end menu +@node Articulations +@subsection Articulations + +UNTRANSLATED NODE: IGNORE ME + +@node Fingering instructions +@subsection Fingering instructions + +UNTRANSLATED NODE: IGNORE ME + +@node Dynamics +@subsection Dynamics + +UNTRANSLATED NODE: IGNORE ME + +@node Breath marks +@subsection Breath marks + +UNTRANSLATED NODE: IGNORE ME + +@node Trills +@subsection Trills + +UNTRANSLATED NODE: IGNORE ME + +@node Glissando +@subsection Glissando + +UNTRANSLATED NODE: IGNORE ME + +@node Arpeggio +@subsection Arpeggio + +UNTRANSLATED NODE: IGNORE ME + +@node Falls and doits +@subsection Falls and doits + +UNTRANSLATED NODE: IGNORE ME + +@node Repeats +@section Repeats + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Repeat types:: +* Repeat syntax:: +* Repeats and MIDI:: +* Manual repeat commands:: +* Tremolo repeats:: +* Tremolo subdivisions:: +* Measure repeats:: +@end menu +@node Repeat types +@subsection Repeat types + +UNTRANSLATED NODE: IGNORE ME + +@node Repeat syntax +@subsection Repeat syntax + +UNTRANSLATED NODE: IGNORE ME + +@node Repeats and MIDI +@subsection Repeats and MIDI + +UNTRANSLATED NODE: IGNORE ME + +@node Manual repeat commands +@subsection Manual repeat commands + +UNTRANSLATED NODE: IGNORE ME + +@node Tremolo repeats +@subsection Tremolo repeats + +UNTRANSLATED NODE: IGNORE ME + +@node Tremolo subdivisions +@subsection Tremolo subdivisions + +UNTRANSLATED NODE: IGNORE ME + +@node Measure repeats +@subsection Measure repeats + +UNTRANSLATED NODE: IGNORE ME + diff --git a/Documentation/fr/user/changing-defaults.itely b/Documentation/fr/user/changing-defaults.itely new file mode 100644 index 0000000000..69342deaff --- /dev/null +++ b/Documentation/fr/user/changing-defaults.itely @@ -0,0 +1,127 @@ +@node Changing defaults +@chapter Changing defaults + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Automatic notation:: +* Interpretation contexts:: +* The \override command:: +@end menu +@node Automatic notation +@section Automatic notation + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Automatic accidentals:: +* Setting automatic beam behavior:: +@end menu +@node Automatic accidentals +@subsection Automatic accidentals + +UNTRANSLATED NODE: IGNORE ME + +@node Setting automatic beam behavior +@subsection Setting automatic beam behavior + +UNTRANSLATED NODE: IGNORE ME + +@node Interpretation contexts +@section Interpretation contexts + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Contexts explained:: +* Creating contexts:: +* Changing context properties on the fly:: +* Modifying context plug-ins:: +* Layout tunings within contexts:: +* Changing context default settings:: +* Defining new contexts:: +@end menu +@node Contexts explained +@subsection Contexts explained + +UNTRANSLATED NODE: IGNORE ME + +@node Creating contexts +@subsection Creating contexts + +UNTRANSLATED NODE: IGNORE ME + +@node Changing context properties on the fly +@subsection Changing context properties on the fly + +UNTRANSLATED NODE: IGNORE ME + +@node Modifying context plug-ins +@subsection Modifying context plug-ins + +UNTRANSLATED NODE: IGNORE ME + +@node Layout tunings within contexts +@subsection Layout tunings within contexts + +UNTRANSLATED NODE: IGNORE ME + +@node Changing context default settings +@subsection Changing context default settings + +UNTRANSLATED NODE: IGNORE ME + +@node Defining new contexts +@subsection Defining new contexts + +UNTRANSLATED NODE: IGNORE ME + +@node The \override command +@section The \override command + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Constructing a tweak:: +* Navigating the program reference:: +* Layout interfaces:: +* Determining the grob property:: +* Objects connected to the input:: +* \set vs. \override:: +* Difficult tweaks:: +@end menu +@node Constructing a tweak +@subsection Constructing a tweak + +UNTRANSLATED NODE: IGNORE ME + +@node Navigating the program reference +@subsection Navigating the program reference + +UNTRANSLATED NODE: IGNORE ME + +@node Layout interfaces +@subsection Layout interfaces + +UNTRANSLATED NODE: IGNORE ME + +@node Determining the grob property +@subsection Determining the grob property + +UNTRANSLATED NODE: IGNORE ME + +@node Objects connected to the input +@subsection Objects connected to the input + +UNTRANSLATED NODE: IGNORE ME + +@node \set vs. \override +@subsection \set vs. \override + +UNTRANSLATED NODE: IGNORE ME + +@node Difficult tweaks +@subsection Difficult tweaks + +UNTRANSLATED NODE: IGNORE ME + diff --git a/Documentation/fr/user/cheatsheet.itely b/Documentation/fr/user/cheatsheet.itely new file mode 100644 index 0000000000..24a63dc774 --- /dev/null +++ b/Documentation/fr/user/cheatsheet.itely @@ -0,0 +1,5 @@ +@node Cheat sheet +@appendix Cheat sheet + +UNTRANSLATED NODE: IGNORE ME + diff --git a/Documentation/fr/user/converters.itely b/Documentation/fr/user/converters.itely new file mode 100644 index 0000000000..07b91238fd --- /dev/null +++ b/Documentation/fr/user/converters.itely @@ -0,0 +1,37 @@ +@node Converting from other formats +@chapter Converting from other formats + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Invoking midi2ly:: +* Invoking etf2ly:: +* Invoking musicxml2ly:: +* Invoking abc2ly:: +* Generating LilyPond files:: +@end menu +@node Invoking midi2ly +@section Invoking + +UNTRANSLATED NODE: IGNORE ME + +@node Invoking etf2ly +@section Invoking + +UNTRANSLATED NODE: IGNORE ME + +@node Invoking musicxml2ly +@section Invoking + +UNTRANSLATED NODE: IGNORE ME + +@node Invoking abc2ly +@section Invoking + +UNTRANSLATED NODE: IGNORE ME + +@node Generating LilyPond files +@section Generating LilyPond files + +UNTRANSLATED NODE: IGNORE ME + diff --git a/Documentation/fr/user/instrument-notation.itely b/Documentation/fr/user/instrument-notation.itely new file mode 100644 index 0000000000..bf8742de5d --- /dev/null +++ b/Documentation/fr/user/instrument-notation.itely @@ -0,0 +1,399 @@ +@node Instrument-specific notation +@chapter Instrument-specific notation + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Piano music:: +* Chord names:: +* Vocal music:: +* Rhythmic music:: +* Guitar:: +* Bagpipe:: +* Ancient notation:: +* Other instrument specific notation:: +@end menu +@node Piano music +@section Piano music + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Automatic staff changes:: +* Manual staff switches:: +* Pedals:: +* Staff switch lines:: +* Cross staff stems:: +@end menu +@node Automatic staff changes +@subsection Automatic staff changes + +UNTRANSLATED NODE: IGNORE ME + +@node Manual staff switches +@subsection Manual staff switches + +UNTRANSLATED NODE: IGNORE ME + +@node Pedals +@subsection Pedals + +UNTRANSLATED NODE: IGNORE ME + +@node Staff switch lines +@subsection Staff switch lines + +UNTRANSLATED NODE: IGNORE ME + +@node Cross staff stems +@subsection Cross staff stems + +UNTRANSLATED NODE: IGNORE ME + +@node Chord names +@section Chord names + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Introducing chord names:: +* Chords mode:: +* Printing chord names:: +@end menu +@node Introducing chord names +@subsection Introducing chord names + +UNTRANSLATED NODE: IGNORE ME + +@node Chords mode +@subsection Chords mode + +UNTRANSLATED NODE: IGNORE ME + +@node Printing chord names +@subsection Printing chord names + +UNTRANSLATED NODE: IGNORE ME + +@node Vocal music +@section Vocal music + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Setting simple songs:: +* Entering lyrics:: +* Hyphens and extenders:: +* The Lyrics context:: +* Melismata:: +* Another way of entering lyrics:: +* Flexibility in placement:: +* Spacing lyrics:: +* More about stanzas:: +* Ambitus:: +* Other vocal issues:: +@end menu +@node Setting simple songs +@subsection Setting simple songs + +UNTRANSLATED NODE: IGNORE ME + +@node Entering lyrics +@subsection Entering lyrics + +UNTRANSLATED NODE: IGNORE ME + +@node Hyphens and extenders +@subsection Hyphens and extenders + +UNTRANSLATED NODE: IGNORE ME + +@node The Lyrics context +@subsection The Lyrics context + +UNTRANSLATED NODE: IGNORE ME + +@node Melismata +@subsection Melismata + +UNTRANSLATED NODE: IGNORE ME + +@node Another way of entering lyrics +@subsection Another way of entering lyrics + +UNTRANSLATED NODE: IGNORE ME + +@node Flexibility in placement +@subsection Flexibility in placement + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Lyrics to multiple notes of a melisma:: +* Divisi lyrics:: +* Switching the melody associated with a lyrics line:: +* Specifying melismata within the lyrics:: +* Lyrics independent of notes:: +@end menu +@node Lyrics to multiple notes of a melisma +@subsubsection Lyrics to multiple notes of a melisma + +UNTRANSLATED NODE: IGNORE ME + +@node Divisi lyrics +@subsubsection Divisi lyrics + +UNTRANSLATED NODE: IGNORE ME + +@node Switching the melody associated with a lyrics line +@subsubsection Switching the melody associated with a lyrics line + +UNTRANSLATED NODE: IGNORE ME + +@node Specifying melismata within the lyrics +@subsubsection Specifying melismata within the lyrics + +UNTRANSLATED NODE: IGNORE ME + +@node Lyrics independent of notes +@subsubsection Lyrics independent of notes + +UNTRANSLATED NODE: IGNORE ME + +@node Spacing lyrics +@subsection Spacing lyrics + +UNTRANSLATED NODE: IGNORE ME + +@node More about stanzas +@subsection More about stanzas + +UNTRANSLATED NODE: IGNORE ME + +@node Ambitus +@subsection Ambitus + +UNTRANSLATED NODE: IGNORE ME + +@node Other vocal issues +@subsection Other vocal issues + +UNTRANSLATED NODE: IGNORE ME + +@node Rhythmic music +@section Rhythmic music + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Showing melody rhythms:: +* Entering percussion:: +* Percussion staves:: +* Ghost notes:: +@end menu +@node Showing melody rhythms +@subsection Showing melody rhythms + +UNTRANSLATED NODE: IGNORE ME + +@node Entering percussion +@subsection Entering percussion + +UNTRANSLATED NODE: IGNORE ME + +@node Percussion staves +@subsection Percussion staves + +UNTRANSLATED NODE: IGNORE ME + +@node Ghost notes +@subsection Ghost notes + +UNTRANSLATED NODE: IGNORE ME + +@node Guitar +@section Guitar + +UNTRANSLATED NODE: IGNORE ME + +@menu +* String number indications:: +* Tablatures basic:: +* Non-guitar tablatures:: +* Banjo tablatures:: +* Fret diagrams:: +* Right hand fingerings:: +* Other guitar issues:: +@end menu +@node String number indications +@subsection String number indications + +UNTRANSLATED NODE: IGNORE ME + +@node Tablatures basic +@subsection Tablatures basic + +UNTRANSLATED NODE: IGNORE ME + +@node Non-guitar tablatures +@subsection Non-guitar tablatures + +UNTRANSLATED NODE: IGNORE ME + +@node Banjo tablatures +@subsection Banjo tablatures + +UNTRANSLATED NODE: IGNORE ME + +@node Fret diagrams +@subsection Fret diagrams + +UNTRANSLATED NODE: IGNORE ME + +@node Right hand fingerings +@subsection Right hand fingerings + +UNTRANSLATED NODE: IGNORE ME + +@node Other guitar issues +@subsection Other guitar issues + +UNTRANSLATED NODE: IGNORE ME + +@node Bagpipe +@section Bagpipe + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Bagpipe definitions:: +* Bagpipe example:: +@end menu +@node Bagpipe definitions +@subsection Bagpipe definitions + +UNTRANSLATED NODE: IGNORE ME + +@node Bagpipe example +@subsection Bagpipe example + +UNTRANSLATED NODE: IGNORE ME + +@node Ancient notation +@section Ancient notation + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Ancient note heads:: +* Ancient accidentals:: +* Ancient rests:: +* Ancient clefs:: +* Ancient flags:: +* Ancient time signatures:: +* Ancient articulations:: +* Custodes:: +* Divisiones:: +* Ligatures:: +* Gregorian Chant contexts:: +* Mensural contexts:: +* Musica ficta accidentals:: +* Figured bass:: +@end menu +@node Ancient note heads +@subsection Ancient note heads + +UNTRANSLATED NODE: IGNORE ME + +@node Ancient accidentals +@subsection Ancient accidentals + +UNTRANSLATED NODE: IGNORE ME + +@node Ancient rests +@subsection Ancient rests + +UNTRANSLATED NODE: IGNORE ME + +@node Ancient clefs +@subsection Ancient clefs + +UNTRANSLATED NODE: IGNORE ME + +@node Ancient flags +@subsection Ancient flags + +UNTRANSLATED NODE: IGNORE ME + +@node Ancient time signatures +@subsection Ancient time signatures + +UNTRANSLATED NODE: IGNORE ME + +@node Ancient articulations +@subsection Ancient articulations + +UNTRANSLATED NODE: IGNORE ME + +@node Custodes +@subsection Custodes + +UNTRANSLATED NODE: IGNORE ME + +@node Divisiones +@subsection Divisiones + +UNTRANSLATED NODE: IGNORE ME + +@node Ligatures +@subsection Ligatures + +UNTRANSLATED NODE: IGNORE ME + +@menu +* White mensural ligatures:: +* Gregorian square neumes ligatures:: +@end menu +@node White mensural ligatures +@subsubsection White mensural ligatures + +UNTRANSLATED NODE: IGNORE ME + +@node Gregorian square neumes ligatures +@subsubsection Gregorian square neumes ligatures + +UNTRANSLATED NODE: IGNORE ME + +@node Gregorian Chant contexts +@subsection Gregorian Chant contexts + +UNTRANSLATED NODE: IGNORE ME + +@node Mensural contexts +@subsection Mensural contexts + +UNTRANSLATED NODE: IGNORE ME + +@node Musica ficta accidentals +@subsection Musica ficta accidentals + +UNTRANSLATED NODE: IGNORE ME + +@node Figured bass +@subsection Figured bass + +UNTRANSLATED NODE: IGNORE ME + +@node Other instrument specific notation +@section Other instrument specific notation + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Artificial harmonics (strings):: +@end menu +@node Artificial harmonics (strings) +@subsection Artificial harmonics (strings) + +UNTRANSLATED NODE: IGNORE ME + diff --git a/Documentation/fr/user/introduction.itely b/Documentation/fr/user/introduction.itely new file mode 100644 index 0000000000..bfb50ccdef --- /dev/null +++ b/Documentation/fr/user/introduction.itely @@ -0,0 +1,43 @@ +@node Introduction +@chapter Introduction + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Engraving:: +* Automated engraving:: +* What symbols to engrave?:: +* Music representation:: +* Example applications:: +* About this manual:: +@end menu +@node Engraving +@section Engraving + +UNTRANSLATED NODE: IGNORE ME + +@node Automated engraving +@section Automated engraving + +UNTRANSLATED NODE: IGNORE ME + +@node What symbols to engrave? +@section What symbols to engrave? + +UNTRANSLATED NODE: IGNORE ME + +@node Music representation +@section Music representation + +UNTRANSLATED NODE: IGNORE ME + +@node Example applications +@section Example applications + +UNTRANSLATED NODE: IGNORE ME + +@node About this manual +@section About this manual + +UNTRANSLATED NODE: IGNORE ME + diff --git a/Documentation/fr/user/lilypond-book.itely b/Documentation/fr/user/lilypond-book.itely new file mode 100644 index 0000000000..a01caad7e5 --- /dev/null +++ b/Documentation/fr/user/lilypond-book.itely @@ -0,0 +1,71 @@ +@node LilyPond-book +@chapter + +UNTRANSLATED NODE: IGNORE ME + +@menu +* An example of a musicological document:: +* Integrating LaTeX and music:: +* Integrating Texinfo and music:: +* Integrating HTML and music:: +* Integrating DocBook and music:: +* Music fragment options:: +* Invoking lilypond-book:: +* Filename extensions:: +* Many quotes of a large score:: +* Inserting LilyPond output into other programs:: +@end menu +@node An example of a musicological document +@section An example of a musicological document + +UNTRANSLATED NODE: IGNORE ME + +@node Integrating LaTeX and music +@section Integrating La + +UNTRANSLATED NODE: IGNORE ME + +@node Integrating Texinfo and music +@section Integrating Texinfo and music + +UNTRANSLATED NODE: IGNORE ME + +@node Integrating HTML and music +@section Integrating HTML and music + +UNTRANSLATED NODE: IGNORE ME + +@node Integrating DocBook and music +@section Integrating DocBook and music + +UNTRANSLATED NODE: IGNORE ME + +@unnumberedsubsec Common conventions +@unnumberedsubsec Including a LilyPond file +@unnumberedsubsec Including LilyPond code +@unnumberedsubsec Processing the DocBook document +@node Music fragment options +@section Music fragment options + +UNTRANSLATED NODE: IGNORE ME + +@node Invoking lilypond-book +@section Invoking + +UNTRANSLATED NODE: IGNORE ME + +@node Filename extensions +@section Filename extensions + +UNTRANSLATED NODE: IGNORE ME + +@node Many quotes of a large score +@section Many quotes of a large score + +UNTRANSLATED NODE: IGNORE ME + +@node Inserting LilyPond output into other programs +@section Inserting LilyPond output into other programs + +UNTRANSLATED NODE: IGNORE ME + diff --git a/Documentation/fr/user/lilypond.tely b/Documentation/fr/user/lilypond.tely new file mode 100644 index 0000000000..6b65254191 --- /dev/null +++ b/Documentation/fr/user/lilypond.tely @@ -0,0 +1,184 @@ +\input texinfo @c -*- coding: utf-8; mode: texinfo; -*- +@setfilename lilypond.info +@settitle GNU LilyPond +@iftex +@afourpaper +@end iftex + +@c don't remove this comment. +@ignore +@omfcreator Han-Wen Nienhuys, Jan Nieuwenhuizen and Graham Percival +@omfdescription User manual of the LilyPond music engraving system +@omftype user manual +@omfcategory Applications|Publishing +@omflanguage French +@end ignore + +@documentlanguage fr +@documentencoding UTF-8 + +@syncodeindex fn cp +@syncodeindex ky cp +@syncodeindex pg cp +@syncodeindex tp cp +@syncodeindex vr cp + +@finalout + +@titlepage +@title GNU LilyPond +@subtitle Le système de gravure musicale +@author L'équipe de développement de LilyPond + + +Copyright @copyright{} 1999--2006 by the authors + +@quotation +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.1 +or any later version published by the Free Software Foundation; +with no Invariant Sections. +A copy of the license is included in the section entitled ``GNU +Free Documentation License''. +@end quotation + +@vskip 20pt + +@lilypond[raggedright] +\score { + \context Lyrics { + \override Score.RehearsalMark #'self-alignment-X = #LEFT + \override Score.RehearsalMark #'font-size = #-2 + \mark #(ly:export (string-append + "(Pour LilyPond version " (lilypond-version) ")")) + s2 + } + \layout { + indent = 0.0\pt + } +} +@end lilypond + +@end titlepage + + +@ifnottex +Ce fichier documente GNU LilyPond. + +Copyright @copyright{} 1999--2006 by the authors + +@quotation +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.1 +or any later version published by the Free Software Foundation; +with no Invariant Sections. +A copy of the license is included in the section entitled ``GNU +Free Documentation License''. +@end quotation +@end ifnottex + + +@ifnottex +@node Top +@top GNU LilyPond --- The music typesetter +@c HJJ: Info needs `@top', which is a synonym for `@unnumbered' in TeX. + +Ce document est le manuel de l'utilisateur pour GNU LilyPond 2.8.X. +@ifhtml +(Allez au bas de la page pour voir le numéro de version exact). +@end ifhtml + +@cindex web site +@cindex URL + +Vous pouvez obtenir plus d'informations sur +@uref{http://@/www@/.lilypond@/.org/}. Ce site contient des copies en +ligne de ce manuel, ainsi qu'une documentation supplémentaire. + +@ignore +@include dedication.itely +@end ignore + +@menu +Manuel d'apprentissage + +* Preface:: +* Introduction:: quoi, pourquoi comment. +* Tutorial:: un tutoriel d'introduction. +* Putting it all together:: explication plus détaillée des concepts de LilyPond. +* Working on LilyPond projects:: traite de l'utilisation quotidienne. +* Tweaking output:: introduction aux retouches de mise en forme. + +Manuel de référence + +* Basic notation:: notation musicale standard. +* Instrument-specific notation:: +* Advanced notation:: notation plus rarement utilisée. +* Changing defaults:: retoucher la mise en forme. +* Non-musical notation:: aspects autres que la notation musicale. +* Spacing issues:: mise en page de la musique sur le papier. +* Interfaces for programmers:: utilisation avancée. + +Utilisation du programme + +* Running LilyPond:: mode d'emploi. +* LilyPond-book:: intégrer texte et musique. +* Converting from other formats:: conversion vers le format source lilypond. + +Annexes + +* Literature list:: ouvrages de référence sur la notation musicale. +* Scheme tutorial:: programmer au sein de LilyPond. +* Notation manual tables:: tables et diagrammes. +* Example templates:: modèles prêts à l'emploi. +* Cheat sheet:: résumé de la syntaxe de LilyPond. +* GNU Free Documentation License:: licence de ce document. +* LilyPond command index:: +* LilyPond index:: + +@end menu +@end ifnottex + +@contents + + +@include macros.itexi +@include preface.itely +@include introduction.itely +@include tutorial.itely +@include putting.itely +@include working.itely +@include tweaks.itely + + +@include basic-notation.itely +@include instrument-notation.itely +@include advanced-notation.itely +@include changing-defaults.itely +@include non-music.itely +@include spacing.itely +@include programming-interface.itely + +@include running.itely +@include lilypond-book.itely +@include converters.itely + + +@include literature.itely +@include scheme-tutorial.itely +@include notation-appendices.itely +@include templates.itely +@include cheatsheet.itely +@include fdl.itexi + +@node LilyPond command index +@appendix LilyPond command index + +@printindex ky + +@node LilyPond index +@appendix LilyPond index + +@printindex cp + +@bye diff --git a/Documentation/fr/user/literature.itely b/Documentation/fr/user/literature.itely new file mode 100644 index 0000000000..1400e5288a --- /dev/null +++ b/Documentation/fr/user/literature.itely @@ -0,0 +1,5 @@ +@node Literature list +@appendix Literature list + +UNTRANSLATED NODE: IGNORE ME + diff --git a/Documentation/fr/user/non-music.itely b/Documentation/fr/user/non-music.itely new file mode 100644 index 0000000000..38977cad04 --- /dev/null +++ b/Documentation/fr/user/non-music.itely @@ -0,0 +1,115 @@ +@node Non-musical notation +@chapter Non-musical notation + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Input files:: +* Titles and headers:: +* MIDI output:: +* Displaying LilyPond notation:: +* Skipping corrected music:: +@end menu +@node Input files +@section Input files + +UNTRANSLATED NODE: IGNORE ME + +@menu +* File structure (introduction):: +* Multiple scores in a book:: +* Extracting fragments of notation:: +* File structure:: +* A single music expression:: +* Including LilyPond files:: +* Text encoding:: +@end menu +@node File structure (introduction) +@subsection File structure (introduction) + +UNTRANSLATED NODE: IGNORE ME + +@node Multiple scores in a book +@subsection Multiple scores in a book + +UNTRANSLATED NODE: IGNORE ME + +@node Extracting fragments of notation +@subsection Extracting fragments of notation + +UNTRANSLATED NODE: IGNORE ME + +@node File structure +@subsection File structure + +UNTRANSLATED NODE: IGNORE ME + +@node A single music expression +@subsection A single music expression + +UNTRANSLATED NODE: IGNORE ME + +@node Including LilyPond files +@subsection Including LilyPond files + +UNTRANSLATED NODE: IGNORE ME + +@node Text encoding +@subsection Text encoding + +UNTRANSLATED NODE: IGNORE ME + +@node Titles and headers +@section Titles and headers + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Creating titles:: +* Custom titles:: +@end menu +@node Creating titles +@subsection Creating titles + +UNTRANSLATED NODE: IGNORE ME + +@node Custom titles +@subsection Custom titles + +UNTRANSLATED NODE: IGNORE ME + +@node MIDI output +@section MIDI output + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Creating MIDI files:: +* MIDI block:: +* MIDI instrument names:: +@end menu +@node Creating MIDI files +@subsection Creating MIDI files + +UNTRANSLATED NODE: IGNORE ME + +@node MIDI block +@subsection MIDI block + +UNTRANSLATED NODE: IGNORE ME + +@node MIDI instrument names +@subsection MIDI instrument names + +UNTRANSLATED NODE: IGNORE ME + +@node Displaying LilyPond notation +@section Displaying LilyPond notation + +UNTRANSLATED NODE: IGNORE ME + +@node Skipping corrected music +@section Skipping corrected music + +UNTRANSLATED NODE: IGNORE ME + diff --git a/Documentation/fr/user/notation-appendices.itely b/Documentation/fr/user/notation-appendices.itely new file mode 100644 index 0000000000..21642c5fe8 --- /dev/null +++ b/Documentation/fr/user/notation-appendices.itely @@ -0,0 +1,36 @@ +@node Notation manual tables +@appendix Notation manual tables + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Chord name chart:: +* MIDI instruments:: +* List of colors:: +* The Feta font:: +@end menu +@node Chord name chart +@appendixsec Chord name chart + +UNTRANSLATED NODE: IGNORE ME + +@node MIDI instruments +@appendixsec MIDI instruments + +UNTRANSLATED NODE: IGNORE ME + +@node List of colors +@appendixsec List of colors + +UNTRANSLATED NODE: IGNORE ME + +@subsubheading Normal colors +@subsubheading X color names +@subsubheading Color Names without a numerical suffix: +@subsubheading Color names with a numerical suffix +@subsubheading Grey Scale +@node The Feta font +@appendixsec The Feta font + +UNTRANSLATED NODE: IGNORE ME + diff --git a/Documentation/fr/user/preface.itely b/Documentation/fr/user/preface.itely new file mode 100644 index 0000000000..91a0b4235b --- /dev/null +++ b/Documentation/fr/user/preface.itely @@ -0,0 +1,5 @@ +@node Preface +@unnumbered Preface + +UNTRANSLATED NODE: IGNORE ME + diff --git a/Documentation/fr/user/programming-interface.itely b/Documentation/fr/user/programming-interface.itely new file mode 100644 index 0000000000..2417124af9 --- /dev/null +++ b/Documentation/fr/user/programming-interface.itely @@ -0,0 +1,149 @@ +@node Interfaces for programmers +@chapter Interfaces for programmers + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Music functions:: +* Programmer interfaces:: +* Building complicated functions:: +* Markup programmer interface:: +* Contexts for programmers:: +* Scheme procedures as properties:: +@end menu +@node Music functions +@section Music functions + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Overview of music functions:: +* Simple substitution functions:: +* Paired substitution functions:: +* Mathematics in functions:: +* Void functions:: +@end menu +@node Overview of music functions +@subsection Overview of music functions + +UNTRANSLATED NODE: IGNORE ME + +@node Simple substitution functions +@subsection Simple substitution functions + +UNTRANSLATED NODE: IGNORE ME + +@node Paired substitution functions +@subsection Paired substitution functions + +UNTRANSLATED NODE: IGNORE ME + +@node Mathematics in functions +@subsection Mathematics in functions + +UNTRANSLATED NODE: IGNORE ME + +@node Void functions +@subsection Void functions + +UNTRANSLATED NODE: IGNORE ME + +@node Programmer interfaces +@section Programmer interfaces + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Input variables and Scheme:: +* Internal music representation:: +@end menu +@node Input variables and Scheme +@subsection Input variables and Scheme + +UNTRANSLATED NODE: IGNORE ME + +@node Internal music representation +@subsection Internal music representation + +UNTRANSLATED NODE: IGNORE ME + +@node Building complicated functions +@section Building complicated functions + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Displaying music expressions:: +* Music properties:: +* Doubling a note with slurs (example):: +* Adding articulation to notes (example):: +@end menu +@node Displaying music expressions +@subsection Displaying music expressions + +UNTRANSLATED NODE: IGNORE ME + +@node Music properties +@subsection Music properties + +UNTRANSLATED NODE: IGNORE ME + +@node Doubling a note with slurs (example) +@subsection Doubling a note with slurs (example) + +UNTRANSLATED NODE: IGNORE ME + +@node Adding articulation to notes (example) +@subsection Adding articulation to notes (example) + +UNTRANSLATED NODE: IGNORE ME + +@node Markup programmer interface +@section Markup programmer interface + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Markup construction in Scheme:: +* How markups work internally:: +* New markup command definition:: +@end menu +@node Markup construction in Scheme +@subsection Markup construction in Scheme + +UNTRANSLATED NODE: IGNORE ME + +@node How markups work internally +@subsection How markups work internally + +UNTRANSLATED NODE: IGNORE ME + +@node New markup command definition +@subsection New markup command definition + +UNTRANSLATED NODE: IGNORE ME + +@node Contexts for programmers +@section Contexts for programmers + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Context evaluation:: +* Running a function on all layout objects:: +@end menu +@node Context evaluation +@subsection Context evaluation + +UNTRANSLATED NODE: IGNORE ME + +@node Running a function on all layout objects +@subsection Running a function on all layout objects + +UNTRANSLATED NODE: IGNORE ME + +@node Scheme procedures as properties +@section Scheme procedures as properties + +UNTRANSLATED NODE: IGNORE ME + diff --git a/Documentation/fr/user/putting.itely b/Documentation/fr/user/putting.itely new file mode 100644 index 0000000000..16d2054dfb --- /dev/null +++ b/Documentation/fr/user/putting.itely @@ -0,0 +1,25 @@ +@node Putting it all together +@chapter Putting it all together + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Extending the templates:: +* How LilyPond files work:: +* Score is a single musical expression:: +@end menu +@node Extending the templates +@section Extending the templates + +UNTRANSLATED NODE: IGNORE ME + +@node How LilyPond files work +@section How LilyPond files work + +UNTRANSLATED NODE: IGNORE ME + +@node Score is a single musical expression +@section Score is a single musical expression + +UNTRANSLATED NODE: IGNORE ME + diff --git a/Documentation/fr/user/running.itely b/Documentation/fr/user/running.itely new file mode 100644 index 0000000000..438c5bf072 --- /dev/null +++ b/Documentation/fr/user/running.itely @@ -0,0 +1,51 @@ +@node Running LilyPond +@chapter Running LilyPond + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Invoking lilypond:: +* Notes for the MacOS X app:: +* Updating files with convert-ly:: +* Reporting bugs:: +* Error messages:: +* Editor support:: +* Point and click:: +@end menu +@node Invoking lilypond +@section Invoking lilypond + +UNTRANSLATED NODE: IGNORE ME + +@subsection Command line options +@subsection Environment variables +@node Notes for the MacOS X app +@section Notes for the MacOS X app + +UNTRANSLATED NODE: IGNORE ME + +@node Updating files with convert-ly +@section Updating with + +UNTRANSLATED NODE: IGNORE ME + +@node Reporting bugs +@section Reporting bugs + +UNTRANSLATED NODE: IGNORE ME + +@node Error messages +@section Error messages + +UNTRANSLATED NODE: IGNORE ME + +@node Editor support +@section Editor support + +UNTRANSLATED NODE: IGNORE ME + +@node Point and click +@section Point and click + +UNTRANSLATED NODE: IGNORE ME + diff --git a/Documentation/fr/user/scheme-tutorial.itely b/Documentation/fr/user/scheme-tutorial.itely new file mode 100644 index 0000000000..d89fb346fd --- /dev/null +++ b/Documentation/fr/user/scheme-tutorial.itely @@ -0,0 +1,5 @@ +@node Scheme tutorial +@appendix Scheme tutorial + +UNTRANSLATED NODE: IGNORE ME + diff --git a/Documentation/fr/user/spacing.itely b/Documentation/fr/user/spacing.itely new file mode 100644 index 0000000000..bb9119890e --- /dev/null +++ b/Documentation/fr/user/spacing.itely @@ -0,0 +1,155 @@ +@node Spacing issues +@chapter Spacing issues + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Paper and pages:: +* Music layout:: +* Vertical spacing:: +* Horizontal spacing:: +* Breaks:: +* Displaying spacing:: +@end menu +@node Paper and pages +@section Paper and pages + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Paper size:: +* Page formatting:: +@end menu +@node Paper size +@subsection Paper size + +UNTRANSLATED NODE: IGNORE ME + +@node Page formatting +@subsection Page formatting + +UNTRANSLATED NODE: IGNORE ME + +@node Music layout +@section Music layout + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Setting global staff size:: +* Score layout:: +@end menu +@node Setting global staff size +@subsection Setting global staff size + +UNTRANSLATED NODE: IGNORE ME + +@node Score layout +@subsection Score layout + +UNTRANSLATED NODE: IGNORE ME + +@node Vertical spacing +@section Vertical spacing + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Vertical spacing inside a system:: +* Vertical spacing of piano staves:: +* Vertical spacing between systems:: +* Controlling spacing of individual systems:: +* Two-pass vertical spacing:: +@end menu +@node Vertical spacing inside a system +@subsection Vertical spacing inside a system + +UNTRANSLATED NODE: IGNORE ME + +@node Vertical spacing of piano staves +@subsection Vertical spacing of piano staves + +UNTRANSLATED NODE: IGNORE ME + +@node Vertical spacing between systems +@subsection Vertical spacing between systems + +UNTRANSLATED NODE: IGNORE ME + +@node Controlling spacing of individual systems +@subsection Controlling spacing of individual systems + +UNTRANSLATED NODE: IGNORE ME + +@node Two-pass vertical spacing +@subsection Two-pass vertical spacing + +UNTRANSLATED NODE: IGNORE ME + +@node Horizontal spacing +@section Horizontal Spacing + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Horizontal spacing overview:: +* New spacing area:: +* Changing horizontal spacing:: +* Line length:: +@end menu +@node Horizontal spacing overview +@subsection Horizontal spacing overview + +UNTRANSLATED NODE: IGNORE ME + +@node New spacing area +@subsection New spacing area + +UNTRANSLATED NODE: IGNORE ME + +@node Changing horizontal spacing +@subsection Changing horizontal spacing + +UNTRANSLATED NODE: IGNORE ME + +@node Line length +@subsection Line length + +UNTRANSLATED NODE: IGNORE ME + +@node Breaks +@section Breaks + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Line breaking:: +* Page breaking:: +* Optimal page breaking:: +* Optimal page turning:: +@end menu +@node Line breaking +@subsection Line breaking + +UNTRANSLATED NODE: IGNORE ME + +@node Page breaking +@subsection Page breaking + +UNTRANSLATED NODE: IGNORE ME + +@node Optimal page breaking +@subsection Optimal page breaking + +UNTRANSLATED NODE: IGNORE ME + +@node Optimal page turning +@subsection Optimal page turning + +UNTRANSLATED NODE: IGNORE ME + +@node Displaying spacing +@section Displaying spacing + +UNTRANSLATED NODE: IGNORE ME + diff --git a/Documentation/fr/user/templates.itely b/Documentation/fr/user/templates.itely new file mode 100644 index 0000000000..bd3c4228a0 --- /dev/null +++ b/Documentation/fr/user/templates.itely @@ -0,0 +1,65 @@ +@node Example templates +@appendix Example templates + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Single staff:: +* Piano templates:: +* String quartet:: +* Vocal ensembles:: +* Ancient notation templates:: +* Jazz combo:: +* Lilypond-book templates:: +@end menu +@node Single staff +@appendixsec Single staff + +UNTRANSLATED NODE: IGNORE ME + +@appendixsubsec Notes only +@appendixsubsec Notes and lyrics +@appendixsubsec Notes and chords +@appendixsubsec Notes, lyrics, and chords. +@node Piano templates +@appendixsec Piano templates + +UNTRANSLATED NODE: IGNORE ME + +@appendixsubsec Solo piano +@appendixsubsec Piano and melody with lyrics +@appendixsubsec Piano centered lyrics +@appendixsubsec Piano centered dynamics +@node String quartet +@appendixsec String quartet + +UNTRANSLATED NODE: IGNORE ME + +@appendixsubsec String quartet +@appendixsubsec String quartet parts +@node Vocal ensembles +@appendixsec Vocal ensembles + +UNTRANSLATED NODE: IGNORE ME + +@appendixsubsec SATB vocal score +@appendixsubsec SATB vocal score and automatic piano reduction +@node Ancient notation templates +@appendixsec Ancient notation templates + +UNTRANSLATED NODE: IGNORE ME + +@appendixsubsec Transcription of mensural music +@appendixsubsec Gregorian transcription template +@node Jazz combo +@appendixsec Jazz combo + +UNTRANSLATED NODE: IGNORE ME + +@node Lilypond-book templates +@appendixsec Lilypond-book templates + +UNTRANSLATED NODE: IGNORE ME + +@appendixsubsec LaTeX +@appendixsubsec Texinfo diff --git a/Documentation/fr/user/tutorial.itely b/Documentation/fr/user/tutorial.itely new file mode 100644 index 0000000000..b8869424a5 --- /dev/null +++ b/Documentation/fr/user/tutorial.itely @@ -0,0 +1,1476 @@ +@c -*- coding: utf-8; mode: texinfo; documentlanguage: fr -*- +@c This file is part of lilypond.tely + +@c TODO: +@c * more details about running lilypond; error messages, +@c compiling/viewing (emacs?) +@c * where to go from First steps+More basics? + +@c wherever possible, do not include index entries here; the +@c index should point to stuff in the reference manual. -gp + +@c Your first LilyPond score in 10 minutes? + +@node Tutorial +@chapter Tutorial + +Ce tutoriel commence par une courte introduction au langage utilisé +par LilyPond pour représenter la musique. Après ce premier contact, +nous verrons comment produire une partition à imprimer. Vous serez +alors capable de créer et d'imprimer vos propres partitions. + +@ifhtml +Beaucoup de gens apprennent à utiliser les programmes en les essayant +et en bidouillant avec. C'est également possible avec LilyPond. Si +vous cliquez sur une image dans la version HTML de ce manuel, vous +verrez exactement le code LilyPond utilisé pour générer cette image. +Essayez sur cette image + +@lilypond[fragment,quote,ragged-right,relative=2] +c-\markup { \bold \huge { Click here. } } +@end lilypond +@end ifhtml + +En copiant et en collant l'intégralité du code dans un fichier test, +vous aurez un modèle comme base pour expérimenter. Si vous +apprenez de cette façon, vous aurez probablement envie d'imprimer ou +de créer un lien vers +@ifhtml +la +@end ifhtml +@ref{Cheat sheet}, tableau qui répertorie les commandes usuelles +pour une consultation rapide. + +@menu +* First steps:: +* Running LilyPond for the first time:: +* More about pitches:: +* Entering ties:: +* Automatic and manual beams:: +* Octave entry:: +* Music expressions explained:: +* More staves:: +* Adding articulation marks to notes:: +* Combining notes into chords:: +* Advanced rhythmic commands:: +* Commenting input files:: +* Printing lyrics:: +* A lead sheet:: +* Adding titles:: +* Single staff polyphony:: +* Piano staves:: +* Organizing larger pieces:: +* An orchestral part:: +* After the tutorial:: +@end menu + + +@node First steps +@section First steps + +Le premier exemple montre comment écrire la partition la plus +élémentaire qui soit, une gamme (@rglos{scale}). Une @rglos{note} peut +être entrée en tapant son nom, de @samp{a} à @samp{g}. Donc si vous +entrez + +@example +@{ +c d e f g a b +@} +@end example + +@noindent +le résultat ressemblera à + +@lilypond[fragment,quote,notime,relative=1] +c d e f g a b +@end lilypond + +@c DIV specific +Il est aussi possible d'utiliser les noms de notes français @samp{do +re mi fa sol la si}, en insérant au début du fichier la ligne +@samp{\include "catalan.ly"} +@c END DIV + +Tout extrait de code LilyPond doit être entouré d'une @{paire +d'accolades@}. Bien que la plupart des exemples de ce manuel n'en +comportent pas, ne les oubliez pas dans vos compositions ! + +De plus, de nombreux exemples utilisent le mode @code{relative}. Ceci +est expliqué à la section @ref{Octave entry} ; sachez dès à présent +que certains exemples devraient être libellés sous la forme +@code{\relative @{ @emph{...musique...} @}}. +De nombreux exemples ont aussi été compressés horizontalement pour +économiser de la place, grace à la commande +@code{\paper @{ragged-right = ##t @}}. + +@cindex Case sensitive +Enfin, LilyPond est sensible à la casse. @code{ @{ c d e @} } est +un code valide ; @code{ @{ C D E @} } produira un message d'erreur. + +La durée (@rglos{duration}) d'une note est spécifiée par un nombre +qui suit le nom de cette note : @samp{1} pour une ronde (@rglos{whole +note}), @samp{2} pour une blanche (@rglos{half note}), @samp{4} pour +une noire (@rglos{quarter note}) et ainsi de suite. + +@example +a1 a2 a4 a16 a32 +@end example + +@lilypond[fragment,quote,notime,relative=2] +\set Staff.autoBeaming = ##f +{ a1 a2 a4 a16 a32 s16_" " } +@end lilypond + +Si aucune durée n'est spécifiée, la dernière durée entrée est utilisée +pour les notes suivantes. La valeur implicite de la première note +dans les fichiers sources de la partition est la noire : + +@example +a a8 a a2 a +@end example + +@lilypond[fragment,quote,notime,relative=2] +{ a a8 a a2 a s16_" " } +@end lilypond + + +On saisit un silence (@rglos{rest}) tout comme une note, mais avec le +caractère @samp{r} + +@example +r2 r4 r8 r16 +@end example + +@lilypond[fragment,quote,notime] +r2 r4 r8 r16 s16_" " +@end lilypond + +Ajouter un point @samp{.} après une durée permet d'obtenir une note +pointée (@rglos{dotted note}) + +@example +a2. a4 a8. a16 +@end example + +@lilypond[fragment,quote,notime,relative=1] +{ a2. a4 a8. a16 s16_" " } +@end lilypond + +La métrique (@rglos{time signature}) est définie par +la commande @code{\time} + +@example +\time 3/4 +\time 6/8 +\time 4/4 +@end example + +@c A clef here may lead to confusion, remove it. +@lilypond[fragment,quote] +\override Staff.Clef #'transparent = ##t +\time 3/4 +s4_" " +\time 6/8 +s4_" " +\time 4/4 +s16_" " +@end lilypond + +La @rglos{clef} est définie par la commande @code{\clef} + +@example +\clef treble +\clef bass +\clef alto +\clef tenor +@end example + +@lilypond[fragment,quote,notime] +\clef treble +s4_" " +\clef bass +s4_" " +\clef alto +s4_" " +\clef tenor +s16_" " +@end lilypond + +Pensez bien à encadrer les notes et les commandes avec des accolades +@code{@{@tie{}@dots{}@tie{}@}} pour pouvoir obtenir un résultat +imprimable. + +@lilypond[fragment,quote,noindent,verbatim] +\time 3/4 +\clef bass +c2 e4 g2. +f4 e d c2 r4 +@end lilypond + +Pour plus d'informations sur + +@quotation +@table @asis +@item la définition des hauteurs et des durées +voir +@ref{Pitches}, et @ref{Durations}. +@item les clefs +voir @ref{Clef} +@item les silences +voir @ref{Rests}. +@item la métrique et autres commandes liées au temps +voir @ref{Time signature}. +@end table +@end quotation + + +@node Running LilyPond for the first time +@section Running LilyPond for the first time + +@c cheesy title to avoid clash with chapter name. + +Dans la section précédente, nous avons vu quelles sortes d'éléments +peut contenir un fichier LilyPond. Dans cette section nous +expliquerons quelles commandes exécuter et comment voir ou imprimer le +résultat de LilyPond. Si vous n'avez jamais utilisé +LilyPond, voulez tester votre installation ou souhaitez compiler +vous-même un fichier d'exemple, lisez cette section. + +@unnumberedsubsec MacOS X + +Si vous double-cliquez sur LilyPond.app, un fichier d'exemple sera +ouvert. Sauvegardez-le, par exemple, sous @file{test.ly} sur votre +bureau, et traitez-le ensuite avec la commande du menu +@samp{Compile > Typeset File}. +Le fichier PDF résultant est alors affiché sur votre écran. + +Prenez note que le premier démarrage prend une minute ou deux , +car toutes les polices systèmes doivent être d'abord analysées. + +@unnumberedsubsec Windows + +Sous Windows, démarrez un éditeur de texte @footnote{N'importe quel +éditeur simple ou orienté programmation, qui prend en charge le +codage de caractères UTF-8, fera l'affaire, par exemple +Notepad. N'utilisez pas de traitement de texte car ceux-ci insèrent +des codes de formatage qui posent problème à LilyPond.} et saisissez + +@verbatim +@{ c'4 e' g' @} +@end verbatim + +Enregistrez le sur le bureau sous @file{test.ly} et vérifiez bien +qu'il ne s'appelle pas @file{test.ly.TXT}. Double-cliquez sur le +fichier @file{test.ly} pour le traiter et afficher le fichier +PDF résultant. + + +@unnumberedsubsec Unix + +Commencez par ouvrir une fenêtre de terminal et un éditeur de +texte. Par exemple, vous pouvez ouvrir un xterm et exécuter +@code{joe}. @footnote{Des fichiers de macros pour les fans de VIM et un +@code{LilyPond-mode} pour les fans d'Emacs existent. S'ils ne sont pas +encore installés, consultez le fichier @file{INSTALL.txt}.} Dans votre +éditeur, entrez le texte suivant et sauvegardez le fichier sous +@file{test.ly} + +@verbatim +@{ c'4 e' g' @} +@end verbatim + +@noindent +Pour traiter @file{test.ly}, procédez comme ceci : + +@example +lilypond test.ly +@end example + +@noindent +Vous verrez quelque chose ressemblant à : + +@example +lilypond test.ly +GNU LilyPond 2.10.0 +Processing `test.ly' +Parsing... +Interpreting music... [1] +Preprocessing graphical objects... +Calculating line breaks... [2] +Layout output to `test.ps'... +Converting to `test.pdf'... +@end example + +@c DIV specific +Suivant votre installation, les messages peuvent être traduits. +@c END DIV + +@cindex DVI file +@cindex Viewing music +@cindex xdvi +@noindent +Le résultat est le fichier @file{test.pdf} que vous pouvez imprimer ou +visualiser avec les outils standards de votre système d'exploitation. +@footnote{Si votre système ne dispose pas des outils nécessaires, +vous pouvez essayer +@uref{http://@/www@/.cs@/.wisc@/.edu/@/~ghost/,Ghostscript}, un +programme pour voir et imprimer les fichiers PDF et PostScript.} + +@node More about pitches +@section More about pitches + +Un dièse (@rglos{sharp}) s'obtient en ajoutant @samp{is} au nom de la +note, un bémol (@rglos{flat}) en ajoutant @samp{es}. Comme vous pouvez +vous y attendre, un double dièse ou double bémol est obtenu en +ajoutant @samp{isis} ou @samp{eses}@footnote{Cette syntaxe est dérivée +de la convention de dénomination des notes dans les langues nordiques +et germaniques, comme l'allemand ou le hollandais.}. + +@c DIV specific +Si vous utilisez la commande @samp{\include "catalan.ly"} pour entrer +les noms de notes français au lieu des noms hollandais, il faudra +ajouter un @samp{d} pour un dièse, et un @samp{b} pour un bèmol. Le +double dièse et le double bémol s'obtiennent en ajoutant +respectivement @samp{dd} et @samp{bb} +@c END DIV + +@example +cis1 ees fisis aeses +@end example + +@lilypond[fragment,quote,notime] +\set Score.timing = ##f +\transpose c c' { cis1 ees fisis aeses s16_" " } +@end lilypond + +@cindex key signature, setting +L'armure est déterminée par la commande @code{\key}, suivie d'une +hauteur puis de @code{\major} (majeur) ou @code{\minor} (mineur) : + +@example +\key d \major +g1 +\key c \minor +g +@end example + +@lilypond[fragment,quote,notime,fragment] +\key d \major +g'1 +\key c \minor +g' +@end lilypond + +@noindent +La combinaison de l'armure et des hauteurs de note -- y compris les +altérations -- permet de déterminer dans quel cas afficher les +altérations accidentelles. Cette fonctionnalité est souvent source de +confusion pour les nouveaux utilisateurs, aussi expliquons-la en +détail. + + +LilyPond fait une nette distinction entre le contenu musical et la +mise en forme. L'altération d'une note -- bémol, bécarre ou dièse -- +fait partie de sa hauteur, et donc du contenu musical. La présence +d'une altération accidentelle -- un @emph{signe} bémol, bécarre ou +dièse -- devant la note correspondante est une question de mise en +page. La mise en page est un processus qui obéit à des règles ; les +altérations accidentelles sont donc automatiquement imprimées suivant +ces règles. Les hauteurs de note appartiennent à la musique que vous +entrez, et comme vous êtes sensé(e) entrer ce que vous voulez entendre, +LilyPond, qui n'est chargé que de la gravure, ne les choisit pas à +votre place. + +Dans cet exemple + +@lilypond[quote,notime,fragment] +\key d \major +d' cis' fis' +@end lilypond + +@noindent +si aucune note n'a d'altération accidentelle, vous devez +cependant entrer + +@example +\key d \major +d cis fis +@end example + +@noindent +Le code @samp{d} ne veut pas dire « imprimer un point noir juste +en-dessous de la portée. » Cela signifie plutôt : « une note ayant la +hauteur ré naturel. » Avec l'armure de la bémol majeur, ce ré sera flanqué +d'un bécarre accidentel. + +@lilypond[quote,notime,fragment,relative=1,verbatim] +\key as \major +d +@end lilypond + +Ajouter explicitement toutes les altérations requiert un peu plus +d'effort dans la phase de saisie, mais avec l'avantage que la +transposition en sera facilitée. De plus les altérations accidentelles +peuvent être imprimées suivant plusieurs conventions. Regardez +@ref{Automatic accidentals} pour connaître la manière dont les +altérations accidentelles peuvent être imprimées suivant différentes +règles. + + +Pour plus d'informations sur + +@quotation +@table @asis +@item les altérations accidentelles +voir @ref{Automatic accidentals}. + +@item les armures +voir @ref{Key signature}. +@end table +@end quotation + +@node Entering ties +@section Entering ties + +@cindex tie +Une liaison de prolongation@footnote{parfois aussi appelée liaison de +tenue.} (@rglos{tie}) est créée en ajoutant un tilde @samp{~} à +la suite de la première note liée. + +@lilypond[quote,notime,fragment,verbatim,relative=3] +g4~ g a2~ a4 +@end lilypond + +Pour plus d'informations sur les liaisons de prolongation, voir @ref{Ties}. + + + +@node Automatic and manual beams +@section Automatic and manual beams + +@cindex beams, by hand +Toutes les ligatures@footnote{parfois appelées aussi liens de croches} +(@rglos{beam}), sont dessinées automatiquement : + +@lilypond[quote,fragment,relative=2,verbatim] +a8 ais d es r d +@end lilypond + +@noindent +Si l'emplacement des barres ne vous convient pas, vous pouvez +les entrer à la main. Marquer la première note à être attachée d'un +@samp{[} et la dernière d'un @samp{]}. + +@lilypond[quote,fragment,relative=2,verbatim] +a8[ ais] d[ es r d] +@end lilypond + +Pour plus d'informations sur les ligatures, voir @ref{Manual beams}. + + +Voici comment se comportent ensemble armures, altérations +accidentelles et liaisons : + +@lilypond[fragment,quote,noindent,line-width=50\staff-space,verbatim] +\relative c'' { + \time 4/4 + \key g \minor + \clef treble + r4 r8 a8 gis4 b + a8 d4.~ d e,8 + fis4 fis8 fis8 eis4 a8 gis~ + gis2 r2 +} +@end lilypond + +@cindex accidentals + + +@noindent +Il y a plusieurs points intéressants à noter dans cet exemple. Les +barres de mesure et les liens de croches sont dessinés +automatiquement. Les sauts de ligne sont calculés automatiquement ; +peu importe où se situent les sauts de ligne dans le fichier source. +Enfin, l'ordre dans lequel la métrique, l'armure et les changements de +clefs sont saisis n'a pas d'importance : dans la sortie imprimable, +ils sont organisés suivant les conventions standard de notation. + + + +@node Octave entry +@section Octave entry + + +@c Tim wants to move this quotes example just before the: quotes-do not-work +@c score, but we'd need to remove quotes from the other two (key and +@c tie) examples... + +@c better to have this just before the `octaves are bad' snipped +@c but we'd need to remove the ', from \key and tie +Pour hausser une note d'une octave, ajoutez une apostrophe @code{'} au +nom de la note ; pour la baisser d'une octave, ajoutez une virgule +@code{,}. Le do central (entre la clef de sol et la clef de fa) est +@code{c'} + +@lilypond[quote,notime,fragment,verbatim] +c'4 c'' c''' \clef bass c c, +@end lilypond + +Un exemple de l'utilisation des apostrophes dans ce fragment de Mozart : + +@lilypond[quote,ragged-right,fragment,verbatim] +\key a \major +\time 6/8 +cis''8. d''16 cis''8 e''4 e''8 +b'8. cis''16 b'8 d''4 d''8 +@end lilypond + +@noindent +Cet exemple montre qu'il faut beaucoup d'apostrophes pour écrire de la +musique dans un registre aigu. Ceci rend le fichier moins lisible, et +c'est une source d'erreurs. La solution consiste à utiliser le mode +d'« octaves relatives ». C'est la façon la plus commode de copier de +la musique existante. + +En mode relatif, une note sans signe d'octaviation -- @code{'} ou +@code{,} après le nom de la note -- est interprétée de manière à ce +qu'elle soit la plus proche de la note précédente. Par exemple, +@samp{c f} monte, alors que @samp{c g} descend. + +Pour utiliser le mode relatif, ajoutez @code{\relative} avant le +morceau de musique. La première hauteur de note est choisie +relativement en fonction du do central -- c'est-à-dire @code{c'}. + + + +@lilypond[quote,notime,fragment,verbatim] +\relative { + c' f c g c +} +@end lilypond + + +Puisque la plus grande partie de la musique utilise de petits +intervalles, les pièces peuvent être écrites en mode relatif sans +pratiquement utiliser de signes d'octavation. L'exemple précédent est +entré comme + +@lilypond[quote,ragged-right,verbatim] +\relative { + \key a \major + \time 6/8 + cis'8. d16 cis8 e4 e8 + b8. cis16 b8 d4 d8 +} +@end lilypond + +@c needed better, maybe even redundant explanation +@c added another example below. +@c grappig: Pa vond het heel logies, en slim toen-i eenmaal begreep. +@c in eerste instantie drong het `relative' niet door zonder extra uitleg. +Les intervalles plus grands qu'une quarte sont produits en ajoutant +les signes d'octavation : + +@lilypond[quote,notime,verbatim,fragment] +\relative c { + c'' f, f c' c g' c, +} +@end lilypond + +En résumé, apostrophes et virgules ne déterminent pas la hauteur +absolue d'une note dans le mode @code{\relative}. Au lieu de cela, la +hauteur de la note est relative à la précédente, et modifier l'octave +d'une seule note changera l'octave de toutes les notes suivantes. + +Pour plus d'information sur les octaves relatives, voir +@ref{Relative octaves}, et @ref{Octave check}. + + +@node Music expressions explained +@section Music expressions explained + + +Dans les fichiers source LilyPond, la musique est représentée par ce qu'on +appelle des @emph{expressions musicales}. Nous en avons déjà vu dans +les quelques exemples précédents ; une seule note constitue une +expression musicale : + +@lilypond[fragment,quote,verbatim,relative=3] +a4 +@end lilypond + +Mettre un groupe de notes entre accolades crée une nouvelle expression +musicale : + +@lilypond[fragment,quote,verbatim,relative=3] +{ a4 g4 } +@end lilypond + +Placer une séquence d'expressions musicales -- des notes par exemple +-- entre accolades signifie qu'elles doivent être jouées +successivement, les unes après les autres. Le résultat est une +expression, qui peut elle-même être regroupée séquentiellement avec +d'autres expressions. Ici, l'expression de l'exemple précédent est +combinée à deux notes : + +@lilypond[fragment,quote,verbatim,relative=3] +{ { a4 g } f g } +@end lilypond + +Cette technique est utile pour de la musique non monophonique. Pour +entrer une musique avec plusieurs voix ou plusieurs portées, nous +pouvons aussi combiner en parallèle les expressions. Deux voix qui doivent être +jouées en même temps, sont entrées comme une combinaison simultanée de +deux expression. Une expression musicale « simultanée » est formée en +entourant les expressions entre @code{<<} et @code{>>}. Dans l'exemple +suivant, trois expressions (contenant chacune deux notes distinctes) sont +combinées simultanément. + +@lilypond[fragment,quote,verbatim,relative=3] +<< + { a4 g } + { f e } + { d b } +>> +@end lilypond + +Ce mécanisme est similaire au formules mathématiques : une grosse formule +est créée en assemblant plusieurs petites formules. Ces types +de formules, appelées expressions, ont une définition récursive, de +telle sorte que vous pouvez fabriquer des expressions +arbitrairement longues et complexes. Par exemple, + +@example +1 + +1 + 2 + +(1 + 2) * 3 + +((1 + 2) * 3) / (4 * 5) +@end example + +@cindex expression +@cindex music expression +Ceci est une suite d'expressions, où chacune est contenue dans la +suivante. Les expressions les plus simples sont les nombres, et de +plus grandes expressions sont produites en combinant des expressions +avec des opérateurs -- comme @samp{+}, @samp{*} et @samp{/} -- et des +parenthèses. Tout comme les expressions mathématiques, les expressions +musicales peuvent être imbriquées avec une profondeur arbitraire, ce +qui est nécessaire pour de la musique complexe comme des partitions +polyphoniques. + +Notez que l'exemple suivant ne comporte qu'une seule portée, +contrairement à l'exemple précédent qui contenait trois portées +séparées. C'est parce que l'exemple commence par une note seule. Pour +déterminer le nombre de portées, LilyPond regarde le premier élément +qui n'est pas une accolade. Si c'est une seule note, il y a une portée +; si c'est une expression simultanée, il y aura plus d'une portée. + +@lilypond[fragment,quote,verbatim,relative=2] +{ + c <> + << { e f } { c <> } >> +} +@end lilypond + +Il est facile de s'y perdre avec des fichiers musicaux comprenant de nombreuses +imbrications, tant pour leur création que pour leur maintenance. Une +convention permet d'éviter cette confusion : l'indentation. Pour +entrer un fichier avec de prfondes imbrications d'accolades et de +crochets, il est d'usage d'avoir recours à une indentation qui indique +le niveau de profondeur. Formater la musique d'une telle manière en +facilite la lecture et vous aide à insérer le bon nombre d'accolades +fermant les expressions. Par exemple, + +@example +<< + @{ + @dots{} + @} + @{ + @dots{} + @} +>> +@end example + +Certains éditeurs disposent d'un mode spécifique pour saisir des +fichiers LilyPond, qui peut vous aider à indenter le fichier source. +Voir la section @ref{Editor support} pour plus d'informations. + +@node More staves +@section More staves + +Pour créer plus d'une portée, chaque partie de la musique constituant +une portée est entrée en la faisant précéder de +@code{\new Staff}. Ces éléments @code{Staff} sont combinés en parallèle avec +@code{<<} et @code{>>}, comme + +@lilypond[quote,fragment,verbatim] +<< + \new Staff { \clef treble c'' } + \new Staff { \clef bass c } +>> +@end lilypond + + +La commande @code{\new} introduit un « contexte de notation ». Un +contexte de notation est un environnement dans lequel les événements +musicaux -- comme les notes ou les commandes @code{\clef} -- sont +interprétés. Pour des pièces simples, ces contextes sont créés +automatiquement. Pour des pièces plus complexes, il est préférable de +spécifier explicitement les contextes. Cela assure que chaque fragment +aura sa propre portée. + +Il existe différents types de contextes. Les contextes @code{Staff} +(portée), @code{Voice} (voix) et @code{Score} (partition) gèrent la +notation de la mélodie, alors que @code{Lyrics} gère les paroles et +@code{ChordNames} imprime le nom des accords. + +En termes de syntaxe, faire précéder une expression musicale de +@code{\new} crée une plus grosse expression musicale. En reprenant la +comparaison, cela ressemble au signe « moins » en mathématiques. La formule +@math{(4+5)} est une expression, donc @math{-(4+5)} est une plus grosse +expression. + +Nous pouvons maintenant écrire un morceau à deux portées : + +@c TODO: (c) status of this Paul McCartney (?) song (let's all stand together) + +@lilypond[fragment,quote,verbatim,ragged-right] +\relative << + \new Staff { + \time 3/4 + \clef treble + + e'2 d4 c2 b4 a8[ a] + b[ b] g[ g] a2. + } + \new Staff { + \clef bass + c,,2 e4 g2. + f4 e d c2. + } +>> +@end lilypond + +Pour plus d'informations sur les contextes, voir leur description à +@ref{Interpretation contexts}. + + + +@node Adding articulation marks to notes +@section Adding articulation marks to notes + +@cindex articulation +@cindex accents +@cindex staccato + +Les articulations standard peuvent être ajoutées à une note en +utilisant un tiret (@samp{-}) et un caractère : + +@lilypond[fragment,quote,verbatim,relative=2] +c-. c-- c-> c-^ c-+ c-_ +@end lilypond + +@cindex fingering +De la même manière, des indications de doigté peuvent être ajoutées à +une note en utilisant un tiret (@samp{-}) et le chiffre à écrire : + +@lilypond[fragment,quote,verbatim,relative=2] +c-3 e-5 b-2 a-1 +@end lilypond + +Articulations et doigtés sont habituellement placés automatiquement, +mais vous pouvez spécifier une direction en utilisant @samp{^} (en haut) +ou @samp{_} (en bas). Vous pouvez aussi utiliser plusieurs articulations +sur la même note. Dans la plupart des cas, cependant, il est mieux de +laisser LilyPond déterminer l'emplacement de l'articulation. + +@lilypond[fragment,quote,verbatim,relative=2] +c_-^1 d^. f^4_2-> e^-_+ +@end lilypond + +Les signes de nuances sont obtenus en ajoutant à la note les noms des nuances, +précédées d'un anti-slash @samp{\} : + +@lilypond[fragment,quote,verbatim,relative=2] +c\ff c\mf +@end lilypond + +@cindex dynamics +@cindex decrescendo +@cindex crescendo + +Crescendi et decrescendi débutent avec les commandes @code{\<} et +@code{\>}. Ils se terminent soit par une nuance d'arrivée, par exemple @code{\f}, +soit par la commande @code{\!} : + +@lilypond[fragment,quote,verbatim,relative=2] +c2\< c2\ff\> c2 c2\! +@end lilypond + + + +@cindex slur + +Une liaison d'articulation (@rglos{slur}) est une courbe tracée +au-dessus de plusieurs notes. Elle indique un jeu legato. Les notes de +départ et d'arrivée sont suivies respectivement par @samp{(} et +@samp{)} : + +@lilypond[fragment,quote,fragment,relative=2,verbatim] +d4( c16) cis( d e c cis d) e( d4) +@end lilypond + +@cindex slurs versus ties +Une liaison d'articulation ressemble à une liaison de +prolongation (@rglos{tie}), +mais a une signification différente. Une liaison de prolongation fait +durer la première note plus longtemps, et ne peut être utilisée que +sur une paire de notes de même hauteur. Ces deux types de liaison +peuvent être imbriqués : + +@lilypond[quote,fragment,relative=2] +c2~( c8 fis fis4 ~ fis2 g2) +@end lilypond + +@cindex phrasing slurs +Une liaison de phrasé peut être entrée avec @code{\(} et @code{\)}, +vous pouvez donc avoir simultanément une liaison d'articulation et une +liaison de phrasé. Vous ne pouvez pas avoir de liaisons d'articulation +simultanées ni de liaisons de phrasé simultanées. + +@lilypond[quote,fragment,relative=2,verbatim] +a8(\( ais b c) cis2 b'2 a4 cis, c\) +@end lilypond + + +Pour plus d'informations sur les + +@quotation +@table @asis +@item doigtés +voir @ref{Fingering instructions}. +@item articulations +voir @ref{Articulations}. +@item liaisons d'articulation +voir @ref{Slurs}. +@item liaisons de phrasé +voir @ref{Phrasing slurs}. +@item nuances +voir @ref{Dynamics}. +@end table +@end quotation + + +@node Combining notes into chords +@section Combining notes into chords + +@cindex chords +Des accords peuvent être produits en entourant les hauteurs de note +avec les angles gauche et droit -- @samp{<} et @samp{>} -- + +@lilypond[quote,relative=1,fragment,verbatim] +r4 4 8 +@end lilypond + + +Vous pouvez combiner les indications comme les liaisons et les liens de +croches avec les accords. Ils doivent cependant être placés en +dehors des angles : + +@lilypond[quote,relative=1,fragment,verbatim] +r4 8[ ]~ +@end lilypond + +@example +r4 8\>( \!) +@end example + +@lilypond[quote,relative=1,fragment] +\slurUp +r4 8\>( \!) +@end lilypond + + +@node Advanced rhythmic commands +@section Advanced rhythmic commands + +@cindex pickup +@cindex anacruse +@cindex partial measure +Une levée est entrée avec le mot-clé @code{\partial}. Il est suivi par +une durée : @code{\partial 4} est une levée d'une noire et +@code{\partial 8} d'une croche. + +@lilypond[quote,relative=2,verbatim,fragment] +\partial 8 +f8 c2 d e +@end lilypond + +@cindex tuplets +@cindex triplets +Les n-olets sont créés avec le mot-clef @code{\times}. Celui-ci prend +deux arguments : une fraction et une expression musicale. La durée des +notes de l'expression musicale est multipliée par la fraction. Les +notes d'un triolet durent les deux tiers du temps de leur notation +réelle, cette fraction est donc de 2/3 pour les triolets : + +@lilypond[quote,relative=1,verbatim,fragment] +\times 2/3 { f8 g a } +\times 2/3 { c r c } +@end lilypond + +@cindex grace notes +@cindex acciaccatura +Des notes d'ornement sont produites en préfixant une expression musicale +avec le mot-clé @code{\appoggiatura} ou @code{\acciaccatura} : +@cindex appoggiatura +@cindex acciaccatura + +@lilypond[quote,relative=2,verbatim,fragment] +c4 \appoggiatura b16 c4 +c4 \acciaccatura b16 c4 +@end lilypond + +@noindent + +Pour plus d'informations sur les + +@quotation +@table @asis +@item ornementations +voir @ref{Grace notes}, +@item n-olets +voir @ref{Tuplets}, +@item mesures incomplètes (levées) +voir @ref{Partial measures}. +@end table +@end quotation + + +@node Commenting input files +@section Commenting input files + +@cindex comments +@cindex line comment +@cindex block comment +Un commentaire est une remarque à l'attention du lecteur du fichier +source ; il est ignoré lors de l'analyse du fichier, et n'a donc +aucun effet sur la sortie imprimable. Il existe deux types +de commentaires. Le symbole pourcent @samp{%} introduit un commentaire +d'une ligne : après @code{%}, le reste de la ligne est ignoré. Un bloc de +commentaire marque une section entière dans le fichier d'entrée. Tout ce +qui est à l'intérieur de @code{%@{} et @code{%@}} est ignoré. Le fragment +suivant montre les utilisations possible des commentaires : + +@example +% mélodie de "ah vous dirais-je maman" + c4 c g' g a a g2 + +%@{ + Cette ligne, et les notes ci-dessous + sont ignorées, puisque'elles sont dans + un bloc de commentaire. + + f f e e d d c2 +%@} +@end example + +@c TODO post-2.6 reorg +@c This is good info, but I wouldn't call it a comment. IMO it should +@c be moved somewhere else. + +@cindex versioning + +Il y a une déclaration particulière qui est une sorte de commentaire. La +déclaration @code{\version} stipule le numéro de la version de LilyPond +pour laquelle le fichier a été écrit. Pour donner à un fichier la version +2.10.0, utilisez + +@example +\version "2.10.0" +@end example + +@noindent +Cette annotation permet de faciliter les prochaines mises à jour de +LilyPond. Les changements dans la syntaxe sont gérés avec un +programme spécial, @file{convert-ly} -- voir +@ref{Updating files with convert-ly} -- et il utilise @code{\version} +pour déterminer les règles de conversion à appliquer au fichier. + + +@node Printing lyrics +@section Printing lyrics +@cindex lyrics + +@c TODO: (c) status of the Queen fragment. + +@cindex Lyrics +@cindex Songs +Les paroles sont entrées en séparant chaque syllable par un espace : + +@example +I want to break free +@end example + +Voyons la mélodie + +@lilypond[quote,verbatim,fragment,ragged-right] +\relative { + r4 c \times 2/3 { f g g } + \times 2/3 { g4( a2) } +} +@end lilypond + +Les paroles peuvent être associées à ces notes en les combinant avec le +mot-clé @code{\addlyrics} + +@lilypond[quote,verbatim,fragment,ragged-right] +<< + \relative { + r4 c \times 2/3 { f g g } + \times 2/3 { g4( a2) } + } + \addlyrics { I want to break free } +>> +@end lilypond + +@cindex melisma +@cindex extender line +@c synonyms? +Cette mélodie se termine sur un mélisme (@rglos{melisma}), +c'est-à-dire qu'une seule syllable (« free ») correspond à plus d'une +note. Ceci est indiqué avec une @emph{ligne d'extension}. Elle est +entrée avec deux caractères souligné (@code{_}), c'est-à-dire + +@example +@{ I want to break free __ @} +@end example + +@lilypond[fragment,quote,ragged-right] +<< + \relative { + r4 c \times 2/3 { f g g } + \times 2/3 { g4( a2) } + } + \addlyrics { I want to break free __ } +>> +@end lilypond + +De la même manière, les séparations syllabiques d'un mot peuvent être entrées +avec deux tirets (@code{-}), ce qui produit un tiret centré entre les deux +syllabes : + +@example +A -- le gri -- a +@end example + +@c no ragged-right here, because otherwise the hypens get lost. +@lilypond[fragment,quote] +<< + \relative { + \time 2/4 + f4 f c' c + } + \addlyrics { A -- le gri -- a } +>> +@end lilypond + +Plus de possibilités, comme celle d'ajouter plusieurs lignes de +paroles en dessous d'une même mélodie sont exposées à +@ref{Vocal music}. + + +@node A lead sheet +@section A lead sheet + +@cindex Lead sheets +@cindex chords +@cindex chord names + +@c TODO: revise this, \chords { } is shorter and more intuitive. + +Dans la musique de variété, il est courant d'indiquer l'accompagnement +par le nom des accords. De tels accords peuvent être entrés comme les +notes : + +@lilypond[quote,verbatim,ragged-right] +\chordmode { c2 f4. g8 } +@end lilypond + +@noindent +Maintenant, chaque hauteur est lue comme la base de l'accord à la +place de la note. Ce mode est activé avec @code{\chordmode}. + +Les autres accords peuvent être créés en ajoutant des modifiacteurs après +deux points. L'exemple suivant montre quelques modificateurs usuels : + +@lilypond[quote,verbatim,ragged-right] +\chordmode { c2 f4:m g4:maj7 gis1:dim7 } +@end lilypond + +Pour la musique improvisée, les accords ne sont pas imprimés sur des +portées mais comme des lignes à part entière. Ceci s'obtient en +utilisant @code{\chords} à la place de @code{\chordmode}. La même +syntaxe sera utilisée que dans le cas de@code{\chordmode}, mais le +rendu des notes interviendra dans un contexte de @code{ChordNames}, +avec le résultat suivant + +@lilypond[quote,verbatim,ragged-right] +\chords { c2 f4.:m g4.:maj7 gis8:dim7 } +@end lilypond + +@cindex lead sheet +Une fois assemblés, les accords, paroles et mélodie forment une +partition de chanson : + +@example +<< + \chords @{ @emph{les accords} @} + @emph{la mélodie} + \addlyrics @{ @emph{le texte} @} +>> +@} +@end example + +@lilypond[quote,ragged-right] +<< + \chords { r2 c:sus4 f } + \relative { + r4 c' \times 2/3 { f g g } + \times 2/3 { g4( a2) } + } + \addlyrics { I want to break free __ } +>> +@end lilypond + +Une liste complète de modificateurs et d'autres options de +mise en forme se trouve à la section @ref{Chords}. + + +@node Adding titles +@section Adding titles + +Les informations bibliographiques sont entrées dans un bloc séparé, le +bloc d'en-tête (@code{\header}). Le nom du morceau, son compositeur, etc., sont +définis dans @code{\header@{@tie{}@dots{}@tie{}@}}. +Le bloc @code{\header} est habituellement placé en début de fichier. +Par exemple, + +@example +\header @{ + title = "Miniature" + composer = "Igor Stravinsky" +@} + +@{ @dots{} @} +@end example + + +Quand le fichier est traité, le titre et le compositeur sont imprimés +en haut de la partition. Vous trouverez plus d'informations sur les +titres à @ref{Creating titles}. + + +@node Single staff polyphony +@section Single staff polyphony + +@cindex polyphony +@cindex multiple voices +@cindex voices, more -- on a staff +Quand différentes lignes mélodiques sont combinées sur une seule et +même portée, elle sont imprimées comme des voix polyphoniques ; chaque +voix a ses propre hampes@footnote{familièrement appelées queues de +note.}, liaisons et ligatures, la voix supérieure ayant les hampes +vers le haut, la voix inférieure vers le bas. + +Ce type de partition est réalisé en entrant chaque voix comme +une séquence (avec @code{@{...@}}), en combinant simultanément les +voix et en les séparant par @code{\\} : + +@lilypond[quote,verbatim,relative=2,fragment] +<< { a4 g2 f4~ f4 } \\ + { r4 g4 f2 f4 } >> +@end lilypond + +Pour l'écriture de musique polyphonique, les silences invisibles +(spacer rests) s'avèrent bien pratiques ; ce sont des silences qui ne +s'impriment pas. Ils sont utiles pour remplir des voix qui, +temporairement, ne jouent rien. On peut voir ici le même exemple avec +un silence espace invisible (@code{s}) à la place d'un silence normal +(@code{r}) : + +@lilypond[quote,verbatim,relative=2,fragment] +<< { a4 g2 f4~ f4 } \\ + { s4 g4 f2 f4 } >> +@end lilypond + +@noindent +Encore une fois, ces expressions peuvent s'imbriquer arbitrairement : + +@lilypond[quote,fragment,verbatim,relative=2,fragment] +<< + \new Staff << + { a4 g2 f4~ f4 } \\ + { s4 g4 f2 f4 } + >> + \new Staff << + \clef bass + { 1 ~ 4 } \\ + { e,,4 d e2 ~ e4} + >> +>> +@end lilypond + +Plus de fonctionnalités sur l'écriture polyphonique sont décrites à la +section @ref{Basic polyphony} du manuel. + + +@node Piano staves +@section Piano staves + +@cindex staff switch, manual +@cindex cross staff voice, manual +La musique pour piano s'écrit avec deux portées reliées par une +accolade. Imprimer ce type de portée revient au même que dans l'exemple de +musique polyphonique (@ref{More staves}), + +@example +<< \new Staff @{ @dots{} @} + \new Staff @{ @dots{} @} >> +@end example + +@noindent +mais maintenant cette expression entière doit être interprétée dans un +contexte @code{PianoStaff} + +@example +\new PianoStaff << \new Staff @dots{} >> +@end example + +Voici un petit exemple : + +@lilypond[quote,verbatim,relative=1,fragment] +\new PianoStaff << + \new Staff { \time 2/4 c4 c g' g } + \new Staff { \clef bass c,, c' e c } +>> +@end lilypond + +Plus d'informations sur le formatage de la musique pour piano sont +données à @ref{Piano music}. + + +@node Organizing larger pieces +@section Organizing larger pieces + +Lorsqu'on combine tous les éléments étudiés plus haut pour produire +des fichiers plus volumineux, les blocs @code{\score} deviennent +beaucoup plus gros parce que les expressions musicales sont plus +longues et, dans le cas des pièces polyphoniques, profondément +imbriquées. De telles expressions imposantes finissent par devenir peu +maniables. + +En utilisant des variables, appelées également identificateurs, il est +possible de découper des expressions musicales complexes. Un identificateur +se définit comme + +@example +MusiqueToto = @{ @dots{} @} +@end example + +@noindent +Le contenu de l'expression musicale @code{MusiqueToto}, peut être +utilisé plus loin en faisant précéder son nom d'un anti-slash, c'est-à-dire +@code{\MusiqueToto}. Dans l'exemple suivant, un motif de deux notes est +répété deux fois en utilisant la substitution par une variable : + +@lilypond[quote,ragged-right,verbatim,nofragment] +seufzer = { + e'4( dis'4) +} +{ \seufzer \seufzer } +@end lilypond + +Le nom d'un identificateur ne doit comporter que des caractères +alphabétiques non accentués, aucun nombre ni tiret. On doit le définir +en dehors de toute expression musicale. + +Il est possible d'utiliser des variables de types variés. +Par exemple, + +@example +largeur = 4.5\cm +nom = "Wendy" +papierACinq = \paper @{ paperheight = 21.0 \cm @} +@end example + +En fonction de son contenu, l'identificateur peut être utilisé à différents +endroits. L'exemple suivant utilise la variable précédente : + +@example +\paper @{ + \papierACinq + line-width = \largeur +@} +@{ c4^\nom @} +@end example + +Vous trouverez plus d'informations sur les usages possibles des +identificateurs dans le manuel technique, section +@ref{Input variables and Scheme}. +@c fixme: the ref is too technical. + + +@node An orchestral part +@section An orchestral part + +Pour la musique d'orchestre, toute la musique est imprimée deux fois. +Une partie séparée pour chaque pupitre, et un conducteur pour le chef. +Recourir à des identifiants permet de s'épargner un double travail. La +musique est entrée une seule fois, et enregistrée dans une variable. Le +contenu de ces variables sera utilisé pour générer à la fois la +partie d'instrument et le conducteur. + +Définir les notes dans un fichier à part est très pratique. Par +exemple, supposons que le fichier @file{musique-cor.ly} contienne la +partie d'un duo cor/@/basson : + +@example +notesCor = \relative c @{ + \time 2/4 + r4 f8 a cis4 f e d +@} +@end example + +@noindent +Puis, une partie individuelle est créée en mettant ce qui suit dans +un fichier + +@example +\include "musique-cor.ly" +\header @{ + instrument = "Cor en fa" +@} + +@{ + \transpose f c' \notesCor +@} +@end example + +La ligne + +@example +\include "musique-cor.ly" +@end example + +@noindent +indique à LilyPond de lire le contenu de @file{musique-cor.ly} à cet +endroit dans le fichier, ainsi @code{notesCor} est défini pour ce qui +suivra. La commande @code{\transpose f@tie{}c'} indique que +l'argument, en l'occurence @code{\notesCor}, doit être transposé d'une +quinte ascendante. Le son entendu @samp{fa} correspond à la note écrite +@code{do'}, ce qui correspond bien à la transpostion d'un cor en +fa. La transposition peut être constatée dans la sortie suivante : + +@lilypond[quote,ragged-right] +\transpose f c' \relative c { + \time 2/4 + r4 f8 a cis4 f e d +} +@end lilypond + +Dans la musique d'ensemble, il arrive souvent qu'une des voix ne joue +pas pendant plusieurs mesures. Ceci est spécifié par un silence +spécial, le silence multi-mesures (mesures à compter). Il est saisi +par une lettre capitale @samp{R} suivie d'une durée (@code{1}@tie{}pour une +ronde, @code{2}@tie{}pour une blanche, etc.). En multipliant la durée, on +peut construire des silences plus longs. Par exemple, ce silence dure +3@tie{}mesures à 2/4 + +@example +R2*3 +@end example + +Pour l'impression de parties séparées, ces silences multi-mesures doivent être +condensés. On peut l'obtenir en réglant une variable d'exécution + +@example +\set Score.skipBars = ##t +@end example + +@noindent +Cette commande règle la propriété @code{skipBars} dans le contexte +@code{Score} à vrai (@code{##t}). En faisant précéder la musique plus haut +du silence et de cette option, on obtient + +@lilypond[quote,ragged-right] +\transpose f c' \relative c { + \time 2/4 + \set Score.skipBars = ##t + R2*3 + r4 f8 a cis4 f e d +} +@end lilypond + + +On crée le conducteur en combinant toutes les parties. En +supposant que l'autre voix soit dans l'expression @code{notesBasson} du fichier +@file{musique-basson.ly}, le conducteur est composé des commandes + +@example +\include "musique-cor.ly" +\include "musique-basson.ly" + +<< + \new Staff \notesCor + \new Staff \notesBasson +>> +@end example + +@noindent +donnant pour résultat + +@lilypond[quote,ragged-right] +\relative c << + \new Staff { + \time 2/4 R2*3 + r4 f8 a cis4 f e d + } + \new Staff { + \clef bass + r4 d,8 f | gis4 c | b bes | + a8 e f4 | g d | gis f + } +>> +@end lilypond + +De plus amples informations sur la gestion des parties et conducteurs +se trouvent dans le manuel de notation, section @ref{Orchestral music}. + +Le réglage des variables d'exécution (« propriétés ») est abordé dans +@ref{Changing context properties on the fly}. + + +@node After the tutorial +@section After the tutorial + +Après avoir parcouru ce tutoriel, vous devriez vous essayer à écrire +un morceau ou deux. Commencez par copier l'un des modèles types (@ref{Example +templates}) et ajoutez-y des notes. Si vous voulez employer une notation que +vous n'avez pas trouvé dans le tutoriel, consultez la référence de +notation, en commençant par la @ref{Basic notation}. Si vous désirez écrire pour un +ensemble instrumental non couvert par les @ref{Example templates}, +lisez la section @ref{Extending the templates}. + +Après avoir écrit quelques pièces courtes, lisez les chapitres 3 à 5 +du manuel d'apprentissage. Rien ne s'oppose à ce que vous consultiez dès à +présent les autres chapitres, bien sûr ! Néanmoins, le reste du manuel +de l'utilisateur part du principe que vous avez déjà bien assimilé la +syntaxe de LilyPond. Vous pouvez toujours survoler le reste du manuel, +et y revenir plus tard après avoir acquis de l'expérience. + diff --git a/Documentation/fr/user/tweaks.itely b/Documentation/fr/user/tweaks.itely new file mode 100644 index 0000000000..ca79cdefce --- /dev/null +++ b/Documentation/fr/user/tweaks.itely @@ -0,0 +1,43 @@ +@node Tweaking output +@chapter Tweaking output + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Moving objects:: +* Fixing overlapping notation:: +* Common tweaks:: +* Default files:: +* Fitting music onto fewer pages:: +* Advanced tweaks with Scheme:: +@end menu +@node Moving objects +@section Moving objects + +UNTRANSLATED NODE: IGNORE ME + +@node Fixing overlapping notation +@section Fixing overlapping notation + +UNTRANSLATED NODE: IGNORE ME + +@node Common tweaks +@section Common tweaks + +UNTRANSLATED NODE: IGNORE ME + +@node Default files +@section Default files + +UNTRANSLATED NODE: IGNORE ME + +@node Fitting music onto fewer pages +@section Fitting music onto fewer pages + +UNTRANSLATED NODE: IGNORE ME + +@node Advanced tweaks with Scheme +@section Advanced tweaks with Scheme + +UNTRANSLATED NODE: IGNORE ME + diff --git a/Documentation/fr/user/working.itely b/Documentation/fr/user/working.itely new file mode 100644 index 0000000000..a05a3bc433 --- /dev/null +++ b/Documentation/fr/user/working.itely @@ -0,0 +1,57 @@ +@node Working on LilyPond projects +@chapter Working on LilyPond projects + +UNTRANSLATED NODE: IGNORE ME + +@menu +* Suggestions for writing LilyPond files:: +* Saving typing with identifiers and functions:: +* Style sheets:: +* Updating old files:: +* Troubleshooting (taking it all apart):: +@end menu +@node Suggestions for writing LilyPond files +@section Suggestions for writing LilyPond files + +UNTRANSLATED NODE: IGNORE ME + +@menu +* General suggestions:: +* Typesetting existing music:: +* Large projects:: +@end menu +@node General suggestions +@subsection General suggestions + +UNTRANSLATED NODE: IGNORE ME + +@node Typesetting existing music +@subsection Typesetting existing music + +UNTRANSLATED NODE: IGNORE ME + +@node Large projects +@subsection Large projects + +UNTRANSLATED NODE: IGNORE ME + +@node Saving typing with identifiers and functions +@section Saving typing with identifiers and functions + +UNTRANSLATED NODE: IGNORE ME + +@node Style sheets +@section Style sheets + +UNTRANSLATED NODE: IGNORE ME + +@node Updating old files +@section Updating old files + +UNTRANSLATED NODE: IGNORE ME + +@node Troubleshooting (taking it all apart) +@section Troubleshooting (taking it all apart) + +UNTRANSLATED NODE: IGNORE ME + diff --git a/Documentation/po/GNUmakefile b/Documentation/po/GNUmakefile new file mode 100644 index 0000000000..23939296d0 --- /dev/null +++ b/Documentation/po/GNUmakefile @@ -0,0 +1,21 @@ +depth = ../.. + +STEPMAKE_TEMPLATES=podir + +include $(depth)/make/stepmake.make + +doc-localedir=$(outdir) +DOMAIN=lilypond-doc + +messages: $(MO_FILES) + for i in $(CATALOGS); do \ + mkdir -p $(doc-localedir)/$$i/LC_MESSAGES; \ + cp $(outdir)/$$i.mo $(doc-localedir)/$$i/LC_MESSAGES/$(DOMAIN).mo; \ + done + +po-update: + $(PYTHON) $(depth)/buildscripts/texi-langutils.py -d $(outdir) -o doc.pot --gettext ../$(depth)/Documentation/user/lilypond.tely + msgmerge -U lilypond-doc.pot $(outdir)/doc.pot + for i in $(CATALOGS); do \ + msgmerge -U $$i.po lilypond-doc.pot; \ + done diff --git a/Documentation/po/fr.po b/Documentation/po/fr.po new file mode 100644 index 0000000000..990cb2a490 --- /dev/null +++ b/Documentation/po/fr.po @@ -0,0 +1,1186 @@ +# translation of fr.po to Français +# translation of LilyPond documentation +# Copyright (C) 2006 Han-Wen Nienhuys, Jan Nieuwenhuizen +# This file is distributed under the same license as the lilypond package. +# +# John Mandereau , 2006. +msgid "" +msgstr "" +"Project-Id-Version: fr\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2006-11-19 10:23+0100\n" +"PO-Revision-Date: 2006-11-25 16:47+0100\n" +"Last-Translator: John Mandereau \n" +"Language-Team: Français \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" + +msgid "Top" +msgstr "Sommaire" + +msgid "GNU LilyPond --- The music typesetter" +msgstr "GNU LilyPond -- le système de gravure musicale" + +msgid "LilyPond command index" +msgstr "Index des commandes LilyPond" + +msgid "LilyPond index" +msgstr "Index de LilyPond" + +msgid "Bugs" +msgstr "Bogues" + +msgid "See also" +msgstr "Voir aussi" + +msgid "Predefined commands" +msgstr "Commandes prédéfinies" + +msgid "Commonly tweaked properties" +msgstr "Propriétés couramment ajustées" + +msgid "Preface" +msgstr "Préface" + +msgid "Introduction" +msgstr "Introduction" + +msgid "Engraving" +msgstr "Gravure" + +msgid "Automated engraving" +msgstr "Gravure automatisée" + +msgid "What symbols to engrave?" +msgstr "Quels signes graver ?" + +msgid "Music representation" +msgstr "Représentation de la musique" + +msgid "Example applications" +msgstr "Exemples d'applications" + +msgid "About this manual" +msgstr "À propos de ce manuel" + +msgid "Tutorial" +msgstr "Tutoriel" + +msgid "First steps" +msgstr "Premiers pas" + +msgid "Running LilyPond for the first time" +msgstr "Lancer LilyPond pour la première fois" + +msgid "MacOS X" +msgstr "MacOS X" + +msgid "Windows" +msgstr "Windows" + +msgid "Unix" +msgstr "Unix" + +msgid "More about pitches" +msgstr "Les hauteurs en détail" + +msgid "Entering ties" +msgstr "Liaisons de durée" + +msgid "Automatic and manual beams" +msgstr "Barres de ligature automatiques et manuelles" + +msgid "Octave entry" +msgstr "Saisie des octaves" + +msgid "Music expressions explained" +msgstr "Les expressions musicales en clair" + +msgid "More staves" +msgstr "Plus de portées" + +msgid "Adding articulation marks to notes" +msgstr "Ajout de signes d'articulation" + +msgid "Combining notes into chords" +msgstr "Combinaison de notes en accords" + +msgid "Advanced rhythmic commands" +msgstr "Commandes rythmiques avancées" + +msgid "Commenting input files" +msgstr "Commenter un fichier source" + +msgid "Printing lyrics" +msgstr "Imprimer des paroles" + +msgid "A lead sheet" +msgstr "Partition d'une chanson" + +msgid "Adding titles" +msgstr "Ajout de titres" + +msgid "Single staff polyphony" +msgstr "Polyphonie sur une portée" + +msgid "Piano staves" +msgstr "Double portée" + +msgid "Organizing larger pieces" +msgstr "Comment organiser de plus grandes pièces" + +msgid "An orchestral part" +msgstr "Partitions d'orchestre" + +msgid "After the tutorial" +msgstr "Après le tutoriel" + +msgid "Putting it all together" +msgstr "" + +msgid "Extending the templates" +msgstr "" + +msgid "How LilyPond files work" +msgstr "" + +msgid "Score is a single musical expression" +msgstr "" + +msgid "Working on LilyPond projects" +msgstr "" + +msgid "Suggestions for writing LilyPond files" +msgstr "" + +msgid "General suggestions" +msgstr "" + +msgid "Typesetting existing music" +msgstr "" + +msgid "Large projects" +msgstr "" + +msgid "Saving typing with identifiers and functions" +msgstr "" + +msgid "Style sheets" +msgstr "" + +msgid "Updating old files" +msgstr "" + +msgid "Troubleshooting (taking it all apart)" +msgstr "" + +msgid "Tweaking output" +msgstr "" + +msgid "Moving objects" +msgstr "" + +msgid "Fixing overlapping notation" +msgstr "" + +msgid "Common tweaks" +msgstr "" + +msgid "Default files" +msgstr "" + +msgid "Fitting music onto fewer pages" +msgstr "" + +msgid "Advanced tweaks with Scheme" +msgstr "" + +msgid "Basic notation" +msgstr "" + +msgid "Pitches" +msgstr "" + +msgid "Normal pitches" +msgstr "" + +msgid "Accidentals" +msgstr "" + +msgid "Cautionary accidentals" +msgstr "" + +msgid "Micro tones" +msgstr "" + +msgid "Notes names in other languages" +msgstr "" + +msgid "Relative octaves" +msgstr "" + +msgid "Octave check" +msgstr "" + +msgid "Transpose" +msgstr "" + +msgid "Rests" +msgstr "" + +msgid "Skips" +msgstr "" + +msgid "Rhythms" +msgstr "" + +msgid "Durations" +msgstr "" + +msgid "Augmentation dots" +msgstr "" + +msgid "Tuplets" +msgstr "" + +msgid "Scaling durations" +msgstr "" + +msgid "Bar check" +msgstr "" + +msgid "Barnumber check" +msgstr "" + +msgid "Automatic note splitting" +msgstr "" + +msgid "Multiple notes at once" +msgstr "" + +msgid "Chords" +msgstr "" + +msgid "Stems" +msgstr "" + +msgid "Basic polyphony" +msgstr "" + +msgid "Explicitly instantiating voices" +msgstr "" + +msgid "Collision Resolution" +msgstr "" + +msgid "Staff notation" +msgstr "" + +msgid "Clef" +msgstr "" + +msgid "Key signature" +msgstr "" + +msgid "Time signature" +msgstr "" + +msgid "Partial measures" +msgstr "" + +msgid "Bar lines" +msgstr "" + +msgid "Unmetered music" +msgstr "" + +msgid "System start delimiters" +msgstr "" + +msgid "Staff symbol" +msgstr "" + +msgid "Writing music in parallel" +msgstr "" + +msgid "Connecting notes" +msgstr "" + +msgid "Ties" +msgstr "" + +msgid "Slurs" +msgstr "" + +msgid "Phrasing slurs" +msgstr "" + +msgid "Laissez vibrer ties" +msgstr "" + +msgid "Automatic beams" +msgstr "" + +msgid "Manual beams" +msgstr "" + +msgid "Grace notes" +msgstr "" + +msgid "Expressive marks" +msgstr "" + +msgid "Articulations" +msgstr "" + +msgid "Fingering instructions" +msgstr "" + +msgid "Dynamics" +msgstr "" + +msgid "Breath marks" +msgstr "" + +msgid "Trills" +msgstr "" + +msgid "Glissando" +msgstr "" + +msgid "Arpeggio" +msgstr "" + +msgid "Falls and doits" +msgstr "" + +msgid "Repeats" +msgstr "" + +msgid "Repeat types" +msgstr "" + +msgid "Repeat syntax" +msgstr "" + +msgid "Repeats and MIDI" +msgstr "" + +msgid "Manual repeat commands" +msgstr "" + +msgid "Tremolo repeats" +msgstr "" + +msgid "Tremolo subdivisions" +msgstr "" + +msgid "Measure repeats" +msgstr "" + +msgid "Instrument-specific notation" +msgstr "" + +msgid "Piano music" +msgstr "" + +msgid "Automatic staff changes" +msgstr "" + +msgid "Manual staff switches" +msgstr "" + +msgid "Pedals" +msgstr "" + +msgid "Staff switch lines" +msgstr "" + +msgid "Cross staff stems" +msgstr "" + +msgid "Chord names" +msgstr "" + +msgid "Introducing chord names" +msgstr "" + +msgid "Chords mode" +msgstr "" + +msgid "Printing chord names" +msgstr "" + +msgid "Vocal music" +msgstr "" + +msgid "Setting simple songs" +msgstr "" + +msgid "Entering lyrics" +msgstr "" + +msgid "Hyphens and extenders" +msgstr "" + +msgid "The Lyrics context" +msgstr "" + +msgid "Melismata" +msgstr "" + +msgid "Another way of entering lyrics" +msgstr "" + +msgid "Flexibility in placement" +msgstr "" + +msgid "Lyrics to multiple notes of a melisma" +msgstr "" + +msgid "Divisi lyrics" +msgstr "" + +msgid "Switching the melody associated with a lyrics line" +msgstr "" + +msgid "Specifying melismata within the lyrics" +msgstr "" + +msgid "Lyrics independent of notes" +msgstr "" + +msgid "Spacing lyrics" +msgstr "" + +msgid "More about stanzas" +msgstr "" + +msgid "Ambitus" +msgstr "" + +msgid "Other vocal issues" +msgstr "" + +msgid "Rhythmic music" +msgstr "" + +msgid "Showing melody rhythms" +msgstr "" + +msgid "Entering percussion" +msgstr "" + +msgid "Percussion staves" +msgstr "" + +msgid "Ghost notes" +msgstr "" + +msgid "Guitar" +msgstr "" + +msgid "String number indications" +msgstr "" + +msgid "Tablatures basic" +msgstr "" + +msgid "Non-guitar tablatures" +msgstr "" + +msgid "Banjo tablatures" +msgstr "" + +msgid "Fret diagrams" +msgstr "" + +msgid "Right hand fingerings" +msgstr "" + +msgid "Other guitar issues" +msgstr "" + +msgid "Bagpipe" +msgstr "" + +msgid "Bagpipe definitions" +msgstr "" + +msgid "Bagpipe example" +msgstr "" + +msgid "Ancient notation" +msgstr "" + +msgid "Ancient note heads" +msgstr "" + +msgid "Ancient accidentals" +msgstr "" + +msgid "Ancient rests" +msgstr "" + +msgid "Ancient clefs" +msgstr "" + +msgid "Ancient flags" +msgstr "" + +msgid "Ancient time signatures" +msgstr "" + +msgid "Ancient articulations" +msgstr "" + +msgid "Custodes" +msgstr "" + +msgid "Divisiones" +msgstr "" + +msgid "Ligatures" +msgstr "" + +msgid "White mensural ligatures" +msgstr "" + +msgid "Gregorian square neumes ligatures" +msgstr "" + +msgid "Gregorian Chant contexts" +msgstr "" + +msgid "Mensural contexts" +msgstr "" + +msgid "Musica ficta accidentals" +msgstr "" + +msgid "Figured bass" +msgstr "" + +msgid "Other instrument specific notation" +msgstr "" + +msgid "Artificial harmonics (strings)" +msgstr "" + +msgid "Advanced notation" +msgstr "" + +msgid "Text" +msgstr "" + +msgid "Text scripts" +msgstr "" + +msgid "Text spanners" +msgstr "" + +msgid "Text marks" +msgstr "" + +msgid "Text markup" +msgstr "" + +msgid "Nested scores" +msgstr "" + +msgid "Overview of text markup commands" +msgstr "" + +msgid "Font selection" +msgstr "" + +msgid "New dynamic marks" +msgstr "" + +msgid "Preparing parts" +msgstr "" + +msgid "Multi measure rests" +msgstr "" + +msgid "Metronome marks" +msgstr "" + +msgid "Rehearsal marks" +msgstr "" + +msgid "Bar numbers" +msgstr "" + +msgid "Instrument names" +msgstr "" + +msgid "Instrument transpositions" +msgstr "" + +msgid "Ottava brackets" +msgstr "" + +msgid "Different editions from one source" +msgstr "" + +msgid "Orchestral music" +msgstr "" + +msgid "Automatic part combining" +msgstr "" + +msgid "Hiding staves" +msgstr "" + +msgid "Quoting other voices" +msgstr "" + +msgid "Formatting cue notes" +msgstr "" + +msgid "Aligning to cadenzas" +msgstr "" + +msgid "Contemporary notation" +msgstr "" + +msgid "Polymetric notation" +msgstr "" + +msgid "Time administration" +msgstr "" + +msgid "Proportional notation" +msgstr "" + +msgid "Clusters" +msgstr "" + +msgid "Special noteheads" +msgstr "" + +msgid "Feathered beams" +msgstr "" + +msgid "Improvisation" +msgstr "" + +msgid "Selecting notation font size" +msgstr "" + +msgid "Educational use" +msgstr "" + +msgid "Balloon help" +msgstr "" + +msgid "Blank music sheet" +msgstr "" + +msgid "Hidden notes" +msgstr "" + +msgid "Shape note heads" +msgstr "" + +msgid "Easy Notation note heads" +msgstr "" + +msgid "Analysis brackets" +msgstr "" + +msgid "Coloring objects" +msgstr "" + +msgid "Parentheses" +msgstr "" + +msgid "Changing defaults" +msgstr "" + +msgid "Automatic notation" +msgstr "" + +msgid "Automatic accidentals" +msgstr "" + +msgid "Setting automatic beam behavior" +msgstr "" + +msgid "Interpretation contexts" +msgstr "" + +msgid "Contexts explained" +msgstr "" + +msgid "Creating contexts" +msgstr "" + +msgid "Changing context properties on the fly" +msgstr "" + +msgid "Modifying context plug-ins" +msgstr "" + +msgid "Layout tunings within contexts" +msgstr "" + +msgid "Changing context default settings" +msgstr "" + +msgid "Defining new contexts" +msgstr "" + +msgid "The \\override command" +msgstr "" + +msgid "Constructing a tweak" +msgstr "" + +msgid "Navigating the program reference" +msgstr "" + +msgid "Layout interfaces" +msgstr "" + +msgid "Determining the grob property" +msgstr "" + +msgid "Objects connected to the input" +msgstr "" + +msgid "\\set vs. \\override" +msgstr "" + +msgid "Difficult tweaks" +msgstr "" + +msgid "Non-musical notation" +msgstr "" + +msgid "Input files" +msgstr "" + +msgid "File structure (introduction)" +msgstr "" + +msgid "Multiple scores in a book" +msgstr "" + +msgid "Extracting fragments of notation" +msgstr "" + +msgid "File structure" +msgstr "" + +msgid "A single music expression" +msgstr "" + +msgid "Including LilyPond files" +msgstr "" + +msgid "Text encoding" +msgstr "" + +msgid "Titles and headers" +msgstr "" + +msgid "Creating titles" +msgstr "" + +msgid "Custom titles" +msgstr "" + +msgid "MIDI output" +msgstr "" + +msgid "Creating MIDI files" +msgstr "" + +msgid "MIDI block" +msgstr "" + +msgid "MIDI instrument names" +msgstr "" + +msgid "Displaying LilyPond notation" +msgstr "" + +msgid "Skipping corrected music" +msgstr "" + +msgid "Spacing issues" +msgstr "" + +msgid "Paper and pages" +msgstr "" + +msgid "Paper size" +msgstr "" + +msgid "Page formatting" +msgstr "" + +msgid "Music layout" +msgstr "" + +msgid "Setting global staff size" +msgstr "" + +msgid "Score layout" +msgstr "" + +msgid "Vertical spacing" +msgstr "" + +msgid "Vertical spacing inside a system" +msgstr "" + +msgid "Vertical spacing of piano staves" +msgstr "" + +msgid "Vertical spacing between systems" +msgstr "" + +msgid "Controlling spacing of individual systems" +msgstr "" + +msgid "Two-pass vertical spacing" +msgstr "" + +msgid "Horizontal spacing" +msgstr "" + +msgid "Horizontal Spacing" +msgstr "" + +msgid "Horizontal spacing overview" +msgstr "" + +msgid "New spacing area" +msgstr "" + +msgid "Changing horizontal spacing" +msgstr "" + +msgid "Line length" +msgstr "" + +msgid "Breaks" +msgstr "" + +msgid "Line breaking" +msgstr "" + +msgid "Page breaking" +msgstr "" + +msgid "Optimal page breaking" +msgstr "" + +msgid "Optimal page turning" +msgstr "" + +msgid "Displaying spacing" +msgstr "" + +msgid "Interfaces for programmers" +msgstr "" + +msgid "Music functions" +msgstr "" + +msgid "Overview of music functions" +msgstr "" + +msgid "Simple substitution functions" +msgstr "" + +msgid "Paired substitution functions" +msgstr "" + +msgid "Mathematics in functions" +msgstr "" + +msgid "Void functions" +msgstr "" + +msgid "Programmer interfaces" +msgstr "" + +msgid "Input variables and Scheme" +msgstr "" + +msgid "Internal music representation" +msgstr "" + +msgid "Building complicated functions" +msgstr "" + +msgid "Displaying music expressions" +msgstr "" + +msgid "Music properties" +msgstr "" + +msgid "Doubling a note with slurs (example)" +msgstr "" + +msgid "Adding articulation to notes (example)" +msgstr "" + +msgid "Markup programmer interface" +msgstr "" + +msgid "Markup construction in Scheme" +msgstr "" + +msgid "How markups work internally" +msgstr "" + +msgid "New markup command definition" +msgstr "" + +msgid "Contexts for programmers" +msgstr "" + +msgid "Context evaluation" +msgstr "" + +msgid "Running a function on all layout objects" +msgstr "" + +msgid "Scheme procedures as properties" +msgstr "" + +msgid "Running LilyPond" +msgstr "" + +msgid "Invoking lilypond" +msgstr "" + +msgid "Command line options" +msgstr "" + +msgid "Environment variables" +msgstr "" + +msgid "Notes for the MacOS X app" +msgstr "" + +msgid "Updating files with convert-ly" +msgstr "" + +msgid "Updating with" +msgstr "" + +msgid "Reporting bugs" +msgstr "" + +msgid "Error messages" +msgstr "" + +msgid "Editor support" +msgstr "" + +msgid "Point and click" +msgstr "" + +msgid "LilyPond-book" +msgstr "" + +msgid "An example of a musicological document" +msgstr "" + +msgid "Integrating LaTeX and music" +msgstr "" + +msgid "Integrating La" +msgstr "" + +msgid "Integrating Texinfo and music" +msgstr "" + +msgid "Integrating HTML and music" +msgstr "" + +msgid "Integrating DocBook and music" +msgstr "" + +msgid "Common conventions" +msgstr "" + +msgid "Including a LilyPond file" +msgstr "" + +msgid "Including LilyPond code" +msgstr "" + +msgid "Processing the DocBook document" +msgstr "" + +msgid "Music fragment options" +msgstr "" + +msgid "Invoking lilypond-book" +msgstr "" + +msgid "Invoking" +msgstr "" + +msgid "Filename extensions" +msgstr "" + +msgid "Many quotes of a large score" +msgstr "" + +msgid "Inserting LilyPond output into other programs" +msgstr "" + +msgid "Converting from other formats" +msgstr "" + +msgid "Invoking midi2ly" +msgstr "" + +msgid "Invoking etf2ly" +msgstr "" + +msgid "Invoking musicxml2ly" +msgstr "" + +msgid "Invoking abc2ly" +msgstr "" + +msgid "Generating LilyPond files" +msgstr "" + +msgid "Literature list" +msgstr "" + +msgid "Scheme tutorial" +msgstr "" + +msgid "Notation manual tables" +msgstr "" + +msgid "Chord name chart" +msgstr "" + +msgid "MIDI instruments" +msgstr "" + +msgid "List of colors" +msgstr "" + +msgid "Normal colors" +msgstr "" + +msgid "X color names" +msgstr "" + +msgid "Color Names without a numerical suffix:" +msgstr "" + +msgid "Color names with a numerical suffix" +msgstr "" + +msgid "Grey Scale" +msgstr "" + +msgid "The Feta font" +msgstr "" + +msgid "Example templates" +msgstr "" + +msgid "Single staff" +msgstr "" + +msgid "Notes only" +msgstr "" + +msgid "Notes and lyrics" +msgstr "" + +msgid "Notes and chords" +msgstr "" + +msgid "Notes, lyrics, and chords." +msgstr "" + +msgid "Piano templates" +msgstr "" + +msgid "Solo piano" +msgstr "" + +msgid "Piano and melody with lyrics" +msgstr "" + +msgid "Piano centered lyrics" +msgstr "" + +msgid "Piano centered dynamics" +msgstr "" + +msgid "String quartet" +msgstr "" + +msgid "String quartet parts" +msgstr "" + +msgid "Vocal ensembles" +msgstr "" + +msgid "SATB vocal score" +msgstr "" + +msgid "SATB vocal score and automatic piano reduction" +msgstr "" + +msgid "Ancient notation templates" +msgstr "" + +msgid "Transcription of mensural music" +msgstr "" + +msgid "Gregorian transcription template" +msgstr "" + +msgid "Jazz combo" +msgstr "" + +msgid "Lilypond-book templates" +msgstr "" + +msgid "LaTeX" +msgstr "" + +msgid "Texinfo" +msgstr "" + +msgid "Cheat sheet" +msgstr "" + +msgid "GNU Free Documentation License" +msgstr "" + +msgid "ADDENDUM: How to use this License for your documents" +msgstr "" + +msgid "Up:" +msgstr "Haut :" + +msgid "Next:" +msgstr "Suivant :" + +msgid "Previous:" +msgstr "Précédent :" + +msgid "Appendix" +msgstr "Annexe" + diff --git a/Documentation/po/lilypond-doc.pot b/Documentation/po/lilypond-doc.pot new file mode 100644 index 0000000000..13cf8cefa2 --- /dev/null +++ b/Documentation/po/lilypond-doc.pot @@ -0,0 +1,1184 @@ +# translation of LilyPond documentation +# Copyright (C) 2006 Han-Wen Nienhuys, Jan Nieuwenhuizen +# This file is distributed under the same license as the lilypond package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2006-11-19 10:23+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +msgid "Top" +msgstr "" + +msgid "GNU LilyPond --- The music typesetter" +msgstr "" + +msgid "LilyPond command index" +msgstr "" + +msgid "LilyPond index" +msgstr "" + +msgid "Bugs" +msgstr "" + +msgid "See also" +msgstr "" + +msgid "Predefined commands" +msgstr "" + +msgid "Commonly tweaked properties" +msgstr "" + +msgid "Preface" +msgstr "" + +msgid "Introduction" +msgstr "" + +msgid "Engraving" +msgstr "" + +msgid "Automated engraving" +msgstr "" + +msgid "What symbols to engrave?" +msgstr "" + +msgid "Music representation" +msgstr "" + +msgid "Example applications" +msgstr "" + +msgid "About this manual" +msgstr "" + +msgid "Tutorial" +msgstr "" + +msgid "First steps" +msgstr "" + +msgid "Running LilyPond for the first time" +msgstr "" + +msgid "MacOS X" +msgstr "" + +msgid "Windows" +msgstr "" + +msgid "Unix" +msgstr "" + +msgid "More about pitches" +msgstr "" + +msgid "Entering ties" +msgstr "" + +msgid "Automatic and manual beams" +msgstr "" + +msgid "Octave entry" +msgstr "" + +msgid "Music expressions explained" +msgstr "" + +msgid "More staves" +msgstr "" + +msgid "Adding articulation marks to notes" +msgstr "" + +msgid "Combining notes into chords" +msgstr "" + +msgid "Advanced rhythmic commands" +msgstr "" + +msgid "Commenting input files" +msgstr "" + +msgid "Printing lyrics" +msgstr "" + +msgid "A lead sheet" +msgstr "" + +msgid "Adding titles" +msgstr "" + +msgid "Single staff polyphony" +msgstr "" + +msgid "Piano staves" +msgstr "" + +msgid "Organizing larger pieces" +msgstr "" + +msgid "An orchestral part" +msgstr "" + +msgid "After the tutorial" +msgstr "" + +msgid "Putting it all together" +msgstr "" + +msgid "Extending the templates" +msgstr "" + +msgid "How LilyPond files work" +msgstr "" + +msgid "Score is a single musical expression" +msgstr "" + +msgid "Working on LilyPond projects" +msgstr "" + +msgid "Suggestions for writing LilyPond files" +msgstr "" + +msgid "General suggestions" +msgstr "" + +msgid "Typesetting existing music" +msgstr "" + +msgid "Large projects" +msgstr "" + +msgid "Saving typing with identifiers and functions" +msgstr "" + +msgid "Style sheets" +msgstr "" + +msgid "Updating old files" +msgstr "" + +msgid "Troubleshooting (taking it all apart)" +msgstr "" + +msgid "Tweaking output" +msgstr "" + +msgid "Moving objects" +msgstr "" + +msgid "Fixing overlapping notation" +msgstr "" + +msgid "Common tweaks" +msgstr "" + +msgid "Default files" +msgstr "" + +msgid "Fitting music onto fewer pages" +msgstr "" + +msgid "Advanced tweaks with Scheme" +msgstr "" + +msgid "Basic notation" +msgstr "" + +msgid "Pitches" +msgstr "" + +msgid "Normal pitches" +msgstr "" + +msgid "Accidentals" +msgstr "" + +msgid "Cautionary accidentals" +msgstr "" + +msgid "Micro tones" +msgstr "" + +msgid "Notes names in other languages" +msgstr "" + +msgid "Relative octaves" +msgstr "" + +msgid "Octave check" +msgstr "" + +msgid "Transpose" +msgstr "" + +msgid "Rests" +msgstr "" + +msgid "Skips" +msgstr "" + +msgid "Rhythms" +msgstr "" + +msgid "Durations" +msgstr "" + +msgid "Augmentation dots" +msgstr "" + +msgid "Tuplets" +msgstr "" + +msgid "Scaling durations" +msgstr "" + +msgid "Bar check" +msgstr "" + +msgid "Barnumber check" +msgstr "" + +msgid "Automatic note splitting" +msgstr "" + +msgid "Multiple notes at once" +msgstr "" + +msgid "Chords" +msgstr "" + +msgid "Stems" +msgstr "" + +msgid "Basic polyphony" +msgstr "" + +msgid "Explicitly instantiating voices" +msgstr "" + +msgid "Collision Resolution" +msgstr "" + +msgid "Staff notation" +msgstr "" + +msgid "Clef" +msgstr "" + +msgid "Key signature" +msgstr "" + +msgid "Time signature" +msgstr "" + +msgid "Partial measures" +msgstr "" + +msgid "Bar lines" +msgstr "" + +msgid "Unmetered music" +msgstr "" + +msgid "System start delimiters" +msgstr "" + +msgid "Staff symbol" +msgstr "" + +msgid "Writing music in parallel" +msgstr "" + +msgid "Connecting notes" +msgstr "" + +msgid "Ties" +msgstr "" + +msgid "Slurs" +msgstr "" + +msgid "Phrasing slurs" +msgstr "" + +msgid "Laissez vibrer ties" +msgstr "" + +msgid "Automatic beams" +msgstr "" + +msgid "Manual beams" +msgstr "" + +msgid "Grace notes" +msgstr "" + +msgid "Expressive marks" +msgstr "" + +msgid "Articulations" +msgstr "" + +msgid "Fingering instructions" +msgstr "" + +msgid "Dynamics" +msgstr "" + +msgid "Breath marks" +msgstr "" + +msgid "Trills" +msgstr "" + +msgid "Glissando" +msgstr "" + +msgid "Arpeggio" +msgstr "" + +msgid "Falls and doits" +msgstr "" + +msgid "Repeats" +msgstr "" + +msgid "Repeat types" +msgstr "" + +msgid "Repeat syntax" +msgstr "" + +msgid "Repeats and MIDI" +msgstr "" + +msgid "Manual repeat commands" +msgstr "" + +msgid "Tremolo repeats" +msgstr "" + +msgid "Tremolo subdivisions" +msgstr "" + +msgid "Measure repeats" +msgstr "" + +msgid "Instrument-specific notation" +msgstr "" + +msgid "Piano music" +msgstr "" + +msgid "Automatic staff changes" +msgstr "" + +msgid "Manual staff switches" +msgstr "" + +msgid "Pedals" +msgstr "" + +msgid "Staff switch lines" +msgstr "" + +msgid "Cross staff stems" +msgstr "" + +msgid "Chord names" +msgstr "" + +msgid "Introducing chord names" +msgstr "" + +msgid "Chords mode" +msgstr "" + +msgid "Printing chord names" +msgstr "" + +msgid "Vocal music" +msgstr "" + +msgid "Setting simple songs" +msgstr "" + +msgid "Entering lyrics" +msgstr "" + +msgid "Hyphens and extenders" +msgstr "" + +msgid "The Lyrics context" +msgstr "" + +msgid "Melismata" +msgstr "" + +msgid "Another way of entering lyrics" +msgstr "" + +msgid "Flexibility in placement" +msgstr "" + +msgid "Lyrics to multiple notes of a melisma" +msgstr "" + +msgid "Divisi lyrics" +msgstr "" + +msgid "Switching the melody associated with a lyrics line" +msgstr "" + +msgid "Specifying melismata within the lyrics" +msgstr "" + +msgid "Lyrics independent of notes" +msgstr "" + +msgid "Spacing lyrics" +msgstr "" + +msgid "More about stanzas" +msgstr "" + +msgid "Ambitus" +msgstr "" + +msgid "Other vocal issues" +msgstr "" + +msgid "Rhythmic music" +msgstr "" + +msgid "Showing melody rhythms" +msgstr "" + +msgid "Entering percussion" +msgstr "" + +msgid "Percussion staves" +msgstr "" + +msgid "Ghost notes" +msgstr "" + +msgid "Guitar" +msgstr "" + +msgid "String number indications" +msgstr "" + +msgid "Tablatures basic" +msgstr "" + +msgid "Non-guitar tablatures" +msgstr "" + +msgid "Banjo tablatures" +msgstr "" + +msgid "Fret diagrams" +msgstr "" + +msgid "Right hand fingerings" +msgstr "" + +msgid "Other guitar issues" +msgstr "" + +msgid "Bagpipe" +msgstr "" + +msgid "Bagpipe definitions" +msgstr "" + +msgid "Bagpipe example" +msgstr "" + +msgid "Ancient notation" +msgstr "" + +msgid "Ancient note heads" +msgstr "" + +msgid "Ancient accidentals" +msgstr "" + +msgid "Ancient rests" +msgstr "" + +msgid "Ancient clefs" +msgstr "" + +msgid "Ancient flags" +msgstr "" + +msgid "Ancient time signatures" +msgstr "" + +msgid "Ancient articulations" +msgstr "" + +msgid "Custodes" +msgstr "" + +msgid "Divisiones" +msgstr "" + +msgid "Ligatures" +msgstr "" + +msgid "White mensural ligatures" +msgstr "" + +msgid "Gregorian square neumes ligatures" +msgstr "" + +msgid "Gregorian Chant contexts" +msgstr "" + +msgid "Mensural contexts" +msgstr "" + +msgid "Musica ficta accidentals" +msgstr "" + +msgid "Figured bass" +msgstr "" + +msgid "Other instrument specific notation" +msgstr "" + +msgid "Artificial harmonics (strings)" +msgstr "" + +msgid "Advanced notation" +msgstr "" + +msgid "Text" +msgstr "" + +msgid "Text scripts" +msgstr "" + +msgid "Text spanners" +msgstr "" + +msgid "Text marks" +msgstr "" + +msgid "Text markup" +msgstr "" + +msgid "Nested scores" +msgstr "" + +msgid "Overview of text markup commands" +msgstr "" + +msgid "Font selection" +msgstr "" + +msgid "New dynamic marks" +msgstr "" + +msgid "Preparing parts" +msgstr "" + +msgid "Multi measure rests" +msgstr "" + +msgid "Metronome marks" +msgstr "" + +msgid "Rehearsal marks" +msgstr "" + +msgid "Bar numbers" +msgstr "" + +msgid "Instrument names" +msgstr "" + +msgid "Instrument transpositions" +msgstr "" + +msgid "Ottava brackets" +msgstr "" + +msgid "Different editions from one source" +msgstr "" + +msgid "Orchestral music" +msgstr "" + +msgid "Automatic part combining" +msgstr "" + +msgid "Hiding staves" +msgstr "" + +msgid "Quoting other voices" +msgstr "" + +msgid "Formatting cue notes" +msgstr "" + +msgid "Aligning to cadenzas" +msgstr "" + +msgid "Contemporary notation" +msgstr "" + +msgid "Polymetric notation" +msgstr "" + +msgid "Time administration" +msgstr "" + +msgid "Proportional notation" +msgstr "" + +msgid "Clusters" +msgstr "" + +msgid "Special noteheads" +msgstr "" + +msgid "Feathered beams" +msgstr "" + +msgid "Improvisation" +msgstr "" + +msgid "Selecting notation font size" +msgstr "" + +msgid "Educational use" +msgstr "" + +msgid "Balloon help" +msgstr "" + +msgid "Blank music sheet" +msgstr "" + +msgid "Hidden notes" +msgstr "" + +msgid "Shape note heads" +msgstr "" + +msgid "Easy Notation note heads" +msgstr "" + +msgid "Analysis brackets" +msgstr "" + +msgid "Coloring objects" +msgstr "" + +msgid "Parentheses" +msgstr "" + +msgid "Changing defaults" +msgstr "" + +msgid "Automatic notation" +msgstr "" + +msgid "Automatic accidentals" +msgstr "" + +msgid "Setting automatic beam behavior" +msgstr "" + +msgid "Interpretation contexts" +msgstr "" + +msgid "Contexts explained" +msgstr "" + +msgid "Creating contexts" +msgstr "" + +msgid "Changing context properties on the fly" +msgstr "" + +msgid "Modifying context plug-ins" +msgstr "" + +msgid "Layout tunings within contexts" +msgstr "" + +msgid "Changing context default settings" +msgstr "" + +msgid "Defining new contexts" +msgstr "" + +msgid "The \\override command" +msgstr "" + +msgid "Constructing a tweak" +msgstr "" + +msgid "Navigating the program reference" +msgstr "" + +msgid "Layout interfaces" +msgstr "" + +msgid "Determining the grob property" +msgstr "" + +msgid "Objects connected to the input" +msgstr "" + +msgid "\\set vs. \\override" +msgstr "" + +msgid "Difficult tweaks" +msgstr "" + +msgid "Non-musical notation" +msgstr "" + +msgid "Input files" +msgstr "" + +msgid "File structure (introduction)" +msgstr "" + +msgid "Multiple scores in a book" +msgstr "" + +msgid "Extracting fragments of notation" +msgstr "" + +msgid "File structure" +msgstr "" + +msgid "A single music expression" +msgstr "" + +msgid "Including LilyPond files" +msgstr "" + +msgid "Text encoding" +msgstr "" + +msgid "Titles and headers" +msgstr "" + +msgid "Creating titles" +msgstr "" + +msgid "Custom titles" +msgstr "" + +msgid "MIDI output" +msgstr "" + +msgid "Creating MIDI files" +msgstr "" + +msgid "MIDI block" +msgstr "" + +msgid "MIDI instrument names" +msgstr "" + +msgid "Displaying LilyPond notation" +msgstr "" + +msgid "Skipping corrected music" +msgstr "" + +msgid "Spacing issues" +msgstr "" + +msgid "Paper and pages" +msgstr "" + +msgid "Paper size" +msgstr "" + +msgid "Page formatting" +msgstr "" + +msgid "Music layout" +msgstr "" + +msgid "Setting global staff size" +msgstr "" + +msgid "Score layout" +msgstr "" + +msgid "Vertical spacing" +msgstr "" + +msgid "Vertical spacing inside a system" +msgstr "" + +msgid "Vertical spacing of piano staves" +msgstr "" + +msgid "Vertical spacing between systems" +msgstr "" + +msgid "Controlling spacing of individual systems" +msgstr "" + +msgid "Two-pass vertical spacing" +msgstr "" + +msgid "Horizontal spacing" +msgstr "" + +msgid "Horizontal Spacing" +msgstr "" + +msgid "Horizontal spacing overview" +msgstr "" + +msgid "New spacing area" +msgstr "" + +msgid "Changing horizontal spacing" +msgstr "" + +msgid "Line length" +msgstr "" + +msgid "Breaks" +msgstr "" + +msgid "Line breaking" +msgstr "" + +msgid "Page breaking" +msgstr "" + +msgid "Optimal page breaking" +msgstr "" + +msgid "Optimal page turning" +msgstr "" + +msgid "Displaying spacing" +msgstr "" + +msgid "Interfaces for programmers" +msgstr "" + +msgid "Music functions" +msgstr "" + +msgid "Overview of music functions" +msgstr "" + +msgid "Simple substitution functions" +msgstr "" + +msgid "Paired substitution functions" +msgstr "" + +msgid "Mathematics in functions" +msgstr "" + +msgid "Void functions" +msgstr "" + +msgid "Programmer interfaces" +msgstr "" + +msgid "Input variables and Scheme" +msgstr "" + +msgid "Internal music representation" +msgstr "" + +msgid "Building complicated functions" +msgstr "" + +msgid "Displaying music expressions" +msgstr "" + +msgid "Music properties" +msgstr "" + +msgid "Doubling a note with slurs (example)" +msgstr "" + +msgid "Adding articulation to notes (example)" +msgstr "" + +msgid "Markup programmer interface" +msgstr "" + +msgid "Markup construction in Scheme" +msgstr "" + +msgid "How markups work internally" +msgstr "" + +msgid "New markup command definition" +msgstr "" + +msgid "Contexts for programmers" +msgstr "" + +msgid "Context evaluation" +msgstr "" + +msgid "Running a function on all layout objects" +msgstr "" + +msgid "Scheme procedures as properties" +msgstr "" + +msgid "Running LilyPond" +msgstr "" + +msgid "Invoking lilypond" +msgstr "" + +msgid "Command line options" +msgstr "" + +msgid "Environment variables" +msgstr "" + +msgid "Notes for the MacOS X app" +msgstr "" + +msgid "Updating files with convert-ly" +msgstr "" + +msgid "Updating with" +msgstr "" + +msgid "Reporting bugs" +msgstr "" + +msgid "Error messages" +msgstr "" + +msgid "Editor support" +msgstr "" + +msgid "Point and click" +msgstr "" + +msgid "LilyPond-book" +msgstr "" + +msgid "An example of a musicological document" +msgstr "" + +msgid "Integrating LaTeX and music" +msgstr "" + +msgid "Integrating La" +msgstr "" + +msgid "Integrating Texinfo and music" +msgstr "" + +msgid "Integrating HTML and music" +msgstr "" + +msgid "Integrating DocBook and music" +msgstr "" + +msgid "Common conventions" +msgstr "" + +msgid "Including a LilyPond file" +msgstr "" + +msgid "Including LilyPond code" +msgstr "" + +msgid "Processing the DocBook document" +msgstr "" + +msgid "Music fragment options" +msgstr "" + +msgid "Invoking lilypond-book" +msgstr "" + +msgid "Invoking" +msgstr "" + +msgid "Filename extensions" +msgstr "" + +msgid "Many quotes of a large score" +msgstr "" + +msgid "Inserting LilyPond output into other programs" +msgstr "" + +msgid "Converting from other formats" +msgstr "" + +msgid "Invoking midi2ly" +msgstr "" + +msgid "Invoking etf2ly" +msgstr "" + +msgid "Invoking musicxml2ly" +msgstr "" + +msgid "Invoking abc2ly" +msgstr "" + +msgid "Generating LilyPond files" +msgstr "" + +msgid "Literature list" +msgstr "" + +msgid "Scheme tutorial" +msgstr "" + +msgid "Notation manual tables" +msgstr "" + +msgid "Chord name chart" +msgstr "" + +msgid "MIDI instruments" +msgstr "" + +msgid "List of colors" +msgstr "" + +msgid "Normal colors" +msgstr "" + +msgid "X color names" +msgstr "" + +msgid "Color Names without a numerical suffix:" +msgstr "" + +msgid "Color names with a numerical suffix" +msgstr "" + +msgid "Grey Scale" +msgstr "" + +msgid "The Feta font" +msgstr "" + +msgid "Example templates" +msgstr "" + +msgid "Single staff" +msgstr "" + +msgid "Notes only" +msgstr "" + +msgid "Notes and lyrics" +msgstr "" + +msgid "Notes and chords" +msgstr "" + +msgid "Notes, lyrics, and chords." +msgstr "" + +msgid "Piano templates" +msgstr "" + +msgid "Solo piano" +msgstr "" + +msgid "Piano and melody with lyrics" +msgstr "" + +msgid "Piano centered lyrics" +msgstr "" + +msgid "Piano centered dynamics" +msgstr "" + +msgid "String quartet" +msgstr "" + +msgid "String quartet parts" +msgstr "" + +msgid "Vocal ensembles" +msgstr "" + +msgid "SATB vocal score" +msgstr "" + +msgid "SATB vocal score and automatic piano reduction" +msgstr "" + +msgid "Ancient notation templates" +msgstr "" + +msgid "Transcription of mensural music" +msgstr "" + +msgid "Gregorian transcription template" +msgstr "" + +msgid "Jazz combo" +msgstr "" + +msgid "Lilypond-book templates" +msgstr "" + +msgid "LaTeX" +msgstr "" + +msgid "Texinfo" +msgstr "" + +msgid "Cheat sheet" +msgstr "" + +msgid "GNU Free Documentation License" +msgstr "" + +msgid "ADDENDUM: How to use this License for your documents" +msgstr "" + +msgid "Up:" +msgstr "" + +msgid "Next:" +msgstr "" + +msgid "Previous:" +msgstr "" + +msgid "Appendix" +msgstr "" diff --git a/Documentation/topdocs/AUTHORS.texi b/Documentation/topdocs/AUTHORS.texi index db201896ad..c2c816327a 100644 --- a/Documentation/topdocs/AUTHORS.texi +++ b/Documentation/topdocs/AUTHORS.texi @@ -99,6 +99,8 @@ Documentation and examples Example files, documentation @item @email{heikki.junes@@hut.fi, Heikki Junes}, Cleanups in docs and example files. +@item @email{john.mandereau@@free.fr, John Mandereau}, + Internationalization. @item @email{scancm@@biobase.dk, Christian Mondrup}, Glossary. @item @email{hanwen@@xs4all.nl, Han-Wen Nienhuys}, @@ -109,7 +111,7 @@ Documentation and examples Main author. @item @email{gpermus@@gmail.com, Graham Percival}, @uref{http://percival-music.ca}, - Documenation Editor. + Documentation Editor. @item @email{pinard@@iro.umontreal.ca, François Pinard}, @uref{http://www.iro.umontreal.ca/~pinard/}, Parts of Documentation/user/glossary*, started @@ -147,10 +149,17 @@ Translations Russian translation. @item @email{, David González}, Spanish glossary translations. +@item @email{ngclaude@@123mail.org, Nicolas Grandclaude}, + French documentation translation. +@item @email{lolyfan@@wanadoo.fr, Jean-Charles Malahieude}, + French translation of messages, website and documentation. @item @email{john.mandereau@@free.fr, John Mandereau}, - French translation. -@item @email{lilyfan@@wanadoo.fr, Jean-Charles Malahieude} - French translation + French translation of messages, website and documentation +@item @email{gauvainpocentek@@yahoo.fr, Gauvain Pocentek}, + French website translation. +@item @email{ludovicsardain@@gmail.com, Ludovic Sardain}, + French documentation translation. @end itemize + @bye diff --git a/Documentation/topdocs/NEWS.tely b/Documentation/topdocs/NEWS.tely index 374dc9f444..e5984dfe85 100644 --- a/Documentation/topdocs/NEWS.tely +++ b/Documentation/topdocs/NEWS.tely @@ -66,6 +66,60 @@ which scares away people. @end ignore +@item Tablature now supports harmonics and slides, + +@lilypond[fragment,ragged-right,relative=1] +\new TabVoice +{ + d\2\glissando e\2 +} +@end lilypond + +This feature was sponsored by Mike Amundsen + +@item Horizontal spacing now follows object outlines more +accurately. This allows tighter horizontal spacing. + +@lilypond[fragment,ragged-right] +{ + \stemUp c''4...*1/2 + ceses'! +} +@end lilypond + + +@item Objects that belong outside of the staff are +now positioned automatically to avoid collisions. + +@lilypond[fragment,ragged-right,relative=1] + c'' + \once \override TextScript #'self-alignment-X = #CENTER + a,^"this doesn't collide with the c" + b^"this goes above the previous markup" + a8_"this goes below the dynamic" + a\f +@end lilypond + +@item Staves are spaced vertically using a skyline algorithm. This helps to avoid +uneven vertical spacing. + +@lilypond[ragged-right] + +%% todo: fix 'landscape PDF. +#(set-default-paper-size "a6" ) +\header { + tagline = ##f +} + +\book { + \score { + { + a,,1 | a'4 b' c'' d'' \break + \repeat unfold 2 {a' b' c'' d''} | b''''1 + } + } +} +@end lilypond @end itemize diff --git a/Documentation/topdocs/README.texi b/Documentation/topdocs/README.texi index b22a613c95..2d6e26b99e 100644 --- a/Documentation/topdocs/README.texi +++ b/Documentation/topdocs/README.texi @@ -17,9 +17,9 @@ Project. @section Versioning -LilyPond uses a versioning scheme similar to the Linux kernel. In a -version "x.y.z", an even second number 'y' denotes a stable version. -For development versions 'y' is odd. +LilyPond uses a versioning scheme that easily identifies stable and +development releases. In a version "x.y.z", an even second number 'y' +denotes a stable version. For development versions 'y' is odd. @section Downloading @@ -73,7 +73,7 @@ list. for sending bugreports. @item @uref{http://mail.gnu.org/mailman/listinfo/lilypond-cvs,lilypond-cvs@@gnu.org} - for commit messages from the CVS repository, and log files from the + for log files from the autobuild. @end itemize diff --git a/Documentation/user/GNUmakefile b/Documentation/user/GNUmakefile index 03f132c43c..11653d575f 100644 --- a/Documentation/user/GNUmakefile +++ b/Documentation/user/GNUmakefile @@ -192,13 +192,13 @@ $(outdir)/lilypond-internals/lilypond-internals.xml: $(outdir)/lilypond-internal $(outdir)/lilypond.pdf: $(OUT_PDF_IMAGES) $(OUT_PNG_IMAGES) $(outdir)/%.png: %.png - convert -geometry 50x50% $< $@ + convert -depth 8 -geometry 50x50% $< $@ $(outdir)/%.png: %.eps gs -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -q -sOutputFile=$@ -sDEVICE=png16m -dEPSCrop -dNOPAUSE -f $< -c quit $(outdir)/%.pdf: %.png - convert $< $@ + convert -depth 8 $< $@ $(outdir)/%.pdf: %.eps gs -dAutoRotatePages=/None -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -sOutputFile=$@ -dEPSCrop -c .setpdfwrite -f $< @@ -229,11 +229,6 @@ $(outdir)/music-glossary/source: local-WWW: $(HTML_FILES) $(DEEP_HTML_FILES)\ $(datafiles) $(PDF_FILES) $(source-links) info info-dir -local-WWW-clean: deep-WWW-clean - -deep-WWW-clean: - rm -rf $(outdir)/lilypond $(outdir)/lilypond-internals - info-dir: $(SHELL) $(buildscript-dir)/install-info-html.sh --dir=$(outdir) lilypond lilypond-internals music-glossary @@ -241,9 +236,6 @@ info-dir: $(outdir)/%.bib: %.bib ln -f $< $@ -local-clean: - rm -f fonts.aux fonts.log feta*.tfm feta*.*pk - rm -rf $(outdir)/lilypond $(outdir)/lilypond-internals $(outdir)/music-glossary # lilypond.texi deps $(top-build-dir)/mf/$(outconfbase)/feta16list.ly: @@ -270,10 +262,3 @@ $(outdir)/lilypond-internals.nexi $(outdir)/lilypond-internals.texi: $(LILYPOND_ ## unused $(outdir)/interfaces.itexi: dummy cd $(outdir) && lilypond $(top-src-dir)/ly/generate-interface-doc - - -local-clean: local-delete - -local-delete: - find $(outdir)/ -name 'lily-[0-9]*' | xargs rm -f - -rm -f $(outdir)/* diff --git a/Documentation/user/advanced-notation.itely b/Documentation/user/advanced-notation.itely index b327f8aec1..a414fe7b44 100644 --- a/Documentation/user/advanced-notation.itely +++ b/Documentation/user/advanced-notation.itely @@ -303,9 +303,8 @@ but it can also be used anywhere text is called in lilypond } @end lilypond -Text can also be placed on its own, away from any @code{\score} -block. This is primarily used in a @code{\book} (see -@ref{Multiple scores in a book}). +A @code{\markup} command can also be placed on its own, away from any +@code{\score} block, see @ref{Multiple scores in a book}. @lilypond[quote,ragged-right,verbatim] \markup{ Here is some text. } @@ -1135,9 +1134,9 @@ the staff. They are created by invoking the function } @end lilypond -The @code{set-octavation} function also takes -1 (for 8va bassa) and 2 -(for 15ma) as arguments. Internally the function sets the properties -@code{ottavation} (e.g., to @code{"8va"}) and +The @code{set-octavation} function also takes -1 (for 8va bassa), 2@tie{}(for 15ma), +and -2 (for 15ma bassa) as arguments. Internally the function sets the properties +@code{ottavation} (e.g., to @code{"8va"} or @code{"8vb"}) and @code{centralCPosition}. For overriding the text of the bracket, set @code{ottavation} after invoking @code{set-octavation}, i.e., @@ -1399,7 +1398,7 @@ or @code{\RemoveEmptyRhythmicStaffContext}. Another application is making ossia sections, i.e., alternative melodies on a separate piece of staff, with help of a Frenched -staff. See @inputfileref{input/@/test,ossia@/.ly} for an example. +staff. @node Quoting other voices @@ -1849,7 +1848,7 @@ seven sixteenths notes. @subsection Proportional notation @cindex Proportional notation -Notes can be spaced proportional to their time-difference by +Notes can be spaced proportionally to their time-difference by assigning a duration to @code{proportionalNotationDuration} @lilypond[quote,ragged-right,verbatim,relative=2,fragment] @@ -1860,6 +1859,36 @@ assigning a duration to @code{proportionalNotationDuration} >> @end lilypond +Setting this property only affects the ideal spacing between +consecutive notes. For true proportional notation, the following +settings are also required. + +@itemize @bullet + +@item True proportional notation requires that symbols are allowed to +overstrike each other. That is achieved by removing the +@internalsref{Separating_line_group_engraver} from +@internalsref{Staff} context. + +@item Spacing influence of prefatory matter (clefs, bar lines, etc.) +is removed by setting the @code{strict-note-spacing} property to +@code{#t} in @internalsref{SpacingSpanner} grob. + +@item Optical spacing tweaks are switched by setting +@code{uniform-stretching} in @internalsref{SpacingSpanner} to true. + + +@end itemize + +@seealso + +@inputfileref{input/@/regression,spacing-proportional/.ly} +@inputfileref{input/@/regression,spacing-strict-notespacing/.ly} +@inputfileref{input/@/regression,spacing-strict-spacing-grace/.ly} + +An example of strict proportional notation is in the +example file @file{input/proportional.ly}. + @node Clusters @subsection Clusters @@ -2191,7 +2220,7 @@ used in music for beginners The command @code{\setEasyHeads} overrides settings for the @internalsref{NoteHead} object. To make the letters readable, it has to be printed in a large font size. To print with a larger font, see -@ref{Setting global staff size}. +@ref{Setting the staff size}. @refcommands diff --git a/Documentation/user/basic-notation.itely b/Documentation/user/basic-notation.itely index 235b41892f..d760201c36 100644 --- a/Documentation/user/basic-notation.itely +++ b/Documentation/user/basic-notation.itely @@ -1777,8 +1777,7 @@ b b @end lilypond In combination with Frenched staves, this may be used to typeset ossia -sections. An example is in @inputfileref{input/@/test@/,ossia.ly}, -shown here +sections. An example is shown here @cindex ossia diff --git a/Documentation/user/instrument-notation.itely b/Documentation/user/instrument-notation.itely index 4ca0142e04..42e4348cc6 100644 --- a/Documentation/user/instrument-notation.itely +++ b/Documentation/user/instrument-notation.itely @@ -148,7 +148,7 @@ usually the setup for a score will start with a setup of the staves, and the @context{Voice} is inserted afterwards @example -\new Staff = down +\context Staff = down \new Voice @{ @dots{} \change Staff = up @dots{} @} @end example @@ -4548,6 +4548,15 @@ automatically. @end lilypond +@refbugs + +When using figured bass above the staff with extender lines and +@code{implicitBassFigures} the lines may become swapped around. +Maintaining order consistently will be impossible when multiple figures +have overlapping extender lines. To avoid this problem, plese +use @code{stacking-dir} on @code{BassFigureAlignment}. + + @seealso Program reference: @internalsref{NewBassFigure}, diff --git a/Documentation/user/lilypond.tely b/Documentation/user/lilypond.tely index bcdbc5682c..ce5b8b4f10 100644 --- a/Documentation/user/lilypond.tely +++ b/Documentation/user/lilypond.tely @@ -133,7 +133,7 @@ Free Documentation License''. @top GNU LilyPond --- The music typesetter @c HJJ: Info needs `@top', which is a synonym for `@unnumbered' in TeX. -This is the user manual for GNU LilyPond 2.8.x series. +This is the user manual for GNU LilyPond 2.10.x series. @ifhtml (See the bottom of this page for the exact version number). @end ifhtml diff --git a/Documentation/user/non-music.itely b/Documentation/user/non-music.itely index f477d882be..9fb163d7c0 100644 --- a/Documentation/user/non-music.itely +++ b/Documentation/user/non-music.itely @@ -98,23 +98,29 @@ and texts are entered with a @code{\markup} block, @funindex \book -The movements and texts are combined together in a @code{\book} block, -like +All the movements and texts which appear in the same @code{.ly} file +will normally be typeset in the form of a single output file. @example -\book @{ - \score @{ - @var{..} - @} - \markup @{ - @var{..} - @} - \score @{ - @var{..} - @} +\score @{ + @var{..} +@} +\markup @{ + @var{..} +@} +\score @{ + @var{..} @} @end example +However, if you want multiple output files from the same @code{.ly} +file, then you can add multiple @code{\book} blocks, where each such +@code{\book} block will result in a separate output. If you do not +specify any @code{\book} block in the file, LilyPond will implicitly +treat the full file as a single @code{\book} block, see @ref{File +structure}. One important exception is within lilypond-book documents, +where you explicitly have to add a @code{\book} block, otherwise only +the first @code{\score} or @code{\markup} will appear in the output. The header for each piece of music can be put inside the @code{\score} block. The @code{piece} name from the header will be printed before @@ -123,25 +129,23 @@ each movement. The title for the entire book can be put inside the the top of the file is inserted. @example -\book @{ - \header @{ - title = "Eight miniatures" - composer = "Igor Stravinsky" - @} - \score @{ - @dots{} - \header @{ piece = "Romanze" @} - @} - \markup @{ - ..text of second verse.. - @} - \markup @{ - ..text of third verse.. - @} - \score @{ - @dots{} - \header @{ piece = "Menuetto" @} - @} +\header @{ + title = "Eight miniatures" + composer = "Igor Stravinsky" +@} +\score @{ + @dots{} + \header @{ piece = "Romanze" @} +@} +\markup @{ + ..text of second verse.. +@} +\markup @{ + ..text of third verse.. +@} +\score @{ + @dots{} + \header @{ piece = "Menuetto" @} @} @end example @@ -221,8 +225,13 @@ contain only one music expression. @item A @code{\book} block logically combines multiple movements (i.e., multiple @code{\score} blocks) in one document. If there are -a number of @code{\scores}, a single output file will be created -in which all movements are concatenated. +a number of @code{\scores}, one output file will be created for +each @code{\book} block, in which all corresponding movements are +concatenated. The only reason to explicitly specify @code{\book} blocks +in a @code{.ly} file is if you wish multiple output files from a single +input file. One exception is within lilypond-book documents, where you +explicitly have to add a @code{\book} block if you want more than a +single @code{\score} or @code{\markup} in the same example. This behavior can be changed by setting the variable @code{toplevel-book-handler} at toplevel. The default handler is @@ -469,8 +478,8 @@ some pieces include a lot more information. @node Creating titles @subsection Creating titles -Titles are created for each @code{\score} block, and over a -@code{\book}. +Titles are created for each @code{\score} block, and for the full input +file (or @code{\book} block). The contents of the titles are taken from the @code{\header} blocks. The header block for a book supports the following @@ -661,14 +670,13 @@ variables in the @code{\paper} block. The init file @table @code @funindex bookTitleMarkup @item bookTitleMarkup - This is the title put over an entire @code{\book} block. Typically, - it has the composer and the title of the piece + This is the title added at the top of the entire output document. +Typically, it has the composer and the title of the piece @funindex scoreTitleMarkup @item scoreTitleMarkup - This is the title put over a @code{\score} block within a -@code{\book}. Typically, it has the name of the movement (@code{piece} -field). + This is the title put over a @code{\score} block. Typically, it has +the name of the movement (@code{piece} field). @funindex oddHeaderMarkup @item oddHeaderMarkup @@ -763,12 +771,15 @@ to a score, for example, @example \score @{ @var{...music...} - \midi @{ @} + \midi @{ + \context @{ + \Score + tempoWholesPerMinute = #(ly:make-moment 72 4) + @} + @} @} @end example -FIXME - The tempo is specified using the @code{\tempo} command. In this example the tempo of quarter notes is set to 72 beats per minute. diff --git a/Documentation/user/notation-appendices.itely b/Documentation/user/notation-appendices.itely index 9ad1949cad..32afbd6f1b 100644 --- a/Documentation/user/notation-appendices.itely +++ b/Documentation/user/notation-appendices.itely @@ -189,13 +189,13 @@ accessed directly using text markup such as @code{g^\markup @{ @ignore -@node All context properties +@n ode All context properties @a ppendixsec All context properties @i nclude context-properties.tely -@node Layout properties +@n ode Layout properties @ap pendixsec Layout properties @in clude layout-properties.tely diff --git a/Documentation/user/programming-interface.itely b/Documentation/user/programming-interface.itely index 57b5d1da88..9a62200bba 100644 --- a/Documentation/user/programming-interface.itely +++ b/Documentation/user/programming-interface.itely @@ -12,7 +12,7 @@ not familiar with Scheme, you may wish to read our * Building complicated functions:: * Markup programmer interface:: * Contexts for programmers:: -* Scheme procedures as properties:: +* Scheme procedures as properties:: @end menu @@ -27,6 +27,7 @@ This section discusses how to create music functions within LilyPond. * Paired substitution functions:: * Mathematics in functions:: * Void functions:: +* Overview of available music functions:: @end menu @node Overview of music functions @@ -236,6 +237,15 @@ noPointAndClick = \noPointAndClick % disable point and click @end example +@node Overview of available music functions +@subsection Overview of available music functions + +@c fixme ; this should be move somewhere else? +The following commands are music functions + +@include identifiers.tely + + @node Programmer interfaces @section Programmer interfaces diff --git a/Documentation/user/spacing.itely b/Documentation/user/spacing.itely index aa4a6039b8..21b9328860 100644 --- a/Documentation/user/spacing.itely +++ b/Documentation/user/spacing.itely @@ -29,6 +29,7 @@ or stretched. * Horizontal spacing:: * Breaks:: * Displaying spacing:: +* Vertical collision avoidance:: @end menu @@ -229,8 +230,8 @@ book and the title of a piece). Default is@tie{}2mm. @funindex printallheaders @item printallheaders -Setting this to #t will print all headers for each \score in a -\book. Normally only the piece and opus \headers are printed. +Setting this to #t will print all headers for each \score in the +output. Normally only the piece and opus \headers are printed. @funindex systemSeparatorMarkup @item systemSeparatorMarkup @@ -332,19 +333,20 @@ add space between the titles and the first system of the score. @section Music layout @menu -* Setting global staff size:: +* Setting the staff size:: * Score layout:: @end menu -@node Setting global staff size -@subsection Setting global staff size +@node Setting the staff size +@subsection Setting the staff size @cindex font size, setting @cindex staff size, setting @funindex layout file -To set the global staff size, use @code{set-global-staff-size}. +To set the staff size globally for all scores in a file (or +in a @code{book} block, to be precise), use @code{set-global-staff-size}. @example #(set-global-staff-size 14) @@ -354,6 +356,16 @@ To set the global staff size, use @code{set-global-staff-size}. This sets the global default size to 14pt staff height and scales all fonts accordingly. +To set the staff size individually for each score, use +@example +\score@{ + ... + \layout@{ + #(layout-set-staff-size 15) + @} +@} +@end example + The Feta font provides musical symbols at eight different sizes. Each font is tuned for a different staff size: at a smaller size the font becomes heavier, to match the relatively heavier staff lines. @@ -814,6 +826,11 @@ c16[ c c8] @end lilypond +The @code{\newSpacingSection} command creates a new +@internalsref{SpacingSpanner} object, and hence new @code{\override}s +may be used in that location. + + @node Changing horizontal spacing @subsection Changing horizontal spacing @@ -1170,3 +1187,76 @@ The pairs @var{b} the upper edge of the interval. +@node Vertical collision avoidance +@section Vertical collision avoidance + +@funindex outside-staff-priority +@funindex outside-staff-padding +@funindex outside-staff-horizontal-padding + +Intuitively, there are some objects in musical notation that belong +to the staff and there are other objects that should be placed outside +the staff. Objects belonging outside the staff include things such as +rehearsal marks, text and dynamic markings (from now on, these will +be called outside-staff objects). LilyPond's rule for the +vertical placement of outside-staff objects is to place them as close +to the staff as possible but not so close that they collide with +another object. + +LilyPond uses the @code{outside-staff-priority} property to determine +whether a grob is an outside-staff object: if @code{outside-staff-priority} +is a number, the grob is an outside-staff object. In addition, +@code{outside-staff-priority} tells LilyPond in which order the objects +should be placed. + +First, LilyPond places all the objects that do not belong outside +the staff. Then it sorts the outside-staff objects according to their +@code{outside-staff-priority} (in increasing order). One by one, LilyPond +takes the outside-staff objects and places them so that they do +not collide with any objects that have already been placed. That +is, if two outside-staff grobs are competing for the same space, the one +with the lower @code{outside-staff-priority} will be placed closer to +the staff. + +@lilypond[quote,ragged-right,relative=2,fragment,verbatim] +c4_"Text"\pp +r2. +\once \override TextScript #'outside-staff-priority = #1 +c4_"Text"\pp % this time the text will be closer to the staff +r2. +% by setting outside-staff-priority to a non-number, we +% disable the automatic collision avoidance +\once \override TextScript #'outside-staff-priority = ##f +\once \override DynamicLineSpanner #'outside-staff-priority = ##f +c4_"Text"\pp % now they will collide +@end lilypond + +The vertical padding between an outside-staff object and the +previously-positioned grobs can be controlled with +@code{outside-staff-padding}. + +@lilypond[quote,ragged-right,relative=2,fragment,verbatim] +\once \override TextScript #'outside-staff-padding = #0 +a'^"This text is placed very close to the note" +\once \override TextScript #'outside-staff-padding = #3 +c^"This text is padded away from the previous text" +c^"This text is placed close to the previous text" +@end lilypond + +By default, outside-staff objects are placed without regard to +their horizontal distance from the previously-posititioned grobs. This +can lead to situations in which objects are placed very close to each +other horizontally. Setting @code{outside-staff-horizontal-padding} +causes an object to be offset vertically so that such a situation +doesn't occur. + +@lilypond[quote,ragged-right,relative=2,fragment,verbatim] +% the markup is too close to the following note +c2^"Text" +c''2 +% setting outside-staff-horizontal-padding fixes this +R1 +\once \override TextScript #'outside-staff-horizontal-padding = #1 +c,,2^"Text" +c''2 +@end lilypond diff --git a/GNUmakefile.in b/GNUmakefile.in index 70d937a7f4..423d2154ca 100644 --- a/GNUmakefile.in +++ b/GNUmakefile.in @@ -18,7 +18,7 @@ documentation-dir=$(if $(findstring no,$(DOCUMENTATION)),,Documentation) SCRIPTS = configure autogen.sh README_FILES = COPYING DEDICATION ROADMAP THANKS HACKING -TOPDOC_FILES=AUTHORS README INSTALL NEWS +TOPDOC_FILES = AUTHORS README INSTALL NEWS TOPDOC_TXT_FILES = $(addprefix $(top-build-dir)/Documentation/topdocs/$(outdir)/,$(addsuffix .txt,$(TOPDOC_FILES))) IN_FILES := $(call src-wildcard,*.in) @@ -35,15 +35,15 @@ include $(depth)/make/stepmake.make local-dist: dist-toplevel-txt-files dist-changelog dist-changelog: - if test -d .git ; then \ - git-whatchanged gub-2.9.29-2.. > $(distdir)/ChangeLog ; \ + if test -d $(top-src-dir)/.git ; then \ + cd $(top-src-dir) && git-whatchanged gub-2.9.29-2.. > $(distdir)/ChangeLog ; \ else \ - cp $(srcdir)/ChangeLog $(distdir) ; \ + cp $(top-src-dir)/ChangeLog $(distdir) ; \ fi default: $(outdir)/VERSION -$(outdir)/VERSION: $(config_make) +$(outdir)/VERSION: $(config_make) VERSION echo $(TOPLEVEL_VERSION) > $@ dist-toplevel-txt-files: @@ -82,7 +82,9 @@ final-install: web-ext = html midi pdf png txt ly signature -footify = $(PYTHON) $(step-bindir)/add-html-footer.py --name $(PACKAGE_NAME) --version $(TOPLEVEL_VERSION) +# For docball, issue `make web CONTENT_NEGOTIATION=' +CONTENT_NEGOTIATION = --content-negotiation +footify = $(PYTHON) $(step-bindir)/add-html-footer.py --name $(PACKAGE_NAME) --version $(TOPLEVEL_VERSION) $(CONTENT_NEGOTIATION) footifymail = MAILADDRESS='http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs' @@ -98,7 +100,8 @@ local-WWW-post: cd $(top-build-dir) && find Documentation input \ $(web-ext:%=-path '*/out-www/*.%' -or) -type l \ - | grep -v 'lily-[0-9].*.pdf' \ + | grep -v 'lily-[0-9a-f]*.*pdf' \ + | grep -v '/fr/' \ > $(outdir)/weblist ls $(outdir)/*.html >> $(outdir)/weblist @@ -117,7 +120,6 @@ local-WWW-post: rm -rf $$a ; \ done \ done - echo $(TOPLEVEL_VERSION) > $(outdir)/web-root/VERSION tree-prefix = $(outdir) tree-bin = $(tree-prefix)/bin @@ -146,7 +148,7 @@ PO_FILES = $(call src-wildcard,$(src-depth)/po/*.po) HELP_CATALOGS = $(PO_FILES:po/%.po=%) CATALOGS = $(HELP_CATALOGS:lilypond=) -$(tree-share-prefix)/lilypond-force link-tree: GNUmakefile +$(tree-share-prefix)/lilypond-force link-tree: GNUmakefile $(outdir)/VERSION # Preparing LilyPond tree for build-dir exec cd $(top-build-dir)/$(outbase) && rm -rf bin lib share mkdir -p $(tree-bin) @@ -154,7 +156,6 @@ $(tree-share-prefix)/lilypond-force link-tree: GNUmakefile ln -s $(TOPLEVEL_VERSION) $(tree-share-prefix-current) mkdir -p $(tree-lib-prefix) ln -s $(TOPLEVEL_VERSION) $(tree-lib-prefix-current) - mkdir -p $(tree-share-prefix)/dvips mkdir -p $(tree-share-prefix)/elisp mkdir -p $(tree-share-prefix)/fonts mkdir -p $(tree-share-prefix)/fonts/otf @@ -177,9 +178,6 @@ $(tree-share-prefix)/lilypond-force link-tree: GNUmakefile ln -s ../../../../python/$(outconfbase) python && \ ln -s $(top-src-dir)/scm && \ ln -s $(top-src-dir)/scripts scripts - cd $(tree-share-prefix)/dvips && \ - ln -s ./../../../mf/$(outconfbase) mf-out && \ - ln -s $(top-src-dir)/ps cd $(tree-share-prefix)/tex && \ ln -s $(top-src-dir)/tex source && \ ln -s ../../../../../tex/$(outconfbase) tex-out && \ @@ -212,17 +210,7 @@ $(tree-share-prefix)/mf-link-tree link-mf-tree: $(tree-share-prefix)/lilypond-fo ln -s ../../../../../../mf/$(outconfbase)/*.pfa . TAGS.make: dummy - etags -o $@ $(find $(srcdir) -name 'GNUmakefile*' -o -name '*.make') - -local-clean: build-dir-setup-clean local-web-clean - -local-web-clean: - rm -rf $(outdir)/web-root/ - - - -build-dir-setup-clean: - cd $(top-build-dir) && rm -rf share + etags -o $@ $(find $(top-src-dir) -name 'GNUmakefile*' -o -name '*.make') $(config_h): config.hh.in # diff --git a/ROADMAP b/ROADMAP index ffe13dba44..6a691b6237 100644 --- a/ROADMAP +++ b/ROADMAP @@ -28,8 +28,7 @@ source files. bugs/ Buggy or problematic notation mutopia/ Real music, more at www.mutopiaproject.org no-notation/ Examples that do not produce output - regression/ Testing of [all] features, one test per file - templates/ Boilerplates for typical music layouts + regression/ Testing of features, one test per file test/ Tips and tricks tutorial/ Examples from the tutorial lily/ C++ sources for LilyPond (lilypond-bin) diff --git a/SConstruct b/SConstruct index 40949dc511..7e86f13cb1 100644 --- a/SConstruct +++ b/SConstruct @@ -313,7 +313,6 @@ def symlink_tree (target, source, env): ('scripts/', 'bin/lilypond-book'), ('scripts/', 'bin/ps2png'), ('mf', 'share/lilypond/%(ver)s/dvips/mf-out'), - ('#ps', 'share/lilypond/%(ver)s/dvips/ps'), ('#ps/music-drawing-routines.ps', 'share/lilypond/%(ver)s/tex/music-drawing-routines.ps'), ('mf', 'share/lilypond/%(ver)s/otf'), @@ -420,14 +419,13 @@ def configure (target, source, env): required = [] test_program (required, 'bash', '2.0', 'Bash', 'bash') - test_program (required, 'gcc', '2.8', 'GNU C compiler', 'gcc') - test_program (required, 'g++', '3.0.5', 'GNU C++ compiler', 'g++') - test_program (required, 'guile-config', '1.6', 'GUILE development', + test_program (required, 'gcc', '4.0', 'GNU C compiler', 'gcc') + test_program (required, 'g++', '4.0.5', 'GNU C++ compiler', 'g++') + test_program (required, 'guile-config', '1.8', 'GUILE development', 'libguile-dev or guile-devel') test_program (required, 'mf', '0.0', 'Metafont', 'tetex-bin') - test_program (required, 'mftrace', '1.1.9', + test_program (required, 'mftrace', '1.1.19', 'mftrace (http://xs4all.nl/~hanwen/mftrace)', 'mftrace') - test_program (required, 'potrace', '0.0', 'Potrace', 'potrace') test_program (required, 'python', '2.1', 'Python (www.python.org)', 'python') # Silly, and breaks with /bin/sh == dash @@ -438,21 +436,17 @@ def configure (target, source, env): #test_program (optional, 'foo', '2.0', 'Foomatic tester', 'bar') test_program (optional, 'bison', '1.25', 'Bison -- parser generator', 'bison') - test_program (optional, 'dvips', '0.0', 'Dvips', 'tetex-bin') test_program (optional, 'fontforge', '0.0.20050624', 'FontForge', 'fontforge') test_program (optional, 'flex', '0.0', 'Flex -- lexer generator', 'flex') - test_program (optional, 'guile', '1.6', 'GUILE scheme', 'guile') + test_program (optional, 'guile', '1.8', 'GUILE scheme', 'guile') test_program (optional, 'gs', '8.15', 'Ghostscript PostScript interpreter', 'gs or gs-afpl or gs-esp or gs-gpl') - test_program (optional, 'mftrace', '1.1.19', 'Metafont tracing Type1', - 'mftrace') - test_program (optional, 'makeinfo', '4.7', 'Makeinfo tool', 'texinfo') + test_program (optional, 'makeinfo', '4.8', 'Makeinfo tool', 'texinfo') test_program (optional, 'perl', '4.0', 'Perl practical efficient readonly language', 'perl') - #test_program (optional, 'ps2pdf', '0.0', 'Ps2pdf', 'gs') def CheckYYCurrentBuffer (context): context.Message ('Checking for yy_current_buffer... ') @@ -679,6 +673,9 @@ BUILD_ABC2LY = '${set__x}$PYTHON $srcdir/scripts/abc2ly.py' BUILD_LILYPOND = '$absbuild/lily/$out/lilypond ${__verbose}' BUILD_LILYPOND_BOOK = '$PYTHON $srcdir/scripts/lilypond-book.py ${__verbose}' +if env['verbose'] and env['verbose'] != '0': + env['__verbose'] = ' --verbose' + env['set__x'] = 'set -x;' # post-option environment-update env.Append ( @@ -694,22 +691,11 @@ env.Append ( libdir_package = libdir_package, libdir_package_version = libdir_package_version, - # global build verbosity switch - __verbose = ' --verbose', - LILYPOND = BUILD_LILYPOND, ABC2LY = BUILD_ABC2LY, LILYPOND_BOOK = BUILD_LILYPOND_BOOK, LILYPOND_BOOK_FORMAT = 'texi-html', MAKEINFO_FLAGS = '--css-include=$srcdir/Documentation/texinfo.css', - # PYTHONPATH = ['$absbuild/python/$out'], - TEXI2DVI_PAPERSIZE = '@afourpaper', - TEXI2DVI_FLAGS = [ '-t$TEXI2DVI_PAPERSIZE'], - DVIPS_PAPERSIZE = 'a4', - DVIPS_FLAGS = ['-t$DVIPS_PAPERSIZE', - '-u+lilypond.map', - '-u+ec-mftrace.map'], - PSPDF_FLAGS = ['-sPAPERSIZE=$DVIPS_PAPERSIZE'], ) env.Append (CCFLAGS = ['-pipe', '-Wno-pmf-conversions']) @@ -726,11 +712,6 @@ env.Append (LINKFLAGS = ['-Wl,--export-dynamic']) # FIXME: ParseConfig ignores -L flag? env.Append (LINKFLAGS = ['-L/usr/X11R6/lib']) -if env['verbose']: - env['__verbose'] = ' --verbose' - env['set__x'] = 'set -x;' - - ## Explicit target and dependencies if 'clean' in COMMAND_LINE_TARGETS: @@ -761,10 +742,6 @@ if 'realclean' in COMMAND_LINE_TARGETS: os.unlink (config_cache) Exit (s) -def symlink_tree (): - print "BOE" - raise urg - # Declare SConscript phonies env.Alias ('minimal', config_cache) @@ -980,3 +957,4 @@ for d in subdirs: env.BuildDir (b, d, duplicate = 0) SConscript (os.path.join (b, 'SConscript')) +env.Command ('tree', ['#/VERSION', '#/SConstruct'], symlink_tree) diff --git a/THANKS b/THANKS index 38623616d3..94f71d2208 100644 --- a/THANKS +++ b/THANKS @@ -2,6 +2,39 @@ Release 2.10 ************ + +DEVELOPMENT TEAM + +Han-Wen Nienhuys - Core development +Jan Nieuwenhuizen - Core development +Joe Neeman - Core development +Graham Percival - Documentation Editor and Bug Meister +Mats Bengtsson - Support Guru + + +SPONSORS + +Mike Amundsen + + +BUG HUNTERS/SUGGESTIONS + +Benjamin Drung +David Bobroff +Cameron Horsburgh +Maarten Hijzelendoorn +Matthijs Frankeno +Phillip Kirlin +Rick Hansen +Thomas Scharkowski +Trevor Bača +Werner Lemberg + + +Release 2.10 +************ + + DEVELOPMENT TEAM Han-Wen Nienhuys - Core development @@ -19,6 +52,16 @@ Erlend Aasland Guido Amoruso Heikki Junes Joe Neeman +John Mandereau + + +TRANSLATORS + +Gauvain Pocentek +Jean-Charles Malahieude +John Mandereau +Ludovic Sardain +Nicolas Grandclaude SPONSORS diff --git a/VERSION b/VERSION index 36a6a289d7..7616dcf40b 100644 --- a/VERSION +++ b/VERSION @@ -1,6 +1,6 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=2 MINOR_VERSION=11 -PATCH_LEVEL=0 +PATCH_LEVEL=2 MY_PATCH_LEVEL= diff --git a/buildscripts/builder.py b/buildscripts/builder.py index cf3493fa72..f41b0dd05c 100644 --- a/buildscripts/builder.py +++ b/buildscripts/builder.py @@ -166,8 +166,7 @@ def add_tfm_target (target, source, env): def add_lisp_enc_tex_ly_target (target, source, env): base = os.path.splitext (str (target[0]))[0] - return (target + [base + '.lisp', base + '.enc', base + '.tex', - base + 'list.ly'], + return (target + [base + '.lisp', base + '.enc', base + '.tex'], source) def add_cff_cffps_svg (target, source, env): @@ -191,7 +190,6 @@ a = '$PYTHON $MF_TO_TABLE_PY \ --enc=${TARGET.base}.enc \ --tex=${TARGET.base}.tex \ ${TARGET.base}.log' -#--ly=${TARGET.base}list.ly \ gtable = Builder (action = a, suffix = '.otf-gtable', src_suffix = '.log', emitter = add_lisp_enc_tex_ly_target) env.Append (BUILDERS = {'GTABLE': gtable}) @@ -280,21 +278,6 @@ def at_copy (target, source, env): AT_COPY = Builder (action = at_copy, src_suffix = ['.in', '.py', '.sh',]) env.Append (BUILDERS = {'AT_COPY': AT_COPY}) -def at_copy_ext (target, source, env): - n = str (source[0]) - s = open (n).read () - for i in atvars: - if env.has_key (i): - s = string.replace (s, '@%s@'% i, env[i]) - # whugh - e = os.path.splitext (n)[1] - t = str (target[0]) + e - open (t, 'w').write (s) - -AT_COPY_EXT = Builder (action = at_copy_ext, src_suffix = ['.py', '.sh',]) -env.Append (BUILDERS = {'AT_COPY_EXT': AT_COPY_EXT}) - - MO = Builder (action = 'msgfmt -o $TARGET $SOURCE', suffix = '.mo', src_suffix = '.po') env.Append (BUILDERS = {'MO': MO}) diff --git a/buildscripts/find-superfluous-includes.py b/buildscripts/find-superfluous-includes.py new file mode 100644 index 0000000000..ded1087da7 --- /dev/null +++ b/buildscripts/find-superfluous-includes.py @@ -0,0 +1,44 @@ +#!/usr/bin/python +import sys +import re +import os + + +full_paths = {} +incs = {} +inc_re = re.compile ('^#include "([^"]+)"') +def parse_file (fn): + lst = [] + + lc = 0 + for l in open (fn).readlines(): + lc += 1 + m = inc_re.search (l) + if m: + lst.append ((lc, m.group (1))) + + base = os.path.split (fn)[1] + full_paths[base] = fn + incs[base] = lst + + +def has_include (f, name): + try: + return name in [b for (a,b) in incs[f]] + except KeyError: + return False + +for a in sys.argv: + parse_file (a) + +print '-*-compilation-*-' +for (f, lst) in incs.items (): + for (n, inc) in lst: + for (n2, inc2) in lst: + if has_include (inc2, inc): + print "%s:%d: already have %s from %s" % (full_paths[f], n, + inc, inc2) + break + + + diff --git a/buildscripts/html-gettext.py b/buildscripts/html-gettext.py new file mode 100644 index 0000000000..97f8e5f6f6 --- /dev/null +++ b/buildscripts/html-gettext.py @@ -0,0 +1,73 @@ +#!@PYTHON@ +# html-gettext.py + +# Usage: html-gettext.py [-o OUTDIR] LOCALEDIR LANG FILES +# +# -o OUTDIR specifies that output files should be written in OUTDIR +# rather than be overwritten +# +# LANG +# LOCALEDIR should contain 'lilypond-doc' message catalogs + + +### DATA +# Currently, typo_rules[LANG] only defines the HTML-coded space occuring +# before double punctuation characters (i.e. : ; ? ! ) for LANG + +typo_rules = { 'fr':' ', 'default':'' } + + +### PROGRAM + +import sys +import re +import os +import string +import gettext +import getopt + +optlist, args = getopt.getopt(sys.argv[1:],'o:') + +outdir = '.' +for x in optlist: + if x[0] == '-o': + outdir = x[1] + +if args[1] in typo_rules.keys(): + dbl_punct_char_separator = typo_rules[args[1]] +else: + dbl_punct_char_separator = typo_rules['default'] + +t = gettext.translation('lilypond-doc', args[0], [args[1]]) +_ = t.gettext + +def link_gettext (m): + return '' + +def title_gettext (m): + return '' + _(m.group(1)) + ' - ' + m.group(2) + '' + +def a_href_gettext (m): + if m.group(4) == ':': + s = dbl_punct_char_separator + ':' + elif m.group(4) == None: + s = '' + return '' + s + +def h_gettext (m): + return '' + \ + (m.group(3) or '') + _(m.group(4)) + '' + +for filename in args[2:]: + f = open (filename, 'r') + page = f.read () + f.close() + page = re.sub (r'', link_gettext, page) + page = re.sub (r'([^<]*?) - ([^<]*?)', title_gettext, page) + page = re.sub (r')([^<]+)(:)?', a_href_gettext, page) + page = re.sub (r'([\d.]+ )?([^<]+)', h_gettext, page) + for w in ('Next:', 'Previous:', 'Up:'): + page = re.sub (w, _(w), page) + f = open (os.path.join (outdir, filename), 'w') + f.write (page) + f.close () diff --git a/buildscripts/mutopia-index.py b/buildscripts/mutopia-index.py index f63240cec8..8bb5af36ab 100644 --- a/buildscripts/mutopia-index.py +++ b/buildscripts/mutopia-index.py @@ -198,7 +198,7 @@ allfiles = [] for d in dirs: allfiles = allfiles + find ('*.ly', d) -allfiles = filter (lambda x: not x.endswith ('snippet-map.ly') and not re.search ('lily-[0-9]+', x), allfiles) +allfiles = filter (lambda x: not x.endswith ('snippet-map.ly') and not re.search ('lily-[0-9a-f]+', x), allfiles) gen_list (allfiles, outfile) diff --git a/buildscripts/pfx2ttf.fontforge b/buildscripts/pfx2ttf.fontforge index ec0f9a214a..cdb82475f6 100644 --- a/buildscripts/pfx2ttf.fontforge +++ b/buildscripts/pfx2ttf.fontforge @@ -3,6 +3,22 @@ Open($1); MergeKern($2) + +# +# NCSB is broken as shipped by Fedora Core 6 +# it contains bogus ligatures TM and No in the AFM file. +# +# Remove the TM glyph - for want of better FF fix. +err = SelectIf("trademark"); +if ( err > 0 ) + Cut(); +elseif ( err == 0 ) + Print("Could not find \"trademark\" glyph"); +elseif ( err < 0 ) + Print("An error occurred while searching for the \"trademark\" glyph"); +endif + + # Remove the No. glyph - for want of better FF fix. err = SelectIf("afii61352"); if ( err > 0 ) diff --git a/buildscripts/texi-langutils.py b/buildscripts/texi-langutils.py new file mode 100644 index 0000000000..09737639b7 --- /dev/null +++ b/buildscripts/texi-langutils.py @@ -0,0 +1,95 @@ +#!@PYTHON@ +# texi-langutils.py + +# WARNING: this script can't find files included in a different directory + +import sys +import re +import getopt +import os +import string + +optlist, texi_files = getopt.getopt(sys.argv[1:],'no:d:b:i:',['skeleton', 'gettext']) +process_includes = not ('-n', '') in optlist # -n don't process @include's in texinfo files + +make_gettext = ('--gettext', '') in optlist # --gettext generate a node list from a Texinfo source +make_skeleton = ('--skeleton', '') in optlist # --skeleton extract the node tree from a Texinfo source + +output_file = 'doc.pot' +node_blurb = '' +intro_blurb = '' + +for x in optlist: + if x[0] == '-o': # -o NAME set PO output file name to NAME + output_file = x[1] + elif x[0] == '-d': # -d DIR set working directory to DIR + os.chdir (x[1]) + elif x[0] == '-b': # -b BLURB set blurb written at each node to BLURB + node_blurb = x[1] + elif x[0] == '-i': # -i BLURB set blurb written at beginning of each file to BLURB + intro_blurb = x[1] + +def process_texi (texifilename, i_blurb, n_blurb, write_skeleton, output_file=None): + try: + #print "Processing %s..." % texifilename + f = open (texifilename, 'r') + texifile = f.read () + f.close () + includes = [] + if write_skeleton: + g = open (os.path.basename (texifilename), 'w') + g.write (i_blurb) + tutu = re.findall (r"""^(\*) +([^: + ]+)::[^ + ]*?$|^@(include|menu|end menu|node|(?:unnumbered|appendix)(?:(?:sub){0,2}sec)?|top|chapter|(?:sub){0,2}section|(?:major|chap|(?:sub){0,2})heading) *([^@ + ]*)[^ + ]*?$""", texifile, re.M) + node_trigger = False + for item in tutu: + if item[0] == '*': + g.write ('* ' + item[1] + '::\n') + else: + g.write ('@' + item[2] + ' ' + item[3] + '\n') + if node_trigger: + g.write (n_blurb) + node_trigger = False + if not item[2] in ('include', 'menu', 'end menu'): + if output_file: + output_file.write ('_("' + item[3].strip () + '")\n') + node_trigger = True + elif item[2] == 'include': + includes.append(item[3]) + g.close () + elif output_file: + toto = re.findall (r"""^@(include|node|(?:unnumbered|appendix)(?:(?:sub){0,2}sec)?|top|chapter|(?:sub){0,2}section|(?:major|chap|(?:sub){0,2})heading) *([^@ + ]*)[^ + ]*?$""", texifile, re.M) + for item in toto: + if item[0] == 'include': + includes.append(item[1]) + else: + output_file.write ('_("' + item[1].strip () + '")\n') + if process_includes: + dir = os.path.dirname (texifilename) + for item in includes: + process_texi (os.path.join (dir, item.strip ()), i_blurb, n_blurb, write_skeleton, output_file) + except IOError, (errno, strerror): + print "I/O error(%s): %s: %s" % (errno, texifilename, strerror) + + +if intro_blurb != '': + intro_blurb += '\n\n' +if node_blurb != '': + node_blurb = '\n' + node_blurb + '\n\n' +if make_gettext: + node_list_filename = 'node_list' + node_list = open (node_list_filename, 'w') + for texi_file in texi_files: + process_texi (texi_file, intro_blurb, node_blurb, make_skeleton, node_list) + for word in ('Up:', 'Next:', 'Previous:', 'Appendix'): + node_list.write ('_("' + word + '")\n') + node_list.close () + os.system ('xgettext -L Python --no-location -o ' + output_file + ' ' + node_list_filename) +else: + for texi_file in texi_files: + process_texi (texi_file, intro_blurb, node_blurb, make_skeleton) diff --git a/flower/file-path.cc b/flower/file-path.cc index 63ecdb833a..31e7e993ef 100644 --- a/flower/file-path.cc +++ b/flower/file-path.cc @@ -9,8 +9,6 @@ #include "file-path.hh" -#include "std-string.hh" - #include #include diff --git a/flower/getopt-long.cc b/flower/getopt-long.cc index 17c1eafb7d..bb51a01863 100644 --- a/flower/getopt-long.cc +++ b/flower/getopt-long.cc @@ -12,7 +12,6 @@ #include "config.hh" #include "international.hh" -#include "std-string.hh" #if !HAVE_GETTEXT inline char * diff --git a/flower/include/file-cookie.hh b/flower/include/file-cookie.hh index ab163ea3eb..ab2558fd14 100644 --- a/flower/include/file-cookie.hh +++ b/flower/include/file-cookie.hh @@ -24,7 +24,8 @@ using namespace std; lily_cookie_io_functions_t io_funcs); int lily_cookie_fclose (void *); - int lily_cookie_fprintf (void *file, char const *format, ...); + int lily_cookie_fprintf (void *file, char const *format, ...) + __attribute__ ((format (printf, 2, 3))); int lily_cookie_putc (int c, void *file); #ifdef __cplusplus diff --git a/flower/include/interval.hh b/flower/include/interval.hh index 7b7d4f54e5..c485f32016 100644 --- a/flower/include/interval.hh +++ b/flower/include/interval.hh @@ -9,8 +9,6 @@ #include -#include "std-string.hh" - #include "flower-proto.hh" #include "drul-array.hh" diff --git a/flower/include/libc-extension.hh b/flower/include/libc-extension.hh index da4291604c..236b731d8a 100644 --- a/flower/include/libc-extension.hh +++ b/flower/include/libc-extension.hh @@ -37,6 +37,7 @@ double my_round (double); #if ! HAVE_SNPRINTF /* GNU extension. */ int snprintf (char *str, size_t n, char const *format, ...); + __attribute__ ((format (printf, 3, 4))); #endif #if ! HAVE_VSNPRINTF /* GNU extension. */ diff --git a/flower/include/string-convert.hh b/flower/include/string-convert.hh index 4717bfc49b..1277890929 100644 --- a/flower/include/string-convert.hh +++ b/flower/include/string-convert.hh @@ -9,7 +9,6 @@ #include using namespace std; -#include "std-string.hh" #include "flower-proto.hh" /** The functor string_convert handles all conversions to/from string @@ -31,7 +30,7 @@ public: static int dec2int (string dec_string); static double dec2double (string dec_string); static string double_string (double f, char const *fmt = 0); - static string form_string (char const *format, ...); + static string form_string (char const *format, ...) __attribute__ ((format (printf, 1,2))); static string vform_string (char const *format, va_list args); static int hex2int (string str); static unsigned hex2unsigned (string str); diff --git a/input/mutopia/W.A.Mozart/mozart-hrn-3.ly b/input/mutopia/W.A.Mozart/mozart-hrn-3.ly index 9f1ae8ab57..1e7960dd22 100644 --- a/input/mutopia/W.A.Mozart/mozart-hrn-3.ly +++ b/input/mutopia/W.A.Mozart/mozart-hrn-3.ly @@ -49,7 +49,6 @@ virtuoso that taught in Geneva. \include "mozart-hrn3-rondo.ily" \paper { - between-system-padding = 0.0 between-system-space = 20 \mm } diff --git a/input/no-notation/midi-drums.ly b/input/no-notation/midi-drums.ly new file mode 100644 index 0000000000..2b799be25b --- /dev/null +++ b/input/no-notation/midi-drums.ly @@ -0,0 +1,18 @@ + +\version "2.10.0" + +\version "2.10.1" + +\score { + \new DrumStaff << + \drummode { + bd4 sn4 bd4 sn4 + << + {\voiceOne \repeat unfold 16 hh16 } + \new DrumVoice { \voiceTwo bd4 sn4 bd4 sn4 } + >> \oneVoice + } + >> + \layout {} + \midi {} +} diff --git a/input/proportional.ly b/input/proportional.ly index a566324578..d5f68c70dc 100644 --- a/input/proportional.ly +++ b/input/proportional.ly @@ -28,7 +28,6 @@ \override Beam #'break-overshoot = #'(-0.5 . 1.0) \override TupletBracket #'break-overshoot = #'(-0.5 . 1.0) \override TupletBracket #'staff-padding = #3.5 - \override PaperColumn #'used = ##t } \context { % we want over print if necessary. diff --git a/input/regression/GNUmakefile b/input/regression/GNUmakefile index 15b634bccf..df3a19a13b 100644 --- a/input/regression/GNUmakefile +++ b/input/regression/GNUmakefile @@ -6,9 +6,3 @@ LOCALSTEPMAKE_TEMPLATES=lilypond ly lysdoc include $(depth)/make/stepmake.make TITLE=LilyPond Regression Tests -local-clean: local-delete - -# use `find` together with `xargs` to avoid too long argument-lists. -local-delete: - $(FIND) $(outdir)/ -empty -name '*' | xargs rm -f - diff --git a/input/regression/accidental-collision.ly b/input/regression/accidental-collision.ly new file mode 100644 index 0000000000..eeb03d5981 --- /dev/null +++ b/input/regression/accidental-collision.ly @@ -0,0 +1,10 @@ +\header { + texidoc = "accidentals avoid stems of other notes too." + } + +\version "2.10.1" + +\paper { + ragged-right = ##t + } +\new Staff \relative <> diff --git a/input/regression/bend-dot.ly b/input/regression/bend-dot.ly new file mode 100644 index 0000000000..4b55de5cd4 --- /dev/null +++ b/input/regression/bend-dot.ly @@ -0,0 +1,19 @@ +\version "2.11.2" +\header { + texidoc = "Bends avoid dots, but only if necessary." +} + +\score { + << + \new Staff \relative c' { + \time 4/4 + g''4.-\bendAfter #+1 + s8 s2 + f4.-\bendAfter #+1 + } + >> +} + +\paper { + ragged-right = ##t +} diff --git a/input/regression/collision-whole.ly b/input/regression/collision-whole.ly new file mode 100644 index 0000000000..3c818023c9 --- /dev/null +++ b/input/regression/collision-whole.ly @@ -0,0 +1,14 @@ +\version "2.10.1" + +\header { + texidoc = "Mixed collisions with whole notes require asymmetric shifts." +} + +\layout{ragged-right=##t} +\relative c'' { + << + { c1 c2 s2 c1 c4 s2. } + \\ + { c2 s2 c1 c4 s2. c1 } + >> +} diff --git a/input/regression/font-bogus-ligature.ly b/input/regression/font-bogus-ligature.ly new file mode 100644 index 0000000000..ec7399e374 --- /dev/null +++ b/input/regression/font-bogus-ligature.ly @@ -0,0 +1,16 @@ +\header +{ + texidoc = "TM and No should not be changed into trademark/number symbols. +This may happen with incorrect font versions. +" +} + +\version "2.10.0" + +\paper { + ragged-right = ##T +} + +{ + c4^"November WHITMAN" +} diff --git a/input/regression/markup-scheme.ly b/input/regression/markup-scheme.ly index 608ba694ae..e82b4b0ba3 100644 --- a/input/regression/markup-scheme.ly +++ b/input/regression/markup-scheme.ly @@ -43,8 +43,11 @@ For maintenance reasons, we don't excercise the entire markup command set. \combine "X" "+" \combine "o" "/" \box \column { \line { "string 1" } \line { "string 2" } } + " " \italic Norsk \super "2" + \circle \dynamic "p" + " " \dynamic sfzp \huge { "A" \smaller "A" \smaller \smaller "A" \smaller \smaller \smaller "A" } diff --git a/input/regression/markup-syntax.ly b/input/regression/markup-syntax.ly index 0dcb732ecc..5018c71849 100644 --- a/input/regression/markup-syntax.ly +++ b/input/regression/markup-syntax.ly @@ -1,33 +1,37 @@ -\header { - - texidoc = "Demo of markup texts, using LilyPond syntax. " +\version "2.10.0" +\header { + texidoc = "Demo of markup texts, using LilyPond syntax." } -\version "2.10.0" - { f'1-\markup { foo \raise #0.2 \hbracket \bold bar - \override #'(baseline-skip . 4) - \bracket \column { baz bazr bla } + \override #'(baseline-skip . 4) + \bracket \column { + baz + bazr + bla + } \hspace #2.0 \override #'(font-encoding . fetaMusic) { \lookup #"noteheads-0" } \semiflat - { } - - \combine "X" "+" + \combine "X" "+" \combine "o" "/" } g'1-\markup { % \char-number #"abc1234abc" - \box \column { \line { "string 1" } \line { "string 2" } } - " " + \box \column { + \line { "string 1" } + \line { "string 2" } + \concat { "f" "i" } + } + " " \draw-circle #1 #0.3 ##f " " \draw-circle #1 #0.3 ##t diff --git a/input/regression/quote-tuplet.ly b/input/regression/quote-tuplet.ly new file mode 100644 index 0000000000..0579d4fde6 --- /dev/null +++ b/input/regression/quote-tuplet.ly @@ -0,0 +1,31 @@ + +\version "2.10.0" + +\header { + + texidoc = "In cue notes, Tuplet stops are handled before new tuplets + start." + +} + +foo = \relative { + \times 2/3 { c4 c c } \times 2/3 { c4 c c } +} + +\addquote "foo" { \foo } + +\paper { + ragged-right = ##t +} + +\new Staff +<< + \new Voice \transpose c c' { + \override Stem #'direction = #UP + \foo + } + \new Voice { + \cueDuring #"foo" #DOWN { s1 } + } +>> + diff --git a/input/regression/skyline-vertical-placement.ly b/input/regression/skyline-vertical-placement.ly new file mode 100644 index 0000000000..6c85a39f2a --- /dev/null +++ b/input/regression/skyline-vertical-placement.ly @@ -0,0 +1,17 @@ +\header { + texidoc = "Grobs that have outside-staff-priority set are positioned +using a skyline algorithm so that they don't collide with other objects." +} + +\layout {ragged-right = ##t} + +\version "2.11.0" +\relative c''' { + \override TextScript #'outside-staff-priority = #1 + c + \once \override TextScript #'self-alignment-X = #CENTER + a,^"this doesn't collide with the c" + b^"this goes above the previous markup" + a8_"this goes below the dynamic" + a\f +} diff --git a/input/regression/skyline-vertical-spacing.ly b/input/regression/skyline-vertical-spacing.ly new file mode 100644 index 0000000000..6db0a16011 --- /dev/null +++ b/input/regression/skyline-vertical-spacing.ly @@ -0,0 +1,18 @@ +\header { + texidoc = "We use a skyline algorithm to determine the distance to the next +system instead of relying only on bounding boxes. This keeps gaps between +systems more uniform." +} + +\paper {ragged-right = ##t} +#(set-default-paper-size "a6") + +\version "2.11.0" +\book { + \score { + { + a,,1 | a'4 b' c'' d'' \break + \repeat unfold 2 {a' b' c'' d''} | b''''1 + } + } +} diff --git a/input/regression/spacing-horizontal-skyline.ly b/input/regression/spacing-horizontal-skyline.ly new file mode 100644 index 0000000000..554c17da3f --- /dev/null +++ b/input/regression/spacing-horizontal-skyline.ly @@ -0,0 +1,24 @@ + +\header { + + texidoc = "accidentals may be folded under preceding notes." + } +\version "2.11.1" + +\paper { + ragged-right = ##t + } + +\relative { + \stemUp c''4...*1/2 + + ceses,,! + eses! + ceses! + feses! + ceses! + geses'! + ceses,! + +} + diff --git a/input/regression/spacing-measure-length.ly b/input/regression/spacing-measure-length.ly new file mode 100644 index 0000000000..848f27870d --- /dev/null +++ b/input/regression/spacing-measure-length.ly @@ -0,0 +1,26 @@ +\header { + + texidoc = "Horizontal spacing is bounded by of the current measure length. +This means that the 3/8 setting does not affect the whole rest spacing." + +} + + +\version "2.11.1" + +\layout { + ragged-right = ##t +} + +\score { + \new Staff \with { + \remove Separating_line_group_engraver + } { + \relative c' { + \override Score.SpacingSpanner #'uniform-stretching = ##t + \set Score.proportionalNotationDuration = #(ly:make-moment 4 25) + r1 + \time 3/8 r4. + } + } +} diff --git a/input/regression/tablature-banjo.ly b/input/regression/tablature-banjo.ly new file mode 100644 index 0000000000..7e8dea3013 --- /dev/null +++ b/input/regression/tablature-banjo.ly @@ -0,0 +1,18 @@ +\version "2.10.0" + +\header +{ + texidoc = "Tablature may also be tuned for banjo." +} + +\new TabStaff << + \set TabStaff.tablatureFormat = #fret-number-tablature-format-banjo + \set TabStaff.stringTunings = #banjo-open-g-tuning + { + \stemDown + g8 d' g'\5 a b g e d' | + g4 d''8\5 b' a'\2 g'\5 e'\2 d' | + g4 + } +>> + diff --git a/input/regression/tablature-harmonic.ly b/input/regression/tablature-harmonic.ly new file mode 100644 index 0000000000..bc26540c37 --- /dev/null +++ b/input/regression/tablature-harmonic.ly @@ -0,0 +1,11 @@ +\version "2.10.0" +\header { + + texidoc = "Harmonics get angled brackets in tablature" + +} + +\new TabVoice +\relative c' { + +} diff --git a/input/regression/tie-broken-minimum-length.ly b/input/regression/tie-broken-minimum-length.ly new file mode 100644 index 0000000000..51f9708a3c --- /dev/null +++ b/input/regression/tie-broken-minimum-length.ly @@ -0,0 +1,20 @@ + +\version "2.11.0" + +\header { + + texidoc = " Broken ties honor @code{minimum-length} also. This tie +has a @code{minimum-length} of 5." + +} + +\relative { + \override Tie #'minimum-length = #5 + f2. f16 f f f ~ | \break + f1 +} + +\paper { + indent = 0.0\mm + line-width = 40.0\mm +} diff --git a/input/wilhelmus.ly b/input/wilhelmus.ly index 4ae2161c10..a6b00e404f 100644 --- a/input/wilhelmus.ly +++ b/input/wilhelmus.ly @@ -11,21 +11,6 @@ } %% hymn tricks -#(define (prepend-grob-property grob-name - grob-prop entry) - (lambda (context) - (let* - ((grob-def (ly:context-property context grob-name))) - (if (pair? grob-def) - (ly:context-pushpop-property context grob-name grob-prop - (cons - entry - (assoc-get grob-prop (car grob-def)))))))) - -#(define (set-extra-space grob-name entry value) - (prepend-grob-property grob-name 'space-alist - (cons entry (cons 'extra-space value)))) - noclefs = { s1 \override Staff.Clef #'break-visibility = @@ -33,17 +18,13 @@ noclefs = { } setMargins = { - %% first line left margin - %% justified: - %% \context Staff \applyContext #(set-extra-space 'TimeSignature 'first-note 4.5) - %% ragged-right: - \context Staff \applyContext #(set-extra-space 'TimeSignature 'first-note 9.5) - - %% next lines left margin - \context Staff \applyContext #(set-extra-space 'KeySignature 'staff-bar 15) + %% \context Staff \applyContext #(set-extra-space 'TimeSignature + %% 'first-note -> extra-space 4.5 + + \override Staff.TimeSignature #'space-alist #'first-note = #'(extra-space . 9.5) + \override Staff.KeySignature #'space-alist #'staff-bar = #'(extra-space . 15) + \override Score.LeftEdge #'space-alist #'key-signature = #'(extra-space . 1) - %% next lines small key-signature margin - \context Staff \applyContext #(set-extra-space 'LeftEdge 'key-signature 1.0) } pipeSymbol = { @@ -142,7 +123,10 @@ text = \lyricmode { oneHalfNoteTime = \markup { \override #'(baseline-skip . 0) - \column { \line { \number "1" } \line { \smaller \smaller \note #"2" #-0.5 } } + \column { + \line { \number "1" } + \line { \smaller \smaller \note #"2" #-0.6 } + } } \layout { @@ -175,6 +159,7 @@ oneHalfNoteTime = \markup { %% Custom time signature \override Staff.TimeSignature #'stencil = #ly:text-interface::print \override Staff.TimeSignature #'text = #oneHalfNoteTime + \override Staff.TimeSignature #'style = #'() \noclefs \new Voice = "voice" \voice diff --git a/lily/accidental-engraver.cc b/lily/accidental-engraver.cc index fc462faffa..9d671c11e6 100644 --- a/lily/accidental-engraver.cc +++ b/lily/accidental-engraver.cc @@ -9,7 +9,9 @@ #include "accidental-placement.hh" #include "arpeggio.hh" +#include "spanner.hh" #include "context.hh" +#include "item.hh" #include "engraver.hh" #include "international.hh" #include "pitch.hh" diff --git a/lily/accidental-placement.cc b/lily/accidental-placement.cc index c943c9cca4..6aaf49b2e6 100644 --- a/lily/accidental-placement.cc +++ b/lily/accidental-placement.cc @@ -9,12 +9,12 @@ #include "accidental-placement.hh" +#include "item.hh" #include "rhythmic-head.hh" #include "accidental-interface.hh" #include "music.hh" #include "note-collision.hh" #include "note-column.hh" -#include "pitch.hh" #include "pointer-group-interface.hh" #include "skyline.hh" #include "stream-event.hh" @@ -75,6 +75,24 @@ Accidental_placement::split_accidentals (Grob *accs, } } +vector +Accidental_placement::get_break_reminder_accidentals (vector const &elts, Grob *left) +{ + vector br; + vector ra; + vector ret; + + if (dynamic_cast (left)->break_status_dir () != RIGHT) + return vector (); + + for (vsize i = 0; i < elts.size (); i++) + { + split_accidentals (elts[i], &br, &ra); + ret.insert (ret.end (), br.begin (), br.end ()); + } + return ret; +} + /* Accidentals are special, because they appear and disappear after ties at will. @@ -302,7 +320,32 @@ Accidental_placement::calc_positioning_done (SCM smob) vector_sort (heads, less ()); uniq (heads); + + vector stems; + for (vsize i = 0; i < heads.size (); i++) + { + if (Grob *s = Rhythmic_head::get_stem (heads[i])) + stems.push_back (s); + } + + vector_sort (stems, less ()); + uniq (stems); + common[Y_AXIS] = common_refpoint_of_array (heads, common[Y_AXIS], Y_AXIS); + common[Y_AXIS] = common_refpoint_of_array (stems, common[Y_AXIS], Y_AXIS); + + for (vsize i = 0; i < heads.size (); i++) + { + if (Grob *s = Rhythmic_head::get_stem (heads[i])) + { + stems.push_back (s); + common[Y_AXIS] = s->common_refpoint (common[Y_AXIS], Y_AXIS); + } + } + + vector_sort (stems, less ()); + uniq (stems); + for (vsize i = apes.size (); i--;) { @@ -315,8 +358,8 @@ Accidental_placement::calc_positioning_done (SCM smob) ape->extents_.insert (ape->extents_.end (), boxes.begin (), boxes.end ()); } - ape->left_skyline_ = Skyline (ape->extents_, Y_AXIS, LEFT); - ape->right_skyline_ = Skyline (ape->extents_, Y_AXIS, RIGHT); + ape->left_skyline_ = Skyline (ape->extents_, 0, Y_AXIS, LEFT); + ape->right_skyline_ = Skyline (ape->extents_, 0, Y_AXIS, RIGHT); } Interval total; @@ -340,24 +383,15 @@ Accidental_placement::calc_positioning_done (SCM smob) head_extents.push_back (Box (heads[i]->extent (common[X_AXIS], X_AXIS), heads[i]->extent (common[Y_AXIS], Y_AXIS))); - vector stems; - for (vsize i = 0; i < heads.size (); i++) - { - if (Grob *s = Rhythmic_head::get_stem (heads[i])) - stems.push_back (s); - } - - vector_sort (stems, less ()); - uniq (stems); for (vsize i = 0; i < stems.size (); i ++) { int very_large = INT_MAX; - head_extents.push_back (Box (heads[i]->extent (common[X_AXIS], X_AXIS), - heads[i]->pure_height (common[Y_AXIS], 0, very_large))); + head_extents.push_back (Box (stems[i]->extent (common[X_AXIS], X_AXIS), + stems[i]->pure_height (common[Y_AXIS], 0, very_large))); } - head_ape->left_skyline_ = Skyline (head_extents, Y_AXIS, LEFT); + head_ape->left_skyline_ = Skyline (head_extents, 0, Y_AXIS, LEFT); head_ape->offset_ = 0.0; Real padding = robust_scm2double (me->get_property ("padding"), 0.2); @@ -415,7 +449,6 @@ Accidental_placement::calc_positioning_done (SCM smob) } ADD_INTERFACE (Accidental_placement, - "accidental-placement-interface", "Resolve accidental collisions.", /* properties */ diff --git a/lily/accidental.cc b/lily/accidental.cc index 0557883267..060c97849d 100644 --- a/lily/accidental.cc +++ b/lily/accidental.cc @@ -254,7 +254,7 @@ Accidental_interface::print (SCM smob) /* TODO: should move avoid-slur into item? */ -ADD_INTERFACE (Accidental_interface, "accidental-interface", +ADD_INTERFACE (Accidental_interface, "a single accidental", "accidentals " "avoid-slur " diff --git a/lily/align-interface.cc b/lily/align-interface.cc index 736ecb9096..2f23220c5a 100644 --- a/lily/align-interface.cc +++ b/lily/align-interface.cc @@ -123,28 +123,71 @@ Align_interface::align_to_fixed_distance (Grob *me, Axis a) v.unite (Interval (where, where)); } - /* - TODO: support self-alignment-{Y, X} - */ for (vsize i = 0; i < translates.size (); i++) elems[i]->translate_axis (translates[i] - v.center (), a); } -/* - Hairy function to put elements where they should be. Can be tweaked - from the outside by setting extra-space in its - children - - We assume that the children the refpoints of the children are still - found at 0.0 -- we will fuck up with thresholds if children's - extents are already moved to locations such as (-16, -8), since the - dy needed to put things in a row doesn't relate to the distances - between original refpoints. - - TODO: maybe we should rethink and throw out thresholding altogether. - The original function has been taken over by - align_to_fixed_distance (). -*/ +/* for each grob, find its upper and lower skylines. If the grob has + an empty extent, delete it from the list instead. If the extent is + non-empty but there is no skyline available (or pure is true), just + create a flat skyline from the bounding box */ +static void +get_skylines (Grob *me, + vector *const elements, + Axis a, + bool pure, int start, int end, + vector *const ret) +{ + Grob *other_axis_common = common_refpoint_of_array (*elements, me, other_axis (a)); + for (vsize i = elements->size (); i--;) + { + Grob *g = (*elements)[i]; + Interval extent = g->maybe_pure_extent (g, a, pure, start, end); + Interval other_extent = pure ? Interval (-infinity_f, infinity_f) + : g->extent (other_axis_common, other_axis (a)); + Box b = (a == X_AXIS) ? Box (extent, other_extent) : Box (other_extent, extent); + + if (extent.is_empty ()) + { + elements->erase (elements->begin () + i); + continue; + } + + Skyline_pair skylines; + if (!pure + && Skyline_pair::unsmob (g->get_property ("skylines"))) + skylines = *Skyline_pair::unsmob (g->get_property ("skylines")); + else + { + if (!pure) + programming_error ("no skylines for alignment-child\n"); + + skylines = Skyline_pair (b, 0, other_axis (a)); + } + + /* each skyline is calculated relative to (potentially) a different other_axis + coordinate. In order to compare the skylines effectively, we need to shift them + to some absolute reference point */ + if (!pure) + { + /* this is perhaps an abuse of minimum-?-extent: maybe we should create + another property? But it seems that the only (current) use of + minimum-Y-extent is to separate vertically-aligned elements */ + SCM min_extent = g->get_property (a == X_AXIS ? "minimum-X-extent" : "minimum-Y-extent"); + if (is_number_pair (min_extent)) + { + b[a] = ly_scm2interval (min_extent); + skylines.insert (b, 0, other_axis (a)); + } + Real offset = g->relative_coordinate (other_axis_common, other_axis (a)); + skylines.shift (-offset); + } + + + ret->push_back (skylines); + } + reverse (*ret); +} vector Align_interface::get_extents_aligned_translates (Grob *me, @@ -169,63 +212,29 @@ Align_interface::get_extents_aligned_translates (Grob *me, Direction stacking_dir = robust_scm2dir (me->get_property ("stacking-dir"), DOWN); - Interval threshold = robust_scm2interval (me->get_property ("threshold"), - Interval (0, Interval::infinity ())); + vector elems (all_grobs); // writable copy + vector skylines; - vector dims; - vector elems; + get_skylines (me, &elems, a, pure, start, end, &skylines); - for (vsize i = 0; i < all_grobs.size (); i++) - { - Interval y = all_grobs[i]->maybe_pure_extent (all_grobs[i], a, pure, start, end); - if (!y.is_empty ()) - { - Grob *e = dynamic_cast (all_grobs[i]); - - elems.push_back (e); - dims.push_back (y); - } - } - - /* - Read self-alignment-X and self-alignment-Y. This may seem like - code duplication. (and really: it is), but this is necessary to - prevent ugly cyclic dependencies that arise when you combine - self-alignment on a child with alignment of children. - */ - SCM align ((a == X_AXIS) - ? me->get_property ("self-alignment-X") - : me->get_property ("self-alignment-Y")); - - Interval total; Real where = 0; - Real extra_space = 0.0; SCM extra_space_handle = scm_assq (ly_symbol2scm ("alignment-extra-space"), line_break_details); + Real extra_space = robust_scm2double (scm_is_pair (extra_space_handle) + ? scm_cdr (extra_space_handle) + : SCM_EOL, + 0.0); - extra_space = robust_scm2double (scm_is_pair (extra_space_handle) - ? scm_cdr (extra_space_handle) - : SCM_EOL, - extra_space); - - Real padding = robust_scm2double (me->get_property ("padding"), - 0.0); + Real padding = robust_scm2double (me->get_property ("padding"), 0.0); vector translates; for (vsize j = 0; j < elems.size (); j++) { - Real dy = -dims[j][-stacking_dir]; - if (j) - dy += dims[j - 1][stacking_dir]; - - /* - we want dy to be > 0 - */ - dy *= stacking_dir; - if (j) - dy = min (max (dy, threshold[SMALLER]), threshold[BIGGER]); - + Real dy = 0; + if (j == 0) + dy = skylines[j][-stacking_dir].max_height (); + else + dy = skylines[j-1][stacking_dir].distance (skylines[j][-stacking_dir]); where += stacking_dir * (dy + padding + extra_space / elems.size ()); - total.unite (dims[j] + where); translates.push_back (where); } @@ -243,25 +252,16 @@ Align_interface::get_extents_aligned_translates (Grob *me, } } - - Real center_offset = 0.0; - - /* - also move the grobs that were empty, to maintain spatial order. - */ vector all_translates; - if (translates.size ()) + + if (!translates.empty ()) { Real w = translates[0]; - - if (scm_is_number (align)) - center_offset = total.linear_combination (scm_to_double (align)); - for (vsize i = 0, j = 0; j < all_grobs.size (); j++) { if (i < elems.size () && all_grobs[j] == elems[i]) w = translates[i++]; - all_translates.push_back (w - center_offset); + all_translates.push_back (w); } } return all_translates; @@ -367,7 +367,6 @@ find_fixed_alignment_parent (Grob *g) } ADD_INTERFACE (Align_interface, - "align-interface", "Order grobs from top to bottom, left to right, right to left or bottom " "to top. " @@ -389,9 +388,3 @@ ADD_INTERFACE (Align_interface, "stacking-dir " "threshold " ); - -struct Foobar -{ - bool has_interface (Grob *); -}; - diff --git a/lily/all-font-metrics.cc b/lily/all-font-metrics.cc index 4d95f9e6c1..bf2aadd4bb 100644 --- a/lily/all-font-metrics.cc +++ b/lily/all-font-metrics.cc @@ -15,6 +15,18 @@ #include "scm-hash.hh" #include "warn.hh" + +Index_to_charcode_map const * +All_font_metrics::get_index_to_charcode_map (string filename, FT_Face face) +{ + if (filename_charcode_maps_map_.find (filename) + == filename_charcode_maps_map_.end ()) + filename_charcode_maps_map_[filename] = make_index_to_charcode_map (face); + + return &filename_charcode_maps_map_[filename]; +} + + All_font_metrics::All_font_metrics (string path) { otf_dict_ = new Scheme_hash_table; @@ -166,6 +178,17 @@ All_font_metrics::find_font (string name) All_font_metrics *all_fonts_global; +LY_DEFINE (ly_reset_all_fonts, "ly:reset-all-fonts", 0, 0, 0, + (), + "Forget all about previously loaded fonts. ") +{ + delete all_fonts_global; + all_fonts_global = new All_font_metrics (global_path.to_string ()); + + return SCM_UNSPECIFIED; +} + + LY_DEFINE (ly_font_load, "ly:font-load", 1, 0, 0, (SCM name), "Load the font @var{name}. ") @@ -177,3 +200,4 @@ LY_DEFINE (ly_font_load, "ly:font-load", 1, 0, 0, return fm->self_scm (); } + diff --git a/lily/ambitus-engraver.cc b/lily/ambitus-engraver.cc index 2c606e878a..5946b91c6d 100644 --- a/lily/ambitus-engraver.cc +++ b/lily/ambitus-engraver.cc @@ -11,6 +11,7 @@ #include "engraver.hh" #include "axis-group-interface.hh" +#include "item.hh" #include "note-head.hh" #include "pitch-interval.hh" #include "pointer-group-interface.hh" diff --git a/lily/ambitus.cc b/lily/ambitus.cc index 2d88f61eae..1e6da083bc 100644 --- a/lily/ambitus.cc +++ b/lily/ambitus.cc @@ -68,7 +68,7 @@ Ambitus::print (SCM smob) return SCM_EOL; } -ADD_INTERFACE (Ambitus, "ambitus-interface", +ADD_INTERFACE (Ambitus , "The line between note heads for a pitch range.", /* props */ diff --git a/lily/arpeggio-engraver.cc b/lily/arpeggio-engraver.cc index a09810d90a..0086d121e7 100644 --- a/lily/arpeggio-engraver.cc +++ b/lily/arpeggio-engraver.cc @@ -15,6 +15,7 @@ #include "side-position-interface.hh" #include "stream-event.hh" #include "note-column.hh" +#include "item.hh" #include "translator.icc" diff --git a/lily/arpeggio.cc b/lily/arpeggio.cc index c3ed8a3939..d9e9e80636 100644 --- a/lily/arpeggio.cc +++ b/lily/arpeggio.cc @@ -8,6 +8,7 @@ #include "arpeggio.hh" +#include "grob.hh" #include "output-def.hh" #include "stem.hh" #include "staff-symbol-referencer.hh" @@ -57,8 +58,11 @@ Arpeggio::print (SCM smob) if (heads.is_empty () || heads.length () < 0.5) { - programming_error ("no heads for arpeggio found?"); - me->suicide (); + if (!to_boolean (me->get_property ("transparent"))) + { + me->warning ("no heads for arpeggio found?"); + me->suicide (); + } return SCM_EOL; } @@ -143,7 +147,7 @@ Arpeggio::width (SCM smob) return ly_interval2scm (arpeggio.extent (X_AXIS)); } -ADD_INTERFACE (Arpeggio, "arpeggio-interface", +ADD_INTERFACE (Arpeggio, "Functions and settings for drawing an arpeggio symbol (a wavy line left to noteheads.", /* properties */ diff --git a/lily/audio-staff.cc b/lily/audio-staff.cc index 5d402febf5..1616ceb3c8 100644 --- a/lily/audio-staff.cc +++ b/lily/audio-staff.cc @@ -18,6 +18,11 @@ Audio_staff::add_audio_item (Audio_item *l) audio_items_.push_back (l); } +Audio_staff::Audio_staff () +{ + channel_ = -1; +} + void Audio_staff::output (Midi_stream &midi_stream, int channel) { diff --git a/lily/auto-change-iterator.cc b/lily/auto-change-iterator.cc index ade8303e0d..a935bfc05a 100644 --- a/lily/auto-change-iterator.cc +++ b/lily/auto-change-iterator.cc @@ -9,6 +9,7 @@ #include "context.hh" #include "direction.hh" #include "international.hh" +#include "music.hh" #include "music-wrapper-iterator.hh" class Auto_change_iterator : public Music_wrapper_iterator diff --git a/lily/axis-group-interface.cc b/lily/axis-group-interface.cc index c7a5b8eff9..4319bb8b92 100644 --- a/lily/axis-group-interface.cc +++ b/lily/axis-group-interface.cc @@ -11,14 +11,12 @@ #include "align-interface.hh" #include "directional-element-interface.hh" #include "pointer-group-interface.hh" -#include "grob.hh" #include "grob-array.hh" #include "hara-kiri-group-spanner.hh" #include "international.hh" -#include "item.hh" #include "paper-column.hh" #include "paper-score.hh" -#include "std-vector.hh" +#include "separation-item.hh" #include "system.hh" #include "warn.hh" @@ -90,6 +88,8 @@ Axis_group_interface::cached_pure_height (Grob *me, if (end == r) end_index = i; } + if (end == INT_MAX) + end_index = breaks.size () - 1; if (start_index == VPOS || end_index == VPOS) { @@ -179,13 +179,54 @@ Axis_group_interface::pure_height (SCM smob, SCM start_scm, SCM end_scm) return pure_group_height (me, start, end); } + +MAKE_SCHEME_CALLBACK (Axis_group_interface, calc_skylines, 1); +SCM +Axis_group_interface::calc_skylines (SCM smob) +{ + Grob *me = unsmob_grob (smob); + extract_grob_set (me, "elements", elts); + return skyline_spacing (me, elts).smobbed_copy (); +} + +/* whereas calc_skylines calculates skylines for axis-groups with a lot of + visible children, combine_skylines is designed for axis-groups whose only + children are other axis-groups (ie. VerticalAlignment). Rather than + calculating all the skylines from scratch, we just merge the skylines + of the children. +*/ +MAKE_SCHEME_CALLBACK (Axis_group_interface, combine_skylines, 1); +SCM +Axis_group_interface::combine_skylines (SCM smob) +{ + Grob *me = unsmob_grob (smob); + extract_grob_set (me, "elements", elements); + Grob *y_common = common_refpoint_of_array (elements, me, Y_AXIS); + + assert (y_common == me); + + Skyline_pair ret; + for (vsize i = 0; i < elements.size (); i++) + { + SCM skyline_scm = elements[i]->get_property ("skylines"); + if (Skyline_pair::unsmob (skyline_scm)) + { + Real offset = elements[i]->relative_coordinate (y_common, Y_AXIS); + Skyline_pair other = *Skyline_pair::unsmob (skyline_scm); + other.raise (offset); + ret.merge (other); + } + } + return ret.smobbed_copy (); +} SCM Axis_group_interface::generic_group_extent (Grob *me, Axis a) { + /* trigger the callback to do skyline-spacing on the children */ + (void) me->get_property ("skylines"); + extract_grob_set (me, "elements", elts); - if (a == Y_AXIS && to_boolean (me->get_property ("skyline-spacing"))) - skyline_spacing (me, elts); Grob *common = common_refpoint_of_array (elts, me, a); Real my_coord = me->relative_coordinate (common, a); @@ -258,64 +299,142 @@ Axis_group_interface::get_children (Grob *me, vector *found) bool staff_priority_less (Grob * const &g1, Grob * const &g2) { - int priority_1 = robust_scm2int (g1->get_property ("outside-staff-priority"), INT_MIN); - int priority_2 = robust_scm2int (g2->get_property ("outside-staff-priority"), INT_MIN); + Real priority_1 = robust_scm2double (g1->get_property ("outside-staff-priority"), -infinity_f); + Real priority_2 = robust_scm2double (g2->get_property ("outside-staff-priority"), -infinity_f); if (priority_1 < priority_2) return true; else if (priority_1 > priority_2) return false; - /* if there is no preference in staff priority, choose the one with the lower rank */ - int rank_1 = g1->spanned_rank_iv ()[LEFT]; - int rank_2 = g2->spanned_rank_iv ()[LEFT]; - return rank_1 < rank_2; + /* if there is no preference in staff priority, choose the left-most one */ + Grob *common = g1->common_refpoint (g2, X_AXIS); + Real start_1 = g1->extent (common, X_AXIS)[LEFT]; + Real start_2 = g2->extent (common, X_AXIS)[LEFT]; + return start_1 < start_2; } -void +static void +add_boxes (Grob *me, Grob *x_common, Grob *y_common, vector *const boxes) +{ + /* if we are a parent, consider the children's boxes instead of mine */ + if (Grob_array *elements = unsmob_grob_array (me->get_object ("elements"))) + { + for (vsize i = 0; i < elements->size (); i++) + add_boxes (elements->grob (i), x_common, y_common, boxes); + } + else if (!scm_is_number (me->get_property ("outside-staff-priority"))) + boxes->push_back (Box (me->extent (x_common, X_AXIS), + me->extent (y_common, Y_AXIS))); +} + +/* We want to avoid situations like this: + still more text + more text + text + ------------------- + staff + ------------------- + + The point is that "still more text" should be positioned under + "more text". In order to achieve this, we place the grobs in several + passes. We keep track of the right-most horizontal position that has been + affected by the current pass so far (actually we keep track of 2 + positions, one for above the staff, one for below). + + In each pass, we loop through the unplaced grobs from left to right. + If the grob overlaps the right-most affected position, we place it + (and then update the right-most affected position to point to the right + edge of the just-placed grob). Otherwise, we skip it until the next pass. +*/ +static void +add_grobs_of_one_priority (Skyline_pair *const skylines, + vector elements, + Grob *x_common, + Grob *y_common) +{ + vector boxes; + Drul_array last_affected_position; + + reverse (elements); + while (!elements.empty ()) + { + last_affected_position[UP] = -infinity_f; + last_affected_position[DOWN] = -infinity_f; + /* do one pass */ + for (vsize i = elements.size (); i--;) + { + Direction dir = get_grob_direction (elements[i]); + if (dir == CENTER) + { + warning (_ ("an outside-staff object should have a direction, defaulting to up")); + dir = UP; + } + + Box b (elements[i]->extent (x_common, X_AXIS), + elements[i]->extent (y_common, Y_AXIS)); + SCM horizon_padding_scm = elements[i]->get_property ("outside-staff-horizontal-padding"); + Real horizon_padding = robust_scm2double (horizon_padding_scm, 0.0); + + if (b[X_AXIS][LEFT] - 2*horizon_padding < last_affected_position[dir]) + continue; + + if (b[X_AXIS].is_empty () || b[Y_AXIS].is_empty ()) + warning (_f ("outside-staff object %s has an empty extent", elements[i]->name ().c_str ())); + else + { + boxes.clear (); + boxes.push_back (b); + Skyline other = Skyline (boxes, horizon_padding, X_AXIS, -dir); + Real padding = robust_scm2double (elements[i]->get_property ("outside-staff-padding"), 0.5); + Real dist = (*skylines)[dir].distance (other) + padding; + + if (dist > 0) + { + b.translate (Offset (0, dir*dist)); + elements[i]->translate_axis (dir*dist, Y_AXIS); + } + (*skylines)[dir].insert (b, 0, X_AXIS); + elements[i]->set_property ("outside-staff-priority", SCM_BOOL_F); + last_affected_position[dir] = b[X_AXIS][RIGHT]; + } + elements.erase (elements.begin () + i); + } + } +} + +Skyline_pair Axis_group_interface::skyline_spacing (Grob *me, vector elements) { vector_sort (elements, staff_priority_less); Grob *x_common = common_refpoint_of_array (elements, me, X_AXIS); Grob *y_common = common_refpoint_of_array (elements, me, Y_AXIS); + assert (y_common == me); + vsize i = 0; vector boxes; for (i = 0; i < elements.size () && !scm_is_number (elements[i]->get_property ("outside-staff-priority")); i++) - boxes.push_back (Box (elements[i]->extent (x_common, X_AXIS), - elements[i]->extent (y_common, Y_AXIS))); - + add_boxes (elements[i], x_common, y_common, &boxes); - Drul_array skylines (Skyline (boxes, X_AXIS, DOWN), - Skyline (boxes, X_AXIS, UP)); + Skyline_pair skylines (boxes, 0, X_AXIS); for (; i < elements.size (); i++) { - Direction dir = get_grob_direction (elements[i]); - if (dir == CENTER) - { - warning (_ ("an outside-staff object should have a direction")); - continue; - } - - Box b (elements[i]->extent (x_common, X_AXIS), - elements[i]->extent (y_common, Y_AXIS)); - boxes.clear (); - boxes.push_back (b); - Skyline other = Skyline (boxes, X_AXIS, -dir); - Real dist = skylines[dir].distance (other); - - if (dist > 0) - { - b.translate (Offset (0, dir*dist)); - elements[i]->translate_axis (dir*dist, Y_AXIS); - } - skylines[dir].insert (b, X_AXIS); + SCM priority = elements[i]->get_property ("outside-staff-priority"); + vector current_elts; + current_elts.push_back (elements[i]); + while (i < elements.size () - 1 + && scm_eq_p (elements[i+1]->get_property ("outside-staff-priority"), priority)) + current_elts.push_back (elements[++i]); + + add_grobs_of_one_priority (&skylines, current_elts, x_common, y_common); } + return skylines; } -ADD_INTERFACE (Axis_group_interface, "axis-group-interface", +ADD_INTERFACE (Axis_group_interface, "An object that groups other layout objects.", @@ -324,6 +443,6 @@ ADD_INTERFACE (Axis_group_interface, "axis-group-interface", "elements " "common-refpoint-of-elements " "pure-relevant-elements " - "skyline-spacing " + "skylines " "cached-pure-extents " ); diff --git a/lily/balloon-engraver.cc b/lily/balloon-engraver.cc index 374d6913d8..9db33d90d1 100644 --- a/lily/balloon-engraver.cc +++ b/lily/balloon-engraver.cc @@ -9,7 +9,6 @@ #include "engraver.hh" - #include "stream-event.hh" #include "item.hh" diff --git a/lily/balloon.cc b/lily/balloon.cc index 03477d9ba4..065d61c159 100644 --- a/lily/balloon.cc +++ b/lily/balloon.cc @@ -19,7 +19,7 @@ class Balloon_interface { public: DECLARE_SCHEME_CALLBACK (print, (SCM)); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE (); }; MAKE_SCHEME_CALLBACK (Balloon_interface, print, 1); @@ -69,7 +69,7 @@ Balloon_interface::print (SCM smob) return fr.smobbed_copy (); } -ADD_INTERFACE (Balloon_interface, "text-balloon-interface", +ADD_INTERFACE (Balloon_interface, "A collection of routines to put text balloons around an object.", /* properties */ diff --git a/lily/bar-line.cc b/lily/bar-line.cc index 0a1c0d9fea..840a1de15d 100644 --- a/lily/bar-line.cc +++ b/lily/bar-line.cc @@ -239,7 +239,6 @@ Bar_line::dashed_bar_line (Grob *me, Real h, Real thick) ADD_INTERFACE (Bar_line, - "bar-line-interface", "Bar line.\n" "\n" diff --git a/lily/beam-concave.cc b/lily/beam-concave.cc index 47ee57bbf5..ee351d0a26 100644 --- a/lily/beam-concave.cc +++ b/lily/beam-concave.cc @@ -3,9 +3,9 @@ */ #include "pointer-group-interface.hh" -#include "std-vector.hh" #include "stem.hh" #include "beam.hh" +#include "grob.hh" #include "staff-symbol-referencer.hh" #include "directional-element-interface.hh" diff --git a/lily/beam-quanting.cc b/lily/beam-quanting.cc index e4cec84364..a0a1528597 100644 --- a/lily/beam-quanting.cc +++ b/lily/beam-quanting.cc @@ -12,6 +12,7 @@ #include using namespace std; +#include "grob.hh" #include "align-interface.hh" #include "international.hh" #include "output-def.hh" diff --git a/lily/beam.cc b/lily/beam.cc index 0778c58388..d020483352 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -1440,7 +1440,6 @@ Beam::get_direction_beam_count (Grob *me, Direction d) } ADD_INTERFACE (Beam, - "beam-interface", "A beam. \n\n" "The @code{thickness} property is the weight of beams, " diff --git a/lily/book.cc b/lily/book.cc index f307bcf3c3..44f7ee4ef9 100644 --- a/lily/book.cc +++ b/lily/book.cc @@ -13,12 +13,10 @@ using namespace std; #include "lilypond-key.hh" #include "main.hh" -#include "music-output.hh" #include "music.hh" #include "output-def.hh" #include "paper-book.hh" #include "score.hh" -#include "stencil.hh" #include "text-interface.hh" #include "warn.hh" #include "performance.hh" diff --git a/lily/break-align-engraver.cc b/lily/break-align-engraver.cc index 7a61987846..dcce285bdf 100644 --- a/lily/break-align-engraver.cc +++ b/lily/break-align-engraver.cc @@ -12,6 +12,7 @@ #include "axis-group-interface.hh" #include "context.hh" #include "translator-group.hh" +#include "item.hh" #include "translator.icc" @@ -111,7 +112,7 @@ Break_align_engraver::add_to_group (SCM align_name, Item *item) column_alist_ = scm_assoc_set_x (column_alist_, align_name, group->self_scm ()); - Break_align_interface::add_element (align_, group); + Break_alignment_interface::add_element (align_, group); } Axis_group_interface::add_element (group, item); } @@ -120,6 +121,8 @@ ADD_TRANSLATOR (Break_align_engraver, "Align grobs with corresponding @code{break-align-symbols} into " "groups, and order the groups according to @code{breakAlignOrder}. " "The left edge of the alignment gets a separate group, with a symbol @code{left-edge}. ", - /* create */ "BreakAlignment BreakAlignGroup LeftEdge", + /* create */ "BreakAlignment " + "BreakAlignGroup " + "LeftEdge ", /* read */ "", /* write */ ""); diff --git a/lily/break-align-interface.cc b/lily/break-align-interface.cc deleted file mode 100644 index f78ea4ef48..0000000000 --- a/lily/break-align-interface.cc +++ /dev/null @@ -1,360 +0,0 @@ -/* - break-align-interface.cc -- implement Break_align_interface - - source file of the GNU LilyPond music typesetter - - (c) 1997--2006 Han-Wen Nienhuys -*/ - - -#include "break-align-interface.hh" - -#include "align-interface.hh" -#include "axis-group-interface.hh" -#include "dimensions.hh" -#include "international.hh" -#include "output-def.hh" -#include "paper-column.hh" -#include "pointer-group-interface.hh" -#include "self-alignment-interface.hh" -#include "side-position-interface.hh" -#include "warn.hh" - - -MAKE_SCHEME_CALLBACK (Break_align_interface, self_align_callback, 1); -SCM -Break_align_interface::self_align_callback (SCM smob) -{ - Grob *me = unsmob_grob (smob); - - Item *item = dynamic_cast (me); - Direction bsd = item->break_status_dir (); - if (bsd == LEFT) - me->set_property ("self-alignment-X", scm_from_int (RIGHT)); - - /* - Force break alignment itself to be done first, in the case - */ - return Self_alignment_interface::aligned_on_self (me, X_AXIS); -} - -/* - This is tricky: we cannot modify 'elements, since callers are - iterating the same list. Reordering the list in-place, or resetting - 'elements will skip elements in the loops of callers. - - So we return the correct order as an array. -*/ -SCM -Break_align_interface::break_align_order (Item *me) -{ - SCM order_vec = me->get_property ("break-align-orders"); - if (!scm_is_vector (order_vec) - || scm_c_vector_length (order_vec) < 3) - return SCM_BOOL_F; - - SCM order = scm_vector_ref (order_vec, - scm_from_int (me->break_status_dir () + 1)); - - - return order; -} - - -vector -Break_align_interface::ordered_elements (Grob *grob) -{ - Item *me = dynamic_cast (grob); - extract_grob_set (me, "elements", elts); - - - SCM order = break_align_order (me); - - if (order == SCM_BOOL_F) - return elts; - - vector writable_elts (elts); - /* - Copy in order specified in BREAK-ALIGN-ORDER. - */ - vector new_elts; - for (; scm_is_pair (order); order = scm_cdr (order)) - { - SCM sym = scm_car (order); - - for (vsize i = writable_elts.size (); i--;) - { - Grob *g = writable_elts[i]; - if (g && sym == g->get_property ("break-align-symbol")) - { - new_elts.push_back (g); - writable_elts.erase (writable_elts.begin () + i); - } - } - } - - return new_elts; -} - -void -Break_align_interface::add_element (Grob *me, Grob *toadd) -{ - Align_interface::add_element (me, toadd); -} - -MAKE_SCHEME_CALLBACK(Break_align_interface, calc_positioning_done, 1) -SCM -Break_align_interface::calc_positioning_done (SCM smob) -{ - Grob *grob = unsmob_grob (smob); - Item *me = dynamic_cast (grob); - - vector elems = ordered_elements (me); - vector extents; - - int last_nonempty = -1; - for (vsize i = 0; i < elems.size (); i++) - { - Interval y = elems[i]->extent (elems[i], X_AXIS); - extents.push_back (y); - if (!y.is_empty ()) - last_nonempty = i; - } - - vsize idx = 0; - while (idx < extents.size () && extents[idx].is_empty ()) - idx++; - - vector offsets; - offsets.resize (elems.size ()); - for (vsize i = 0; i < offsets.size ();i++) - offsets[i] = 0.0; - - Real extra_right_space = 0.0; - vsize edge_idx = VPOS; - while (idx < elems.size ()) - { - vsize next_idx = idx + 1; - while (next_idx < elems.size () - && extents[next_idx].is_empty ()) - next_idx++; - - Grob *l = elems[idx]; - Grob *r = 0; - - if (next_idx < elems.size ()) - r = elems[next_idx]; - - SCM alist = SCM_EOL; - - /* - Find the first grob with a space-alist entry. - */ - extract_grob_set (l, "elements", elts); - - for (vsize i = elts.size (); i--;) - { - Grob *elt = elts[i]; - - if (edge_idx == VPOS - && (elt->get_property ("break-align-symbol") - == ly_symbol2scm ("left-edge"))) - edge_idx = idx; - - SCM l = elt->get_property ("space-alist"); - if (scm_is_pair (l)) - { - alist = l; - break; - } - } - - SCM rsym = r ? SCM_EOL : ly_symbol2scm ("right-edge"); - - /* - We used to use #'cause to find out the symbol and the spacing - table, but that gets icky when that grob is suicided for some - reason. - */ - if (r) - { - extract_grob_set (r, "elements", elts); - for (vsize i = elts.size (); - !scm_is_symbol (rsym) && i--;) - { - Grob *elt = elts[i]; - rsym = elt->get_property ("break-align-symbol"); - } - } - - if (rsym == ly_symbol2scm ("left-edge")) - edge_idx = next_idx; - - SCM entry = SCM_EOL; - if (scm_is_symbol (rsym)) - entry = scm_assq (rsym, alist); - - bool entry_found = scm_is_pair (entry); - if (!entry_found) - { - string sym_string; - if (scm_is_symbol (rsym)) - sym_string = ly_symbol2string (rsym); - - string orig_string; - if (unsmob_grob (l->get_property ("cause"))) - orig_string = unsmob_grob (l->get_property ("cause"))->name (); - - programming_error (_f ("No spacing entry from %s to `%s'", - orig_string.c_str (), - sym_string.c_str ())); - } - - Real distance = 1.0; - SCM type = ly_symbol2scm ("extra-space"); - - if (entry_found) - { - entry = scm_cdr (entry); - - distance = scm_to_double (scm_cdr (entry)); - type = scm_car (entry); - } - - if (r) - { - if (type == ly_symbol2scm ("extra-space")) - offsets[next_idx] = extents[idx][RIGHT] + distance - - extents[next_idx][LEFT]; - /* should probably junk minimum-space */ - else if (type == ly_symbol2scm ("minimum-space")) - offsets[next_idx] = max (extents[idx][RIGHT], distance); - } - else - { - extra_right_space = distance; - if (idx < offsets.size() - 1) - offsets[idx+1] = extents[idx][RIGHT] + distance; - } - - idx = next_idx; - } - - Real here = 0.0; - Interval total_extent; - - Real alignment_off = 0.0; - for (vsize i = 0; i < offsets.size (); i++) - { - here += offsets[i]; - if (i == edge_idx) - alignment_off = -here; - total_extent.unite (extents[i] + here); - } - - if (total_extent.is_empty ()) - return SCM_BOOL_T; - - if (me->break_status_dir () == LEFT) - alignment_off = -total_extent[RIGHT] - extra_right_space; - else if (edge_idx == VPOS) - alignment_off = -total_extent[LEFT]; - - here = alignment_off; - for (vsize i = 0; i < offsets.size (); i++) - { - here += offsets[i]; - elems[i]->translate_axis (here, X_AXIS); - } - - return SCM_BOOL_T; -} - -ADD_INTERFACE (Break_aligned_interface, "break-aligned-interface", - "Items that are aligned in prefatory matter.\n" - "\n" - "The spacing of these items is controlled by the @code{space-alist}\n" - "property. It contains a list @code{break-align-symbol}s with a specification\n" - "of the associated space. The space specification can be " - "@table @code\n" - "@item (minimum-space . @var{spc}))\n" - " Pad space until the distance is @var{spc}\n" - "@item (fixed-space . @var{spc})\n" - " Set a fixed space\n" - "@item (semi-fixed-space . @var{spc})\n" - " Set a space. Half of it is fixed and half is stretchable. \n" - "(does not work at start of line. fixme)\n" - "@item (extra-space . @var{spc})\n" - " Add @var{spc} amount of space.\n" - "@end table\n" - "\n" - "Special keys for the alist are @code{first-note} and @code{next-note}, signifying\n" - "the first note on a line, and the next note halfway a line.\n" - "\n" - "Rules for this spacing are much more complicated than this. \n" - "See [Wanske] page 126 -- 134, [Ross] pg 143 -- 147\n", - - /* properties */ - "break-align-symbol " - "space-alist " - ); - -ADD_INTERFACE (Break_align_interface, "break-alignment-interface", - "The object that performs break aligment. See @ref{break-aligned-interface}.", - - /* properties */ - "positioning-done " - "break-align-orders"); - - -MAKE_SCHEME_CALLBACK(Break_alignment_align_interface, self_align_callback, 1) -SCM -Break_alignment_align_interface::self_align_callback (SCM grob) -{ - Grob *me = unsmob_grob (grob); - Item *alignment = dynamic_cast (me->get_parent (X_AXIS)); - if (!Break_align_interface::has_interface (alignment)) - return scm_from_int (0); - - SCM my_align = me->get_property ("break-align-symbol"); - SCM order = Break_align_interface::break_align_order (alignment); - - vector elements = Break_align_interface::ordered_elements (alignment); - if (elements.size () == 0) - return scm_from_int (0); - - int last_idx_found = -1; - vsize i = 0; - for (SCM s = order; scm_is_pair (s); s = scm_cdr (s)) - { - if (i < elements.size () - && elements[i]->get_property ("break-align-symbol") == scm_car (s)) - { - last_idx_found = i; - i ++; - } - - if (scm_car (s) == my_align) - break ; - } - - Direction which_edge = LEFT; - if (vsize (last_idx_found + 1) < elements.size()) - last_idx_found ++; - else - which_edge = RIGHT; - - Grob *common = me->common_refpoint (elements[last_idx_found], X_AXIS); - - return scm_from_double (robust_relative_extent (elements[last_idx_found], common, X_AXIS)[which_edge] - - me->relative_coordinate (common, X_AXIS)); -} - -ADD_INTERFACE (Break_alignment_align_interface, "break-alignment-align-interface", - "Object that is aligned on a break aligment. ", - - /* properties */ - "break-align-symbol " - ) - - diff --git a/lily/break-alignment-interface.cc b/lily/break-alignment-interface.cc new file mode 100644 index 0000000000..37eae38297 --- /dev/null +++ b/lily/break-alignment-interface.cc @@ -0,0 +1,361 @@ +/* + break-align-interface.cc -- implement Break_alignment_interface + + source file of the GNU LilyPond music typesetter + + (c) 1997--2006 Han-Wen Nienhuys +*/ + + +#include "break-align-interface.hh" + +#include "align-interface.hh" +#include "axis-group-interface.hh" +#include "dimensions.hh" +#include "international.hh" +#include "output-def.hh" +#include "paper-column.hh" +#include "pointer-group-interface.hh" +#include "self-alignment-interface.hh" +#include "side-position-interface.hh" +#include "warn.hh" + + +MAKE_SCHEME_CALLBACK (Break_alignment_interface, self_align_callback, 1); +SCM +Break_alignment_interface::self_align_callback (SCM smob) +{ + Grob *me = unsmob_grob (smob); + + Item *item = dynamic_cast (me); + Direction bsd = item->break_status_dir (); + if (bsd == LEFT) + me->set_property ("self-alignment-X", scm_from_int (RIGHT)); + + /* + Force break alignment itself to be done first, in the case + */ + return Self_alignment_interface::aligned_on_self (me, X_AXIS); +} + +/* + This is tricky: we cannot modify 'elements, since callers are + iterating the same list. Reordering the list in-place, or resetting + 'elements will skip elements in the loops of callers. + + So we return the correct order as an array. +*/ +SCM +Break_alignment_interface::break_align_order (Item *me) +{ + SCM order_vec = me->get_property ("break-align-orders"); + if (!scm_is_vector (order_vec) + || scm_c_vector_length (order_vec) < 3) + return SCM_BOOL_F; + + SCM order = scm_vector_ref (order_vec, + scm_from_int (me->break_status_dir () + 1)); + + + return order; +} + + +vector +Break_alignment_interface::ordered_elements (Grob *grob) +{ + Item *me = dynamic_cast (grob); + extract_grob_set (me, "elements", elts); + + + SCM order = break_align_order (me); + + if (order == SCM_BOOL_F) + return elts; + + vector writable_elts (elts); + /* + Copy in order specified in BREAK-ALIGN-ORDER. + */ + vector new_elts; + for (; scm_is_pair (order); order = scm_cdr (order)) + { + SCM sym = scm_car (order); + + for (vsize i = writable_elts.size (); i--;) + { + Grob *g = writable_elts[i]; + if (g && sym == g->get_property ("break-align-symbol")) + { + new_elts.push_back (g); + writable_elts.erase (writable_elts.begin () + i); + } + } + } + + return new_elts; +} + +void +Break_alignment_interface::add_element (Grob *me, Grob *toadd) +{ + Align_interface::add_element (me, toadd); +} + +MAKE_SCHEME_CALLBACK(Break_alignment_interface, calc_positioning_done, 1) +SCM +Break_alignment_interface::calc_positioning_done (SCM smob) +{ + Grob *grob = unsmob_grob (smob); + Item *me = dynamic_cast (grob); + + vector elems = ordered_elements (me); + vector extents; + + int last_nonempty = -1; + for (vsize i = 0; i < elems.size (); i++) + { + Interval y = elems[i]->extent (elems[i], X_AXIS); + extents.push_back (y); + if (!y.is_empty ()) + last_nonempty = i; + } + + vsize idx = 0; + while (idx < extents.size () && extents[idx].is_empty ()) + idx++; + + vector offsets; + offsets.resize (elems.size ()); + for (vsize i = 0; i < offsets.size ();i++) + offsets[i] = 0.0; + + Real extra_right_space = 0.0; + vsize edge_idx = VPOS; + while (idx < elems.size ()) + { + vsize next_idx = idx + 1; + while (next_idx < elems.size () + && extents[next_idx].is_empty ()) + next_idx++; + + Grob *l = elems[idx]; + Grob *r = 0; + + if (next_idx < elems.size ()) + r = elems[next_idx]; + + SCM alist = SCM_EOL; + + /* + Find the first grob with a space-alist entry. + */ + extract_grob_set (l, "elements", elts); + + for (vsize i = elts.size (); i--;) + { + Grob *elt = elts[i]; + + if (edge_idx == VPOS + && (elt->get_property ("break-align-symbol") + == ly_symbol2scm ("left-edge"))) + edge_idx = idx; + + SCM l = elt->get_property ("space-alist"); + if (scm_is_pair (l)) + { + alist = l; + break; + } + } + + SCM rsym = r ? SCM_EOL : ly_symbol2scm ("right-edge"); + + /* + We used to use #'cause to find out the symbol and the spacing + table, but that gets icky when that grob is suicided for some + reason. + */ + if (r) + { + extract_grob_set (r, "elements", elts); + for (vsize i = elts.size (); + !scm_is_symbol (rsym) && i--;) + { + Grob *elt = elts[i]; + rsym = elt->get_property ("break-align-symbol"); + } + } + + if (rsym == ly_symbol2scm ("left-edge")) + edge_idx = next_idx; + + SCM entry = SCM_EOL; + if (scm_is_symbol (rsym)) + entry = scm_assq (rsym, alist); + + bool entry_found = scm_is_pair (entry); + if (!entry_found) + { + string sym_string; + if (scm_is_symbol (rsym)) + sym_string = ly_symbol2string (rsym); + + string orig_string; + if (unsmob_grob (l->get_property ("cause"))) + orig_string = unsmob_grob (l->get_property ("cause"))->name (); + + programming_error (_f ("No spacing entry from %s to `%s'", + orig_string.c_str (), + sym_string.c_str ())); + } + + Real distance = 1.0; + SCM type = ly_symbol2scm ("extra-space"); + + if (entry_found) + { + entry = scm_cdr (entry); + + distance = scm_to_double (scm_cdr (entry)); + type = scm_car (entry); + } + + if (r) + { + if (type == ly_symbol2scm ("extra-space")) + offsets[next_idx] = extents[idx][RIGHT] + distance + - extents[next_idx][LEFT]; + /* should probably junk minimum-space */ + else if (type == ly_symbol2scm ("minimum-space")) + offsets[next_idx] = max (extents[idx][RIGHT], distance); + } + else + { + extra_right_space = distance; + if (idx < offsets.size() - 1) + offsets[idx+1] = extents[idx][RIGHT] + distance; + } + + idx = next_idx; + } + + Real here = 0.0; + Interval total_extent; + + Real alignment_off = 0.0; + for (vsize i = 0; i < offsets.size (); i++) + { + here += offsets[i]; + if (i == edge_idx) + alignment_off = -here; + total_extent.unite (extents[i] + here); + } + + if (total_extent.is_empty ()) + return SCM_BOOL_T; + + if (me->break_status_dir () == LEFT) + alignment_off = -total_extent[RIGHT] - extra_right_space; + else if (edge_idx == VPOS) + alignment_off = -total_extent[LEFT]; + + here = alignment_off; + for (vsize i = 0; i < offsets.size (); i++) + { + here += offsets[i]; + elems[i]->translate_axis (here, X_AXIS); + } + + return SCM_BOOL_T; +} + + + +MAKE_SCHEME_CALLBACK(Break_alignable_interface, self_align_callback, 1) +SCM +Break_alignable_interface::self_align_callback (SCM grob) +{ + Grob *me = unsmob_grob (grob); + Item *alignment = dynamic_cast (me->get_parent (X_AXIS)); + if (!Break_alignment_interface::has_interface (alignment)) + return scm_from_int (0); + + SCM my_align = me->get_property ("break-align-symbol"); + SCM order = Break_alignment_interface::break_align_order (alignment); + + vector elements = Break_alignment_interface::ordered_elements (alignment); + if (elements.size () == 0) + return scm_from_int (0); + + int last_idx_found = -1; + vsize i = 0; + for (SCM s = order; scm_is_pair (s); s = scm_cdr (s)) + { + if (i < elements.size () + && elements[i]->get_property ("break-align-symbol") == scm_car (s)) + { + last_idx_found = i; + i ++; + } + + if (scm_car (s) == my_align) + break ; + } + + Direction which_edge = LEFT; + if (vsize (last_idx_found + 1) < elements.size()) + last_idx_found ++; + else + which_edge = RIGHT; + + Grob *common = me->common_refpoint (elements[last_idx_found], X_AXIS); + + return scm_from_double (robust_relative_extent (elements[last_idx_found], common, X_AXIS)[which_edge] + - me->relative_coordinate (common, X_AXIS)); +} + +ADD_INTERFACE (Break_alignable_interface, + "Object that is aligned on a break aligment. ", + + /* properties */ + "break-align-symbol " + ) + + + +ADD_INTERFACE (Break_aligned_interface, + "Items that are aligned in prefatory matter.\n" + "\n" + "The spacing of these items is controlled by the @code{space-alist}\n" + "property. It contains a list @code{break-align-symbol}s with a specification\n" + "of the associated space. The space specification can be " + "@table @code\n" + "@item (minimum-space . @var{spc}))\n" + " Pad space until the distance is @var{spc}\n" + "@item (fixed-space . @var{spc})\n" + " Set a fixed space\n" + "@item (semi-fixed-space . @var{spc})\n" + " Set a space. Half of it is fixed and half is stretchable. \n" + "(does not work at start of line. fixme)\n" + "@item (extra-space . @var{spc})\n" + " Add @var{spc} amount of space.\n" + "@end table\n" + "\n" + "Special keys for the alist are @code{first-note} and @code{next-note}, signifying\n" + "the first note on a line, and the next note halfway a line.\n" + "\n" + "Rules for this spacing are much more complicated than this. \n" + "See [Wanske] page 126 -- 134, [Ross] pg 143 -- 147\n", + + /* properties */ + "break-align-symbol " + "space-alist " + ); + +ADD_INTERFACE (Break_alignment_interface, + "The object that performs break aligment. See @ref{break-aligned-interface}.", + + /* properties */ + "positioning-done " + "break-align-orders"); diff --git a/lily/break-substitution.cc b/lily/break-substitution.cc index 20ae27b01f..4885c6ed72 100644 --- a/lily/break-substitution.cc +++ b/lily/break-substitution.cc @@ -10,9 +10,9 @@ #include using namespace std; -#include "grob-array.hh" #include "item.hh" #include "system.hh" +#include "grob-array.hh" static SCM break_criterion; void diff --git a/lily/breathing-sign.cc b/lily/breathing-sign.cc index f8d02996f4..d0acbcea05 100644 --- a/lily/breathing-sign.cc +++ b/lily/breathing-sign.cc @@ -20,6 +20,7 @@ #include "direction.hh" #include "text-interface.hh" #include "font-interface.hh" +#include "grob.hh" /* TODO: thickness should be a grob property (unit: linethickness) @@ -178,7 +179,7 @@ Breathing_sign::offset_callback (SCM smob) return scm_from_double (inter * sz * d); } -ADD_INTERFACE (Breathing_sign, "breathing-sign-interface", +ADD_INTERFACE (Breathing_sign, "A breathing sign.", "direction " diff --git a/lily/chord-name.cc b/lily/chord-name.cc index e929046db4..959898e3a7 100644 --- a/lily/chord-name.cc +++ b/lily/chord-name.cc @@ -32,7 +32,7 @@ Chord_name::after_line_breaking (SCM smob) return SCM_UNSPECIFIED; } -ADD_INTERFACE (Chord_name, "chord-name-interface", +ADD_INTERFACE (Chord_name, "A chord name.", diff --git a/lily/clef-engraver.cc b/lily/clef-engraver.cc index 78472dc99e..258b047397 100644 --- a/lily/clef-engraver.cc +++ b/lily/clef-engraver.cc @@ -11,6 +11,7 @@ #include using namespace std; +#include "item.hh" #include "context.hh" #include "bar-line.hh" #include "staff-symbol-referencer.hh" diff --git a/lily/clef.cc b/lily/clef.cc index 0718f8bd53..36427055f5 100644 --- a/lily/clef.cc +++ b/lily/clef.cc @@ -11,7 +11,6 @@ #include "font-interface.hh" #include "international.hh" #include "item.hh" -#include "std-string.hh" #include "stencil.hh" MAKE_SCHEME_CALLBACK (Clef, calc_glyph_name, 1); @@ -56,7 +55,7 @@ Clef::print (SCM smob) return out.smobbed_copy (); } -ADD_INTERFACE (Clef, "clef-interface", +ADD_INTERFACE (Clef, "A clef sign", /* properties */ diff --git a/lily/cluster-engraver.cc b/lily/cluster-engraver.cc index cd0c59b817..c1cb5a4025 100644 --- a/lily/cluster-engraver.cc +++ b/lily/cluster-engraver.cc @@ -13,6 +13,7 @@ #include "pointer-group-interface.hh" #include "pitch.hh" #include "stream-event.hh" +#include "item.hh" #include "translator.icc" diff --git a/lily/cluster.cc b/lily/cluster.cc index 27ef9dd08a..90c2adcf50 100644 --- a/lily/cluster.cc +++ b/lily/cluster.cc @@ -195,7 +195,7 @@ Cluster::print (SCM smob) return out.smobbed_copy (); } -ADD_INTERFACE (Cluster, "cluster-interface", +ADD_INTERFACE (Cluster, "A graphically drawn musical cluster. " "\n\n" "@code{padding} adds to the vertical extent of the shape (top and " @@ -211,7 +211,7 @@ struct Cluster_beacon { public: DECLARE_SCHEME_CALLBACK (height, (SCM)); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); }; MAKE_SCHEME_CALLBACK (Cluster_beacon, height, 1); @@ -225,7 +225,6 @@ Cluster_beacon::height (SCM g) } ADD_INTERFACE (Cluster_beacon, - "cluster-beacon-interface", "A place holder for the cluster spanner to determine the vertical " "extents of a cluster spanner at this X position.", diff --git a/lily/collision-engraver.cc b/lily/collision-engraver.cc index 7f56435e81..32dddc1d7a 100644 --- a/lily/collision-engraver.cc +++ b/lily/collision-engraver.cc @@ -10,6 +10,7 @@ #include "note-column.hh" #include "note-collision.hh" #include "axis-group-interface.hh" +#include "item.hh" class Collision_engraver : public Engraver { diff --git a/lily/constrained-breaking.cc b/lily/constrained-breaking.cc index 40d4c1177f..52ed127306 100644 --- a/lily/constrained-breaking.cc +++ b/lily/constrained-breaking.cc @@ -322,7 +322,7 @@ Constrained_breaking::initialize () Output_def *l = pscore_->layout (); System *sys = pscore_->root_system (); - Real padding = robust_scm2double (l->c_variable ("between-system-padding"), 0); + Real padding = robust_scm2double (l->c_variable ("page-breaking-between-system-padding"), 0); Real space = robust_scm2double (l->c_variable ("ideal-system-space"), 0); Interval first_line = line_dimensions_int (pscore_->layout (), 0); diff --git a/lily/context-property.cc b/lily/context-property.cc index 851bbe0a41..9496518a23 100644 --- a/lily/context-property.cc +++ b/lily/context-property.cc @@ -12,7 +12,6 @@ #include "international.hh" #include "item.hh" #include "main.hh" -#include "paper-column.hh" #include "simple-closure.hh" #include "spanner.hh" #include "warn.hh" diff --git a/lily/context-specced-music-iterator.cc b/lily/context-specced-music-iterator.cc index 86342a5eb4..59b3ba907c 100644 --- a/lily/context-specced-music-iterator.cc +++ b/lily/context-specced-music-iterator.cc @@ -9,6 +9,8 @@ #include "music-wrapper-iterator.hh" #include "context.hh" +#include "music.hh" + class Context_specced_music_iterator : public Music_wrapper_iterator { diff --git a/lily/custos.cc b/lily/custos.cc index 4e0010dcf6..7a3c09bbfa 100644 --- a/lily/custos.cc +++ b/lily/custos.cc @@ -81,7 +81,7 @@ Custos::print (SCM smob) return stencil.smobbed_copy (); } -ADD_INTERFACE (Custos, "custos-interface", +ADD_INTERFACE (Custos, "A custos object.", "style " "neutral-position " diff --git a/lily/dimension-cache.cc b/lily/dimension-cache.cc index ebf4ad93e2..1a98ab2a43 100644 --- a/lily/dimension-cache.cc +++ b/lily/dimension-cache.cc @@ -8,6 +8,7 @@ #include "dimension-cache.hh" + #include "warn.hh" #include "grob.hh" diff --git a/lily/directional-element-interface.cc b/lily/directional-element-interface.cc index 4c46118b1f..d828544977 100644 --- a/lily/directional-element-interface.cc +++ b/lily/directional-element-interface.cc @@ -8,6 +8,7 @@ #include "directional-element-interface.hh" #include "warn.hh" +#include "grob.hh" Direction get_grob_direction (Grob *me) diff --git a/lily/dispatcher.cc b/lily/dispatcher.cc index fb3df2a40f..6107594900 100644 --- a/lily/dispatcher.cc +++ b/lily/dispatcher.cc @@ -10,7 +10,6 @@ #include "input.hh" #include "international.hh" #include "ly-smobs.icc" -#include "stream-event.hh" #include "warn.hh" IMPLEMENT_SMOBS (Dispatcher); diff --git a/lily/dot-column-engraver.cc b/lily/dot-column-engraver.cc index 04a75241c6..ede002049f 100644 --- a/lily/dot-column-engraver.cc +++ b/lily/dot-column-engraver.cc @@ -11,6 +11,7 @@ #include "side-position-interface.hh" #include "engraver.hh" #include "translator.icc" +#include "item.hh" class Dot_column_engraver : public Engraver { diff --git a/lily/dot-column.cc b/lily/dot-column.cc index 4683c51cb5..a07dfcde11 100644 --- a/lily/dot-column.cc +++ b/lily/dot-column.cc @@ -21,6 +21,7 @@ using namespace std; #include "side-position-interface.hh" #include "axis-group-interface.hh" #include "stem.hh" +#include "grob.hh" #include "pointer-group-interface.hh" /* @@ -292,7 +293,6 @@ Dot_column::add_head (Grob *me, Grob *rh) } ADD_INTERFACE (Dot_column, - "dot-column-interface", "Groups dot objects so they form a column, and position dots so they do not " "clash with staff lines ", diff --git a/lily/dots.cc b/lily/dots.cc index f697752e35..afa82868a8 100644 --- a/lily/dots.cc +++ b/lily/dots.cc @@ -59,7 +59,7 @@ Dots::print (SCM d) return mol.smobbed_copy (); } -ADD_INTERFACE (Dots, "dots-interface", +ADD_INTERFACE (Dots, "The dots to go with a notehead or rest." "@code{direction} sets the preferred direction to move in case of staff " "line collisions.", diff --git a/lily/drum-note-engraver.cc b/lily/drum-note-engraver.cc index 5cdbbe8a4c..fc1b77a034 100644 --- a/lily/drum-note-engraver.cc +++ b/lily/drum-note-engraver.cc @@ -7,6 +7,7 @@ #include using namespace std; +#include "item.hh" #include "duration.hh" #include "engraver.hh" #include "note-column.hh" diff --git a/lily/drum-note-performer.cc b/lily/drum-note-performer.cc index 19ba7bbf90..7aa463b576 100644 --- a/lily/drum-note-performer.cc +++ b/lily/drum-note-performer.cc @@ -10,7 +10,6 @@ #include "audio-item.hh" #include "audio-column.hh" #include "global-context.hh" -#include "pitch.hh" #include "stream-event.hh" #include "translator.icc" #include "warn.hh" diff --git a/lily/dynamic-engraver.cc b/lily/dynamic-engraver.cc index 50cde13ea3..8f64db1136 100644 --- a/lily/dynamic-engraver.cc +++ b/lily/dynamic-engraver.cc @@ -23,6 +23,7 @@ #include "staff-symbol-referencer.hh" #include "stream-event.hh" #include "warn.hh" +#include "spanner.hh" #include "translator.icc" @@ -63,7 +64,6 @@ class Dynamic_engraver : public Engraver TRANSLATOR_DECLARATIONS (Dynamic_engraver); DECLARE_ACKNOWLEDGER (accidental); - DECLARE_ACKNOWLEDGER (script); DECLARE_ACKNOWLEDGER (stem_tremolo); DECLARE_ACKNOWLEDGER (note_column); DECLARE_ACKNOWLEDGER (slur); @@ -453,27 +453,7 @@ Dynamic_engraver::acknowledge_note_column (Grob_info info) finished_cresc_->set_bound (RIGHT, info.grob ()); } -void -Dynamic_engraver::acknowledge_script (Grob_info info) -{ - if (!line_spanner_ || !script_) - return; - - SCM p = info.grob ()->get_property ("script-priority"); - - /* - UGH. - - DynamicText doesn't really have a script-priority field. - */ - if (scm_is_number (p) - && scm_to_int (p) - < scm_to_int (script_->get_property ("script-priority"))) - Side_position_interface::add_support (line_spanner_, info.grob ()); -} - ADD_ACKNOWLEDGER (Dynamic_engraver, accidental); -ADD_ACKNOWLEDGER (Dynamic_engraver, script); ADD_ACKNOWLEDGER (Dynamic_engraver, note_column); ADD_ACKNOWLEDGER (Dynamic_engraver, slur); ADD_ACKNOWLEDGER (Dynamic_engraver, stem_tremolo); diff --git a/lily/dynamic-text-spanner.cc b/lily/dynamic-text-spanner.cc index 59eb1c3a58..ff6eac541e 100644 --- a/lily/dynamic-text-spanner.cc +++ b/lily/dynamic-text-spanner.cc @@ -22,7 +22,7 @@ class Dynamic_text_spanner { public: DECLARE_SCHEME_CALLBACK (print, (SCM)); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); }; /* @@ -154,7 +154,6 @@ Dynamic_text_spanner::print (SCM smob) } ADD_INTERFACE (Dynamic_text_spanner, - "dynamic-text-spanner-interface", "A text spanner for crescendo texts", "bound-padding " diff --git a/lily/easy-notation.cc b/lily/easy-notation.cc index 2fb0d72234..c6ecb0e20f 100644 --- a/lily/easy-notation.cc +++ b/lily/easy-notation.cc @@ -15,7 +15,6 @@ using namespace std; #include "grob.hh" #include "music.hh" #include "output-def.hh" -#include "pitch.hh" #include "staff-symbol-referencer.hh" #include "stem.hh" #include "stream-event.hh" diff --git a/lily/enclosing-bracket.cc b/lily/enclosing-bracket.cc index 81a292a2ec..60e98f0944 100644 --- a/lily/enclosing-bracket.cc +++ b/lily/enclosing-bracket.cc @@ -15,7 +15,7 @@ struct Enclosing_bracket { - static bool has_interface (Grob*); + DECLARE_GROB_INTERFACE(); public: DECLARE_SCHEME_CALLBACK(print, (SCM)); @@ -24,7 +24,6 @@ public: ADD_INTERFACE(Enclosing_bracket, - "enclosing-bracket-interface", "Brackets alongside bass figures.", diff --git a/lily/engraver-group.cc b/lily/engraver-group.cc index 525c1fa857..4c5a5864c3 100644 --- a/lily/engraver-group.cc +++ b/lily/engraver-group.cc @@ -11,7 +11,6 @@ #include "engraver-group.hh" #include "grob.hh" #include "paper-score.hh" -#include "stream-event.hh" #include "translator-dispatch-list.hh" #include "warn.hh" diff --git a/lily/engraver.cc b/lily/engraver.cc index b61850eb2f..c8eb805638 100644 --- a/lily/engraver.cc +++ b/lily/engraver.cc @@ -10,7 +10,6 @@ #include "context.hh" #include "international.hh" -#include "item.hh" #include "lilypond-key.hh" #include "music.hh" #include "paper-column.hh" diff --git a/lily/event-chord-iterator.cc b/lily/event-chord-iterator.cc index 89a0f383a9..ea1a105ea4 100644 --- a/lily/event-chord-iterator.cc +++ b/lily/event-chord-iterator.cc @@ -14,8 +14,6 @@ #include "input.hh" #include "international.hh" #include "music.hh" -#include "pitch.hh" -#include "stream-event.hh" #include "warn.hh" Event_chord_iterator::Event_chord_iterator () diff --git a/lily/event-iterator.cc b/lily/event-iterator.cc index 8e6d6df26d..9f3b353c50 100644 --- a/lily/event-iterator.cc +++ b/lily/event-iterator.cc @@ -13,7 +13,6 @@ #include "input.hh" #include "international.hh" #include "music.hh" -#include "pitch.hh" #include "warn.hh" Event_iterator::Event_iterator () diff --git a/lily/extender-engraver.cc b/lily/extender-engraver.cc index 3fb0d43033..efea867822 100644 --- a/lily/extender-engraver.cc +++ b/lily/extender-engraver.cc @@ -17,6 +17,7 @@ #include "pointer-group-interface.hh" #include "stream-event.hh" #include "warn.hh" +#include "spanner.hh" #include "translator.icc" diff --git a/lily/figured-bass-continuation.cc b/lily/figured-bass-continuation.cc index d6b6f2002b..0020b11e7f 100644 --- a/lily/figured-bass-continuation.cc +++ b/lily/figured-bass-continuation.cc @@ -8,7 +8,6 @@ */ #include "line-interface.hh" -#include "lily-guile.hh" #include "spanner.hh" #include "output-def.hh" #include "item.hh" @@ -21,7 +20,7 @@ struct Figured_bass_continuation { - static bool has_interface (Grob*); + DECLARE_GROB_INTERFACE(); public: DECLARE_SCHEME_CALLBACK(print, (SCM)); @@ -82,7 +81,6 @@ Figured_bass_continuation::print (SCM grob) } ADD_INTERFACE(Figured_bass_continuation, - "figured-bass-continuation-interface", "Simple extender line between bounds.", /* props */ diff --git a/lily/figured-bass-position-engraver.cc b/lily/figured-bass-position-engraver.cc index a1b97c99cb..caab84bf4a 100644 --- a/lily/figured-bass-position-engraver.cc +++ b/lily/figured-bass-position-engraver.cc @@ -11,6 +11,7 @@ #include "context.hh" #include "spanner.hh" +#include "item.hh" #include "side-position-interface.hh" #include "translator.icc" #include "axis-group-interface.hh" diff --git a/lily/fingering-engraver.cc b/lily/fingering-engraver.cc index 896913bbc2..b5f36ef79b 100644 --- a/lily/fingering-engraver.cc +++ b/lily/fingering-engraver.cc @@ -13,6 +13,7 @@ #include "side-position-interface.hh" #include "stem.hh" #include "stream-event.hh" +#include "item.hh" #include "translator.icc" diff --git a/lily/font-interface.cc b/lily/font-interface.cc index d620b31d21..482f91af7a 100644 --- a/lily/font-interface.cc +++ b/lily/font-interface.cc @@ -49,7 +49,7 @@ Font_interface::text_font_alist_chain (Grob *g) return g->get_property_alist_chain (defaults); } -ADD_INTERFACE (Font_interface, "font-interface", +ADD_INTERFACE (Font_interface, "Any symbol that is typeset through fixed sets of glyphs, " " (ie. fonts)", diff --git a/lily/font-metric-scheme.cc b/lily/font-metric-scheme.cc index 64d6f5c400..d04d1eab8a 100644 --- a/lily/font-metric-scheme.cc +++ b/lily/font-metric-scheme.cc @@ -6,9 +6,10 @@ (c) 2005--2006 Han-Wen Nienhuys */ +#include "font-metric.hh" + #include "warn.hh" #include "stencil.hh" -#include "font-metric.hh" #include "modified-font-metric.hh" LY_DEFINE (ly_font_get_glyph, "ly:font-get-glyph", diff --git a/lily/font-metric.cc b/lily/font-metric.cc index 7cfb8d749c..03625cc946 100644 --- a/lily/font-metric.cc +++ b/lily/font-metric.cc @@ -18,7 +18,6 @@ using namespace std; #include "modified-font-metric.hh" #include "open-type-font.hh" #include "stencil.hh" -#include "virtual-methods.hh" #include "warn.hh" #include "ly-smobs.icc" diff --git a/lily/forbid-break-engraver.cc b/lily/forbid-break-engraver.cc index 64dedf7358..c44bbb6012 100644 --- a/lily/forbid-break-engraver.cc +++ b/lily/forbid-break-engraver.cc @@ -10,7 +10,6 @@ #include "engraver.hh" #include "grob.hh" #include "input.hh" -#include "moment.hh" #include "pitch.hh" #include "rhythmic-head.hh" diff --git a/lily/general-scheme.cc b/lily/general-scheme.cc index 2ba1cb3b36..142e7c2bef 100644 --- a/lily/general-scheme.cc +++ b/lily/general-scheme.cc @@ -16,7 +16,6 @@ using namespace std; #include "international.hh" #include "libc-extension.hh" #include "lily-guile.hh" -#include "std-string.hh" #include "misc.hh" #include "warn.hh" #include "version.hh" @@ -326,7 +325,7 @@ LY_DEFINE(ly_hash_table_keys, "ly:hash-table-keys", LY_DEFINE (ly_camel_case_to_lisp_identifier, "ly:camel-case->lisp-identifier", 1, 0, 0, (SCM name_sym), - "Convert FooBar to foo-bar style symbol.") + "Convert FooBar_Bla to foo-bar-bla style symbol.") { SCM_ASSERT_TYPE(scm_is_symbol (name_sym), name_sym, SCM_ARG1, __FUNCTION__, "symbol"); @@ -336,19 +335,7 @@ LY_DEFINE (ly_camel_case_to_lisp_identifier, "ly:camel-case->lisp-identifier", */ const string in = ly_symbol2string (name_sym); - - vector out; - - /* don't add '-' before first character */ - out.push_back (tolower (in[0])); - - for (size_t inpos = 1; inpos < in.size (); inpos++) - { - if (isupper (in[inpos])) - out.push_back ('-'); - out.push_back (tolower (in[inpos])); - } + string result = camel_case_to_lisp_identifier (in); - string result (&out[0], out.size ()); return ly_symbol2scm (result.c_str ()); } diff --git a/lily/glissando-engraver.cc b/lily/glissando-engraver.cc index 91dd733cb8..4c506df38d 100644 --- a/lily/glissando-engraver.cc +++ b/lily/glissando-engraver.cc @@ -73,6 +73,7 @@ Glissando_engraver::stop_translation_timestep () { if (last_line_ && last_line_->get_bound (RIGHT)) last_line_ = 0; + if (line_) { if (last_line_) diff --git a/lily/global-context.cc b/lily/global-context.cc index 858922562f..6e0e1c4379 100644 --- a/lily/global-context.cc +++ b/lily/global-context.cc @@ -18,7 +18,6 @@ using namespace std; #include "music-iterator.hh" #include "music.hh" #include "output-def.hh" -#include "stream-event.hh" #include "warn.hh" Global_context::Global_context (Output_def *o, Object_key *key) diff --git a/lily/grace-music.cc b/lily/grace-music.cc index bf3e304f16..51ea066f1a 100644 --- a/lily/grace-music.cc +++ b/lily/grace-music.cc @@ -8,7 +8,6 @@ #include "music.hh" #include "music-wrapper.hh" -#include "moment.hh" class Grace_music { diff --git a/lily/gregorian-ligature.cc b/lily/gregorian-ligature.cc index 5047fa928b..fa790b368e 100644 --- a/lily/gregorian-ligature.cc +++ b/lily/gregorian-ligature.cc @@ -48,7 +48,7 @@ Gregorian_ligature::prefixes_to_str (Grob *primitive) subclass like VaticanaLigatureEngraver. The property is lateron read by the associated item class, such as VaticanaLigature.--jr */ -ADD_INTERFACE (Gregorian_ligature, "gregorian-ligature-interface", +ADD_INTERFACE (Gregorian_ligature, "A gregorian ligature", "virga stropha inclinatum auctum descendens ascendens " "oriscus quilisma deminutum cavum linea pes-or-flexa " diff --git a/lily/grid-line-interface.cc b/lily/grid-line-interface.cc index 49befddff8..f24f96829f 100644 --- a/lily/grid-line-interface.cc +++ b/lily/grid-line-interface.cc @@ -12,7 +12,6 @@ #include "pointer-group-interface.hh" #include "lookup.hh" #include "output-def.hh" -#include "stencil.hh" MAKE_SCHEME_CALLBACK (Grid_line_interface, print, 1); SCM @@ -68,10 +67,10 @@ Grid_line_interface::add_grid_point (Grob *me, Grob *b) Pointer_group_interface::add_grob (me, ly_symbol2scm ("elements"), b); } -ADD_INTERFACE (Grid_line_interface, "grid-line-interface", +ADD_INTERFACE (Grid_line_interface, "A line that spanned between grid-points. ", "elements thickness"); -ADD_INTERFACE (Grid_point_interface, "grid-point-interface", +ADD_INTERFACE (Grid_point_interface, "A spanning point for grid lines. ", ""); diff --git a/lily/grob-info.cc b/lily/grob-info.cc index 23ff736d95..62af8f3256 100644 --- a/lily/grob-info.cc +++ b/lily/grob-info.cc @@ -8,7 +8,6 @@ #include "context.hh" #include "grob-info.hh" -#include "grob.hh" #include "item.hh" #include "music.hh" #include "spanner.hh" diff --git a/lily/grob-interface.cc b/lily/grob-interface.cc index 9d52d4a56a..c47937db0f 100644 --- a/lily/grob-interface.cc +++ b/lily/grob-interface.cc @@ -11,18 +11,27 @@ #include "grob.hh" #include "international.hh" #include "protected-scm.hh" -#include "std-string.hh" +#include "string-convert.hh" #include "warn.hh" +#include "misc.hh" -void add_interface (char const *symbol, +SCM add_interface (char const *cxx_name, char const *descr, char const *vars) { - SCM s = ly_symbol2scm (symbol); + string suffix ("-interface"); + string lispy_name = camel_case_to_lisp_identifier (cxx_name); + vsize end = max (int (0), int (lispy_name.length () - suffix.length ())); + if (lispy_name.substr (end) != suffix) + lispy_name += suffix; + + SCM s = ly_symbol2scm (lispy_name.c_str ()); SCM d = scm_makfrom0str (descr); SCM l = parse_symbol_list (vars); ly_add_interface (s, d, l); + + return s; } void diff --git a/lily/grob-scheme.cc b/lily/grob-scheme.cc index b31447ffac..be431b7e10 100644 --- a/lily/grob-scheme.cc +++ b/lily/grob-scheme.cc @@ -7,15 +7,13 @@ Han-Wen Nienhuys */ -#include "grob.hh" - #include "warn.hh" // error() #include "item.hh" #include "output-def.hh" #include "system.hh" #include "font-interface.hh" #include "paper-score.hh" - +#include "grob-array.hh" LY_DEFINE (ly_grob_property_data, "ly:grob-property-data", 2, 0, 0, (SCM grob, SCM sym), diff --git a/lily/grob.cc b/lily/grob.cc index 1456a264ef..139a387989 100644 --- a/lily/grob.cc +++ b/lily/grob.cc @@ -309,13 +309,15 @@ Grob::pure_relative_y_coordinate (Grob const *refp, int start, int end) it probably means that the Alignment was fixed and it has already been calculated. */ - Grob *p = get_parent (Y_AXIS); - Real trans = 0; - if (Align_interface::has_interface (p) && !dim_cache_[Y_AXIS].offset_) - trans = Align_interface::get_pure_child_y_translation (p, this, start, end); + if (Grob *p = get_parent (Y_AXIS)) + { + Real trans = 0; + if (Align_interface::has_interface (p) && !dim_cache_[Y_AXIS].offset_) + trans = Align_interface::get_pure_child_y_translation (p, this, start, end); - return off + trans - + dim_cache_[Y_AXIS].parent_->pure_relative_y_coordinate (refp, start, end); + return off + trans + p->pure_relative_y_coordinate (refp, start, end); + } + return off; } /* Invoke callbacks to get offset relative to parent. */ @@ -566,7 +568,7 @@ Grob::programming_error (string s) const } -ADD_INTERFACE (Grob, "grob-interface", +ADD_INTERFACE (Grob, "A grob represents a piece of music notation\n" "\n" "All grobs have an X and Y-position on the page. These X and Y positions\n" @@ -621,6 +623,8 @@ ADD_INTERFACE (Grob, "grob-interface", "meta " "minimum-X-extent " "minimum-Y-extent " + "outside-staff-horizontal-padding " + "outside-staff-padding " "outside-staff-priority " "rotation " "springs-and-rods " diff --git a/lily/hairpin.cc b/lily/hairpin.cc index 891baf0e0c..e0916cd99d 100644 --- a/lily/hairpin.cc +++ b/lily/hairpin.cc @@ -251,7 +251,7 @@ Hairpin::print (SCM smob) return mol.smobbed_copy (); } -ADD_INTERFACE (Hairpin, "hairpin-interface", +ADD_INTERFACE (Hairpin, "A hairpin crescendo/decrescendo.", /* props */ diff --git a/lily/hara-kiri-group-spanner.cc b/lily/hara-kiri-group-spanner.cc index 1515e8fea2..90a06f145a 100644 --- a/lily/hara-kiri-group-spanner.cc +++ b/lily/hara-kiri-group-spanner.cc @@ -14,7 +14,6 @@ #include "axis-group-interface.hh" #include "spanner.hh" #include "warn.hh" -#include "item.hh" MAKE_SCHEME_CALLBACK (Hara_kiri_group_spanner, y_extent, 1); SCM @@ -153,7 +152,7 @@ Hara_kiri_group_spanner::add_interesting_item (Grob *me, Grob *n) Pointer_group_interface::add_unordered_grob (me, ly_symbol2scm ("items-worth-living"), n); } -ADD_INTERFACE (Hara_kiri_group_spanner, "hara-kiri-group-interface", +ADD_INTERFACE (Hara_kiri_group_spanner, "A group spanner that keeps track of interesting items. If it " "doesn't contain any after linebreaking, then it " "will remove itself and all its children.", diff --git a/lily/horizontal-bracket-engraver.cc b/lily/horizontal-bracket-engraver.cc index b0909c2689..57c368154a 100644 --- a/lily/horizontal-bracket-engraver.cc +++ b/lily/horizontal-bracket-engraver.cc @@ -13,6 +13,8 @@ #include "pointer-group-interface.hh" #include "side-position-interface.hh" #include "stream-event.hh" +#include "spanner.hh" +#include "item.hh" #include "translator.icc" diff --git a/lily/horizontal-bracket.cc b/lily/horizontal-bracket.cc index 00dd0b653f..d2b016b496 100644 --- a/lily/horizontal-bracket.cc +++ b/lily/horizontal-bracket.cc @@ -16,6 +16,8 @@ #include "staff-symbol-referencer.hh" #include "tuplet-bracket.hh" #include "axis-group-interface.hh" +#include "spanner.hh" +#include "item.hh" Stencil @@ -111,8 +113,6 @@ Horizontal_bracket::print (SCM smob) } ADD_INTERFACE (Horizontal_bracket, - - "horizontal-bracket-interface", "A horizontal bracket encompassing notes.", /* props */ diff --git a/lily/include/accidental-interface.hh b/lily/include/accidental-interface.hh index b9f4e7c83d..8fd57a5fd9 100644 --- a/lily/include/accidental-interface.hh +++ b/lily/include/accidental-interface.hh @@ -12,8 +12,8 @@ #include "std-vector.hh" #include "box.hh" -#include "lily-guile.hh" #include "lily-proto.hh" +#include "grob-interface.hh" class Accidental_interface { @@ -21,7 +21,7 @@ public: DECLARE_SCHEME_CALLBACK (print, (SCM)); DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM)); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); static string get_fontcharname (string style, int alteration); static vector accurate_boxes (Grob *me, Grob **common); diff --git a/lily/include/accidental-placement.hh b/lily/include/accidental-placement.hh index 43c33b8a9f..5d09bdc2df 100644 --- a/lily/include/accidental-placement.hh +++ b/lily/include/accidental-placement.hh @@ -9,7 +9,8 @@ #ifndef ACCIDENTAL_PLACEMENT_HH #define ACCIDENTAL_PLACEMENT_HH -#include "grob.hh" +#include "grob-interface.hh" +#include "lily-proto.hh" class Accidental_placement { @@ -17,6 +18,8 @@ public: DECLARE_SCHEME_CALLBACK (alignment_callback, (SCM element)); static void add_accidental (Grob *, Grob *); + static vector get_break_reminder_accidentals (vector const &elts, + Grob *left); static Interval get_relevant_accidental_extent (Grob *me, Item *item_col, Grob *acc); @@ -25,7 +28,7 @@ public: vector *real_acc); DECLARE_SCHEME_CALLBACK(calc_positioning_done, (SCM)); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); }; #endif /* ACCIDENTAL_PLACEMENT_HH */ diff --git a/lily/include/align-interface.hh b/lily/include/align-interface.hh index 273dbc660c..54005bd986 100644 --- a/lily/include/align-interface.hh +++ b/lily/include/align-interface.hh @@ -10,8 +10,8 @@ #define ALIGN_INTERFACE_HH #include "lily-proto.hh" -#include "lily-guile.hh" #include "std-vector.hh" +#include "grob-interface.hh" struct Align_interface { @@ -27,7 +27,7 @@ struct Align_interface static void add_element (Grob *, Grob *); static int get_count (Grob *, Grob *); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); static Real get_pure_child_y_translation (Grob *, Grob *child, int start, int end); }; diff --git a/lily/include/all-font-metrics.hh b/lily/include/all-font-metrics.hh index c8c0de2f0a..34a05e701f 100644 --- a/lily/include/all-font-metrics.hh +++ b/lily/include/all-font-metrics.hh @@ -18,7 +18,8 @@ #include #endif -/** + +/* Interface to all .afm files living in the filesystem. */ class All_font_metrics @@ -32,8 +33,13 @@ class All_font_metrics int pango_dpi_; #endif + map filename_charcode_maps_map_; + All_font_metrics (All_font_metrics const &); public: + + Index_to_charcode_map const *get_index_to_charcode_map (string filename, FT_Face face); + All_font_metrics (string search_path); ~All_font_metrics (); @@ -49,6 +55,7 @@ public: }; extern All_font_metrics *all_fonts_global; +SCM ly_reset_all_fonts (); #endif /* ALL_FONTS_HH */ diff --git a/lily/include/ambitus.hh b/lily/include/ambitus.hh index 7f0a2d40cf..d687e20be4 100644 --- a/lily/include/ambitus.hh +++ b/lily/include/ambitus.hh @@ -9,14 +9,13 @@ #ifndef AMBITUS_HH #define AMBITUS_HH -#include "lily-guile.hh" - -class Grob; +#include "lily-proto.hh" +#include "grob-interface.hh" struct Ambitus { DECLARE_SCHEME_CALLBACK (print, (SCM smob)); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); static Slice get_positions (Grob *); static Interval head_width (Grob *me, Grob *common); }; diff --git a/lily/include/arpeggio.hh b/lily/include/arpeggio.hh index 27f2d14dae..4d740dbc15 100644 --- a/lily/include/arpeggio.hh +++ b/lily/include/arpeggio.hh @@ -9,8 +9,9 @@ #ifndef ARPEGGIO_HH #define ARPEGGIO_HH -#include "lily-guile.hh" #include "lily-proto.hh" +#include "grob-interface.hh" + class Arpeggio { @@ -18,7 +19,7 @@ public: DECLARE_SCHEME_CALLBACK (print, (SCM)); DECLARE_SCHEME_CALLBACK (brew_chord_bracket, (SCM)); DECLARE_SCHEME_CALLBACK (width, (SCM)); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); }; #endif /* ARPEGGIO_HH */ diff --git a/lily/include/audio-staff.hh b/lily/include/audio-staff.hh index e20fc1c4d7..fa6e1b9429 100644 --- a/lily/include/audio-staff.hh +++ b/lily/include/audio-staff.hh @@ -16,6 +16,8 @@ struct Audio_staff : public Audio_element void add_audio_item (Audio_item *l); void output (Midi_stream &midi_stream_r, int track_i); + Audio_staff (); + vector audio_items_; int channel_; }; diff --git a/lily/include/axis-group-interface.hh b/lily/include/axis-group-interface.hh index b1bd975454..4272b1a890 100644 --- a/lily/include/axis-group-interface.hh +++ b/lily/include/axis-group-interface.hh @@ -11,10 +11,9 @@ #include "std-vector.hh" #include "lily-proto.hh" -#include "lily-guile.hh" +#include "grob-interface.hh" +#include "skyline.hh" -/** - */ struct Axis_group_interface { static SCM generic_group_extent (Grob *me, Axis a); @@ -22,6 +21,8 @@ struct Axis_group_interface DECLARE_SCHEME_CALLBACK (width, (SCM smob)); DECLARE_SCHEME_CALLBACK (height, (SCM smob)); DECLARE_SCHEME_CALLBACK (pure_height, (SCM smob, SCM start, SCM end)); + DECLARE_SCHEME_CALLBACK (calc_skylines, (SCM smob)); + DECLARE_SCHEME_CALLBACK (combine_skylines, (SCM smob)); static Interval relative_group_extent (vector const &list, Grob *common, Axis); static Interval relative_pure_height (Grob *me, vector const &list, @@ -30,12 +31,12 @@ struct Axis_group_interface static Interval cached_pure_height (Grob *me, vector const &list, Grob *common, int, int); - static void skyline_spacing (Grob *me, vector elements); + static Skyline_pair skyline_spacing (Grob *me, vector elements); static void add_element (Grob *me, Grob *); static void set_axes (Grob *, Axis, Axis); static bool has_axis (Grob *, Axis); static void get_children (Grob *, vector *); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); }; #endif /* AXIS_GROUP_INTERFACE_HH */ diff --git a/lily/include/bar-line.hh b/lily/include/bar-line.hh index 39253a7b8d..d7b51cbad9 100644 --- a/lily/include/bar-line.hh +++ b/lily/include/bar-line.hh @@ -7,16 +7,13 @@ #ifndef BAR_HH #define BAR_HH -#include "lily-guile.hh" #include "lily-proto.hh" +#include "grob-interface.hh" -/** - A vertical bar. -*/ class Bar_line { public: - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); static Stencil dashed_bar_line (Grob *me, Real h, Real thick); static Stencil compound_barline (Grob *, string, Real height, bool rounded); diff --git a/lily/include/bar.hh b/lily/include/bar.hh index b7ebca69a5..ee737a1beb 100644 --- a/lily/include/bar.hh +++ b/lily/include/bar.hh @@ -7,8 +7,8 @@ #ifndef BAR_HH #define BAR_HH -#include "lily-guile.hh" #include "lily-proto.hh" +#include "grob-interface.hh" /** A vertical bar. @@ -16,7 +16,7 @@ class Bar { public: - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); static Stencil compound_barline (Grob *, string, Real height); static Stencil simple_barline (Grob *, Real wid, Real height); diff --git a/lily/include/beam.hh b/lily/include/beam.hh index 71821f6629..9126bfbfec 100644 --- a/lily/include/beam.hh +++ b/lily/include/beam.hh @@ -10,9 +10,9 @@ #ifndef BEAM_HH #define BEAM_HH +#include "grob-interface.hh" #include "std-vector.hh" #include "lily-proto.hh" -#include "lily-guile.hh" #include "stem-info.hh" /* @@ -71,7 +71,7 @@ public: static int visible_stem_count (Grob *); static Grob *first_visible_stem (Grob *); static Grob *last_visible_stem (Grob *); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); static void add_stem (Grob *, Grob *); static bool is_knee (Grob *); static void set_beaming (Grob *, Beaming_pattern const *); diff --git a/lily/include/book.hh b/lily/include/book.hh index 5bdb47359c..03553138d5 100644 --- a/lily/include/book.hh +++ b/lily/include/book.hh @@ -9,11 +9,11 @@ #ifndef BOOK_HH #define BOOK_HH -#include "input.hh" #include "lily-proto.hh" #include "std-vector.hh" #include "object-key.hh" #include "std-string.hh" +#include "virtual-methods.hh" class Book { diff --git a/lily/include/break-align-interface.hh b/lily/include/break-align-interface.hh index 41972c83a5..421043b24c 100644 --- a/lily/include/break-align-interface.hh +++ b/lily/include/break-align-interface.hh @@ -1,5 +1,5 @@ /* - break-align-interface.hh -- declare Break_align_interface + break-align-interface.hh -- declare Break_alignment_interface source file of the GNU LilyPond music typesetter @@ -9,13 +9,14 @@ #ifndef BREAK_ALIGN_INTERFACE_HH #define BREAK_ALIGN_INTERFACE_HH -#include "item.hh" +#include "grob-interface.hh" +#include "lily-proto.hh" -class Break_align_interface +class Break_alignment_interface { public: static vector ordered_elements (Grob *me); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); static void add_element (Grob *me, Grob *add); static SCM break_align_order (Item *me); DECLARE_SCHEME_CALLBACK (calc_positioning_done, (SCM element)); @@ -24,13 +25,13 @@ public: struct Break_aligned_interface { - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); }; -struct Break_alignment_align_interface +struct Break_alignable_interface { DECLARE_SCHEME_CALLBACK (self_align_callback, (SCM element)); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); }; #endif // BREAK_ALIGN_INTERFACE_HH diff --git a/lily/include/breathing-sign.hh b/lily/include/breathing-sign.hh index 9093230a58..69d46e67a2 100644 --- a/lily/include/breathing-sign.hh +++ b/lily/include/breathing-sign.hh @@ -9,7 +9,8 @@ #ifndef BREATHING_SIGN_HH #define BREATHING_SIGN_HH -#include "lily-guile.hh" +#include "grob-interface.hh" +#include "lily-proto.hh" class Grob; @@ -28,7 +29,7 @@ public: DECLARE_SCHEME_CALLBACK (finalis, (SCM)); DECLARE_SCHEME_CALLBACK (offset_callback, (SCM element)); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); }; #endif // BREATHING_SIGN_HH diff --git a/lily/include/chord-name.hh b/lily/include/chord-name.hh index dc79a77a0b..f5c805684f 100644 --- a/lily/include/chord-name.hh +++ b/lily/include/chord-name.hh @@ -10,12 +10,13 @@ #define CHORD_NAME_HH #include "stencil.hh" +#include "grob-interface.hh" class Chord_name { public: DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM)); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); }; #endif // CHORD_NAME_HH diff --git a/lily/include/clef.hh b/lily/include/clef.hh index 2f78edb822..6595fc4687 100644 --- a/lily/include/clef.hh +++ b/lily/include/clef.hh @@ -9,14 +9,14 @@ #ifndef CLEF_HH #define CLEF_HH -#include "lily-guile.hh" #include "lily-proto.hh" +#include "grob-interface.hh" struct Clef { DECLARE_SCHEME_CALLBACK (calc_glyph_name, (SCM)); DECLARE_SCHEME_CALLBACK (print, (SCM)); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); }; #endif /* CLEF_HH */ diff --git a/lily/include/cluster.hh b/lily/include/cluster.hh index 6b6ad1dda0..75090102e6 100644 --- a/lily/include/cluster.hh +++ b/lily/include/cluster.hh @@ -10,14 +10,13 @@ #define CLUSTER_HH #include "stencil.hh" +#include "grob-interface.hh" class Cluster { public: DECLARE_SCHEME_CALLBACK (print, (SCM)); - // DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM)); - static bool has_interface (Grob *); - // DECLARE_SCHEME_CALLBACK (set_spacing_rods, (SCM )); + DECLARE_GROB_INTERFACE(); }; #endif // CLUSTER_HH diff --git a/lily/include/context-def.hh b/lily/include/context-def.hh index 5884ff128e..ac7b776208 100644 --- a/lily/include/context-def.hh +++ b/lily/include/context-def.hh @@ -13,6 +13,8 @@ #include "lily-proto.hh" #include "smobs.hh" #include "input.hh" +#include "virtual-methods.hh" + /* The definition of a interpretation context as given in the diff --git a/lily/include/context.hh b/lily/include/context.hh index 74058ad798..8eba283027 100644 --- a/lily/include/context.hh +++ b/lily/include/context.hh @@ -10,7 +10,6 @@ #define CONTEXT_HH #include "context-key-manager.hh" -#include "lily-proto.hh" #include "listener.hh" #include "moment.hh" #include "std-vector.hh" diff --git a/lily/include/custos.hh b/lily/include/custos.hh index c6a693404b..d1a26ab4a4 100644 --- a/lily/include/custos.hh +++ b/lily/include/custos.hh @@ -9,15 +9,13 @@ #ifndef CUSTOS_HH #define CUSTOS_HH -#include "lily-guile.hh" - -class Grob; -class Stencil; +#include "lily-proto.hh" +#include "grob-interface.hh" struct Custos { DECLARE_SCHEME_CALLBACK (print, (SCM)); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); private: static void add_streepjes (Grob *me, int pos, int interspaces, Stencil *custos_); diff --git a/lily/include/directional-element-interface.hh b/lily/include/directional-element-interface.hh index 9fff2486ad..7da0eae623 100644 --- a/lily/include/directional-element-interface.hh +++ b/lily/include/directional-element-interface.hh @@ -9,7 +9,8 @@ #ifndef DIRECTIONAL_ELEMENT_HH #define DIRECTIONAL_ELEMENT_HH -#include "grob.hh" +#include "lily-proto.hh" +#include "direction.hh" // what is the advantage not having these two as STATICs of GROB -- jcn void set_grob_direction (Grob *, Direction); diff --git a/lily/include/dot-column.hh b/lily/include/dot-column.hh index 63ad0d3f93..503b1425ae 100644 --- a/lily/include/dot-column.hh +++ b/lily/include/dot-column.hh @@ -9,7 +9,9 @@ #ifndef DOT_COLUMN_HH #define DOT_COLUMN_HH -#include "lily-guile.hh" +#include "lily-proto.hh" +#include "grob-interface.hh" + class Grob; @@ -22,7 +24,7 @@ public: static int compare (Grob *const &, Grob *const &); static void add_head (Grob *dotcol, Grob *rh); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); DECLARE_SCHEME_CALLBACK (side_position, (SCM)); DECLARE_SCHEME_CALLBACK (calc_positioning_done, (SCM)); }; diff --git a/lily/include/dots.hh b/lily/include/dots.hh index e62e7f13a5..df1d37289b 100644 --- a/lily/include/dots.hh +++ b/lily/include/dots.hh @@ -10,13 +10,13 @@ #define DOTS_HH #include "lily-proto.hh" -#include "lily-guile.hh" +#include "grob-interface.hh" class Dots { public: DECLARE_SCHEME_CALLBACK (print, (SCM)); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); }; #endif // DOTS_HH diff --git a/lily/include/font-interface.hh b/lily/include/font-interface.hh index c92692026d..cc68af60d7 100644 --- a/lily/include/font-interface.hh +++ b/lily/include/font-interface.hh @@ -10,13 +10,14 @@ #define FONT_INTERFACE_HH #include "font-metric.hh" +#include "grob-interface.hh" struct Font_interface { static SCM text_font_alist_chain (Grob *); static SCM music_font_alist_chain (Grob *); static Font_metric *get_default_font (Grob *); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); }; #endif /* FONT_INTERFACE_HH */ diff --git a/lily/include/font-metric.hh b/lily/include/font-metric.hh index dfcd1e8003..1107ba9af8 100644 --- a/lily/include/font-metric.hh +++ b/lily/include/font-metric.hh @@ -13,6 +13,12 @@ #include "lily-proto.hh" #include "smobs.hh" #include "virtual-methods.hh" +#include "freetype.hh" + +#include +using namespace std; + +typedef map Index_to_charcode_map; class Font_metric { diff --git a/lily/include/gregorian-ligature.hh b/lily/include/gregorian-ligature.hh index a6d8adc950..07b0ba11ef 100644 --- a/lily/include/gregorian-ligature.hh +++ b/lily/include/gregorian-ligature.hh @@ -11,11 +11,13 @@ class Grob; #include "std-string.hh" +#include "grob-interface.hh" + class Gregorian_ligature { public: - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); static string prefixes_to_str (Grob *); }; diff --git a/lily/include/grid-line-interface.hh b/lily/include/grid-line-interface.hh index fc789eea2e..abb02c9488 100644 --- a/lily/include/grid-line-interface.hh +++ b/lily/include/grid-line-interface.hh @@ -10,7 +10,8 @@ #define GRID_LINE_INTERFACE_HH #include "lily-proto.hh" -#include "lily-guile.hh" +#include "grob-interface.hh" + class Grid_line_interface { @@ -18,13 +19,13 @@ public: static void add_grid_point (Grob *me, Grob *b); DECLARE_SCHEME_CALLBACK (print, (SCM)); DECLARE_SCHEME_CALLBACK (width, (SCM)); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); }; class Grid_point_interface { public: - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); }; #endif /* GRID_LINE_INTERFACE_HH */ diff --git a/lily/include/grob-interface.hh b/lily/include/grob-interface.hh index e28716cb66..f6a92c0afe 100644 --- a/lily/include/grob-interface.hh +++ b/lily/include/grob-interface.hh @@ -11,18 +11,23 @@ #include "lily-guile.hh" -#define ADD_INTERFACE(cl, a, b, c) \ +#define DECLARE_GROB_INTERFACE() \ + static SCM interface_symbol_; \ + static bool has_interface (Grob*) + +#define ADD_INTERFACE(cl, b, c) \ + SCM cl::interface_symbol_; \ bool cl::has_interface (Grob *me) \ { \ - return me->internal_has_interface (ly_symbol2scm (a)); \ + return me->internal_has_interface (interface_symbol_); \ } \ void cl ## _init_ifaces () \ { \ - add_interface (a, b, c); \ + cl::interface_symbol_ = add_interface (#cl, b, c); \ } \ ADD_SCM_INIT_FUNC (cl ## ifaces, cl ## _init_ifaces); -void add_interface (char const *symbol, +SCM add_interface (char const *cxx_name, char const *descr, char const *vars); diff --git a/lily/include/grob.hh b/lily/include/grob.hh index 64fb7322a6..3a06afda20 100644 --- a/lily/include/grob.hh +++ b/lily/include/grob.hh @@ -110,7 +110,7 @@ public: /* interfaces */ bool internal_has_interface (SCM intf); - static bool has_interface (Grob *me); + DECLARE_GROB_INTERFACE(); /* offsets */ void translate_axis (Real, Axis); diff --git a/lily/include/hairpin.hh b/lily/include/hairpin.hh index 521fad1e4c..0d7c92ff23 100644 --- a/lily/include/hairpin.hh +++ b/lily/include/hairpin.hh @@ -9,18 +9,16 @@ #ifndef HAIRPIN_HH #define HAIRPIN_HH -#include "lily-guile.hh" +#include "grob-interface.hh" #include "lily-proto.hh" -/** - The hairpin symbol. -*/ + struct Hairpin { public: DECLARE_SCHEME_CALLBACK (print, (SCM)); DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM)); static void consider_suicide (Spanner*); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); }; #endif // HAIRPIN_HH diff --git a/lily/include/hara-kiri-group-spanner.hh b/lily/include/hara-kiri-group-spanner.hh index 0112b0864f..42692c7396 100644 --- a/lily/include/hara-kiri-group-spanner.hh +++ b/lily/include/hara-kiri-group-spanner.hh @@ -9,8 +9,8 @@ #ifndef HARA_KIRI_VERTICAL_GROUP_SPANNER_HH #define HARA_KIRI_VERTICAL_GROUP_SPANNER_HH -#include "lily-guile.hh" #include "lily-proto.hh" +#include "grob-interface.hh" class Hara_kiri_group_spanner { @@ -20,7 +20,7 @@ public: DECLARE_SCHEME_CALLBACK (pure_height, (SCM smob, SCM start, SCM end)); DECLARE_SCHEME_CALLBACK (force_hara_kiri_in_y_parent_callback, (SCM)); DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM)); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); static bool request_suicide (Grob *me, int start, int end); static void consider_suicide (Grob *me); static void add_interesting_item (Grob *me, Grob *n); diff --git a/lily/include/horizontal-bracket.hh b/lily/include/horizontal-bracket.hh index cb54b95a26..d8cbef6c06 100644 --- a/lily/include/horizontal-bracket.hh +++ b/lily/include/horizontal-bracket.hh @@ -9,9 +9,9 @@ #ifndef HORIZONTAL_BRACKET_HH #define HORIZONTAL_BRACKET_HH -#include "lily-guile.hh" #include "lily-proto.hh" #include "std-vector.hh" +#include "grob-interface.hh" struct Horizontal_bracket { @@ -20,7 +20,7 @@ struct Horizontal_bracket static Stencil make_enclosing_bracket (Grob *me, Grob *refpoint, vector grobs, Axis a, Direction dir); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); }; #endif /* HORIZONTAL_BRACKET_HH */ diff --git a/lily/include/input.hh b/lily/include/input.hh index 625910ea74..15f54aef22 100644 --- a/lily/include/input.hh +++ b/lily/include/input.hh @@ -10,7 +10,6 @@ #define INPUT_HH #include "flower-proto.hh" -#include "std-string.hh" /** Base class for anything that records its poisition in the parse file. @@ -53,8 +52,6 @@ public: }; - -#include "input.hh" #include "smobs.hh" SCM make_input (Input spot); diff --git a/lily/include/item.hh b/lily/include/item.hh index 7c28a35240..cb8c61523e 100644 --- a/lily/include/item.hh +++ b/lily/include/item.hh @@ -8,7 +8,6 @@ #ifndef ITEM_HH #define ITEM_HH -#include "box.hh" #include "grob.hh" /** @@ -40,7 +39,7 @@ public: virtual Paper_column *get_column () const; virtual void handle_prebroken_dependencies (); virtual Interval_t spanned_rank_iv (); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); protected: virtual void discretionary_processing (); void copy_breakable_items (); diff --git a/lily/include/lily-guile.hh b/lily/include/lily-guile.hh index 0f94e2ebbb..621849edc6 100644 --- a/lily/include/lily-guile.hh +++ b/lily/include/lily-guile.hh @@ -66,6 +66,7 @@ Interval robust_scm2interval (SCM, Drul_array); Offset robust_scm2offset (SCM, Offset); string robust_scm2string (SCM, string); + SCM ly_quote_scm (SCM s); bool type_check_assignment (SCM val, SCM sym, SCM type_symbol); string print_scm_val (SCM val); @@ -114,7 +115,9 @@ inline SCM ly_append4 (SCM x1, SCM x2, SCM x3, SCM x4) /* display and print newline. */ -void ly_display_scm (void *s); +extern "C" { + void ly_display_scm (SCM s); +} void read_lily_scm_file (string); void ly_c_init_guile (); @@ -193,4 +196,7 @@ ly_cxx_vector_to_list (vector const &src) } +SCM ly_offsets2scm (vector os); +vector ly_scm2offsets (SCM s); + #endif /* LILY_GUILE_HH */ diff --git a/lily/include/lily-lexer.hh b/lily/include/lily-lexer.hh index 543178ca25..994d185f6f 100644 --- a/lily/include/lily-lexer.hh +++ b/lily/include/lily-lexer.hh @@ -69,6 +69,7 @@ public: void start_main_input (); + SCM keyword_list () const; SCM lookup_identifier (string s); SCM lookup_identifier_symbol (SCM s); void push_extra_token (int token_type); diff --git a/lily/include/lily-parser.hh b/lily/include/lily-parser.hh index d4557e3688..b07734769a 100644 --- a/lily/include/lily-parser.hh +++ b/lily/include/lily-parser.hh @@ -11,7 +11,6 @@ #include "duration.hh" #include "input.hh" -#include "std-vector.hh" #include "pitch.hh" /** diff --git a/lily/include/lily-proto.hh b/lily/include/lily-proto.hh index 58e7cb4c84..c3082aaddd 100644 --- a/lily/include/lily-proto.hh +++ b/lily/include/lily-proto.hh @@ -150,6 +150,7 @@ class Simultaneous_music_iterator; class Skyline_entry; class Slur_configuration; class Slur_score_state; +class Spacing_options; class Span_score_bar_engraver; class Spanner; class Staff_group_bar_engraver; diff --git a/lily/include/lilypond-input-version.hh b/lily/include/lilypond-input-version.hh deleted file mode 100644 index 12c4782205..0000000000 --- a/lily/include/lilypond-input-version.hh +++ /dev/null @@ -1,30 +0,0 @@ -/* - lilypond-version.hh -- declare LilyPond_version - - source file of the GNU LilyPond music typesetter - - (c) 1998--2006 Jan Nieuwenhuizen -*/ - -#ifndef LILYPOND_VERSION_HH -#define LILYPOND_VERSION_HH - -#include "std-string.hh" - -struct Lilypond_version -{ - Lilypond_version (int major, int minor, int patch); - Lilypond_version (string str); - - string to_string () const; - operator int () const; - - int major_; - int minor_; - int patch_; - string extra_patch_string_; -}; - -extern Lilypond_version oldest_version; - -#endif // LILYPOND_VERSION_HH diff --git a/lily/include/lilypond-version.hh b/lily/include/lilypond-version.hh new file mode 100644 index 0000000000..12c4782205 --- /dev/null +++ b/lily/include/lilypond-version.hh @@ -0,0 +1,30 @@ +/* + lilypond-version.hh -- declare LilyPond_version + + source file of the GNU LilyPond music typesetter + + (c) 1998--2006 Jan Nieuwenhuizen +*/ + +#ifndef LILYPOND_VERSION_HH +#define LILYPOND_VERSION_HH + +#include "std-string.hh" + +struct Lilypond_version +{ + Lilypond_version (int major, int minor, int patch); + Lilypond_version (string str); + + string to_string () const; + operator int () const; + + int major_; + int minor_; + int patch_; + string extra_patch_string_; +}; + +extern Lilypond_version oldest_version; + +#endif // LILYPOND_VERSION_HH diff --git a/lily/include/line-interface.hh b/lily/include/line-interface.hh index 8b8bd6df90..ec33ce93c6 100644 --- a/lily/include/line-interface.hh +++ b/lily/include/line-interface.hh @@ -10,11 +10,12 @@ #define LINE_INTERFACE_HH #include "lily-proto.hh" +#include "grob-interface.hh" struct Line_interface { static Stencil line (Grob *me, Offset from, Offset to); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); static Stencil make_dashed_line (Real th, Offset from, Offset to, Real, Real); static Stencil make_line (Real th, Offset from, Offset to); static Stencil make_arrow (Offset beg, Offset end, Real thick, diff --git a/lily/include/line-spanner.hh b/lily/include/line-spanner.hh index be124f74e4..de1170b6b0 100644 --- a/lily/include/line-spanner.hh +++ b/lily/include/line-spanner.hh @@ -9,10 +9,8 @@ #ifndef LINE_SPANNER_HH #define LINE_SPANNER_HH -#include "lily-guile.hh" - -class Grob; -class Stencil; +#include "lily-proto.hh" +#include "grob-interface.hh" class Line_spanner { @@ -20,7 +18,7 @@ public: DECLARE_SCHEME_CALLBACK (print, (SCM)); DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM)); static Stencil line_stencil (Grob *me, Offset f, Offset t); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); private: static Offset get_broken_offset (Grob *me, Direction dir); diff --git a/lily/include/lyric-extender.hh b/lily/include/lyric-extender.hh index c4e4cf3479..4d891f8c14 100644 --- a/lily/include/lyric-extender.hh +++ b/lily/include/lyric-extender.hh @@ -8,7 +8,8 @@ #ifndef EXTENDER_SPANNER_HH #define EXTENDER_SPANNER_HH -#include "spanner.hh" +#include "grob-interface.hh" +#include "lily-proto.hh" /* Extenders must be entered manually for now. @@ -26,7 +27,7 @@ class Lyric_extender { public: - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); DECLARE_SCHEME_CALLBACK (print, (SCM)); }; diff --git a/lily/include/lyric-hyphen.hh b/lily/include/lyric-hyphen.hh index 00d87adda4..b5377ae82a 100644 --- a/lily/include/lyric-hyphen.hh +++ b/lily/include/lyric-hyphen.hh @@ -7,13 +7,14 @@ #ifndef HYPHEN_SPANNER_HH #define HYPHEN_SPANNER_HH -#include "spanner.hh" +#include "grob-interface.hh" +#include "lily-proto.hh" -struct Hyphen_spanner +struct Lyric_hyphen { public: DECLARE_SCHEME_CALLBACK (set_spacing_rods, (SCM)); - bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); DECLARE_SCHEME_CALLBACK (print, (SCM)); }; diff --git a/lily/include/measure-grouping-spanner.hh b/lily/include/measure-grouping-spanner.hh index 96612d1286..ef481714ee 100644 --- a/lily/include/measure-grouping-spanner.hh +++ b/lily/include/measure-grouping-spanner.hh @@ -9,14 +9,16 @@ #ifndef MEASURE_GROUPING_SPANNER_HH #define MEASURE_GROUPING_SPANNER_HH -#include "grob.hh" +#include "grob-interface.hh" +#include "lily-proto.hh" + class Measure_grouping { public: DECLARE_SCHEME_CALLBACK (print, (SCM)); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); }; #endif /* MEASURE_GROUPING_SPANNER_HH */ diff --git a/lily/include/melody-spanner.hh b/lily/include/melody-spanner.hh index 42762c0a6f..0b67613cfa 100644 --- a/lily/include/melody-spanner.hh +++ b/lily/include/melody-spanner.hh @@ -10,13 +10,13 @@ #ifndef MELODY_SPANNER_HH #define MELODY_SPANNER_HH -#include "lily-guile.hh" #include "lily-proto.hh" +#include "grob-interface.hh" class Melody_spanner { public: - static bool has_interface (Grob*); + DECLARE_GROB_INTERFACE(); static void add_stem (Grob*, Grob*); DECLARE_SCHEME_CALLBACK(calc_neutral_stem_direction, (SCM)); }; diff --git a/lily/include/mensural-ligature.hh b/lily/include/mensural-ligature.hh index bb51eaca88..afb04a2ef2 100644 --- a/lily/include/mensural-ligature.hh +++ b/lily/include/mensural-ligature.hh @@ -11,7 +11,8 @@ #define MENSURAL_LIGATURE_HH #include "lily-proto.hh" -#include "lily-guile.hh" +#include "grob-interface.hh" + /* * These are all possible mensural ligature primitives. @@ -32,7 +33,7 @@ struct Mensural_ligature { DECLARE_SCHEME_CALLBACK (brew_ligature_primitive, (SCM)); DECLARE_SCHEME_CALLBACK (print, (SCM)); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); }; #endif /* MENSURAL_LIGATURE_HH */ diff --git a/lily/include/misc.hh b/lily/include/misc.hh index 4303d3b7b5..fa7555d086 100644 --- a/lily/include/misc.hh +++ b/lily/include/misc.hh @@ -38,5 +38,7 @@ linear_interpolate (Real x, Real x1, Real x2, Real y1, Real y2) Real directed_round (Real f, Direction d); Real peak_around (Real epsilon, Real threshold, Real x); +string camel_case_to_lisp_identifier (string in); + #endif diff --git a/lily/include/multi-measure-rest.hh b/lily/include/multi-measure-rest.hh index b5ea6f5895..dd0d4054ae 100644 --- a/lily/include/multi-measure-rest.hh +++ b/lily/include/multi-measure-rest.hh @@ -9,13 +9,13 @@ #ifndef MULTI_MEASURE_REST_HH #define MULTI_MEASURE_REST_HH -#include "lily-guile.hh" +#include "grob-interface.hh" #include "rod.hh" class Multi_measure_rest { public: - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); DECLARE_SCHEME_CALLBACK (print, (SCM)); DECLARE_SCHEME_CALLBACK (percent, (SCM)); static void add_column (Grob *, Item *); diff --git a/lily/include/music-function.hh b/lily/include/music-function.hh index 1e9cbfe307..723472bd78 100644 --- a/lily/include/music-function.hh +++ b/lily/include/music-function.hh @@ -12,6 +12,8 @@ #include "lily-guile.hh" SCM ly_make_music_function (SCM, SCM); +SCM make_music_function (SCM, SCM); + SCM get_music_function_transform (SCM); bool is_music_function (SCM); diff --git a/lily/include/music-sequence.hh b/lily/include/music-sequence.hh index 9287bc6e2b..dc1046aaa8 100644 --- a/lily/include/music-sequence.hh +++ b/lily/include/music-sequence.hh @@ -9,7 +9,9 @@ #ifndef MUSIC_SEQUENCE_HH #define MUSIC_SEQUENCE_HH -#include "music.hh" +#include "pitch.hh" +#include "moment.hh" +#include "lily-guile.hh" struct Music_sequence { diff --git a/lily/include/music-wrapper-iterator.hh b/lily/include/music-wrapper-iterator.hh index d249428654..ca118be037 100644 --- a/lily/include/music-wrapper-iterator.hh +++ b/lily/include/music-wrapper-iterator.hh @@ -9,7 +9,6 @@ #ifndef MUSIC_WRAPPER_ITERATOR_HH #define MUSIC_WRAPPER_ITERATOR_HH -#include "music.hh" #include "music-iterator.hh" /** diff --git a/lily/include/music.hh b/lily/include/music.hh index 223764bb14..f7e4407f3b 100644 --- a/lily/include/music.hh +++ b/lily/include/music.hh @@ -9,7 +9,6 @@ #ifndef MUSIC_HH #define MUSIC_HH -#include "virtual-methods.hh" #include "smobs.hh" #include "moment.hh" #include "pitch.hh" diff --git a/lily/include/note-collision.hh b/lily/include/note-collision.hh index 11f578ce81..7500ea45e9 100644 --- a/lily/include/note-collision.hh +++ b/lily/include/note-collision.hh @@ -9,9 +9,10 @@ #ifndef COLLISION_HH #define COLLISION_HH -#include "lily-proto.hh" -#include "lily-guile.hh" #include "std-vector.hh" +#include "grob-interface.hh" +#include "lily-proto.hh" + /** Resolve conflicts between various Note_columns (chords). @@ -32,6 +33,6 @@ public: static Drul_array > get_clash_groups (Grob *me); DECLARE_SCHEME_CALLBACK (calc_positioning_done, (SCM smob)); static void add_column (Grob *me, Grob *ncol); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); }; #endif // COLLISION_HH diff --git a/lily/include/note-column.hh b/lily/include/note-column.hh index ec12414539..73030a46d9 100644 --- a/lily/include/note-column.hh +++ b/lily/include/note-column.hh @@ -9,7 +9,9 @@ #ifndef NOTE_COLUMN_HH #define NOTE_COLUMN_HH -#include "item.hh" +#include "grob-interface.hh" +#include "lily-proto.hh" + /** a struct for treating a group of noteheads (noteheads, stem (chord) and scripts) as a single entity. @@ -32,7 +34,7 @@ public: static void set_dotcol (Grob *me, Grob *); static void add_head (Grob *me, Grob *); static bool has_rests (Grob *me); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); static Item *get_stem (Grob *); }; diff --git a/lily/include/note-head.hh b/lily/include/note-head.hh index 55b1107f9f..ff4e9a848a 100644 --- a/lily/include/note-head.hh +++ b/lily/include/note-head.hh @@ -8,6 +8,7 @@ #define NOTEHEAD_HH #include "stencil.hh" +#include "grob-interface.hh" /** ball at the end of the stem. Also takes care of ledger lines. @@ -23,7 +24,7 @@ public: DECLARE_SCHEME_CALLBACK (brew_ez_stencil, (SCM)); DECLARE_SCHEME_CALLBACK (stem_x_shift, (SCM)); DECLARE_SCHEME_CALLBACK (calc_stem_attachment, (SCM)); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); static Real stem_attachment_coordinate (Grob *, Axis a); static int get_balltype (Grob *); diff --git a/lily/include/note-spacing.hh b/lily/include/note-spacing.hh index cd786f8de1..dc8cbe4e02 100644 --- a/lily/include/note-spacing.hh +++ b/lily/include/note-spacing.hh @@ -9,12 +9,13 @@ #ifndef NOTE_SPACING_HH #define NOTE_SPACING_HH +#include "grob-interface.hh" #include "lily-proto.hh" class Note_spacing { public: - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); static void get_spacing (Grob *me, Item *, Real, Real, Real *, Real *); static void stem_dir_correction (Grob *me, Item *next_col, Real incr, diff --git a/lily/include/open-type-font.hh b/lily/include/open-type-font.hh index c0490be6e5..9cd34497ab 100644 --- a/lily/include/open-type-font.hh +++ b/lily/include/open-type-font.hh @@ -9,13 +9,9 @@ #ifndef OPEN_TYPE_FONT_HH #define OPEN_TYPE_FONT_HH -#include -using namespace std; -#include "freetype.hh" #include "font-metric.hh" -typedef map Index_to_charcode_map; Index_to_charcode_map make_index_to_charcode_map (FT_Face face); void get_unicode_name (char*s, FT_ULong code); void get_glyph_index_name (char*s, FT_ULong code); @@ -58,4 +54,5 @@ public: string get_otf_table (FT_Face face, string tag); FT_Face open_ft_face (string str); + #endif /* OPEN_TYPE_FONT_HH */ diff --git a/lily/include/output-def.hh b/lily/include/output-def.hh index 8670be67fb..6a6165037e 100644 --- a/lily/include/output-def.hh +++ b/lily/include/output-def.hh @@ -9,7 +9,6 @@ #ifndef MUSIC_OUTPUT_DEF_HH #define MUSIC_OUTPUT_DEF_HH -#include "std-string.hh" #include "lily-proto.hh" #include "virtual-methods.hh" #include "smobs.hh" diff --git a/lily/include/page-breaking.hh b/lily/include/page-breaking.hh index 548100ca8b..7c2a99e381 100644 --- a/lily/include/page-breaking.hh +++ b/lily/include/page-breaking.hh @@ -11,7 +11,6 @@ #define PAGE_BREAKING_HH #include "constrained-breaking.hh" -#include "lily-guile.hh" /* Either a paper-score, markup or header. */ diff --git a/lily/include/page-turn-page-breaking.hh b/lily/include/page-turn-page-breaking.hh index 6fb78bc67d..a109f1ff8f 100644 --- a/lily/include/page-turn-page-breaking.hh +++ b/lily/include/page-turn-page-breaking.hh @@ -11,9 +11,7 @@ #ifndef PAGE_TURN_PAGE_BREAKING_HH #define PAGE_TURN_PAGE_BREAKING_HH -#include "constrained-breaking.hh" #include "page-breaking.hh" -#include "lily-guile.hh" /* A dynamic programming solution to breaking pages diff --git a/lily/include/pango-font.hh b/lily/include/pango-font.hh index 5449ec0a42..76b4d6c8eb 100644 --- a/lily/include/pango-font.hh +++ b/lily/include/pango-font.hh @@ -15,9 +15,8 @@ #include #include -#include "font-metric.hh" -#include "open-type-font.hh" +#include "font-metric.hh" class Pango_font : public Font_metric { diff --git a/lily/include/paper-column.hh b/lily/include/paper-column.hh index 6adbdbe179..be6ab9378d 100644 --- a/lily/include/paper-column.hh +++ b/lily/include/paper-column.hh @@ -42,8 +42,8 @@ public: DECLARE_SCHEME_CALLBACK (print, (SCM)); DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM)); - static bool has_interface (Grob *); - static int get_rank (Grob *); + DECLARE_GROB_INTERFACE(); + static int get_rank (Grob const *); static bool is_musical (Grob *); static Moment when_mom (Grob *); static bool is_used (Grob *); diff --git a/lily/include/percent-repeat-item.hh b/lily/include/percent-repeat-item.hh index 58d8d0ee64..83662b5d3d 100644 --- a/lily/include/percent-repeat-item.hh +++ b/lily/include/percent-repeat-item.hh @@ -9,12 +9,13 @@ #ifndef PERCENT_REPEAT_ITEM_HH #define PERCENT_REPEAT_ITEM_HH -#include "grob.hh" +#include "grob-interface.hh" +#include "lily-proto.hh" class Percent_repeat_item_interface { public: - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); DECLARE_SCHEME_CALLBACK (beat_slash, (SCM)); DECLARE_SCHEME_CALLBACK (double_percent, (SCM)); static Stencil x_percent (Grob *, int, Real, Real); diff --git a/lily/include/prob.hh b/lily/include/prob.hh index 40d5f5e250..6c6f59be7c 100644 --- a/lily/include/prob.hh +++ b/lily/include/prob.hh @@ -10,6 +10,8 @@ #define PROPERTY_OBJECT_HH #include "stencil.hh" +#include "virtual-methods.hh" + /* A formatted "system" (A block of titling also is a Property_object) diff --git a/lily/include/rest-collision.hh b/lily/include/rest-collision.hh index fe76e1b15c..5f2e165765 100644 --- a/lily/include/rest-collision.hh +++ b/lily/include/rest-collision.hh @@ -9,15 +9,15 @@ #ifndef REST_COLLISION_HH #define REST_COLLISION_HH +#include "grob-interface.hh" #include "lily-proto.hh" -#include "lily-guile.hh" class Rest_collision { public: static void add_column (Grob *me, Grob *); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); DECLARE_SCHEME_CALLBACK (force_shift_callback, (SCM element)); DECLARE_SCHEME_CALLBACK (calc_positioning_done, (SCM element)); DECLARE_SCHEME_CALLBACK (force_shift_callback_rest, (SCM element, SCM off)); diff --git a/lily/include/rest.hh b/lily/include/rest.hh index 357b76bcb2..20107120b7 100644 --- a/lily/include/rest.hh +++ b/lily/include/rest.hh @@ -9,7 +9,7 @@ #ifndef REST_HH #define REST_HH -#include "lily-guile.hh" +#include "grob-interface.hh" class Grob; @@ -17,7 +17,7 @@ class Rest { public: DECLARE_SCHEME_CALLBACK (y_offset_callback, (SCM)); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); static string glyph_name (Grob *, int, string, bool); static SCM brew_internal_stencil (Grob*, bool); static SCM generic_extent_callback (Grob*, Axis); diff --git a/lily/include/rhythmic-head.hh b/lily/include/rhythmic-head.hh index cd1620fb8c..2fae285707 100644 --- a/lily/include/rhythmic-head.hh +++ b/lily/include/rhythmic-head.hh @@ -9,7 +9,7 @@ #ifndef RHYTHMIC_HEAD_HH #define RHYTHMIC_HEAD_HH -#include "lily-guile.hh" +#include "grob-interface.hh" #include "lily-proto.hh" class Rhythmic_head @@ -21,7 +21,7 @@ public: static Item *get_dots (Grob *); static int dot_count (Grob *); DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM)); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); }; #endif // RHYTHMIC_HEAD_HH diff --git a/lily/include/rod.hh b/lily/include/rod.hh index 163ae847d5..7bf58538de 100644 --- a/lily/include/rod.hh +++ b/lily/include/rod.hh @@ -17,13 +17,8 @@ struct Rod Drul_array item_drul_; Real distance_; - /** - translate the rod so as to refer to Paper_columns - */ void columnize (); - void add_to_cols (); - Rod (); }; diff --git a/lily/include/score.hh b/lily/include/score.hh index 039e1d236a..71b2037efb 100644 --- a/lily/include/score.hh +++ b/lily/include/score.hh @@ -15,7 +15,6 @@ #include "std-vector.hh" #include "smobs.hh" #include "virtual-methods.hh" -#include "std-string.hh" class Score { diff --git a/lily/include/script-column.hh b/lily/include/script-column.hh index d4b1210726..e36eb952bf 100644 --- a/lily/include/script-column.hh +++ b/lily/include/script-column.hh @@ -9,9 +9,8 @@ #ifndef Script_COLUMN_HH #define Script_COLUMN_HH -#include "lily-guile.hh" #include "lily-proto.hh" - +#include "grob-interface.hh" #include "std-vector.hh" class Script_column @@ -20,7 +19,7 @@ public: static void add_side_positioned (Grob *, Grob *); DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM)); DECLARE_SCHEME_CALLBACK (row_before_line_breaking, (SCM)); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); static void order_grobs (vector grobs); }; diff --git a/lily/include/script-interface.hh b/lily/include/script-interface.hh index 8d0e0355c0..6acbadc35b 100644 --- a/lily/include/script-interface.hh +++ b/lily/include/script-interface.hh @@ -9,8 +9,8 @@ #ifndef SCRIPT_INTERFACE_HH #define SCRIPT_INTERFACE_HH -#include "lily-guile.hh" #include "lily-proto.hh" +#include "grob-interface.hh" /** Articulation marks (and the like) that are attached to notes/stems. @@ -21,7 +21,7 @@ class Script_interface { public: static Stencil get_stencil (Grob *, Direction d); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); DECLARE_SCHEME_CALLBACK (print, (SCM)); DECLARE_SCHEME_CALLBACK (calc_direction, (SCM)); }; diff --git a/lily/include/self-alignment-interface.hh b/lily/include/self-alignment-interface.hh index 63ea1c0f59..4fe353fb97 100644 --- a/lily/include/self-alignment-interface.hh +++ b/lily/include/self-alignment-interface.hh @@ -9,11 +9,12 @@ #ifndef SELF_ALIGNMENT_INTERFACE_HH #define SELF_ALIGNMENT_INTERFACE_HH -#include "spanner.hh" +#include "lily-proto.hh" +#include "grob-interface.hh" struct Self_alignment_interface { - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); static SCM aligned_on_self (Grob *me, Axis a); static SCM centered_on_object (Grob *me, Axis a); diff --git a/lily/include/semi-tie-column.hh b/lily/include/semi-tie-column.hh index cfeb7fc779..1671f7fc5f 100644 --- a/lily/include/semi-tie-column.hh +++ b/lily/include/semi-tie-column.hh @@ -12,11 +12,10 @@ #include "grob-interface.hh" #include "lily-proto.hh" -#include "lily-guile.hh" struct Semi_tie_column { - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); DECLARE_SCHEME_CALLBACK(calc_positioning_done, (SCM)); }; diff --git a/lily/include/semi-tie.hh b/lily/include/semi-tie.hh index ec63c627ef..83688ab012 100644 --- a/lily/include/semi-tie.hh +++ b/lily/include/semi-tie.hh @@ -12,11 +12,11 @@ #include "grob-interface.hh" -#include "lily-guile.hh" +#include "lily-proto.hh" struct Semi_tie { - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); DECLARE_SCHEME_CALLBACK (calc_direction, (SCM)); DECLARE_SCHEME_CALLBACK (calc_control_points, (SCM)); diff --git a/lily/include/separating-group-spanner.hh b/lily/include/separating-group-spanner.hh index 15b6aecbe8..1419d53971 100644 --- a/lily/include/separating-group-spanner.hh +++ b/lily/include/separating-group-spanner.hh @@ -9,7 +9,8 @@ #ifndef SEPARATING_GROUP_SPANNER_HH #define SEPARATING_GROUP_SPANNER_HH -#include "spanner.hh" +#include "grob-interface.hh" +#include "lily-proto.hh" class Separating_group_spanner { @@ -20,7 +21,7 @@ class Separating_group_spanner public: static void add_spacing_unit (Grob *me, Item *); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); DECLARE_SCHEME_CALLBACK (set_spacing_rods, (SCM)); }; diff --git a/lily/include/separation-item.hh b/lily/include/separation-item.hh index 012935761b..4fb59b5e62 100644 --- a/lily/include/separation-item.hh +++ b/lily/include/separation-item.hh @@ -11,14 +11,21 @@ #include "lily-proto.hh" #include "direction.hh" +#include "grob-interface.hh" +#include "skyline.hh" struct Separation_item { - static bool has_interface (Grob *); - static Interval conditional_width (Grob *, Grob *); + DECLARE_GROB_INTERFACE(); + DECLARE_SCHEME_CALLBACK(calc_skylines, (SCM)); + + static vector boxes (Grob *me, Grob *left); + static Skyline conditional_skyline (Grob *, Grob *); static Interval width (Grob *); static Interval relative_width (Grob *, Grob *); static Grob *extremal_break_aligned_grob (Grob *, Direction, Interval *); + static bool set_distance (Drul_array, Real); + static void set_skyline_distance (Drul_array, Real); static void add_item (Grob *, Item *); static void add_conditional_item (Grob *, Grob *); }; diff --git a/lily/include/side-position-interface.hh b/lily/include/side-position-interface.hh index fd58027a88..dc105cea4a 100644 --- a/lily/include/side-position-interface.hh +++ b/lily/include/side-position-interface.hh @@ -9,8 +9,8 @@ #ifndef SIDE_POSITION_INTERFACE_HH #define SIDE_POSITION_INTERFACE_HH -#include "spanner.hh" -#include "item.hh" +#include "grob-interface.hh" +#include "lily-proto.hh" /* TODO: move out unrelated callbacks. @@ -33,7 +33,7 @@ public: bool pure, int start, int end, Real *current_off); static Axis get_axis (Grob *); static void set_axis (Grob *, Axis); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); static void add_support (Grob *, Grob *); static void add_staff_support (Grob *); static Direction get_direction (Grob *); diff --git a/lily/include/skyline.hh b/lily/include/skyline.hh index c8440c7f94..36fd9d23e4 100644 --- a/lily/include/skyline.hh +++ b/lily/include/skyline.hh @@ -10,27 +10,34 @@ #define SKYLINE_HH #include + #include "axis.hh" #include "box.hh" #include "interval.hh" #include "direction.hh" #include "std-vector.hh" -#include "stencil.hh" +#include "smobs.hh" struct Building { Interval iv_; - Real start_height_; - Real end_height_; - Real m_; - Real b_; + Drul_array height_; + + Real y_intercept_; + Real slope_; - Building (Real start, Real start_height, Real end_height, Real end, Real max_slope); + void precompute (); + Building (Real start, Real start_height, Real end_height, Real end); + Building (Box const &b, Real horizon_padding, Axis a, Direction d); + void print () const; Real height (Real x) const; Real intersection (Building const &other) const; - void leading_part (Real chop, Real h); - bool obstructs (Building const &other) const; + void leading_part (Real chop); + bool conceals_beginning (Building const &other) const; + bool conceals (Building const &other) const; + bool sane () const; + Building sloped_neighbour (Real horizon_padding, Direction d) const; }; class Skyline @@ -38,26 +45,47 @@ class Skyline private: list buildings_; Direction sky_; - Real max_slope_; + void internal_merge_skyline (list*, list*, list *const result); - void internal_build_skyline (list*, - list *const result); + void internal_build_skyline (list*, list *const result); bool is_legal_skyline () const; + DECLARE_SIMPLE_SMOBS(Skyline); public: Skyline (); + Skyline (Skyline const &src); Skyline (Direction sky); - Skyline (vector const &bldgs, Axis a, Direction sky); - + Skyline (vector const &bldgs, Real horizon_padding, Axis a, Direction sky); + Skyline (Box const &b, Real horizon_padding, Axis a, Direction sky); + vector to_points () const; void merge (Skyline const &); - void insert (Box const &, Axis); + void insert (Box const &, Real horizon_padding, Axis); + void print () const; void raise (Real); + void shift (Real); Real distance (Skyline const &) const; Real height (Real airplane) const; Real max_height () const; void set_minimum_height (Real height); - Stencil stencil (); +}; + +class Skyline_pair +{ +private: + Drul_array skylines_; + + DECLARE_SIMPLE_SMOBS(Skyline_pair); +public: + Skyline_pair (); + Skyline_pair (vector const &boxes, Real horizon_padding, Axis a); + Skyline_pair (Box const &, Real horizon_padding, Axis a); + void raise (Real); + void shift (Real); + void insert (Box const &, Real horizon_padding, Axis); + void merge (Skyline_pair const &other); + Skyline &operator [] (Direction d); + Skyline const &operator [] (Direction d) const; }; #endif /* SKYLINE_HH */ diff --git a/lily/include/slur-configuration.hh b/lily/include/slur-configuration.hh index fa61e42b14..1db127238a 100644 --- a/lily/include/slur-configuration.hh +++ b/lily/include/slur-configuration.hh @@ -10,8 +10,8 @@ #define SLUR_CONFIGURATION_HH #include "bezier.hh" +#include "lily-proto.hh" #include "std-vector.hh" -#include "main.hh" enum Configuration_tag diff --git a/lily/include/slur-scoring.hh b/lily/include/slur-scoring.hh index 3e5b9d86b4..c02fac2005 100644 --- a/lily/include/slur-scoring.hh +++ b/lily/include/slur-scoring.hh @@ -10,7 +10,6 @@ #define SLUR_SCORING_HH #include "box.hh" -#include "lily-proto.hh" #include "std-vector.hh" #include "lily-guile.hh" #include "slur-score-parameters.hh" diff --git a/lily/include/slur.hh b/lily/include/slur.hh index d8603485d5..0ec721d4d2 100644 --- a/lily/include/slur.hh +++ b/lily/include/slur.hh @@ -9,10 +9,9 @@ #ifndef SLUR_HH #define SLUR_HH -#include "grob-info.hh" #include "lily-proto.hh" -#include "lily-guile.hh" #include "std-vector.hh" +#include "grob-interface.hh" class Slur { @@ -20,7 +19,7 @@ public: static void add_column (Grob *me, Grob *col); static void add_extra_encompass (Grob *me, Grob *col); static void replace_breakable_encompass_objects (Grob *me); - static void auxiliary_acknowledge_extra_object (Grob_info, vector&, vector&); + static void auxiliary_acknowledge_extra_object (Grob_info const &, vector&, vector&); DECLARE_SCHEME_CALLBACK (print, (SCM)); DECLARE_SCHEME_CALLBACK (calc_control_points, (SCM)); DECLARE_SCHEME_CALLBACK (calc_direction, (SCM)); @@ -28,7 +27,7 @@ public: DECLARE_SCHEME_CALLBACK (height, (SCM)); DECLARE_SCHEME_CALLBACK (outside_slur_callback, (SCM, SCM)); DECLARE_SCHEME_CALLBACK (pure_outside_slur_callback, (SCM, SCM, SCM, SCM)); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); static Bezier get_curve (Grob *me); }; diff --git a/lily/include/smobs.hh b/lily/include/smobs.hh index a2dcdb613d..da37b4f9e8 100644 --- a/lily/include/smobs.hh +++ b/lily/include/smobs.hh @@ -10,7 +10,6 @@ #define SMOBS_HH #include "lily-guile.hh" -#include "virtual-methods.hh" #include "warn.hh" /* diff --git a/lily/include/source-file.hh b/lily/include/source-file.hh index 88120da55c..71ae366a85 100644 --- a/lily/include/source-file.hh +++ b/lily/include/source-file.hh @@ -9,7 +9,6 @@ #ifndef SOURCE_FILE_HH #define SOURCE_FILE_HH -#include "flower-proto.hh" #include "std-vector.hh" #include "lily-proto.hh" #include "smobs.hh" diff --git a/lily/include/spaceable-grob.hh b/lily/include/spaceable-grob.hh index 3167a5e351..cb1217bf6f 100644 --- a/lily/include/spaceable-grob.hh +++ b/lily/include/spaceable-grob.hh @@ -9,8 +9,8 @@ #ifndef SPACEABLE_GROB_HH #define SPACEABLE_GROB_HH -#include "lily-guile.hh" #include "lily-proto.hh" +#include "grob-interface.hh" struct Spaceable_grob { @@ -19,7 +19,7 @@ struct Spaceable_grob static void add_spring (Grob *me, Grob *to, Real dist, Real strength); static void get_spring (Grob *me, Grob *other, Real *dist, Real *inv_strength); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); static void remove_interface (Grob *); static SCM get_minimum_distances (Grob *); static SCM get_ideal_distances (Grob *); diff --git a/lily/include/spacing-interface.hh b/lily/include/spacing-interface.hh index c33eea09d4..1d7665bbb5 100644 --- a/lily/include/spacing-interface.hh +++ b/lily/include/spacing-interface.hh @@ -5,9 +5,11 @@ (c) 2002--2006 Han-Wen Nienhuys */ +#include "grob-interface.hh" +#include "lily-proto.hh" struct Spacing_interface { - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); }; diff --git a/lily/include/spacing-options.hh b/lily/include/spacing-options.hh new file mode 100644 index 0000000000..faebb55489 --- /dev/null +++ b/lily/include/spacing-options.hh @@ -0,0 +1,30 @@ +/* + spacing-options.hh -- declare Spacing_options + + source file of the GNU LilyPond music typesetter + + (c) 2006 Han-Wen Nienhuys + +*/ + +#ifndef SPACING_OPTIONS_HH +#define SPACING_OPTIONS_HH + +#include "lily-proto.hh" +#include "rational.hh" + +struct Spacing_options +{ + bool packed_; + bool stretch_uniformly_; + bool float_nonmusical_columns_; + bool float_grace_columns_; + Rational global_shortest_; + Real increment_; + Real shortest_duration_space_; + + Spacing_options(); + void init_from_grob (Grob *me); + Real get_duration_space (Rational d, bool *) const; +}; +#endif /* SPACING_OPTIONS_HH */ diff --git a/lily/include/spacing-spanner.hh b/lily/include/spacing-spanner.hh index f39ea98bc3..3dace37510 100644 --- a/lily/include/spacing-spanner.hh +++ b/lily/include/spacing-spanner.hh @@ -10,24 +10,9 @@ #define SPACING_SPANNER_HH #include "lily-proto.hh" -#include "lily-guile.hh" #include "rational.hh" #include "std-vector.hh" - -struct Spacing_options -{ - bool packed_; - bool stretch_uniformly_; - bool float_nonmusical_columns_; - bool float_grace_columns_; - Rational global_shortest_; - Real increment_; - Real shortest_duration_space_; - - Spacing_options(); - void init_from_grob (Grob *me); - Real get_duration_space (Rational d, bool *) const; -}; +#include "grob-interface.hh" /* TODO: prune to public interface. @@ -56,7 +41,7 @@ public: DECLARE_SCHEME_CALLBACK (set_springs, (SCM)); DECLARE_SCHEME_CALLBACK (calc_common_shortest_duration, (SCM)); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); }; #endif /* SPACING_SPANNER_HH */ diff --git a/lily/include/span-bar.hh b/lily/include/span-bar.hh index ed9802eb46..449f8bca3d 100644 --- a/lily/include/span-bar.hh +++ b/lily/include/span-bar.hh @@ -9,8 +9,8 @@ #ifndef SPAN_BAR_HH #define SPAN_BAR_HH -#include "lily-guile.hh" #include "lily-proto.hh" +#include "grob-interface.hh" /** This is a barline that is spanned across other bar lines. This is @@ -21,7 +21,7 @@ class Span_bar { public: - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); static Interval get_spanned_interval (Grob *); static void add_bar (Grob *, Grob *); static void evaluate_glyph (Grob *); diff --git a/lily/include/spanner.hh b/lily/include/spanner.hh index 8267bf1af4..b90d199516 100644 --- a/lily/include/spanner.hh +++ b/lily/include/spanner.hh @@ -60,7 +60,7 @@ public: static bool less (Spanner *const &, Spanner *const &); virtual Grob *find_broken_piece (System *) const; virtual void derived_mark () const; - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); virtual System *get_system () const; protected: diff --git a/lily/include/staff-spacing.hh b/lily/include/staff-spacing.hh index 9b3010facd..af6d394ead 100644 --- a/lily/include/staff-spacing.hh +++ b/lily/include/staff-spacing.hh @@ -10,13 +10,14 @@ #define STAFF_SPACING_HH #include "lily-proto.hh" +#include "grob-interface.hh" class Staff_spacing { public: static void next_notes_correction (Grob *, Grob *, Real *, Real *); static void next_note_correction (Grob *, Grob *, Interval, Real*, Real *); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); static void get_spacing_params (Grob *, Real *, Real *); static Interval bar_y_positions (Grob *); diff --git a/lily/include/staff-symbol-referencer.hh b/lily/include/staff-symbol-referencer.hh index 1b4c096b8e..e6d4ceeec5 100644 --- a/lily/include/staff-symbol-referencer.hh +++ b/lily/include/staff-symbol-referencer.hh @@ -9,7 +9,8 @@ #ifndef STAFF_SYMBOL_REFERENCER_HH #define STAFF_SYMBOL_REFERENCER_HH -#include "grob.hh" +#include "grob-interface.hh" +#include "lily-proto.hh" /** A notation object that needs access to variables of the staff (no @@ -18,7 +19,7 @@ class Staff_symbol_referencer { public: - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); static bool ugly_hack (Grob *); static void set_position (Grob *, Real); DECLARE_SCHEME_CALLBACK (callback, (SCM element)); diff --git a/lily/include/staff-symbol.hh b/lily/include/staff-symbol.hh index edf3a0f532..af532014d9 100644 --- a/lily/include/staff-symbol.hh +++ b/lily/include/staff-symbol.hh @@ -9,8 +9,8 @@ #ifndef STAFF_SYMBOL_HH #define STAFF_SYMBOL_HH -#include "lily-guile.hh" #include "lily-proto.hh" +#include "grob-interface.hh" /** TODO: add linethickness as parameter. @@ -26,6 +26,6 @@ public: static int line_count (Grob *); DECLARE_SCHEME_CALLBACK (print, (SCM)); DECLARE_SCHEME_CALLBACK (height, (SCM)); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); }; #endif // STAFF_SYMBOL_HH diff --git a/lily/include/stem-info.hh b/lily/include/stem-info.hh index c83c1c68a2..2551c1b094 100644 --- a/lily/include/stem-info.hh +++ b/lily/include/stem-info.hh @@ -10,6 +10,7 @@ #define STEM_INFO_HH #include "real.hh" +#include "direction.hh" /* Parameters for a stem, (multiply with stemdirection, to get real values diff --git a/lily/include/stem-tremolo.hh b/lily/include/stem-tremolo.hh index 49b5fd4c5c..75946a34ee 100644 --- a/lily/include/stem-tremolo.hh +++ b/lily/include/stem-tremolo.hh @@ -10,13 +10,13 @@ #define ABBREV_HH #include "lily-proto.hh" -#include "lily-guile.hh" +#include "grob-interface.hh" class Stem_tremolo { public: - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); DECLARE_SCHEME_CALLBACK (calc_slope, (SCM)); DECLARE_SCHEME_CALLBACK (calc_width, (SCM)); DECLARE_SCHEME_CALLBACK (print, (SCM)); diff --git a/lily/include/stem.hh b/lily/include/stem.hh index 3d06bca6f6..8808d16665 100644 --- a/lily/include/stem.hh +++ b/lily/include/stem.hh @@ -9,8 +9,8 @@ #include "std-vector.hh" #include "lily-proto.hh" -#include "lily-guile.hh" #include "stem-info.hh" +#include "grob-interface.hh" class Stem { @@ -37,7 +37,7 @@ public: static Real stem_end_position (Grob *); static Stencil flag (Grob *); static Stencil get_translated_flag (Grob*); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); static void set_spacing_hints (Grob *); DECLARE_SCHEME_CALLBACK (print, (SCM)); diff --git a/lily/include/stencil.hh b/lily/include/stencil.hh index c887be149c..b80bcc1c3d 100644 --- a/lily/include/stencil.hh +++ b/lily/include/stencil.hh @@ -95,4 +95,6 @@ void register_stencil_head (SCM symbol); bool is_stencil_head (SCM symbol); SCM all_stencil_heads (); +Stencil points_to_line_stencil (vector points); + #endif /* STENCIL_HH */ diff --git a/lily/include/system-start-delimiter.hh b/lily/include/system-start-delimiter.hh index 115c8cd37a..f04cde76f6 100644 --- a/lily/include/system-start-delimiter.hh +++ b/lily/include/system-start-delimiter.hh @@ -9,8 +9,8 @@ #ifndef SYSTEM_START_DELIMITER_HH #define SYSTEM_START_DELIMITER_HH -#include "lily-guile.hh" #include "lily-proto.hh" +#include "grob-interface.hh" /* Braces/brackets across staves. @@ -20,7 +20,7 @@ class System_start_delimiter public: DECLARE_SCHEME_CALLBACK (print, (SCM)); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); static void try_collapse (Grob *); static Stencil staff_bracket (Grob *, Real); static Stencil old_staff_bracket (Grob *, Real); diff --git a/lily/include/system.hh b/lily/include/system.hh index f10b9b750f..e1a91bf4fa 100644 --- a/lily/include/system.hh +++ b/lily/include/system.hh @@ -10,7 +10,6 @@ #include "column-x-positions.hh" #include "spanner.hh" -#include "grob-array.hh" #include "skyline.hh" /* @@ -42,7 +41,7 @@ public: int spanner_count () const; void break_into_pieces (vector const &); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); vector broken_col_range (Item const *, Item const *) const; vector columns () const; diff --git a/lily/include/text-interface.hh b/lily/include/text-interface.hh index 97094c8aec..187e73715e 100644 --- a/lily/include/text-interface.hh +++ b/lily/include/text-interface.hh @@ -11,6 +11,8 @@ #define TEXT_ITEM #include "stencil.hh" +#include "grob-interface.hh" + class Text_interface { @@ -18,7 +20,7 @@ public: DECLARE_SCHEME_CALLBACK (print, (SCM)); DECLARE_SCHEME_CALLBACK (interpret_markup, (SCM, SCM, SCM)); DECLARE_SCHEME_CALLBACK (interpret_string, (SCM, SCM, SCM)); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); static bool is_markup (SCM); }; diff --git a/lily/include/text-spanner.hh b/lily/include/text-spanner.hh index 86f87e264b..06034b1870 100644 --- a/lily/include/text-spanner.hh +++ b/lily/include/text-spanner.hh @@ -9,15 +9,14 @@ #ifndef TEXT_SPANNER_HH #define TEXT_SPANNER_HH -#include "lily-guile.hh" - -class Grob; +#include "grob-interface.hh" +#include "lily-proto.hh" class Text_spanner { public: DECLARE_SCHEME_CALLBACK (print, (SCM)); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); }; #endif /* TEXT_SPANNER_HH */ diff --git a/lily/include/tie-column.hh b/lily/include/tie-column.hh index ff101a8839..77d6d68a78 100644 --- a/lily/include/tie-column.hh +++ b/lily/include/tie-column.hh @@ -9,13 +9,13 @@ #ifndef TIE_COLUMN_HH #define TIE_COLUMN_HH +#include "grob-interface.hh" #include "lily-proto.hh" -#include "lily-guile.hh" class Tie_column { public: - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); static void add_tie (Grob *me, Grob *); DECLARE_SCHEME_CALLBACK (calc_positioning_done, (SCM)); DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM)); diff --git a/lily/include/tie-configuration.hh b/lily/include/tie-configuration.hh index cd3bfe3998..95fd15b01c 100644 --- a/lily/include/tie-configuration.hh +++ b/lily/include/tie-configuration.hh @@ -10,12 +10,10 @@ #ifndef TIE_CONFIGURATION_HH #define TIE_CONFIGURATION_HH -#include "main.hh" -#include "lily-proto.hh" #include "direction.hh" #include "interval.hh" -#include "compare.hh" #include "std-vector.hh" +#include "main.hh" // DEBUG_SLUR_SCORING class Tie_configuration { diff --git a/lily/include/tie-formatting-problem.hh b/lily/include/tie-formatting-problem.hh index 7d48995d60..2b1e2b6230 100644 --- a/lily/include/tie-formatting-problem.hh +++ b/lily/include/tie-formatting-problem.hh @@ -11,9 +11,7 @@ #define TIE_FORMATTING_PROBLEM_HH #include "drul-array.hh" -#include "std-vector.hh" #include "skyline.hh" -#include "lily-proto.hh" #include "tie-configuration.hh" #include "tie-details.hh" #include "tuple.hh" diff --git a/lily/include/tie.hh b/lily/include/tie.hh index 7f96b826cf..35d3d9596c 100644 --- a/lily/include/tie.hh +++ b/lily/include/tie.hh @@ -9,9 +9,9 @@ #ifndef TIE_HH #define TIE_HH -#include "lily-guile.hh" #include "lily-proto.hh" #include "skyline.hh" +#include "grob-interface.hh" @@ -20,7 +20,7 @@ class Tie { public: static void set_head (Grob *, Direction, Grob *head); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); static Grob *head (Grob *, Direction); static int get_column_rank (Grob *, Direction); static int get_position (Grob *); diff --git a/lily/include/time-signature.hh b/lily/include/time-signature.hh index 72cdc97a06..d25843252e 100644 --- a/lily/include/time-signature.hh +++ b/lily/include/time-signature.hh @@ -7,7 +7,8 @@ #ifndef METER_HH #define METER_HH -#include "item.hh" +#include "grob-interface.hh" +#include "lily-proto.hh" /** Print a time_signature sign. @@ -18,7 +19,7 @@ */ struct Time_signature { - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); static Stencil special_time_signature (Grob *, SCM, int, int); static Stencil numbered_time_signature (Grob *, int, int); DECLARE_SCHEME_CALLBACK (print, (SCM)); diff --git a/lily/include/timing-translator.hh b/lily/include/timing-translator.hh index ef13b682cc..3ed20422b7 100644 --- a/lily/include/timing-translator.hh +++ b/lily/include/timing-translator.hh @@ -12,8 +12,6 @@ #include "moment.hh" #include "translator.hh" -#include "std-vector.hh" - class Timing_translator : public Translator { public: diff --git a/lily/include/translator-dispatch-list.hh b/lily/include/translator-dispatch-list.hh index e385dee0c0..3a54305235 100644 --- a/lily/include/translator-dispatch-list.hh +++ b/lily/include/translator-dispatch-list.hh @@ -10,7 +10,6 @@ #define TRANSLATOR_DISPATCH_LIST_HH #include "lily-proto.hh" -#include "lily-guile.hh" #include "std-vector.hh" #include "smobs.hh" diff --git a/lily/include/translator-group.hh b/lily/include/translator-group.hh index 577c1db93f..72481b5da3 100644 --- a/lily/include/translator-group.hh +++ b/lily/include/translator-group.hh @@ -11,7 +11,6 @@ #include "listener.hh" #include "translator.hh" -#include "std-vector.hh" typedef void (Translator:: *Translator_method) (void); typedef void (Translator_group:: *Translator_group_method) (void); diff --git a/lily/include/translator.hh b/lily/include/translator.hh index cf1439e673..eee42e5b7d 100644 --- a/lily/include/translator.hh +++ b/lily/include/translator.hh @@ -10,10 +10,9 @@ #define TRANSLATOR_HH #include "global-ctor.hh" -#include "std-string.hh" #include "lily-proto.hh" #include "virtual-methods.hh" -#include "input.hh" +#include "input.hh" // for error reporting #include "smobs.hh" #include "std-vector.hh" #include "protected-scm.hh" diff --git a/lily/include/tuplet-bracket.hh b/lily/include/tuplet-bracket.hh index 1b9d9c03c0..b60c417c19 100644 --- a/lily/include/tuplet-bracket.hh +++ b/lily/include/tuplet-bracket.hh @@ -7,9 +7,9 @@ #ifndef Tuplet_bracket_HH #define Tuplet_bracket_HH -#include "lily-guile.hh" #include "lily-proto.hh" #include "std-vector.hh" +#include "grob-interface.hh" class Tuplet_bracket { @@ -20,7 +20,7 @@ public: DECLARE_SCHEME_CALLBACK (print, (SCM)); DECLARE_SCHEME_CALLBACK (calc_connect_to_neighbors, (SCM smob)); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); static Grob* get_common_x (Spanner *); static void add_tuplet_bracket (Grob *me, Grob *smaller_bracket); static void get_bounds (Grob *, Grob **, Grob **); diff --git a/lily/include/vaticana-ligature.hh b/lily/include/vaticana-ligature.hh index f84280cc40..f20fccf28f 100644 --- a/lily/include/vaticana-ligature.hh +++ b/lily/include/vaticana-ligature.hh @@ -9,13 +9,14 @@ #ifndef VATICANA_LIGATURE_HH #define VATICANA_LIGATURE_HH -#include "stencil.hh" +#include "grob-interface.hh" +#include "lily-proto.hh" struct Vaticana_ligature { DECLARE_SCHEME_CALLBACK (brew_ligature_primitive, (SCM)); DECLARE_SCHEME_CALLBACK (print, (SCM)); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); }; /* diff --git a/lily/include/volta-bracket.hh b/lily/include/volta-bracket.hh index f9999b92f6..687439cc7f 100644 --- a/lily/include/volta-bracket.hh +++ b/lily/include/volta-bracket.hh @@ -8,11 +8,12 @@ #define VOLTA_SPANNER_HH #include "spanner.hh" +#include "lily-proto.hh" class Volta_bracket_interface { public: - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); DECLARE_SCHEME_CALLBACK (print, (SCM)); static void modify_edge_height (Spanner *); static void add_column (Grob *, Grob *col); diff --git a/lily/instrument-name-engraver.cc b/lily/instrument-name-engraver.cc index 9290ef93e5..a256b8beb1 100644 --- a/lily/instrument-name-engraver.cc +++ b/lily/instrument-name-engraver.cc @@ -7,7 +7,6 @@ */ #include "engraver.hh" -#include "spanner.hh" #include "pointer-group-interface.hh" #include "side-position-interface.hh" #include "axis-group-interface.hh" diff --git a/lily/item.cc b/lily/item.cc index ff00630b5f..173df20ed8 100644 --- a/lily/item.cc +++ b/lily/item.cc @@ -197,9 +197,7 @@ unsmob_item (SCM s) } ADD_INTERFACE (Item, - "item-interface", - "\n" - "\n" + "Grobs can be distinguished in their role in the horizontal spacing.\n" "Many grobs define constraints on the spacing by their sizes. For\n" "example, note heads, clefs, stems, and all other symbols with a fixed\n" diff --git a/lily/key-signature-interface.cc b/lily/key-signature-interface.cc index 5705b46ccf..60a11db86a 100644 --- a/lily/key-signature-interface.cc +++ b/lily/key-signature-interface.cc @@ -20,7 +20,7 @@ struct Key_signature_interface { DECLARE_SCHEME_CALLBACK (print, (SCM)); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); }; /* @@ -149,6 +149,6 @@ Key_signature_interface::print (SCM smob) return mol.smobbed_copy (); } -ADD_INTERFACE (Key_signature_interface, "key-signature-interface", +ADD_INTERFACE (Key_signature_interface, "A group of accidentals, to be printed as signature sign.", "style c0-position alteration-alist"); diff --git a/lily/ledger-line-spanner.cc b/lily/ledger-line-spanner.cc index bf7444dea0..ea0fa43d4e 100644 --- a/lily/ledger-line-spanner.cc +++ b/lily/ledger-line-spanner.cc @@ -9,7 +9,6 @@ #include using namespace std; -#include "item.hh" #include "note-head.hh" #include "staff-symbol-referencer.hh" #include "staff-symbol.hh" @@ -29,7 +28,7 @@ struct Ledger_line_spanner Interval x_extent, Real left_shorten); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); }; Stencil @@ -352,28 +351,27 @@ Ledger_line_spanner::print (SCM smob) } ADD_INTERFACE (Ledger_line_spanner, - "ledger-line-interface", "This spanner draws the ledger lines of a staff.\n" "This is a separate grob because it has to process\n" "all potential collisions between all note heads.", /* properties */ + "gap " + "length-fraction " + "minimum-length-fraction " "note-heads " "thickness " - "minimum-length-fraction " - "length-fraction " - "gap"); + ); struct Ledgered_interface { - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); }; ADD_INTERFACE (Ledgered_interface, - "ledgered-interface", "Objects that need ledger lines, typically " - "note heads. See also @ref{ledger-line-interface}.", + "note heads. See also @ref{ledger-line-spanner-interface}.", "no-ledgers"); diff --git a/lily/lexer.ll b/lily/lexer.ll index 8bf851eea4..9cb2cac0c6 100644 --- a/lily/lexer.ll +++ b/lily/lexer.ll @@ -41,7 +41,7 @@ using namespace std; #include "interval.hh" #include "lily-guile.hh" #include "lily-lexer.hh" -#include "lilypond-input-version.hh" +#include "lilypond-version.hh" #include "main.hh" #include "music.hh" #include "music-function.hh" @@ -875,12 +875,18 @@ is_valid_version (string s) { Lilypond_version current ( MAJOR_VERSION "." MINOR_VERSION "." PATCH_LEVEL ); Lilypond_version ver (s); - if (! ((ver >= oldest_version) && (ver <= current))) + if (int (ver) < oldest_version) { - non_fatal_error (_f ("Incorrect lilypond version: %s (%s, %s)", ver.to_string (), oldest_version.to_string (), current.to_string ())); - non_fatal_error (_ ("Consider updating the input with the convert-ly script")); + non_fatal_error (_f ("file too old: %s (oldest supported: %s)", ver.to_string (), oldest_version.to_string ())); + non_fatal_error (_ ("consider updating the input with the convert-ly script")); return false; - } + } + + if (ver > current) + { + non_fatal_error (_f ("program too old: %s (file requires: %s)", current.to_string (), ver.to_string ())); + return false; + } return true; } diff --git a/lily/ligature-bracket-engraver.cc b/lily/ligature-bracket-engraver.cc index 18efd8177a..6e8dd9a22a 100644 --- a/lily/ligature-bracket-engraver.cc +++ b/lily/ligature-bracket-engraver.cc @@ -11,6 +11,9 @@ #include "tuplet-bracket.hh" #include "spanner.hh" #include "stream-event.hh" +#include "spanner.hh" +#include "item.hh" + #include "translator.icc" /* diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index e932f342b7..d57a9f5730 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -16,8 +16,6 @@ using namespace std; -#include "config.hh" - #include "dimensions.hh" #include "direction.hh" #include "file-path.hh" @@ -114,12 +112,15 @@ gulp_file_to_string (string fn, bool must_exist, int size) return result; } -void -ly_display_scm (void *s) -{ - scm_display ((SCM)s, scm_current_output_port ()); - scm_newline (scm_current_output_port ()); -} +extern "C" { + // maybe gdb 5.0 becomes quicker if it doesn't do fancy C++ typing? + void + ly_display_scm (SCM s) + { + scm_display (s, scm_current_output_port ()); + scm_newline (scm_current_output_port ()); + } +}; string ly_scm2string (SCM str) @@ -302,6 +303,28 @@ ly_scm2offset (SCM s) scm_to_double (scm_cdr (s))); } +SCM +ly_offsets2scm (vector os) +{ + SCM l = SCM_EOL; + SCM *tail = &l; + for (vsize i = 0; i < os.size (); i++) + { + *tail = scm_cons (ly_offset2scm (os[i]), SCM_EOL); + tail = SCM_CDRLOC(*tail); + } + return l; +} + +vector +ly_scm2offsets (SCM s) +{ + vector os; + for (; scm_is_pair (s); s = scm_cdr (s)) + os.push_back (ly_scm2offset (scm_car (s))); + return os; +} + SCM ly_deep_copy (SCM src) { diff --git a/lily/lily-lexer-scheme.cc b/lily/lily-lexer-scheme.cc new file mode 100644 index 0000000000..66e47d3d6b --- /dev/null +++ b/lily/lily-lexer-scheme.cc @@ -0,0 +1,20 @@ +/* + lily-lexer-scheme.cc -- implement Lily_lexer bindings. + + source file of the GNU LilyPond music typesetter + + (c) 2006 Han-Wen Nienhuys + +*/ + +#include "lily-lexer.hh" + +LY_DEFINE(ly_lexer_keywords, "ly:lexer-keywords", + 1,0,0, (SCM lexer), + "Return a list of (KEY . CODE) pairs, signifying the lilypond reserved words list.") +{ + Lily_lexer * lex = Lily_lexer::unsmob (lexer); + SCM_ASSERT_TYPE(lex, lexer, SCM_ARG1, __FUNCTION__, "lily lexer"); + return lex->keyword_list (); +} + diff --git a/lily/lily-lexer.cc b/lily/lily-lexer.cc index 394e20089b..8d70783cb5 100644 --- a/lily/lily-lexer.cc +++ b/lily/lily-lexer.cc @@ -183,6 +183,26 @@ Lily_lexer::lookup_keyword (string s) return keytable_->lookup (s.c_str ()); } +SCM +Lily_lexer::keyword_list () const +{ + if (!keytable_) + return SCM_EOL; + + SCM l = SCM_EOL; + SCM *tail = &l; + for (vsize i = 0; i < keytable_->table_.size (); i++) + { + *tail = scm_acons (scm_makfrom0str (keytable_->table_[i].name_), + scm_from_int (keytable_->table_[i].tokcode_), + SCM_EOL); + + tail = SCM_CDRLOC(*tail); + } + + return l; +} + SCM Lily_lexer::lookup_identifier_symbol (SCM sym) { diff --git a/lily/lily-parser-scheme.cc b/lily/lily-parser-scheme.cc index a1cdfa3c03..83c3826dbd 100644 --- a/lily/lily-parser-scheme.cc +++ b/lily/lily-parser-scheme.cc @@ -11,7 +11,6 @@ #include "file-name-map.hh" #include "file-name.hh" #include "file-path.hh" -#include "input.hh" #include "international.hh" #include "lily-lexer.hh" #include "lily-parser.hh" @@ -164,7 +163,15 @@ LY_DEFINE (ly_parse_string, "ly:parse-string", return SCM_UNSPECIFIED; } -LY_DEFINE (ly_clone_parser, "ly:clone-parser", +LY_DEFINE (ly_parser_lexer, "ly:parser-lexer", + 1, 0, 0, (SCM parser_smob), + "Return the lexer for PARSER_SMOB.") +{ + Lily_parser *parser = unsmob_lily_parser (parser_smob); + return parser->lexer_->self_scm (); +} + +LY_DEFINE (ly_parser_clone, "ly:parser-clone", 1, 0, 0, (SCM parser_smob), "Return a clone of PARSER_SMOB.") { diff --git a/lily/lilypond-version.cc b/lily/lilypond-version.cc index c9c0559225..21ca2e5212 100644 --- a/lily/lilypond-version.cc +++ b/lily/lilypond-version.cc @@ -8,7 +8,7 @@ #include -#include "lilypond-input-version.hh" +#include "lilypond-version.hh" #include "string-convert.hh" #include "misc.hh" diff --git a/lily/line-interface.cc b/lily/line-interface.cc index ff7fae5783..f65dc946f2 100644 --- a/lily/line-interface.cc +++ b/lily/line-interface.cc @@ -11,6 +11,7 @@ #include "staff-symbol-referencer.hh" #include "lookup.hh" #include "output-def.hh" +#include "grob.hh" Stencil Line_interface::make_arrow (Offset begin, Offset end, @@ -139,7 +140,7 @@ Line_interface::line (Grob *me, Offset from, Offset to) return stil; } -ADD_INTERFACE (Line_interface, "line-interface", +ADD_INTERFACE (Line_interface, "Generic line objects. Any object using lines supports this. Normally, " "you get a straight line. If @code{dash-period} is defined, a dashed line is " "produced; the length of the dashes is tuned with " @@ -154,3 +155,22 @@ ADD_INTERFACE (Line_interface, "line-interface", "style " "arrow-length " "arrow-width") + + + +/* todo: move this somewhere else? */ +Stencil +points_to_line_stencil (vector points) +{ + Stencil ret; + for (vsize i = 1; i < points.size (); i++) + { + if (points[i-1].is_sane () && points[i].is_sane ()) + { + Stencil line + = Line_interface::make_line (0.1, points[i-1], points[i]); + ret.add_stencil (line); + } + } + return ret; +} diff --git a/lily/line-spanner.cc b/lily/line-spanner.cc index 0b6a9fae7f..2f99a0dce2 100644 --- a/lily/line-spanner.cc +++ b/lily/line-spanner.cc @@ -205,6 +205,9 @@ Line_spanner::print (SCM smob) Offset my_off; Offset his_off; + Real extra_dy = robust_scm2double (me->get_property ("extra-dy"), + 0.0); + if (bound[RIGHT]->break_status_dir ()) { if (bound[LEFT]->break_status_dir ()) @@ -247,11 +250,11 @@ Line_spanner::print (SCM smob) Real yoff = this_common_y->relative_coordinate (all_common_y, Y_AXIS); Offset p1 (bound[LEFT]->extent (commonx, X_AXIS)[RIGHT], - this_ext.center () + yoff); + this_ext.center () + yoff - extra_dy / 2); Offset p2 (bound[RIGHT]->extent (commonx, X_AXIS)[LEFT], - next_ext.center () + yoff); + next_ext.center () + yoff + extra_dy / 2); - Offset dz (p2 -p1); + Offset dz (p2 - p1); Real len = dz.length (); Offset dir = dz * (1 / len); @@ -288,24 +291,27 @@ Line_spanner::print (SCM smob) his_off[ax] = bound[LEFT]->relative_coordinate (common[a], ax); } - ofxy = dxy * (off / dxy.length ()); + ofxy = dxy * (off / dxy.length ()) ; dxy -= 2*ofxy; + dxy[Y_AXIS] += extra_dy; + Stencil line = line_stencil (me, Offset (0, 0), dxy); line.translate_axis (bound[LEFT]->extent (bound[LEFT], X_AXIS).length () / 2, X_AXIS); - line.translate (ofxy - my_off + his_off); + line.translate (ofxy - my_off + his_off + Offset (0, -extra_dy/2)); return line.smobbed_copy (); } } -ADD_INTERFACE (Line_spanner, "line-spanner-interface", +ADD_INTERFACE (Line_spanner, "Generic line drawn between two objects, e.g. for use with glissandi.\n" "The property @code{style} can be @code{line}, " "@code{dashed-line}, @code{trill}, \n" "@code{dotted-line} or @code{zigzag}.\n" "\n", - + + "extra-dy " "arrow " "gap " "thickness " diff --git a/lily/lyric-combine-music-iterator.cc b/lily/lyric-combine-music-iterator.cc index dafed1d3c8..6011ede3f2 100644 --- a/lily/lyric-combine-music-iterator.cc +++ b/lily/lyric-combine-music-iterator.cc @@ -6,7 +6,6 @@ (c) 2004--2006 Han-Wen Nienhuys */ -#include "context.hh" #include "dispatcher.hh" #include "global-context.hh" #include "grob.hh" diff --git a/lily/lyric-combine-music.cc b/lily/lyric-combine-music.cc index 931ef3b041..d3f2eafe85 100644 --- a/lily/lyric-combine-music.cc +++ b/lily/lyric-combine-music.cc @@ -7,8 +7,6 @@ */ #include "music.hh" -#include "pitch.hh" -#include "moment.hh" struct Lyric_combine_music { diff --git a/lily/lyric-extender.cc b/lily/lyric-extender.cc index 867a6d83d3..d30a53d668 100644 --- a/lily/lyric-extender.cc +++ b/lily/lyric-extender.cc @@ -8,10 +8,10 @@ #include "lyric-extender.hh" - +#include "spanner.hh" +#include "item.hh" #include "warn.hh" #include "lookup.hh" -#include "paper-column.hh" #include "output-def.hh" #include "note-head.hh" #include "pointer-group-interface.hh" @@ -84,7 +84,7 @@ Lyric_extender::print (SCM smob) return mol.smobbed_copy (); } -ADD_INTERFACE (Lyric_extender, "lyric-extender-interface", +ADD_INTERFACE (Lyric_extender, "The extender is a simple line at the baseline of the lyric " "that helps show the length of a melissima (tied/slurred note).", diff --git a/lily/lyric-hyphen.cc b/lily/lyric-hyphen.cc index 66bf1b8523..d38460be74 100644 --- a/lily/lyric-hyphen.cc +++ b/lily/lyric-hyphen.cc @@ -1,5 +1,5 @@ /* - hyphen-spanner.cc -- implement Hyphen_spanner + hyphen-spanner.cc -- implement Lyric_hyphen source file of the GNU LilyPond music typesetter @@ -13,15 +13,16 @@ #include "output-def.hh" #include "paper-column.hh" #include "moment.hh" +#include "spanner.hh" /* TODO: should extract hyphen dimensions or hyphen glyph from the font. */ -MAKE_SCHEME_CALLBACK (Hyphen_spanner, print, 1); +MAKE_SCHEME_CALLBACK (Lyric_hyphen, print, 1); SCM -Hyphen_spanner::print (SCM smob) +Lyric_hyphen::print (SCM smob) { Spanner *me = unsmob_spanner (smob); Drul_array bounds (me->get_bound (LEFT), @@ -102,9 +103,9 @@ Hyphen_spanner::print (SCM smob) return total.smobbed_copy (); } -MAKE_SCHEME_CALLBACK (Hyphen_spanner, set_spacing_rods, 1); +MAKE_SCHEME_CALLBACK (Lyric_hyphen, set_spacing_rods, 1); SCM -Hyphen_spanner::set_spacing_rods (SCM smob) +Lyric_hyphen::set_spacing_rods (SCM smob) { Grob *me = unsmob_grob (smob); @@ -128,10 +129,8 @@ Hyphen_spanner::set_spacing_rods (SCM smob) return SCM_UNSPECIFIED; } -ADD_INTERFACE (Hyphen_spanner, +ADD_INTERFACE (Lyric_hyphen, - "lyric-hyphen-interface", - "A centered hyphen is a simple line between " "lyrics used to divide syllables", diff --git a/lily/main.cc b/lily/main.cc index 2eb6cec0ba..68fc2a03cb 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -34,7 +34,6 @@ using namespace std; #include "getopt-long.hh" #include "global-ctor.hh" #include "international.hh" -#include "lily-guile.hh" #include "lily-version.hh" #include "misc.hh" #include "output-def.hh" @@ -394,8 +393,7 @@ main_with_guile (void *, int, char **) init_fontconfig (); init_freetype (); - - all_fonts_global = new All_font_metrics (global_path.to_string ()); + ly_reset_all_fonts (); if (!init_scheme_variables.empty () || !init_scheme_code_string.empty ()) @@ -602,13 +600,19 @@ setup_guile_env () bool overwrite = true; if (!yield) { - yield = "70"; + yield = "65"; overwrite = false; } sane_putenv ("GUILE_MIN_YIELD_1", yield, overwrite); sane_putenv ("GUILE_MIN_YIELD_2", yield, overwrite); sane_putenv ("GUILE_MIN_YIELD_MALLOC", yield, overwrite); + + + sane_putenv ("GUILE_INIT_SEGMENT_SIZE_1", + "10485760", overwrite); + sane_putenv ("GUILE_MAX_SEGMENT_SIZE", + "104857600", overwrite); } void @@ -628,6 +632,7 @@ main (int argc, char **argv) setup_paths (argv[0]); setup_guile_env (); +#if 0 /* Debugging aid. */ try { @@ -637,7 +642,10 @@ main (int argc, char **argv) { error (_f ("exception caught: %s", e.what ())); }; - +#else + scm_boot_guile (argc, argv, main_with_guile, 0); +#endif + /* Only reachable if GUILE exits. That is an error. */ return 1; } diff --git a/lily/measure-grouping-engraver.cc b/lily/measure-grouping-engraver.cc index 49b5195594..fe7abf1ea4 100644 --- a/lily/measure-grouping-engraver.cc +++ b/lily/measure-grouping-engraver.cc @@ -10,6 +10,7 @@ #include "side-position-interface.hh" #include "global-context.hh" #include "engraver.hh" +#include "spanner.hh" #include "translator.icc" diff --git a/lily/measure-grouping-spanner.cc b/lily/measure-grouping-spanner.cc index 9306badd21..a256d0468d 100644 --- a/lily/measure-grouping-spanner.cc +++ b/lily/measure-grouping-spanner.cc @@ -47,7 +47,7 @@ Measure_grouping::print (SCM grob) return m.smobbed_copy (); } -ADD_INTERFACE (Measure_grouping, "measure-grouping-interface", +ADD_INTERFACE (Measure_grouping, "This object indicates groups of beats. " "Valid choices for @code{style} are @code{bracket} and @code{triangle}.", "thickness style height"); diff --git a/lily/melody-spanner.cc b/lily/melody-spanner.cc index d0544ab2d2..d4901f2c9b 100644 --- a/lily/melody-spanner.cc +++ b/lily/melody-spanner.cc @@ -88,7 +88,7 @@ Melody_spanner::add_stem (Grob *me, Grob *stem) stem->set_property ("neutral-direction", Melody_spanner::calc_neutral_stem_direction_proc); } -ADD_INTERFACE (Melody_spanner, "melody-spanner-interface", +ADD_INTERFACE (Melody_spanner, "Context dependent typesetting decisions.", "stems " diff --git a/lily/mensural-ligature.cc b/lily/mensural-ligature.cc index a351494325..88a1181058 100644 --- a/lily/mensural-ligature.cc +++ b/lily/mensural-ligature.cc @@ -219,7 +219,7 @@ Mensural_ligature::print (SCM) return SCM_EOL; } -ADD_INTERFACE (Mensural_ligature, "mensural-ligature-interface", +ADD_INTERFACE (Mensural_ligature, "A mensural ligature", "delta-position " diff --git a/lily/misc.cc b/lily/misc.cc index e7c3063df2..aa49a697a6 100644 --- a/lily/misc.cc +++ b/lily/misc.cc @@ -55,3 +55,26 @@ peak_around (Real epsilon, Real threshold, Real x) return 1.0; return max (- epsilon * (x - threshold) / ((x + epsilon) * threshold), 0.0); } + + +string +camel_case_to_lisp_identifier (string in) +{ + vector out; + + /* don't add '-' before first character */ + out.push_back (tolower (in[0])); + + for (size_t inpos = 1; inpos < in.size (); inpos++) + { + if (isupper (in[inpos])) + out.push_back ('-'); + out.push_back (tolower (in[inpos])); + } + + string result (&out[0], out.size ()); + replace_all (result, '_', '-'); + + return result; +} + diff --git a/lily/modified-font-metric.cc b/lily/modified-font-metric.cc index 52eee67268..e0fb13044d 100644 --- a/lily/modified-font-metric.cc +++ b/lily/modified-font-metric.cc @@ -13,7 +13,6 @@ using namespace std; #include "text-metrics.hh" #include "warn.hh" #include "stencil.hh" -#include "lookup.hh" #include "main.hh" Modified_font_metric::Modified_font_metric (Font_metric *fm, diff --git a/lily/module-scheme.cc b/lily/module-scheme.cc index 0d64fa5290..f930a2856e 100644 --- a/lily/module-scheme.cc +++ b/lily/module-scheme.cc @@ -6,12 +6,12 @@ (c) 2005--2006 Han-Wen Nienhuys */ -#include "lily-guile.hh" +#include "ly-module.hh" + #include "warn.hh" #include "main.hh" #include "std-string.hh" -#include "ly-module.hh" /* If a variable in changed in SRC, we DEST doesn't see the diff --git a/lily/multi-measure-rest-engraver.cc b/lily/multi-measure-rest-engraver.cc index 9a7816bf0d..5d0d7d9713 100644 --- a/lily/multi-measure-rest-engraver.cc +++ b/lily/multi-measure-rest-engraver.cc @@ -12,6 +12,7 @@ #include "staff-symbol-referencer.hh" #include "stream-event.hh" #include "moment.hh" +#include "spanner.hh" #include "translator.icc" diff --git a/lily/multi-measure-rest.cc b/lily/multi-measure-rest.cc index 0a87a137ed..44d699b7ce 100644 --- a/lily/multi-measure-rest.cc +++ b/lily/multi-measure-rest.cc @@ -351,7 +351,7 @@ Multi_measure_rest::set_text_rods (SCM smob) return SCM_UNSPECIFIED; } -ADD_INTERFACE (Multi_measure_rest, "multi-measure-rest-interface", +ADD_INTERFACE (Multi_measure_rest, "A rest that spans a whole number of measures.", /* properties */ diff --git a/lily/music-function-scheme.cc b/lily/music-function-scheme.cc new file mode 100644 index 0000000000..06e57f083b --- /dev/null +++ b/lily/music-function-scheme.cc @@ -0,0 +1,30 @@ +#include "music-function.hh" + +LY_DEFINE (ly_music_function_p, "ly:music-function?", 1, 0, 0, + (SCM x), + "Is @var{x} an @code{music-function}?") +{ + return is_music_function (x) ? SCM_BOOL_T : SCM_BOOL_F; +} + +LY_DEFINE (ly_music_function_extract, "ly:music-function-extract", 1, 0, 0, + (SCM x), + "Return the Scheme function inside @var{x}") +{ + SCM_ASSERT_TYPE(is_music_function (x), x, SCM_ARG1, __FUNCTION__, + "music function"); + + return SCM_CELL_OBJECT_1(x); +} + +LY_DEFINE (ly_make_music_function, "ly:make-music-function", 2, 0, 0, + (SCM signature, SCM func), + "Make a function to process music, to be used for the " + "parser. @code{func} is the function, and @code{signature} describes " + "Its arguments. @code{signature} is a list containing either " + "@code{ly:music?} predicates or other type predicates.") +{ + SCM_ASSERT_TYPE(ly_is_procedure (func), func, SCM_ARG1, __FUNCTION__, "function"); + return make_music_function (signature, func); +} + diff --git a/lily/music-function.cc b/lily/music-function.cc index 6795ca67d4..6a97db4a55 100644 --- a/lily/music-function.cc +++ b/lily/music-function.cc @@ -26,19 +26,6 @@ print_music_function (SCM b, SCM port, scm_print_state *) return 1; } -LY_DEFINE (ly_make_music_function, "ly:make-music-function", 2, 0, 0, - (SCM signature, SCM func), - "Make a function to process music, to be used for the " - "parser. @code{func} is the function, and @code{signature} describes " - "Its arguments. @code{signature} is a list containing either " - "@code{ly:music?} predicates or other type predicates.") -{ - scm_set_object_property_x (func, ly_symbol2scm ("music-function-signature"), - signature); - - SCM_RETURN_NEWSMOB (music_function_tag, func); -} - bool is_music_function (SCM music_function) { @@ -62,4 +49,14 @@ init_music_function (void) scm_set_smob_print (music_function_tag, print_music_function); } +SCM +make_music_function (SCM signature, SCM func) +{ + scm_set_object_property_x (func, ly_symbol2scm ("music-function-signature"), + signature); + + SCM_RETURN_NEWSMOB (music_function_tag, func); +} + ADD_SCM_INIT_FUNC (music_function_tag, init_music_function); + diff --git a/lily/music-iterator.cc b/lily/music-iterator.cc index 036a0c3249..3a97459f89 100644 --- a/lily/music-iterator.cc +++ b/lily/music-iterator.cc @@ -7,12 +7,11 @@ */ -#include "music-iterator.hh" - #include using namespace std; #include "warn.hh" +#include "music.hh" #include "context.hh" #include "event-iterator.hh" #include "input.hh" diff --git a/lily/music-output.cc b/lily/music-output.cc index 184849b18a..096dd33007 100644 --- a/lily/music-output.cc +++ b/lily/music-output.cc @@ -9,7 +9,6 @@ #include "music-output.hh" #include "ly-smobs.icc" -#include "virtual-methods.hh" Music_output::Music_output () { diff --git a/lily/music-scheme.cc b/lily/music-scheme.cc index b18aae42da..365c3f4344 100644 --- a/lily/music-scheme.cc +++ b/lily/music-scheme.cc @@ -10,7 +10,6 @@ #include "duration.hh" #include "warn.hh" -#include "pitch.hh" LY_DEFINE (ly_music_length, "ly:music-length", 1, 0, 0, (SCM mus), diff --git a/lily/music-sequence.cc b/lily/music-sequence.cc index 8a2915ad10..30ca686e79 100644 --- a/lily/music-sequence.cc +++ b/lily/music-sequence.cc @@ -6,11 +6,12 @@ (c) 1998--2006 Han-Wen Nienhuys */ +#include "music-sequence.hh" + #include "warn.hh" #include "program-option.hh" -#include "pitch.hh" +#include "music.hh" #include "input.hh" -#include "music-sequence.hh" void transpose_music_list (SCM lst, Pitch rq) diff --git a/lily/music-wrapper-iterator.cc b/lily/music-wrapper-iterator.cc index c50a64c7c1..e89896ce66 100644 --- a/lily/music-wrapper-iterator.cc +++ b/lily/music-wrapper-iterator.cc @@ -8,6 +8,7 @@ #include "music-wrapper-iterator.hh" #include "music-wrapper.hh" +#include "music.hh" Music_wrapper_iterator::Music_wrapper_iterator () { diff --git a/lily/music-wrapper.cc b/lily/music-wrapper.cc index 456af661cc..051187a8a4 100644 --- a/lily/music-wrapper.cc +++ b/lily/music-wrapper.cc @@ -25,6 +25,9 @@ Music_wrapper::length_callback (SCM m) { Music *me = unsmob_music (m); Music *elt = unsmob_music (me->get_property ("element")); - return elt->get_length ().smobbed_copy (); + if (elt) + return elt->get_length ().smobbed_copy (); + else + return Moment (0).smobbed_copy (); } diff --git a/lily/music.cc b/lily/music.cc index 1253e72860..fb272aae03 100644 --- a/lily/music.cc +++ b/lily/music.cc @@ -16,7 +16,6 @@ #include "ly-smobs.icc" #include "main.hh" #include "music-sequence.hh" -#include "pitch.hh" #include "score.hh" #include "warn.hh" diff --git a/lily/new-fingering-engraver.cc b/lily/new-fingering-engraver.cc index d944c6327f..594f24f337 100644 --- a/lily/new-fingering-engraver.cc +++ b/lily/new-fingering-engraver.cc @@ -15,6 +15,7 @@ #include "side-position-interface.hh" #include "stem.hh" #include "stream-event.hh" +#include "item.hh" #include "warn.hh" #include "translator.icc" diff --git a/lily/note-collision.cc b/lily/note-collision.cc index ddfbf19983..2fa8ce4881 100644 --- a/lily/note-collision.cc +++ b/lily/note-collision.cc @@ -15,6 +15,7 @@ #include "note-head.hh" #include "output-def.hh" #include "pointer-group-interface.hh" +#include "item.hh" #include "rhythmic-head.hh" #include "staff-symbol-referencer.hh" #include "side-position-interface.hh" @@ -246,6 +247,22 @@ check_meshing_chords (Grob *me, else shift_amount *= 0.17; + /* + + */ + if (full_collide + && dnball_type * upball_type == 0) + { + if (upball_type == 0 && dnball_type == 1) + shift_amount *= 1.25; + else if (upball_type == 0 && dnball_type == 2) + shift_amount *= 1.35; + else if (dnball_type == 0 && upball_type == 1) + shift_amount *= 0.7; + else if (dnball_type == 0 && upball_type == 2) + shift_amount *= 0.75; + } + /* * Fix issue #44: * @@ -529,7 +546,7 @@ Note_collision_interface::add_column (Grob *me, Grob *ncol) Axis_group_interface::add_element (me, ncol); } -ADD_INTERFACE (Note_collision_interface, "note-collision-interface", +ADD_INTERFACE (Note_collision_interface, "An object that handles collisions between notes with different stem " "directions and horizontal shifts. Most of the interesting properties " "are to be set in @ref{note-column-interface}: these are " diff --git a/lily/note-column.cc b/lily/note-column.cc index 146b3b0654..a53c060069 100644 --- a/lily/note-column.cc +++ b/lily/note-column.cc @@ -15,6 +15,7 @@ using namespace std; #include "axis-group-interface.hh" #include "directional-element-interface.hh" #include "international.hh" +#include "item.hh" #include "note-head.hh" #include "output-def.hh" #include "pointer-group-interface.hh" @@ -186,7 +187,7 @@ Note_column::arpeggio (Grob *me) return unsmob_grob (me->get_object ("arpeggio")); } -ADD_INTERFACE (Note_column, "note-column-interface", +ADD_INTERFACE (Note_column, "Stem and noteheads combined", /* properties */ diff --git a/lily/note-head-line-engraver.cc b/lily/note-head-line-engraver.cc index 4493ffb7b1..2d48f05c70 100644 --- a/lily/note-head-line-engraver.cc +++ b/lily/note-head-line-engraver.cc @@ -13,6 +13,9 @@ #include "side-position-interface.hh" #include "staff-symbol-referencer.hh" #include "context.hh" +#include "spanner.hh" +#include "item.hh" + /** Create line-spanner grobs for lines that connect note heads. diff --git a/lily/note-head.cc b/lily/note-head.cc index ecf59808f3..12064f705b 100644 --- a/lily/note-head.cc +++ b/lily/note-head.cc @@ -18,6 +18,7 @@ using namespace std; #include "font-interface.hh" #include "international.hh" #include "warn.hh" +#include "grob.hh" static Stencil internal_print (Grob *me, string *font_char) @@ -141,7 +142,7 @@ Note_head::calc_stem_attachment (SCM smob) } -ADD_INTERFACE (Note_head, "note-head-interface", +ADD_INTERFACE (Note_head, "Note head", /* properties */ diff --git a/lily/note-heads-engraver.cc b/lily/note-heads-engraver.cc index 6c065af4f6..7d976761dd 100644 --- a/lily/note-heads-engraver.cc +++ b/lily/note-heads-engraver.cc @@ -9,8 +9,6 @@ #include using namespace std; -#include "dots.hh" -#include "dot-column.hh" #include "duration.hh" #include "item.hh" #include "output-def.hh" diff --git a/lily/note-spacing.cc b/lily/note-spacing.cc index 2700c12835..f601a1054b 100644 --- a/lily/note-spacing.cc +++ b/lily/note-spacing.cc @@ -455,7 +455,7 @@ Note_spacing::stem_dir_correction (Grob *me, Item *rcolumn, */ } -ADD_INTERFACE (Note_spacing, "note-spacing-interface", +ADD_INTERFACE (Note_spacing, "This object calculates spacing wishes for individual voices.", diff --git a/lily/open-type-font.cc b/lily/open-type-font.cc index 45ae95cce7..d34654e770 100644 --- a/lily/open-type-font.cc +++ b/lily/open-type-font.cc @@ -82,8 +82,10 @@ get_otf_table (FT_Face face, string tag) { FT_ULong len; FT_Byte *tab = load_table (tag.c_str (), face, &len); + string ret ((char const*) tab, len); + free (tab); - return string ((char const*) tab, len); + return ret; } FT_Face diff --git a/lily/ottava-bracket.cc b/lily/ottava-bracket.cc index f3b90b124c..f1894a25a8 100644 --- a/lily/ottava-bracket.cc +++ b/lily/ottava-bracket.cc @@ -24,7 +24,7 @@ struct Ottava_bracket { DECLARE_SCHEME_CALLBACK (print, (SCM)); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); }; /* @@ -176,8 +176,6 @@ Ottava_bracket::print (SCM smob) } ADD_INTERFACE (Ottava_bracket, - "ottava-bracket-interface", - "An ottava bracket", /* diff --git a/lily/ottava-engraver.cc b/lily/ottava-engraver.cc index 243a5aff2d..6afa928387 100644 --- a/lily/ottava-engraver.cc +++ b/lily/ottava-engraver.cc @@ -10,6 +10,8 @@ #include "note-column.hh" #include "side-position-interface.hh" #include "engraver.hh" +#include "spanner.hh" +#include "item.hh" class Ottava_spanner_engraver : public Engraver { diff --git a/lily/output-def-scheme.cc b/lily/output-def-scheme.cc index 6c257fd092..95fd4a5782 100644 --- a/lily/output-def-scheme.cc +++ b/lily/output-def-scheme.cc @@ -6,10 +6,10 @@ (c) 2005--2006 Han-Wen Nienhuys */ -#include "font-metric.hh" +#include "output-def.hh" + #include "pango-font.hh" #include "modified-font-metric.hh" -#include "output-def.hh" #include "ly-module.hh" #include "context-def.hh" #include "lily-parser.hh" diff --git a/lily/page-turn-engraver.cc b/lily/page-turn-engraver.cc index c2817479d3..4064efa37e 100644 --- a/lily/page-turn-engraver.cc +++ b/lily/page-turn-engraver.cc @@ -12,7 +12,6 @@ #include "duration.hh" #include "grob.hh" #include "international.hh" -#include "moment.hh" #include "paper-column.hh" #include "stream-event.hh" #include "warn.hh" diff --git a/lily/pango-font.cc b/lily/pango-font.cc index e075029154..3d58e0dd0e 100644 --- a/lily/pango-font.cc +++ b/lily/pango-font.cc @@ -10,16 +10,19 @@ #include #include +#include + /* Ugh. */ -#include "pango-font.hh" +#include "pango-font.hh" #include "dimensions.hh" #include "file-name.hh" #include "international.hh" -#include "lookup.hh" +#include "lookup.hh" // debugging #include "main.hh" #include "string-convert.hh" #include "warn.hh" +#include "all-font-metrics.hh" #if HAVE_PANGO_FT2 #include "stencil.hh" @@ -77,22 +80,6 @@ Pango_font::derived_mark () const } -map filename_charcode_maps_map; -Index_to_charcode_map const *get_index_to_charcode_map (string postscript_name, FT_Face face); - - -Index_to_charcode_map const * -get_index_to_charcode_map (string filename, FT_Face face) -{ - if (filename_charcode_maps_map.find (filename) == filename_charcode_maps_map.end ()) - filename_charcode_maps_map[filename] = make_index_to_charcode_map (face); - - if (filename_charcode_maps_map.find (filename) == filename_charcode_maps_map.end ()) - return 0; - - return &filename_charcode_maps_map[filename]; -} - void get_glyph_index_name (char *s, FT_ULong code) { @@ -160,7 +147,7 @@ Pango_font::pango_item_string_stencil (PangoItem const *item, string str, Index_to_charcode_map const *cmap = 0; bool has_glyph_names = ftface->face_flags & FT_FACE_FLAG_GLYPH_NAMES; if (! has_glyph_names) - cmap = get_index_to_charcode_map (file_name, ftface); + cmap = all_fonts_global->get_index_to_charcode_map (file_name, ftface); bool is_ttf = string (FT_Get_X11_Font_Format (ftface)) == "TrueType"; bool cid_keyed = false; diff --git a/lily/paper-column-engraver.cc b/lily/paper-column-engraver.cc index fb0ab67c81..bef70f72a7 100644 --- a/lily/paper-column-engraver.cc +++ b/lily/paper-column-engraver.cc @@ -11,7 +11,6 @@ #include "international.hh" #include "axis-group-interface.hh" #include "context.hh" -#include "item.hh" #include "note-spacing.hh" #include "paper-column.hh" #include "pointer-group-interface.hh" diff --git a/lily/paper-column.cc b/lily/paper-column.cc index 0f01da091e..2636b20fe4 100644 --- a/lily/paper-column.cc +++ b/lily/paper-column.cc @@ -34,9 +34,9 @@ Paper_column::do_break_processing () } int -Paper_column::get_rank (Grob *me) +Paper_column::get_rank (Grob const *me) { - return dynamic_cast (me)->rank_; + return dynamic_cast (me)->rank_; } System * @@ -203,8 +203,6 @@ Paper_column::before_line_breaking (SCM grob) ADD_INTERFACE (Paper_column, - - "paper-column-interface", "@code{Paper_column} objects form the top-most X-parents for items." " The are two types of columns: musical columns, where are attached to, and " " non-musical columns, where bar-lines, clefs etc. are attached to. " diff --git a/lily/parenthesis-engraver.cc b/lily/parenthesis-engraver.cc index 54e016f4d9..cef5c55493 100644 --- a/lily/parenthesis-engraver.cc +++ b/lily/parenthesis-engraver.cc @@ -9,7 +9,6 @@ #include "engraver.hh" -#include "grob.hh" #include "item.hh" #include "pointer-group-interface.hh" #include "simple-closure.hh" diff --git a/lily/parser.yy b/lily/parser.yy index a075649481..64d6103d44 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -80,7 +80,6 @@ using namespace std; #include "lily-guile.hh" #include "lily-lexer.hh" #include "lily-parser.hh" -#include "lilypond-input-version.hh" #include "main.hh" #include "misc.hh" #include "music.hh" diff --git a/lily/part-combine-engraver.cc b/lily/part-combine-engraver.cc index b862a4f73d..121ad3fbd2 100644 --- a/lily/part-combine-engraver.cc +++ b/lily/part-combine-engraver.cc @@ -15,6 +15,7 @@ #include "stem.hh" #include "stream-event.hh" #include "text-interface.hh" +#include "item.hh" #include "translator.icc" diff --git a/lily/part-combine-iterator.cc b/lily/part-combine-iterator.cc index 03da0d4f57..6dbff41180 100644 --- a/lily/part-combine-iterator.cc +++ b/lily/part-combine-iterator.cc @@ -9,7 +9,6 @@ #include "context.hh" #include "dispatcher.hh" #include "lily-guile.hh" -#include "listener.hh" #include "music.hh" #include "music-iterator.hh" #include "music-sequence.hh" diff --git a/lily/percent-repeat-item.cc b/lily/percent-repeat-item.cc index 691ad5dbae..705d9394b2 100644 --- a/lily/percent-repeat-item.cc +++ b/lily/percent-repeat-item.cc @@ -7,8 +7,7 @@ */ #include "percent-repeat-item.hh" - - +#include "item.hh" #include "lookup.hh" #include "font-interface.hh" @@ -71,7 +70,9 @@ Percent_repeat_item_interface::beat_slash (SCM grob) return m.smobbed_copy (); } -ADD_INTERFACE (Percent_repeat_item_interface, "percent-repeat-interface", +ADD_INTERFACE (Percent_repeat_item_interface, "Repeats that look like percent signs", - "slope thickness"); + + "slope " + "thickness "); diff --git a/lily/percent-repeat-iterator.cc b/lily/percent-repeat-iterator.cc index 495f30f33c..077d51907d 100644 --- a/lily/percent-repeat-iterator.cc +++ b/lily/percent-repeat-iterator.cc @@ -8,7 +8,6 @@ */ #include "input.hh" -#include "music.hh" #include "repeated-music.hh" #include "sequential-iterator.hh" diff --git a/lily/performance.cc b/lily/performance.cc index 0bfe37ee82..59cc64a2e2 100644 --- a/lily/performance.cc +++ b/lily/performance.cc @@ -43,6 +43,7 @@ Performance::output (Midi_stream &midi_stream) midi_stream << Midi_header (1, tracks_, clocks_per_4); message (_ ("Track...") + " "); + int channel = 0; for (vsize i = 0; i < audio_staffs_.size (); i++) { @@ -50,30 +51,37 @@ Performance::output (Midi_stream &midi_stream) if (be_verbose_global) progress_indication ("[" + to_string (i)); - /* - MIDI players tend to ignore instrument settings on - channel 10, the percussion channel by default. - */ - if (channel % 16 == 9) - channel++; + int midi_channel = s->channel_; + + if (midi_channel < 0) + { + midi_channel = channel; + channel ++; + /* + MIDI players tend to ignore instrument settings on + channel 10, the percussion channel. + */ + if (channel % 16 == 9) + channel ++; + } /* Huh? Why does each staff also have a separate channel? We should map channels to voices, not staves. --hwn. */ - if (channel > 15) + if (midi_channel > 15) { warning (_ ("MIDI channel wrapped around")); warning (_ ("remapping modulo 16")); + + midi_channel = midi_channel % 16; } - s->output (midi_stream, channel); - channel ++; + s->output (midi_stream, midi_channel); if (be_verbose_global) progress_indication ("]"); } } - void Performance::add_element (Audio_element *p) { diff --git a/lily/piano-pedal-bracket.cc b/lily/piano-pedal-bracket.cc index baffc8fe98..8c76a60d13 100644 --- a/lily/piano-pedal-bracket.cc +++ b/lily/piano-pedal-bracket.cc @@ -14,7 +14,7 @@ struct Piano_pedal_bracket { DECLARE_SCHEME_CALLBACK (print, (SCM)); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); }; MAKE_SCHEME_CALLBACK (Piano_pedal_bracket, print, 1); @@ -90,7 +90,6 @@ Piano_pedal_bracket::print (SCM smob) } ADD_INTERFACE (Piano_pedal_bracket, - "piano-pedal-bracket-interface", "The bracket of the piano pedal. " "It can be tuned through the regular " diff --git a/lily/piano-pedal-engraver.cc b/lily/piano-pedal-engraver.cc index 25c486f9e6..8c919cb36f 100644 --- a/lily/piano-pedal-engraver.cc +++ b/lily/piano-pedal-engraver.cc @@ -23,9 +23,12 @@ #include "stream-event.hh" #include "string-convert.hh" #include "warn.hh" -#include "protected-scm.hh" +#include "spanner.hh" +#include "item.hh" + #include "translator.icc" + /* TODO: diff --git a/lily/pitch-squash-engraver.cc b/lily/pitch-squash-engraver.cc index 50d2d862ac..f072c3c84e 100644 --- a/lily/pitch-squash-engraver.cc +++ b/lily/pitch-squash-engraver.cc @@ -5,10 +5,13 @@ (c) 1997--2006 Han-Wen Nienhuys */ + +#include "engraver.hh" + #include "staff-symbol-referencer.hh" #include "note-head.hh" #include "rhythmic-head.hh" -#include "engraver.hh" +#include "grob.hh" class Pitch_squash_engraver : public Engraver { diff --git a/lily/pointer-group-interface.cc b/lily/pointer-group-interface.cc index 2d58941b72..36eac12bca 100644 --- a/lily/pointer-group-interface.cc +++ b/lily/pointer-group-interface.cc @@ -8,8 +8,6 @@ #include "pointer-group-interface.hh" -#include "lily-proto.hh" -#include "item.hh" #include "grob-array.hh" #include "grob.hh" diff --git a/lily/prob.cc b/lily/prob.cc index b6df86590f..a45e089a08 100644 --- a/lily/prob.cc +++ b/lily/prob.cc @@ -9,6 +9,7 @@ #include "prob.hh" #include "main.hh" #include "item.hh" +#include "input.hh" #include "ly-smobs.icc" @@ -41,12 +42,20 @@ Prob::equal_p (SCM sa, SCM sb) /* Compare mutable and immutable lists, element by element. */ for (i = 0; i < 2; i++) { - SCM aprop = props[0][i], bprop = props[1][i]; + SCM aprop = props[0][i]; + SCM bprop = props[1][i]; - for (; scm_is_pair (aprop) && scm_is_pair(bprop); aprop = scm_cdr (aprop), bprop = scm_cdr (bprop)) + for (; + scm_is_pair (aprop) && scm_is_pair(bprop); + aprop = scm_cdr (aprop), bprop = scm_cdr (bprop)) { + SCM aval = scm_cdar (aprop); + SCM bval = scm_cdar (bprop); if (scm_caar (aprop) != scm_caar (bprop) || - !to_boolean (scm_equal_p (scm_cdar (aprop), scm_cdar (bprop)))) + ( + !(unsmob_input (aval) && unsmob_input (bval)) + && + !to_boolean (scm_equal_p (aval, bval)))) return SCM_BOOL_F; } diff --git a/lily/quote-iterator.cc b/lily/quote-iterator.cc index dead1d503e..849472c329 100644 --- a/lily/quote-iterator.cc +++ b/lily/quote-iterator.cc @@ -15,7 +15,6 @@ #include "lily-guile.hh" #include "music-sequence.hh" #include "music.hh" -#include "stream-event.hh" #include "warn.hh" class Quote_iterator : public Music_wrapper_iterator diff --git a/lily/relative-octave-check.cc b/lily/relative-octave-check.cc index 651702ce99..388e2f2d0f 100644 --- a/lily/relative-octave-check.cc +++ b/lily/relative-octave-check.cc @@ -9,7 +9,6 @@ #include "input.hh" #include "international.hh" #include "music.hh" -#include "pitch.hh" class Relative_octave_check { diff --git a/lily/relative-octave-music.cc b/lily/relative-octave-music.cc index d8dadb981b..f940a8b68b 100644 --- a/lily/relative-octave-music.cc +++ b/lily/relative-octave-music.cc @@ -7,7 +7,6 @@ */ #include "music.hh" -#include "pitch.hh" #include "warn.hh" #include "program-option.hh" diff --git a/lily/rest-collision-engraver.cc b/lily/rest-collision-engraver.cc index 6158a8b4f4..fb1c763b9e 100644 --- a/lily/rest-collision-engraver.cc +++ b/lily/rest-collision-engraver.cc @@ -10,6 +10,7 @@ #include "engraver.hh" #include "rest-collision.hh" #include "note-column.hh" +#include "item.hh" class Rest_collision_engraver : public Engraver { diff --git a/lily/rest-collision.cc b/lily/rest-collision.cc index 959bf2156b..3e82328837 100644 --- a/lily/rest-collision.cc +++ b/lily/rest-collision.cc @@ -21,6 +21,7 @@ using namespace std; #include "rhythmic-head.hh" #include "staff-symbol-referencer.hh" #include "stem.hh" +#include "grob.hh" #include "warn.hh" MAKE_SCHEME_CALLBACK (Rest_collision, force_shift_callback, 1); @@ -260,7 +261,7 @@ Rest_collision::calc_positioning_done (SCM smob) return SCM_UNSPECIFIED; } -ADD_INTERFACE (Rest_collision, "rest-collision-interface", +ADD_INTERFACE (Rest_collision, "Move around ordinary rests (not multi-measure-rests) to avoid " "conflicts.", diff --git a/lily/rest.cc b/lily/rest.cc index d7351d648a..e3543e4cb9 100644 --- a/lily/rest.cc +++ b/lily/rest.cc @@ -16,6 +16,7 @@ #include "paper-score.hh" #include "staff-symbol-referencer.hh" #include "stencil.hh" +#include "grob.hh" // -> offset callback MAKE_SCHEME_CALLBACK (Rest, y_offset_callback, 1); @@ -186,7 +187,7 @@ Rest::generic_extent_callback (Grob *me, Axis a) return ly_interval2scm (unsmob_stencil (m)->extent (a)); } -ADD_INTERFACE (Rest, "rest-interface", +ADD_INTERFACE (Rest, "A rest symbol.", /* properties */ diff --git a/lily/rhythmic-column-engraver.cc b/lily/rhythmic-column-engraver.cc index 9543fcc92f..ec8b754873 100644 --- a/lily/rhythmic-column-engraver.cc +++ b/lily/rhythmic-column-engraver.cc @@ -10,6 +10,7 @@ #include "rhythmic-head.hh" #include "stem.hh" #include "note-column.hh" +#include "item.hh" #include "dot-column.hh" #include "pointer-group-interface.hh" diff --git a/lily/rhythmic-head.cc b/lily/rhythmic-head.cc index f771c75edc..00ef3ae020 100644 --- a/lily/rhythmic-head.cc +++ b/lily/rhythmic-head.cc @@ -50,8 +50,6 @@ Rhythmic_head::duration_log (Grob *me) ADD_INTERFACE (Rhythmic_head, - "rhythmic-head-interface", - "Note head or rest", "dot " diff --git a/lily/score-engraver.cc b/lily/score-engraver.cc index 1f8832831f..91cca081e7 100644 --- a/lily/score-engraver.cc +++ b/lily/score-engraver.cc @@ -20,7 +20,6 @@ #include "paper-column-engraver.hh" #include "paper-column.hh" #include "paper-score.hh" -#include "stream-event.hh" #include "system.hh" #include "warn.hh" diff --git a/lily/score-performer.cc b/lily/score-performer.cc index 34c5a1c78d..73f79add86 100644 --- a/lily/score-performer.cc +++ b/lily/score-performer.cc @@ -11,12 +11,10 @@ #include "audio-column.hh" #include "audio-item.hh" #include "context-def.hh" -#include "context.hh" #include "dispatcher.hh" #include "global-context.hh" #include "performance.hh" #include "midi-stream.hh" -#include "moment.hh" #include "output-def.hh" #include "string-convert.hh" #include "warn.hh" diff --git a/lily/script-column-engraver.cc b/lily/script-column-engraver.cc index ce69a3929c..ada6f0aac4 100644 --- a/lily/script-column-engraver.cc +++ b/lily/script-column-engraver.cc @@ -9,6 +9,7 @@ #include "engraver.hh" #include "script-column.hh" #include "side-position-interface.hh" +#include "item.hh" #include "translator.icc" @@ -18,7 +19,7 @@ class Script_column_engraver : public Engraver { Grob *script_column_; - vector scripts_; + vector scripts_; public: TRANSLATOR_DECLARATIONS (Script_column_engraver); diff --git a/lily/script-column.cc b/lily/script-column.cc index 36ebc6971c..a8fc0c3fc4 100644 --- a/lily/script-column.cc +++ b/lily/script-column.cc @@ -13,6 +13,7 @@ #include "directional-element-interface.hh" #include "side-position-interface.hh" #include "warn.hh" +#include "grob.hh" #include "pointer-group-interface.hh" #include @@ -132,7 +133,19 @@ Script_column::order_grobs (vector grobs) { Grob *g = unsmob_grob (scm_car (s)); if (last) - Side_position_interface::add_support (g, last); + { + SCM outside_staff = last->get_property ("outside-staff-priority"); + if (scm_is_number (outside_staff)) + { + /* we allow the outside-staff-priority ordering to override the + script-priority ordering */ + if (!scm_is_number (g->get_property ("outside-staff-priority"))) + g->set_property ("outside-staff-priority", + scm_from_double (scm_to_double (outside_staff) + 0.1)); + } + else + Side_position_interface::add_support (g, last); + } last = g; } @@ -140,7 +153,7 @@ Script_column::order_grobs (vector grobs) while (flip (&d) != DOWN); } -ADD_INTERFACE (Script_column, "script-column-interface", +ADD_INTERFACE (Script_column, "An interface that sorts scripts " "according to their @code{script-priority}", diff --git a/lily/script-interface.cc b/lily/script-interface.cc index de8198533b..94bebe9e60 100644 --- a/lily/script-interface.cc +++ b/lily/script-interface.cc @@ -9,6 +9,7 @@ #include "script-interface.hh" #include "directional-element-interface.hh" +#include "item.hh" #include "warn.hh" #include "font-interface.hh" #include "side-position-interface.hh" @@ -78,10 +79,10 @@ Script_interface::print (SCM smob) struct Text_script { - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); }; -ADD_INTERFACE (Text_script, "text-script-interface", +ADD_INTERFACE (Text_script, "An object that is put above or below a note", /* properties */ @@ -94,7 +95,7 @@ ADD_INTERFACE (Text_script, "text-script-interface", /* Hmm. Where should we put add-stem-support ? */ -ADD_INTERFACE (Script_interface, "script-interface", +ADD_INTERFACE (Script_interface, "An object that is put above or below a note", "add-stem-support " "avoid-slur " diff --git a/lily/script-row-engraver.cc b/lily/script-row-engraver.cc index da06274270..b84c5f22a2 100644 --- a/lily/script-row-engraver.cc +++ b/lily/script-row-engraver.cc @@ -10,6 +10,7 @@ #include "engraver.hh" #include "accidental-placement.hh" +#include "item.hh" #include "script-column.hh" #include "side-position-interface.hh" diff --git a/lily/self-aligment-interface.cc b/lily/self-aligment-interface.cc index 47e9fcc8f0..4c63ce73d2 100644 --- a/lily/self-aligment-interface.cc +++ b/lily/self-aligment-interface.cc @@ -8,6 +8,7 @@ #include "self-alignment-interface.hh" #include "warn.hh" +#include "grob.hh" MAKE_SCHEME_CALLBACK (Self_alignment_interface, y_aligned_on_self, 1); SCM @@ -131,7 +132,7 @@ Self_alignment_interface::set_align_self (Grob *me, Axis a) a); } -ADD_INTERFACE (Self_alignment_interface, "self-alignment-interface", +ADD_INTERFACE (Self_alignment_interface, "Position this object on itself and/or on its parent. To this end, the following functions " " are provided: \n" "@table @code \n" diff --git a/lily/semi-tie-column.cc b/lily/semi-tie-column.cc index 055b377c72..7a02ac578b 100644 --- a/lily/semi-tie-column.cc +++ b/lily/semi-tie-column.cc @@ -17,12 +17,10 @@ #include "staff-symbol-referencer.hh" #include "item.hh" #include "tie-formatting-problem.hh" -#include "tie-configuration.hh" #include "tie-column-format.hh" ADD_INTERFACE(Semi_tie_column, - "semi-tie-column-interface", "The interface for a column of l.v. ties.", /* properties */ diff --git a/lily/semi-tie.cc b/lily/semi-tie.cc index c5a514b535..77b266e6c4 100644 --- a/lily/semi-tie.cc +++ b/lily/semi-tie.cc @@ -17,8 +17,6 @@ ADD_INTERFACE(Semi_tie, - "semi-tie-interface", - "A tie which is only on one side connected to note heads. ", /* properties */ diff --git a/lily/separating-group-spanner.cc b/lily/separating-group-spanner.cc index 14e457b6ef..fb8cce0022 100644 --- a/lily/separating-group-spanner.cc +++ b/lily/separating-group-spanner.cc @@ -34,35 +34,11 @@ Separating_group_spanner::find_rods (Item *r, if (lb) { - Interval li (Separation_item::width (lb)); - Interval ri (Separation_item::conditional_width (r, lb)); - if (!li.is_empty () && !ri.is_empty ()) - { - Rod rod; - - rod.item_drul_[LEFT] = lb; - rod.item_drul_[RIGHT] = r; - - rod.distance_ = li[RIGHT] - ri[LEFT] + padding; - rod.add_to_cols (); - } + Separation_item::set_distance (Drul_array (lb, r), padding); } - Interval li (Separation_item::width (l)); - Interval ri (Separation_item::conditional_width (r, l)); - if (!li.is_empty () && !ri.is_empty ()) - { - Rod rod; - - rod.item_drul_[LEFT] = l; - rod.item_drul_[RIGHT] = r; - - rod.distance_ = li[RIGHT] - ri[LEFT] + padding; - - if (rod.distance_ > 0.0) - rod.add_to_cols (); - break; - } + if (Separation_item::set_distance (Drul_array (l, r), padding)) + break; /* this grob doesn't cause a constraint. We look further until we @@ -109,7 +85,7 @@ Separating_group_spanner::add_spacing_unit (Grob *me, Item *i) Pointer_group_interface::add_unordered_grob (me, ly_symbol2scm ("elements"), i); } -ADD_INTERFACE (Separating_group_spanner, "separation-spanner-interface", +ADD_INTERFACE (Separating_group_spanner, "A spanner that calculates spacing constraints (\"rods\") " "using the @code{separation-item-interface} grobs in @code{elements}.", diff --git a/lily/separating-line-group-engraver.cc b/lily/separating-line-group-engraver.cc index aa6f05a18f..b2aeb9b2ab 100644 --- a/lily/separating-line-group-engraver.cc +++ b/lily/separating-line-group-engraver.cc @@ -16,6 +16,7 @@ #include "note-spacing.hh" #include "accidental-placement.hh" #include "context.hh" +#include "spanner.hh" #include "grob-array.hh" #include "pointer-group-interface.hh" @@ -107,11 +108,11 @@ Separating_line_group_engraver::finalize () void Separating_line_group_engraver::acknowledge_item (Grob_info i) { - Item *it = dynamic_cast (i.grob ()); - if (!it) - return; + Item *it = i.item (); if (it->get_parent (X_AXIS) - && Axis_group_interface::has_axis (it->get_parent (X_AXIS), X_AXIS)) + && it->get_parent (X_AXIS) == it->get_parent (Y_AXIS) + && Axis_group_interface::has_axis (it->get_parent (X_AXIS), X_AXIS) + && Axis_group_interface::has_axis (it->get_parent (Y_AXIS), Y_AXIS)) return; if (to_boolean (it->get_property ("no-spacing-rods"))) diff --git a/lily/separation-item.cc b/lily/separation-item.cc index 6406a3e0fc..0a6c085afc 100644 --- a/lily/separation-item.cc +++ b/lily/separation-item.cc @@ -8,6 +8,7 @@ #include "separation-item.hh" +#include "skyline.hh" #include "paper-column.hh" #include "warn.hh" #include "pointer-group-interface.hh" @@ -26,79 +27,108 @@ Separation_item::add_conditional_item (Grob *me, Grob *e) Pointer_group_interface::add_grob (me, ly_symbol2scm ("conditional-elements"), e); } +void +Separation_item::set_skyline_distance (Drul_array items, + Real padding) +{ + Drul_array lines (Skyline_pair::unsmob (items[LEFT]->get_property ("skylines")), + Skyline_pair::unsmob (items[RIGHT]->get_property ("skylines"))); + Skyline right = conditional_skyline (items[RIGHT], items[LEFT]); + right.merge ((*lines[RIGHT])[LEFT]); + + Real dist = padding + (*lines[LEFT])[RIGHT].distance (right); + if (dist > 0) + { + Rod rod; + + rod.item_drul_ = items; + + rod.distance_ = dist; + rod.add_to_cols (); + } +} + +bool +Separation_item::set_distance (Drul_array items, + Real padding) +{ + set_skyline_distance (items, padding); + return true; +} + /* Return the width of ME given that we are considering the object on the LEFT. */ -Interval -Separation_item::conditional_width (Grob *me, Grob *left) +Skyline +Separation_item::conditional_skyline (Grob *me, Grob *left) { - Interval w = width (me); + vector bs = boxes (me, left); + return Skyline (bs, 0.1, Y_AXIS, LEFT); +} + + +MAKE_SCHEME_CALLBACK(Separation_item,calc_skylines,1); +SCM +Separation_item::calc_skylines (SCM smob) +{ + Item *me = unsmob_item (smob); + vector bs = boxes (me, 0); + /* todo: the horizon_padding is somewhat arbitrary */ + return Skyline_pair (bs, 0.1, Y_AXIS).smobbed_copy (); +} +/* if left is non-NULL, get the boxes corresponding to the + conditional-elements (conditioned on the grob LEFT). This + sounds more general than it is: conditional-elements are + always accidentals attached to a tied note. +*/ +vector +Separation_item::boxes (Grob *me, Grob *left) +{ Item *item = dynamic_cast (me); + + int very_large = INT_MAX; Paper_column *pc = item->get_column (); + vector out; + extract_grob_set (me, left ? "conditional-elements" : "elements", read_only_elts); + vector elts; - extract_grob_set (me, "conditional-elements", elts); + if (left) + elts = Accidental_placement::get_break_reminder_accidentals (read_only_elts, left); + else + elts = read_only_elts; + + Grob *ycommon = common_refpoint_of_array (elts, me, Y_AXIS); + for (vsize i = 0; i < elts.size (); i++) { Item *il = dynamic_cast (elts[i]); if (pc != il->get_column ()) { - /* this shouldn't happen, but let's continue anyway. */ - programming_error ("Separation_item: I've been drinking too much"); - continue; /*UGH UGH*/ + continue; } if (to_boolean (il->get_property ("no-spacing-rods"))) continue; - if (Accidental_placement::has_interface (il)) - w.unite (Accidental_placement::get_relevant_accidental_extent (il, pc, left)); - } + Interval y (il->pure_height (ycommon, 0, very_large)); + Interval x (il->extent (pc, X_AXIS)); - SCM pad = me->get_property ("padding"); + SCM padding = elts[i]->get_property ("padding"); + x.widen (robust_scm2double (padding, 0)); + + out.push_back (Box (x, y)); + } - w.widen (robust_scm2double (pad, 0.0)); - return w; + return out; } Interval Separation_item::width (Grob *me) { SCM sw = me->get_property ("X-extent"); - if (is_number_pair (sw)) - return ly_scm2interval (sw); - - Item *item = dynamic_cast (me); - Paper_column *pc = item->get_column (); - Interval w; - - extract_grob_set (me, "elements", elts); - for (vsize i = 0; i < elts.size (); i++) - { - Item *il = dynamic_cast (elts[i]); - if (pc != il->get_column ()) - { - /* this shouldn't happen, but let's continue anyway. */ - programming_error ("Separation_item: I've been drinking too much"); - continue; /*UGH UGH*/ - } - - if (to_boolean (il->get_property ("no-spacing-rods"))) - continue; - - Interval iv (il->extent (pc, X_AXIS)); - if (!iv.is_empty ()) - w.unite (iv); - } - - SCM pad = me->get_property ("padding"); - - w.widen (robust_scm2double (pad, 0.0)); - - me->set_property ("X-extent", ly_interval2scm (w)); - - return w; + return ly_scm2interval (sw); } Interval @@ -148,7 +178,13 @@ Separation_item::extremal_break_aligned_grob (Grob *me, return last_grob; } -ADD_INTERFACE (Separation_item, "separation-item-interface", +ADD_INTERFACE (Separation_item, "Item that computes widths to generate spacing rods. " - "This is done in concert with @ref{separation-spanner-interface}.", - "padding X-extent conditional-elements elements"); + "This is done in concert with @ref{separating-group-spanner-interface}.", + + "X-extent " + "conditional-elements " + "elements " + "padding " + "skylines " + ); diff --git a/lily/side-position-interface.cc b/lily/side-position-interface.cc index 73854bdc40..96751edf2c 100644 --- a/lily/side-position-interface.cc +++ b/lily/side-position-interface.cc @@ -22,6 +22,7 @@ using namespace std; #include "staff-symbol.hh" #include "string-convert.hh" #include "misc.hh" +#include "grob.hh" void Side_position_interface::add_support (Grob *me, Grob *e) @@ -276,7 +277,7 @@ Side_position_interface::get_axis (Grob *me) return NO_AXES; } -ADD_INTERFACE (Side_position_interface, "side-position-interface", +ADD_INTERFACE (Side_position_interface, "Position a victim object (this one) next to other objects (the " "support). The property @code{direction} signifies where to put the " "victim object relative to the support (left or right, up or down?)\n\n " diff --git a/lily/simple-closure.cc b/lily/simple-closure.cc index 139478983a..cea6584972 100644 --- a/lily/simple-closure.cc +++ b/lily/simple-closure.cc @@ -9,7 +9,6 @@ #include "simple-closure.hh" #include "grob.hh" -#include "lily-guile.hh" static scm_t_bits simple_closure_tag; diff --git a/lily/skyline.cc b/lily/skyline.cc index e52a6277d5..6b53a62ef8 100644 --- a/lily/skyline.cc +++ b/lily/skyline.cc @@ -7,17 +7,17 @@ #include "skyline.hh" -#include "line-interface.hh" +#include "ly-smobs.icc" /* A skyline is a sequence of non-overlapping buildings: something like this: _______ - / \ ________ - / \ ________/ \ - /\ / \ / \ - / -----/ \ / \ - / \ / \ - / ------------/ ---- + | \ ________ + | \ ________/ \ + /\ | \ / \ + / -------- \ / \ + / \ / \ + / ------------/ ---- -- Each building has a starting position, and ending position, a starting height and an ending height. @@ -44,85 +44,161 @@ #define EPS 1e-10 static inline bool -equal (Real x, Real y) +approx_equal (Real x, Real y) { return abs (x - y) < EPS || (isinf (x) && isinf (y) && ((x > 0) == (y > 0))); } +static inline bool +approx_greater_than (Real x, Real y) +{ + return x > y + EPS; +} + +static inline bool +approx_less_than (Real x, Real y) +{ + return x < y - EPS; +} + +static inline bool +approx_less_equal (Real x, Real y) +{ + return x <= y + EPS; +} + +static inline bool +approx_greater_equal (Real x, Real y) +{ + return x >= y - EPS; +} + +void +Skyline::print () const +{ + for (list::const_iterator i = buildings_.begin (); + i != buildings_.end (); i++) + { + (*i).print (); + } +} + bool Skyline::is_legal_skyline () const { list::const_iterator i; Real last_x = -infinity_f; - Real last_h = -infinity_f; for (i = buildings_.begin (); i != buildings_.end (); i++) { if (i->iv_[LEFT] != last_x) return false; - if (i != buildings_.begin () && !equal (i->start_height_, last_h)) - return false; last_x = i->iv_[RIGHT]; - last_h = i->end_height_; + if (isinf (i->iv_.length ()) && i->height_[LEFT] != i->height_[RIGHT]) + return false; } return last_x == infinity_f; } -Building::Building (Real start, Real start_height, Real end_height, Real end, Real max_slope) +Building::Building (Real start, Real start_height, Real end_height, Real end) : iv_ (start, end) { - start_height_ = start_height; - end_height_ = end_height; + height_[LEFT] = start_height; + height_[RIGHT] = end_height; + + if (isinf (start) || isinf (end)) + assert (start_height == end_height); + + precompute (); +} + +Building::Building (Box const &b, Real horizon_padding, Axis horizon_axis, Direction sky) +{ + Real height = sky * b[other_axis (horizon_axis)][sky]; - if (isinf (start)) - assert (isinf (start_height) || start_height == end_height); - if (isinf (end)) - assert (isinf (end_height) || start_height == end_height); + iv_ = b[horizon_axis]; + iv_.widen (horizon_padding + EPS); + height_[LEFT] = height; + height_[RIGHT] = height; + + if (sane ()) + precompute (); +} + +void +Building::precompute () +{ + slope_ = (height_[RIGHT] - height_[LEFT]) / (iv_.length()); + if (height_[LEFT] == height_[RIGHT]) /* in case they're both infinity */ + slope_ = 0; - m_ = (end_height - start_height) / (end - start); - if (start_height == end_height) - m_ = 0; - if (isinf (m_) || isnan (m_)) - m_ = max_slope * (start_height < end_height ? 1 : -1); - assert (abs (m_) <= max_slope); + assert (!isinf (slope_) && !isnan (slope_)); - if (isinf (start)) + if (isinf (iv_[START])) { - if (isinf (end)) - b_ = start_height; - else - b_ = end_height - m_*end; + assert (slope_ == 0); + y_intercept_ = height_[LEFT]; } else - b_ = start_height - m_*start; + y_intercept_ = height_[LEFT] - slope_ * iv_[START]; } Real Building::height (Real x) const { if (isinf (x)) - return (x > 0) ? end_height_ : start_height_; - return m_*x + b_; + return (x > 0) ? height_[RIGHT] : height_[LEFT]; + return slope_*x + y_intercept_; +} + +void +Building::print () const +{ + printf ("X[%f,%f] -> Y[%f,%f]\n", + iv_[LEFT], iv_[RIGHT], + height_[LEFT], height_[RIGHT]); } Real Building::intersection (Building const &other) const { - return (b_ - other.b_) / (other.m_ - m_); + return (y_intercept_ - other.y_intercept_) / (other.slope_ - slope_); } void -Building::leading_part (Real chop, Real h) +Building::leading_part (Real chop) { - assert (chop > iv_[LEFT] && chop <= iv_[RIGHT] && !equal (chop, iv_[LEFT])); - assert (equal (h, height (chop))); + assert (chop > iv_[LEFT] && chop <= iv_[RIGHT] && !approx_equal (chop, iv_[LEFT])); iv_[RIGHT] = chop; - end_height_ = h; + height_[RIGHT] = height (chop); +} + +Building +Building::sloped_neighbour (Real horizon_padding, Direction d) const +{ + Real left = iv_[d]; + Real right = iv_[d] + d * horizon_padding; + Real left_height = height_[d]; + Real right_height = height_[d] - horizon_padding; + if (d == LEFT) + { + swap (left, right); + swap (left_height, right_height); + } + return Building (left, left_height, right_height, right); +} + +bool +Building::sane () const +{ + return approx_less_than (iv_[LEFT], iv_[RIGHT]) + && !isinf (height_[RIGHT]) + && !isinf (height_[LEFT]); } static void skyline_trailing_part (list *sky, Real x) { - if (equal (x, sky->front ().iv_[RIGHT])) + if (approx_equal (x, sky->front ().iv_[RIGHT])) sky->pop_front (); else assert (x < sky->front ().iv_[RIGHT]); @@ -130,16 +206,25 @@ skyline_trailing_part (list *sky, Real x) if (!sky->empty ()) { sky->front ().iv_[LEFT] = x; - sky->front ().start_height_ = sky->front ().height (x); + sky->front ().height_[LEFT] = sky->front ().height (x); } } bool -Building::obstructs (Building const &other) const +Building::conceals_beginning (Building const &other) const { - if (equal (intersection (other), iv_[LEFT]) || equal (start_height_, other.start_height_)) - return m_ > other.m_ || (m_ == other.m_ && b_ > other.b_); - return start_height_ > other.start_height_; + if (approx_equal (intersection (other), iv_[LEFT]) || approx_equal (height_[LEFT], other.height_[LEFT])) + return slope_ > other.slope_; + return height_[LEFT] > other.height_[LEFT]; +} + +bool +Building::conceals (Building const &other) const +{ + assert (iv_[LEFT] <= other.iv_[LEFT]); + return (iv_[RIGHT] >= other.iv_[RIGHT]) + && approx_greater_equal (height (other.iv_[LEFT]), other.height_[LEFT]) + && approx_greater_equal (height (other.iv_[RIGHT]), other.height_[RIGHT]); } void @@ -148,29 +233,34 @@ Skyline::internal_merge_skyline (list *s1, list *s2, { while (!s1->empty ()) { - if (s2->front ().obstructs (s1->front ())) + if (s2->front ().conceals_beginning (s1->front ())) swap (s1, s2); Building b = s1->front (); - while (s2->front ().iv_[RIGHT] < b.iv_[RIGHT] - && s2->front ().end_height_ <= b.height (s2->front ().iv_[RIGHT]) + EPS) + while (!s2->empty () && b.conceals (s2->front ())) s2->pop_front (); + if (s2->empty ()) + { + result->push_front (b); + break; + } - /* the front of s2 either intersects with b or it ends after b */ + /* s2 either intersects with b or it ends after b */ Real end = infinity_f; - Real s2_end_height = s2->front ().end_height_; + Real s2_start_height = s2->front ().height_[LEFT]; + Real s2_end_height = s2->front ().height_[RIGHT]; + Real s1_start_height = b.height (s2->front ().iv_[LEFT]); Real s1_end_height = b.height (s2->front ().iv_[RIGHT]); - if (s2_end_height > s1_end_height + EPS) + if (approx_greater_than (s2_start_height, s1_start_height)) + end = s2->front ().iv_[LEFT]; + else if (approx_greater_than (s2_end_height, s1_end_height)) end = b.intersection (s2->front ()); end = min (end, b.iv_[RIGHT]); - Real height = b.height (end); - b.leading_part (end, height); + b.leading_part (end); result->push_front (b); skyline_trailing_part (s1, end); - if (!s1->empty ()) - s1->front ().start_height_ = height; skyline_trailing_part (s2, end); } result->reverse (); @@ -179,17 +269,28 @@ Skyline::internal_merge_skyline (list *s1, list *s2, static void empty_skyline (list *const ret) { - ret->push_front (Building (-infinity_f, -infinity_f, -infinity_f, infinity_f, 0)); + ret->push_front (Building (-infinity_f, -infinity_f, -infinity_f, infinity_f)); } static void -single_skyline (Building const &b, list *const ret, Real max_slope) +single_skyline (Building b, Real horizon_padding, list *const ret) { + b.iv_.widen (horizon_padding); + if (!isinf (b.iv_[RIGHT])) - ret->push_front (Building (b.iv_[RIGHT], b.end_height_, -infinity_f, infinity_f, max_slope)); - ret->push_front (b); + ret->push_front (Building (b.iv_[RIGHT], -infinity_f, + -infinity_f, infinity_f)); + if (horizon_padding > 0 && !isinf (b.iv_.length ())) + ret->push_front (b.sloped_neighbour (horizon_padding, RIGHT)); + + if (b.iv_[RIGHT] > b.iv_[LEFT]) + ret->push_front (b); + + if (horizon_padding > 0 && !isinf (b.iv_.length ())) + ret->push_front (b.sloped_neighbour (horizon_padding, LEFT)); if (!isinf (b.iv_[LEFT])) - ret->push_front (Building (-infinity_f, -infinity_f, b.start_height_, b.iv_[LEFT], max_slope)); + ret->push_front (Building (-infinity_f, -infinity_f, + -infinity_f, b.iv_[LEFT])); } void @@ -204,7 +305,7 @@ Skyline::internal_build_skyline (list *buildings, list *cons } else if (size == 1) { - single_skyline (buildings->front (), result, max_slope_); + single_skyline (buildings->front (), 0, result); return; } @@ -224,35 +325,66 @@ Skyline::internal_build_skyline (list *buildings, list *cons Skyline::Skyline () { - max_slope_ = 2; sky_ = UP; - empty_skyline (&buildings_); + empty_skyline (&buildings_); +} + +Skyline::Skyline (Skyline const &src) +{ + sky_ = src.sky_; + + for (list::const_iterator i = src.buildings_.begin (); + i != src.buildings_.end (); i++) + { + buildings_.push_back (Building ((*i))); + } } Skyline::Skyline (Direction sky) { - max_slope_ = 2; sky_ = sky; empty_skyline (&buildings_); } -Skyline::Skyline (vector const &boxes, Axis a, Direction sky) +/* + build skyline from a set of boxes. If horizon_padding > 0, expand all the boxes + by that amount and add 45-degree sloped boxes to the edges of each box (of + width horizon_padding). That is, the total amount of horizontal expansion is + horizon_padding*4, half of which is sloped and half of which is flat. + + Boxes should have fatness in the horizon_axis (after they are expanded by + horizon_padding), otherwise they are ignored. + */ +Skyline::Skyline (vector const &boxes, Real horizon_padding, Axis horizon_axis, Direction sky) { list bldgs; sky_ = sky; - max_slope_ = 2; for (vsize i = 0; i < boxes.size (); i++) { - Interval iv = boxes[i][a]; - Real height = sky * boxes[i][other_axis (a)][sky]; - if (!iv.is_empty () && !isinf (height) && !equal (iv[LEFT], iv[RIGHT])) - bldgs.push_front (Building (iv[LEFT], height, height, iv[RIGHT], max_slope_)); + Building front (boxes[i], horizon_padding, horizon_axis, sky); + if (front.sane ()) + { + bldgs.push_front (front); + if (horizon_padding > 0 && !isinf (front.iv_.length ())) + { + bldgs.push_front (front.sloped_neighbour (horizon_padding, LEFT)); + bldgs.push_front (front.sloped_neighbour (horizon_padding, RIGHT)); + } + } } + internal_build_skyline (&bldgs, &buildings_); assert (is_legal_skyline ()); } +Skyline::Skyline (Box const &b, Real horizon_padding, Axis horizon_axis, Direction sky) +{ + sky_ = sky; + Building front (b, 0, horizon_axis, sky); + single_skyline (front, horizon_padding, &buildings_); +} + void Skyline::merge (Skyline const &other) { @@ -266,15 +398,13 @@ Skyline::merge (Skyline const &other) } void -Skyline::insert (Box const &b, Axis a) +Skyline::insert (Box const &b, Real horizon_padding, Axis a) { list other_bld; list my_bld; - Interval iv = b[a]; - Real height = sky_ * b[other_axis (a)][sky_]; my_bld.splice (my_bld.begin (), buildings_); - single_skyline (Building (iv[LEFT], height, height, iv[RIGHT], max_slope_), &other_bld, max_slope_); + single_skyline (Building (b, 0, a, sky_), horizon_padding, &other_bld); internal_merge_skyline (&other_bld, &my_bld, &buildings_); assert (is_legal_skyline ()); } @@ -285,13 +415,24 @@ Skyline::raise (Real r) list::iterator end = buildings_.end (); for (list::iterator i = buildings_.begin (); i != end; i++) { - i->start_height_ += sky_ * r; - i->end_height_ += sky_ * r; - i->b_ += sky_ * r; + i->height_[LEFT] += sky_ * r; + i->height_[RIGHT] += sky_ * r; + i->y_intercept_ += sky_ * r; } assert (is_legal_skyline ()); } +void +Skyline::shift (Real r) +{ + list::iterator end = buildings_.end (); + for (list::iterator i = buildings_.begin (); i != end; i++) + { + i->iv_[LEFT] += r; + i->iv_[RIGHT] += r; + } +} + Real Skyline::distance (Skyline const &other) const { @@ -324,6 +465,7 @@ Skyline::height (Real airplane) const if (i->iv_[RIGHT] >= airplane) return sky_ * i->height (airplane); } + assert (0); return 0; } @@ -340,25 +482,124 @@ void Skyline::set_minimum_height (Real h) { Skyline s (sky_); - s.buildings_.front ().start_height_ = h*sky_; - s.buildings_.front ().end_height_ = h*sky_; - s.buildings_.front ().b_ = h*sky_; + s.buildings_.front ().height_[LEFT] = h * sky_; + s.buildings_.front ().height_[RIGHT] = h * sky_; + s.buildings_.front ().y_intercept_ = h * sky_; merge (s); } -Stencil -Skyline::stencil () + +vector +Skyline::to_points () const { - Stencil ret; - for (list::iterator i = buildings_.begin (); i != buildings_.end (); i++) + vector out; + + for (list::const_iterator i (buildings_.begin ()); + i != buildings_.end (); i++) { - if (!isinf (i->iv_.length ())) - { - Stencil line = Line_interface::make_line (0.1, - Offset (i->iv_[LEFT], sky_*i->start_height_), - Offset (i->iv_[RIGHT], sky_*i->end_height_)); - ret.add_stencil (line); - } + if (!isinf (i->iv_[LEFT]) && !isinf (i->height_[LEFT])) + out.push_back (Offset (i->iv_[LEFT], sky_ * i->height_[LEFT])); + if (!isinf (i->iv_[RIGHT]) && !isinf (i->height_[RIGHT])) + out.push_back (Offset (i->iv_[RIGHT], sky_ * i->height_[RIGHT])); } - return ret; + return out; +} + +Skyline_pair::Skyline_pair () + : skylines_ (Skyline (DOWN), Skyline (UP)) +{ +} + +Skyline_pair::Skyline_pair (vector const &boxes, Real padding, Axis a) + : skylines_ (Skyline (boxes, padding, a, DOWN), Skyline (boxes, padding, a, UP)) +{ +} + +Skyline_pair::Skyline_pair (Box const &b, Real padding, Axis a) + : skylines_ (Skyline (b, padding, a, DOWN), Skyline (b, padding, a, UP)) +{ +} + +void +Skyline_pair::raise (Real r) +{ + skylines_[UP].raise (r); + skylines_[DOWN].raise (r); +} + +void +Skyline_pair::shift (Real r) +{ + skylines_[UP].shift (r); + skylines_[DOWN].shift (r); +} + +void +Skyline_pair::insert (Box const &b, Real padding, Axis a) +{ + skylines_[UP].insert (b, padding, a); + skylines_[DOWN].insert (b, padding, a); +} + +void +Skyline_pair::merge (Skyline_pair const &other) +{ + skylines_[UP].merge (other[UP]); + skylines_[DOWN].merge (other[DOWN]); +} + +Skyline& +Skyline_pair::operator [] (Direction d) +{ + return skylines_[d]; +} + +Skyline const& +Skyline_pair::operator [] (Direction d) const +{ + return skylines_[d]; +} + +/****************************************************************/ + + +IMPLEMENT_SIMPLE_SMOBS (Skyline); +IMPLEMENT_TYPE_P (Skyline, "ly:skyline?"); +IMPLEMENT_DEFAULT_EQUAL_P (Skyline); + +IMPLEMENT_SIMPLE_SMOBS (Skyline_pair); +IMPLEMENT_TYPE_P (Skyline_pair, "ly:skyline-pair?"); +IMPLEMENT_DEFAULT_EQUAL_P (Skyline_pair); + +SCM +Skyline::mark_smob (SCM) +{ + return SCM_EOL; +} + +int +Skyline::print_smob (SCM s, SCM port, scm_print_state *) +{ + Skyline *r = (Skyline *) SCM_CELL_WORD_1 (s); + (void) r; + + scm_puts ("#", port); + + return 1; +} + +SCM +Skyline_pair::mark_smob (SCM) +{ + return SCM_EOL; +} + +int +Skyline_pair::print_smob (SCM s, SCM port, scm_print_state *) +{ + Skyline_pair *r = (Skyline_pair *) SCM_CELL_WORD_1 (s); + (void) r; + + scm_puts ("#", port); + return 1; } diff --git a/lily/slur.cc b/lily/slur.cc index a87feb6850..88697c2bb1 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -8,7 +8,7 @@ */ #include "slur.hh" - +#include "grob-info.hh" #include "grob-array.hh" #include "beam.hh" #include "bezier.hh" @@ -212,7 +212,7 @@ void Slur::add_column (Grob *me, Grob *n) { Pointer_group_interface::add_grob (me, ly_symbol2scm ("note-columns"), n); - add_bound_item (dynamic_cast (me), dynamic_cast (n)); + add_bound_item (dynamic_cast (me), n); } void @@ -320,7 +320,7 @@ Slur::outside_slur_callback (SCM grob, SCM offset_scm) * Used by Slur_engraver:: and Phrasing_slur_engraver:: */ void -Slur::auxiliary_acknowledge_extra_object (Grob_info info, +Slur::auxiliary_acknowledge_extra_object (Grob_info const &info, vector &slurs, vector &end_slurs) { @@ -357,7 +357,7 @@ Slur::auxiliary_acknowledge_extra_object (Grob_info info, } -ADD_INTERFACE (Slur, "slur-interface", +ADD_INTERFACE (Slur, "A slur", diff --git a/lily/spaceable-grob.cc b/lily/spaceable-grob.cc index 0f3dc9849b..679c2bcb19 100644 --- a/lily/spaceable-grob.cc +++ b/lily/spaceable-grob.cc @@ -120,7 +120,7 @@ Spaceable_grob::remove_interface (Grob *me) me->set_object ("ideal-distances", SCM_EOL); } -ADD_INTERFACE (Spaceable_grob, "spaceable-grob-interface", +ADD_INTERFACE (Spaceable_grob, "A layout object that takes part in the spacing problem. ", diff --git a/lily/spacing-basic.cc b/lily/spacing-basic.cc index fcae3dfcc2..2e81fdf416 100644 --- a/lily/spacing-basic.cc +++ b/lily/spacing-basic.cc @@ -7,9 +7,13 @@ */ #include "spacing-spanner.hh" + +#include "spacing-options.hh" #include "moment.hh" #include "paper-column.hh" #include "warn.hh" +#include "pointer-group-interface.hh" +#include "system.hh" /* LilyPond spaces by taking a simple-minded spacing algorithm, and @@ -75,6 +79,34 @@ Spacing_spanner::standard_breakable_column_spacing (Grob *me, Item *l, Item *r, } } +Moment * +get_measure_length (Grob *column) +{ + Grob * sys = column->get_parent (X_AXIS); + + extract_grob_set (sys, "columns", cols); + + vsize col_idx = binary_search (cols, column, + Paper_column::less_than); + + if (col_idx == VPOS) + { + programming_error ( __FUNCTION__ + string (": Unknown column")); + return 0; + } + + do + { + if (Moment *len = unsmob_moment (cols[col_idx]->get_property ("measure-length"))) + { + return len; + } + } + while (col_idx-- != 0); + + return 0; +} + Real Spacing_spanner::note_spacing (Grob *me, Grob *lc, Grob *rc, Spacing_options const *options, @@ -106,7 +138,7 @@ Spacing_spanner::note_spacing (Grob *me, Grob *lc, Grob *rc, several measures. */ - Moment *dt = unsmob_moment (rc->get_property ("measure-length")); + Moment *dt = get_measure_length (lc); if (dt) { delta_t = min (delta_t, *dt); diff --git a/lily/spacing-determine-loose-columns.cc b/lily/spacing-determine-loose-columns.cc index 8cd0b9b6a0..fe5a89c80b 100644 --- a/lily/spacing-determine-loose-columns.cc +++ b/lily/spacing-determine-loose-columns.cc @@ -9,6 +9,7 @@ #include "staff-spacing.hh" +#include "spacing-options.hh" #include "system.hh" #include "paper-column.hh" #include "column-x-positions.hh" @@ -16,6 +17,7 @@ #include "spacing-spanner.hh" #include "note-spacing.hh" #include "moment.hh" +#include "grob-array.hh" #include "break-align-interface.hh" #include "warn.hh" @@ -105,7 +107,7 @@ is_loose_column (Grob *l, Grob *col, Grob *r, Spacing_options const *options) for (vsize i = elts.size (); i--;) { Grob *g = elts[i]; - if (g && Break_align_interface::has_interface (g)) + if (g && Break_alignment_interface::has_interface (g)) { extract_grob_set (g, "elements", gelts); for (vsize j = gelts.size (); j--;) diff --git a/lily/spacing-engraver.cc b/lily/spacing-engraver.cc index 56886a560c..c6fc091de0 100644 --- a/lily/spacing-engraver.cc +++ b/lily/spacing-engraver.cc @@ -185,6 +185,7 @@ Spacing_engraver::stop_translation_timestep () { musical_column->set_property ("shortest-playing-duration", proportional); musical_column->set_property ("shortest-starter-duration", proportional); + musical_column->set_property ("used", SCM_BOOL_T); return; } diff --git a/lily/spacing-loose-columns.cc b/lily/spacing-loose-columns.cc index 13a37071c0..94bc552e6f 100644 --- a/lily/spacing-loose-columns.cc +++ b/lily/spacing-loose-columns.cc @@ -15,6 +15,7 @@ #include "spacing-spanner.hh" #include "warn.hh" #include "moment.hh" +#include "spacing-options.hh" /* Find the loose columns in POSNS, and drape them around the columns specified in BETWEEN-COLS. */ diff --git a/lily/spacing-options.cc b/lily/spacing-options.cc index 916408aa73..c0e11fa62c 100644 --- a/lily/spacing-options.cc +++ b/lily/spacing-options.cc @@ -7,7 +7,7 @@ */ -#include "spacing-spanner.hh" +#include "spacing-options.hh" #include "grob.hh" #include "misc.hh" #include "moment.hh" diff --git a/lily/spacing-spanner.cc b/lily/spacing-spanner.cc index 2f6e90326c..31f7df6c8e 100644 --- a/lily/spacing-spanner.cc +++ b/lily/spacing-spanner.cc @@ -10,8 +10,10 @@ #include #include + using namespace std; +#include "spacing-options.hh" #include "international.hh" #include "main.hh" #include "moment.hh" @@ -493,7 +495,7 @@ Spacing_spanner::breakable_column_spacing (Grob *me, Item *l, Item *r, Spaceable_grob::add_spring (l, r, distance, inverse_strength); } -ADD_INTERFACE (Spacing_spanner, "spacing-spanner-interface", +ADD_INTERFACE (Spacing_spanner, "The space taken by a note is dependent on its duration. Doubling a\n" "duration adds spacing-increment to the space. The most common shortest\n" "note gets @code{shortest-duration-space}. Notes that are even shorter are\n" @@ -518,7 +520,7 @@ ADD_INTERFACE (Spacing_spanner, "spacing-spanner-interface", ); -ADD_INTERFACE (Spacing_interface, "spacing-interface", +ADD_INTERFACE (Spacing_interface, "Something to do with line breaking and spacing. " "Kill this one after determining line breaks.", diff --git a/lily/span-arpeggio-engraver.cc b/lily/span-arpeggio-engraver.cc index 55babfbfee..4a81d5bdba 100644 --- a/lily/span-arpeggio-engraver.cc +++ b/lily/span-arpeggio-engraver.cc @@ -13,6 +13,7 @@ #include "pointer-group-interface.hh" #include "side-position-interface.hh" #include "staff-symbol-referencer.hh" +#include "item.hh" /** Make arpeggios that span multiple staves. Catch arpeggios, and span a @@ -72,12 +73,12 @@ Span_arpeggio_engraver::stop_translation_timestep () for (vsize j = 0; j < arpeggios_.size (); j++) { extract_grob_set (arpeggios_[j], "stems", stems); - for (vsize i = stems.size (); i--;) + for (vsize i = 0; i < stems.size (); i++) Pointer_group_interface::add_grob (span_arpeggio_, ly_symbol2scm ("stems"), stems[i]); extract_grob_set (arpeggios_[j], "side-support-elements", sses); - for (vsize i = sses.size (); i--;) + for (vsize i = 0; i < sses.size (); i++) Pointer_group_interface::add_grob (span_arpeggio_, ly_symbol2scm ("side-support-elements"), sses[i]); diff --git a/lily/span-bar.cc b/lily/span-bar.cc index 5c1c76e855..4566d73f77 100644 --- a/lily/span-bar.cc +++ b/lily/span-bar.cc @@ -209,7 +209,7 @@ Span_bar::calc_bar_size (SCM smob) return scm_from_double (iv.length ()); } -ADD_INTERFACE (Span_bar, "span-bar-interface", +ADD_INTERFACE (Span_bar, "A bar line that spanned between other barlines. This interface is " " used for bar lines that connect different staves.", diff --git a/lily/spanner.cc b/lily/spanner.cc index 955ba76ef3..c0ac823b02 100644 --- a/lily/spanner.cc +++ b/lily/spanner.cc @@ -6,9 +6,6 @@ (c) 1996--2006 Han-Wen Nienhuys */ -#include "spanner.hh" - - #include "pointer-group-interface.hh" #include "libc-extension.hh" #include "paper-column.hh" @@ -337,16 +334,33 @@ SCM Spanner::set_spacing_rods (SCM smob) { Grob *me = unsmob_grob (smob); - - Rod r; - Spanner *sp = dynamic_cast (me); - r.item_drul_[LEFT] = sp->get_bound (LEFT); - r.item_drul_[RIGHT] = sp->get_bound (RIGHT); - SCM num_length = me->get_property ("minimum-length"); if (scm_is_number (num_length)) { + Rod r; + Spanner *sp = dynamic_cast (me); + + + System *root = get_root_system (me); + vector cols (root->broken_col_range (sp->get_bound (LEFT)->get_column (), + sp->get_bound (RIGHT)->get_column ())); + + if (cols.size ()) + { + Rod r ; + r.item_drul_[LEFT] = sp->get_bound (LEFT); + r.item_drul_[RIGHT] = cols[0]->find_prebroken_piece (LEFT); + r.distance_ = robust_scm2double (num_length, 0); + r.add_to_cols (); + + r.item_drul_[LEFT] = cols.back ()->find_prebroken_piece (RIGHT); + r.item_drul_[RIGHT] = sp->get_bound (RIGHT); + r.add_to_cols (); + } + r.distance_ = robust_scm2double (num_length, 0); + r.item_drul_[LEFT] = sp->get_bound (LEFT); + r.item_drul_[RIGHT] = sp->get_bound (RIGHT); r.add_to_cols (); } @@ -371,7 +385,6 @@ unsmob_spanner (SCM s) } ADD_INTERFACE (Spanner, - "spanner-interface", "Some objects are horizontally spanned between objects. For\n" "example, slur, beam, tie, etc. These grobs form a subtype called\n" "@code{Spanner}. All spanners have two span-points (these must be\n" diff --git a/lily/staff-spacing.cc b/lily/staff-spacing.cc index 1d9182c16c..f89113187e 100644 --- a/lily/staff-spacing.cc +++ b/lily/staff-spacing.cc @@ -261,7 +261,7 @@ Staff_spacing::get_spacing_params (Grob *me, Real *space, Real *fixed) *fixed += correction_fixed; } -ADD_INTERFACE (Staff_spacing, "staff-spacing-interface", +ADD_INTERFACE (Staff_spacing, "This object calculates spacing details from a " " breakable symbol (left) to another object. For example, it takes care " " of optical spacing from a bar lines to a note.", diff --git a/lily/staff-symbol-referencer.cc b/lily/staff-symbol-referencer.cc index aa45e55e7a..7fe0bf3131 100644 --- a/lily/staff-symbol-referencer.cc +++ b/lily/staff-symbol-referencer.cc @@ -8,8 +8,8 @@ #include "staff-symbol-referencer.hh" - #include "staff-symbol.hh" +#include "grob.hh" #include "output-def.hh" #include "libc-extension.hh" @@ -163,7 +163,7 @@ position_less (Grob *const &a, Grob *const &b) < Staff_symbol_referencer::get_position (b); } -ADD_INTERFACE (Staff_symbol_referencer, "staff-symbol-referencer-interface", +ADD_INTERFACE (Staff_symbol_referencer, "An object whose Y position is meant relative to a staff " "symbol. " "These usually have @code{Staff_symbol_referencer::callback} " diff --git a/lily/staff-symbol.cc b/lily/staff-symbol.cc index 6edb1f910e..f999346753 100644 --- a/lily/staff-symbol.cc +++ b/lily/staff-symbol.cc @@ -170,7 +170,7 @@ Staff_symbol::height (SCM smob) -ADD_INTERFACE (Staff_symbol, "staff-symbol-interface", +ADD_INTERFACE (Staff_symbol, "This spanner draws the lines of a staff. " "A staff symbol definines a vertical unit, the staff space. " "Quantities that go by a half staff space are called positions " diff --git a/lily/stanza-number-engraver.cc b/lily/stanza-number-engraver.cc index 43a044552f..bdf4ae5db2 100644 --- a/lily/stanza-number-engraver.cc +++ b/lily/stanza-number-engraver.cc @@ -9,6 +9,7 @@ #include "engraver.hh" #include "side-position-interface.hh" #include "text-interface.hh" +#include "item.hh" class Stanza_number_engraver : public Engraver { diff --git a/lily/stem-engraver.cc b/lily/stem-engraver.cc index 93f2a67aed..1dfef14b73 100644 --- a/lily/stem-engraver.cc +++ b/lily/stem-engraver.cc @@ -23,9 +23,6 @@ #include "translator.icc" -/** - Make stems upon receiving noteheads. -*/ class Stem_engraver : public Engraver { Grob *stem_; diff --git a/lily/stem-tremolo.cc b/lily/stem-tremolo.cc index 6729aa934c..e607fda1b0 100644 --- a/lily/stem-tremolo.cc +++ b/lily/stem-tremolo.cc @@ -215,7 +215,7 @@ Stem_tremolo::print (SCM grob) return s.smobbed_copy (); } -ADD_INTERFACE (Stem_tremolo, "stem-tremolo-interface", +ADD_INTERFACE (Stem_tremolo, "A beam slashing a stem to indicate a tremolo.", "beam-thickness " diff --git a/lily/stem.cc b/lily/stem.cc index 69e7a15ce6..fc21f2d6b9 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -14,6 +14,7 @@ */ #include "stem.hh" +#include "spanner.hh" #include // rint using namespace std; @@ -988,7 +989,7 @@ Stem::beam_multiplicity (Grob *stem) } /* FIXME: Too many properties */ -ADD_INTERFACE (Stem, "stem-interface", +ADD_INTERFACE (Stem, "The stem represent the graphical stem. " "In addition, it internally connects note heads, beams and" "tremolos. " diff --git a/lily/stream-event-scheme.cc b/lily/stream-event-scheme.cc index ea93654961..1f890782a4 100644 --- a/lily/stream-event-scheme.cc +++ b/lily/stream-event-scheme.cc @@ -26,7 +26,7 @@ LY_DEFINE (ly_make_stream_event, "ly:make-stream-event", LY_DEFINE (ly_event_property, "ly:event-property", 2, 0, 0, (SCM sev, SCM sym), "Get the property @var{sym} of stream event @var{mus}.\n" - "If @var{sym} is undefined, return @code{' ()}.\n") + "If @var{sym} is undefined, return @code{'()}.\n") { Stream_event *e = unsmob_stream_event (sev); SCM_ASSERT_TYPE (e, sev, SCM_ARG1, __FUNCTION__, "stream event"); diff --git a/lily/system-start-delimiter.cc b/lily/system-start-delimiter.cc index 7099ca7e7a..c3fe50250a 100644 --- a/lily/system-start-delimiter.cc +++ b/lily/system-start-delimiter.cc @@ -175,7 +175,6 @@ System_start_delimiter::staff_brace (Grob *me, Real y) } ADD_INTERFACE (System_start_delimiter, - "system-start-delimiter-interface", "The brace, bracket or bar in front of the system. " , diff --git a/lily/system-start-text.cc b/lily/system-start-text.cc index 5a90191081..a0a90b06c3 100644 --- a/lily/system-start-text.cc +++ b/lily/system-start-text.cc @@ -19,7 +19,7 @@ class System_start_text { public: static Stencil get_stencil (Grob *); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); DECLARE_SCHEME_CALLBACK (print, (SCM)); }; @@ -95,7 +95,6 @@ System_start_text::print (SCM smob) ADD_INTERFACE (System_start_text, - "system-start-text-interface", "Text in front of the system.", /* properties */ diff --git a/lily/system.cc b/lily/system.cc index 7c1828cabd..90eb463c44 100644 --- a/lily/system.cc +++ b/lily/system.cc @@ -402,8 +402,8 @@ System::get_paper_system () exprs)); if (debug_skylines) { - sys_stencil.add_stencil (skylines_[UP].stencil ().in_color (255, 0, 0)); - sys_stencil.add_stencil (skylines_[DOWN].stencil ().in_color (0, 255, 0)); + sys_stencil.add_stencil (points_to_line_stencil (skylines_[UP].to_points ()).in_color (255, 0, 0)); + sys_stencil.add_stencil (points_to_line_stencil (skylines_[DOWN].to_points ()).in_color (0, 255, 0)); } Grob *left_bound = this->get_bound (LEFT); @@ -445,17 +445,18 @@ System::broken_col_range (Item const *left, Item const *right) const left = left->get_column (); right = right->get_column (); + extract_grob_set (this, "columns", cols); - vsize i = 0; - while (i < cols.size () - && cols[i] != left) - i++; + vsize i = binary_search (cols, (Grob *) left, + Paper_column::less_than); + + int end_rank = Paper_column::get_rank (right); if (i < cols.size ()) i++; while (i < cols.size () - && cols[i] != right) + && Paper_column::get_rank (cols[i]) < end_rank) { Paper_column *c = dynamic_cast (cols[i]); if (Paper_column::is_breakable (c) && !c->system_) @@ -466,6 +467,7 @@ System::broken_col_range (Item const *left, Item const *right) const return ret; } + /** Return all columns, but filter out any unused columns , since they might disrupt the spacing problem. */ vector @@ -530,12 +532,14 @@ System::build_skylines () boxes.push_back (Box (xiv, yiv)); } - skylines_[UP] = Skyline (boxes, X_AXIS, UP); - skylines_[DOWN] = Skyline (boxes, X_AXIS, DOWN); + SCM horizon_padding_scm = get_property ("skyline-horizontal-padding"); + Real horizon_padding = robust_scm2double (horizon_padding_scm, 0); + skylines_[UP] = Skyline (boxes, horizon_padding, X_AXIS, UP); + skylines_[DOWN] = Skyline (boxes, horizon_padding, X_AXIS, DOWN); } -ADD_INTERFACE (System, "system-interface", +ADD_INTERFACE (System, "This is the toplevel object: each object in a score " "ultimately has a System object as its X and Y parent. ", @@ -545,4 +549,5 @@ ADD_INTERFACE (System, "system-interface", "pure-Y-extent " "spaceable-staves " "skyline-distance " + "skyline-horizontal-padding " ) diff --git a/lily/tab-harmonic-engraver.cc b/lily/tab-harmonic-engraver.cc new file mode 100644 index 0000000000..385b462cbd --- /dev/null +++ b/lily/tab-harmonic-engraver.cc @@ -0,0 +1,73 @@ +/* + tab-harmonic-engraver.cc -- implement Tab_harmonic_engraver + + source file of the GNU LilyPond music typesetter + + (c) 2005--2006 Han-Wen Nienhuys + +*/ + +#include "engraver.hh" + +#include "item.hh" +#include "pointer-group-interface.hh" +#include "simple-closure.hh" +#include "stream-event.hh" +#include "warn.hh" + +#include "translator.icc" + +class Tab_harmonic_engraver : public Engraver +{ + TRANSLATOR_DECLARATIONS (Tab_harmonic_engraver); + +protected: + DECLARE_ACKNOWLEDGER (note_head); +}; + +Tab_harmonic_engraver::Tab_harmonic_engraver() +{ +} + +void +Tab_harmonic_engraver::acknowledge_note_head (Grob_info info) +{ + if (Stream_event *note = info.event_cause ()) + { + for (SCM s = note->get_property ("articulations"); + scm_is_pair (s); s = scm_cdr (s)) + { + Stream_event *ev = unsmob_stream_event (scm_car (s)); + + if (!ev) + continue; + + + if (ev->in_event_class ("harmonic-event")) + { + if (Item *victim = info.item ()) + { + Engraver *eng = dynamic_cast (info.origin_translator ()); + Item *paren = eng->make_item ("HarmonicParenthesesItem", victim->self_scm ()); + Pointer_group_interface::add_grob (paren, ly_symbol2scm ("elements"), victim); + + paren->set_parent (victim, Y_AXIS); + + Real size = robust_scm2double (paren->get_property ("font-size"), 0.0) + + robust_scm2double (victim->get_property ("font-size"), 0.0); + paren->set_property ("font-size", scm_from_double (size)); + } + } + } + } +} + +ADD_ACKNOWLEDGER (Tab_harmonic_engraver, note_head); +ADD_TRANSLATOR (Tab_harmonic_engraver, + /* doc */ "Parenthesize objects whose music cause has the @code{parenthesize} " + "property.", + + /* create */ + "HarmonicParenthesesItem ", + /* read */ "", + /* write */ ""); diff --git a/lily/tab-note-heads-engraver.cc b/lily/tab-note-heads-engraver.cc index 7870c0218a..a9e6556734 100644 --- a/lily/tab-note-heads-engraver.cc +++ b/lily/tab-note-heads-engraver.cc @@ -1,9 +1,7 @@ /* tab-note-heads-engraver.cc -- part of GNU LilyPond - based on note-heads-engraver.cc, by Jean-Baptiste Lamy , - - (c) 2002--2006 + (c) 2002--2006 Han-Wen Nienhuys, Jean-Baptiste Lamy , */ #include @@ -20,6 +18,7 @@ using namespace std; #include "rhythmic-head.hh" #include "stream-event.hh" #include "warn.hh" +#include "context.hh" #include "translator.icc" @@ -67,8 +66,8 @@ Tab_note_heads_engraver::process_music () vsize j = 0; for (vsize i = 0; i < note_events_.size (); i++) { - SCM stringTunings = get_property ("stringTunings"); - int number_of_strings = scm_ilength (stringTunings); + SCM string_tunings = get_property ("stringTunings"); + int number_of_strings = scm_ilength (string_tunings); bool high_string_one = to_boolean (get_property ("highStringOne")); Stream_event *event = note_events_[i]; @@ -115,22 +114,26 @@ Tab_note_heads_engraver::process_music () while (!string_found) { int fret = unsmob_pitch (scm_pitch)->semitone_pitch () - - scm_to_int (scm_list_ref (stringTunings, scm_from_int (tab_string - 1))); + - scm_to_int (scm_list_ref (string_tunings, scm_from_int (tab_string - 1))); if (fret < min_fret) tab_string += high_string_one ? 1 : -1; else string_found = true; } - SCM text = scm_call_3 (proc, scm_from_int (tab_string), stringTunings, scm_pitch); + SCM text = scm_call_3 (proc, scm_from_int (tab_string), + context ()->self_scm (), + event->self_scm ()); + note->set_property ("text", text); + int pos = 2 * tab_string - number_of_strings - 1; // No tab-note between the string !!! if (to_boolean (get_property ("stringOneTopmost"))) pos = -pos; - note->set_property ("text", text); - note->set_property ("staff-position", scm_from_int (pos)); + + notes_.push_back (note); } } diff --git a/lily/text-engraver.cc b/lily/text-engraver.cc index bf1dfbd811..a3447ccce7 100644 --- a/lily/text-engraver.cc +++ b/lily/text-engraver.cc @@ -13,6 +13,7 @@ #include "stem.hh" #include "stream-event.hh" #include "text-interface.hh" +#include "item.hh" #include "translator.icc" @@ -22,7 +23,7 @@ class Text_engraver : public Engraver { vector evs_; - vector texts_; + vector texts_; public: TRANSLATOR_DECLARATIONS (Text_engraver); protected: diff --git a/lily/text-interface.cc b/lily/text-interface.cc index c249052da5..ebfae5ae5b 100644 --- a/lily/text-interface.cc +++ b/lily/text-interface.cc @@ -91,7 +91,7 @@ Text_interface::is_markup (SCM x) ly_symbol2scm ("markup-signature")))); } -ADD_INTERFACE (Text_interface, "text-interface", +ADD_INTERFACE (Text_interface, "A scheme markup text, see @usermanref{Text markup}.", "baseline-skip " "text " diff --git a/lily/text-spanner-engraver.cc b/lily/text-spanner-engraver.cc index 289c44e33f..28f88fd76f 100644 --- a/lily/text-spanner-engraver.cc +++ b/lily/text-spanner-engraver.cc @@ -11,6 +11,7 @@ #include "international.hh" #include "note-column.hh" #include "side-position-interface.hh" +#include "spanner.hh" #include "stream-event.hh" #include "translator.icc" @@ -90,7 +91,7 @@ Text_spanner_engraver::acknowledge_note_column (Grob_info info) if (spans[i]) { Side_position_interface::add_support (spans[i], info.grob ()); - add_bound_item (spans[i], dynamic_cast (info.grob ())); + add_bound_item (spans[i], info.grob ()); } } } diff --git a/lily/text-spanner.cc b/lily/text-spanner.cc index 4d8b3a092f..ea4c25074a 100644 --- a/lily/text-spanner.cc +++ b/lily/text-spanner.cc @@ -161,7 +161,6 @@ Text_spanner::print (SCM smob) } ADD_INTERFACE (Text_spanner, - "text-spanner-interface", "generic text spanner", diff --git a/lily/tie-column.cc b/lily/tie-column.cc index 13d5fb0177..85529ef1d5 100644 --- a/lily/tie-column.cc +++ b/lily/tie-column.cc @@ -126,7 +126,7 @@ Tie_column::calc_positioning_done (SCM smob) -ADD_INTERFACE (Tie_column, "tie-column-interface", +ADD_INTERFACE (Tie_column, "Object that sets directions of multiple ties in a tied chord", /* properties */ diff --git a/lily/tie-configuration.cc b/lily/tie-configuration.cc index 2e15eb72eb..9192b3795e 100644 --- a/lily/tie-configuration.cc +++ b/lily/tie-configuration.cc @@ -8,6 +8,7 @@ */ #include "tie-configuration.hh" + #include "warn.hh" #include "tie-formatting-problem.hh" #include "bezier.hh" diff --git a/lily/tie-formatting-problem.cc b/lily/tie-formatting-problem.cc index 0e29d3ca50..a55f313735 100644 --- a/lily/tie-formatting-problem.cc +++ b/lily/tie-formatting-problem.cc @@ -12,7 +12,6 @@ #include "paper-column.hh" #include "bezier.hh" #include "directional-element-interface.hh" -#include "item.hh" #include "libc-extension.hh" #include "misc.hh" #include "note-head.hh" @@ -175,8 +174,9 @@ Tie_formatting_problem::set_column_chord_outline (vector bounds, boxes.push_back (Box (x, y)); } while (flip (&updowndir) != DOWN); - - chord_outlines_[key] = Skyline (boxes, Y_AXIS, -dir); + + /* todo: the horizon_padding is somewhat arbitrary */ + chord_outlines_[key] = Skyline (boxes, 0.1, Y_AXIS, -dir); if (bounds[0]->break_status_dir ()) { Real x = robust_relative_extent (bounds[0], x_refpoint_, X_AXIS)[-dir]; diff --git a/lily/tie.cc b/lily/tie.cc index 1263237688..2aab6ac2b1 100644 --- a/lily/tie.cc +++ b/lily/tie.cc @@ -289,8 +289,6 @@ Tie::print (SCM smob) } ADD_INTERFACE (Tie, - "tie-interface", - "A horizontal curve connecting two noteheads. \n\n" , diff --git a/lily/time-signature-engraver.cc b/lily/time-signature-engraver.cc index 78f795eaed..68a7e178b0 100644 --- a/lily/time-signature-engraver.cc +++ b/lily/time-signature-engraver.cc @@ -8,6 +8,7 @@ #include "engraver-group.hh" +#include "item.hh" #include "international.hh" #include "misc.hh" #include "time-signature.hh" diff --git a/lily/time-signature.cc b/lily/time-signature.cc index 26860c688f..ced6468e8d 100644 --- a/lily/time-signature.cc +++ b/lily/time-signature.cc @@ -8,6 +8,7 @@ #include "time-signature.hh" +#include "grob.hh" #include "font-interface.hh" #include "international.hh" #include "output-def.hh" @@ -119,7 +120,7 @@ Time_signature::numbered_time_signature (Grob *me, int num, int den) return m; } -ADD_INTERFACE (Time_signature, "time-signature-interface", +ADD_INTERFACE (Time_signature, "A time signature, in different styles.\n" " The following values for 'style are are recognized:\n" "\n" diff --git a/lily/translator-dispatch-list.cc b/lily/translator-dispatch-list.cc index 28ea71afa2..bd27091988 100644 --- a/lily/translator-dispatch-list.cc +++ b/lily/translator-dispatch-list.cc @@ -7,8 +7,6 @@ */ #include "translator-dispatch-list.hh" - -#include "grob-info.hh" #include "engraver.hh" #include "ly-smobs.icc" diff --git a/lily/translator-group-ctors.cc b/lily/translator-group-ctors.cc index 6684842876..83feef1634 100644 --- a/lily/translator-group-ctors.cc +++ b/lily/translator-group-ctors.cc @@ -8,8 +8,6 @@ #include "score-engraver.hh" #include "score-performer.hh" -#include "engraver-group.hh" -#include "performer-group.hh" #include "warn.hh" /* diff --git a/lily/translator-group.cc b/lily/translator-group.cc index 4ef8c49d6b..b25d6154e5 100644 --- a/lily/translator-group.cc +++ b/lily/translator-group.cc @@ -19,7 +19,6 @@ #include "output-def.hh" #include "performer-group.hh" #include "scm-hash.hh" -#include "stream-event.hh" #include "warn.hh" Translator_group * diff --git a/lily/trill-spanner-engraver.cc b/lily/trill-spanner-engraver.cc index 19576e6f16..3f07d5b5ac 100644 --- a/lily/trill-spanner-engraver.cc +++ b/lily/trill-spanner-engraver.cc @@ -19,6 +19,7 @@ #include "note-column.hh" #include "side-position-interface.hh" #include "stream-event.hh" +#include "spanner.hh" #include "translator.icc" @@ -96,7 +97,7 @@ Trill_spanner_engraver::acknowledge_note_column (Grob_info info) if (spans[i]) { Side_position_interface::add_support (spans[i], info.grob ()); - add_bound_item (spans[i], dynamic_cast (info.grob ())); + add_bound_item (spans[i], info.grob ()); } } } diff --git a/lily/ttf.cc b/lily/ttf.cc index 0e5526f8e1..2e5eb8865d 100644 --- a/lily/ttf.cc +++ b/lily/ttf.cc @@ -10,7 +10,6 @@ #include -#include "lily-proto.hh" #include "memory-stream.hh" #include "warn.hh" #include "lily-guile.hh" @@ -53,7 +52,7 @@ print_header (void *out, FT_Face face) = (TT_Postscript *) FT_Get_Sfnt_Table (face, ft_sfnt_post); if (pt->maxMemType42) - lily_cookie_fprintf (out, "%%%%VMUsage: %ld %ld\n", 0, 0); + lily_cookie_fprintf (out, "%%%%VMUsage: %d %d\n", 0, 0); lily_cookie_fprintf (out, "%d dict begin\n", 11); lily_cookie_fprintf (out, "/FontName /%s def\n", @@ -75,8 +74,8 @@ print_header (void *out, FT_Face face) lily_cookie_fprintf (out, "/FontType 42 def\n"); lily_cookie_fprintf (out, "/FontInfo 8 dict dup begin\n"); lily_cookie_fprintf (out, "/version (%d.%d) def\n", - (ht->Font_Revision >> 16), - (ht->Font_Revision &((1 << 16) -1))); + int (ht->Font_Revision >> 16), + int (ht->Font_Revision &((1 << 16) -1))); #if 0 if (strings[0]) diff --git a/lily/tuplet-bracket.cc b/lily/tuplet-bracket.cc index 261b086c3f..d13cf1c613 100644 --- a/lily/tuplet-bracket.cc +++ b/lily/tuplet-bracket.cc @@ -422,12 +422,12 @@ Tuplet_bracket::make_bracket (Grob *me, // for line properties. straight_corners[d] += -d * shorten[d] / length * dz; while (flip (&d) != LEFT); - if (gap.is_empty ()) - gap = Interval (0, 0); - do - gap_corners[d] = (dz * 0.5) + gap[d] / length * dz; - while (flip (&d) != LEFT) - ; + if (!gap.is_empty ()) + { + do + gap_corners[d] = (dz * 0.5) + gap[d] / length * dz; + while (flip (&d) != LEFT); + } Drul_array flare_corners = straight_corners; do @@ -441,14 +441,20 @@ Tuplet_bracket::make_bracket (Grob *me, // for line properties. Stencil m; do { - m.add_stencil (Line_interface::line (me, straight_corners[d], - gap_corners[d])); + if (!gap.is_empty ()) + m.add_stencil (Line_interface::line (me, straight_corners[d], + gap_corners[d])); m.add_stencil (Line_interface::line (me, straight_corners[d], flare_corners[d])); } + while (flip (&d) != LEFT); + if (gap.is_empty ()) + m.add_stencil (Line_interface::line (me, straight_corners[LEFT], + straight_corners[RIGHT])); + return m; } @@ -731,7 +737,6 @@ Tuplet_bracket::add_tuplet_bracket (Grob *me, Grob *bracket) } ADD_INTERFACE (Tuplet_bracket, - "tuplet-bracket-interface", "A bracket with a number in the middle, used for tuplets. " "When the bracket spans a line break, the value of " "@code{break-overshoot} determines how far it extends " diff --git a/lily/tuplet-engraver.cc b/lily/tuplet-engraver.cc index 7a3cf534fd..441fdd7610 100644 --- a/lily/tuplet-engraver.cc +++ b/lily/tuplet-engraver.cc @@ -14,6 +14,7 @@ #include "stream-event.hh" #include "tuplet-bracket.hh" #include "warn.hh" +#include "item.hh" #include "translator.icc" @@ -43,8 +44,10 @@ public: protected: vector tuplets_; + vector new_tuplets_; vector stopped_tuplets_; vector last_tuplets_; + DECLARE_ACKNOWLEDGER (note_column); DECLARE_TRANSLATOR_LISTENER (tuplet_span); virtual void finalize (); @@ -61,7 +64,7 @@ Tuplet_engraver::listen_tuplet_span (Stream_event *ev) { Tuplet_description d; d.event_ = ev; - tuplets_.push_back (d); + new_tuplets_.push_back (d); } else if (dir == STOP && tuplets_.size ()) { @@ -104,6 +107,8 @@ Tuplet_engraver::process_music () } stopped_tuplets_.clear (); + concat (tuplets_, new_tuplets_); + new_tuplets_.clear (); for (vsize j = tuplets_.size (); j > 0; j--) { /* i goes from size-1 downto 0, inclusively */ diff --git a/lily/tuplet-number.cc b/lily/tuplet-number.cc index a68b99b0a5..31bcbbfa57 100644 --- a/lily/tuplet-number.cc +++ b/lily/tuplet-number.cc @@ -17,7 +17,7 @@ struct Tuplet_number { DECLARE_SCHEME_CALLBACK(print, (SCM)); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE(); }; @@ -62,7 +62,6 @@ Tuplet_number::print (SCM smob) ADD_INTERFACE (Tuplet_number, - "tuplet-number-interface", "The number for a bracket. " , diff --git a/lily/vaticana-ligature.cc b/lily/vaticana-ligature.cc index 411953ea87..9e97482d02 100644 --- a/lily/vaticana-ligature.cc +++ b/lily/vaticana-ligature.cc @@ -292,7 +292,7 @@ Vaticana_ligature::print (SCM) return SCM_EOL; } -ADD_INTERFACE (Vaticana_ligature, "vaticana-ligature-interface", +ADD_INTERFACE (Vaticana_ligature, "A vaticana style gregorian ligature", /* properties */ diff --git a/lily/vertical-align-engraver.cc b/lily/vertical-align-engraver.cc index cbd79dad9a..830aa78fd7 100644 --- a/lily/vertical-align-engraver.cc +++ b/lily/vertical-align-engraver.cc @@ -40,7 +40,10 @@ ADD_TRANSLATOR (Vertical_align_engraver, "Catch groups (staffs, lyrics lines, etc.) and stack " "them vertically.", /* create */ "VerticalAlignment", - /* read */ "alignAboveContext alignBelowContext", + /* read */ + "alignAboveContext " + "alignBelowContext ", + /* write */ ""); Vertical_align_engraver::Vertical_align_engraver () diff --git a/lily/volta-bracket.cc b/lily/volta-bracket.cc index ba33a4015d..9c2e4ea669 100644 --- a/lily/volta-bracket.cc +++ b/lily/volta-bracket.cc @@ -166,7 +166,7 @@ Volta_bracket_interface::add_column (Grob *me, Grob *c) Side_position_interface::add_support (me, c); } -ADD_INTERFACE (Volta_bracket_interface, "volta-bracket-interface", +ADD_INTERFACE (Volta_bracket_interface, "Volta bracket with number", /* properties */ diff --git a/lily/volta-engraver.cc b/lily/volta-engraver.cc index db4d5e60cf..41b0c7cc78 100644 --- a/lily/volta-engraver.cc +++ b/lily/volta-engraver.cc @@ -12,6 +12,7 @@ #include "context.hh" #include "international.hh" #include "note-column.hh" +#include "item.hh" #include "side-position-interface.hh" #include "staff-symbol.hh" #include "text-interface.hh" diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly index f2966d56ee..ada3cf8bf8 100644 --- a/ly/engraver-init.ly +++ b/ly/engraver-init.ly @@ -600,8 +600,16 @@ AncientRemoveEmptyStaffContext = \context { (Voice Slur direction ,DOWN) ) - keepAliveInterfaces = #'(rhythmic-grob-interface lyric-interface percent-repeat-interface) - quotedEventTypes = #'(note-event rest-event time-scaled-music tie-event beam-event) + keepAliveInterfaces = #'( + rhythmic-grob-interface + lyric-interface + percent-repeat-interface) + quotedEventTypes = #'( + note-event + rest-event + tie-event + beam-event + tuplet-span-event) instrumentTransposition = #(ly:make-pitch 0 0 0) verticallySpacedContexts = #'(Staff) @@ -645,6 +653,8 @@ AncientRemoveEmptyStaffContext = \context { \name "TabVoice" \alias "Voice" \consists "Tab_note_heads_engraver" + \consists "Tab_harmonic_engraver" + \remove "Note_heads_engraver" \remove "Fingering_engraver" \remove "New_fingering_engraver" @@ -659,6 +669,9 @@ AncientRemoveEmptyStaffContext = \context { %% No accidental in tablature ! \remove Accidental_engraver + + \override Glissando #'extra-dy = #0.75 + \override Glissando #'gap = #0.2 } \context { diff --git a/ly/music-functions-init.ly b/ly/music-functions-init.ly index fa18af6ce7..077c965bd5 100644 --- a/ly/music-functions-init.ly +++ b/ly/music-functions-init.ly @@ -405,6 +405,8 @@ and assign them to the identifiers provided in @var{voice-ids}. @var{music}: a music sequence, containing BarChecks as limiting expressions. Example: + +@verbatim \\parallelMusic #'(A B C) { c c | d d | e e | d d | e e | f f | @@ -413,6 +415,7 @@ Example: A = { c c | d d | } B = { d d | e e | } C = { e e | f f | } +@end verbatim " (let* ((voices (apply circular-list (make-list (length voice-ids) (list)))) (current-voices voices) @@ -548,7 +551,7 @@ includePageLayoutFile = (if (access? tweak-filename R_OK) (begin (ly:message "Including tweak file ~a" tweak-filename) - (set! page-layout-parser (ly:clone-parser parser)) + (set! page-layout-parser (ly:parser-clone parser)) (ly:parser-parse-string page-layout-parser (format #f "\\include \"~a\"" tweak-filename)))))) diff --git a/make/doclang-rules.make b/make/doclang-rules.make new file mode 100644 index 0000000000..e69de29bb2 diff --git a/make/doclang-targets.make b/make/doclang-targets.make new file mode 100644 index 0000000000..7547e39ea6 --- /dev/null +++ b/make/doclang-targets.make @@ -0,0 +1,54 @@ +# assumes depth and ISOLANG are defined + +OUT_ITEXI_FILES = $(ITELY_FILES:%.itely=$(outdir)/%.itexi) + +LILYPOND_BOOK_INCLUDES += \ + -I$(top-src-dir)/Documentation/user \ + -I$(top-build-dir)/Documentation/user/$(outdir) + +default: + +$(outdir)/lilypond.nexi: $(ITELY_FILES) $(ITEXI_FILES) + +MAKEINFO = LANG=$(ISOLANG) $(MAKEINFO_PROGRAM) --force + +$(outdir)/lilypond/index.html: $(outdir)/lilypond.nexi doc-po + mkdir -p $(dir $@) + -$(MAKEINFO) -I$(outdir) --output=$(outdir)/lilypond --css-include=$(top-src-dir)/Documentation/texinfo.css --html $< + find $(outdir) -name '*.html' | xargs grep -L 'UNTRANSLATED NODE: IGNORE ME' | xargs $(PYTHON) $(top-src-dir)/buildscripts/html-gettext.py $(depth)/Documentation/po/$(outdir) $(ISOLANG) + +$(outdir)/lilypond.html: $(outdir)/lilypond.nexi + -$(MAKEINFO) -I$(outdir) --output=$@ --css-include=$(top-src-dir)/Documentation/texinfo.css --html --no-split --no-headers $< + +local-WWW: png-ln $(outdir)/lilypond.html $(outdir)/lilypond/index.html deep-ln lang-merge + +lang-merge: + $(foreach i, $(shell find $(outdir) -name '*.html' | xargs grep -L --label="" 'UNTRANSLATED NODE: IGNORE ME'), ln -f $(i) $(i:$(outdir)/%.html=$(depth)/Documentation/user/$(outdir)/%.$(ISOLANG).html) &&) true + +png-ln: + mkdir -p $(outdir)/lilypond + # makeinfo is broken, it MUST have PNGs in output dir + # symlinking PNGs... + $(foreach i, $(shell find $(depth)/Documentation/user/$(outdir) -maxdepth 1 -name '*.png'), ln -sf ../$(i) $(i:$(depth)/Documentation/user/$(outdir)/%.png=$(outdir)/%.png) &&) true + $(foreach i, $(shell find $(depth)/Documentation/user/$(outdir)/lilypond -name '*.png'), ln -sf ../../$(i) $(i:$(depth)/Documentation/user/$(outdir)/%.png=$(outdir)/%.png) &&) true + +# Links referred to by Documentation index +# BROKEN: the following makes broken symlinks +#LILYPOND_LINKS = Reference-Manual.html Tutorial.html Ly2dvi.html Midi2ly.html + + +deep-ln: + mkdir -p $(outdir)/lilypond + cd $(outdir)/lilypond && $(foreach i, $(LILYPOND_LINKS),\ + rm -f $(i) && ln -s lilypond.html $(i) &&) true + +local-WWW-clean: deep-WWW-clean + +deep-WWW-clean: + rm -rf $(outdir)/lilypond + +web-clean: clean + $(MAKE) out=www local-WWW-clean + +doc-po: + $(MAKE) -C $(depth)/Documentation/po messages diff --git a/make/doclang-vars.make b/make/doclang-vars.make new file mode 100644 index 0000000000..e69de29bb2 diff --git a/make/lilypond-vars.make b/make/lilypond-vars.make index 3c55dbeedc..201c9984e9 100644 --- a/make/lilypond-vars.make +++ b/make/lilypond-vars.make @@ -24,7 +24,8 @@ CONVERT_LY = $(script-dir)/convert-ly.py LILYPOND_BOOK = $(script-dir)/lilypond-book.py LILYPOND_BOOK_INCLUDES = -I $(src-dir)/ -I $(outdir) -I $(input-dir) -I $(input-dir)/regression/ -I $(input-dir)/manual/ -I $(input-dir)/tutorial/ -I $(top-build-dir)/mf/$(outconfbase)/ -I $(top-build-dir)/mf/out/ -LILYPOND_BOOK_LILYPOND_FLAGS=--backend=eps --formats=ps,png,pdf -dinclude-eps-fonts -dgs-load-fonts --header=texidoc -I $(top-src-dir)/input/manual -dcheck-internal-types -ddump-signatures -danti-alias-factor=2 +LILYPOND_JOBS=$(if $(CPU_COUNT),-djob-count=$(CPU_COUNT),) +LILYPOND_BOOK_LILYPOND_FLAGS=--backend=eps --formats=ps,png,pdf $(LILYPOND_JOBS) -dinclude-eps-fonts -dgs-load-fonts --header=texidoc -I $(top-src-dir)/input/manual -dcheck-internal-types -ddump-signatures -danti-alias-factor=2 LILYPOND_BOOK_FLAGS = --process="$(LILYPOND_BINARY) $(LILYPOND_BOOK_LILYPOND_FLAGS)" TEXINPUTS=$(top-src-dir)/tex/:: diff --git a/mf/GNUmakefile b/mf/GNUmakefile index c87aa1c47f..866bfbbad9 100644 --- a/mf/GNUmakefile +++ b/mf/GNUmakefile @@ -103,7 +103,7 @@ PFA_FILES = $(ALL_FONTS:%=$(outdir)/%.pfa) # Make tfm files first, log files last, # so that normally log files aren't made twice -ALL_GEN_FILES= $(TFM_FILES) $(TEXTABLES) $(TFM_FILES) $(LOG_FILES) $(ENC_FILES) $(LISP_FILES) $(FETA_LIST_FILES) $(OTF_TABLES) $(NCSB_OTFS) $(PFA_FILES) $(OTF_FILES) $(SVG_FILES) +ALL_GEN_FILES= $(TFM_FILES) $(TEXTABLES) $(TFM_FILES) $(LOG_FILES) $(ENC_FILES) $(LISP_FILES) $(OTF_TABLES) $(NCSB_OTFS) $(PFA_FILES) $(OTF_FILES) $(SVG_FILES) #PRE_INSTALL=$(MAKE) "$(ALL_GEN_FILES)" diff --git a/po/GNUmakefile b/po/GNUmakefile index a9b8f72c5d..c277ee920c 100644 --- a/po/GNUmakefile +++ b/po/GNUmakefile @@ -5,14 +5,9 @@ depth = .. NAME = lilypond MODULE_NAME = po - -POT_FILES = $(call src-wildcard,*.pot) -PO_FILES = $(call src-wildcard,*.po) -MO_FILES = $(addprefix $(outdir)/, $(PO_FILES:.po=.mo)) -HELP_CATALOGS = $(PO_FILES:%.po=%) -CATALOGS = $(HELP_CATALOGS:lilypond=) -EXTRA_DIST_FILES = TODO $(PO_FILES) $(POT_FILES) -STEPMAKE_TEMPLATES=podir +DOMAIN = $(NAME) +EXTRA_DIST_FILES = TODO +STEPMAKE_TEMPLATES=podir include $(depth)/make/stepmake.make diff --git a/python/SConscript b/python/SConscript index d0c94df0cf..52c4e1d2a1 100644 --- a/python/SConscript +++ b/python/SConscript @@ -4,11 +4,10 @@ Import ('env', 'install', 'src_glob') py = src_glob ('*.py') c = src_glob ('*.c') -pym = map (env.AT_COPY_EXT, py) cm = map (env.SharedObject, c) -pym +py cm -install (cm + pym, env['sharedir_package_version'] + '/python') +install (py, env['sharedir_package_version'] + '/python') install (cm, env['libdir_package_version'] + '/python') diff --git a/python/convertrules.py b/python/convertrules.py index 2ed3b28636..a2ac08534b 100644 --- a/python/convertrules.py +++ b/python/convertrules.py @@ -2878,3 +2878,10 @@ def conv (str): conversions.append (((2, 10, 0), conv, """bump version for release""")) + +def conv (str): + return re.sub ('ly:clone-parser', + 'ly:parser-clone', str) + +conversions.append (((2, 11, 2), conv, """ly:clone-parser -> ly:parser-clone""")) + diff --git a/scm/backend-library.scm b/scm/backend-library.scm index 07ab29ecd7..5258bcf516 100644 --- a/scm/backend-library.scm +++ b/scm/backend-library.scm @@ -108,8 +108,17 @@ (rename-page-1 #f)) (ly:message (_ "Converting to ~a...") "PNG") - (make-ps-images name resolution paper-width paper-height rename-page-1 verbose - (ly:get-option 'anti-alias-factor)) + + (make-ps-images name + #:resolution resolution + #:page-width paper-width + #:page-height paper-height + #:rename-page-1 rename-page-1 + #:be-verbose verbose + #:anti-alias-factor (ly:get-option 'anti-alias-factor) + #:pixmap-format (ly:get-option 'pixmap-format) + ) + (ly:progress "\n"))) (define-public (postprocess-output paper-book module filename formats) diff --git a/scm/c++.scm b/scm/c++.scm index 7069ca1a41..800d08bfe6 100644 --- a/scm/c++.scm +++ b/scm/c++.scm @@ -49,8 +49,10 @@ (define-public (object-type obj) (match-predicate obj type-p-name-alist)) + (define-public (object-type-name obj) (type-name (match-predicate obj type-p-name-alist))) + (define-public (type-name predicate) (let ((entry (assoc predicate type-p-name-alist))) (if (pair? entry) (cdr entry) diff --git a/scm/define-grob-interfaces.scm b/scm/define-grob-interfaces.scm index 661d12de5d..c6eb520493 100644 --- a/scm/define-grob-interfaces.scm +++ b/scm/define-grob-interfaces.scm @@ -105,7 +105,7 @@ (ly:add-interface 'parentheses-interface "Parentheses for other objects" - '(padding)) + '(padding stencils)) (ly:add-interface 'piano-pedal-interface diff --git a/scm/define-grob-properties.scm b/scm/define-grob-properties.scm index 38fe501282..140cf382b7 100644 --- a/scm/define-grob-properties.scm +++ b/scm/define-grob-properties.scm @@ -136,7 +136,8 @@ edges '(@var{left-text} . @var{right-text}).") "How much of the bound a spanner should enclose: +1 = completely, 0 = center, -1 not at all.") (expand-limit ,integer? "maximum number of measures expanded in church rests.") - ;; remove me? + ;; remove me? + (extra-dy ,number? "Slope glissandi this much extra.") (extra-X-extent ,number-pair? "A grob is enlarged in X dimension by this much.") (extra-Y-extent ,number-pair? "See @code{extra-X-extent}.") @@ -274,6 +275,11 @@ get stems extending to the middle staff line.") (non-musical ,boolean? "True if the grob belongs in a NonMusicalPaperColumn.") (number-type ,symbol? "Type of numbers to use in label. Choices include @code{roman-lower}, @code{roman-upper}, and @code{arabic}.") + (outside-staff-horizontal-padding ,number? "By default, an outside-staff-object can be +placed so that is it very close to another grob horizontally. If this property is set, +the outside-staff-object will be raised so that it is not so close to its neighbour.") + (outside-staff-padding ,number? "The padding to place between this grob and the staff when +spacing according to outside-staff-priority.") (outside-staff-priority ,number? "When set, the grob will be positioned outside the staff in such a way as to avoid all collisions. In case of a potential collision, the grob with the smaller outside-staff-priority will be closer to the staff.") @@ -342,6 +348,7 @@ note that starts here.") object.") (side-axis ,number? "If the value is #X (or equivalently 1), the object is placed horizontally next to the other object. If the value is #Y or 0, it is placed vertically.") (size ,number? "Size of object, relative to standard size.") + (skylines ,ly:skyline-pair? "Two skylines, one above and one below this grob (or, for some grobs, to the left and to the right).") (slope ,number? "The slope of this object.") (slur-padding ,number? "Extra distance between slur and script.") (space-alist ,list? "A table that specifies distances between @@ -371,6 +378,7 @@ stems that are placed in tight configurations. For opposite directions, this amount is the correction for two normal sized stems that overlap completely.") (stencil ,ly:stencil? "The symbol to print.") + (stencils ,list? "Multiple stencils, used as intermediate value.") (strict-note-spacing ,boolean? "If set, unbroken columns with non-musical material (clefs, barlines, etc.) are not spaced separately, but put before musical columns.") @@ -553,8 +561,7 @@ than a whole rest.") (spaceable-staves ,ly:grob-array? "Objects to be spaced during page layout.") (skyline-distance ,number? "The distance between this staff and the next one, as determined by a skyline algorithm.") - (skyline-spacing ,boolean? "When true, this axis-group will vertically space its children -using a skyline algorithm.") + (skyline-horizontal-padding ,number? "For determining the vertical distance between 2 staves, it is possible to have a configuration which would result in a tight interleaving of grobs from the top staff and the bottom staff. The larger this parameter is, the farther apart the staves will be placed in such a configuration.") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index 5e2dd4d86c..10a35dc68d 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -204,7 +204,7 @@ (X-offset . ,(ly:make-simple-closure `(,+ ,(ly:make-simple-closure - (list ly:break-alignment-align-interface::self-align-callback)) + (list ly:break-alignable-interface::self-align-callback)) ,(ly:make-simple-closure (list ly:self-alignment-interface::x-aligned-on-self))))) @@ -216,7 +216,7 @@ ((class . Item) (interfaces . (side-position-interface text-interface - break-alignment-align-interface + break-alignable-interface self-alignment-interface font-interface )))) @@ -275,6 +275,7 @@ . ( (axes . (,Y)) (Y-extent . ,ly:axis-group-interface::height) + (skylines . ,ly:axis-group-interface::calc-skylines) (meta . ((class . Spanner) (interfaces . (axis-group-interface )))))) @@ -334,7 +335,7 @@ (BendAfter . ( - (stencil . ,fall::print) + (stencil . ,bend::print) (thickness . 2.0) (meta . ((class . Spanner) (interfaces . (spanner-interface @@ -344,7 +345,7 @@ . ( (non-musical . #t) (stacking-dir . 1) - (positioning-done . ,ly:break-align-interface::calc-positioning-done) + (positioning-done . ,ly:break-alignment-interface::calc-positioning-done) (X-extent . ,ly:axis-group-interface::width) (break-align-orders . ;; end of line #(( @@ -543,7 +544,7 @@ (meta . ((class . Item) (interfaces . (font-interface break-aligned-interface - percent-repeat-interface)))))) + percent-repeat-item-interface)))))) (DoublePercentRepeatCounter . ( @@ -561,7 +562,7 @@ (meta . ((class . Item) (interfaces . (side-position-interface self-alignment-interface - percent-repeat-interface + percent-repeat-item-interface font-interface text-interface)))))) (DynamicLineSpanner @@ -575,6 +576,7 @@ (minimum-space . 1.2) (direction . ,DOWN) (side-axis . ,Y) + (outside-staff-priority . 250) (Y-extent . ,ly:axis-group-interface::height) (X-extent . ,ly:axis-group-interface::width) (meta . ((class . Spanner) @@ -600,7 +602,7 @@ (font-shape . italic) (avoid-slur . around) (no-spacing-rods . #t) - (script-priority . 100) + (outside-staff-priority . 250) (meta . ((class . Item) (interfaces . (font-interface text-interface @@ -670,7 +672,6 @@ (style . line) (gap . 0.5) (zigzag-width . 0.75) - (non-musical . #t) (X-extent . #f) (Y-extent . #f) (stencil . ,ly:line-spanner::print) @@ -845,7 +846,7 @@ (length-fraction . 0.25) (layer . 0) (meta . ((class . Spanner) - (interfaces . (ledger-line-interface)))))) + (interfaces . (ledger-line-spanner-interface)))))) (LeftEdge . ( @@ -907,8 +908,8 @@ (minimum-length . 0.3) (minimum-distance . 0.1) (padding . 0.07) - (springs-and-rods . ,ly:hyphen-spanner::set-spacing-rods) - (stencil . ,ly:hyphen-spanner::print) + (springs-and-rods . ,ly:lyric-hyphen::set-spacing-rods) + (stencil . ,ly:lyric-hyphen::print) (Y-extent . (0 . 0)) (meta . ((class . Spanner) (interfaces . (lyric-interface @@ -918,7 +919,7 @@ (LyricSpace . ((minimum-distance . 0.45) - (springs-and-rods . ,ly:hyphen-spanner::set-spacing-rods) + (springs-and-rods . ,ly:lyric-hyphen::set-spacing-rods) (padding . 0.0) (Y-extent . #f) (X-extent . #f) @@ -1131,9 +1132,6 @@ (Y-offset . ,ly:side-position-interface::y-aligned-side) (stencil . ,ly:text-interface::print) - - ;; no Y dimensions, because of lyrics under tenor clef. - (Y-extent . (0 . 0)) (font-shape . italic) (padding . 0.6) (staff-padding . 0.2) @@ -1156,6 +1154,7 @@ (dash-fraction . 0.3) (edge-height . (0 . 1.2)) (direction . ,UP) + (outside-staff-priority . 400) (meta . ((class . Spanner) (interfaces . (ottava-bracket-interface horizontal-bracket-interface @@ -1181,11 +1180,20 @@ (ParenthesesItem . ((stencil . ,parentheses-item::print) + (stencils . ,parentheses-item::calc-parenthesis-stencils) (font-size . -6) (padding . 0.2) (meta . ((class . Item) (interfaces . (parentheses-interface font-interface)))) )) + + (HarmonicParenthesesItem + . ((stencil . ,parentheses-item::print) + (padding . 0) + (stencils . ,parentheses-item::calc-angled-bracket-stencils) + (meta . ((class . Item) + (interfaces . (parentheses-interface font-interface)))) + )) (PhrasingSlur . ((details . ,default-slur-details) @@ -1213,7 +1221,7 @@ (meta . ((class . Spanner) (interfaces . (multi-measure-rest-interface font-interface - percent-repeat-interface)))))) + percent-repeat-item-interface)))))) (PercentRepeatCounter . ( (stencil . ,ly:text-interface::print) @@ -1230,7 +1238,7 @@ (meta . ((class . Spanner) (interfaces . (side-position-interface self-alignment-interface - percent-repeat-interface + percent-repeat-item-interface font-interface text-interface)))))) @@ -1256,7 +1264,7 @@ (X-offset . ,(ly:make-simple-closure `(,+ ,(ly:make-simple-closure - (list ly:break-alignment-align-interface::self-align-callback)) + (list ly:break-alignable-interface::self-align-callback)) ,(ly:make-simple-closure (list ly:self-alignment-interface::x-aligned-on-self))))) @@ -1269,10 +1277,11 @@ (break-visibility . ,end-of-line-invisible) (break-align-symbol . staff-bar) (padding . 0.8) + (outside-staff-priority . 1000) (meta . ((class . Item) (interfaces . (text-interface side-position-interface - break-alignment-align-interface + break-alignable-interface font-interface mark-interface self-alignment-interface)))))) @@ -1283,7 +1292,7 @@ (thickness . 0.48) (slope . 1.7) (meta . ((class . Item) - (interfaces . (percent-repeat-interface)))))) + (interfaces . (percent-repeat-item-interface)))))) (RepeatTie . ( @@ -1369,6 +1378,7 @@ (avoid-slur . inside) (X-extent . ,ly:axis-group-interface::width) (Y-extent . ,ly:axis-group-interface::height) + (skylines . ,ly:separation-item::calc-skylines) (meta . ((class . Item) (interfaces . (spacing-interface separation-item-interface)))))) @@ -1379,7 +1389,7 @@ (meta . ((class . Spanner) (interfaces . (only-prebreak-interface spacing-interface - separation-spanner-interface)))))) + separating-group-spanner-interface)))))) (Slur . ((details . ,default-slur-details) @@ -1643,7 +1653,8 @@ (axes . (0 1)) (X-extent . ,ly:axis-group-interface::width) (Y-extent . ,ly:axis-group-interface::height) - (skyline-spacing . #t) + (skylines . ,ly:axis-group-interface::calc-skylines) + (skyline-horizontal-padding . 1.0) (meta . ((class . System) (interfaces . (system-interface axis-group-interface)))))) @@ -1706,11 +1717,12 @@ (interfaces . (side-position-interface system-start-delimiter-interface)))))) - (TabNoteHead . ( (stencil . ,ly:text-interface::print) (Y-offset . ,ly:staff-symbol-referencer::callback) + (X-offset . ,ly:self-alignment-interface::x-aligned-on-self) + (direction . 0) (font-size . -2) (stem-attachment . (0.0 . 1.35)) (font-series . bold) @@ -1737,6 +1749,7 @@ (stencil . ,ly:text-interface::print) (direction . ,ly:script-interface::calc-direction) + (outside-staff-priority . 450) (avoid-slur . around) (slur-padding . 0.5) (script-priority . 200) @@ -1758,6 +1771,7 @@ (dash-period . 3.0) (side-axis . ,Y) (direction . ,UP) + (outside-staff-priority . 350) (meta . ((class . Spanner) (interfaces . (text-spanner-interface line-spanner-interface @@ -1773,7 +1787,7 @@ (stencil . ,ly:tie::print) (font-size . -6) (details . ( - ;; for a full list, see tie-helper.cc + ;; for a full list, see tie-details.cc (ratio . 0.333) (center-staff-line-clearance . 0.6) (tip-staff-line-clearance . 0.45) @@ -1834,6 +1848,7 @@ (direction . ,UP) (Y-offset . ,ly:side-position-interface::y-aligned-side) (side-axis . ,Y) + (outside-staff-priority . 50) (meta . ((class . Spanner) (interfaces . (text-spanner-interface line-spanner-interface @@ -1858,6 +1873,7 @@ (axes . (,X)) (font-size . -4) (stencil . ,parenthesize-elements) + (stencils . ,parentheses-item::calc-parenthesis-stencils) (direction . ,RIGHT) (side-axis . ,X) (padding . 0.3) @@ -1958,7 +1974,8 @@ (Y-extent . ,ly:axis-group-interface::height) (X-extent . ,ly:axis-group-interface::width) (stacking-dir . -1) - (padding . 0.1) + (padding . 0.1) + (skylines . ,ly:axis-group-interface::combine-skylines) (meta . ((class . Spanner) (interfaces . (align-interface axis-group-interface)))))) @@ -1968,10 +1985,10 @@ (Y-offset . ,ly:hara-kiri-group-spanner::force-hara-kiri-callback) (Y-extent . ,ly:hara-kiri-group-spanner::y-extent) (X-extent . ,ly:axis-group-interface::width) - (skyline-spacing . #t) + (skylines . ,ly:axis-group-interface::calc-skylines); (meta . ((class . Spanner) (interfaces . (axis-group-interface - hara-kiri-group-interface + hara-kiri-group-spanner-interface vertically-spaceable-interface)))))) @@ -1987,6 +2004,7 @@ (edge-height . (2.0 . 2.0)) ;; staff-space; (minimum-space . 5) (font-size . -4) + (outside-staff-priority . 100) (meta . ((class . Spanner) (interfaces . (volta-bracket-interface horizontal-bracket-interface @@ -2063,7 +2081,10 @@ (define pure-print-callbacks (list + ly:bar-line::print ly:note-head::print + ly:accidental-interface::print + ly:dots::print ly:clef::print ly:text-interface::print ly:script-interface::print)) diff --git a/scm/define-markup-commands.scm b/scm/define-markup-commands.scm index 567486bb15..5d96ecb179 100644 --- a/scm/define-markup-commands.scm +++ b/scm/define-markup-commands.scm @@ -127,17 +127,7 @@ circle of diameter 0 (ie sharp corners)." (define-markup-command (whiteout layout props arg) (markup?) "Provide a white underground for @var{arg}" - (let* ((stil (interpret-markup layout props arg)) - (white - (interpret-markup layout props - (make-with-color-markup - white - (make-filled-box-markup - (ly:stencil-extent stil X) - (ly:stencil-extent stil Y) - 0.0))))) - - (ly:stencil-add white stil))) + (stencil-whiteout (interpret-markup layout props arg))) (define-markup-command (pad-markup layout props padding arg) (number? markup?) "Add space around a markup object." @@ -416,6 +406,28 @@ determines the space between each markup in @var{args}." space (remove ly:stencil-empty? stencils)))) +(define-markup-command (concat layout props args) (markup-list?) + "Concatenate @var{args} in a horizontal line, without spaces inbetween. +Strings and simple markups are concatenated on the input level, allowing +ligatures. For example, @code{\\concat @{ \"f\" \\simple #\"i\" @}} is +equivalent to @code{\"fi\"}." + + (define (concat-string-args arg-list) + (fold-right (lambda (arg result-list) + (let ((result (if (pair? result-list) + (car result-list) + '()))) + (if (and (pair? arg) (eqv? (car arg) simple-markup)) + (set! arg (cadr arg))) + (if (and (string? result) (string? arg)) + (cons (string-append arg result) (cdr result-list)) + (cons arg result-list)))) + '() + arg-list)) + + (interpret-markup layout + (prepend-alist-chain 'word-space 0 props) + (make-line-markup (concat-string-args args)))) (define (wordwrap-stencils stencils justify base-space line-width text-dir) @@ -1339,21 +1351,26 @@ and/or @code{extra-offset} properties. " (define-markup-command (fraction layout props arg1 arg2) (markup? markup?) "Make a fraction of two markups." (let* ((m1 (interpret-markup layout props arg1)) - (m2 (interpret-markup layout props arg2))) + (m2 (interpret-markup layout props arg2)) + (factor (magstep (chain-assoc-get 'font-size props 0))) + (boxdimen (cons (* factor -0.05) (* factor 0.05))) + (padding (* factor 0.2)) + (baseline (* factor 0.6)) + (offset (* factor 0.75))) (set! m1 (ly:stencil-aligned-to m1 X CENTER)) (set! m2 (ly:stencil-aligned-to m2 X CENTER)) (let* ((x1 (ly:stencil-extent m1 X)) (x2 (ly:stencil-extent m2 X)) - (line (ly:round-filled-box (interval-union x1 x2) '(-0.05 . 0.05) 0.0)) + (line (ly:round-filled-box (interval-union x1 x2) boxdimen 0.0)) ;; should stack mols separately, to maintain LINE on baseline - (stack (stack-lines -1 0.2 0.6 (list m1 line m2)))) + (stack (stack-lines DOWN padding baseline (list m1 line m2)))) (set! stack (ly:stencil-aligned-to stack Y CENTER)) (set! stack (ly:stencil-aligned-to stack X LEFT)) ;; should have EX dimension ;; empirical anyway - (ly:stencil-translate-axis stack 0.75 Y)))) + (ly:stencil-translate-axis stack offset Y)))) diff --git a/scm/document-identifiers.scm b/scm/document-identifiers.scm new file mode 100644 index 0000000000..736da24904 --- /dev/null +++ b/scm/document-identifiers.scm @@ -0,0 +1,66 @@ +;; +;; document-identifiers.scm -- implement documentation +;; of identifiers from .ly file. +;; +;; source file of the GNU LilyPond music typesetter +;; +;; (c) 2006 Han-Wen Nienhuys +;; + + +(use-modules (ice-9 format)) + +(define (document-music-function music-func-pair) + (let* + ((name-sym (car music-func-pair)) + (music-func (cdr music-func-pair)) + (func (ly:music-function-extract music-func)) + (arg-names + (map symbol->string + (cddr (cadr (procedure-source func))))) + (doc (procedure-documentation func)) + (sign (object-property func 'music-function-signature)) + (type-names (map type-name sign)) + + ;; C&P + (signature (zip arg-names arg-names type-names)) + (signature-str + (string-join + (map (lambda (x) (format "@var{~a} (~a)" + (car x) + (cadr x))) + + (zip arg-names type-names))))) + + (format + + "\n +@item @code{~a} - ~a\n +@findex ~a + +~a\n\n" + + name-sym signature-str + name-sym + (if doc doc "(undocumented; fixme)")))) + + + +(define (document-object obj-pair) + (cond + ((ly:music-function? (cdr obj-pair)) (document-music-function obj-pair)) + (else + #f))) + +(define-public (identifiers-doc-string) + (format + "@table @asis +~a +@end table +" + (string-join + (filter + identity + (map + document-object + (ly:module->alist (current-module))))))) diff --git a/scm/document-markup.scm b/scm/document-markup.scm index c2257640a9..9a5e51eb19 100644 --- a/scm/document-markup.scm +++ b/scm/document-markup.scm @@ -15,7 +15,6 @@ (cddr (cadr (procedure-source func))))) (sig-type-names (map type-name sig)) - (signature (zip arg-names sig-type-names)) (signature-str (string-join (map (lambda (x) (string-append diff --git a/scm/documentation-generate.scm b/scm/documentation-generate.scm index 6143f60993..b44fc12e0e 100644 --- a/scm/documentation-generate.scm +++ b/scm/documentation-generate.scm @@ -20,6 +20,7 @@ "document-functions.scm" "document-translation.scm" "document-music.scm" + "document-identifiers.scm" "document-backend.scm" "document-markup.scm")) @@ -33,6 +34,10 @@ (markup-doc-string) (open-output-file "markup-commands.tely")) +(display + (identifiers-doc-string) + (open-output-file "identifiers.tely")) + (display (backend-properties-doc-string all-user-grob-properties) diff --git a/scm/layout-page-layout.scm b/scm/layout-page-layout.scm index 090ad06b7b..f7853b01bb 100644 --- a/scm/layout-page-layout.scm +++ b/scm/layout-page-layout.scm @@ -89,7 +89,10 @@ (define (first-line-position line layout) "Position of the first line on page" - (max (+ (ly:output-def-lookup layout 'page-top-space) + (max (+ (if (ly:prob-property? line 'is-title) + ;; do not use page-top-space if first line is a title + 0.0 + (ly:output-def-lookup layout 'page-top-space)) (interval-end (paper-system-staff-extents line))) (interval-end (paper-system-extent line Y)))) diff --git a/scm/lily-library.scm b/scm/lily-library.scm index 6e30cf6ae5..0d09beae53 100644 --- a/scm/lily-library.scm +++ b/scm/lily-library.scm @@ -6,6 +6,8 @@ ;;;; (c) 1998--2006 Jan Nieuwenhuizen ;;;; Han-Wen Nienhuys +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; constants. (define-public X 0) (define-public Y 1) @@ -28,11 +30,17 @@ (define-safe-public DOUBLE-SHARP 4) (define-safe-public SEMI-TONE 2) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; moments + (define-public ZERO-MOMENT (ly:make-moment 0 1)) (define-public (moment-min a b) (if (ly:moment ((a b c) (d e f) (g)) " @@ -328,7 +374,7 @@ found." (if (null? lst) '() (let* ((c (split-one sep? lst '()))) - (cons (reverse! (car c) '()) (split-list (cdr c) sep?))))) + (cons (reverse! (car c) '()) (split-list-by-separator (cdr c) sep?))))) (define-public (offset-add a b) (cons (+ (car a) (car b)) diff --git a/scm/lily.scm b/scm/lily.scm index f3767ca9f5..a016901bcb 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -35,11 +35,12 @@ "load fonts via Ghostscript.") (include-book-title-preview #t "include book-titles in preview images.") (include-eps-fonts #t "Include fonts in separate-system EPS files.") + (job-count #f "Process in parallel") (eps-box-padding #f "Pad EPS bounding box left edge by this much to guarantee alignment between systems") (gui #f "running from gui; redirect stderr to log file") - + (log-file #f "redirect output to log FILE.log") (old-relative #f "relative for simultaneous music works similar to chord syntax") @@ -47,6 +48,7 @@ similar to chord syntax") "experimental mechanism for remembering tweaks") (point-and-click #t "use point & click") (paper-size "a4" "the default paper size") + (pixmap-format "png16m" "GS format to use for pixel images") (protected-scheme-parsing #t "continue when finding errors in inline scheme are caught in the parser. If off, halt on errors, and print a stack trace.") @@ -59,7 +61,7 @@ on errors, and print a stack trace.") (strict-infinity-checking #f "If yes, crash on encountering Inf/NaN") (ttf-verbosity 0 - "how much verbosity for TTF font embedding?") + "how much verbosity for TTF font embedding?") (show-available-fonts #f "List font names available.") @@ -78,7 +80,7 @@ on errors, and print a stack trace.") (if (defined? 'set-debug-cell-accesses!) (set-debug-cell-accesses! #f)) -;(set-debug-cell-accesses! 1000) + ;(set-debug-cell-accesses! 1000) (use-modules (ice-9 regex) (ice-9 safe) @@ -105,6 +107,7 @@ on errors, and print a stack trace.") (if (ly:get-option 'verbose) (begin + (ly:set-option 'protected-scheme-parsing #f) (debug-enable 'debug) (debug-enable 'backtrace) (read-enable 'positions))) @@ -138,7 +141,7 @@ on errors, and print a stack trace.") (if (ly:get-option 'verbose) (ly:progress "[~A" file-name)) (if (not file-name) - (ly:error (_ "Can't find ~A" x))) + (ly:error (_ "Can't find ~A") x)) (primitive-load file-name) (if (ly:get-option 'verbose) (ly:progress "]")))) @@ -175,7 +178,7 @@ on errors, and print a stack trace.") "//*" "/" (string-regexp-substitute "\\\\" "/" x)))) ;; FIXME: this prints a warning. - (define-public (ly-getcwd) + (define-public (ly-getcwd) (slashify (native-getcwd)))) (else (define-public ly-getcwd getcwd))) @@ -254,7 +257,7 @@ The syntax is the same as `define*-public'." (ly:set-default-scale (ly:make-scale #(0 2 4 5 7 9 11))) - + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; other files. @@ -346,8 +349,10 @@ The syntax is the same as `define*-public'." (,vector? . "vector"))) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; debug mem leaks +(define gc-dumping #f) (define gc-protect-stat-count 0) (define-public (dump-gc-protects) (set! gc-protect-stat-count (1+ gc-protect-stat-count)) @@ -362,34 +367,38 @@ The syntax is the same as `define*-public'." ".scm")) (outfile (open-file out-file-name "w"))) - (display (format "Dumping gc protected objs to ~a...\n" out-file-name)) + (set! gc-dumping #t) + (display (format "Dumping GC statistics ~a...\n" out-file-name)) (display (map (lambda (y) (let ((x (car y)) (c (cdr y))) - - (string-append - (string-join - (map object->string (list (object-address x) c x)) - " ") - "\n"))) - + (display + (format "~a (~a) = ~a\n" (object-address x) c x) + outfile))) (filter (lambda (x) (not (symbol? (car x)))) protects)) outfile) -; (display (ly:smob-protects)) + (format outfile "\nprotected symbols: ~a\n" + (length (filter symbol? (map car protects)))) + + + + ;; (display (ly:smob-protects)) (newline outfile) (if (defined? 'gc-live-object-stats) (let* ((stats #f)) (display "Live object statistics: GC'ing\n") + (ly:reset-all-fonts) (gc) (gc) (ly:set-option 'debug-gc-assert-parsed-dead #t) (gc) - + (ly:set-option 'debug-gc-assert-parsed-dead #f) + (set! stats (gc-live-object-stats)) (display "Dumping live object statistics.\n") @@ -398,11 +407,47 @@ The syntax is the same as `define*-public'." (format outfile "~a: ~a\n" (car x) (cdr x))) (sort (gc-live-object-stats) (lambda (x y) - (string count 0) + (let* + ((pid (primitive-fork))) + (if (= pid 0) + (1- count) + (helper (1- count) (cons pid acc)))) + acc)) + (helper count '())) + + (define-public (lilypond-main files) "Entry point for LilyPond." @@ -416,6 +461,64 @@ The syntax is the same as `define*-public'." (if (null? files) (no-files-handler)) + (if (ly:get-option 'read-file-list) + (set! files + (filter (lambda (s) + (> (string-length s) 0)) + (apply append + (map (lambda (f) (string-split (ly:gulp-file f) #\nl)) + files))) + )) + + (if (and (number? (ly:get-option 'job-count)) + (> (length files) (ly:get-option 'job-count))) + + (let* + ((count (ly:get-option 'job-count)) + (split-todo (split-list files count)) + (joblist (multi-fork count)) + (errors '())) + + (if (not (string-or-symbol? (ly:get-option 'log-file))) + (ly:set-option 'log-file "lilypond-multi-run")) + + (if (number? joblist) + (begin + (ly:set-option 'log-file (format "~a-~a" + (ly:get-option 'log-file) joblist)) + (set! files (vector-ref split-todo joblist))) + + (begin + (ly:progress "\nForking into jobs: ~a\n" joblist) + (for-each + (lambda (pid) + (let* ((stat (cdr (waitpid pid)))) + + (if (not (= stat 0)) + (set! errors (cons (list-element-index joblist pid) errors))))) + joblist) + + (for-each + (lambda (x) + (let* ((logfile (format "~a-~a.log" + (ly:get-option 'log-file) x)) + (log (ly:gulp-file logfile)) + (len (string-length log)) + (tail (substring log (max 0 (- len 1024))))) + + (display (format "\n\nlogfile ~a:\n\n ~a" logfile tail)))) + + errors) + + (if (pair? errors) + (ly:error "Children ~a exited with errors." errors)) + + (exit (if (null? errors) 0 1)))))) + + + (if (string-or-symbol? (ly:get-option 'log-file)) + (ly:stderr-redirect (format "~a.log" (ly:get-option 'log-file)) "w")) + (let ((failed (lilypond-all files))) (if (pair? failed) (begin @@ -428,14 +531,7 @@ The syntax is the same as `define*-public'." (exit 0))))) (define-public (lilypond-all files) - (if (ly:get-option 'read-file-list) - (set! files - (filter (lambda (s) - (> (string-length s) 0)) - (apply append - (map (lambda (f) (string-split (ly:gulp-file f) #\nl)) - files))) - )) + (if (ly:get-option 'show-available-fonts) (begin @@ -444,17 +540,25 @@ The syntax is the same as `define*-public'." )) (let* ((failed '()) + (first #t) (handler (lambda (key failed-file) (set! failed (append (list failed-file) failed))))) (for-each (lambda (x) - (ly:set-option 'debug-gc-assert-parsed-dead #f) + + ;; We don't carry info across file boundaries + (if first + (set! first #f) + (gc)) + (lilypond-file handler x) (ly:clear-anonymous-modules) (if (ly:get-option 'debug-gc) - (dump-gc-protects))) - + (dump-gc-protects) + (if (= (random 40) 1) + (ly:reset-all-fonts)))) + files) failed)) @@ -468,12 +572,14 @@ The syntax is the same as `define*-public'." (define-public (gui-main files) (if (null? files) (gui-no-files-handler)) - (let* ((base (basename (car files) ".ly")) - (log-name (string-append base ".log"))) - (if (not (ly:get-option 'gui)) - (ly:message (_ "Redirecting output to ~a...") log-name)) - (ly:stderr-redirect log-name "w") - (ly:message "# -*-compilation-*-") + + (if (not (string? (ly:get-option 'log-file))) + (let* ((base (basename (car files) ".ly")) + (log-name (string-append base ".log"))) + (if (not (ly:get-option 'gui)) + (ly:message (_ "Redirecting output to ~a...") log-name)) + (ly:stderr-redirect log-name "w") + (ly:message "# -*-compilation-*-")) (let ((failed (lilypond-all files))) (if (pair? failed) diff --git a/scm/ly-syntax-constructors.scm b/scm/ly-syntax-constructors.scm index 23befc939e..cfdee35a3b 100644 --- a/scm/ly-syntax-constructors.scm +++ b/scm/ly-syntax-constructors.scm @@ -98,10 +98,14 @@ (define (script-to-mmrest-text music) "Extract 'direction and 'text from SCRIPT-MUSIC, and transform MultiMeasureTextEvent" + (if (memq 'script-event (ly:music-property music 'types)) - (let ((dir (ly:music-property music 'direction)) - (p (make-music 'MultiMeasureTextEvent + (let* + ((dir (ly:music-property music 'direction)) + (tags (ly:music-property music 'tags)) + (p (make-music 'MultiMeasureTextEvent + 'tags tags 'text (ly:music-property music 'text)))) (if (ly:dir? dir) (set! (ly:music-property p 'direction) dir)) diff --git a/scm/markup.scm b/scm/markup.scm index 268efaf879..bd20798e91 100644 --- a/scm/markup.scm +++ b/scm/markup.scm @@ -35,9 +35,32 @@ The command is now available in markup mode, e.g. ;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; markup definer utilities + +(defmacro-public in-module-define-variable (module-name symbol value) + "Define a variable in a module and export its name. + (in-module-define-variable (some module) symbol value)" + (let ((gmodule (gensym "module"))) + `(let ((,gmodule (resolve-module ',module-name))) + (module-define! ,gmodule ',symbol ,value) + (module-export! ,gmodule '(,symbol))))) + +(defmacro-public in-module-define-function + (module-name function-name+arg-list . body) + "Define a public function in a module: + (in-module-define-function (some module) (function-name . args) + ..body..)" + `(in-module-define-variable + ,module-name + ,(car function-name+arg-list) + (let ((proc (lambda ,(cdr function-name+arg-list) + ,@body))) + (set-procedure-property! proc + 'name + ',(car function-name+arg-list)) + proc))) + ;;; `define-markup-command' can be used both for built-in markup ;;; definitions and user defined markups. - (defmacro-public define-markup-command (command-and-args signature . body) " @@ -54,25 +77,37 @@ Syntax: (define-markup-command (COMMAND layout props arg1 arg2 ...) (arg1-type? arg2-type? ...) \"documentation string\" ...command body...) - or: - (define-markup-command COMMAND (arg1-type? arg2-type? ...) - function) +or: + (define-markup-command COMMAND (arg1-type? arg2-type? ...) function) " - (let* ((command (if (pair? command-and-args) (car command-and-args) command-and-args)) - (args (if (pair? command-and-args) (cdr command-and-args) '())) - (command-name (string->symbol (string-append (symbol->string command) "-markup"))) - (make-markup-name (string->symbol (string-append "make-" (symbol->string command-name))))) - `(begin - (define-public ,(if (pair? args) - (cons command-name args) - command-name) - ,@body) - (set! (markup-command-signature ,command-name) (list ,@signature)) - (if (not (member ,command-name markup-function-list)) - (set! markup-function-list (cons ,command-name markup-function-list))) - (define-public (,make-markup-name . args) - (let ((sig (list ,@signature))) - (make-markup ,command-name ,(symbol->string make-markup-name) sig args)))))) + (let* ((command (if (pair? command-and-args) + (car command-and-args) + command-and-args)) + (command-name (string->symbol (format #f "~a-markup" command))) + (make-markup-name (string->symbol (format #f "make-~a-markup" command)))) + `(let ((lily-module (resolve-module '(lily)))) + ;; define the COMMAND-markup procedure in (lily) module + ,(if (pair? command-and-args) + ;; two cases: + ;; 1/ (define (COMMAND-markup layout props arg1 arg2 ...) + ;; ..command body)) + `(in-module-define-function (lily) (,command-name ,@(cdr command-and-args)) + ,@body) + ;; 2/ (define COMMAND-markup function) + `(in-module-define-variable (lily) ,command-name ,(car body))) + (let ((command-proc (module-ref lily-module ',command-name))) + ;; register its command signature + (set! (markup-command-signature command-proc) + (list ,@signature)) + ;; add the COMMAND-markup procedure to the list of markup functions + (if (not (member command-proc markup-function-list)) + (set! markup-function-list (cons command-proc markup-function-list))) + ;; define the make-COMMAND-markup procedure in (lily) module + (in-module-define-function (lily) (,make-markup-name . args) + (make-markup command-proc + ,(symbol->string make-markup-name) + (list ,@signature) + args)))))) (define-public (make-markup markup-function make-name signature args) " Construct a markup object from MARKUP-FUNCTION and ARGS. Typecheck @@ -266,8 +301,8 @@ Also set markup-signature and markup-keyword object properties." (define (markup-symbol-to-proc markup-sym) "Return the markup command procedure which name is `markup-sym', if any." (hash-fold (lambda (key val prev) - (or prev - (if (eqv? (procedure-name key) markup-sym) key #f))) + (or prev + (if (eqv? (procedure-name key) markup-sym) key #f))) #f markup-command-signatures)) @@ -410,9 +445,3 @@ eg: ((italic) (raise 4) (bold)), maps the commands on each markup argument, eg: (car stencils)) (ly:make-stencil '() '(0 . 0) '(0 . 0)))) - - - - - - diff --git a/scm/music-functions.scm b/scm/music-functions.scm index 4f25c3b323..7b0d5d0658 100644 --- a/scm/music-functions.scm +++ b/scm/music-functions.scm @@ -74,6 +74,7 @@ First it recurses over the children, then the function is applied to MUSIC. (define-public (display-music music) "Display music, not done with music-map for clarity of presentation." + (display music) (display ": { ") (let ((es (ly:music-property music 'elements)) @@ -421,8 +422,8 @@ OTTAVATION to `8va', or whatever appropriate." (string (cdr (assoc octavation '((2 . "15ma") (1 . "8va") (0 . #f) - (-1 . "8va bassa") - (-2 . "15ma bassa")))))) + (-1 . "8vb") + (-2 . "15mb")))))) (ly:context-set-property! context 'middleCPosition new-c0) (ly:context-set-property! context 'originalCentralCPosition c0) (ly:context-set-property! context 'ottavation string))))) @@ -528,7 +529,7 @@ of beat groupings " "Split the parts of a chord into different Voices using separator" (let ((es (ly:music-property ch 'elements))) (set! (ly:music-property ch 'elements) - (voicify-list (split-list es music-separator?) 0)) + (voicify-list (split-list-by-separator es music-separator?) 0)) ch)) (define-public (voicify-music m) @@ -800,12 +801,15 @@ if appropriate. (list (make-sequential-music (list - (context-spec-music (make-property-set 'skipTypesetting #t) 'Score) + (context-spec-music (make-property-set 'skipTypesetting #t) + 'Score) (make-music 'SkipMusic 'duration - (ly:make-duration 0 0 - (ly:moment-main-numerator skip-length) - (ly:moment-main-denominator skip-length))) - (context-spec-music (make-property-set 'skipTypesetting #f) 'Score))) + (ly:make-duration + 0 0 + (ly:moment-main-numerator skip-length) + (ly:moment-main-denominator skip-length))) + (context-spec-music (make-property-set 'skipTypesetting #f) + 'Score))) music))) music))) diff --git a/scm/output-lib.scm b/scm/output-lib.scm index 2978f3b198..f15fb8ca25 100644 --- a/scm/output-lib.scm +++ b/scm/output-lib.scm @@ -10,6 +10,8 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; general +(define-public (grob::has-interface grob iface) + (memq iface (ly:grob-interfaces grob))) (define-public (make-stencil-boxer thickness padding callback) @@ -55,14 +57,28 @@ ;; The TabNoteHead tablatureFormat callback. ;; Compute the text grob-property -(define-public (fret-number-tablature-format string tuning pitch) - (make-whiteout-markup - (make-vcenter-markup - (number->string - (- (ly:pitch-semitones pitch) - (list-ref tuning - ;; remove 1 because list index starts at 0 and guitar string at 1. - (- string 1))))))) +(define-public (fret-number-tablature-format string + context event) + (let* + ((tuning (ly:context-property context 'stringTunings)) + (pitch (ly:event-property event 'pitch)) + (is-harmonic (apply + functional-or + (map + (lambda (ev) + (eq? 'harmonic-event (ly:event-property ev 'class))) + (ly:event-property event 'articulations))))) + + + (make-whiteout-markup + (make-vcenter-markup + (format + "~a" + (- (ly:pitch-semitones pitch) + (list-ref tuning + ;; remove 1 because list index starts at 0 and guitar string at 1. + (- string 1)))))) + )) ;; The 5-string banjo has got a extra string, the fifth (duh), wich ;; starts at the fifth fret on the neck. Frets on the fifth string @@ -70,14 +86,20 @@ ;; the "first fret" on the fifth string is really the sixth fret ;; on the banjo neck. ;; We solve this by defining a new fret-number-tablature function: -(define-public (fret-number-tablature-format-banjo string tuning pitch) +(define-public (fret-number-tablature-format-banjo string + context event) + (let* + ((tuning (ly:context-property context 'stringTunings)) + (pitch (ly:event-property event 'pitch)) + ) (make-whiteout-markup (make-vcenter-markup (let ((fret (- (ly:pitch-semitones pitch) (list-ref tuning (- string 1))))) (number->string (cond ((and (> fret 0) (= string 5)) (+ fret 5)) - (else fret))))))) + (else fret)))))) + )) ; default tunings for common string instruments @@ -285,6 +307,37 @@ centered, X==1 is at the right, X == -1 is at the left." ;; * Pitch Trill Heads ;; * Parentheses +(define-public (parentheses-item::calc-parenthesis-stencils grob) + (let* ( + (font (ly:grob-default-font grob)) + (lp (ly:font-get-glyph font "accidentals.leftparen")) + (rp (ly:font-get-glyph font "accidentals.rightparen")) + ) + + (list lp rp))) + + +(define (grob-text grob text) + (let* + ((layout (ly:grob-layout grob)) + (defs (ly:output-def-lookup layout 'text-font-defaults)) + (props (ly:grob-alist-chain grob defs))) + + (ly:text-interface::interpret-markup + layout props text))) + +(define-public (parentheses-item::calc-angled-bracket-stencils grob) + (let* ( + (font (ly:grob-default-font grob)) + (lp (ly:stencil-aligned-to (ly:stencil-aligned-to (grob-text grob (ly:wide-char->utf-8 #x2329)) + Y CENTER) X RIGHT)) + (rp (ly:stencil-aligned-to (ly:stencil-aligned-to (grob-text grob (ly:wide-char->utf-8 #x232A)) + Y CENTER) X LEFT)) + ) + + (list (stencil-whiteout lp) + (stencil-whiteout rp)))) + (define (parenthesize-elements grob . rest) (let* ((refp (if (null? rest) @@ -292,10 +345,9 @@ centered, X==1 is at the right, X == -1 is at the left." (car rest))) (elts (ly:grob-object grob 'elements)) (x-ext (ly:relative-group-extent elts refp X)) - - (font (ly:grob-default-font grob)) - (lp (ly:font-get-glyph font "accidentals.leftparen")) - (rp (ly:font-get-glyph font "accidentals.rightparen")) + (stencils (ly:grob-property grob 'stencils)) + (lp (car stencils)) + (rp (cadr stencils)) (padding (ly:grob-property grob 'padding 0.1))) (ly:stencil-add @@ -324,6 +376,7 @@ centered, X==1 is at the right, X == -1 is at the left." )) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; @@ -336,12 +389,19 @@ centered, X==1 is at the right, X == -1 is at the left." value) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; falls +;; falls/doits -(define-public (fall::print spanner) +(define-public (bend::print spanner) + (define (close a b) + (< (abs (- a b)) 0.01)) + (let* ((delta-y (* 0.5 (ly:grob-property spanner 'delta-position))) (left-span (ly:spanner-bound spanner LEFT)) + (dots (if (and (grob::has-interface left-span 'note-head-interface) + (ly:grob? (ly:grob-object left-span 'dot))) + (ly:grob-object left-span 'dot) #f)) + (right-span (ly:spanner-bound spanner RIGHT)) (thickness (* (ly:grob-property spanner 'thickness) (ly:output-def-lookup (ly:grob-layout spanner) @@ -351,9 +411,19 @@ centered, X==1 is at the right, X == -1 is at the left." (ly:grob-common-refpoint spanner left-span X) X)) + (common-y (ly:grob-common-refpoint spanner left-span Y)) (left-x (+ padding - (interval-end (ly:grob-robust-relative-extent - left-span common X)))) + (max (interval-end (ly:grob-robust-relative-extent + left-span common X)) + (if (and + dots + (close (ly:grob-relative-coordinate dots common-y Y) + (ly:grob-relative-coordinate spanner common-y Y))) + (interval-end (ly:grob-robust-relative-extent dots common X)) + -10000) ;; TODO: use real infinity constant. + ))) + (x (display (grob::has-interface left-span 'note-head-interface))) + (right-x (- (interval-start (ly:grob-robust-relative-extent right-span common X)) padding)) @@ -372,9 +442,10 @@ centered, X==1 is at the right, X == -1 is at the left." )))) ) + (display left-span) (ly:make-stencil exp - (cons 0 dx) + (cons (- left-x self-x) (- right-x self-x)) (cons (min 0 delta-y) (max 0 delta-y))))) @@ -416,7 +487,7 @@ centered, X==1 is at the right, X == -1 is at the left." (if (> digit 5) (ly:input-message (ly:event-property event 'origin) - "Music for the martians")) + "Warning: Fingering notation for finger number ~a" digit)) (number->string digit 10) )) diff --git a/scm/parser-ly-from-scheme.scm b/scm/parser-ly-from-scheme.scm index 9d2b3b5d47..86f3f89a27 100644 --- a/scm/parser-ly-from-scheme.scm +++ b/scm/parser-ly-from-scheme.scm @@ -78,7 +78,7 @@ character." ;; other caracters (else (display c out)))))))) - `(let ((parser-clone (ly:clone-parser parser))) + `(let ((parser-clone (ly:parser-clone parser))) ,@(map (lambda (binding) `(ly:parser-define! parser-clone ',(car binding) ,(cdr binding))) (reverse bindings)) diff --git a/scm/ps-to-png.scm b/scm/ps-to-png.scm index d76f926a90..2d429886f3 100644 --- a/scm/ps-to-png.scm +++ b/scm/ps-to-png.scm @@ -108,7 +108,7 @@ (rename-file file old) (my-system be-verbose #t - (format #f "convert -scale \"~a%\" ~a ~a" percentage old file)) + (format #f "convert -scale \"~a%\" -depth 8 ~a ~a" percentage old file)) (delete-file old) )) @@ -127,26 +127,31 @@ 0))) (define-public (make-ps-images ps-name . rest) - (let-optional - rest ((resolution 90) - page-width - page-height - (rename-page-1? #f) - (verbose? #f) - (aa-factor 1) - ) - - (let* ((base (basename (re-sub "[.]e?ps" "" ps-name))) - (png1 (string-append base ".png")) - (pngn (string-append base "-page%d.png")) + (let-keywords* + rest #f + ((resolution 90) + (page-width 100) + (page-height 100) + (rename-page-1 #f) + (be-verbose #f) + (pixmap-format 'png16m) + (anti-alias-factor 1)) + + (let* ( + (format-str (format "~a" pixmap-format)) + (extension (cond + ((string-contains format-str "png") "png") + ((string-contains format-str "jpg") "jpeg") + ((string-contains format-str "jpeg") "jpeg") + (else + (ly:error "Unknown pixmap format ~a" pixmap-format)))) + (base (basename (re-sub "[.]e?ps" "" ps-name))) + (png1 (format "~a.~a" base extension)) + (pngn (format "~a-page%d.~a" base extension)) (page-count (ps-page-count ps-name)) - (multi-page? (> page-count 1)) (output-file (if multi-page? pngn png1)) - ;; png16m is because Lily produces color nowadays. - ;; can't use pngalpha device, since IE is broken. - ;; (gs-variable-options (if multi-page? (format #f "-dDEVICEWIDTHPOINTS=~,2f -dDEVICEHEIGHTPOINTS=~,2f" page-width page-height) @@ -158,16 +163,17 @@ -dGraphicsAlphaBits=4\ -dTextAlphaBits=4\ -dNOPAUSE\ - -sDEVICE=png16m\ + -sDEVICE=~a\ -sOutputFile=~S\ -r~S\ ~S\ -c quit" (search-gs) - (if verbose? "" "-q") + (if be-verbose "" "-q") gs-variable-options + pixmap-format output-file - (* aa-factor resolution) ps-name)) + (* anti-alias-factor resolution) ps-name)) (status 0) (files '())) @@ -178,7 +184,7 @@ (set! cmd (re-sub "=" "#" cmd)) (set! cmd (re-sub "-dSAFER " "" cmd)))) - (set! status (my-system verbose? #f cmd)) + (set! status (my-system be-verbose #f cmd)) (set! files (if multi-page? @@ -193,7 +199,7 @@ (map delete-file files) (exit 1))) - (if (and rename-page-1? multi-page?) + (if (and rename-page-1 multi-page?) (begin (rename-file (re-sub "%d" "1" pngn) png1) (set! files @@ -201,8 +207,8 @@ (cdr files))) )) - (if (not (= 1 aa-factor)) - (for-each (lambda (f) (scale-down-image verbose? aa-factor f)) + (if (not (= 1 anti-alias-factor)) + (for-each (lambda (f) (scale-down-image be-verbose anti-alias-factor f)) files)) files))) diff --git a/scm/safe-lily.scm b/scm/safe-lily.scm index 31161e25cf..370bfea2a8 100644 --- a/scm/safe-lily.scm +++ b/scm/safe-lily.scm @@ -161,8 +161,8 @@ ly:hara-kiri-group-spanner::force-hara-kiri-callback ly:hara-kiri-group-spanner::y-extent ly:horizontal-bracket::print - ly:hyphen-spanner::print - ly:hyphen-spanner::set-spacing-rods + ly:lyric-hyphen::print + ly:lyric-hyphen::set-spacing-rods ly:key-signature-interface::print ly:line-spanner::print ly:lyric-extender::print diff --git a/scm/stencil.scm b/scm/stencil.scm index b2d425e6ea..62b43cebc2 100644 --- a/scm/stencil.scm +++ b/scm/stencil.scm @@ -118,13 +118,32 @@ encloses the contents. `(text ,font-metric ,text) (car b) (cdr b)))) (define-public (fontify-text-white scale font-metric text) - "Set TEXT with scale factor s" + "Set TEXT with scale factor SCALE" (let* ((b (ly:text-dimension font-metric text)) ;;urg -- workaround for using ps font (c `(white-text ,(* 2 scale) ,text))) ;;urg -- extent is not from ps font, but we hope it's close (ly:make-stencil c (car b) (cdr b)))) +(define-public (stencil-with-color stencil color) + (ly:make-stencil + (list 'color color (ly:stencil-expr stencil)) + (ly:stencil-extent stencil X) + (ly:stencil-extent stencil Y))) + +(define-public (stencil-whiteout stencil) + (let* + ((x-ext (ly:stencil-extent stencil X)) + (y-ext (ly:stencil-extent stencil Y)) + + ) + + (ly:stencil-add + (stencil-with-color (ly:round-filled-box x-ext y-ext 0.0) + white) + stencil) + )) + (define-public (dimension-arrows destination) "Draw twosided arrow from here to @var{destination}" diff --git a/scripts/lilypond-book.py b/scripts/lilypond-book.py index a99ceb49e4..6699ba2dcb 100644 --- a/scripts/lilypond-book.py +++ b/scripts/lilypond-book.py @@ -35,6 +35,7 @@ import commands import os import sys import re +import md5 ################ # RELOCATION @@ -1066,46 +1067,52 @@ class Lilypond_snippet (Snippet): d.update (locals()) return (PREAMBLE_LY + body) % d - # TODO: Use md5? def get_hash (self): if not self.hash: - self.hash = abs (hash (self.full_ly ())) + hash = md5.md5 (self.relevant_contents (self.full_ly ())) + + ## let's not create too long names. + self.hash = hash.hexdigest ()[:10] + return self.hash def basename (self): if FILENAME in self.option_dict: return self.option_dict[FILENAME] if global_options.use_hash: - return 'lily-%d' % self.get_hash () + return 'lily-%s' % self.get_hash () raise 'to be done' def write_ly (self): outf = open (self.basename () + '.ly', 'w') outf.write (self.full_ly ()) - open (self.basename () + '.txt', 'w').write ('image of music') + def relevant_contents (self, ly): + return re.sub (r'\\(version|sourcefileline)[^\n]*\n', '', ly) + def ly_is_outdated (self): base = self.basename () - - tex_file = '%s.tex' % base - eps_file = '%s.eps' % base - system_file = '%s-systems.tex' % base - ly_file = '%s.ly' % base - ok = os.path.exists (ly_file) \ - and os.path.exists (system_file)\ - and os.stat (system_file)[stat.ST_SIZE] \ - and re.match ('% eof', open (system_file).readlines ()[-1]) - if ok and (not global_options.use_hash or FILENAME in self.option_dict): - ok = (self.full_ly () == open (ly_file).read ()) - if ok: - # TODO: Do something smart with target formats - # (ps, png) and m/ctimes. + ly_file = base + '.ly' + tex_file = base + '.tex' + eps_file = base + '.eps' + systems_file = base + '-systems.tex' + + if (os.path.exists (ly_file) + and os.path.exists (systems_file) + and os.stat (systems_file)[stat.ST_SIZE] + and re.match ('% eof', open (systems_file).readlines ()[-1]) + and (global_options.use_hash or FILENAME in self.option_dict) + and (self.relevant_contents (self.full_ly ()) + == self.relevant_contents (open (ly_file).read ()))): return None + if global_options.verbose: + print 'OUT OF DATE: ', ly_file return self def png_is_outdated (self): base = self.basename () + # FIXME: refactor stupid OK stuff ok = not self.ly_is_outdated () if global_options.format in (HTML, TEXINFO): ok = ok and os.path.exists (base + '.eps') @@ -1127,6 +1134,7 @@ class Lilypond_snippet (Snippet): if backend == 'ps': return 0 + # FIXME: refactor stupid OK stuff base = self.basename () ok = self.ly_is_outdated () ok = ok and (os.path.exists (base + '.texstr')) @@ -1279,11 +1287,6 @@ class Lilypond_file_snippet (Lilypond_snippet): def ly (self): name = self.substring ('filename') contents = open (find_file (name)).read () - - ## strip version string to make automated regtest comparisons - ## across versions easier. - contents = re.sub (r'\\version *"[^"]*"', '', contents) - return ('\\sourcefilename \"%s\"\n\\sourcefileline 0\n%s' % (name, contents)) @@ -1766,6 +1769,7 @@ def do_options (): return args def main (): + # FIXME: 85 lines of `main' macramee?? files = do_options () file = files[0] diff --git a/scripts/lilypond-invoke-editor.scm b/scripts/lilypond-invoke-editor.scm index 048ac3f53b..275aa901d8 100755 --- a/scripts/lilypond-invoke-editor.scm +++ b/scripts/lilypond-invoke-editor.scm @@ -12,6 +12,7 @@ (use-modules (ice-9 getopt-long) (ice-9 regex) + (srfi srfi-1) (srfi srfi-13) (srfi srfi-14)) @@ -23,7 +24,6 @@ ;; argv0 relocation -- do in wrapper? - (define LILYPONDPREFIX (let* ((prefix (or (getenv "LILYPONDPREFIX") @@ -124,6 +124,19 @@ Options: (format "~a ~a" (getenv "BROWSER") uri) (format #f "firefox -remote 'OpenURL(~a,new-tab)'" uri)))) + +(define (strip-framework-path var) + (define pat "lilypond/usr") + (let* + ((val (getenv var)) + (paths (string-split val #\:)) + (without (remove (lambda (s) (string-contains s pat)) + paths))) + + (if (not (= (length without) + (length paths))) + (setenv var (string-join without ":"))))) + (define (main args) (let ((files (parse-options args))) (if (running-from-gui?) @@ -138,8 +151,10 @@ Options: (show-help (current-error-port)) (exit 2))) (set! %load-path (cons LILYPONDPREFIX %load-path)) + (primitive-eval '(use-modules (scm editor))) + (strip-framework-path "LD_LIBRARY_PATH") (let* ((uri (car files))) (if (is-textedit-uri? uri) (run-editor uri) diff --git a/stepmake/aclocal.m4 b/stepmake/aclocal.m4 index be97fa96de..25a0f5426b 100644 --- a/stepmake/aclocal.m4 +++ b/stepmake/aclocal.m4 @@ -34,7 +34,7 @@ AC_DEFUN(STEPMAKE_GET_VERSION, [ ## grab the first version number in --version output. eval _ver=\"\`("$1" --version || "$1" -V) 2>&1 | grep '\(^\| \)[0-9][0-9]*\.[0-9]' \ | head -n 1 \ - | tr ' ' '\n' | grep '[0-9]\.[0-9]' | head -n 1 | sed 's/\([0-9.]*\).*/\1/g'\`\" + | tr ' ' '\n' | sed 's/\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/g' | grep '\(^\| \)[0-9][0-9]*\.[0-9]' | head -n 1\`\" if test -z "$_ver"; then ## If empty, try date [fontforge] diff --git a/stepmake/bin/add-html-footer.py b/stepmake/bin/add-html-footer.py index d19a9a4b74..08ff5ff061 100644 --- a/stepmake/bin/add-html-footer.py +++ b/stepmake/bin/add-html-footer.py @@ -13,6 +13,7 @@ import getopt index_url='' top_url='' changelog_file='' +content_negotiation = False package_name = '' package_version = '' @@ -68,6 +69,7 @@ Add header, footer and top of ChangLog file (up to the ********) to HTML-FILE Options: --changelog=FILE use FILE as ChangeLog [ChangeLog] + --content-negotiation strip .html and .png from urls --footer=FILE use FILE as footer --header=FILE use FILE as header -h, --help print this help @@ -80,13 +82,15 @@ Options: (options, files) = getopt.getopt(sys.argv[1:], 'h', [ 'changelog=', 'footer=', 'header=', 'help', 'index=', - 'name=', 'version=']) + 'name=', 'content-negotiation', 'version=']) for opt in options: o = opt[0] a = opt[1] if o == '--changelog': changelog_file = a + elif o == '--content-negotiation': + content_negotiation = True elif o == '--footer': footer_file = a elif o == '--header': @@ -266,10 +270,11 @@ except: return s underscore = _ - +C = 'site' LANGUAGES = ( - ('site', 'English'), + (C, 'English'), ('nl', 'Nederlands'), + ('fr', 'French') ) language_available = _ ("Other languages: %s.") % "%(language_menu)s" @@ -287,7 +292,7 @@ LANGUAGES_TEMPLATE = '''\ def file_lang (file, lang): (base, ext) = os.path.splitext (file) base = os.path.splitext (base)[0] - if lang and lang != 'site': + if lang and lang != C: return base + '.' + lang + ext return base + ext @@ -298,8 +303,8 @@ def i18n (file_name, page): base_name = os.path.basename (file_name) - lang = 'site' - m = re.match ('.*[.]([^.]*).html', file_name) + lang = C + m = re.match ('.*[.]([^/.]*).html', file_name) if m: lang = m.group (1) @@ -308,14 +313,19 @@ def i18n (file_name, page): and os.path.exists (file_lang (file_name, x[0])), LANGUAGES) - # Strip .html, .png suffix for auto language selection. -# page = re.sub ('''(href|src)=[\'"]([^/][.]*[^.:\'"]*)(.html(#[^"]*)|.png)[\'"]''', -# '\\1="\\2"', page) + # Strip .html, .png suffix for auto language selection (content + # negotiation). The menu must keep the full extension, so do + # this before adding the menu. + if content_negotiation: + page = re.sub ('''(href|src)=[\'"]([^/][.]*[^.:\'"]*)(.html|.png)(#[^"\']*|)[\'"]''', + '\\1="\\2\\4"', page) - # Create language menu. + # Add menu after stripping: must not have autoselection for language menu. language_menu = '' for (prefix, name) in available: lang_file = file_lang (base_name, prefix) + if language_menu != '': + language_menu += ', ' language_menu += '%(name)s' % vars () languages = '' @@ -331,7 +341,6 @@ def i18n (file_name, page): page = page + languages return page - ## end i18n for f in files: do_file (f) diff --git a/stepmake/stepmake/generic-targets.make b/stepmake/stepmake/generic-targets.make index 26874ad5b5..7546bbd2b5 100644 --- a/stepmake/stepmake/generic-targets.make +++ b/stepmake/stepmake/generic-targets.make @@ -7,9 +7,8 @@ all: default man: $(LOOP) -# be careful about deletion. clean: local-clean - -rm -f $(outdir)/* + -rm -rf "./$(outdir)" $(LOOP) ifneq ($(strip $(depth)),.) @@ -23,8 +22,8 @@ distclean: clean cvs-clean: $(MAKE) local-distclean - find . -type d -name out | xargs rm -rf - find . -type d -name out-www | xargs rm -rf + rm -rf out + rm -rf out-www rm -f aclocal.m4 configure maintainerclean: diff --git a/stepmake/stepmake/podir-vars.make b/stepmake/stepmake/podir-vars.make index 1bb8bf6d7f..b8e53f4b2c 100644 --- a/stepmake/stepmake/podir-vars.make +++ b/stepmake/stepmake/podir-vars.make @@ -1 +1,11 @@ # empty + +POT_FILES = $(call src-wildcard,*.pot) +PO_FILES = $(call src-wildcard,*.po) +MO_FILES = $(addprefix $(outdir)/, $(PO_FILES:.po=.mo)) + +HELP_CATALOGS = $(PO_FILES:%.po=%) +CATALOGS = $(HELP_CATALOGS:$(DOMAIN)=) + +DIST_FILES += $(POT_FILES) $(PO_FILES) + diff --git a/tex/SConscript b/tex/SConscript index c9aed16582..e9feaa3131 100644 --- a/tex/SConscript +++ b/tex/SConscript @@ -1,5 +1,5 @@ # -*-python-*- Import ('env', 'install', 'src_glob') -sources = src_glob ('*.tex') + ['latin1.enc'] +sources = src_glob ('*.tex') install (sources, env['sharedir_package_version'] + '/tex')