From: fred Date: Wed, 27 Mar 2002 00:32:43 +0000 (+0000) Subject: lilypond-1.3.104 X-Git-Tag: release/1.5.59~1130 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=3e3f4d224fe93afa39a26d6ff00ec06123e62871;p=lilypond.git lilypond-1.3.104 --- diff --git a/DEDICATION b/DEDICATION index d889d1fa0c..3cded516bc 100644 --- a/DEDICATION +++ b/DEDICATION @@ -13,9 +13,9 @@ certainly not least) Janneke! HWN That's a nice thought, Wendy. I've got a few too, to spread -the credits a bit (Again, no particular order) Michelle, Illushka, -Ruth, Eva, Fro/ydis, Monique, Noor, Sascha, Monique, Ilse, Monique, -Eva, Roos, Judith, Tim, and, of course, Wendy! +the credits a bit (Again, no particular order) Michelle, Illushka, +Mieke, Ruth, Eva, Fro/ydis, Monique, Mary Anne, Noor, Sascha, Monique, +Ilse, Monique, Eva, Roos, Judith, Tim, Connie and, of course, Wendy! JCN diff --git a/Documentation/index.texi b/Documentation/index.texi index fc4c732961..0bc1a04159 100644 --- a/Documentation/index.texi +++ b/Documentation/index.texi @@ -22,9 +22,7 @@ @itemize @bullet @item @uref{../user/out-www/lilypond.html,LilyPond reference manual} also available in @uref{../user/out-www/lilypond.ps.gz,Postscript} -@item LilyPond @uref{../user/out-www/backend.html,backend reference}, - @uref{../user/out-www/engravers.html, engraver reference} and - @uref{../user/out-www/contexts.html, context reference}, +@item LilyPond @uref{../user/out-www/lilypond-internals.html,internals} @item @uref{../user/out-www/glossary.html,A glossary of musical terms}, includes translations. Also available in @uref{../user/out-www/glossary.ps.gz,Postscript}) @item @uref{../user/out-www/mudela-book.html,mudela-book}, a tool for diff --git a/Documentation/user/GNUmakefile b/Documentation/user/GNUmakefile index 98e71f00e6..0cee86ef33 100644 --- a/Documentation/user/GNUmakefile +++ b/Documentation/user/GNUmakefile @@ -18,6 +18,8 @@ PS_FILES = $(DVI_FILES:.dvi=.ps) $(OUTDOC_FILES:.doc=.ps) $(OUTTEX_FILES:.tex=. PS_GZ_FILES= $(addsuffix .gz, $(PS_FILES)) +INFO_FILES = $(addprefix $(outdir)/, lilypond.info lilypond-internals.info) + STEPMAKE_TEMPLATES=tex texinfo documentation LOCALSTEPMAKE_TEMPLATES=lilypond mudela @@ -27,10 +29,11 @@ dvi: $(DVI_FILES) ps: $(PS_FILES) -# urg -default: +info: $(INFO_FILES) + +default: info -local-WWW: $(HTML_FILES) $(datafiles) $(PS_GZ_FILES) backdoc +local-WWW: $(HTML_FILES) $(datafiles) $(PS_GZ_FILES) backdoc-WWW true # $(PYTHON) $(step-bindir)/ls-latex.py --title 'User documentation' \ @@ -45,6 +48,9 @@ $(outdir)/%.bib: %.bib localclean: rm -f fonts.aux fonts.log feta*.tfm feta*.*pk -#ugh. out/ hardcoded. -backdoc: - (cd $(outdir); $(topdir)/lily/out/lilypond $(depth)/../ly/generate-documentation) +backdoc-WWW: $(outdir)/lilypond-internals.html + +#ugh. lily/OUT/lilypond hardcoded. +$(outdir)/lilypond-internals.texi: + (cd $(outdir); $(topdir)/lily/out/lilypond ../$(srcdir)/../ly/generate-documentation) + diff --git a/Documentation/user/lilypond.tely b/Documentation/user/lilypond.tely index b4bbf8a654..d988d77164 100644 --- a/Documentation/user/lilypond.tely +++ b/Documentation/user/lilypond.tely @@ -1,12 +1,12 @@ \input texinfo @c -*-texinfo-*- @setfilename lilypond.info -@settitle LilyPond Reference Manual +@settitle GNU LilyPond @titlepage -@title LilyPond Reference Manual -@subtitle The GNU Project Typesetter +@title GNU LilyPond +@subtitle The music typesetter @author Han-Wen Nienhuys, Jan Nieuwenhuizen and Adrian Mariano Copyright @copyright{} 1999 by the authors @@ -77,18 +77,23 @@ than the names being similar :-)" @end ignore -@contents - @node Top, , , (dir) +@chapter GNU LilyPond --- The music typesetter + +@contents @menu -* Tutorial:: a tutorial introduction to lilypond. -* Invoking LilyPond:: Operation. -* Reporting Bugs:: Where to report bugs. -* Reference Manual:: Reference Manual. -* More information:: Where to turn to for more help. -* convert-mudela:: Upgrading input files. -* Index:: Unified index. +* Tutorial:: A tutorial introduction to lilypond. +* Invoking LilyPond:: Operation. +* Reporting Bugs:: Where to report bugs. +* Reference Manual:: Reference Manual. +@c Move to Reference Manual? +* Internals:(lilypond-internals). Auto generated detailed documentation. +* More information:: Where to turn to for more help. +* convert-mudela:: Upgrading input files. +@c Hmm, having the generated doco in a separate file, +@c the index can't refer to that. +* Index:: Unified index. @end menu @macro keyindex {word} diff --git a/Documentation/user/refman.itely b/Documentation/user/refman.itely index af651ea05a..77f40dfcd7 100644 --- a/Documentation/user/refman.itely +++ b/Documentation/user/refman.itely @@ -1,3 +1,4 @@ +@c -*-texinfo-*- @c TODO: @c - Reinsert subsection commands that were lost in the @c ancient conversion from YODL! /MB @@ -6,42 +7,45 @@ @c - Fix indexing (keyindex) so it doesn't add line breaks /MB @node Reference Manual, , , Top +@chapter Reference Manual + @menu -* Overview:: Overview -* Top level:: Top level -* notenames:: notenames -* Lexical conventions:: Lexical conventions -* Other languages:: notelang -* modes:: modes -* Types:: Types -* Music expressions:: Music expressions -* Atomic music expressions:: Atomic music expressions -* Note specification:: notedesc -* barlines:: barlines -* Manual beams:: Manual beam -* stem tremolo:: tremolo -* Compound music expressions:: Compound music expressions -* relative:: relative -* Repeats:: Repeats -* transpose:: transpose -* Ambiguities:: Ambiguities -* Notation conversion specifics:: Notation conversion specifics -* autobeam:: autobeam -* lyricprint:: lyricprint -* Notation Contexts:: Notation Contexts -* Properties:: Changing formatting -* Notation output definitions:: Notation output definitions -* paper:: paper -* Paper variables:: papervars -* contextdefs:: contextdefs -* engravers:: engravers -* Sound output:: Sound output -* midilist:: midilist -* Pre-defined Identifiers:: Pre-defined Identifiers +* Overview:: Overview +* Top level:: Top level +* notenames:: notenames +* Lexical conventions:: Lexical conventions +* Other languages:: notelang +* modes:: modes +* Types:: Types +* Music expressions:: Music expressions +* Atomic music expressions:: Atomic music expressions +* Note specification:: notedesc +* barlines:: barlines +* Manual beams:: Manual beam +* stem tremolo:: tremolo +* Compound music expressions:: Compound music expressions +* relative:: relative +* Repeats:: Repeats +* transpose:: transpose +* Ambiguities:: Ambiguities +* Notation conversion specifics:: Notation conversion specifics +* autobeam:: autobeam +* lyricprint:: lyricprint +* Notation Contexts:: Notation Contexts +* Properties:: Changing formatting +* Notation output definitions:: Notation output definitions +* paper:: paper +* Paper variables:: papervars +* contextdefs:: contextdefs +* Sound output:: Sound output +* midilist:: midilist +* Pre-defined Identifiers:: Pre-defined Identifiers +@c May be fragile. Better make single link to generated doco? +* Interpretation contexts:(lilypond-internals)LilyPond interpretation contexts. +* Engravers:(lilypond-internals)LilyPond engravers. +* Backend:(lilypond-internals)LilyPond backend. @end menu -@chapter Reference Manual - @node Overview, , , Reference Manual diff --git a/Documentation/user/tutorial.itely b/Documentation/user/tutorial.itely index 66c915a63c..2a6e64e63a 100644 --- a/Documentation/user/tutorial.itely +++ b/Documentation/user/tutorial.itely @@ -1,13 +1,14 @@ -@chapter Tutorial - +@c -*-texinfo-*- @node Tutorial, , , Top +@chapter Tutorial + @menu -* Introduction:: Introduction -* The first tune:: The first tune -* Lyrics and chords:: Lyrics and chords -* Piano music:: Piano music -* end of tutorial:: The end +* Introduction:: Introduction +* The first tune:: The first tune +* Lyrics and chords:: Lyrics and chords +* Piano music:: Piano music +* end of tutorial:: The end @end menu @node Introduction, , , Tutorial diff --git a/debian/GNUmakefile b/debian/GNUmakefile index b9ea31efad..7e67f9d823 100644 --- a/debian/GNUmakefile +++ b/debian/GNUmakefile @@ -7,9 +7,9 @@ at-dir = $(outdir)/ at-ext = EXTRA_DIST_FILES = README.Debian TODO $(CONF_FILES) \ - control.foka ex.prerm ex.doc-base -CONF_FILES = changelog control copyright emacsen-startup \ - preinst postinst postrm rules watch + control.foka +CONF_FILES = changelog control copyright doc-base emacsen-startup \ + preinst postinst postrm prerm rules watch #OUTCONF_FILES = $(addprefix $(outdir)/, $(basename $(CONF_FILES))) $(OUTIN_FILES) OUTCONF_FILES = $(OUTIN_FILES) OUT_DIST_FILES = $(OUTIN_FILES) diff --git a/debian/changelog b/debian/changelog index af625de087..dc55185130 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +lilypond1.3 (1.3.103) unstable; urgency=low + + * Re-enabled info doc rules. + + -- Jan Nieuwenhuizen Sun, 5 Nov 2000 22:15:57 -0100 + lilypond1.3 (1.3.79-1) unstable; urgency=low * New upstream release. diff --git a/debian/doc-base b/debian/doc-base new file mode 100644 index 0000000000..cb521ca139 --- /dev/null +++ b/debian/doc-base @@ -0,0 +1,11 @@ +Document: lilypond +Title: GNU LilyPond, the music typesetter +Author: Various +Abstract: This documentation describes LilyPond (the GNU Project music + typesetter), its language Mudela, and the Mutopia project, a.k.a. + "Music To the People." +Section: Apps/Music + +Format: info +Index: /usr/share/info/lilypond.info.gz +Files: /usr/share/info/lilypond.info* /usr/share/info/lilypond-internals.info* diff --git a/debian/prerm b/debian/prerm new file mode 100644 index 0000000000..0c665397e0 --- /dev/null +++ b/debian/prerm @@ -0,0 +1,6 @@ +#!/bin/sh +set -e + +install-info --quiet --remove /usr/share/info/lilypond.info.gz + +#DEBHELPER# diff --git a/debian/rules b/debian/rules index 2330b5cf67..de648132d4 100644 --- a/debian/rules +++ b/debian/rules @@ -84,8 +84,9 @@ binary-indep: build install binary-arch: build install dh_testdir dh_testroot - cp -av lilypond-mode.el $(r)/usr/share/emacs/site-lisp/ - dh_installdocs DEDICATION NEWS ROADMAP TODO *.txt \ + cp -av lilypond-mode.el lilypond-font-lock.el \ + $(r)/usr/share/emacs/site-lisp/ + dh_installdocs DEDICATION NEWS ROADMAP *.txt \ Documentation/pictures/out/*.png \ Documentation/out/*.txt \ Documentation/*/out/[a-z]*.dvi \ diff --git a/input/test/chord-names.ly b/input/test/chord-names.ly index 940999a4b4..cccabf2568 100644 --- a/input/test/chord-names.ly +++ b/input/test/chord-names.ly @@ -23,7 +23,7 @@ chord = \notes\transpose c''\chords{ linewidth = -1.0; \translator { \ChordNamesContext - ChordNames \push #'word-space = #1 + ChordName \push #'word-space = #1 } } } diff --git a/input/test/chords.ly b/input/test/chords.ly index 76e1ca7395..fae83c6f55 100644 --- a/input/test/chords.ly +++ b/input/test/chords.ly @@ -62,7 +62,7 @@ keys = \notes{ \paper{ \translator { \ChordNamesContext - ChordNames \push #'word-space = #1 + ChordName \push #'word-space = #1 } } } diff --git a/lily/time-signature.cc b/lily/time-signature.cc index 77cc1ab699..e6afe98bd2 100644 --- a/lily/time-signature.cc +++ b/lily/time-signature.cc @@ -50,24 +50,36 @@ Time_signature::brew_molecule (SCM smob) Molecule Time_signature::special_time_signature (Score_element*me, String s, int n, int d) { - // First guess: s contains only the signature style - String symbolname = "timesig-" + s + to_str (n) + "/" + to_str (d); + /* + Randomly probing the font sucks? + */ + + SCM alist_chain = Font_interface::font_alist_chain (me); + + SCM style_chain = + Font_interface::add_style (me, ly_symbol2scm ("timesig-symbol"), + alist_chain); + + Font_metric *feta = Font_interface::get_font (me, style_chain); /* - Randomly probing the font sucks? - */ + First guess: s contains only the signature style, append fraction. + */ + String symbolname = "timesig-" + s + to_str (n) + "/" + to_str (d); - Molecule m = Font_interface::get_default_font (me)->find_by_name (symbolname); + Molecule m = feta->find_by_name (symbolname); if (!m.empty_b()) return m; - // Second guess: s contains the full signature name - m = Font_interface::get_default_font (me)->find_by_name ("timesig-"+s); + /* + Second guess: s contains the full signature name + */ + m = feta->find_by_name ("timesig-" + s); if (!m.empty_b ()) return m; // Resort to default layout with numbers - return time_signature (me, n,d); + return time_signature (me, n, d); } diff --git a/lilypond-mode.el b/lilypond-mode.el index 8250db03fe..5f570c77fd 100644 --- a/lilypond-mode.el +++ b/lilypond-mode.el @@ -8,7 +8,7 @@ ;;; Inspired on auctex -(load-file "lilypond-font-lock.el") +(load-library "lilypond-font-lock") (require 'easymenu) (require 'compile) @@ -442,6 +442,6 @@ command." (interactive) (message "Using `LilyPond-mode' version %s" LilyPond-version)) -(provide 'LilyPond-mode) -;;; LilyPond-mode.el ends here +(provide 'lilypond-mode) +;;; lilypond-mode.el ends here diff --git a/ly/generate-documentation.ly b/ly/generate-documentation.ly index 03399af21a..bc928994e8 100644 --- a/ly/generate-documentation.ly +++ b/ly/generate-documentation.ly @@ -1,2 +1,5 @@ +% +% Running LilyPond on this file generates the documentation +% #(eval-string (ly-gulp-file "generate-documentation.scm")) diff --git a/make/lilypond.spec.in b/make/lilypond.spec.in index bcd0bca7a7..f8b2634943 100644 --- a/make/lilypond.spec.in +++ b/make/lilypond.spec.in @@ -1,3 +1,5 @@ +%define info yes + Name: lilypond Version: @TOPLEVEL_VERSION@ Release: 1 @@ -56,7 +58,9 @@ mkdir -p $RPM_BUILD_ROOT/tmp/lilypond-rpm-doc strip lily/out/lilypond midi2ly/out/midi2ly make prefix="$RPM_BUILD_ROOT%{_prefix}" install -# gzip -9fn $RPM_BUILD_ROOT%{_prefix}/info/* || true +%if info=="yes" +gzip -9fn $RPM_BUILD_ROOT%{_prefix}/info/* || true +%endif mkdir -p $RPM_BUILD_ROOT%{_prefix}/../etc/profile.d cp buildscripts/out/lilypond-profile $RPM_BUILD_ROOT%{_prefix}/../etc/profile.d/lilypond.sh @@ -83,12 +87,16 @@ echo '!c:\\texmf\\fonts\\tfm\\public\\cm' > $RPM_BUILD_ROOT%{_prefix}/s touch /tmp/.lilypond-install rm `find /var/lib/texmf -name 'feta*pk -print' -or -name 'feta*tfm -print'` /tmp/.lilypond-install -# /sbin/install-info %{_prefix}/info/lilypond.info.gz %{_prefix}/info/dir || true +%if info=="yes" +/sbin/install-info %{_prefix}/info/lilypond.info.gz %{_prefix}/info/dir || true +%endif %preun +%if info=="yes" if [ $1 = 0 ]; then - true # /sbin/install-info --delete %{_prefix}/info/lilypond.info.gz %{_prefix}/info/dir || true + /sbin/install-info --delete %{_prefix}/info/lilypond.info.gz %{_prefix}/info/dir || true fi +%endif %files @@ -111,6 +119,11 @@ fi %{_prefix}/bin %endif +%if info=="yes" +%{_prefix}/info/lilypond.info.gz +%{_prefix}/info/lilypond-internals.info.gz +%endif + %{_prefix}/man/man1/abc2ly.1.gz %{_prefix}/man/man1/as2text.1.gz %{_prefix}/man/man1/convert-mudela.1.gz diff --git a/make/mudela-rules.make b/make/mudela-rules.make index 9143c6bf45..9e0e47e6ce 100644 --- a/make/mudela-rules.make +++ b/make/mudela-rules.make @@ -11,3 +11,13 @@ $(outdir)/%.latex: %.doc $(outdir)/%.texi: %.tely cd $(outdir); LILYPONDPREFIX=$(LILYPONDPREFIX)/.. $(PYTHON) $(depth)/../scripts/mudela-book.py -I .. -I $(depth)/../input/test/ --dependencies --dep-prefix=$(outdir)/ --format=texi ../$< $(SUBST_TEXI_DEPS) + +# nexi: no-lily texi +# for plain info doco: don't run lily +$(outdir)/%.nexi: %.tely + cd $(outdir); LILYPONDPREFIX=$(LILYPONDPREFIX)/.. $(PYTHON) $(depth)/../scripts/mudela-book.py --no-lily -I .. -I $(depth)/../input/test/ --dependencies --dep-prefix=$(outdir)/ --format=texi ../$< + mv $(@D)/$(*F).texi $@ + $(SUBST_TEXI_DEPS) + +$(outdir)/%.info: $(outdir)/%.nexi + -$(MAKEINFO) --force --output=$@ $< diff --git a/scm/backend-documentation-lib.scm b/scm/backend-documentation-lib.scm new file mode 100644 index 0000000000..a7d785a00d --- /dev/null +++ b/scm/backend-documentation-lib.scm @@ -0,0 +1,88 @@ + +;;; backend-documentation-lib.scm -- Functions for backend documentation +;;; +;;; source file of the GNU LilyPond music typesetter +;;; +;;; (c) 2000 Han-Wen Nienhuys +;;; Jan Nieuwenhuizen + + +;;; This file generates documentation for the backend of lilypond. + + +;; alist of property descriptions +(define (document-element-property prop desc) + (let ((handle (assoc (car prop) desc))) + (cons + (string-append + "@code{" (symbol->string (car prop)) "} " + "(" (type-name (cadr prop)) "):") + (string-append + (caddr prop) + "\ndefault value: @code{" + (if (pair? handle) + (scm->string (cdr handle)) + "not set" ) + "}")))) + +;; Second level, part of element description +(define (document-interface interface element-description) + (let* ((name (car interface)) + (desc (cadr interface)) + (props (caddr interface)) + (docs (map (lambda (x) + (document-element-property x element-description)) + props))) + + (string-append + (section 2 (string-append "Interface: " (symbol->string name))) + desc + (description-list docs)))) + +;; First level element description +(define (document-element iname description) + (display (string-append "\nProcessing " iname " ... ") (current-error-port)) + (let* ((metah (assoc 'meta description)) + + (meta (if (pair? metah) + (cdr metah) + '((properties . ()) (name . "huh?")) + )) + + (name (cdr (assoc 'name meta))) + (ifaces (cdr (assoc 'interface-descriptions meta))) + (ifacedoc (map (lambda (x) (document-interface x description)) + (reverse ifaces)))) + + (string-append + (node (element-name name)) + (section 2 (element-name name)) + "\n" + + (let* ((element (string->symbol name)) + (engravers + (apply append + (map (lambda (x) + (let ((engraver (car x)) + (objs (cadddr x))) + (if (member element objs) + (list engraver) + '()))) + engraver-description-alist)))) + (string-append + name " elements are created by: " + (human-listify (map reffy (map engraver-name engravers))))) + + (apply string-append ifacedoc)))) + + +(define (document-all-elements name) + (let* ((doc (apply string-append + (map (lambda (x) (document-element (car x) (cdr x))) + all-element-descriptions))) + (names (map car all-element-descriptions))) + + (string-append + (texi-node-menu name (map (lambda (x) (cons (element-name x) "")) + names)) + doc))) diff --git a/scm/basic-properties.scm b/scm/basic-properties.scm index 89efe54dae..4239bc7f41 100644 --- a/scm/basic-properties.scm +++ b/scm/basic-properties.scm @@ -14,154 +14,6 @@ -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; BEAMS -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(define (default-beam-space-function multiplicity) - (if (<= multiplicity 3) 0.816 0.844) - ) - -; -; width in staff space. -; -(define (default-beam-flag-width-function type) - (cond - ((eq? type 1) 1.98) - ((eq? type 1) 1.65) ;; FIXME: check what this should be and why - (else 1.32) - )) - - -; This is a mess : global namespace pollution. We should wait -; till guile has proper toplevel environment support. - - -;; Beams should be prevented to conflict with the stafflines, -;; especially at small slopes -;; ---------------------------------------------------------- -;; ######## -;; ######## -;; ######## -;; --------------########------------------------------------ -;; ######## -;; -;; hang straddle sit inter hang - -;; inter seems to be a modern quirk, we don't use that - - -;; Note: quanting period is take as quants.top () - quants[0], -;; which should be 1 (== 1 interline) -(define (mean a b) (* 0.5 (+ a b))) -(define (default-beam-dy-quants beam stafflinethick) - (let ((thick (ly-get-elt-property beam 'thickness)) - ) - - (list 0 (mean thick stafflinethick) (+ thick stafflinethick) 1) - )) - -;; two popular veritcal beam quantings -;; see params.ly: #'beam-vertical-quants - -; (todo: merge these 2 funcs ? ) - -(define (default-beam-y-quants beam multiplicity dy staff-line) - (let* ((beam-straddle 0) - (thick (ly-get-elt-property beam 'thickness)) - (beam-sit (/ (+ thick staff-line) 2)) - (beam-hang (- 1 (/ (- thick staff-line) 2))) - (quants (list beam-hang)) - ) - - (if (or (<= multiplicity 1) (>= (abs dy) (/ staff-line 2))) - (set! quants (cons beam-sit quants))) - (if (or (<= multiplicity 2) (>= (abs dy) (/ staff-line 2))) - (set! quants (cons beam-straddle quants))) - ;; period: 1 (interline) - (append quants (list (+ 1 (car quants)))))) - -(define (beam-traditional-y-quants beam multiplicity dy staff-line) - (let* ((beam-straddle 0) - (thick (ly-get-elt-property beam 'thickness)) - (beam-sit (/ (+ thick staff-line) 2)) - (beam-hang (- 1 (/ (- thick staff-line) 2))) - (quants '()) - ) - (if (>= dy (/ staff-line -2)) - (set! quants (cons beam-hang quants))) - (if (and (<= multiplicity 1) (<= dy (/ staff-line 2))) - (set! quants (cons beam-sit quants))) - (if (or (<= multiplicity 2) (>= (abs dy) (/ staff-line 2))) - (set! quants (cons beam-straddle quants))) - ;; period: 1 (interline) - (append quants (list (+ 1 (car quants)))))) - - -;; There are several ways to calculate the direction of a beam -;; -;; * majority: number count of up or down notes -;; * mean : mean centre distance of all notes -;; * median : mean centre distance weighted per note - -(define (dir-compare up down) - (sign (- up down))) - -;; arguments are in the form (up . down) -(define (beam-dir-majority count total) - (dir-compare (car count) (cdr count))) - -(define (beam-dir-mean count total) - (dir-compare (car total) (cdr total))) - -(define (beam-dir-median count total) - (if (and (> (car count) 0) - (> (cdr count) 0)) - (dir-compare (/ (car total) (car count)) (/ (cdr total) (cdr count))) - (dir-compare (car count) (cdr count)))) - - - -;; [Ross] states that the majority of the notes dictates the -;; direction (and not the mean of "center distance") -;; -;; But is that because it really looks better, or because he wants -;; to provide some real simple hands-on rules? -;; -;; We have our doubts, so we simply provide all sensible alternatives. - -;; array index multiplicity, last if index>size -;; beamed stems - - -;; TODO -;; - take #forced stems into account (now done in C++)? -;; - take y-position of chord or beam into account - -; -; todo: clean this up a bit: the list is getting rather long. -; -(define basic-beam-properties - `( - (molecule-callback . ,Beam::brew_molecule) - (thickness . 0.42) ; in staff-space, should use stafflinethick? - (before-line-breaking-callback . ,Beam::before_line_breaking) - (after-line-breaking-callback . ,Beam::after_line_breaking) - (default-neutral-direction . 1) - (dir-function . ,beam-dir-majority) - (height-quants . ,default-beam-dy-quants) - (vertical-position-quant-function . ,default-beam-y-quants) - (beamed-stem-shorten . (0.5)) - (outer-stem-length-limit . 0.2) - (slope-limit . 0.2) - (flag-width-function . ,default-beam-flag-width-function) - (space-function . ,default-beam-space-function) - (damping . 1) - (meta . ,(element-description "Beam" beam-interface)) - ) - ) - - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Bar lines. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/scm/beam.scm b/scm/beam.scm new file mode 100644 index 0000000000..ac9c1ffc80 --- /dev/null +++ b/scm/beam.scm @@ -0,0 +1,148 @@ + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; BEAMS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define (default-beam-space-function multiplicity) + (if (<= multiplicity 3) 0.816 0.844) + ) + +; +; width in staff space. +; +(define (default-beam-flag-width-function type) + (cond + ((eq? type 1) 1.98) + ((eq? type 1) 1.65) ;; FIXME: check what this should be and why + (else 1.32) + )) + + +; This is a mess : global namespace pollution. We should wait +; till guile has proper toplevel environment support. + + +;; Beams should be prevented to conflict with the stafflines, +;; especially at small slopes +;; ---------------------------------------------------------- +;; ######## +;; ######## +;; ######## +;; --------------########------------------------------------ +;; ######## +;; +;; hang straddle sit inter hang + +;; inter seems to be a modern quirk, we don't use that + + +;; Note: quanting period is take as quants.top () - quants[0], +;; which should be 1 (== 1 interline) +(define (mean a b) (* 0.5 (+ a b))) +(define (default-beam-dy-quants beam stafflinethick) + (let ((thick (ly-get-elt-property beam 'thickness)) + ) + + (list 0 (mean thick stafflinethick) (+ thick stafflinethick) 1) + )) + +;; two popular veritcal beam quantings +;; see params.ly: #'beam-vertical-quants + +; (todo: merge these 2 funcs ? ) + +(define (default-beam-y-quants beam multiplicity dy staff-line) + (let* ((beam-straddle 0) + (thick (ly-get-elt-property beam 'thickness)) + (beam-sit (/ (+ thick staff-line) 2)) + (beam-hang (- 1 (/ (- thick staff-line) 2))) + (quants (list beam-hang)) + ) + + (if (or (<= multiplicity 1) (>= (abs dy) (/ staff-line 2))) + (set! quants (cons beam-sit quants))) + (if (or (<= multiplicity 2) (>= (abs dy) (/ staff-line 2))) + (set! quants (cons beam-straddle quants))) + ;; period: 1 (interline) + (append quants (list (+ 1 (car quants)))))) + +(define (beam-traditional-y-quants beam multiplicity dy staff-line) + (let* ((beam-straddle 0) + (thick (ly-get-elt-property beam 'thickness)) + (beam-sit (/ (+ thick staff-line) 2)) + (beam-hang (- 1 (/ (- thick staff-line) 2))) + (quants '()) + ) + (if (>= dy (/ staff-line -2)) + (set! quants (cons beam-hang quants))) + (if (and (<= multiplicity 1) (<= dy (/ staff-line 2))) + (set! quants (cons beam-sit quants))) + (if (or (<= multiplicity 2) (>= (abs dy) (/ staff-line 2))) + (set! quants (cons beam-straddle quants))) + ;; period: 1 (interline) + (append quants (list (+ 1 (car quants)))))) + + +;; There are several ways to calculate the direction of a beam +;; +;; * majority: number count of up or down notes +;; * mean : mean centre distance of all notes +;; * median : mean centre distance weighted per note + +(define (dir-compare up down) + (sign (- up down))) + +;; arguments are in the form (up . down) +(define (beam-dir-majority count total) + (dir-compare (car count) (cdr count))) + +(define (beam-dir-mean count total) + (dir-compare (car total) (cdr total))) + +(define (beam-dir-median count total) + (if (and (> (car count) 0) + (> (cdr count) 0)) + (dir-compare (/ (car total) (car count)) (/ (cdr total) (cdr count))) + (dir-compare (car count) (cdr count)))) + + + +;; [Ross] states that the majority of the notes dictates the +;; direction (and not the mean of "center distance") +;; +;; But is that because it really looks better, or because he wants +;; to provide some real simple hands-on rules? +;; +;; We have our doubts, so we simply provide all sensible alternatives. + +;; array index multiplicity, last if index>size +;; beamed stems + + +;; TODO +;; - take #forced stems into account (now done in C++)? +;; - take y-position of chord or beam into account + +; +; todo: clean this up a bit: the list is getting rather long. +; +(define basic-beam-properties + `( + (molecule-callback . ,Beam::brew_molecule) + (thickness . 0.42) ; in staff-space, should use stafflinethick? + (before-line-breaking-callback . ,Beam::before_line_breaking) + (after-line-breaking-callback . ,Beam::after_line_breaking) + (default-neutral-direction . 1) + (dir-function . ,beam-dir-majority) + (height-quants . ,default-beam-dy-quants) + (vertical-position-quant-function . ,default-beam-y-quants) + (beamed-stem-shorten . (0.5)) + (outer-stem-length-limit . 0.2) + (slope-limit . 0.2) + (flag-width-function . ,default-beam-flag-width-function) + (space-function . ,default-beam-space-function) + (damping . 1) + (meta . ,(element-description "Beam" beam-interface)) + ) + ) + diff --git a/scm/documentation-lib.scm b/scm/documentation-lib.scm new file mode 100644 index 0000000000..5bc4476531 --- /dev/null +++ b/scm/documentation-lib.scm @@ -0,0 +1,115 @@ +;;; +;;; documentation-lib.scm -- Assorted Functions for generated documentation +;;; +;;; source file of the GNU LilyPond music typesetter +;;; +;;; (c) 2000 Han-Wen Nienhuys +;;; Jan Nieuwenhuizen + +(define (uniqued-alist alist acc) + (if (null? alist) acc + (if (assoc (caar alist) acc) + (uniqued-alist (cdr alist) acc) + (uniqued-alist (cdr alist) (cons (car alist) acc) + )))) + +(define (self-evaluating? x) + (or (number? x) (string? x) (procedure? x) (boolean? x))) + +(define (texify x) + x) +;; (let* +;; ((x1 (regexp-substitute/global #f "\([^@]\){" x 'pre "\1@{" 'post)) +;; ((x2 (regexp-substitute/global #f "\([^@]\){" x 'pre "\1@{" 'post)) +;; ((x3 (regexp-substitute/global #f "\([^@]\)@" x 'pre "\1@@" 'post)) +;; ) +;; x2)) + +(define (scm->string val) + (string-append + (if (self-evaluating? val) "" "'") + (texify + (call-with-output-string (lambda (port) (display val port)))) + )) + +(define (node name) + (string-append + "\n@html" + "\n
" + "\n@end html" + "\n@node " name ",,,")) + +(define section-alist + '( + ;; Hmm, texinfo doesn't have ``part'' + (0 . "@top") + (1 . "@unnumbered") + (2 . "@unnumberedsec") + (3 . "@unnumberedsubsec") + (4 . "@unnumberedsubsubsec") + (5 . "@unnumberedsubsubsec") + )) + +(define (section level name) + (string-append "\n" (cdr (assoc level section-alist)) " " name "\n")) + +(define (description-list items-alist) + (string-append + "\n@table @samp\n" + (apply string-append + (map (lambda (x) (string-append "\n@item " (car x) "\n" (cdr x))) + items-alist)) + "\n@end table\n")) + +(define (texi-menu items-alist) + (string-append + "\n@menu" + (apply string-append + (map (lambda (x) (string-append "\n* " (car x) ":: " (cdr x))) + items-alist)) + "\n@end menu\n" + ;; Menus don't appear in html, so we make a list ourselves + "\n@ifhtml\n" + (description-list (map (lambda (x) (cons (reffy (car x)) (cdr x))) + items-alist)) + "\n@end ifhtml\n")) + + +(define (texi-node-menu name items-alist) + (string-append + (node name) + (section 1 name) + (texi-menu items-alist))) + +(define (texi-file-head name file-name top items-alist) + (string-append + "\input texinfo @c -*-texinfo-*-\n" + "@settitle " name + "\n@setfilename " file-name ".info" + (node "Top") top + "\n@top" + (section 1 name) + (texi-menu items-alist))) + +(define (context-name name) + (string-append "Context " name)) + +(define (engraver-name name) + name) + +(define (element-name name) + (string-append "Element " name)) + +(define (reffy x) + (string-append "@ref{" x "}")) + +(define (human-listify l) + (cond + ((null? l) "none") + ((null? (cdr l)) (car l)) + ((null? (cddr l)) (string-append (car l) " and " (cadr l))) + (else (string-append (car l) ", " (human-listify (cdr l)))) + )) + +(define (writing-wip x) + (display (string-append "\nWriting " x " ... ") (current-error-port))) diff --git a/scm/engraver-documentation-lib.scm b/scm/engraver-documentation-lib.scm new file mode 100644 index 0000000000..bdf12cad61 --- /dev/null +++ b/scm/engraver-documentation-lib.scm @@ -0,0 +1,153 @@ + +;;; engraver-documentation-lib.scm -- Functions for engraver documentation +;;; +;;; source file of the GNU LilyPond music typesetter +;;; +;;; (c) 2000 Han-Wen Nienhuys +;;; Jan Nieuwenhuizen + + +(eval-string (ly-gulp-file "translator-description.scm")) + +;; alist of translater descriptions +(define (document-translator-property prop-desc) + (cons + (string-append + "@code{" (car prop-desc) "} " + "(" (type-name (cadr prop-desc)) "):") + (caddr prop-desc))) + +;; First level Engraver description and +;; second level Context description +(define (document-engraver level engraver-descr) + + (let* ( + (props (car (cdddr engraver-descr))) + (name (car engraver-descr)) + (desc (cadr engraver-descr)) + (objs (caddr engraver-descr)) + ) + + (string-append + (section level (engraver-name name)) + desc + "\n\n" + (if (null? props) + "" + (string-append + (section (+ level 1) "Properties") + (description-list + (map (lambda (x) (document-translator-property x)) props)))) + (if (null? objs) + "" + (string-append + "This engraver creates \n " + (human-listify (map reffy (map element-name objs))) + " elements.") + ) + + "\n\n" + + (let* ((paper-alist (My_lily_parser::paper_description)) + (context-description-alist (map cdr paper-alist)) + (contexts + (apply append + (map (lambda (x) + (let ((context (cdr (assoc 'type-name x))) + (consists (append + (list (cdr (assoc 'group-type x))) + (cdr (assoc 'consists x)) + (cdr (assoc 'end-consists x))))) + + (if (member name consists) + (list context) + '()))) + context-description-alist)))) + (string-append + name " is part of contexts: " + (human-listify (map reffy (map context-name contexts)))))))) + + +;; First level Engraver description +(define (document-separate-engraver top description) + (let ((name (car description))) + (string-append + (node (engraver-name name)) + (document-engraver 2 description)))) + +;; Second level, part of Context description +(define (document-engraver-by-name name) + (let* + ( + (eg (assoc (string->symbol name) engraver-description-alist)) + ) + + (if (eq? eg #f) + (string-append "Engraver " name ", not documented.\n") + (document-engraver 3 (cdr eg)) + ) + )) + +(define (context-doc-string context-desc) + (let* + ( + (name (cdr (assoc 'type-name context-desc))) + (desc-handle (assoc (string->symbol name) context-description-alist)) + (desc (if (pair? desc-handle) (cdr desc-handle) "")) + + (accepts (cdr (assoc 'accepts context-desc))) + (consists (append + (list (cdr (assoc 'group-type context-desc))) + (cdr (assoc 'consists context-desc)) + (cdr (assoc 'end-consists context-desc)) + )) + ) + + (string-append + desc + + (if (null? accepts) + "This context is a `bottom' context; it can not contain other contexts." + (string-append + name " can contain \n" + (human-listify (map reffy (map context-name accepts))))) + + "\n\nThis context is built from the following engravers\n" + (apply string-append + (map document-engraver-by-name consists))))) + + +;; First level Context description +(define (document-context top context-desc) + (let ((name (cdr (assoc 'type-name context-desc))) + (doc (context-doc-string context-desc))) + + (string-append + (node (context-name name)) + (section 2 (context-name name)) + doc))) + +(define (document-paper name) + (let* ((paper-alist (My_lily_parser::paper_description)) + (names (sort (map car paper-alist) string +;;; Jan Nieuwenhuizen -(define (urlfy x) - (string-append "" x "")) +;;; File entry point for generated documentation -(define (human-listify l) - (cond - ((null? l) "none") - ((null? (cdr l)) (car l)) - ((null? (cddr l)) (string-append (car l) " and " (cadr l))) - (else (string-append (car l) ", " (human-listify (cdr l)))) - )) +;;; Running LilyPond on this file generates the documentation -(define (writing-wip x) - (display (string-append "Writing " x " ... \n") (current-error-port)) - ) -(eval-string (ly-gulp-file "generate-engraver-documentation.scm")) -(eval-string (ly-gulp-file "generate-backend-documentation.scm")) +;; We use ly-gulp because these files live in +;; +;; PATH=$LILYPONDPREFIX/scm:/scm +;; +(eval-string (ly-gulp-file "documentation-lib.scm")) +(eval-string (ly-gulp-file "engraver-documentation-lib.scm")) +(eval-string (ly-gulp-file "backend-documentation-lib.scm")) + +(let* ((doc (string-append + (document-paper "LilyPond interpretation contexts") + (document-all-engravers "LilyPond engravers") + (document-all-elements "LilyPond backend"))) + (name "lilypond-internals") + (outname (string-append name ".texi")) + (out (open-output-file outname))) + + (writing-wip outname) + (display + (string-append + (texi-file-head + + ;; we can't use (dir) and top if we're included by lilypond.tely + "LilyPond internals" name "(lilypond.info)" + '(("LilyPond interpretation contexts" . "Hierarchy and grouping of Engravers") + ("LilyPond engravers" . "Engravers create Elements") + ("LilyPond backend" . "Detailed description of all Elements"))) + + doc + "\n@bye") + out)) + +(newline (current-error-port)) diff --git a/scm/interface.scm b/scm/interface.scm index 870e365bbd..3c201da7eb 100644 --- a/scm/interface.scm +++ b/scm/interface.scm @@ -1,7 +1,12 @@ ; should include default value? -;;; ::::::: should generate documentation for score elements from here. + +;;; FIXME: naming. +;;; Score elements are called `objects' now and then, which gets +;;; rather confusing, we now have `elements', `items', `spanners' +;;; and `objects'. + (define (elt-property-description symbol type? description) (list symbol type? description)) @@ -45,18 +50,18 @@ "All elements support this" (list (elt-property-description 'X-offset-callbacks list? "list of functions, each taking an element and axis argument. The function determine the position relative to this element's parent. The last one in the list is called first") - (elt-property-description 'Y-offset-callbacks list? "see X-offset-callbacks") + (elt-property-description 'Y-offset-callbacks list? "see @code{X-offset-callbacks}") (elt-property-description 'X-extent-callback procedure? "procedure taking an element and axis argument, returning a number-pair. The return value is the extent of the element.") - (elt-property-description 'Y-extent-callback procedure? "see X-extent-callback ") + (elt-property-description 'Y-extent-callback procedure? "see @code{X-extent-callback}") (elt-property-description 'font-relative-size integer? "") (elt-property-description 'extra-offset number-pair? "pair of reals (a cons) forcing an extra offset before outputting") - (elt-property-description 'interfaces list? "list of symbols indicating the interfaces supported by this object. Is initialized from the meta field.") + (elt-property-description 'interfaces list? "list of symbols indicating the interfaces supported by this object. Is initialized from the @code{meta} field.") (elt-property-description 'dependencies list? "list of score-element pointers that indicate who to compute first for certain global passes") (elt-property-description 'no-spacing-rods boolean? "read from elements: boolean that makes Separation_item ignore this item (MOVE ME TO ITEM)") (elt-property-description 'extra-extent-X number-pair? "enlarge in X dimension by this much, measured in staff space") - (elt-property-description 'extra-extent-Y number-pair? "see extra-extent-Y") + (elt-property-description 'extra-extent-Y number-pair? "see @code{extra-extent-Y}") (elt-property-description 'minimum-extent-X number-pair? "minimum size in X dimension, measured in staff space") - (elt-property-description 'minimum-extent-Y number-pair? "see minimum-extent-Y") + (elt-property-description 'minimum-extent-Y number-pair? "see @code{minimum-extent-Y}") (elt-property-description 'origin ly-input-location? "location in input file of the definition") (elt-property-description 'transparent boolean? "This is almost the same as setting molecule-callback to #f, but this retains the @@ -86,21 +91,21 @@ Caching of computed values is permissible, and generally useful, though. direction to choose if we're in the middle of the staff ") (elt-property-description 'thickness number? "weight of beams, in staffspace") (elt-property-description 'space-function procedure? "function of type multiplicity -> real (in staffspace)") - (elt-property-description 'beamed-stem-shorten number? "") - (elt-property-description 'height-quants number? "") - (elt-property-description 'vertical-position-quant-function procedure? "") - (elt-property-description 'dir-function procedure? "") + (elt-property-description 'beamed-stem-shorten number? "shorten beamed stems in forced direction") + (elt-property-description 'height-quants procedure? "function of type (beam staff-line-thickness) -> list of quants. Default value: default-beam-dy-quants. +") + (elt-property-description 'vertical-position-quant-function procedure? " +function of type (beam multiplicity dy staff-line-thickness) -> real. Default value: default-beam-y-quants, also available: beam-traditional-y-quants. +") + (elt-property-description 'dir-function procedure? "function of type (count total)->direction. Default value: beam-dir-majority, also available: beam-dir-mean, beam-dir-median.") (elt-property-description 'damping number? "damping factor.") (elt-property-description 'outer-stem-length-limit number? "catch suspect beam slopes, set slope to zero if outer stem is lengthened more than this (in staffspace)") (elt-property-description 'slope-limit number? "set slope to zero if slope is running away steeper than this.") ) -)) - - + )) -;;;;;;;;;;;;;;;;;;;; (define clef-interface (lily-interface @@ -129,7 +134,7 @@ more than this (in staffspace)") (elt-property-description 'horizontal-shift integer? "integer that identifies ranking of note-column for horizontal shifting.") (elt-property-description 'force-hshift number? "amount of collision_note_width that overides automatic collision settings.") (elt-property-description 'merge-differently-dotted boolean? "merge black noteheads with differing dot count in collisions. -

+ Merge noteheads in collisions, even if they have a different number of dots. This normal notation for polyphonic guitar music. @@ -198,10 +203,11 @@ one end of the stem") (elt-property-description 'minimum-space number? "minimum distance that the victim should move (after padding)") (elt-property-description 'padding number? "add this much extra space between victim and support") (elt-property-description 'self-alignment-X number? "real number: -1 = -left aligned, 0 = center, 1 right-aligned in X direction.

Set to -an element pointer, if you want that element to be the center. In -this case, the center element should have this object as a reference -point. +left aligned, 0 = center, 1 right-aligned in X direction. + + Set to an element pointer, if you want that element to be the center. +In this case, the center element should have this object as a +reference point. ") (elt-property-description 'self-alignment-Y number? "like self-alignment-X but for Y axis") @@ -222,12 +228,12 @@ point. (lily-interface 'line-of-score-interface "Super element, parent of all: -

- The columns of a score that form one line. The toplevel element. - Any element has a Line_of_score as both X and Y reference - point. The Paper_score contains one element of this type. Control - enters the Score_element dependency calculation from this single - Line_of_score object." + +The columns of a score that form one line. The toplevel element. Any +element has a Line_of_score as both X and Y reference point. The +Paper_score contains one element of this type. Control enters the +Score_element dependency calculation from this single Line_of_score +object." (list (elt-property-description 'between-system-string string? "string to dump between two systems. Useful for forcing pagebreaks") @@ -294,7 +300,7 @@ Setting it to false will prevent printing of the bracket. Setting the property to #'if-no-beam will make it print only if there is no beam associated with this tuplet bracket.") (elt-property-description 'tuplet-number-visibility boolean-or-symbol? " -Like tuplet-bracket-visibility, but for the number.") +Like @code{tuplet-bracket-visibility}, but for the number.") (elt-property-description 'parallel-beam boolean? "internal: true if there is a beam just as wide as the bracket ") (elt-property-description 'thick number? "thickness, in stafflinethickness") ) @@ -460,34 +466,47 @@ hufnagel, vaticana and medicaea [TODO: should use symbol] ") (list (elt-property-description 'text (lambda (x) (or (string? x) (list? x))) " Scheme markup text. It is defined as follows: -

-TEXT : STRING | (MARKUP SENTENCE)
-MARKUP: PROPERTY | ABBREV
-SENTENCE: TEXT | SENTENCE TEXT
-PROPERTY: (key . value)
+@example + +TEXT : STRING | (MARKUP SENTENCE) +MARKUP: PROPERTY | ABBREV +SENTENCE: TEXT | SENTENCE TEXT +PROPERTY: (key . value) ABBREV: rows lines roman music bold italic named super sub text, or any font-style -

+ +@end example So, TEXT is either a string, or a list of which the CAR is a MARKUP. MARKUP is either a CONS: an element property '(key . value) or a symbol: a predefined abbreviation for a list of element properties. -

+ The following abbreviations are currently defined: -

-
rows
horizontal mode: set all text on one line (default) -
lines
vertical mode: set every text on new line -
roman
select roman font -
music
select feta font -
bold
select bold series -
italic
select italic shape -
named
lookup by character name -
text
plain text lookup (by character value) -
super
superscript -
sub
subscript -
any font-style
finger volta timesig mmrest mark script large Large dynamic -
+@table @samp +@item rows +horizontal mode: set all text on one line (default) +@item lines + vertical mode: set every text on new line +@item roman + select roman font +@item music + select feta font +@item bold + select bold series +@item italic + select italic shape +@item named + lookup by character name +@item text + plain text lookup (by character value) +@item super + superscript +@item sub + subscript +@item any font-style + finger volta timesig mmrest mark script large Large dynamic +@end table " ) ;; Should move this somewhere else? (elt-property-description 'align number? "the alignment of the text, 0 is horizontal, 1 is vertical") @@ -522,7 +541,7 @@ The following abbreviations are currently defined: (define separation-spanner-interface (lily-interface 'separation-spanner-interface - "Spanner that containing separation-item-interface elements to calculate rods" + "Spanner that containing @code{separation-item-interface} elements to calculate rods" '() )) (define text-script-interface @@ -665,7 +684,7 @@ conflicts." (elt-property-description 'minimum-distance number? "minimum distance between notes and rests.") (elt-property-description 'elements list? "list of elements (NoteColumn, generally) participating in the collision. The -rest-collision property in elements is set +@code{rest-collision} property in @code{elements} is set to a pointer to the collision") ))) @@ -680,7 +699,7 @@ to a pointer to the collision") (define script-column-interface (lily-interface 'script-column-interface - "An interface that sorts scripts according to their script-priority" + "An interface that sorts scripts according to their @code{script-priority}" (list ))) @@ -706,17 +725,18 @@ arithmetic_basicspace is set to a value so that the shortest note takes about two noteheads of space (ie, is followed by a notehead of space): +@example 2*quartwidth = arithmetic_multiplier * ( C + log2 (SHORTEST) )) - { using: C = arithmetic_basicspace - log2 (mininum (SHORTEST, 1/8)) } - { assuming: SHORTEST <= 1/8 } + @{ using: C = arithmetic_basicspace - log2 (mininum (SHORTEST, 1/8)) @} + @{ assuming: SHORTEST <= 1/8 @} = arithmetic_multiplier * ( arithmetic_basicspace - log2 (SHORTEST) + log2 (SHORTEST) ) = arithmetic_multiplier * arithmetic_basicspace - { choose: arithmetic_multiplier = 1.0*quartwidth (why?)} + @{ choose: arithmetic_multiplier = 1.0*quartwidth (why?) @} = quartwidth * arithmetic_basicspace @@ -724,10 +744,12 @@ space): arithmetic_basicspace = 2/1 = 2 + If you want to space your music wider, use something like: arithmetic_basicspace = 4.; +@end example ") (elt-property-description 'arithmetic-multiplier number? "see arithmetic-basicspace") @@ -758,7 +780,7 @@ position 0." (lily-interface 'separation-item-interface "Item that computes widths to generate spacing rods. -

+ Calc dimensions for the Separating_group_spanner; this has to be an item to get dependencies correct. It can't be an element_group since these usually are in a different X_group diff --git a/scm/lily.scm b/scm/lily.scm index a50b23c915..be6872c677 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -1,16 +1,18 @@ -; lily.scm -- implement Scheme output routines for TeX and PostScript -; -; source file of the GNU LilyPond music typesetter -; -; (c) 1998 Jan Nieuwenhuizen +;;; lily.scm -- implement Scheme output routines for TeX and PostScript +;;; +;;; source file of the GNU LilyPond music typesetter +;;; +;;; (c) 1998--2000 Jan Nieuwenhuizen +;;; Han-Wen Nienhuys -; -; This file contains various routines in Scheme that are easier to -; do here than in C++. At present it is an unorganised mess. Sorry. -; -; We should repartition the entire scm side of lily in a -; more sane way, using namesspaces/modules? +;;; +;;; This file contains various routines in Scheme that are easier to +;;; do here than in C++. At present it is an unorganised mess. Sorry. + + +;;; We should repartition the entire scm side of lily in a +;;; more sane way, using namesspaces/modules? (debug-enable 'backtrace) @@ -756,6 +758,7 @@ (begin (eval-string (ly-gulp-file "interface.scm")) + (eval-string (ly-gulp-file "beam.scm")) (eval-string (ly-gulp-file "slur.scm")) (eval-string (ly-gulp-file "font.scm")) (eval-string (ly-gulp-file "auto-beam.scm")) diff --git a/scm/translator-description.scm b/scm/translator-description.scm index e05e36346b..6f8beaa2b1 100644 --- a/scm/translator-description.scm +++ b/scm/translator-description.scm @@ -63,18 +63,18 @@ is erased. (translator-property-description 'CONTEXTNAMEVerticalExtent number-pair? "hard coded vertical extent. The format is a pair of dimensions, for example, this sets the sizes -of a staff to 10 (5+5) staffspaces high.

+of a staff to 10 (5+5) staffspaces high. - +@example \property Staff.StaffVerticalExtent = #(-5.0 . 5.0) - +@end example [fixme, naming]") (translator-property-description 'CONTEXTNAMEMinimumVerticalExtent number-pair? "minimum vertical extent, same format as CONTEXTNAMEVerticalExtent [fixme, naming]") (translator-property-description - 'CONTEXTNAExtraVerticalExtent number-pair? + 'CONTEXTNAMExtraVerticalExtent number-pair? "extra vertical extent, same format CONTEXTNAMEMinimumVerticalExtent [fixme, naming]") ))) @@ -103,16 +103,17 @@ interesting items (ie. note heads, lyric syllables and normal rests)" (translator-property-description 'forgetAccidentals boolean? "do not set localKeySignature when a note alterated differently from localKeySignature is found. -

+ Causes accidentals to be printed at every note instead of remembered for the duration of a measure. ") (translator-property-description 'noResetKey boolean? "Do not reset local key to the value of keySignature at the start of a measure, -as determined by measurePosition.

- Do not reset the key at the start of a measure. Accidentals will - be printed only once and are in effect until overridden, possibly - many measures later. +as determined by measurePosition. + +Do not reset the key at the start of a measure. Accidentals will be +printed only once and are in effect until overridden, possibly many +measures later. ") ))) @@ -128,7 +129,7 @@ as determined by measurePosition.

(translator-property-description 'repeatCommands list? "This property is read to find any command of the form (volta . X), where X is a string or #f") (translator-property-description 'voltaSpannerDuration moment? - "maximum duration of the volta bracket.

+ "maximum duration of the volta bracket. Set to a duration to control the size of the brackets printed by @code{\alternative}. It specifies the number of whole notes duration @@ -166,19 +167,15 @@ given in an @code{\alternative}. '(TextScript) (list (translator-property-description 'combineParts boolean? "try to combine parts?") + (translator-property-description 'soloADue boolean? "set Solo/A due texts?") + (translator-property-description 'soloText string? "text for begin of solo") + (translator-property-description 'soloIIText string? "text for begin of solo for voice ``two''") + (translator-property-description 'aDueText string? "text for begin of a due") + (translator-property-description 'split-interval number-pair? "always split into two voices for contained intervals") (translator-property-description 'unison boolean? "set if unisono is detected ") - (translator-property-description 'solo boolean? "") - (translator-property-description 'soloADue boolean? "") - (translator-property-description 'soloText string? "") - (translator-property-description 'soloIIText string? "") - (translator-property-description 'aDueText string? "") - (translator-property-description 'combineParts boolean? "") - (translator-property-description 'unisilence boolean? "") - (translator-property-description 'unison boolean? "") - (translator-property-description 'unirhythm boolean? "") - (translator-property-description 'solo boolean? "") - (translator-property-description 'split-interval number-pair? "") - (translator-property-description 'soloADue boolean? "") + (translator-property-description 'solo boolean? "set if solo is detected") + (translator-property-description 'unisilence boolean? "set if unisilence is detected") + (translator-property-description 'unirhythm boolean? "set if unirhythm is detected") ))) (cons @@ -214,14 +211,36 @@ Uses beatLength, measureLength and measurePosition to decide when to start and s (list (translator-property-description 'noAutoBeaming boolean? " If set to true then beams are not generated automatically. ") - (translator-property-description 'beamAutoEnd moment? " - Specifies when automatically generated beams can end. See - section XREF-autobeam [FIXME].") - (translator-property-description 'beamAutoBegin moment? " - Specifies when automatically generated beams can start. See - section XREF-autobeam [FIXME].") + (translator-property-description 'autoBeamSettings list? " +Specifies when automatically generated beams should begin and end. The elements have the format: - ))) +@example + + function shortest-duration-in-beam time-signature + +where + + function = begin or end + shortest-duration-in-beam = numerator denominator; eg: 1 16 + time-signature = numerator denominator, eg: 4 4 + +unspecified or wildcard entries for duration or time-signature +are given by * * + +The user can override beam begin or end time by pushing a wildcard entries +'(begin * * * *) or '(end * * * *) resp., eg: + + \property Voice.autoBeamSettings \push #'(end * * * *) = #(make-moment 1 4) + +The head of the list: + '( + ((end * * 3 2) . ,(make-moment 1 2)) + ((end 1 16 3 2) . ,(make-moment 1 4)) + ((end 1 32 3 2) . ,(make-moment 1 8)) + ... + ) + +@end example")))) (cons 'Bar_engraver @@ -232,9 +251,9 @@ Uses beatLength, measureLength and measurePosition to decide when to start and s (list (translator-property-description 'whichBar string? "This property is read to determine what type of barline to create. Example: -

+@example \\property Staff.whichBar = \"|:\" - +@end example will create a start-repeat bar in this staff only ") (translator-property-description 'staffsFound list? "list of all staff-symbols found.") @@ -277,7 +296,7 @@ put on top of all staffs, and appears only at left side of the staff." prefatory matter (clefs, key signatures) appears, eg. this puts the key signatures after the bar lines: - +@example \\property Score.breakAlignOrder = #'( Span_bar Breathing_sign @@ -286,7 +305,7 @@ key signatures after the bar lines: Key_item Time_signature ) - +@end example ") ))) @@ -307,7 +326,7 @@ key signatures after the bar lines: "Chord_name_engraver" "Catch Note_req's, Tonic_reqs, Inversion_reqs, Bass_req and generate the appropriate chordname." - '(ChordNames) + '(ChordName) (list (translator-property-description 'chordInversion boolean? " Determines whether LilyPond should look for chord inversions when translating from notes to chord names. Set to 1 to find @@ -411,7 +430,7 @@ If omitted, then dots appear on top of the notes. property is used to label subsequent lines. If the @code{midiInstrument} property is not set, then @code{instrument} is used to determine the instrument for MIDI output.") - (translator-property-description 'instr string? "see instrument") + (translator-property-description 'instr string? "see @code{instrument}") ))) (cons @@ -559,15 +578,17 @@ squashing.") "Property_engraver" "This is a engraver that converts \property settings into back-end element-property settings. Example: Voice.stemLength will set -#'length in all Stem objects

+#'length in all Stem objects. + Due to CPU and memory requirements, the use of this engraver is deprecated." '() (list (translator-property-description 'Generic_property_list list? "description of the conversion. -

- Defines names and types for generic properties. These are properties - than can be plugged into the backend directly. See the init file - @file{generic-property.scm} for details. For internal use only, deprecated. + +Defines names and types for generic properties. These are properties +than can be plugged into the backend directly. See the init file +@file{generic-property.scm} for details. For internal use only, +deprecated. ") ))) @@ -664,8 +685,8 @@ Description of scripts to use. (fixme) '(Slur) (list - (translator-property-description 'slurBeginAttachment symbol? "") - (translator-property-description 'slurEndAttachment symbol? "") + (translator-property-description 'slurBeginAttachment symbol? "translates to the car of Slur.element-property 'attachment.") + (translator-property-description 'slurEndAttachment symbol? "translates to the cdr of Slur.element-property 'attachment.") (translator-property-description 'slurMelismaBusy boolean? "Signal a slur if automaticMelismata is set") ))) @@ -699,7 +720,7 @@ arpeggios that cross staffs. (engraver-description "Span_bar_engraver" "This engraver makes cross-staff barlines: It catches all normal -bar lines, and draws a single span-bar across them.

" +bar lines, and draws a single span-bar across them." '(SpanBar) (list @@ -797,7 +818,7 @@ either unison, unisilence or soloADue is set" 'Time_signature_engraver (engraver-description "Time_signature_engraver" - "Create a TimeSignature whenever timeSignatureFraction changes" + "Create a TimeSignature whenever @code{timeSignatureFraction} changes" '(TimeSignature) (list ))) @@ -838,12 +859,15 @@ defaultBarType, barAlways, barNonAuto and measurePosition. notes and rests expand into their full length, printing the appropriate number of empty bars so that synchronization with other voices is preserved. - -@mudela[fragment,verbatim,center] + +@c my @vebatim patch would help... +@example +@@mudela[fragment,verbatim,center] r1 r1*3 R1*3\property Score.skipBars=1 r1*3 R1*3 -@end mudela - +@@end mudela +@end example + ") (translator-property-description 'timing boolean? " Keep administration of measure length, position, bar number, etc? Switch off for cadenzas.") @@ -870,14 +894,15 @@ every barline. Normally a tuplet bracket is as wide as the @code{\times} expression that gave rise to it. By setting this property, you can make brackets last shorter. Example -

-@mudela[verbatim,fragment] -\context Voice \times 2/3 { + +@example +@@mudela[verbatim,fragment] +\context Voice \times 2/3 @{ \property Voice.tupletSpannerDuration = #(make-moment 1 4) [c8 c c] [c c c] -} -@end mudela - +@} +@@end mudela +@end example ") (translator-property-description 'tupletInvisible boolean? " If set to true, tuplet bracket creation is switched off diff --git a/stepmake/stepmake/documentation-targets.make b/stepmake/stepmake/documentation-targets.make index ab527dba4d..5f43a858ba 100644 --- a/stepmake/stepmake/documentation-targets.make +++ b/stepmake/stepmake/documentation-targets.make @@ -10,20 +10,17 @@ local-web: footify: $(footify) $(sort $(wildcard $(outdir)/*.html out/*.html out-www/*.html)) -# what to do here? -ifeq (a,b) +INFO_INSTALL_FILES = $(wildcard $(addsuffix *, $(INFO_FILES))) -$(outdir)/$(package).info: $(outdir)/topinfo.texinfo $(OUTTEXINFO_FILES) - $(MAKEINFO) --force -o $@ $(outdir)/topinfo.texinfo +INFOINSTALL=$(MAKE) INSTALLATION_OUT_DIR=$(infodir) depth=$(depth) INSTALLATION_OUT_FILES="$(INFO_INSTALL_FILES)" -f $(stepdir)/install-out.sub.make +localinstall: install-info +localuninstall: uninstall-info -INFOINSTALL=$(MAKE) INSTALLATION_OUT_DIR=$(infodir) depth=$(depth) INSTALLATION_OUT_FILES="$(INFO_FILES)" -f $(stepdir)/install-out.sub.make $@ - -localinstall: # $(INFO_FILES) +install-info: $(INFO_FILES) -$(INSTALL) -d $(infodir) - $(INFOINSTALL) -localuninstall: - $(INFOINSTALL) - -endif + $(INFOINSTALL) localinstall +uninstall-info: + $(INFOINSTALL) localuninstall + -rmdir $(infodir) \ No newline at end of file diff --git a/stepmake/stepmake/texinfo-rules.make b/stepmake/stepmake/texinfo-rules.make index 42474ba6fc..796be65295 100644 --- a/stepmake/stepmake/texinfo-rules.make +++ b/stepmake/stepmake/texinfo-rules.make @@ -3,10 +3,10 @@ .SUFFIXES: .html .info .texi .texinfo $(outdir)/%.info: $(outdir)/%.texi - makeinfo --output=$@ $< + -$(MAKEINFO) --force --output=$@ $< $(outdir)/%.html: $(outdir)/%.texi - -makeinfo --force --output=$@ --html --no-headers $< + -$(MAKEINFO) --force --output=$@ --html --no-headers $< # we want footers even if website builds (or is built) partly $(footify) $@