#*
-*.abc
*.aux
*.dvi
*.eps
lib
log
ls-R
-lilypond.dir
+ly2dvi.dir
out
out-www
share
-2004-06-20 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * configure.in (PKG_CONFIG_PATH): add --enable-gui flag, and
- encapsulate gtk/pango tests.
-
- * po/tr.po: Turkish translation.
-
-2004-06-20 Nicolas Sceaux <nicolas.sceaux@free.fr>
-
- * input/regression/lily-in-scheme.ly: regression test for #{
- ... #} syntax
-
- * scm/ly-from-scheme.scm (read-lily-expression): #$( ... )
- was causing an error.
-
- * Documentation/user/programming-interface.itely (Using LilyPond
- syntax inside Scheme): documentation for #{ ... #} syntax.
-
-2004-06-19 Heikki Junes <hjunes@cc.hut.fi>
-
- * Documentation/index.html.in: use black thin <hr>.
-
- * buildscripts/mutopia-index.py: use thin black <hr>.
-
-2004-06-19 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * scm/fret-diagrams.scm: Use UNIX style line endings.
- (fret-diagram-verbose): A couple of @{VAR} and an closing itemize
- typo. Fixes compile.
-
- * scm/output-ps.scm (white-dot): Remove second incarnation.
-
- * scm/lily.scm (ly:all-stencil-expressions): Add white-dot.
-
2004-06-19 Han-Wen Nienhuys <hanwen@xs4all.nl>
- * scripts/lilypond.py (ic_p.make_include_option): set error_p for
- single file error.
-
- * lily/bar-line.cc (compound_barline): add support for unbroken ||:
-
-2004-06-17 Carl Sorensen (carl_sorensen@byu.edu)
-
- * scm/fret-diagrams.scm: added fret-diagram-terse interface;
- remove size as argument to fret-diagram interface;
- improved white-circle dots for fret;
- improved top-fret thick line/
-
- * scm/output-ps.scm: added white-dot function
-
- * scm/output-tex.scm: added white-dot function
-
- * tex/music-drawing-routines.ps: added draw_white_dot function
-
- * ps/music-drawing-routines.ps: added draw_white_dot function
-
- * input/test/fret-diagram.ly: examples to show multiple
- functions and multiple interfaces
-
-2004-06-18 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * lily/pangofc-afm-decoder.cc (pango_fc_afm_get_glyph)
- (pango_fc_afm_get_charset): Update iaw Pango CVS update.
-
- * buildscripts/guile-gnome.sh: Add pango to recipe. Resolve
- conflict. Have I told you lately how much I love autotools?
-
-2004-06-17 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * lily/lily-guile.cc:
- * lily/pangofc-afm-decoder.cc:
- * lily/include/pangofc-afm-decoder.hh: Use #if HAVE_* iso #ifdef.
- Fixes build without Pango CVS. Use "pangofc-afm-decoder.hh".
-
- * Documentation/topdocs/NEWS.texi (Top): Mention GNOME backend for
- developers.
-
- * lily/paper-outputter.cc (file): New method.
- (dump_string): Use it.
-
- * scm/output-gnome.scm: Update with pango CVS info, lilylib
- musing.
-
- * lily/accidental-engraver.cc: Bugfix: (do not sort lines if one
- of them has a comma :-).
-
- * scm/framework-gnome.scm: Add pango decoders.
-
- * lily/include/pangofc-afm-decoder.hh:
- * lily/pangofc-afm-decoder.cc: New file.
-
- * lily/lily-guile.cc (ly:pango-add-afm-decoder): New function.
-
- * configure.in: Check for pango.
-
- * stepmake/aclocal.m4 (PKG_CHECK_MODULES): New function (from
- autoconf).
- (STEPMAKE_GTK2, STEPMAKE_PANGO): New function.
-
- * config.make.in (USER_CFLAGS, USER_LDLAGS): Update.
-
-2004-06-17 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * Documentation/user/tutorial.itely (Integrating text and music):
- fix grammar & punctuation.
-
-2004-06-16 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * lily/: Stray janitorial cleanups.
-
- * scm/lily.scm (ly:all-stencil-expressions):
- * scm/lily.scm (ly:all-output-backend-commands): New function.
-
- * scm/safe-lily.scm (safe-objects): Add them.
-
- * scm/framework-gnome.scm (<gnome-outputter>): New class.
-
- * scm/output-gnome.scm: Move non-stencil evaluators to framework.
-
-2004-06-15 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * buildscripts/guile-gnome.sh: Pick-up user-installed pango.
-
-2004-06-15 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * scm/page-layout.scm (default-page-make-stencil): add
- raggedbottom, raggedlastbottom.
-
- * Documentation/user/changing-defaults.itely (Page layout): add doc.
-
- * scm/framework-tex.scm (define-fonts): fix export of
- papersize.
-
- * lily/paper-book.cc (classic_output): strip suffixes from
- framework functions.
-
- * lily/tuplet-bracket.cc (before_line_breaking): do not return
- SCM_UNDEFINED to Scheme.
-
-2004-06-14 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * lily/book.cc: remove Book::to_stencil().
- (process): whoops. Score::book_rendering returns vector, not list.
-
- * scripts/convert-ly.py (conv): remove \notes.
- apply to input examples.
-
- * lily/paper-outputter.cc (output_stencil): don't use
- smobify_self() but self_scm()
-
- * lily/include/ly-smobs.icc (IMPLEMENT_SMOBS): don't return SCM
- from smobify_self().
-
- * lily/paper-book.cc (output): load framework module
- scm_c_resolve_module().
-
- * python/lilylib.py (exit): exit with argument i.
-
-2004-06-14 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * scm/framework-gnome.scm (output-framework-gnome): Try loading
- gnome modules from non-toplevel.
-
- * lily/ly-module.cc (ly:import-module): Export to ly:.
+ * scripts/lilypond.py (make_include_option): set lilypond_error_p.
- * lily/paper-score.cc (process): Do not show progress newline.
-
- * lily/paper-book.cc (output, classic_output): Show progess
- newline after score.
-
-2004-06-14 Heikki Junes <hjunes@cc.hut.fi>
-
- * buildscripts/lilypond-words.py: add ly/vlaams.ly
-
-2004-06-14 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * lily/score.cc (ly:run-translator): Do not crash on empty music
- list.
-
- * lily/book.cc (process): Do not render score when systems is empty.
-
- * input/simple-song.ly: Down one octave.
-
- * scm/output-gnome.scm: Remove script again; re-add modules fix
- (CVS conflict resolve?)
-
- * lily/stencil.cc (ly:interpret-stencil): Was:
- interpret_stencil_expression.
-
-2004-06-13 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * buildscripts/guile-gnome.sh: New file.
-
- * scm/output-gnome.scm: White background, better window size, sane
- canvas size. Cleanups.
-
-2004-06-13 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * VERSION: release 2.3.4
-
- * Documentation/user/invoking.itexi (Invoking the lilypond
- binary): document --safe.
-
- * scm/output-gnome.scm: set PATH in script.
-
- * scm/page-layout.scm (default-page-make-stencil): don't stretch
- if there is too few systems on a page.
-
- * lily/parser.yy (relative_music): start at middle C without pitch
- argument.
-
- * Documentation/user/changing-defaults.itely (Page layout): new node.
- (Paper size): rename node
- (Page breaking): new node.
- (Titling): move from invoking.
- (File structure): new node.
-
- * lily/parser.yy (score_body): allow \header and music anywhere in
- \score body.
-
-2004-06-13 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * scm/lily.scm (ly:load): Remove page-breaking.scm.
-
-2004-06-13 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * lily/include/paper-system.hh: move cc/hh file from paper-line.*
-
- * lily/include/paper-line.hh: rename to Paper_system.
-
- * lily/include/paper-book.hh: doc class.
-
- * lily/paper-book.cc (c_ragged_page_breaks): remove functions.
-
- * scm/page-layout.scm (plain-footer): add tagline/copyright.
- (plain-header): add instrument-name.
- (default-page-make-stencil): bugfixes.
-
- * lily/parser.yy (book_body): allow \header anywhere in \book{}
-
- * lily/paper-book.cc: remove copyright & tagline. Remove
- interactions with Page
-
- * scm/page-layout.scm (ly:optimal-page-breaks): move back breaking
- here,
- (default-page-make-stencil): new function
- (default-page-music-height): new function
- (page-headfoot): new function
- (ly:optimal-page-breaks): generate stencils directly from here
-
- * scm/titling.scm: new file, group titling functions
-
-2004-06-13 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * scm/output-gnome.scm: Handle multiple pages.
-
- * scm/framework-gnome.scm: Do not load output-gnome.
- (framework-gnome): Invoke output-gnome::header and
- output-gnome::end-output as faked stencils. Fixes experimental
- gnome output.
-
-2004-06-13 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * input/mutopia/W.A.Mozart/mozart-hrn3-rondo.ly (rondo):
- octavation compatibility fixes. Backportme.
-
- * scm/page-breaking.scm (ly:optimal-page-breaks): allow overfull
- pages.
- (ly:optimal-page-breaks): combine-penalties: no shortcut for
- negative. Now we handle negative penalties (ie. \pageBreak)
- correctly.
-
- * lily/system.cc (get_line): extract page-penalty from the left
- bound.
-
- * scm/fret-diagrams.scm (fret-diagram): use @table for documentation
+ * lily/bar-line.cc (compound_barline): backport ||: fix.
2004-06-12 Han-Wen Nienhuys <hanwen@xs4all.nl>
- * scm/framework-ps.scm: don't load output-XXX from framework-XXX
-
-2004-06-12 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * scm/output-gnome.scm: Update script. Move development to
- lilypond_2_3_2 branch for now.
-
-2004-06-11 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * scm/page-breaking.scm (ly:optimal-page-breaks): don't do
- negative penalties.
- cleanups.
-
- * Documentation/user/changing-defaults.itely (Creating contexts):
- index entries
-
- * scm/page-breaking.scm (ly:optimal-page-breaks): new
- file. Rewrite function.
-
- * lily/paper-book.cc (pages): new interface: page-breaking returns
- list of line-list.
-
- * lily/page.cc (Page): take lines argument.
-
- * scm/document-translation.scm (all-engravers-doc): link to user man
-
- * scm/page-layout.scm (ly:optimal-page-breaks): use penalty iso. score.
-
- * Documentation/user/notation.itely (Relative octaves): typo.
-
- * lily/paper-book.cc (LY_DEFINE): ly:output-formats. New function.
-
-2004-06-11 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * scm/output-gnome.scm: Update build script.
-
-2004-06-10 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * scm/output-gnome.scm: Add font scaling. Attempt to resurrect
- gnome backend.
-
- * scm/framework-gnome.scm: New file.
-
- * scm/lily.scm: Use it.
-
- * lily/paper-outputter.cc: Janitorial cleanups.
- (ly:outputter-dump-string): Remove unreachable statement.
-
- * scm/framework-ps.scm: Add header. Janitorial cleanups.
- (ice-9): Bugfix: Add srfi-1.
-
- * scm/framework-tex.scm: Add header. Janitorial cleanups.
-
-2004-06-08 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * lily/new-lyric-combine-music-iterator.cc (do_quit): put warning
- in do_quit()
-
-2004-06-07 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * ly/book-paper-defaults.ly: set optimal-page-breaks as default
-
-2004-06-06 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
* ly/engraver-init.ly (AncientRemoveEmptyStaffContext): remove
- override of Beam::position-callbacks. Why would grace beams not be
- quantized? Fixes: weird-stem-size-grace.
+ override for Beam::position-callbacks in grace. Fixes:
+ weird-stem-size-grace
- * lily/new-lyric-combine-music-iterator.cc (find_voice): issue
- warning only once. Backportme.
+2004-06-11 Han-Wen Nienhuys <hanwen@xs4all.nl>
* lily/accidental-engraver.cc (number_accidentals_from_sig):
- bugfix, 2nd try. Backportme.
+ backport additional fixes.
+
+2004-06-07 Mats Bengtsson <mabe@drongo.s3.kth.se>
- * ly/vlaams.ly: new file. (Thanks Hendrik Maryns)
+ * scripts/lilypond-book.py (latex_filter_cmd): Use a temporary
+ file since 'latex "\\nonstopmode \input /dev/stdin"' doesn't work
+ in Cygwin. Warning: ugly hard coded file name used.
2004-06-04 Mats Bengtsson <mabe@drongo.s3.kth.se>
* Documentation/user/notation.itely (Instrument transpositions):
Correct the name of the instrumentTransposition property.
-2004-06-04 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * scm/output-ps.scm (ps-font-command): fix parmesan coding too.
-
-2004-06-04 Mats Bengtsson <mabe@drongo.s3.kth.se>
+2004-06-03 Mats Bengtsson <mabe@drongo.s3.kth.se>
* scripts/lilypond-book.py (output): Bug fix so preLilyPondExample
and postLilyPondExample are called when defined.
-2004-06-03 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * ly/nederlands.ly (pitchnames): use ly:parser-set-note-names.
- This fixes setting notenames with `\include "nederlands.ly" '
-
- * lily/my-lily-parser.cc (LY_DEFINE): ly:parser-set-note-names:
- new function.
-
2004-06-01 Han-Wen Nienhuys <hanwen@xs4all.nl>
- * scm/page-layout.scm: don't do piece, it should be in score-title
- only.
+ * lily/accidental-engraver.cc (update_local_key_signature): fold
+ repetitive code.
+ (number_accidentals_from_sig): backport code from 2.3. Fixes:
+ custom-key-signatures.ly
- * lily/lexer.ll: lex \score separately.
-
- * lily/paper-book.cc: junk stencil2line.
-
- * lily/paper-line.cc (Paper_line): construct from Stencil
- directly. No futzing with the dimensions.
-
- * lily/include/paper-line.hh (class Paper_line):
-
- * lily/stencil.cc (interpret_stencil_expression): combine-stencil
- takes arbitrary number of arguments.
-
- * input/test/markup-score.ly (tuning): simplify example.
-
-2004-05-31 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * lily/score.cc (LY_DEFINE): ly:score-embedded-format, new function.
-
- * scm/define-markup-commands.scm (score): define score-markup
-
- * lily/parser.yy (markup): use score-markup.
-
- * lily/score.cc: add ly:score?
-
-2004-05-30 Carl Sorensen <carl_sorensen@byu.edu>
-
- * scm/fret-diagrams.scm: add fret-diagram-verbose markup; modified
- fret-parse-string so it prepares for calls to fret-diagram-verbose
- Changed display constants to props so they are available for
- \override.
-
2004-05-31 Han-Wen Nienhuys <hanwen@xs4all.nl>
- * VERSION: release 2.3.3
-
- * stepmake/stepmake/generic-vars.make: unset LANG.
-
- * input/regression/tuplet-nest.ly: bugfix.
+ * VERSION: 2.2.2
* lily/tie-performer.cc (stop_translation_timestep): reset
- ties_created_. Fixes: midi-tie.ly, midi-lyrics-barcheck.ly
-
- * lily/chord-tremolo-engraver.cc (stop_translation_timestep):
- clear repeat_ directly after setting stem_tremolo_. Fixes:
- tremolo-repeat.ly
-
- * input/regression/span-bar-break.ly: new file.
-
- * scm/define-grobs.scm (all-grob-descriptions): remove
- break-visibility from SpanBar. Fixes: piano-repeat.ly
-
-2004-05-30 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * python/lilylib.py (make_ps_images): only compute bbox when needed.
-
- * scripts/lilypond-book.py (process_snippets): use lily -f ps
- files for generating pngs. (failed experiment)
-
- * scm/framework-ps.scm (output-classic-framework-ps): dump EPS
- file with PFA fonts included.
-
- * lily/score.cc (default_rendering): put header in too.
-
- * lily/paper-line.cc (LY_DEFINE): change function to
- ly:paper-line-extent
-
- * scm/page-layout.scm (default-book-title): only add lines for
- non-nil fields.
- (default-score-title): idem.
-
- * lily/my-lily-parser.cc (parse_string): delete lexer after use.
-
- * lily/my-lily-lexer.cc (My_lily_lexer): copy keytable.
-
- * lily/include/paper-book.hh (class Paper_book): remove height_
- member.
-
- * input/test/coriolan-margin.ly (texidoc): remove latex macros.
-
- * lily/ly-module.cc (LY_DEFINE): bugfix.
-
- * lily/paper-book.cc (book_title): separate function for the book
- title.
-
- * scm/page-layout.scm (default-book-title): only account for
- markup fields.
-
- * scm/framework-ps.scm: new file. Move high level interface from
- output-ps.scm
-
- * scm/music-functions.scm (def-grace-function): move macros from
- ly/music-functions-init.ly
-
- * lily/paper-outputter.cc (Paper_outputter): move scheme_calls to
- framework-tex.scm
-
- * scm/framework-tex.scm (dump-line): new file. High level
- interface for output (pages, systems, header).
-
- * lily/include/page.hh (class Page): add is_last_ field.
-
- * lily/paper-outputter.cc (print_smob): smobify Paper_outputter.
-
- * lily/paper-book.cc (split_string): new function
- (output): output multiple formats, i.e. --format=ps,tex
-
- * scm/output-ps.scm (output-scopes): dump variables directly.
- (define-fonts): rewrite for new interface
-
- * ps/lilyponddefs.ps: remove lilypondpaper redefinitions.
-
- * lily/paper-outputter.cc (Paper_outputter): take format argument.
-
- * lily/main.cc (parse_argv): don't set extension for output.
-
- * lily/clef-engraver.cc (create_clef): remove
- Staff_symbol_referencer::set_position() call.
-
-2004-05-30 Nicolas Sceaux <nicolas.sceaux@free.fr>
-
- * ly/music-functions-init.ly (addlyrics): set the 'origin property
- with the location argument in music function definitions.
-
-2004-05-29 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * lily/staff-symbol-engraver.cc (acknowledge_grob): remove item ->
- staffsymbol dependency.
-
- * lily/include/grob.hh (class Grob): live () -> is_live (). Small
- cleanups.
-
- * lily/book.cc (process): return Paper_book
- (to_stencil): use Book::process().
-
- * lily/include/my-lily-parser.hh (class My_lily_parser): remove
- header_ field. Store in $globalheader
-
- * lily/parser.yy (book_body): book header is initted to
- $globalheader.
+ ties_created_. Fixes bugs/midi-tie.ly,
+ bugs/midi-lyrics-barcheck.ly
+ * scm/define-grobs.scm (all-grob-descriptions): remove
+ break-visibility. Should fix: bugs/piano-repeat.ly
-2004-05-28 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * input/test/fill-a4.ly: removed.
-
- * lily/parser.yy (output_def): push scope of parent_ Output_def
- too.
-
-2004-05-28 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * scm/output-gnome.scm: Update info.
-
-2004-05-28 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * lily/book-paper-def.cc: collapse Book_output_def to Output_def.
-
- * scm/lily.scm (ly:modules-lookup): handle empty list, and more
- than 1 module.
-
- * lily/include/ly-module.hh (ly_use_module): rename is_module to
- ly_c_module_p.
-
- * scm/page-layout.scm (default-book-title): move Scheme titling
- functions to here.
-
- * lily/parser.yy (book_paper_block): remove scope too.
-
- * ly/engraver-init.ly (EasyNotation): remove OrchestralScoreContext
-
- * lily/rest.cc: add direction to rest properties.
-
- * lily/include/output-def.hh: new file, move from
- music-output-def.hh
-
-2004-05-27 Jan Nieuwenhuizen <janneke@gnu.org>
+ * lily/chord-tremolo-engraver.cc (stop_translation_timestep):
+ reset repeat_ after setting stem tremolo. Should fix:
+ bugs/tremolo-repeat.ly
- * scm/output-gnome.scm: Describe feta-cork hack.
+ * lily/accidental-engraver.cc (set_property_on_children): copy key
+ signature setting. Backport. Should fix:
+ bugs/custom-key-signatures.ly
2004-05-27 Han-Wen Nienhuys <hanwen@xs4all.nl>
- * lily/include/book-paper-def.hh: derive from Output_def
-
- * lily/include/paper-def.hh: move all functionality out of class.
- Junk header.
-
- * lily/include/music-output-def.hh: rename Music_output_def to
- Output_def.
-
- * input/wilhelmus.ly: only set space for Paper formatting.
-
- * lily/include/midi-def.hh: remove file, remove class.
- Move functions to Music-output-def.
-
- * lily/music-output-def.cc (Music_output_def): remove separate
- translator table. Lookup translators in scope directly. This
- obviates Context suffix for context identifiers, i.e.
-
- \context {
- \Staff
- ..
- }
-
-
- will work.
-
-
- * Documentation/user/notation.itely (Chords mode): typo: 13 -> 3.
-
- * Documentation/user/changing-defaults.itely (Horizontal spacing):
- document spacing override hack.
-
-2004-05-27 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * scm/output-gnome.scm: Add C-q, C-w keybindings. Update
- installation info. Support point-and-click. Add +/- zoom
- keybindings.
-
-2004-05-26 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * VERSION: 2.3.2 released
-
- * lily/parser.yy (book_body): set default bookpaper.
-
- * scm/output-tex.scm (header): kludge: hard code linewidth.
-
- * lily/my-lily-parser.cc (My_lily_parser): don't delete lexer.
-
-2004-05-25 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * lily/score.cc (default_rendering): scale outputdef before
- starting.
-
-2004-05-25 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * scm/fret-diagrams.scm: Add header.
-
- * scm/output-gnome.scm: Hello world :-)
-
-2004-05-25 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * lily/context-def.cc (filter_engravers): backport. Fixes:
+ crash-bar-number.ly
- * scripts/lilypond.py (run_dvips): only add papersize if present.
-
- * lily/accidental-engraver.cc (update_local_key_signature): new
- function, fold code from initialize() and process_music().
- (update_local_key_signature): use deep copy. This fixes one
- problem from custom-key-signatures.ly.
- (number_accidentals_from_sig): tighter check for
- accidental-too-old.
-
- * ly/engraver-init.ly: remove localKeySignature
- definition from ChoirStaff, StaffGroup, Score.
-
- * lily/percent-repeat-engraver.cc (try_music): add moments for
- barlines too. Fixes: skipbars-percent-repeat.ly.
-
-2004-05-24 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * lily/context-def.cc (filter_performers): don't go to cdrloc if
- skipping last pair. Fixes: crash-bar-number.
-
- * scm/fret-diagrams.scm (nil): fret-diagrams (courtesy Carl
- D. Sorensen)
-
- * input/test/fret-diagram.ly: new file.
-
- * scm/paper.scm (paper-set-staff-size): scale linewidth too.
- (scale-paper): divide by scale.
+ * lily/percent-repeat-engraver.cc (try_music): backport. Fixes:
+ skipbars-percent-repeat.ly
2004-05-19 Han-Wen Nienhuys <hanwen@xs4all.nl>
- * lily/rest-collision.cc (do_shift): also do nothing for the (0,2)
- case.
+ * lily/rest-collision.cc (do_shift): handle (0-down, 2-up) case
+ too.
-2004-05-18 Han-Wen Nienhuys <hanwen@xs4all.nl>
+2004-05-04 Han-Wen Nienhuys <hanwen@xs4all.nl>
- * scm/stencil.scm (fontify-text): reinstate function
+ * lily/ottava-bracket.cc (print): fix ottava on rests.
- * tex/lily-ps-defs.tex: remove lilypondblotdiam def.
+2004-05-03 Han-Wen Nienhuys <hanwen@xs4all.nl>
- * lily/book-paper-def.cc (Book_paper_def): add copy ctor.
+ * VERSION: release 2.2.1
+
+ * scm/music-functions.scm (set-accidental-style): use GrandStaff
+ iso. PianoStaff.
- * lily/parser.yy (book_paper_head): \bookpaper {}
+2004-05-02 Han-Wen Nienhuys <hanwen@xs4all.nl>
- * python/midi.c: remove config.h
+ * Documentation/user/lilypond.tely (Top): update version number.
-2004-05-18 Jan Nieuwenhuizen <janneke@gnu.org>
+ * lily/lyric-engraver.cc (get_voice_to_lyrics): go higher when
+ finding Voice context.
- * scm/output-gnome.scm: Update.
+ * Documentation/user/music-glossary.tely (Top): replace table strong
+ with table samp.
-2004-05-17 Jan Nieuwenhuizen <janneke@gnu.org>
+ * lily/stem.cc (get_default_stem_end_position): handle dir==0
+ case. This fixes a bugs/tremolo-repeat
- * scm/output-gnome.scm: New file.
+ * Documentation/user/introduction.itely (About this manual): fix
+ URLS.
- * lily/include/book-paper-def.hh: Add. Janitorial fixes.
+2004-04-20 Jan Nieuwenhuizen <janneke@gnu.org>
-2004-05-17 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * lily/book-paper-def.cc (ly_bookpaper_fonts): move from Paperdef
- (find_scaled_font): move from Paper_def
-
-2004-05-16 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * lily/my-lily-parser.cc (LY_DEFINE): new function ly_parser_lookup
- (LY_DEFINE): add SCM_ASSERT_TYPE everywhere.
-
- * po/fr.po: update po.
-
- * lily/include/book-paper-def.hh (class Book_paper_def): new file.
-
- * lily/book-paper-def.cc (print_smob): new file.
-
-2004-05-16 Heikki Junes <hjunes@cc.hut.fi>
-
- * buildscripts/lilypond-words.py: search words also from
- music-functions-init.ly.
-
-2004-05-15 Nicolas Sceaux <nicolas.sceaux@free.fr>
-
- * ly/music-functions-init.ly (def-music-function): new helper
- macro for defining music functions. \addlyrics \appoggiatura
- \acciaccatura \grace \partcombine \autochange \applycontext
- \applyoutput and \breathe are now defined here thanks to it.
-
- * lily/parser.yy:
- * lily/my-lily-lexer.cc: \addlyrics \appoggiatura \acciaccatura
- \grace \partcombine \autochange \applycontext \applyoutput and
- \breathe keywords removed from the parser.
-
- * lily/parser.yy:
- * lily/music-function.cc (ly_make_music_function):
- * lily/lexer.ll (music_function_type): added a case for 0-arg
- music functions.
-
-2004-05-14 Nicolas Sceaux <nicolas.sceaux@free.fr>
-
- * scm/ly-from-scheme.scm (read-lily-expression): A variable
- refering to a music expression can be used in lily-inside-scheme:
- #{ $music #}
-
- * lily/my-lily-parser.cc (LY_DEFINE): introduce ly:clone-parser
- and ly:parser-define, and change ly:parser-parse-string in order
- to make #{ $music #} work.
-
- * scm/new-markup.scm (compile-markup-expression): when an argument
- is a string, use `make-simple-markup'.
-
-2004-05-14 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * lily/parser.yy (My_lily_lexer): bugfix; op should be tag.
-
-2004-05-10 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * scripts/convert-ly.py (FatalConversionError.func): handle + in
- font-size. (backportme)
-
-2004-05-09 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * lily/paper-outputter.cc (output_stencil): dump font definitions
- before each stencil.
-
- * lily/include/paper-book.hh (struct Score_lines): new
- struct. Collect info per Paper-score.
-
- * lily/include/page.hh (class Page): to_stencil() returns Stencil
- everywhere.
-
- * lily/stencil.cc (find_expression_fonts): new function
-
- * lily/paper-outputter.cc (output_stencil): use
- interpret_stencil_expr
-
- * lily/stencil.cc (LY_DEFINE): ly_stencil_fonts: new function.
- (interpret_stencil_expr): new function. Generic stencil
- interpretation.
-
- * lily/paper-def.cc (find_scaled_font): divide lookup
- magnification by outpuscale for non-virtual fontmetrics. This
- fixes ludicrously long font definitions for text
- fonts. (backportme)
-
- * lily/score-engraver.cc: remove
- {Engraver,Score_engraver}::typeset_grob(), remove all calls.
-
-2004-05-09 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * input/test/markup-score.ly: Remove \notes.
-
- * lily/parser.yy (book_body): Grok Composite_music and \header.
- (markup): Push NOTES mode before score_block.
-
- * VERSION: release 2.3.1
-
- * mf/feta-klef.mf:
- * mf/feta-bolletjes.mf: Oops. Comment-out canvast test code.
-
- * Documentation/user/programming-interface.itely: Use @emph (was: @em).
-
- * Documentation/user/out/tutorial.texi: Untrigger lilypond-book error.
-
-2004-05-09 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * scm/output-tex.scm (output-tex-string): tighten safe security.
-
- * lily/scm-option.cc (LY_DEFINE): add 'safe to ly:get-option
-
- * scm/safe-lily.scm (make-safe-lilypond-module): new file. Define
- allowed ly functions.
-
- * lily/ly-module.cc (ly_module_define): only define variable if
- bound.
- (ly_make_anonymous_module): take safe option.
-
-2004-05-08 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * scripts/lilypond-book.py (compose_ly): remove FRAGMENT_LY.
-
-2004-05-08 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * input/regression/newaddlyrics.ly: Fix.
-
- * Documentation/user/tutorial.itely: Use \newlyrics, remove most
- \score \notes.
-
-2004-05-08 Heikki Junes <hjunes@cc.hut.fi>
-
- * Documentation/user/music-glossary.tely ([k-z]): last fixes.
-
-2004-05-08 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * input/mutopia/R.Schumann/romanze-op28-2.ly (d): use #(define .. )
-
- * lily/paper-line.cc (Paper_line): don't store list of stencils,
- but convert to single Stencil immediately.
-
- * lily/paper-book.cc (title): don't return Stencil* but Stencil.
-
-2004-05-07 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * scm/output-sodipodi.scm: Resurrect sodipodi output.
-
-2004-05-07 Kristof Bastiaensen <kristof.bastiaensen@vleeuwen.org>
-
- * elisp/lilypond-mode.el: Changed the way defaults are created for
- LilyPond-command-master. LilyPond-mode will now check the
- timestamps of the files to see which command has to run next.
-
-2004-05-07 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * scm/bass-figure.scm (format-bass-figure): don't set
- number-markup for strings. This fixes string in bass
- figure. (backportme)
-
- * lily/parser.yy (bass_number): insert number-markup into figure
- definition.
-
- * scm/define-music-properties.scm (all-music-properties): make
- 'figure a markup.
-
- * scripts/convert-ly.py (conv): \apply -> \applymusic
-
-2004-05-06 Kristof Bastiaensen <kristof.bastiaensen@vleeuwen.org>
-
- * elisp/lilypond-mode.el: changed the order of some commands
- ("Midi" after "2Midi"), use the user-defined
- LilyPond-command-default as default instead of "LilyPond"
-
- * elisp/lilypond-mode.el: added a LilyPond-master-file variable,
- to set the master file for the next command.
-
- * elisp/lilypond-font-lock.el: replaced font-lock-warning-face
- with font-lock-reference-face.
-
-2004-05-07 Heikki Junes <hjunes@cc.hut.fi>
-
- * Documentation/user/music-glossary.tely ([ab]*): small fixes.
-
- * Documentation/user/music-glossary.tely ([c-l]*): more fixes.
-
-2004-05-06 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * ly/music-functions-init.ly (TODO): new file.
-
- * lily/parser.yy (Generic_prefix_music_scm): add more
- music_function symbols.
- (Prefix_composite_music): change \apply to music-function
-
- * lily/include/music-function.hh: rename to music-function
-
-2004-05-05 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * lily/music-head.cc (LY_DEFINE): change order of args.
-
- * input/regression/music-head.ly (texidoc): new file.
-
- * lily/parser.yy (Generic_prefix_music): allow generic
- music-transformation functions.
-
- * lily/include/music-head.hh (is_music_head): new file.
-
- * lily/music-head.cc (get_music_head_transform): new file.
-
-2004-05-04 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * lily/ottava-bracket.cc (print): use coordinate, not (0,0) for
- empty extent. This fixes ottava brackets on rests. (backportme)
-
- * make/lilypond.redhat.spec.in (Group): ln png files for info.
-
- * lily/piano-pedal-engraver.cc (create_text_grobs): core dump fix.
-
- * cygwin/lily-wins.py: update for the lily-wins.py script.
-
-2004-05-03 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * lily/score-engraver.cc (typeset_all): switch off unbound spanner
- code. This will obviate typeset_grob () in the future. The effect
- of this is that improperly written spanner handling will result in
- invalid spanner bounds.
- (announce_grob): add to elems_ from here
- (typeset_grob): comment out.
-
- * lily/include/engraver.hh (make_spanner): new calling interface
- for make_{item,spanner}. This obviates most calls to
- announce_grob().
-
- * scm/music-functions.scm (set-accidental-style): use GrandStaff
- iso. PianoStaff for piano styles.
-
-2004-05-03 Heikki Junes <hjunes@cc.hut.fi>
-
- * Documentation/user/music-glossary.tely: add segno after d.s.
-
-2004-05-02 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * lily/include/audio-column.hh: remove unused variables.
- (patch by Michael Welsh Duggan)
-
- * flower/include/axes.hh (other_axis): inline Axes function
- (thanks to David Brandon).
-
-2004-05-02 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * cygwin/mknetrel: Install image links (backportme).
-
- * Documentation/user/GNUmakefile (local-install-info): Activate
- actual installing of image links (backportme).
-
-2004-04-30 Mats Bengtsson <mabe@drongo.s3.kth.se>
-
- * Documentation/user/notation.itely (Measure repeats): Removed
- unnecessary (and confusing) \context Voice{.
-
-2004-04-29 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * Documentation/topdocs/NEWS.texi: Mention use of \score as markup.
-
- * lily/page.cc (Page): Do not use ly_scheme_function for
- volatile/configurable variables (FIXME: better name).
-
- * lily/music-output-def.cc (c_lookup_variable): Rename (WAS:
- get_scmvar).
-
-2004-04-29 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * scripts/convert-ly.py (FatalConversionError.subst): use
- \transposition.
-
-2004-04-29 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * lily/include/page.hh (class Page): Declare left_margin ().
-
- * lily/page.cc: Remove paper var caching.
-
-2004-04-28 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * Documentation/user/music-glossary.tely: Add name to @top node.
- Remove comment from @table definitions (workaround for makinfo
- bug).
-
- * lily/stencil-scheme.cc (ly:stencil-expr): Rename (was:
- ly:stencil-get-expr). Update callers.
- (ly:stencil-align-to!): Return stencil too.
-
- * lily/paper-outputter.cc (output_page): Bugfix. Use page
- stencil. Remove looped line-based page output.
- (output_line): Use line stencil. Remove looped stencil-based line
- output.
-
- * lily/page.cc (ly:page-paper-lines): New function.
-
- * input/test/markup-score.ly: New file.
-
- * scm/define-markup-commands.scm (stencil): New markup.
-
- * lily/book.cc (to_stencil): New method.
-
- * lily/parser.yy (markup): Use it to grok \score.
-
-2004-04-27 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * lily/stencil.cc (expr): Rename (was: get_expr). Update callers.
-
- * lily/paper-book.cc (pages): Change signature. Update callers.
-
- * lily/include/page.hh:
- * lily/page.cc: New file.
-
- * lily/paper-line.cc (to_stencil): New method.
-
- * lily/paper-outputter.cc (output_stencil): New method.
-
- * lily/paper-outputter.cc (output_line): Use them.
-
- * lily/warn.cc: Remove.
-
- * lily/my-lily-parser.cc (distill_inname): Remove.
-
- * flower/include/file-name.hh:
- * flower/file-name.cc: New file. Update users.
-
- * flower/file-path.cc [CYGWIN]: Junk testing code. Remove Path.
- (find): New method of same name.
-
- * lily/my-lily-parser.cc (ly:parse-file): Use it.
-
- * lily/scm-option.cc (ly:set-option, ly:get-option): Bugfix:
- constant error message.
-
-2004-04-27 Heikki Junes <hjunes@cc.hut.fi>
-
- * input/test/{blank-notes.ly,staff-container.ly}: typos.
-
-2004-04-26 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * Documentation/user/music-glossary.tely: @table @strong' replaced
- by `@table @samp @c @strong'. This fixes invalid makeinfo output
- (backportme).
-
-2004-04-25 Nicolas Sceaux <nicolas.sceaux@free.fr>
-
- * scm/lily.scm (ly:load): Add ly-from-scheme.scm loading.
-
- * scm/ly-from-scheme.scm: New file. Introduce a new syntax:
- #{ lily music expression #} that returns an equivalent scheme
- music expression by parsing the string.
-
-2004-04-25 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * lily/my-lily-parser.cc:
- * lily/my-lily-lexer.cc: Another step towards parsing ly code from
- SCM string (foo.ly/toto.scm support).
-
-2004-04-24 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * lily/my-lily-parser.cc (ly:parser-parse-string): New function.
-
-2004-04-21 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * input/regression/newaddlyrics.ly: Remove lilypond-book kludge.
-
- * scripts/lilypond-book.py: LY code that includes \header is
- not assumed to be a fragment.
-
-2004-04-20 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * lily/stem-tremolo.cc (print): If stem direction == CENTER, move
- tremolo beams up.
-
- * lily/stem.cc (chord_start_y): Return 0 if no heads.
- (get_default_stem_end_position): No tremolo head juggling if no
- heads. Fixes tremolo crash on rests (backportme).
-
- * scripts/abc2ly.py: Oops use [\]proper[ty] 2.2 syntax.
-
-2004-04-19 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * scripts/abc2ly.py: ABC beams preserve support (courtesy Guy
- Gascoigne-Piggford). Also: TAB and whitespace fixes.
-
- * lily/lexer.ll: Allow \encoding in NOTES mode.
-
- * buildscripts/mf-to-table.py (write_fontlist): Use \lyrics
- for lyrics, not for commands.
-
- * lily/parser.yy (scalar): Bugfix: accept LYRICS_STRING.
- FIXME: Replace some `Music's with Grouped_music_list; fixes make web.
-
- * input/regression/newaddlyrics.ly: New file.
-
- * Documentation/topdocs/NEWS.texi: Update.
-
- * lily/parser.yy (new_lyrics): Return SCM list of lyric musics.
- (Music_list): Allow embedded scm.
-
- * lily/score.cc (ly:score-bookify): New function.
-
- * lily/music.cc (ly:music-scorify): Idem.
-
- * lily/my-lily-parser.cc (ly:parser-print-book): Idem.
- (ly:parser-print-score): Idem.
-
- * scm/lily.scm (default-toplevel-book-handler): Idem.
- (default-toplevel-music-handler): Idem.
- (default-toplevel-score-handler): Idem.
-
- * ly/declarations-init.ly: Set default toplevel handlers.
-
- * lily/parser.yy (book_block, score_block, toplevel_music): Use them.
-
- * scripts/lilypond-book.py (PREAMBLE_LY): Select classic score
- printer for score at toplevel.
-
-2004-04-18 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * lily/parser.yy (NEWLYRICS): Switch to LYRICS mode for lyrics.
- Fix for simple case: input/simple-song.ly, more complex stuff
- does not work yet.
-
-2004-04-18 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * lily/parser.yy (Prefix_composite_music): split Composite_music
- in Prefix_composite_music and Grouped_music_list.
- (re_rhythmed_music): use Grouped_music_list for NEWLYRICS.
-
-2004-04-18 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * scm/lily.scm (toplevel-expression): New define.
-
- * lily/my-lily-parser.cc (ly:parser-add-book-and-score): New function.
-
- * lily/parser.yy (toplevel_expression): Use it.
-
- * lily/include/my-lily-parser.hh: Smobbify.
-
- * lily/my-lily-parser.cc (parse_string): New method.
-
- * lily/my-lily-parser.cc (ly:parse-string): New function.
-
- * Documentation/user/lilypond.tely: Add comment and workaround for
- gs-8.01 crash. Fixes make web.
-
- Simplification of toplevel music.
-
- * lily/lexer.ll, lily/parser.yy:
-
- * In LYRICS mode, return LYRICS_STRING. This fixes one
- shift/reduce problem.
-
- * Use NOTES mode at start of maininput.
-
- * Grok toplevel composite music expression, put in score and book.
-
- * Grok \relative COMPOSITE_MUSIC, make relative on middleC.
-
- * \newlyrics is a shortcut for \context Lyrics \lyricsto "" \lyrics
-
- * input/simple.ly: New file.
-
- * input/simple-song.ly: Idem.
-
-2004-04-16 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * lily/parser.yy: rename NEWADDLYRICS to LYRICSTO. Thanks to Erik
- Sandberg.
-
-2004-04-17 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * scm/font.scm (add-cmr-fonts): Narrow bold is ecrb.
-
-2004-04-17 Heikki Junes <hjunes@cc.hut.fi>
-
- * input/regression/accidental-octave.ly: doc automatic showing
- of note names.
-
-2004-04-16 Heikki Junes <janneke@gnu.org>
-
- * po/fi.po: do "make po && make -C po po-update" at top-level,
- then "cp po/out/fi.po po/fi.po" and update fields.
-
- * po/fi.po: remove all designations of `fuzzy'; shows those elements.
-
-2004-04-15 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * Documentation/user/introduction.itely (About this manual): Fix
- templates and regression urls (backportme).
-
-2004-04-14 Mats Bengtsson <mabe@drongo.s3.kth.se>
-
- * ly/engraver-init.ly (Score:graceSettings): Increase
- beamed-lengths, especially for 32nd notes.
-
- * Documentation/user/notation.itely (Grace notes): Correct the
- syntax for add-grace-property example.
-
-2004-04-13 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * flower/parse-afm.cc [METATYPE1_BUG]: Grok Metatype1's global
- `Generated' tag.
-
- * scm/font.scm (add-cmr-fonts): Use super-cm/lmodern fonts. NOT.
- Severely broken (the Debian package, at least).
-
-2004-04-13 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * lily/context.cc (find_create_context): assign to lvalue.
-
-2004-04-12 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * lily/include/translator.hh (class Translator): rename
- get_parent_context() to context () to avoid confusion.
-
- * lily/include/lily-guile.hh: is_x -> ly_c_X_p naming.
-
- * lily/lexer.ll: change is_string -> ly_c_string_p
-
- * input/mutopia/J.S.Bach/wtk1-fugue2.ly (bassdux): use \book.
-
- * input/mutopia/W.A.Mozart/mozart-hrn-3.ly: use \book.
-
- * VERSION: release 2.3.0
-
- * mf/feta-nummer-code.mf: use ascii names for number glyphs.
-
- * buildscripts/mf-to-table.py (parse_logfile): only prepend group-
- if nonempty.
-
- * lily/include/context.hh (class Context): make members protected.
- (children_contexts): new accessor function.
-
- * lily/include/translator.hh (class Translator): make
- daddy_context_ protected.
- (class Translator): clean up.
-
- * lily/include/context.hh (class Context): make daddy_context_
- private.
-
- * lily/lyric-engraver.cc (get_voice_to_lyrics): recursively go
- higher for finding Voice. (backportme)
-
- * lily/include/context.hh (class Context): remove
- find_context_below() as a method.
-
- * Documentation/user/notation.itely (The Lyrics context): add note
- about manual durations
-
- * ly/chord-modifiers-init.ly (blackTriangleMarkup): use TeX-math
- encoding.
-
- * scm/output-tex.scm (text): dump \inputencoding{} for text.
-
-2004-04-11 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * scripts/lilypond.py (global_latex_preamble): remove latin1 from
- \usepackage{inputenc}
-
- * lily/paper-book.cc (classic_output): don't advance Offset for
- TeX output.
-
- * make/mutopia-rules.make ($(outdir)-$(PAPERSIZE)/%.dvi): include
- ec-sauter.map in rules
-
- * mf/ecb.mf (font_identifier): new file, based on ecbx
-
- * mf/ecb10.mf (gensize): new file.
-
- * Documentation/topdocs/NEWS.texi (Top): document some more new
- features.
-
- * ly/declarations-init.ly: run convert-ly
-
- * lily/my-lily-parser.cc (LY_DEFINE): move parse-file function
- from input-file-results. Remove input-file-results.*
-
-2004-04-11 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * scm/output-ps.scm (font-command): Fix, again.
-
- * input/test/title-markup.ly: Add \noPagebreak test.
-
- * lily/score-engraver.cc (try_music): Bugfix.
-
-2004-04-11 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * lily/main.cc (main_with_guile): excise dependency options -M and
- --dep-prefix
-
- * lily/input-file-results.cc: excise Makefile dependency code
-
- * Documentation/user/invoking.itexi (Invoking the lilypond
- binary): remove dep doco
-
- * lily/main.cc (main_with_guile): call lilypond-main
-
- * scm/lily.scm (lilypond-main): new function: handle multiple files.
-
- * lily/input-file-results.cc (LY_DEFINE): throw ly-file-failed
- exception.
-
- * lily/my-lily-parser.cc: remove paper_description function
-
- * lily/music-output-def.cc (LY_DEFINE): ly:output-description
- new function.
-
- * lily/main.cc: remove global_score_count.
-
- * lily/book.cc (process): don't take header from global_input_file.
-
- * buildscripts/lilypond-profile.sh (Error): set GS_FONTPATH
-
- * lily/parser.yy (My_lily_lexer): remove current_parser global var.
-
- * lily/music-output-def.cc (LY_DEFINE): new function
- ly_output_description. This function does the bulk for setting,
- parsing and breaking down of an input file.
-
- * lily/ly-module.cc (ly_make_anonymous_module): don't protect
- anonymous modules globally. Let's hope they get GCd
-
- * scripts/lilypond.py (run_dvips): add sauter-mftrace.map
-
-2004-04-11 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * scm/output-ps.scm (header): Papersize from paper.
-
- * scripts/lilypond.py (global_latex_preamble): Oldish behaviour
- for classic output.
-
- * tex/lilyponddefs.tex (interscoreline): Oldish behaviour if
- lilypondclassic is defined.
- (lilypondstart): Oldish behaviour if lilypondclassic is defined.
-
- * input/regression/between-systems.ly: Remove.
-
- * python/lilylib.py (get_bbox): Fix regular expression
- for bounding box.
-
- * tex/lilyponddefs.tex (lilypondpagebreak): New overridable macro.
-
- * scm/output-tex.scm (stop-page): Use it.
-
- * scm/output-ps.scm (define-fonts): Bugfix.
-
- * lily/grob.cc: Add penalty to interface.
-
- * lily/include/paper-line.hh (class Paper_line): New member
- var penalty_.
-
- * lily/system.cc (get_line): Initialise Paper_line with
- page-penalty's from original grobs.
-
- * scm/define-music-properties.scm (all-music-properties): Add
- page-penalty.
-
- * scm/define-grob-properties.scm (all-grob-descriptions): Idem.
-
- * lily/score-engraver.cc (try_music): Handle page-penalty.
-
- * ly/declarations-init.ly (pagebreak, noPagebreak): New command.
-
-2004-04-11 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * ly/declarations-init.ly (melismaEnd): typo
-
- * scm/font.scm (add-cmr-fonts): caps is eccc, ecsc is slanted caps.
-
- * scm/output-ps.scm (text): split string into spaces, use moveto
- for setting space.
-
-2004-04-10 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * po/nl.po: Update.
-
- * scm/font.scm (add-cmr-fonts): Typo.
-
-2004-04-10 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * scm/font.scm (add-cmr-fonts): add sauter fonts under latin1
- font-encoding.
-
- * scm/define-grobs.scm (all-grob-descriptions): idem.
-
- * lily/time-signature.cc (numbered_time_signature): idem.
-
- * scm/font.scm (add-cmr-fonts): use real encoding names for
- font-encoding.
-
-2004-04-10 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * lily/paper-book.cc (classic_output):
- * tex/lilyponddefs.tex (lybox): Add height, and proper raising.
- Fixes classic output.
- (lilypondstart):
- * scripts/lilypond.py (global_latex_preamble): Remove topmargin
- kludge.
-
- * scripts/old-lilypond-book.py: Remove.
-
- Page layout for SCOREs enclosed in a BOOK:
-
- * scripts/lilypond.py: Remove LaTeX titling kludge. Remove page
- layout tweaking.
-
- * input/les-nereides.ly (theScore): Add \book.
-
- * input/test/title-markup.ly: Add \book.
-
- * scm/page-layout.scm (ly:optimal-page-breaks): Debugging output
- only if 'verbose.
-
- * lily/include/paper-book.hh (PAGE_LAYOUT): Remove.
-
- * lily/paper-outputter.cc (output_line): Remove PAGE_LAYOUT check.
-
- * tex/lilyponddefs.tex (lilypondstart, lybox, lyitem):
- * scm/output-tex.scm (start-system): Update for page layout by
- LilyPond.
-
- * scm/output-ps.scm (start-system): Previously (new-start-system).
-
- * lily/paper-outputter.cc (output_header): Uniquify list of fonts
- passed to define-fonts.
-
- * lily/paper-column.cc:
- * lily/system.cc (get_line):
- * ly/property-init.ly (newpage):
- * scm/define-grob-properties.scm:
- * scm/output-ps.scm:
- * scm/output-tex.scm: Remove between-system-string kludge.
-
- * scm/output-ps.scm (define-fonts, font-command,
- font-load-encoding): Handle ENCODING = #f.
-
- * scm/output-tex.scm (output-scopes): Check if variable is bound.
-
- * scm/define-markup-commands.scm (fill-line): Use
- make-simple-markup (WAS: unexisting make-word-markup).
-
- * lily/text-item.cc (interpret_markup): Bugfix, transpose
- ENCODING, MARKUP parameters for interpret_string.
-
- * lily/input-file-results.cc (do_one_file): Remove Paper_book hack.
-
- * lily/score.cc (book_rendering): New method.
- (default_rendering): Create Paper_book helper locally, dump
- output.
-
- * lily/my-lily-lexer.cc (the_key_tab): Add book.
-
- * lily/parser.yy: Handle \book.
-
- * lily/include/book.hh:
- * lily/book.cc: New file.
-
-2004-04-10 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * lily/text-item.cc (interpret_string): new file, select font with
- encoding.
-
- * lily/include/lily-guile.hh: ly_XXX_p -> is_XXX. Changes throughout.
-
- * scm/define-markup-commands.scm (encoded-simple): new markup command.
-
- * lily/parser.yy (markup): take encoding from lexer.
-
-2004-04-09 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * lily/kpath.cc (kpathsea_find_tfm): Do not trigger TFM generation.
-
- * scm/output-ps.scm: Remove some cruft.
-
-2004-04-09 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * lily/kpath.cc (kpathsea_find_tfm): don't make unfound TFMs/AFMs.
-
- * Documentation/user/lilypond.tely (Top): manual for v2.3 (backportme)
-
-2004-04-09 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * scm/font.scm (add-century-schoolbook-fonts):
- (make-century-schoolbook-tree): New function.
-
- * input/test/title-markup.ly: Use Century Schoolbook font.
+ * scripts/lilypond.py: Handle --set=fontencoding=FONTENC (default:
+ unset) and --set=inputencoding=INPUTENC (default: latin1).
2004-04-09 Han-Wen Nienhuys <hanwen@xs4all.nl>
- * scripts/convert-ly.py: limited old-style markup convert. (Thanks
- to Erik Sandberg)
-
- * lily/font-metric.cc (LY_DEFINE): new function, return fontName.
-
- * scm/output-ps.scm (define-fonts): remove hack for feta/parmesan.
-
- * lily/font-metric.cc (LY_DEFINE): change to ly:font-filename
-
- * scm/encoding.scm (coding-alist): add AdobeStandardEncoding
-
-2004-04-08 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * scm/part-combiner.scm (determine-split-list): bugfix: if no
- solo-state (at end of solo), we can set the solo status
- too. (backportme.)
-
- * input/regression/part-combine-solo-end.ly: new file.
-
-2004-04-08 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * scripts/abc2ly.py (parse_file): Strip \r from lines. Fixes DOS
- flavour abc files. Really ignore unknown keys (backportme).
-
-2004-04-08 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * lily/scaled-font-metric.cc (text_dimension): only multiply with
- magnification_ when looking up in orig_.
-
- * scm/output-tex.scm (text): switch off char-mapping.
-
- * lily/tfm.cc (coding_scheme): replace ' ' in encoding with '-',
- because AFM's encoding field cannot have spaces.
-
-2004-04-08 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * scm/output-ps.scm (define-fonts): More re/encoding tweaking.
-
-2004-04-08 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * lily/paper-def.cc (find_scaled_font): change to inputencoding.
-
- * mf/cmr.enc: new file, without hi-bit ascii info.
-
- * lily/bezier-bow.cc (slur_shape): make indent dependent on
- width. This removes the 'hook' at the end of a long slur.
-
- * buildscripts/mf-to-table.py (parse_logfile): don't append
- encoding to fontname.
-
-2004-04-07 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * scm/output-ps.scm (define-fonts): Load .enc only once.
-
- * mf/GNUmakefile (INSTALLATION_OUT_SUFFIXES): Install .enc files
- too.
-
-2004-04-07 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * buildscripts/mf-to-table.py (parse_logfile): remove spaces from
- encoding field.
-
- * lily/stencil-scheme.cc: remove ly:fontify-atom
-
- * ly/portuges.ly (pitchnames): new file.
-
- * lily/include/lily-guile.hh: many new ly_ functions. Thanks to
- Michael Welsh Duggan
-
- * lily/*.cc: deprecate gh_ interface. Thanks to Michael Welsh Duggan
-
- * ly/nederlands.ly: add comment about digits.
-
- * lily/scaled-font-metric.cc (derived_mark): idem.
-
- * scm/encoding.scm (make-encoding-mapping): change permutation to
- mapping.
-
- * lily/scaled-font-metric.cc (derived_mark): is a const method.
- (Modified_font_metric): make alist for coding_description_
- (LY_DEFINE): remove coding-name.
-
- * scm/output-tex.scm (text): remove debugging code.
-
- * lily/scaled-font-metric.cc (ly_font_encoding): return vector
-
- * buildscripts/mf-to-table.py (parse_logfile): read EncodingScheme
- from infile.
-
- * mf/feta-generic.mf: move fet_beginfont into generic code.
- use fetaMusic (without space) as encoding
-
- * mf/feta-autometric.mf: take encoding argument
-
- * lily/afm.cc (read_afm_file): bugfix, read global info too.
-
- * lily/my-lily-lexer.cc (set_identifier): remove gh_scm2newstr
- use.
-
- * scm/encoding.scm (read-encoding-file): use symbol for glyph
- name.
-
-2004-04-07 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * input/test/title-markup.ly: Set inputencoding.
-
- * scm/output-ps.scm (define-fonts): Handle font re-encoding.
-
- * lily/scaled-font-metric.cc (ly:font-coding-name): New function.
-
- * scm/encoding.scm (get-coding-filename, get-coding-command): New
- function.
- (coding-alist): Also hold filename, command.
- (read-encoding-file): Return symbols.
-
-2004-04-06 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * scm/output-tex.scm: remove fontify; text and char take a font
- argument.
-
- * lily/tfm.cc (name_to_index): new function, use encoding_table_.
-
- * lily/scaled-font-metric.cc (text_dimension): init
- coding_{permutation,table}_ too
- (LY_DEFINE): ly:font-encoding, new function return
-
- * lily/paper-def.cc (find_scaled_font): take input coding from
- inputcoding paper var.
-
- * lily/performance.cc (output): remap modulo 16.
-
- * lily/text-item.cc (interpret_markup): whoops, variable
- shadowing fixed.
-
-2004-04-06 Michael Welsh Duggan <mwd@sei.cmu.edu>
-
- * lily/piano-pedal-performer.cc (try_music): Compare symbols to
- symbols, not symbols to strings.
-
- * lily/piano-pedal-engraver.cc (try_music): Compare symbols to
- symbols, not symbols to strings.
-
-2004-04-06 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * lily/kpath.cc (kpathsea_gulp_file_to_string):
- (ly:kpathsea-gulp-file): New function.
-
- * scm/encoding.scm (read-encoding-file): Use it.
-
-2004-04-06 Werner Lemberg <wl@gnu.org>
-
- * scm/encoding.scm (coding-alist): Fix typo.
-
-2004-04-06 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * lily/scaled-font-metric.cc (text_dimension): move function from
- Font_metric
- (make_scaled_font_metric): init coding_scheme_ to TeX
- (text_dimension): use get-coding-vector for non TeX coding_scheme_
-
- * lily/include/scaled-font-metric.hh (struct
- Modified_font_metric): rename from Scaled_font_metric
-
- * scm/encoding.scm (read-encoding-file): split up large function,
- leave caching to (delay)
-
- * lily/lily-guile.cc (LY_DEFINE): typecheck argument.
-
-2004-04-05 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * lily/my-lily-lexer.cc (set_encoding): New method.
-
- * lily/lexer.ll: Grok \encoding.
-
- * lily/font-metric.cc (get_encoded_index): New function.
-
- * lily/include/font-metric.hh (coding_scheme): New method.
-
- * scm/encoding.scm: New file.
-
- * mf/feta-beugel.mf: Better error message (WAS: `foobar').
-
-2004-04-05 Werner Lemberg <wl@gnu.org>
-
- * Documentation/user/tutorial.itely: Revised (finished).
-
- * Documentation/user/macros.itexi (@separate): Removed.
-
-2004-04-05 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * scm/output-ps.scm (define-fonts): fix scaling.
-
- * lily/scaled-font-metric.cc (design_size): add function.
-
- * lily/font-metric.cc (LY_DEFINE): opps ly:font-design-size is only
- partial cut&paste of ly:font-magnification.
-
-2004-04-05 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * scm/output-ps.scm (define-fonts):
- (fontify): Update.
-
-2004-04-04 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * po/fr.po: update. (backportme).
-
- * po/nl.po: update. (backportme).
-
- * mf/feta-beugel.mf: document why design size is not fixed.
-
- * mf/feta-braces-a.mf: rename to stress that it's not design size.
-
-2004-04-04 Werner Lemberg <wl@gnu.org>
-
- * Documentation/user/tutorial.itely: Revised (continued).
-
-2004-04-03 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * po/nl.po: Update (backportme).
-
-2004-04-03 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * po/de.po: update. (backportme).
-
- * scm/output-tex.scm (font-command): use ly: functions to
- construct name.
- (define-fonts): don't use alist, just dump \font definitions.
- (font-load-command): calculate proper scaling by taking
- outputscale from paper argument.
-
- * lily/stencil-scheme.cc (fontify_atom): insert Font_metric into
- expression.
-
- * lily/paper-outputter.cc (output_header): pass paper arg to
- define-fonts
-
- * lily/paper-def.cc (font_descriptions): dump list of
- Scaled_font_metrics
- (find_scaled_font): take Font_metric argument, store
- Scaled_font_metrics in hash-table containing (size ->
- Scaled_font_metrics) alist.
- (get_dimension): rename from get_realvar
-
- * lily/font-metric.cc (LY_DEFINE): ly:font-design-size,
- ly:font-magnification, ly:font-name: new functions
-
-2004-04-03 Werner Lemberg <wl@gnu.org>
-
- * Documentation/user/dedication.itely,
- Documentation/user/preface.itely,
- Documentation/user/introduction.itely,
- Documentation/user/tutorial.itely: Revised.
- Removing leading spaces which distorts output if info files are read
- with stand-alone info.
- Removing superfluous inter-word spaces which also distorts output
- for stand-alone info.
- Using ` and ' instead of `` and '' everywhere to improve
- legilibility with stand-alone info
- Using @samp for single-letter input items and data which contains
- spaces, @code for other things.
-
- * lily/grob-interface.cc: Adding copyright.
- (check_interfaces_for_property): Improve format of warning message.
-
-2004-04-03 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * lily/include/font-metric.hh (struct Font_metric): add
- design_size () method.
-
- * buildscripts/mf-to-table.py (base): add DesignSize comment.
-
- * lily/afm.cc (read_afm_file): read design size.
-
- * input/regression/repeat-unfold-tremolo.ly: add dotted case.
-
- * scm/music-functions.scm (unfold-repeats): handle dots too.
-
-2004-04-02 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * mf/GNUmakefile ($(outdir)/$(redhat-package)): fix URL.
- (backportme)
-
-2004-04-02 Jan Nieuwenhuizen <janneke@gnu.org>
-
- * input/wilhelmus.ly: Use raggedright. Hack `Een prin -- ce'
- lyric indent. Revert melismaBusyProperties using \unset.
-
-2004-04-02 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * input/regression/bar-check-redefine.ly (pipeSymbol): new file.
-
- * lily/parser.yy (command_element): allow redefinition of |
- meaning.
-
- * lily/break-align-engraver.cc (acknowledge_grob): construct
- LeftEdge where the first cause for alignment is coming from.
- This makes \override Staff.LeftEdge work as expected.
-
-
- * lily/slur-performer.cc (Slur_performer): add inits
-
- * lily/beam-performer.cc (Beam_performer): add inits
+ * scripts/convert-ly.py: backport of #'(markup).
2004-04-01 Han-Wen Nienhuys <hanwen@xs4all.nl>
note = {Describes a system called MusicEase, and explains that it
uses "constraints" (which go unexplained) to automatically position
various elements. },
- html={http://mesastate.edu/~grader/ieeeme.pdf},
+
year = {1996},
title = {Creating Printed Music Automatically},
author = {Gary M. Rader},
ul li { margin-top: 0.2em; }
td.left-column { padding-right: 1em; }
td.right-column { padding-left: 1em; }
- hr { border:0; height:1; color: #000000; background-color: #000000; }
</style>
</head>
<body>
@node Top, , ,
@top
-@unnumbered New features in 2.3 since 2.2
-
-@itemize @bullet
-
-@item A experimental GNOME output backend is available for developers.
-It depends on several unreleased softwares such as gnome-guile TLA and
-Pango CVS. The output interface coverage is sparse, but it already
-does support point-and-click on the GNOME Canvas. See also
-@file{scm/output-gnome.scm}.
-
-@item Context definitions are now stored in identifiers that match the
-context name, in other words, to modify a @code{Staff} context, the
-following code may be used.
-
-@example
-\context @{
- \Staff
- ..
-@}
-@end example
-
-@item A new block, @code{\bookpaper} has been introduced to
-hold settings for paper size and output scaling.
-
-@item Support for fret diagrams has been contributed by Carl
-D. Sorensen. @file{input/test/fret-diagram.ly} contains an example.
-
-@item The @code{--safe-mode} has been revisited: GUILE evaluation
-is done in the R5RS safe module, with only the basic @code{ly:}
-interface available and malicious @TeX{} code is stopped. However, to
-be reasonably safe, you are advised to use the PostScript backend
-rather than the @TeX{} backend anyway; and if possible use an UML
-sandbox to run gs or latex.
-
-@item Music syntax can now be extended seamlessly. As an example,
-here is the new implementation @code{\applymusic},
-
-@example
- applymusic = #(ly:make-music-function
- (list procedure? ly:music?) ; signature
- (lambda (where func music) ; the function
- (func music)))
-@end example
-
-@item @code{\apply} has been renamed to @code{\applymusic}.
-
-@item Music can be used as a markup.
-When inserting a @code{score} block as part of a @code{\markup}, it
-produces a rendered markup of the music. An example is in
-@file{input/test/markup-score.ly}.
-
-@item LilyPond expressions can be embedded into Scheme. The syntax for
-this is @code{#@{ ... #@}}. Within such a block, Scheme forms can be
-introduced using a @code{$} character (@code{$$} results in a single
-`$' character). These forms are then inserted in the pattern.
-
-@example
-#(define (textoffset dx dy)
- (ly:export
- #@{ \override Voice.TextScript #'extra-offset = #(cons $dx $dy) #@}))
-
-@{
- c'^"normal text"
- %% The following embedded scheme call is the same as
- %% \override Voice.TextScript #'extra-offset = #(cons 2 -3)
- #(textoffset 2 -3)
- c'^"text with offset"
-@}
-@end example
-
-@item A music list at toplevel is interpreted as implicit @code{\score}
-a @code{\score} block at toplevel is interpreted as an implicit
-@code{\book} and @code{\notes} mode is the default lexer mode. The
-result is that
-
-@example
-\header @{ title = "The Title" @}
-@{ a b c @}
-@end example
-
-is interpreted as
-
-@example
-\header @{ title = "The Title" @}
-\book @{
- \score @{
- \notes @{ a b c @}
- @}
-@}
-@end example
-
-This is handled by the function defined in
-@code{toplevel-music-handler}. Similarly, @code{\score} and
-@code{\book} are handled by @code{toplevel-score-handler} and a
-@code{toplevel-book-handler}. By changing these variables, different
-results can be obtained.
-
-
-@item Start pitch for @code{relative} music is optional for music lists.
-The default value is middle C.
-
-@c update-me? formal definition of newaddlyrics, once it works
-@item Combining lyrics with music can be done with @code{\newlyrics}
-
-@example
- \relative @{
- \clef bass
- d2 d c4 bes a2 \break
- @}
- \newlyrics @{
- My first Li -- ly song,
- @}
- \newlyrics @{
- Not much can go wrong!
- @}
-@end example
-
-Syntactically, @code{\newlyrics} acts like an infix operator.
-
-@item The parser is encapsulated in a Scheme function
-@code{ly:parse-file}, so the following fragment processes two files
-
-@verbatim
-#(ly:parse-file "another.ly")
-\score { \notes { c4 }}
-@end verbatim
-
-@item The @code{font-encoding} property can now be used to select
-differently encoded fonts. The previous default setting
-@code{TeX-text} has been replaced by latin1. LilyPond requires the
-@uref{http://www.lilypond.org/download/fonts/,ec-fonts-mftraced}
-package installed to function properly.
-
-@item The encoding of a file can be switched with
-@code{\encoding}. The strings for markup texts are translated
-automatically.
-
-@item The toplevel block @code{\book} introduces page layout.
-A @code{\book} groups @code{\score} blocks into one page layout
-entity. For example, two scores are combined in one book with
-
-@example
-\book @{
- \score @{ ... @}
- \score @{ ... @}
-@}
-@end example
-
-Titling and page breaks are handled by LilyPond. For automatic page
-breaking, two algorithms are available, the classic ragged pages (the
-default), and optimal page breaking.
-Page breaks may be inserted manually with
-@example
- \pageBreak
-@end example
-
-@item
-The @code{lilypond} program does not generate La@TeX{} titles or page
-layout. If you need La@TeX{} titles, you can use the
-@code{lilypond-book} program.
-
-@item There is now less of a noticeable ``hook'' at the end of a long slur.
-
-@item The meaning of the @code{|} in the input can be redefined, by
- assigning a music expression to @code{pipeSymbol}.
-
-@end itemize
@unnumbered New features in 2.2 since 2.0
@end itemize
-@unnumbered New features in 2.0 since 1.8
+@chapter New features in 2.0 since 1.8
@itemize
for simultaneous music.
To convert your files from <PITCHES> to <<PITCHES>>, use the script
-included in @file{buildscripts/convert-new-chords.py}.
+included in buildscripts/convert-new-chords.py
This change was introduced for the following reasons
# Viewawble with a recent Emacs, doing: M-x info out-www/lilypond.info
#info: $(INFO_FILES)
-
-# Cancel the special, non-image info generation rule that skips images:
-$(outdir)/%.info: $(outdir)/%.nexi
-
+ # Cancel the special, non-image info generation rule that skips images:
+ $(outdir)/%.info: $(outdir)/%.nexi
local-install-info: install-info info
-$(INSTALL) -d $(DESTDIR)$(package_infodir)
ifneq ($(patsubst %/local,%,$(DESTDIR)$(prefix)),/usr)
## builder or packager.
@echo "***"
@echo "For images in the INFO docs to work, do: "
- @echo " (cd $(package_infodir) && ln -sf ../../doc/lilypond/Documentation/user/out-www/*png .)"
+ @echo " (cd $(package_infodir) && ln -sf ../../doc/lilypond/$(TOPLEVEL_VERSION)/Documentation/user/out-www/*png .)"
@echo "or add something like that to the postinstall script."
@echo "***"
else
- (cd $(package_infodir) && ln -sf $(local_package_docdir)/Documentation/user/out-www/*png .)
+ @echo " (cd $(package_infodir) && ln -sf $(local_package_docdir)/Documentation/user/out-www/*png .)"
endif
local-uninstall-WWW:
$(builddir)/mf/$(outconfbase)/feta16list.ly:
$(MAKE) -C $(topdir)/mf
-$(outdir)/lilypond.texi: $(ITELY_FILES) $(ITEXI_FILES)
-$(outdir)/lilypond.nexi: $(ITELY_FILES) $(ITEXI_FILES)
+$(outdir)/lilypond.texi: $(ITELY_FILES) macros.itexi
+$(outdir)/lilypond.nexi: $(ITELY_FILES) macros.itexi
# Rules for the automatically generated documentation
# When cross-compiling, we don't have lilypond, so we fake
local-clean: local-delete
local-delete:
- -for i in $$(seq 0 9); do \
- for j in dvi eps eps.bbox eps.trans log png tex; do \
- rm -f $(outdir)/lily-$$i*$$j; \
- done; \
- done
+ -rm -f $(outdir)/lily-1*
-rm -f $(outdir)/*
@menu
* Scheme tutorial::
-* File structure::
* Interpretation contexts::
* Tuning output::
* Fonts::
* Text markup::
* Global layout::
+* Output details::
@end menu
@node Scheme tutorial
#'((1) (2))
@end example
-@node File structure
-@section File structure
-The following items may be present in a @file{.ly} file at toplevel
-
-@itemize @bullet
-@item An output definition, such as @code{\bookpaper}, @code{\midi}
-and @code{\paper}. Such a definition at toplevel changes the default
-settings for the block entered.
-
-@item An @code{\header} block. This sets the global header block. This
-is the block containing the definitions for book-wide settings, like
-composer, title, etc.
-
-@item An @code{\addquote} statement. See @ref{Quoting other voices}
-for more information.
-
-@item A @code{\score} block. This score will be formatted as a book
-containing a single movement.
-
-This behavior can be changed by setting the variable
-@code{toplevel-score-handler} at toplevel. The default handler is
-defined in the init file @file{scm/lily.scm}.
-
-
-@item A @code{\book} block formats the block
-
-This behavior can be changed by setting the variable
-@code{toplevel-book-handler} at toplevel. The default handler is
-defined in the init file @file{scm/lily.scm}.
-
-
-@item A compound music expression, such as
-@example
- @{ c'4 d' e'2 @}
-@end example
-
- This will format the piece as a book with a single movement.
-
-
-This behavior can be changed by setting the variable
-@code{toplevel-music-handler} at toplevel. The default handler is
-defined in the init file @file{scm/lily.scm}.
-
-@end itemize
-
-The following example shows three things which may be entered at
-toplevel
-@verbatim
- \paper {
- % movements are non-justified by default
- raggedright = ##t
- }
-
- \header {
- title = "Do-re-mi"
- }
-
- { c'4 d' e2 }
-@end verbatim
-
-
-At any point in a file, any of the following lexical instructions can
-be entered:
-
-@itemize @bullet
-@item @code{\version}
-@item @code{\include}
-@item @code{\encoding}
-@item @code{\renameinput}
-@end itemize
-
-
-
@node Interpretation contexts
@section Interpretation contexts
@menu
* Creating contexts::
-* Changing context properties on the fly::
+* Changing context properties on the fly ::
* Modifying context plug-ins::
* Layout tunings within contexts::
* Changing context default settings::
create them by hand. There are three commands which do this.
The easiest command is @code{\new}, and it also the quickest to type.
-It is prepended to a music expression, for example
-
-@cindex @code{\new}
-@cindex new contexts
-@cindex Context, creating
+It is prepended to a music expression, for example
@example
\new @var{type} @var{music expression}
>>
@end lilypond
-@cindex @code{\context}
-
Like @code{\new}, the @code{\context} command also directs a music
expression to a context object, but gives the context an extra name. The
syntax is
music = \notes { c4 c4 }
arts = \notes { s4-. s4-> }
\score {
- \notes \relative c'' << \new Staff \context Voice = "A" \music
+ \notes \relative c'' << \new Staff \context Voice = "A" \music
\context Voice = "A" \arts
>>
}
@end lilypond
-@cindex @code{\context}
-@cindex creating contexts
+
The third command for creating contexts is
@example
@node Changing context properties on the fly
@subsection Changing context properties on the fly
-@cindex properties
-@cindex @code{\set}
-@cindex changing properties
-
Each context can have different @emph{properties}, variables contained
in that context. They can be changed during the interpretation step.
This is achieved by inserting the @code{\set} command in the music,
`on-the-fly', during the music, so that the setting only affects the
second group of eighth notes.
-@cindex @code{\unset}
-
There is also an @code{\unset} command,
@quotation
@code{\set }@var{context}@code{.}@var{prop}
\paper @{
@dots{}
\context @{
- \Staff
+ \StaffContext
\set fontSize = #-2
\override Stem #'thickness
Here
@example
- \Staff
+ \StaffContext
@end example
@noindent
takes the existing definition @context{Staff} from the identifier
-@code{Staff}. This works analogously to other contexts.
+@code{StaffContext}. This works analogously to other contexts, so that
+the existing definition of @code{Voice} is in @code{\VoiceContext}.
The statements
@example
\override Stem #'transparent = ##t
\alias Voice
}
- \context { \Staff
+ \context { \StaffContext
\accepts "ImproVoice"
}}
\score { \notes \relative c'' {
@verbatim
\context {
- \Staff
+ \StaffContext
\accepts ImproVoice
}
@end verbatim
@dots{}
@}
\context @{
- \Staff
+ \StaffContext
\accepts "ImproVoice"
@}
@}
are.
We have been talking of `the' @code{Fingering} object, but actually it
-does not amount to much. The initialization file
+does not amount to much. The initialization file
@file{scm/define-grobs.scm} shows the soul of the `object',
@verbatim
notes. An elaborate example of those is in
@inputfileref{input/test,cue-notes.ly}.
-@cindex cue notes
@cindex @code{font-style}
@refcommands
flexible distances (``springs'') are chosen, based on durations. All
possible line breaking combination are tried, and the one with the
best results --- a layout that has uniform density and requires as
-little stretching or cramping as possible --- is chosen.
-
-After spacing and linebreaking, the systems are distributed across
-pages, taking into account the size of the page, and the size of the
-titles.
+little stretching or cramping as possible --- is chosen. When the score
+is processed by @TeX{}, each page is filled with systems, and page breaks
+are chosen whenever the page gets full.
* Vertical spacing::
* Horizontal spacing::
* Line breaking::
-* Line length and line breaking::
-* Titling::
-* Page breaking::
-* Paper size::
* Page layout::
@end menu
@example
\paper @{
\context @{
- \PianoStaff
+ \PianoStaffContext
\override VerticalAlignment #'forced-distance = #9
@}
@dots{}
created before any property commands are interpreted.
@example
\paper @{ \context @{
- \Score
+ \ScoreContext
\override SpacingSpanner #'spacing-increment = #3.0
@} @}
@end example
score, the part containing the longer durations will be spaced too
widely.
-There is no convenient mechanism to manually override spacing. The
-following work-around may be used to insert extra space into a score.
-@example
- \once \override Score.SeparationItem #'padding = #1
-@end example
+There is no convenient mechanism to manually override spacing.
-No work-around exists for decreasing the amount of space.
@menu
Internals: @internalsref{BreakEvent}.
-@node Line length and line breaking
-@subsection Line length and line breaking
+
+@node Page layout
+@subsection Page layout
@cindex page breaks
@cindex breaking pages
that line. The result is similar to formatting paragraphs. In a
paragraph, the last line simply takes its natural length.
+The page layout process happens outside the LilyPond formatting
+engine: variables controlling page layout are passed to the output,
+and are further interpreted by @code{lilypond} wrapper program. It
+responds to the following variables in the @code{\paper} block. The
+spacing between systems is controlled with @code{interscoreline}, its
+default is 16pt. The distance between the score lines will stretch in
+order to fill the full page @code{interscorelinefill} is set to a
+positive number. In that case @code{interscoreline} specifies the
+minimum spacing.
+
+@cindex @code{textheight}
+@cindex @code{interscoreline}
+@cindex @code{interscorelinefill}
+
+If the variable @code{lastpagefill} is defined,
+@c fixme: this should only be done if lastpagefill= #t
+systems are evenly distributed vertically on the last page. This
+might produce ugly results in case there are not enough systems on the
+last page. The @command{lilypond-book} command ignores
+@code{lastpagefill}. See @ref{lilypond-book manual} for more
+information.
+
+@cindex @code{lastpagefill}
+
+Page breaks are normally computed by @TeX{}, so they are not under
+direct control of LilyPond. However, you can insert commands into
+the @file{.tex} output to instruct @TeX{} where to break pages. This
+is done by setting the @code{between-systems-strings} on the
+@internalsref{NonMusicalPaperColumn} where the system is broken.
+An example is shown in @inputfileref{input/regression,between-systems.ly}.
+The predefined command @code{\newpage} also does this.
-@node Titling
-@subsection Titling
-
-Titles are created for each @code{\score} block, and over a
-@code{\book}.
+@cindex paper size
+@cindex page size
+@cindex @code{papersize}
-The contents of the titles are taken from the @code{\header} blocks.
-The header block for a book supports the following
-@table @code
-@item title
- The title of the music. Centered on top of the first page.
-@item subtitle
- Subtitle, centered below the title.
-@item poet
- Name of the poet, left flushed below the subtitle.
-@item composer
- Name of the composer, right flushed below the subtitle.
-@item meter
- Meter string, left flushed below the poet.
-@item opus
- Name of the opus, right flushed below the composer.
-@item arranger
- Name of the arranger, right flushed below the opus.
-@item instrument
- Name of the instrument, centered below the arranger.
-@item dedication
- To whom the piece is dedicated.
-@item piece
- Name of the piece, left flushed below the instrument.
-@end table
+To change the paper size, there are two commands,
+@example
+ #(set-default-paper-size "a4")
+ \paper@{
+ #(set-paper-size "a4")
+ @}
+@end example
+The second one sets the size of the @code{\paper} block that it's in.
-This is a demonstration of the fields available,
-
-@lilypond[verbatim]
-\book {
- \header {
- title = "Title"
- subtitle = "(and (the) subtitle)"
- subsubtitle = "Sub sub title"
- poet = "Poet"
- composer = "Composer"
- texttranslator = "Text Translator"
- meter = "Meter"
- arranger = "Arranger"
- instrument = "Instrument"
- piece = "Piece"
- }
+@refcommands
- \score {
- \header {
- piece = "piece1"
- opus = "opus1"
- }
- { c'1 }
- }
- \score {
- \header {
- piece = "piece2"
- opus = "opus2"
- }
- { c'1 }
- }
-}
-@end lilypond
+@cindex @code{\newpage}
+@code{\newpage}.
-Different fonts may be selected for each element, by using a
-@code{\markup}, e.g.
-@verbatim
- \header {
- title = \markup { \italic { The italic title } }
- }
-@end verbatim
+@seealso
-A more advanced option is to change the Scheme functions
-@code{make-book-title} and @code{make-score-title} functions, defined
-in the @code{\bookpaper} of the @code{\book} block. These functions
-create a block of titling, given the information in the
-@code{\header}. The init file @file{ly/titling.scm} shows how the
-default format is created, and it may be used as a template for
-different styles.
+In this manual: @ref{Invoking lilypond}.
-
+Examples: @inputfileref{input/regression,between-systems.ly}.
-@cindex header
-@cindex footer
-@cindex page layout
-@cindex titles
+Internals: @internalsref{NonMusicalPaperColumn}.
+@refbugs
+LilyPond has no concept of page layout, which makes it difficult to
+reliably choose page breaks in longer pieces.
-@node Page breaking
-@subsection Page breaking
-The default page breaking may be overriden by inserting
-@code{\pageBreak} or @code{\noPageBreak} commands. These commands are
-analogous to @code{\break} and @code{\noBreak}. They should be
-inserted with a bar line. These commands force and forbid a page-break
-from happening.
-Page breaks are computed by the @code{page-breaking} function in the
-@code{\bookpaper} block.
+@node Output details
+@section Output details
-@refcommands
+The default output format is La@TeX{}, which should be run
+through La@TeX{}. Using the option @option{-f}
+(or @option{--format}) other output formats can be selected also, but
+ none of them work reliably.
-@cindex @code{\pageBreak}
-@code{\pageBreak}
-@cindex @code{\noPageBreak}
-@code{\noPageBreak}
+Now the music is output system by system (a `system' is a single line
+from the score, consisting of staves belonging together). From
+@TeX{}'s point of view, a system is an @code{\hbox} which contains a
+lowered @code{\vbox} so that it is centered vertically on the baseline
+of the text. Between systems, @code{\interscoreline} is inserted
+vertically to have stretchable space. The horizontal dimension of the
+@code{\hbox} is given by the @code{linewidth} parameter from
+LilyPond's @code{\paper} block.
-@node Paper size
-@subsection Paper size
+After the last system LilyPond emits a stronger variant of
+@code{\interscoreline} only if the macro
+@code{\lilypondpaperlastpagefill} is not defined (flushing the systems
+to the top of the page). You can avoid that by setting the variable
+@code{lastpagefill} in LilyPond's @code{\paper} block.
-@cindex paper size
-@cindex page size
-@cindex @code{papersize}
+It is possible to fine-tune the vertical offset further by defining the
+macro @code{\lilypondscoreshift}:
-To change the paper size, there are two commands,
@example
- #(set-default-paper-size "a4")
- \paper@{
- #(set-paper-size "a4")
- @}
+\def\lilypondscoreshift@{0.25\baselineskip@}
@end example
-The second one sets the size of the @code{\paper} block that it is in.
-
-
-@node Page layout
-@subsection Page layout
-
-@cindex page layout
-@cindex margins
-@cindex header, page
-@cindex footer, page
-
-LilyPond will do page layout, setting margins and adding headers and
-footers to each page.
-The default layout responds to the following settings in the
-@code{\bookpaper} block
-
-@table @code
-@item hsize
- The width of the page
-@item vsize
- The height of the page
-@item top-margin
- Margin between header and top of the page
-@item bottom-margin
- Margin between footer and bottom of the page
-@item head-sep
- Distance between top-most music system and the page header
-@item foot-sep
- Distance between bottom-most music system and the page footer
-@item raggedbottom
- If set to true, systems will not be spread across the page.
-@item raggedlastbottom
- If set to true, systems will not be spread to fill the last page.
-@end table
-
-The default page header puts the page number and the @code{instrument}
-field from the @code{\header} block on a line.
-
-@cindex copyright
-@cindex tagline
-
-The default footer is empty, except for the first page, where it the
-@code{copyright} field from @code{\header} is inserted, and the last
-page, where @code{tagline} from @code{\header} is added. The default
-tagline is ``Engraved by LilyPond (@var{version})''.
+@noindent
+where @code{\baselineskip} is the distance from one text line to the next.
-The header and footer are created by the functions @code{make-footer}
-and @code{make-header}, defined in @code{\bookpaper}. The default
-implementations are in @file{scm/page-layout.scm}.
+Here an example how to embed a small LilyPond file @code{foo.ly} into
+running La@TeX{} text without using the @code{lilypond-book} script
+(@pxref{lilypond-book manual}):
-The page layout itself is done by two functions:
-@code{page-music-height} and @code{page-make-stencil}. The former
-tells the line-breaking algorithm how much space can be spent on a
-page, the latter creates the actual page given the system to put on it.
+@example
+\documentclass@{article@}
+\def\lilypondpaperlastpagefill@{@}
+\lineskip 5pt
+\def\lilypondscoreshift@{0.25\baselineskip@}
-@seealso
+\begin@{document@}
+This is running text which includes an example music file
+\input@{foo.tex@}
+right here.
+\end@{document@}
+@end example
-Examples: @inputfileref{input/test/,page-breaks.ly}
+The file @file{foo.tex} has been simply produced with
+@example
+ lilypond-bin foo.ly
+@end example
+The call to @code{\lineskip} assures that there is enough vertical space
+between the LilyPond box and the surrounding text lines.
@tab upstep
@tab
@lilypond[fragment,relative=2]
-\partial 8
-f8 c2 d e
+ \partial 8
+ f8 c2 d e
@end lilypond
@tab triplets
@tab
@lilypond[relative=1,fragment]
-\times 2/3 { f8 g a }
+ \times 2/3 { f8 g a }
@end lilypond
@tab grace notes
@tab
@lilypond[relative=2,fragment]
-\context Voice { \grace b16 c4 }
+\context Voice { \grace b16 c4 }
@end lilypond
@item @code{\lyrics @{ twinkle @}}
@tab
twinkle
@lilypond[fragment]
-\new Lyrics \lyrics { twinkle }
+\lyrics \new Lyrics { twinkle }
@end lilypond
@item @code{twin -- kle}
@tab lyric hyphen
@tab
@lilypond[fragment,relative=2]
-<<
- \notes { g'4 g }
- \lyricsto "" \new Lyrics \lyrics { twin -- kle }
->>
+ << \notes { g'4 g }
+ \lyricsto "" \new Lyrics \lyrics { twin -- kle }
+ >>
@end lilypond
@item @code{\chords @{ c:dim f:maj7 @}}
@tab chords
@tab
@lilypond[fragment,relative=2]
-\chords { c:dim f:maj7 }
+ \chords { c:dim f:maj7 }
@end lilypond
@item @code{\context ChordNames}
@tab printing chord names
@tab
@lilypond[fragment,relative=2]
-\context ChordNames \chords { c:dim f:maj7 }
+ \context ChordNames \chords { c:dim f:maj7 }
@end lilypond
@item @code{<<@{e f@} \\@{c d@}>>}
-@quotation
-We want to dedicate this program to all the friends that we
-met through music.
+@quotation
+ We would like to dedicate this program to all the friends that we
+ met through music.
-Han-Wen and Jan
+ Han-Wen and Jan
@end quotation
The images below illustrate the difference between traditional
engraving and typical computer output, and the third picture shows how
LilyPond mimics the traditional look. The left picture shows a scan
-of a flat symbol from a Henle edition published in 2000. The center
-depicts a symbol from a hand-engraved B@"{a}renreiter edition of the
+of a flat symbol from a Henle edition published in 2000. In the
+center show symbol from a hand engraved B@"{a}renreiter edition of the
same music. The left scan illustrates typical flaws of computer
print: the staff lines are thin, the weight of the flat symbol matches
the light lines and it has a straight layout with sharp corners. By
@c introduce illustrating aspects of engraving, spacing...
In spacing, the distribution of space should reflect the durations
between notes. However, many modern scores adhere to the durations
-with mathematical precision, which leads to poor results. In the
+with mathematical precision, which leads to a poor result. In the
next example a motive is printed twice. It is printed once using
exact mathematical spacing, and once with corrections. Can you
spot which fragment is which?
This is a common characteristic of typography. Layout should be
pretty, not only for its own sake, but especially because it helps the
reader in his task. For performance material like sheet music, this is
-of double importance: musicians have a limited amount of attention. The
+doubly important: musicians have a limited amount of attention. The
less attention they need for reading, the more they can focus on
playing itself. In other words, better typography translates to better
performances.
automatically, so manual overrides are less and less necessary.
When we started we wrote the LilyPond program entirely in the C++
-programming language; the program's functionality was set in stone by
+programming language, the program's functionality was set in stone by
the developers. That proved to be unsatisfactory for a number of
reasons:
@itemize @bullet
@item When LilyPond makes mistakes,
-users need to override formatting decisions. Therefore, the user must
-have access to the formatting engine. Hence, rules and settings cannot
-be fixed by us at compile time but must be accessible for users at
-run-time.
+ users need to override formatting decisions. Therefore, the user
+must access to the formatting engine. Hence, rules and settings cannot
+be fixed by us at compile time, but they must be accessible for users
+at run-time.
@item Engraving is a matter of visual judgment, and therefore a matter of
taste. As knowledgeable as we are, users can disagree with our
personal decisions. Therefore, the definitions of typographical style
must also be accessible to the user.
-@item Finally, we continually refine the formatting algorithms, so we
+@item Finally, we continually refine the formatting algorithms, so we
need a flexible approach to rules. The C++ language forces a certain
method of grouping rules that do not match well with how music
notation works.
+
@end itemize
These problems have been addressed by integrating the GUILE
Some variables have a preset value. For example, the thickness of many
lines---a characteristic of typographical style---are preset
-variables. Changing them gives a different typographical impression.
+variables. Changing them gives a different typographical impression
@lilypond[quote,raggedright]
fragment = \notes {
@end lilypond
Formatting rules are also preset variables: each object has variables
-containing procedures. These procedures perform the actual formatting,
+containing procedures. These procedure perform the actual formatting,
and by substituting different ones, we can change behavior. In the
-following example, the rule which note head objects use to produce
-their symbol is changed during the music fragment.
+following example, the rule that note head objects use to produce
+their symbol is changed during the music fragment
@lilypond[quote,raggedright]
#(define (mc-squared grob orig current)
Common music notation is a system of recording music that has evolved
over the past 1000 years. The form that is now in common use, dates
-from the early renaissance. Although the basic form (i.e., note heads on a
+from the early renaissance. Although, the basic form (i.e. note heads on a
5-line staff) has not changed, the details still change to express the
innovations of contemporary notation. Hence, it encompasses some 500
years of music. Its applications range from monophonic melodies to
How can we get a grip on such a many-headed beast, and force it into
the confines of a computer program? We have broken up the problem of
-notation (as opposed to engraving, i.e., typography) into digestible
+notation (as opposed to engraving, i.e. typography) into digestible
and programmable chunks: every type of symbol is handled by a separate
module, a so-called plug-in. Each plug-in is completely modular and
independent, so each can be developed and improved separately. People
-who translate musical ideas to graphic symbols are called copyists or
+that translate musical ideas to graphic symbols are called copyists or
engravers, so by analogy, each plug-in is called @code{engraver}.
In the following example, we see how we start out with a plug-in for
\topVoice
\paper {
\context {
- \Voice
+ \VoiceContext
\remove "Stem_engraver"
\remove "Phrasing_slur_engraver"
\remove "Slur_engraver"
\remove "Auto_beam_engraver"
}
\context {
- \Staff
+ \StaffContext
\remove "Accidental_engraver"
\remove "Key_engraver"
\remove "Clef_engraver"
\topVoice
\paper {
\context {
- \Voice
+ \VoiceContext
\remove "Stem_engraver"
\remove "Phrasing_slur_engraver"
\remove "Slur_engraver"
\remove "Auto_beam_engraver"
}
\context {
- \Staff
+ \StaffContext
\remove "Accidental_engraver"
\remove "Key_engraver"
\remove "Clef_engraver"
@end lilypond
@noindent
-the @code{Clef_engraver} defines a reference point for the staff
+The @code{Clef_engraver} defines a reference point for the staff
@lilypond[quote,raggedright]
\include "engraver-example.lyinc"
\topVoice
\paper {
\context {
- \Voice
+ \VoiceContext
\remove "Stem_engraver"
\remove "Phrasing_slur_engraver"
\remove "Slur_engraver"
\remove "Auto_beam_engraver"
}
\context {
- \Staff
+ \StaffContext
\remove "Accidental_engraver"
\remove "Key_engraver"
\remove "Bar_engraver"
@end lilypond
@noindent
-and the @code{Stem_engraver} adds stems.
+And the @code{Stem_engraver} adds stems
@lilypond[quote,raggedright]
\include "engraver-example.lyinc"
\topVoice
\paper {
\context {
- \Voice
+ \VoiceContext
\remove "Phrasing_slur_engraver"
\remove "Slur_engraver"
\remove "Script_engraver"
\remove "Auto_beam_engraver"
}
\context {
- \Staff
+ \StaffContext
\remove "Accidental_engraver"
\remove "Key_engraver"
\remove "Bar_engraver"
@end lilypond
In this situation, the accidentals and staff are shared, but the
-stems, slurs, beams, etc., are private to each voice. Hence, engravers
-should be grouped. The engravers for note heads, stems, slurs, etc., go
-into a group called `Voice context,' while the engravers for key,
-accidental, bar, etc., go into a group called `Staff context.' In the
+stems, slurs, beams, etc. are private to each voice. Hence, engravers
+should be grouped. The engravers for note heads, stems, slurs, etc. go
+into a group called ``Voice context,'' while the engravers for key,
+accidental, bar, etc. go into a group called ``Staff context.'' In the
case of polyphony, a single Staff context contains more than one Voice
context. In polyphonic notation, many voices can share a staff.
-Similarly, more Staff contexts can be put into a single Score context.
+Similarly, more Staff contexts can be put into a single Score context
@lilypond[quote,raggedright]
\include "engraver-example.lyinc"
The syntax is also the user-interface for LilyPond, hence it is easy
to type
-
@example
c'4 d'8
@end example
-
-@noindent
-a quarter note C1 (middle C) and an eighth note D1 (D above middle C)
-
+a quarter note C1 (middle C) and eighth note D1 (D above middle C)
@lilypond[quote,fragment]
c'4 d'8
@end lilypond
c4
@end lilypond
-@noindent
-Chords can be constructed with < and > enclosing the notes
+Combine this simultaneously with two other notes by enclosing in << and >>
@example
-<c d e>4
+<<c4 d4 e4>>
@end example
-
@lilypond[quote,fragment,relative=1]
-\new Voice { <c d e>4 }
+\new Voice { <<c4 d4 e4>> }
@end lilypond
-@noindent
This expression is put in sequence by enclosing it in curly braces
-@code{@{@tie{}@dots{}@tie{}@}}
+@code{@{ @dots{} @}}
@example
-@{ <c d e>4 f4 @}
+@{ <<c4 d4 e4>> f4 @}
@end example
@lilypond[quote,relative=1]
-\new Voice { <c d e>4 f4 }
+\new Voice { <<c4 d4 e4>> f4 }
@end lilypond
-
-@noindent
-The above is an expression also, and thus it may be combined again with
-another simultaneous expression (a half note) using <<, @code{\\}, and >>
+
+The above is another expression, and therefore, it many combined again
+with a simultaneous expression; in this case, a half note
@example
-<< g2 \\ @{ <c d e>4 f4 @} >>
+<< @{ <<c4 d4 e4>> f4 @} g2 >>
@end example
-
@lilypond[quote,fragment,relative=2]
\new Voice { << g2 \\ { <c d e>4 f4 } >> }
@end lilypond
+
Such recursive structures can be specified neatly and formally in a
context-free grammar. The parsing code is also generated from this
grammar. In other words, the syntax of LilyPond is clearly and
We have written LilyPond as an experiment of how to condense the art
of music engraving into a computer program. Thanks to all that hard
work, the program can now be used to perform useful tasks. The
-simplest application is printing notes.
+simplest application is printing notes
@lilypond[quote,relative=1]
\time 2/4 c4 c g'4 g a4 a g2
@end lilypond
@noindent
-By adding chord names and lyrics we obtain a lead sheet.
+By adding chord names and lyrics we obtain a lead sheet
@lilypond[quote,raggedright]
\score {
}
@end lilypond
+
Polyphonic notation and piano music can also be printed. The following
-example combines some more exotic constructs.
+example combines some more exotic constructs
@lilypondfile[quote,raggedright]{screech-boink.ly}
This manual also shows an application: the input format is text, and
can therefore be easily embedded in other text-based formats such as
-La@TeX{}, HTML, or in the case of this manual, Texinfo. By means of a
+La@TeX{}, HTML or in the case of this manual, Texinfo. By means of a
special program, the input fragments can be replaced by music images
in the resulting PostScript or HTML output files. This makes it easy
to mix music and text in documents.
@end ifhtml
@emph{@ref{Changing defaults}}
explains how to fine tune layout.
-
@item
@ifhtml
The chapter
The
@end ifhtml
@emph{@ref{Literature list}}
-contains a set of useful reference books, for those who wish to know
-more on notation and engraving.
+ contains a set of useful reference books, for those who wish to know
+ more on notation and engraving.
+
@end itemize
Once you are an experienced user, you can use the manual as reference:
@end ifhtml
The program reference is a set of heavily cross linked HTML pages,
-which document the nit-gritty details of each and every LilyPond
-class, object, and function. It is produced directly from the
+which documents the nit-gritty details of each and every LilyPond
+class, object and function. It is produced directly from the
formatting definitions used.
Almost all formatting functionality that is used internally, is
available directly to the user. For example, all variables that
-control thickness values, distances, etc., can be changed in input
+control thicknesses, distances, etc, can be changed in input
files. There are a huge number of formatting options, and all of them
are described in the generated documentation. Each section of the
notation manual has a @b{See also} subsection, which refers to the
have clickable links.
@item
-Templates
+ Templates
@ifhtml
(available @uref{../../../../input/template/out-www/collated-files.html,here})
@end ifhtml
After you have gone through the tutorial, you should be able to write
input files. In practice, writing files from scratch turns out to be
intimidating. To give you a head start, we have collected a number of
-often-used formats in example files; simply copy the template and add
-notes in the appropriate places.
+often-used formats in example files. These files can be used as a
+start; simply copy the template and add notes in the appropriate
+places.
@item
-Various input examples
+ Various input examples
@ifhtml
(available @uref{../../../../input/test/out-www/collated-files.html,here})
@end ifhtml
included.
@item
-The regression tests
+ The regression tests
@ifhtml
(available @uref{../../../../input/regression/out-www/collated-files.html,here})
@end ifhtml
LilyPond in one file. The collection is primarily there to help us
debug problems, but it can be instructive to see how we exercise the
program. The format is similar to the the tips and tricks document.
+
@end itemize
To have @code{lilypond} read from stdin, use a dash @code{-} for
@var{file}. The program supports the following options.
-@cindex stdin, reading
-
@table @code
@item -k,--keep
Keep the temporary directory with all output
files. The temporary directory is created in the current directory as @code{@code{lilypond}.dir}.
+@item -d,--dependencies
+ Write @code{Makefile} dependencies for every input file.
@item -h,--help
Print usage help.
@item -I,--include=@var{dir}
Add @var{key}= @var{val} to the settings, overriding those specified
in the files. Possible keys: @code{language}, @code{latexheaders},
@code{latexpackages}, @code{latexoptions}, @code{papersize},
-@code{linewidth}, @code{orientation},
+@code{pagenumber}, @code{linewidth}, @code{orientation},
@code{textheight}.
@item -v,--version
Show version information.
@strong{NO WARRANTY}!)
@end table
+@subsection Titling layout
+
+@code{lilypond} extracts the following header fields from the LY files
+to generate titling; an example demonstrating all these fields is in
+@inputfileref{input/test,lilypond-testpage.ly}:
+
+@table @code
+@item title
+ The title of the music. Centered on top of the first page.
+@item subtitle
+ Subtitle, centered below the title.
+@item poet
+ Name of the poet, left flushed below the subtitle.
+@item composer
+ Name of the composer, right flushed below the subtitle.
+@item meter
+ Meter string, left flushed below the poet.
+@item opus
+ Name of the opus, right flushed below the composer.
+@item arranger
+ Name of the arranger, right flushed below the opus.
+@item instrument
+ Name of the instrument, centered below the arranger.
+@item dedication
+ To whom the piece is dedicated.
+@item piece
+ Name of the piece, left flushed below the instrument.
+@item head
+ A text to print in the header of all pages. It is not called
+@code{header}, because @code{\header} is a reserved word in LilyPond.
+@item copyright
+ A text to print in the footer of the first page. Default is to
+ print the standard footer also on the first page. Note that if the
+ score consists of only a single page, the first page is also the
+ last page, and in this case, the tagline is printed instead of the
+ copyright.
+@item footer
+ A text to print in the footer of all but the last page.
+@item tagline
+ Line to print at the bottom of last page. The default text is ``Engraved
+by LilyPond @var{version-number}''.
+@end table
+
+
+@cindex header
+@cindex footer
+@cindex page layout
+@cindex titles
+
@subsection Additional parameters
@item latexheaders
Specify additional La@TeX{} headers file.
-<
+
Normally read from the @code{\header} block. Default value: empty.
@item latexpackages
@item papersize
The paper size (as a name, e.g. @code{a4}). It is normally read from
the @code{\paper} block.
+
+@item pagenumber
+ If set to @code{no}, no page numbers will be printed. If set to a
+positive integer, start with this value as the first page number.
+
-@item fontenc
+ @item fontenc
The font encoding, should be set identical to the @code{font-encoding}
property in the score.
@end table
block, then the rest of the scores will be output in numbered files,
starting with @file{filename-1.tex}. Several files can be specified;
they will each be processed independently. @footnote{The status of
-GUILE is not reset across invocations, so be careful not to change any
-system defaults from within Scheme.}
+ GUILE is not reset across invocations, so be careful not to change any
+ system defaults from within Scheme.}
+
+We strongly advise against making LilyPond formatting available
+through a web server. That is, processing input from untrusted users,
+and returning the resulting PDF file. LilyPond is a big and complex
+program. It was not written with security in mind. Making it available
+to the outside world is a huge risk; consider the security
+implications of
+
+@verbatim
+ #(system "rm -rf /")
+ \score {
+ c4^#(ly:export (ly:gulp-file "/etc/passwd"))
+ }
+@end verbatim
@section Command line options
@item -f,--format=@var{format}
@c
@c
-A comma separated list of output formats. Choices are @code{tex} (for
-@TeX{} output, to be processed with La@TeX{}, and @code{ps} for
-PostScript.
+Output format for sheet music. Choices are @code{tex} (for @TeX{}
+output, to be processed with plain @TeX{}, or through @code{lilypond}),
+@code{pdftex} for PDF@TeX{} input, @code{ps} (for PostScript),
+@code{scm} (for a Scheme dump), @code{sk} (for Sketch) and @code{as}
+(for ASCII-art).
-Other output options are intended for developers.
+@strong{This option is only for developers}. Only the @TeX{} output of
+these is usable for real work.
@cindex output format, setting
+@cindex Sketch output
+@cindex ASCII-art output
+@cindex PDFTeX output
@cindex PostScript output
@cindex Scheme dump
@cindex MIDI
Disable @TeX{} output. If you have a @code{\midi} definition MIDI output
will be generated.
+@item -M,--dependencies
+Output rules to be included in Makefile.
@item -o,--output=@var{FILE}
Set the default output file to @var{FILE}.
+@ignore
@item -s,--safe
-Do not trust the @code{.ly} input.
+Disallow untrusted @code{\include} directives, in-line
+Scheme evaluation, backslashes in @TeX{}, code.
-When LilyPond formatting available through a web server, the
-@code{--safe} @b{MUST} be passed. This will prevent code like
-
-@verbatim
- #(system "rm -rf /")
- \score {
- c4^#(ly:export (ly:gulp-file "/etc/passwd"))
- }
-@end verbatim
-
-The @code{--safe} option works by evaluating in-line Scheme
-expressions in a special safe module. This safe module is derived from
-GUILE @file{safe-r5rs} module, but adds a number of functions of the
-LilyPond API. These functions are listed in @file{safe-lily.scm}.
-
-In addition, @code{--safe} disallows @code{\include} directives and
-disables the use of backslashes in @TeX{} strings.
-
-In @code{--safe} mode, it is not possible to import LilyPond variables
-into Scheme.
+@strong{WARNING}: the @code{--safe} option has not been reviewed for a
+long time. Do not rely on it for automatic invocation (e.g. over the
+web). Volunteers are welcome to do a new audit.
+@end ignore
@item -v,--version
Show version information.
ignored. Sometimes, they come in such big quantities that they obscure
other output. In this case, file a bug-report.
-@item Aborted (core dumped)
-This signals a serious programming error that caused the program to
-crash. Such errors are considered critical. If you stumble on one,
-send a bugreport.
-
-
@end table
@cindex errors, message format
are also interpreted.
@cindex titling and lilypond-book
+@cindex lilypond-book and titling
@cindex @code{\header} in La@TeX{} documents
+The titling from the @code{\header} section of the fragments can be
+imported by adding the following to the top of the La@TeX{} file:
+
+@example
+\input titledefs.tex
+\def\preLilyPondExample@{\def\mustmakelilypondtitle@{@}@}
+@end example
The music will be surrounded by @code{\preLilyPondExample} and
@code{\postLilyPondExample}, which are defined to be empty by default.
HINTS FOR STYLE
-* Do not forget to create @cindex entries for new sections of text.
-
* Try not to use punctuation between introductocing sentence and
display material (verbatim, music, example code).
@vskip 20pt
-%% Not yet debugged or reported. This crashes gs-8.01:
-%% compiling gs-8.01 right now... -- jcn
+
@lilypond[raggedright]
\score {
\context Lyrics \notes {
}
}
@end lilypond
+
@end titlepage
@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.3.x series.
+This is the user manual for GNU LilyPond 2.2 series.
@ifhtml
(See the bottom of this page for the exact version number).
@end ifhtml
+
+@iftex
+@macro separate
+@c I want some space over here, not silly characters.
+@tex
+@end tex
+@end macro
+@end iftex
+
+@c \heartsf was supposed to be filled?
+
+@c center*** is broken?
+
+@ifinfo
+@macro separate
+
+@quotation
+@end quotation
+@end macro
+@end ifinfo
+
+@ifhtml
+@macro separate
+@html
+<p></p><br><br>
+@end html
+@end macro
+@end ifhtml
+
+
@c dup?
@ifhtml
@macro internalsref{NAME}
- \input texinfo @c -*-texinfo-*-
+\input texinfo @c -*-texinfo-*-
@settitle Music Glossary
@setfilename music-glosssary.info
@ifnottex
@node Top
-@top Music Glossary
+@top
@chapter Music Glossary
@menu
@end menu
@end ifnottex
@ifnottex
-@table @samp
+@table @code
@item Adrian Mariano
Italian glossary,
@item Bjoern Jacke
This is an example reference, that points you to the @aref{accent}
entry.
-@c All `@table @strong' replaced by `@table @samp'
-@c @strong{note xxx} breaks for info with makeinfo CVS <= 2004-04-26
+ @c @strong
@table @samp
@aitem{A}
FI: ambitus, @"a@"aniala, soitinala.
The term ambit (from latin: ambitus, plural: ambitus) denotes a range
-of pitches for a given voice in a part of music. It may also denote
+of pitches for a given voice in a part of music. It also may denote
the pitch range that a musical instrument is capable of playing.
@aitem{ancient minor scale}
S: ren mollskala,
FI: luonnollinen molliasteikko.
-@aref{diatonic scale} (ancient minor).
-
@lilypond[notime]
\set Score.automaticBars = ##f
\notes\relative c'' {
FI: appoggiatura, etuhele.
Ornamental note, usually a second, that is melodically connected with the main
-note following it. In music before the 19th century a. were usually
+note that follows it. In music before the 19th century a. were usually
performed on the beat, after that mostly before the beat. While the short
a. is performed as a short note regardless of the duration of the main note
the duration of the long a. is proportional to that of the main note.
1. A manuscript in the composer's own hand.
2. Music prepared for photoreproduction by freehand drawing,
-with the aid of a straightedge ruler and T-square only,
+with only the aid of a straightedge ruler and T-square,
which attempts to emulate engraving.
This required more skill than did engraving.
S: stegvis r@"orelse,
FI: asteittainen liike.
-Progressing melodically by intervals of a second. Opposite of @aref{disjunct movement}.
-
+Melody moving in the narrow steps of the scale.
@lilypond
\key g \major \time 4/4
}
\paper {
\context {
- \Staff
+ \StaffContext
\consists Custos_engraver
}
raggedright = ##t
NL: dal segno,
DK: dal segno,
S: dal segno,
-FI: dal segno, lähtien merkistä.
+FI: dal segno, merkkiin asti.
Abbreviated ``d.s.''. Repetition, not from the beginning, but from
another place frequently near the beginning marked by a sign:
%\override TextScript #'font-style = #'large
\override TextScript #'font-shape = #'italic
\key g \major \time 4/4
-\notes\relative c'' { d1 | g,4^\segno a b c | b a g2_\markup{ \line < "d.s. " \small \raise #1 \musicglyph #"scripts-segno" > } \bar "|." }
+\notes\relative c'' { d1 | g,4^\segno a b c | b a g2_"d.s." \bar "|." }
@end lilypond
@aitem{decrescendo}
2@w{ }@aref{semitone}s (S). Scales played on the white keys
of a piano keybord are diatonic.
-The church modes are used in gregorial chant and in pre baroque early music but
+The church modes are used in gregorial chant and pre baroque early music but
also to some extent in newer jazz music.
@lilypond[notime,linewidth=110\mm]
S: hoppande r@"orelse,
FI: melodian hyppiv@"a liike.
-Progressing melodically by intervals larger than a major second.
-Opposite of @aref{conjunct movement}.
+Melody moving in steps greater than those of the
+scale. Opposite of @aref{conjunct movement}.
@lilypond
\key a \major
The methodical use of fingers in the playing of instruments.
-@aitemii{flag,pennant}
+@aitem{flag,pennant}
ES: corchete,
I: coda (uncinata), bandiera,
F: crochet,
Letting the pitch slide fluently from one note to the other.
@aitem{grace notes}
-ES: ?,
+SP: ?,
I: abbellimenti,
F: fioriture,
D: Verzierungen, Vorschl@"age, Vorschlagsnoten,
@aref{note value}.
@aitem{half rest}
-ES: ?,
+SP: ?,
I: pausa di minima,
F: demi-pause,
UK: minim rest,
< g c >^"perfect" s
< g cis >^"augm" s
< g d' >^"perfect" s
- < g des' > ^"dimin" s
+ < g des' > ^"dim" s
< gis es' >^"dimin" s
< g! es' >^"minor" s
< g e'! >^"major" s
S: legato,
FI: legato, sitoen.
-To be performed (a) without any perceptible interruption between the notes,
-unlike (b) @emph{leggiero} or @emph{non-legato}, (c) @emph{portato}, and
+To be performed (a) without any perceptible interruption between the notes
+unlike (b) @emph{leggiero} or @emph{non-legato}, (c) @emph{portato} and
(d) @aref{staccato}.
@lilypond[notime]
NL: liedtekst,
DK: .,
S: .,
-FI, sanoitus.
+FI, sanoitus,
@aitem{major interval}
ES: intervalo mayor,
@aref{temperament} only a limited set of keys are playable.
Used for tuning keyboard instruments for performance of pre-1650 music.
-@aitemii{measure,bar}
+@aitem{measure, bar}
ES: comp@'as,
I: misura, battuta,
F: mesure,
@aitem{melodic cadence}
@aref{cadenza}.
-@aitemii{meter,time}
+@aitem{meter, time}
ES: comp@'as,
I: tempo, metro,
F: indication de m@'esure,
>>
@end lilypond
-Other frequently used ornaments are the @emph{turn}, the @emph{mordent}, and the
+Other frequently used ornaments are the @emph{turn}, the @emph{mordent} and the
@emph{prall} (inverted mordent).
@lilypond
NL: piano,
DK: piano,
S: piano,
-FI, piano, hiljaa.
+FI, piano, hiljaa,
@emph{piano} (@b{p}) soft, @emph{pianissimo} (@b{pp}) very soft,
@emph{mezzopiano} (@b{mp}) medium soft.
S: presto,
FI: presto, hyvin nopeasti.
-Very quick, i.e. quicker than @aref{allegro}; @emph{prestissimo}
+Very quick, i.e. quicker than @aref{allegro}. @emph{prestissimo}
denotes the highest possible degree of speed.
@aitem{Pythagorean comma}
A sequence of fifths starting on@w{ }C eventually circles back to@w{ }C,
but this@w{ }C, obtained by adding 12@w{ }fifths, is
-24 @aref{cent}s higher than the@w{ }C obtained by adding
+24@c{ }@aref{cent}s higher than the@w{ }C obtained by adding
7@w{ }octaves. The difference between those two pitches is called the
Pythagorean comma.
NL: rallentando,
DK: rallentando,
S: rallentando,
-FI. rallerdando, hidastuen.
+FI. rallerdando, hidastuen,
Abbreviation "rall.". @aref{ritardando}.
S: partitur,
FI: partituuri.
-A copy of orchestral, choral, or chamber music showing what each instrument is
+A copy of orchestral, choral or chamber music showing what each instrument is
to play, each voice to sing, having each part arranged one underneath the
other on different staves @aref{staff}.
}
@end lilypond
-@aitemii{staff,pl. staves}
+@aitem{staff}
ES: pentagrama,
I: pentagramma, rigo (musicale),
F: port@'ee,
S: notsystem,
FI: nuottiviivasto.
-A series of (normally@w{ }5) horizontal lines upon and between
+pl. staves. A series of (normally@w{ }5) horizontal lines upon and between
which the musical notes are written, thus indicating (in connection
with a @aref{clef}) their pitch. Staves for
@aref{percussion} instruments may have fewer lines.
NL: syntonische komma,
DK: syntonisk komma,
S: syntoniskt komma,
-FI: syntoninen komma, terssien taajuusero luonnollisessa ja Pytagorisessa viritysj@"arjestelm@"ass@"a.
+FI: syntoninen komma, terssin taajuusero luonnollisessa ja Pytagorisessa viritysj@"arjestelm@"ass@"a.
Difference between the natural third and the third obtained by Pythagorean
tuning (@aref{Pythagorean comma}), equal to 22@w{ }cents.
S: dubbelslag,
FI: korukuvio.
-@aref{ornament}.
+???
@aitem{unison}
ES: un@'{@dotless{i}}sono,
@end table
@page
-
+ @c @strong
@table @samp
@item DURATION NAMES, NOTES AND RESTS
@end table
@page
+ @c strong
@table @samp
@item PITCH NAMES
@end table
@end multitable
@
-
+ @c strong
@table @samp
@item ---------------------
Polyglottes W@"orterbuch der musikalischen Terminologie, Kassel 1980
Oxford Advanced Learner's Dictionary of Current English, Third Edition 1974.
-Webster's Revised Unabridged Dictionary, Springfield 1913.
-
@end table
@bye
formatting in polyphonic music easier. Rest collision testing will
leave these rests alone
-@cindex @code{\rest}
-
@lilypond[quote,raggedright,verbatim]
a'4\rest d'4\rest
@end lilypond
@cindex duration
-@cindex @code{\longa}
-@cindex @code{\breve}
-@cindex @code{\maxima}
In Note, Chord, and Lyrics mode, durations are designated by numbers
\paper {
raggedright = ##t
\context {
- \Staff
+ \StaffContext
\remove "Clef_engraver"
\override StaffSymbol #'transparent = ##t
\override TimeSignature #'transparent = ##t
@seealso
-User manual: @ref{Changing context properties on the fly} for the
-@code{\set} command.
-
-
Program reference: @internalsref{TupletBracket}, and @internalsref{TimeScaledMusic}.
Examples: @inputfileref{input/regression,tuplet-nest.ly}.
@cindex @code{\notes}
The pitch after the @code{\relative} contains a note name. To parse
-the note name as a pitch, it must be surrounded by @code{\notes}
+the note name as a pitch, it must surrounded by @code{\notes}
The relative conversion will not affect @code{\transpose},
@code{\chords} or @code{\relative} sections in its argument. If you
-There is also a syntax that is separate from the notes. The syntax
-
+There is also a syntax that is separate from the notes.
@example
\octave @var{pitch}
@end example
-This checks that @var{pitch} (without quotes) yields @var{pitch} (with
-quotes) in \relative mode. If not, a warning is printed, and the
+This checks that @var{pitch} (without octave) yields @var{pitch} (with
+octave) in \relative mode. If not, a warning is printed, and the
octave is corrected, for example, the first check is passed
successfully. The second check fails with an error message. The
octave is adjusted so the following notes are in the correct octave
speed up this process, you can use @code{skipTypesetting}, described
in the next section.
-It is also possible to redefine the meaning of @code{|}. This is done
-by assigning a music expression to @code{pipeSymbol},
-
-@lilypond
-pipeSymbol = \bar "||"
-
-\score {
- \notes { c'2 c'2 | c'2 c'2 | }
-}
-@end lilypond
-
-
@node Skipping corrected music
@subsection Skipping corrected music
}
\paper {
\context {
- \Staff
+ \StaffContext
\consists "Measure_grouping_engraver"
}
}
@node Unmetered music
@subsection Unmetered music
-@cindex @code{\bar}
-
Bar lines and bar numbers are calculated automatically. For unmetered
music (e.g. cadenzas), this is not desirable. By setting
@code{Score.timing} to false, this automatic timing can be switched
indicate where line breaks can occur.
+
@refcommands
@cindex @code{\cadenzaOn}
is to split chords using the separator @code{\\}. You can use it for
small, short-lived voices or for single chords
-@cindex @code{\\}
-
@lilypond[quote,verbatim,fragment]
\context Staff \relative c'' {
c4 << { f d e } \\ { b c2 } >>
c8 c4. } \\ { c2 c2 } >>
@end lilypond
-LilyPond also vertically shifts rests that are opposite of a stem,
-for example
+LilyPond also vertically shifts rests that are opposite of a stem
+
@lilypond[quote,raggedright,fragment,verbatim]
\context Voice << c''4 \\ r4 >>
@cindex auto-knee-gap
-@seealso
-
-User manual: @ref{Changing context properties on the fly} for the
-@code{\set} command
-
@refbugs
Automatically kneed cross-staff beams cannot be used together with
hidden staves.
-Beams do not avoid collisions with symbols around the notes, such as
-texts and accidentals.
}
\paper {
\context {
- \Staff \consists "Horizontal_bracket_engraver"
+ \StaffContext \consists "Horizontal_bracket_engraver"
}}}
@end lilypond
@example
\new Staff @{
- #(add-grace-property 'Voice 'Stem 'direction '())
+ #(add-grace-property "Voice" Stem direction '())
@dots{}
@}
@end example
patterns that divide the measure length are replaced by slashes
@lilypond[quote,verbatim,raggedright]
-\repeat "percent" 4 { c'4 }
-\repeat "percent" 2 { c'2 es'2 f'4 fis'4 g'4 c''4 }
+\context Voice { \repeat "percent" 4 { c'4 }
+ \repeat "percent" 2 { c'2 es'2 f'4 fis'4 g'4 c''4 }
+}
@end lilypond
@seealso
hihat hh bassdrum bd
@end example
@lilypond[quote,raggedright]
-\new DrumStaff \drums { hihat hh bassdrum bd }
+ \new DrumStaff \drums { hihat hh bassdrum bd
+ }
@end lilypond
The complete list of drum names is in the init file
the @internalsref{DrumVoices} are instantiated by hand first. For example,
@lilypond[quote,fragment,verbatim]
-\new DrumStaff <<
+\drums \new DrumStaff <<
\context DrumVoice = "1" { s1 *2 }
\context DrumVoice = "2" { s1 *2 }
- \drums {
+ {
bd4 sn4 bd4 sn4
<<
{ \repeat unfold 16 hh16 }
\paper {
%% need to do this, because of indented @itemize
linewidth= 9 \cm
- \context { \Score
+ \context { \ScoreContext
\override LyricText #'font-family = #'typewriter
\override BarNumber #'transparent =##T
}}}
@node Vocal music
@section Vocal music
-
-The easiest way to add lyrics to a melody, is by appending
-
-
-@cindex \newlyrics
-@example
- \newlyrics @{ @var{the lyrics} @}
-@end example
-
-to a melody. Here is an example,
-
-@lilypond[raggedright,verbatim]
- \relative { \time 3/4 c2 e4 g2. }
- \newlyrics { play the game }
-@end lilypond
-
-More stanzas can be added by adding more
-@code{\newlyrics} sections
-
-@lilypond[raggedright,verbatim]
- \relative { \time 3/4 c2 e4 g2. }
- \newlyrics { play the game }
- \newlyrics { speel het spel }
- \newlyrics { joue le jeu }
-@end lilypond
-
-The @code{\newlyrics} keyword has three functions: it interprets the
-following words as texts instead of notes, it sets up a context for
-printing texts (the @code{Lyrics} context), and it couples the melody
-with the lyrics, so the durations of both are aligned.
-
-These three functions can be controlled separately, and that is what
-the following sections are about.
+This section discusses how to enter and print lyrics.
@menu
-* Easy lyrics entry
* Entering lyrics::
* The Lyrics context::
* More stanzas::
@cindex punctuation
Lyrics are entered in a special input mode. This mode is is introduced
-by the keyword @code{\lyrics}. In this mode you can enter lyrics,
-with punctuation and accents without any hassle. Syllables are
-entered like notes, but with pitches replaced by text. For example,
+by the keyword @code{\lyrics}. In this mode you can enter lyrics, with
+punctuation and accents without any hassle. Syllables are entered like
+notes, but with pitches replaced by text. For example,
@example
\lyrics @{ Twin-4 kle4 twin- kle litt- le star2 @}
@end example
Any @code{_} character which appears in an unquoted word is converted
to a space. This provides a mechanism for introducing spaces into words
without using quotes. Quoted words can also be used in Lyrics mode to
-specify words that cannot be written with the above rules. The
-following example incorporates double quotes
+specify words that cannot be written with the above rules
@example
\lyrics @{ He said: "\"Let" my peo ple "go\"" @}
@end example
-
-This example is slightly academic, since it gives better looking
-results to use matched single quotes, @code{``} and @code{''}
+However, at least for english texts, you should use
@example
\lyrics @{ He said: ``Let my peo ple go'' @}
@end example
+to get the correct shape of the starting and ending quote.
@cindex hyphens
@node The Lyrics context
@subsection The Lyrics context
-
-@c TODO: document \newlyrics
-
Lyrics are printed by interpreting them in a @internalsref{Lyrics} context
@example
\context Lyrics \lyrics @dots{}
correct duration for each syllable. This is achieved by combining the
melody and the lyrics with the @code{\lyricsto} expression
@example
-\lyricsto @var{name} \new Lyrics \lyrics @dots{}
+\lyricsto @var{name} \new Lyrics @dots{}
@end example
This aligns the lyrics to the
@internalsref{Melisma_translator} in the program reference for more
information.
-Lyrics can also be entered without @code{\lyricsto}. In this case the
-durations of each syllable must be entered explicitly, for example,
-
-@verbatim
- play2 the4 game2.
- sink2 or4 swim2.
-@end verbatim
-
-Alignment to a melody can be specified with the @code{associatedVoice}
-property,
-
-@verbatim
- \set associatedVoice = #"melody"
-@end verbatim
-
-Here is an example demonstrating manual lyric durations,
-
-@lilypond[relative=1,verbatim,fragment]
-<< \context Voice = melody {
- \time 3/4
- c2 e4 g2.
- }
- \new Lyrics \lyrics {
- \set associatedVoice = #"melody"
- play2 the4 game2.
- } >>
-@end lilypond
-
-
-
-
When multiple stanzas are put on the same melody, it can happen that
two stanzas have melismata in different locations. This can be
remedied by switching off melismata for one
setting corresponding names for both contexts. The latter is explained
in @ref{More stanzas}.
-@c TODO: document \new Staff << Voice \lyricsto >> bug
-
@node More stanzas
@subsection More stanzas
\notes \relative c'' \context Voice = duet {
\time 3/4
g2 e4 a2 f4 g2. }
- <<
- \lyricsto "duet" \new Lyrics \lyrics {
+ \lyrics <<
+ \lyricsto "duet" \new Lyrics {
\set vocalName = "Bert"
Hi, my name is Bert. }
- \lyricsto "duet" \new Lyrics \lyrics {
+ \lyricsto "duet" \new Lyrics {
\set vocalName = "Ernie"
Ooooo, ch\'e -- ri, je t'aime. }
>>
<<
\context Voice = duet {
\time 3/4 g2 e4 a2 f4 g2. }
- \lyricsto "duet" \new Lyrics \lyrics {
+ \lyrics \lyricsto "duet" \new Lyrics {
\set stanza = "1. "
Hi, my name is Bert. }
>>
@example
\paper @{
\context @{
- \Voice
+ \VoiceContext
\consists Ambitus_engraver
@}
@}
>>
\paper {
\context {
- \Staff
+ \StaffContext
\consists Ambitus_engraver
}
}
@cindex @code{m}
Since an unaltered 11 does not sound good when combined with an
-unaltered 3, the 11 is removed in this case (unless it is added
+unaltered 13, the 11 is removed in this case (unless it is added
explicitly)
@c
@lilypond[quote,fragment,verbatim]
@example
\simultaneous @{
@var{the music}
- \applymusic #(remove-tag 'score) @var{the music}
- \applymusic #(remove-tag 'part) @var{the music}
+ \apply #(remove-tag 'score) @var{the music}
+ \apply #(remove-tag 'part) @var{the music}
@}
@end example
would yield
raggedright = ##t
interscoreline = 1
\context {
- \Score
+ \ScoreContext
\remove "Bar_number_engraver"
}
\context{
- \Staff
+ \StaffContext
\remove "Clef_engraver"
\remove "Key_engraver"
\remove "Time_signature_engraver"
indent = 0.0
raggedright = ##t
\context {
- \Staff
+ \StaffContext
\remove Staff_symbol_engraver
\remove Clef_engraver
\remove Time_signature_engraver
@example
\paper @{
\context @{
- \Staff
+ \StaffContext
\consists Custos_engraver
Custos \override #'style = #'mensural
@}
}
\paper {
\context {
- \Staff
+ \StaffContext
\consists Custos_engraver
}
}
@example
\paper @{
\context @{
- \Voice
+ \VoiceContext
\remove Ligature_bracket_engraver
\consists Mensural_ligature_engraver
@}
}
\paper {
\context {
- \Voice
+ \VoiceContext
\remove Ligature_bracket_engraver
\consists Mensural_ligature_engraver
}
\paper {
interscoreline = 1
\context {
- \Score
+ \ScoreContext
\remove "Bar_number_engraver"
}
\context {
- \Staff
+ \StaffContext
\remove "Clef_engraver"
\remove "Key_engraver"
\override StaffSymbol #'transparent = ##t
minimumVerticalExtent = ##f
}
\context {
- \Voice
+ \VoiceContext
\remove Ligature_bracket_engraver
\consists Vaticana_ligature_engraver
\override NoteHead #'style = #'vaticana_punctum
\paper {
interscoreline = 1
\context {
- \Score
+ \ScoreContext
\remove "Bar_number_engraver"
}
\context {
- \Staff
+ \StaffContext
\remove "Clef_engraver"
\remove "Key_engraver"
\override StaffSymbol #'transparent = ##t
minimumVerticalExtent = ##f
}
\context {
- \Voice
+ \VoiceContext
\remove Ligature_bracket_engraver
\consists Vaticana_ligature_engraver
\override NoteHead #'style = #'vaticana_punctum
\paper {
interscoreline = 1
\context {
- \Score
+ \ScoreContext
\remove "Bar_number_engraver"
}
\context {
- \Staff
+ \StaffContext
\remove "Clef_engraver"
\remove "Key_engraver"
\override StaffSymbol #'transparent = ##t
minimumVerticalExtent = ##f
}
\context {
- \Voice
+ \VoiceContext
\remove Ligature_bracket_engraver
\consists Vaticana_ligature_engraver
\override NoteHead #'style = #'vaticana_punctum
\paper {
interscoreline = 1
\context {
- \Score
+ \ScoreContext
\remove "Bar_number_engraver"
}
\context {
- \Staff
+ \StaffContext
\remove "Clef_engraver"
\remove "Key_engraver"
\override StaffSymbol #'transparent = ##t
minimumVerticalExtent = ##f
}
\context {
- \Voice
+ \VoiceContext
\remove Ligature_bracket_engraver
\consists Vaticana_ligature_engraver
\override NoteHead #'style = #'vaticana_punctum
\paper {
interscoreline = 1
\context {
- \Score
+ \ScoreContext
\remove "Bar_number_engraver"
}
\context {
- \Staff
+ \StaffContext
\remove "Clef_engraver"
\remove "Key_engraver"
\override StaffSymbol #'transparent = ##t
minimumVerticalExtent = ##f
}
\context {
- \Voice
+ \VoiceContext
\remove Ligature_bracket_engraver
\consists Vaticana_ligature_engraver
\override NoteHead #'style = #'vaticana_punctum
\paper {
interscoreline = 1
\context {
- \Score
+ \ScoreContext
\remove "Bar_number_engraver"
}
\context {
- \Staff
+ \StaffContext
\remove "Clef_engraver"
\remove "Key_engraver"
\override StaffSymbol #'transparent = ##t
minimumVerticalExtent = ##f
}
\context {
- \Voice
+ \VoiceContext
\remove Ligature_bracket_engraver
\consists Vaticana_ligature_engraver
\override NoteHead #'style = #'vaticana_punctum
\paper {
interscoreline = 1
\context {
- \Score
+ \ScoreContext
\remove "Bar_number_engraver"
}
\context {
- \Staff
+ \StaffContext
\remove "Clef_engraver"
\remove "Key_engraver"
\override StaffSymbol #'transparent = ##t
minimumVerticalExtent = ##f
}
\context {
- \Voice
+ \VoiceContext
\remove Ligature_bracket_engraver
\consists Vaticana_ligature_engraver
\override NoteHead #'style = #'vaticana_punctum
\paper {
interscoreline = 1
\context {
- \Score
+ \ScoreContext
\remove "Bar_number_engraver"
}
\context {
- \Staff
+ \StaffContext
\remove "Clef_engraver"
\remove "Key_engraver"
\override StaffSymbol #'transparent = ##t
minimumVerticalExtent = ##f
}
\context {
- \Voice
+ \VoiceContext
\remove Ligature_bracket_engraver
\consists Vaticana_ligature_engraver
\override NoteHead #'style = #'vaticana_punctum
\paper {
interscoreline = 1
\context {
- \Score
+ \ScoreContext
\remove "Bar_number_engraver"
}
\context {
- \Staff
+ \StaffContext
\remove "Clef_engraver"
\remove "Key_engraver"
\override StaffSymbol #'transparent = ##t
minimumVerticalExtent = ##f
}
\context {
- \Voice
+ \VoiceContext
\remove Ligature_bracket_engraver
\consists Vaticana_ligature_engraver
\override NoteHead #'style = #'vaticana_punctum
\paper {
interscoreline = 1
\context {
- \Score
+ \ScoreContext
\remove "Bar_number_engraver"
}
\context {
- \Staff
+ \StaffContext
\remove "Clef_engraver"
\remove "Key_engraver"
\override StaffSymbol #'transparent = ##t
minimumVerticalExtent = ##f
}
\context {
- \Voice
+ \VoiceContext
\remove Ligature_bracket_engraver
\consists Vaticana_ligature_engraver
\override NoteHead #'style = #'vaticana_punctum
\paper {
interscoreline = 1
\context {
- \Score
+ \ScoreContext
\remove "Bar_number_engraver"
}
\context {
- \Staff
+ \StaffContext
\remove "Clef_engraver"
\remove "Key_engraver"
\override StaffSymbol #'transparent = ##t
minimumVerticalExtent = ##f
}
\context {
- \Voice
+ \VoiceContext
\remove Ligature_bracket_engraver
\consists Vaticana_ligature_engraver
\override NoteHead #'style = #'vaticana_punctum
\paper {
interscoreline = 1
\context {
- \Score
+ \ScoreContext
\remove "Bar_number_engraver"
}
\context {
- \Staff
+ \StaffContext
\remove "Clef_engraver"
\remove "Key_engraver"
\override StaffSymbol #'transparent = ##t
minimumVerticalExtent = ##f
}
\context {
- \Voice
+ \VoiceContext
\remove Ligature_bracket_engraver
\consists Vaticana_ligature_engraver
\override NoteHead #'style = #'vaticana_punctum
\paper {
interscoreline = 1
\context {
- \Score
+ \ScoreContext
\remove "Bar_number_engraver"
}
\context {
- \Staff
+ \StaffContext
\remove "Clef_engraver"
\remove "Key_engraver"
\override StaffSymbol #'transparent = ##t
minimumVerticalExtent = ##f
}
\context {
- \Voice
+ \VoiceContext
\remove Ligature_bracket_engraver
\consists Vaticana_ligature_engraver
\override NoteHead #'style = #'vaticana_punctum
\paper {
interscoreline = 1
\context {
- \Score
+ \ScoreContext
\remove "Bar_number_engraver"
}
\context {
- \Staff
+ \StaffContext
\remove "Clef_engraver"
\remove "Key_engraver"
\override StaffSymbol #'transparent = ##t
minimumVerticalExtent = ##f
}
\context {
- \Voice
+ \VoiceContext
\remove Ligature_bracket_engraver
\consists Vaticana_ligature_engraver
\override NoteHead #'style = #'vaticana_punctum
\paper {
interscoreline = 1
\context {
- \Score
+ \ScoreContext
\remove "Bar_number_engraver"
}
\context {
- \Staff
+ \StaffContext
\remove "Clef_engraver"
\remove "Key_engraver"
\override StaffSymbol #'transparent = ##t
minimumVerticalExtent = ##f
}
\context {
- \Voice
+ \VoiceContext
\remove Ligature_bracket_engraver
\consists Vaticana_ligature_engraver
\override NoteHead #'style = #'vaticana_punctum
\paper {
interscoreline = 1
\context {
- \Score
+ \ScoreContext
\remove "Bar_number_engraver"
}
\context {
- \Staff
+ \StaffContext
\remove "Clef_engraver"
\remove "Key_engraver"
\override StaffSymbol #'transparent = ##t
minimumVerticalExtent = ##f
}
\context {
- \Voice
+ \VoiceContext
\remove Ligature_bracket_engraver
\consists Vaticana_ligature_engraver
\override NoteHead #'style = #'vaticana_punctum
\paper {
interscoreline = 1
\context {
- \Score
+ \ScoreContext
\remove "Bar_number_engraver"
}
\context {
- \Staff
+ \StaffContext
\remove "Clef_engraver"
\remove "Key_engraver"
\override StaffSymbol #'transparent = ##t
minimumVerticalExtent = ##f
}
\context {
- \Voice
+ \VoiceContext
\remove Ligature_bracket_engraver
\consists Vaticana_ligature_engraver
\override NoteHead #'style = #'vaticana_punctum
\paper {
interscoreline = 1
\context {
- \Score
+ \ScoreContext
\remove "Bar_number_engraver"
}
\context {
- \Staff
+ \StaffContext
\remove "Clef_engraver"
\remove "Key_engraver"
\override StaffSymbol #'transparent = ##t
minimumVerticalExtent = ##f
}
\context {
- \Voice
+ \VoiceContext
\remove Ligature_bracket_engraver
\consists Vaticana_ligature_engraver
\override NoteHead #'style = #'vaticana_punctum
\paper {
interscoreline = 1
\context {
- \Score
+ \ScoreContext
\remove "Bar_number_engraver"
}
\context {
- \Staff
+ \StaffContext
\remove "Clef_engraver"
\remove "Key_engraver"
\override StaffSymbol #'transparent = ##t
minimumVerticalExtent = ##f
}
\context {
- \Voice
+ \VoiceContext
\remove Ligature_bracket_engraver
\consists Vaticana_ligature_engraver
\override NoteHead #'style = #'vaticana_punctum
\paper {
interscoreline = 1
\context {
- \Score
+ \ScoreContext
\remove "Bar_number_engraver"
}
\context {
- \Staff
+ \StaffContext
\remove "Clef_engraver"
\remove "Key_engraver"
\override StaffSymbol #'transparent = ##t
minimumVerticalExtent = ##f
}
\context {
- \Voice
+ \VoiceContext
\remove Ligature_bracket_engraver
\consists Vaticana_ligature_engraver
\override NoteHead #'style = #'vaticana_punctum
\paper {
interscoreline = 1
\context {
- \Score
+ \ScoreContext
\remove "Bar_number_engraver"
}
\context {
- \Staff
+ \StaffContext
\remove "Clef_engraver"
\remove "Key_engraver"
\override StaffSymbol #'transparent = ##t
minimumVerticalExtent = ##f
}
\context {
- \Voice
+ \VoiceContext
\remove Ligature_bracket_engraver
\consists Vaticana_ligature_engraver
\override NoteHead #'style = #'vaticana_punctum
\paper {
interscoreline = 1
\context {
- \Score
+ \ScoreContext
\remove "Bar_number_engraver"
}
\context {
- \Staff
+ \StaffContext
\remove "Clef_engraver"
\remove "Key_engraver"
\override StaffSymbol #'transparent = ##t
minimumVerticalExtent = ##f
}
\context {
- \Voice
+ \VoiceContext
\remove Ligature_bracket_engraver
\consists Vaticana_ligature_engraver
\override NoteHead #'style = #'vaticana_punctum
\paper {
interscoreline = 1
\context {
- \Score
+ \ScoreContext
\remove "Bar_number_engraver"
}
\context {
- \Staff
+ \StaffContext
\remove "Clef_engraver"
\remove "Key_engraver"
\override StaffSymbol #'transparent = ##t
minimumVerticalExtent = ##f
}
\context {
- \Voice
+ \VoiceContext
\remove Ligature_bracket_engraver
\consists Vaticana_ligature_engraver
\override NoteHead #'style = #'vaticana_punctum
\paper {
interscoreline = 1
\context {
- \Score
+ \ScoreContext
\remove "Bar_number_engraver"
}
\context {
- \Staff
+ \StaffContext
\remove "Clef_engraver"
\remove "Key_engraver"
\override StaffSymbol #'transparent = ##t
minimumVerticalExtent = ##f
}
\context {
- \Voice
+ \VoiceContext
\remove Ligature_bracket_engraver
\consists Vaticana_ligature_engraver
\override NoteHead #'style = #'vaticana_punctum
\paper {
interscoreline = 1
\context {
- \Score
+ \ScoreContext
\remove "Bar_number_engraver"
}
\context {
- \Staff
+ \StaffContext
\remove "Clef_engraver"
\remove "Key_engraver"
\override StaffSymbol #'transparent = ##t
minimumVerticalExtent = ##f
}
\context {
- \Voice
+ \VoiceContext
\remove Ligature_bracket_engraver
\consists Vaticana_ligature_engraver
\override NoteHead #'style = #'vaticana_punctum
\paper {
interscoreline = 1
\context {
- \Score
+ \ScoreContext
\remove "Bar_number_engraver"
}
\context {
- \Staff
+ \StaffContext
\remove "Clef_engraver"
\remove "Key_engraver"
\override StaffSymbol #'transparent = ##t
minimumVerticalExtent = ##f
}
\context {
- \Voice
+ \VoiceContext
\remove Ligature_bracket_engraver
\consists Vaticana_ligature_engraver
\override NoteHead #'style = #'vaticana_punctum
\paper {
interscoreline = 1
\context {
- \Score
+ \ScoreContext
\remove "Bar_number_engraver"
}
\context {
- \Staff
+ \StaffContext
\remove "Clef_engraver"
\remove "Key_engraver"
\override StaffSymbol #'transparent = ##t
minimumVerticalExtent = ##f
}
\context {
- \Voice
+ \VoiceContext
\remove Ligature_bracket_engraver
\consists Vaticana_ligature_engraver
\override NoteHead #'style = #'vaticana_punctum
\paper {
interscoreline = 1
\context {
- \Score
+ \ScoreContext
\remove "Bar_number_engraver"
}
\context {
- \Staff
+ \StaffContext
\remove "Clef_engraver"
\remove "Key_engraver"
\override StaffSymbol #'transparent = ##t
minimumVerticalExtent = ##f
}
\context {
- \Voice
+ \VoiceContext
\remove Ligature_bracket_engraver
\consists Vaticana_ligature_engraver
\override NoteHead #'style = #'vaticana_punctum
\paper {
interscoreline = 1
\context {
- \Score
+ \ScoreContext
\remove "Bar_number_engraver"
}
\context {
- \Staff
+ \StaffContext
\remove "Clef_engraver"
\remove "Key_engraver"
\override StaffSymbol #'transparent = ##t
minimumVerticalExtent = ##f
}
\context {
- \Voice
+ \VoiceContext
\remove Ligature_bracket_engraver
\consists Vaticana_ligature_engraver
\override NoteHead #'style = #'vaticana_punctum
\paper {
interscoreline = 1
\context {
- \Score
+ \ScoreContext
\remove "Bar_number_engraver"
}
\context {
- \Staff
+ \StaffContext
\remove "Clef_engraver"
\remove "Key_engraver"
\override StaffSymbol #'transparent = ##t
minimumVerticalExtent = ##f
}
\context {
- \Voice
+ \VoiceContext
\remove Ligature_bracket_engraver
\consists Vaticana_ligature_engraver
\override NoteHead #'style = #'vaticana_punctum
\paper {
interscoreline = 1
\context {
- \Score
+ \ScoreContext
\remove "Bar_number_engraver"
}
\context {
- \Staff
+ \StaffContext
\remove "Clef_engraver"
\remove "Key_engraver"
\override StaffSymbol #'transparent = ##t
minimumVerticalExtent = ##f
}
\context {
- \Voice
+ \VoiceContext
\remove Ligature_bracket_engraver
\consists Vaticana_ligature_engraver
\override NoteHead #'style = #'vaticana_punctum
\paper {
interscoreline = 1
\context {
- \Score
+ \ScoreContext
\remove "Bar_number_engraver"
}
\context {
- \Staff
+ \StaffContext
\remove "Clef_engraver"
\remove "Key_engraver"
\override StaffSymbol #'transparent = ##t
minimumVerticalExtent = ##f
}
\context {
- \Voice
+ \VoiceContext
\remove Ligature_bracket_engraver
\consists Vaticana_ligature_engraver
\override NoteHead #'style = #'vaticana_punctum
\paper {
interscoreline = 1
\context {
- \Score
+ \ScoreContext
\remove "Bar_number_engraver"
}
\context {
- \Staff
+ \StaffContext
\remove "Clef_engraver"
\remove "Key_engraver"
\override StaffSymbol #'transparent = ##t
minimumVerticalExtent = ##f
}
\context {
- \Voice
+ \VoiceContext
\remove Ligature_bracket_engraver
\consists Vaticana_ligature_engraver
\override NoteHead #'style = #'vaticana_punctum
\paper {
interscoreline = 1
\context {
- \Score
+ \ScoreContext
\remove "Bar_number_engraver"
}
\context {
- \Staff
+ \StaffContext
\remove "Clef_engraver"
\remove "Key_engraver"
\override StaffSymbol #'transparent = ##t
minimumVerticalExtent = ##f
}
\context {
- \Voice
+ \VoiceContext
\remove Ligature_bracket_engraver
\consists Vaticana_ligature_engraver
\override NoteHead #'style = #'vaticana_punctum
\paper {
interscoreline = 1
\context {
- \Score
+ \ScoreContext
\remove "Bar_number_engraver"
}
\context {
- \Staff
+ \StaffContext
\remove "Clef_engraver"
\remove "Key_engraver"
\override StaffSymbol #'transparent = ##t
minimumVerticalExtent = ##f
}
\context {
- \Voice
+ \VoiceContext
\remove Ligature_bracket_engraver
\consists Vaticana_ligature_engraver
\override NoteHead #'style = #'vaticana_punctum
\paper {
interscoreline = 1
\context {
- \Score
+ \ScoreContext
\remove "Bar_number_engraver"
}
\context {
- \Staff
+ \StaffContext
\remove "Clef_engraver"
\remove "Key_engraver"
\override StaffSymbol #'transparent = ##t
minimumVerticalExtent = ##f
}
\context {
- \Voice
+ \VoiceContext
\remove Ligature_bracket_engraver
\consists Vaticana_ligature_engraver
\override NoteHead #'style = #'vaticana_punctum
\paper {
interscoreline = 1
\context {
- \Score
+ \ScoreContext
\remove "Bar_number_engraver"
}
\context {
- \Staff
+ \StaffContext
\remove "Clef_engraver"
\remove "Key_engraver"
\override StaffSymbol #'transparent = ##t
minimumVerticalExtent = ##f
}
\context {
- \Voice
+ \VoiceContext
\remove Ligature_bracket_engraver
\consists Vaticana_ligature_engraver
\override NoteHead #'style = #'vaticana_punctum
chords, e.g.
@c
@lilypond[quote,relative=2,verbatim]
-\applymusic #notes-to-clusters { <c e > <b f'> }
+\apply #notes-to-clusters { <c e > <b f'> }
@end lilypond
The following example (from
it is wonderful, and on some days it just does not work, but you keep
playing, day after day.
-Like making music, working on LilyPond can be dull work, and on
+Like making music, working on LilyPond is can be dull work, and on
some days it feels like plodding through a morass of bugs.
Nevertheless, it has become a part of our life, and we keep doing it.
Probably the most important motivation is that our program actually
-@c -*-texinfo-*-
@node Interfaces for programmers
@appendix Interfaces for programmers
@menu
* Programmer interfaces for input ::
-* Markup programmer interface::
-* Contexts for programmers::
+* Markup programmer interface::
+* Contexts for programmers::
@end menu
@node Programmer interfaces for input
@appendixsec Programmer interfaces for input
@menu
-* Input variables and Scheme::
+* Input variables and Scheme::
* Internal music representation::
-* Extending music syntax::
-* Manipulating music expressions::
-* Using LilyPond syntax inside Scheme::
+* Manipulating music expressions::
@end menu
@node Input variables and Scheme
\score @{ #(ly:export (make-sequential-music newLa)) @}
@end example
-@refbugs
-
-Mixing Scheme and lily identifiers is not possible with @code{--safe}.
@node Internal music representation
@appendixsubsec Internal music representation
@code{element}. The body of a repeat is in @code{element} property of
@internalsref{RepeatedMusic}, and the alternatives in @code{elements}.
-
-
-
-@node Extending music syntax
-@appendixsubsec Extending music syntax
-
-The syntax of composite music expressions, like
-@code{\repeat}, @code{\transpose} and @code{\context}
-follows the general form of
-
-@example
- \@code{keyword} @var{non-music-arguments} @var{music-arguments}
-@end example
-
-Such syntax can also be defined as user code. To do this, it is
-necessary to create a @emph{music function}. This is a specially marked
-Scheme function. For example, the music function @code{\applymusic} applies
-a user-defined function to a music expression. Its syntax is
-
-@example
-\applymusic #@var{func} @var{music}
-@end example
-
-A music function is created with @code{ly:make-music-function},
-
-@example
- (ly:make-music-function
-@end example
-
-@code{\applymusic} takes a Scheme function and a Music expression as
-argument. This is encoded in its first argument,
-
-@example
- (list procedure? ly:music?)
-@end example
-
-The function itself takes another argument, an Input location
-object. That object is used to provide error messages with file names
-and line numbers. The definition is the second argument of
-@code{ly:make-music-function}. The body is function simply calls the
-function
-
-@example
- (lambda (where func music)
- (func music))
-@end example
-
-The above Scheme code only defines the functionality. The tag
-@code{\applymusic} is selected by defining
-
-@example
- applymusic = #(ly:make-music-function
- (list procedure? ly:music?)
- (lambda (location func music)
- (func music)))
-@end example
-
-A @code{def-music-function} macro is introduced on top of
-@code{ly:make-music-function} to ease the definition of music
-functions:
-
-@example
- applymusic = #(def-music-function (location func music) (procedure? ly:music?)
- (func music))
-@end example
-
-Examples of the use of @code{\applymusic} are in the next section.
-
-@seealso
-@file{ly/music-functions-init.ly}.
-
@node Manipulating music expressions
@appendixsubsec Manipulating music expressions
Music objects and their properties can be accessed and manipulated
-directly, through the @code{\applymusic} mechanism.
-The syntax for @code{\applymusic} is
+directly, through the @code{\apply} mechanism.
+The syntax for @code{\apply} is
@example
-\applymusic #@var{func} @var{music}
+\apply #@var{func} @var{music}
@end example
@noindent
(ly:music-set-property! m 'elements (reverse
(ly:music-property m 'elements)))
m)
- \score { \notes \applymusic #rev-music-1 { c4 d4 } }
+ \score { \notes \apply #rev-music-1 { c4 d4 } }
@end lilypond
The use of such a function is very limited. The effect of this
multiple children. The following function application has no effect:
@example
- \applymusic #rev-music-1 \grace @{ c4 d4 @}
+ \apply #rev-music-1 \grace @{ c4 d4 @}
@end example
@noindent
In this case, @code{\grace} is stored as @internalsref{GraceMusic}, which has no
@code{elements}, only a single @code{element}. Every generally
-applicable function for @code{\applymusic} must -- like music expressions
+applicable function for @code{\apply} must -- like music expressions
themselves -- be recursive.
The following example is such a recursive function: It first extracts
\context Voice = "2" @{ \voiceTwo b @} >>
@end example
-Other applications of @code{\applymusic} are writing out repeats
+Other applications of @code{\apply} are writing out repeats
automatically (@inputfileref{input/test,unfold-all-repeats.ly}),
saving keystrokes (@inputfileref{input/test,music-box.ly}) and
exporting
@inputfileref{input/test,music-box.ly}.
-@node Using LilyPond syntax inside Scheme
-@appendixsubsec Using LilyPond syntax inside Scheme
-
-Creating music expressions in scheme can be tedious, as they are
-heavily nested and the resulting scheme code is large. For some
-simple tasks, this can be avoided, using LilyPond usual syntax inside
-scheme, with the dedicated @code{#@{ ... #@}} syntax.
-
-The following two expressions give equivalent music expressions:
-@example
- mynotes = @{ \override Stem #'thickness = #4
- \notes @{ c'8 d' @} @}
-
- #(define mynotes #@{ \override Stem #'thickness = #4
- \notes @{ c'8 d' @} #@})
-@end example
-
-The content of @code{#@{ ... #@}} is enclosed in an implicit @code{@{
-... @}} block, which is parsed. The resulting music expression, a
-@code{SequentialMusic} music object, is then returned and usable in scheme.
-
-Arbitrary scheme forms, including variables, can be used in @code{#@{ ... #@}}
-expressions with the @code{$} character (@code{$$} can be used to
-produce a single $ character). This makes the creation of simple
-functions straightforward. In the following example, a function
-setting the TextScript's padding is defined:
-
-@lilypond[verbatim,raggedright]
- #(use-modules (ice-9 optargs))
- #(define* (textpad padding #:optional once?)
- (ly:export ; this is necessary for using the expression
- ; directly inside a \notes block
- (if once?
- #{ \once \override TextScript #'padding = #$padding #}
- #{ \override TextScript #'padding = #$padding #})))
-
- \score {
- \notes {
- c'^"1"
- #(textpad 3.0 #t) % only once
- c'^"2"
- c'^"3"
- #(textpad 5.0)
- c'^"4"
- c'^"5"
-
- }
- }
-@end lilypond
-
-Here, the variable @code{padding} is a number; music expression
-variables may also be used in a similar fashion, as in the following
-example:
-
-@lilypond[verbatim,raggedright]
- #(define (with-padding padding)
- (lambda (music)
- #{ \override TextScript #'padding = #$padding
- $music
- \revert TextScript #'padding #}))
-
- \score {
- \notes {
- c'^"1"
- \applymusic #(with-padding 3)
- { c'^"2" c'^"3"}
- c'^"4"
- }
- }
-@end lilypond
-
-The function created by @code{(with-padding 3)} adds @code{\override} and
-@code{\revert} statements around the music given as an argument, and returns
-this new expression. Thus, this example is equivalent to:
-
-@example
- \score @{
- \notes @{
- c'^"1"
- @{ \override TextScript #'padding = #3
- @{ c'^"2" c'^"3"@}
- \revert TextScript #'padding
- @}
- c'^"4"
- @}
- @}
-@end example
-
-This function may also be defined as a music function:
-
-@lilypond[verbatim,raggedright]
- withPadding = #(def-music-function (location padding music) (number? ly:music?)
- #{ \override TextScript #'padding = #$padding
- $music
- \revert TextScript #'padding #})
-
- \score {
- \notes {
- c'^"1"
- \withPadding #3
- { c'^"2" c'^"3"}
- c'^"4"
- }
- }
-@end lilypond
-
@node Markup programmer interface
@appendixsec Markup programmer interface
@menu
* Markup construction in scheme::
-* Markup command definition::
+* Markup command definition::
@end menu
@node Markup construction in scheme
@menu
-* Context evaluation::
+* Context evaluation::
* Running a function on all layout objects::
@end menu
@node Context evaluation
@appendixsubsec Context evaluation
-@cindex calling code during interpreting
-@cindex @code{\applycontext}
-
Contexts can be modified during interpretation with Scheme code. The
syntax for this is
@example
@node Running a function on all layout objects
@appendixsubsec Running a function on all layout objects
-
-@cindex calling code on layout objects
-@cindex @code{\applyoutput}
-
-
The most versatile way of tuning an object is @code{\applyoutput}. Its
syntax is
@example
@c TODO:
@c * more details about running lilypond; error messages,
@c compiling/viewing (emacs?)
-@c * where to go from First steps+More basics?
+@c * where to go from First steps+More basics?
@c Your first LilyPond score in 10 minutes?
picture in the HTML version of this manual, you will see the exact
LilyPond input that was used to generate that image.
Try it on this image
-
@lilypond[quote,raggedright,relative=2]
-c-\markup { \bold \huge { Click here. } }
+ c-\markup { \bold \huge { Click here. } }
@end lilypond
@end ifhtml
* Printing lyrics::
* A lead sheet::
* Listening to output::
-* Adding titles::
+* Titling::
* Single staff polyphony::
* Piano staves::
* Organizing larger pieces::
a1 a2 a4 a16 a32
@end example
-@c FIXME: have NOTIME also remove Score.timing?
-@lilypond[quote,notime,relative=1]
+@lilypond[quote,notime]
\set Score.timing = ##f
\set Staff.autoBeaming = ##f
-{ a1 a2 a4 a16 a32 s16_" " }
+\transpose c c' { a1 a2 a4 a16 a32 s16_" " }
@end lilypond
If you do not specify a @rglos{duration}, the duration last entered is
-used for the next notes. The duration of the first note in input
-defaults to a quarter
+used; the duration of the first note defaults to a quarter
+@c FIXME: let's omit the first note rule?
+@c The first note will be a quarter
@example
a a8 a a2 a
@end example
-@lilypond[quote,notime,relative=1]
+@lilypond[quote,notime]
\set Score.timing = ##f
-{ a a8 a a2 a s16_" " }
+\transpose c c' { a a8 a a2 a s16_" " }
@end lilypond
-Rests are entered just like notes, but with the name @samp{r}
+Rests are entered just like notes, but with the name ``@code{r}''
@cindex rests
@example
r2 r4 r8 r16
@end example
-@lilypond[quote,notime]
+@lilypond[quote,fragment]
\set Score.timing = ##f
-r2 r4 r8 r16 s16_" "
+\set Staff.Clef = \turnOff
+\set Staff.TimeSignature = \turnOff
+r2 r4 r8 r16
+s16_" "
@end lilypond
+@separate
Add a dot @samp{.} after the duration to get a @rglos{dotted note}
a2. a4 a8. a16
@end example
-@lilypond[quote,notime,relative=1]
+@lilypond[quote,notime]
\set Score.timing = ##f
-{ a2. a4 a8. a16 s16_" " }
+\transpose c c' { a2. a4 a8. a16 s16_" " }
@end lilypond
The @rglos{meter} (or @rglos{time signature}) can be set with the
s16_" "
@end lilypond
-@ignore
-To recognize names like @samp{c} and @samp{d} as pitches, they have to
+To recognize names like @code{c} and @code{d} as pitches, they have to
be entered inside a so-called @code{\notes} block. This block is
formed by enclosing notes and commands are enclosed in curly braces
-@code{@{@tie{}@dots{}@tie{}@}} and adding the keyword @code{\notes} before
-the opening brace
+@code{@{ @dots{} @}} and adding the keyword @code{\notes} before the
+opening brace
@example
-@{
+\notes @{
\time 3/4
\clef bass
c2 e4 g2.
@}
@end example
-@noindent
and the music will be converted to printable output.
-@end ignore
-Remember to enclose the notes and commands in curly braces
-@code{@{@tie{}@dots{}@tie{}@}} to convert it to printable output.
-
-@lilypond[quote,noindent,linewidth=55\staffspace]
-{
- \time 3/4
- \clef bass
- c2 e4 g2.
- f4 e d c2 r4
+@lilypond[quote,noindent]
+\score {
+ \notes {
+ \time 3/4
+ \clef bass
+ c2 e4 g2.
+ f4 e d c2 r4
+ }
+ \paper {
+ linewidth = 55 * \staffspace
+ }
}
@end lilypond
+In many examples in this manual, both @code{\score} and @code{\notes}
+and accompanying braces are left out for brevity. However, they must
+be present when feeding the file to LilyPond.
+
For more elaborate information on
-@quotation
@table @asis
-@item Entering pitches and durations
+@item Entering pitches and durations
see
-@ref{Pitches}, and @ref{Durations}.
+@ref{Pitches} and @ref{Durations}.
@item Clefs
-see @ref{Clef}.
+see @ref{Clef}
@item Rests
see @ref{Rests}.
@item Time signatures and other timing commands
-see @ref{Time signature}.
-@end table
-@end quotation
+see @ref{Time signature}.
+@end table
@node Running LilyPond
@c commands to type?
@c
-@c We don't have enough space to explain either VIM
+@c We don't have enough space to explain either VIM
@c or Emacs non-advanced users, and I fear that both editors will only
@c confuse newbies. I vote for keeping the material in footnotes.
@c
Begin by opening a terminal window and starting a text editor. For
example, you could open an xterm and execute
-@code{joe}.@footnote{There are macro files for VIM addicts, and there
+@code{joe}@footnote{There are macro files for VIM addicts, and there
is a @code{LilyPond-mode} for Emacs addicts. If it has not been
installed already, refer to
@c FIXME lousy reference.
-the file @file{INSTALL.txt}.} In your text editor, enter the following
+the file @file{INSTALL.txt}}. In your text editor, enter the following
input and save the file as @file{test.ly}
@example
-@{ c'4 e' g' @}
+\score @{
+ \notes @{ c'4 e' g' @}
+@}
@end example
@noindent
To process @file{test.ly}, proceed as follows
+@noindent
@example
lilypond test.ly
@end example
You will see something resembling
@example
-lilypond (GNU LilyPond) 2.2.0
-Running lilypond-bin...
-Now processing `/home/fred/ly/test.ly'
+GNU LilyPond 1.8.0
+Now processing: `/home/fred/ly/test.ly'
Parsing...
Interpreting music...[1]
-@emph{... more interesting stuff ... }
-DVI output to `test.dvi'...
+ @emph{ ... more interesting stuff ... }
PDF output to `test.pdf'...
-PS output to `test.ps'...
+DVI output to `test.dvi'...
@end example
-
@cindex DVI file
@cindex Viewing music
@cindex xdvi
+
@noindent
The result is the file @file{test.pdf}@footnote{For @TeX{}
aficionados: there is also a @file{test.dvi} file. It can be viewed
On Windows, start up a text-editor@footnote{Any simple or
programmer-oriented editor will do, for example Notepad. Do not use a
-word processor, its formatting codes will confuse LilyPond.} and enter
+word processor, its formatting codes will confuse LilyPond} and enter
@example
-@{ c'4 e' g' @}
+\score @{
+ \notes @{ c'4 e' g' @}
+@}
@end example
Save it on the desktop as @file{test.ly} and make sure that it is not
A @rglos{sharp} (@texisharp{}) pitch is made by adding @samp{is} to
the name, a @rglos{flat} (@texiflat{}) pitch by adding @samp{es}. As
you might expect, a @rglos{double sharp} or @rglos{double flat} is
-made by adding @samp{isis} or @samp{eses}@footnote{This syntax
+made by adding @samp{isis} or @samp{eses}:@footnote{This syntax
derived from note naming conventions in Nordic and Germanic languages,
like German and Dutch.}
@end lilypond
@cindex key signature, setting
-The key signature is set with the command @code{\key}, followed by
+The key signature is set with the command ``@code{\key}'', followed by
a pitch and @code{\major} or @code{\minor}
-
@example
\key d \major
g1
g
@end example
-@lilypond[quote,notime,fragment]
+@lilypond[quote,fragment]
+\set Staff.TimeSignature = \turnOff
\key d \major
g'1
\key c \minor
g'
@end lilypond
-@noindent
+
Key signatures together with the pitches (including alterations) are
-used to determine when to print accidentals. This is a
+used together to determine when to print accidentals. This is a
feature that often causes confusion to newcomers, so let us explain it
-in more detail.
+in more detail
LilyPond makes a sharp distinction between musical content and
layout. The alteration (flat, natural or sharp) of a note is part of
the pitch, and is therefore musical content. Whether an accidental (a
-flat, natural or sharp @emph{sign}) is printed in front of the
+flat, natural or sharp @emph{sign}) is a printed in front of the
corresponding note is a question of layout. Layout is something that
follows rules, so accidentals are printed automatically according to
those rules. The pitches in your music are works of art, so they will
In this example
-@lilypond[quote,notime,fragment]
+@lilypond[quote,fragment]
+\set Staff.TimeSignature = \turnOff
\key d \major
d' cis' fis'
@end lilypond
@noindent
-no note gets an explicit accidental, but you still must enter
+no note gets an explicit accidental, but still you enter
@example
\key d \major
d cis fis
@end example
-@noindent
-The code @samp{d} does not mean `print a black dot just below the
-staff.' Rather, it means: `a note with pitch D-natural.' In the key
+The code @code{d} does not mean ``print a black dot just below the
+staff.'' Rather, it means: ``a note with pitch D-natural.'' In the key
of A-flat, it does get an accidental
-@lilypond[quote,notime,fragment]
+@lilypond[quote,fragment]
+\set Staff.TimeSignature = \turnOff
\key as \major
d'
@end lilypond
Adding all alterations explicitly might require a little more effort
when typing, but the advantage is that transposing is easier, and
music can be printed according to different conventions. See
-@ref{Accidentals}, for some examples how accidentals can be printed
+@ref{Accidentals} for some examples how accidentals can be printed
according to different rules.
For more information on
-
-@quotation
+
@table @asis
@item Accidentals
-see @ref{Accidentals}.
+see @ref{Accidentals}
@item Key signature
-see @ref{Key signature}.
+see @ref{Key signature}
@end table
-@end quotation
@node Entering ties
@section Entering ties
@cindex tie
-A tie is created by appending a tilde @samp{~} to the first note
+A tie is created by adding a tilde ``@code{~}'' to the first note
being tied
-
-@lilypond[quote,notime,fragment,verbatim,relative=3]
+@lilypond[quote,fragment,verbatim,relative=3]
g4~ g a2~ a4
@end lilypond
+@separate
+
-For more information on Ties see @ref{Ties}.
+For more information on Ties, see @ref{Ties}.
@lilypond[quote,fragment,relative=2,verbatim]
a8 ais d es r d
@end lilypond
+@separate
-@noindent
If you do not like where beams are put, they can be entered by
-hand. Mark the first note to be beamed with @samp{[} and the last one
-with @samp{]}.
+hand. Mark the first note to be beamed with @code{[} and the last one
+with @code{]}.
@lilypond[quote,fragment,relative=2,verbatim]
a8[ ais] d[ es r d]
@end lilypond
+@separate
For more information on beams, see @ref{Beaming}.
Here are key signatures, accidentals and ties in action
@example
-@{
- \time 4/4
- \key g \minor
- \clef violin
- r4 r8 a8 gis4 b
- a8 d4.~ d e8
- fis4 fis8 fis8 eis4 a8 gis~
- gis2 r2
+\score @{
+ \notes @{
+ \time 4/4
+ \key g \minor
+ \clef violin
+ r4 r8 a8 gis4 b
+ g8 d4.~ d e8
+ fis4 fis8 fis8 eis4 a8 gis~
+ gis2 r2
+ @}
@}
@end example
-
-@ignore
-FIXME
-ugr: removing the ignore block, leaving the comment line below
-@c TODO: use relative mode, verbatim, junk \transpose and above @example
-@end ignore
-
-
-@lilypond[quote,noindent,linewidth=50\staffspace]
-\transpose c c' {
- \time 4/4
- \key g \minor
- \clef violin
- r4 r8 a8 gis4 b
- a8 d4.~ d e8
- fis4 fis8 fis8 eis4 a8 gis~
- gis2 r2
+@lilypond[quote]
+\score {
+ \notes \transpose c c' {
+ \time 4/4
+ \key g \minor
+ \clef violin
+ r4 r8 a8 gis4 b
+ a8 d4.~ d e8
+ fis4 fis8 fis8 eis4 a8 gis~
+ gis2 r2
+ }
+ \paper { linewidth = #(* 50 staffspace) }
}
@end lilypond
-
@cindex accidentals
-
-@noindent
There are some interesting points to note in this example. Bar lines
and beams are drawn automatically. Line breaks are calculated
automatically; it does not matter where the line breaks are in the
@c better to have this just before the `octaves are bad' snipped
@c but we'd need to remove the ', from \key and tie
To raise a note by an octave, add a high quote @code{'} (apostrophe) to
-the note name, to lower a note one octave, add a `low quote' @code{,}
+the note name, to lower a note one octave, add a ``low quote'' @code{,}
(a comma). Middle C is @code{c'}
@example
c'4 c'' c''' \clef bass c c,
@end example
-@lilypond[quote,notime,fragment]
+@lilypond[quote,fragment]
+\set Score.timing = ##f
+\set Staff.TimeSignature = \turnOff
c'4 c'' c''' \clef bass c c,
@end lilypond
+@separate
An example of the use of quotes is in the following Mozart fragment
-
@lilypond[quote,raggedright,fragment,verbatim]
\key a \major
\time 6/8
b'8. cis''16 b'8 d''4 d''8
@end lilypond
-@noindent
-The last example shows that music in a high register needs lots of quotes.
+This example shows that music in a high register needs lots of quotes.
This makes the input less readable, and it is a source of errors. The
-solution is to use `relative octave' mode. In practice, this is the
+solution is to use ``relative octave'' mode. In practice, this is the
most convenient way to copy existing music. To use relative mode, add
-@code{\relative} before the piece of music.
-@ignore
-FIXME: move to notation manual?
- You must also give a note
-from which relative mode starts, in this case @code{c''}.
-@end ignore
-If you do not
-use octavation quotes (i.e., do not add @code{'} or @code{,} after a
+@code{\relative} before the piece of music. You must also give a note
+from which relative starts, in this case @code{c''}. If you do not
+use octavation quotes (i.e. do not add @code{'} or @code{,} after a
note), relative mode chooses the note that is closest to the previous
-one. For example, @samp{c f} goes up while @samp{c g} goes down
+one. For example, @code{c f} goes up while @code{c g} goes down
+
+@example
+\relative c'' @{
+ c f c g c
+@}
+@end example
-@lilypond[quote,notime,fragment,verbatim]
-\relative {
- c' f c g c
+@lilypond[quote,fragment]
+\set Score.timing = ##f
+\set Staff.TimeSignature = \turnOff
+\relative c'' {
+ c f c g c
}
@end lilypond
+@separate
Since most music has small intervals, pieces can be written almost
without octavation quotes in relative mode. The previous example is
entered as
-
+@c
@lilypond[quote,raggedright,fragment,verbatim]
-\relative {
+\relative c'' {
\key a \major
\time 6/8
- cis''8. d16 cis8 e4 e8
+ cis8. d16 cis8 e4 e8
b8. cis16 b8 d4 d8
}
@end lilypond
@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.
Larger intervals are made by adding octavation quotes.
+@example
+\relative c'' @{
+ c f, f c' c g' c,
+@}
+@end example
-@lilypond[quote,notime,verbatim,fragment]
-\relative c {
- c'' f, f c' c g' c,
+@lilypond[quote,fragment]
+\set Score.timing = ##f
+\set Staff.TimeSignature = \turnOff
+\relative c'' {
+ c f, f c' c g' c,
}
@end lilypond
+@separate
-In summary, quotes or commas no longer determine the absolute height
-of a note in @code{\relative} mode. Rather, the height of a note is
-relative to the previous one, and changing the octave of a single note
-shifts all following notes an octave up or down.
+In @code{\relative} mode, quotes or commas no longer determine the
+absolute height of a note. Rather, the height of a note is relative to
+the previous one, and changing the octave of a single note shifts all
+following notes an octave up or down.
-For more information on Relative octaves see @ref{Relative octaves},
+For more information on Relative octaves see @ref{Relative octaves}
and @ref{Octave check}.
Enclosing group of notes in braces creates a new music
expression
-
+
@lilypond[quote,verbatim,relative=3]
{ a4 g4 }
@end lilypond
This technique is useful for non-monophonic music. To enter music
with more voices or more staves, we also combine expressions in
parallel. Two voices that should play at the same time, are entered
-as a simultaneous combination of two sequences. A `simultaneous'
+as a simultaneous combination of two sequences. A ``simultaneous''
music expression is formed by enclosing expressions in @code{<<} and
@code{>>}. In the following example, three sequences (all containing
two notes) are combined simultaneously
-
+
@lilypond[quote,verbatim,relative=3]
<<
{ a4 g }
1
1 + 2
-
+
(1 + 2) * 3
-
+
((1 + 2) * 3) / (4 * 5)
@end example
-
@cindex expression
@cindex music expression
This example shows a sequence of expressions, where each expression is
contained in the next one. The simplest expressions are numbers and
-operators (like @samp{+}, @samp{*} and @samp{/}). Parentheses are used
-to group expressions.
+operators (like +, * and /). Parentheses are used to group
+expressions.
Like mathematical expressions, music expressions can be nested
-arbitrarily deep@footnote{The reason for getting three staves in the
-previous example but just a single staff in current one will be explained
-later.}
-
+arbitrarily deep, e.g.
@lilypond[quote,verbatim,relative=2]
{
c <<c e>>
@cindex indent
When spreading expressions over multiple lines, it is customary to use
an indent that indicates the nesting level. Formatting music like this
-eases reading, and helps you insert the right number of closing
+eases reading, and helps you insert the right number of closing
braces at the end of an expression. For example,
@example
-\book @{
- \score @{
- <<
- @{
- @dots{}
- @}
- @{
- @dots{}
- @}
- \paper @{
- @dots{}
- @}
- >>
- @}
-@}
+\score @{
+ \notes <<
+ @{
+ @dots{}
+ @}
+ @{
+ @dots{}
+ @}
+ >>
+@}
@end example
Some editors have special support for entering LilyPond, and can help
-indenting source files. See @ref{Editor support}, for more information.
+indenting source files. See @ref{Editor support} for more information.
+
+
@node More staves
@section More staves
To print more than one staff, each piece of music that makes up a
staff is marked by adding @code{\new Staff} before it. These
-@code{Staff} elements are then combined parallel with @code{<<} and
+@code{Staff}'s are then combined parallel with @code{<<} and
@code{>>}, as demonstrated here
@lilypond[quote,fragment,verbatim]
@end lilypond
-The command @code{\new} introduces a `notation context.' A notation
+The command @code{\new} introduces a ``notation context.'' A notation
context is an environment in which musical events (like notes or
@code{\clef} commands) are interpreted. For simple pieces, such
notation contexts are created implicitly. For more complex pieces, it
gets its own stave.
There are several types of contexts: @code{Staff}, @code{Voice} and
-@code{Score} handle normal music notation. Other contexts are also
+@code{Score} handle normal music notation. Other staves are also
@code{Lyrics} (for setting lyric texts) and @code{ChordNames} (for
printing chord names).
In terms of syntax, prepending @code{\new} to a music expression
creates a bigger music expression. In this way it resembles the minus
-sign in mathematics. The formula @math{(4+5)} is an expression, so
-@math{-(4+5)} is a bigger expression.
+sign in mathematics. The formula (4+5) is an expression, so -(4+5) is a bigger
+expression.
We can now typeset a melody with two staves
@c TODO: (c) status of this Paul McCartney (?) song (let's all stand together)
@lilypond[quote,verbatim,raggedright]
-<<
- \new Staff {
- \time 3/4
- \clef violin
- \relative {
- e''2 d4 c2 b4 a8[ a]
- b[ b] g[ g] a2. }
- }
- \new Staff {
- \clef bass
- c2 e4 g2.
- f4 e d c2.
- }
->>
+\score {
+ \notes <<
+ \new Staff {
+ \time 3/4
+ \clef violin
+ \relative c'' {
+ e2 d4 c2 b4 a8[ a]
+ b[ b] g[ g] a2. }
+ }
+ \new Staff {
+ \clef bass
+ c2 e4 g2.
+ f4 e d c2.
+ }
+ >>
+}
@end lilypond
For more information on context see the description in
@cindex accents
@cindex staccato
-Common accents can be added to a note using a dash (@samp{-}) and a
+Common accents can be added to a note using a dash (`@code{-}') and a
single character
-
@lilypond[quote,verbatim,relative=2]
c-. c-- c-> c-^ c-+ c-_
@end lilypond
+@separate
@cindex fingering
Similarly, fingering indications can be added to a note using a dash
-(@samp{-}) and the digit to be printed
-
+(`@code{-}') and the digit to be printed
+@c
@lilypond[quote,verbatim,relative=2]
-c-3 e-5 b-2 a-1
+ c-3 e-5 b-2 a-1
@end lilypond
Dynamic signs are made by adding the markings (with a backslash) to
the note
-
@lilypond[quote,verbatim,relative=2]
c\ff c\mf
@end lilypond
+@separate
@cindex dynamics
@cindex decrescendo
Crescendi and decrescendi are started with the commands @code{\<} and
@code{\>}. An ending dynamic, for example @code{\f}, will finish the
crescendo, or the command @code{\!} can be used
-
@lilypond[quote,verbatim,relative=2]
-c2\< c2\ff\> c2 c2\!
+c2\< c2\ff\> c2 c2\!
@end lilypond
+@separate
@cindex slur
A slur is a curve drawn across many notes, and indicates legato
-articulation. The starting note and ending note are marked with
-@samp{(} and @samp{)}, respectively
+articulation. The starting note and ending note are marked with a
+``@code{(}'' and a ``@code{)}'' respectively
@lilypond[quote,fragment,relative=2,verbatim]
d4( c16)( cis d e c cis d e)( d4)
@end lilypond
-
+@separate
@cindex slurs versus ties
A slur looks like a tie, but it has a different meaning. A tie simply
makes the first note sound longer, and can only be used on pairs of
@lilypond[quote,fragment,relative=2]
c2~( c8 fis fis4 ~ fis2 g2)
@end lilypond
-
@cindex phrasing slurs
Slurs to indicate phrasing can be entered with @code{\(} and
@code{\)}, so you can have both legato slurs and phrasing slurs at the
same time.
@lilypond[quote,fragment,relative=2,verbatim]
-a8(\( ais b c) cis2 b'2 a4 cis, c\)
+a8(\( ais b c) cis2 b'2 a4 cis, c\)
@end lilypond
For more information on
-
-@quotation
@table @asis
@item Fingering
-see @ref{Fingering instructions}.
+ see @ref{Fingering instructions}
@item Articulations
-see @ref{Articulations}.
+ see @ref{Articulations}
@item Slurs
-see @ref{Slurs}.
+ see @ref{Slurs}
@item Phrasing slurs
-see @ref{Phrasing slurs}.
+ see @ref{Phrasing slurs}
@item Dynamics
-see @ref{Dynamics}.
+ see @ref{Dynamics}
+@item Fingering
@end table
-@end quotation
-
@node Combining notes into chords
@section Combining notes into chords
@cindex chords
-Chords can be made by surrounding pitches with angle brackets.
-Angle brackets are the symbols @samp{<} and @samp{>}.
+Chords can be made by surrounding pitches with angled brackets.
+Angled brackets are the symbols @code{<} and @code{>}.
@lilypond[quote,relative=1,fragment,verbatim]
r4 <c e g>4 <c f a>8
@end lilypond
+@separate
You can combine markings like beams and ties with chords. They must
be placed outside the angled brackets
-
@lilypond[quote,relative=1,fragment,verbatim]
r4 <c e g>8[ <c f a>]~ <c f a>
@end lilypond
@example
-r4 <c e g>8\>( <c e g> <c e g> <c f a>8\!)
+r4 <c e g>8\>( <c e g> <c e g> <c f a>8\!)
@end example
-
@lilypond[quote,relative=1,fragment]
\slurUp
-r4 <c e g>8\>( <c e g> <c e g> <c f a>8\!)
+r4 <c e g>8\>( <c e g> <c e g> <c f a>8\!)
@end lilypond
+@separate
@node Basic rhythmical commands
-@section Basic rhythmical commands
+@section Basic rhythmical commands
@cindex pickup
@cindex anacruse
A pickup is entered with the keyword @code{\partial}. It
is followed by a duration: @code{\partial 4} is a quarter note upstep
and @code{\partial 8} an eighth note
-
@lilypond[quote,relative=2,verbatim,fragment]
\partial 8
f8 c2 d e
@end lilypond
-
@cindex tuplets
@cindex triplets
Tuplets are made with the @code{\times} keyword. It takes two
arguments: a fraction and a piece of music. The duration of the piece
of music is multiplied by the fraction. Triplets make notes occupy
-2/3 of their notated duration, so a triplet has 2/3 as its fraction
-
+2/3 of their notated duration, so a triplet has 2/3 as its fraction
+@c
@lilypond[quote,relative=1,verbatim,fragment]
\times 2/3 { f8 g a }
\times 2/3 { c r c }
@end lilypond
-
@cindex grace notes
@cindex accacciatura
Grace notes are also made by prefixing a music expression with the
keyword @code{\appoggiatura} or @code{\acciaccatura}
@cindex appoggiatura
@cindex acciaccatura
-
+
@lilypond[quote,relative=2,verbatim,fragment]
c4 \appoggiatura b16 c4
c4 \acciaccatura b16 c4
@noindent
For more information on
-
-@quotation
@table @asis
-@item Grace notes
+@item Grace notes
see @ref{Grace notes},
@item Tuplets
see @ref{Tuplets},
@item Pickups
see @ref{Partial measures}.
@end table
-@end quotation
+
@node Commenting input files
@cindex comments
@cindex line comment
@cindex block comment
-A comment is a remark for the human reader of the music input; it is
+A comment is a remark for the human reader of the music input, it is
ignored and has no effect on the printed output. There are two types
-of comments. The percent symbol @samp{%} introduces a line comment;
+of comments. The percent symbol @code{%} introduces a line comment;
the rest of the line is ignored. A block comments marks a whole
-section of music input---anything that is enclosed in @code{%@{} and
+section of music input, anything that is enclosed in @code{%@{} and
@code{%@}} is ignored. The following fragment shows possible uses for
comments
@example
% notes for twinkle twinkle follow
-c4 c g' g a a
-
+c4 c g' g a a
+
%@{
This line, and the notes below
are ignored, since they are in a
%@}
@end example
-There is a special statement that really is a kind of comment. The
+There is a special statement that really is a kind of comment. The
version statement marks for which version of LilyPond the file was
-written. To mark a file for version 2.1.17, use
+written. To mark a file for version 2.1.17, use
@example
\version "2.1.17"
@end example
-@noindent
These annotations make future upgrades of LilyPond go more
smoothly. Changes in the syntax are handled with a special program,
@file{convert-ly} (see @ref{Invoking convert-ly}), and it uses
@cindex Lyrics
@cindex Songs
-Lyrics are entered by separating each syllable with a space
+Lyrics are entered by separating each syllable with a space,
@example
-I want to break free
+ I want to break free
@end example
-Consider the melody
+To prevent certain words (for example ``as'') as being read as a
+pitch, the input-mode must be switched. This is done with
+@code{\lyrics}. In @code{\lyrics} mode, all words are read as lyric
+syllables.
+@example
+ \lyrics @{ I want to break free @}
+@end example
-@lilypond[quote,verbatim,fragment,raggedright]
-\relative {
- r4 c \times 2/3 { f g g }
- \times 2/3 { g4( a2) }
-}
+@noindent
+Again, the braces @code{@{@}} signify that the syllables are sung in
+sequence.
+
+By default, music expressions are interpreted in @code{Staff} context. For
+lyrics, this is obviously not desirable, so it is necessary
+to explicitly specify a @code{Lyrics} context,
+
+@example
+\new Lyrics \lyrics @{ I want to break free @}
+@end example
+
+The melody for this song is as follows
+
+@lilypond[quote,fragment,relative=2]
+c4
+\times 2/3 { f4 g g } \times 2/3 { g4( a2) }
@end lilypond
-@c FIXME: when/how/to what rename newlyrics?
The lyrics can be set to these notes, combining both with the
-@code{\newlyrics} keyword
+@code{\lyricsto} keyword
+@example
+ \lyricsto "@var{name}" \new Lyrics @dots{}
+@end example
+where @var{name} identifies to which melody the lyrics should be
+aligned. In this case, there is only one melody, so we can leave it
+empty.
+The final result is
@lilypond[quote,verbatim,fragment,raggedright]
-<<
- \relative {
- r4 c \times 2/3 { f g g }
- \times 2/3 { g4( a2) }
- }
- \newlyrics { I want to break free }
->>
+\score {
+ \notes <<
+ \partial 4
+ \relative c' {
+ c4
+ \times 2/3 { f g g } \times 2/3 { g4( a2) }
+ }
+ \lyricsto "" \new Lyrics \lyrics { I want to break free }
+ >>
+}
@end lilypond
@cindex melisma
@cindex extender line
@c synonyms?
-This melody ends on a @rglos{melisma}, a single syllable (`free')
+This melody ends on a @rglos{melisma}, a single syllable (``free'')
sung to more than one note. This is indicated with an @emph{extender
-line}. It is entered as two underscores, i.e.,
-
+line}. It is entered as two underscores, i.e.
@example
-@{ I want to break free __ @}
+\lyrics @{ I want to break free __ @}
@end example
-
@lilypond[quote,raggedright]
-<<
- \relative {
- r4 c \times 2/3 { f g g }
- \times 2/3 { g4( a2) }
- }
- \newlyrics { I want to break free __ }
->>
+\score {
+ <<
+ \notes \relative c' \new Voice {
+ \partial 8
+ c8
+ \times 2/3 { f g g } \times 2/3 { g4( a2) }
+ }
+ \lyricsto "" \new Lyrics \lyrics { I want to break free __ }
+ >>
+}
@end lilypond
Similarly, hyphens between words can be entered as two dashes,
resulting in a centered hyphen between two syllables
-
@example
Twin -- kle twin -- kle
@end example
-
@lilypond[quote,raggedright]
-<<
- \relative {
- \time 2/4
- f4 f c' c
- }
- \newlyrics { Twin -- kle twin -- kle }
->>
+\score {
+ <<
+ \notes \relative f' \context Voice = bla {
+ \time 2/4
+ f4 f c' c'
+ }
+ \new Lyrics \lyrics \lyricsto "bla" { Twin -- kle twin -- kle }
+ >>
+}
@end lilypond
More options, like putting multiple lines of lyrics below a melody are
discussed in @ref{Vocal music}.
-@c FIXME: too geeky, for notation manual?
-@c or introduce using foo = \lyrics { a b c } ?
-
-When using variables for a piece of lyrics
-To prevent certain words (for example `as') as being read as a
-pitch, the input-mode must be switched. This is done with
-@code{\lyrics}. In @code{\lyrics} mode, all words are read as lyric
-syllables.
-
-@example
-myText = \lyrics @{ I want to break free @}
-@end example
-
-@noindent
-The braces @code{@{@}} signify that the syllables are sung in
-sequence.
-
-@ignore
-By default, music expressions are interpreted in @code{Staff} context. For
-lyrics, this is obviously not desirable, so it is necessary
-to explicitly specify a @code{Lyrics} context,
-
-@example
-\lyrics @{ I want to break free @}
-@end example
-
-The melody for this song is as follows
-
-@lilypond[quote,fragment,relative=2]
-r4 c \times 2/3 { f4 g g }
-\times 2/3 { g4( a2) }
-@end lilypond
-
-@end ignore
@node A lead sheet
@cindex Lead sheets
@cindex chords
@cindex chord names
-
-In popular music, it is common to denote accompaniment as chord names.
-Such chords can be entered like notes,
+
+In popular music, it is common to denote accompaniment as chord-names.
+Such chords can be entered like notes,
@example
c2 f4. g8
This mode is switched on with @code{\chords}
@lilypond[quote,verbatim,raggedright]
-\chords { c2 f4. g8 }
+\score {
+ \chords { c2 f4. g8 }
+}
@end lilypond
Other chords can be created by adding modifiers after a colon. The
following example shows a few common modifiers
-
+@c
@lilypond[quote,verbatim]
\chords { c2 f4:m g4:maj7 gis1:dim7 }
@end lilypond
context
@lilypond[quote,verbatim]
-\new ChordNames \chords { c2 f4.:m g4.:maj7 gis8:dim7 }
+ \new ChordNames \chords { c2 f4.:m g4.:maj7 gis8:dim7 }
@end lilypond
@cindex lead sheet
-When put together, chord names, lyrics and a melody form
+@separate
+When put together, chord names, lyrics and a melody form
a lead sheet, for example,
@example
-<<
- \new ChordNames \chords @{ @emph{chords} @}
- @emph{the melody}
- \newlyrics @{ @emph{the text} @}
->>
+\score @{
+ <<
+ \new ChordNames \chords @{ @emph{chords} @}
+ \notes @emph{the melody}
+ \lyricsto "" \new Lyrics \lyrics @{ @emph{the text} @}
+ >>
@}
@end example
-
@lilypond[quote,raggedright]
-<<
- \new ChordNames \chords { r2 c:sus4 f }
- \notes \relative {
- r4 c' \times 2/3 { f g g }
- \times 2/3 { g4( a2) }
- }
- \newlyrics { I want to break free __ }
->>
+\score {
+ <<
+ \partial 4
+ \new ChordNames \chords { r8 c2:sus4 f }
+ \notes \relative c' {
+ c4
+ \times 2/3 { f g g } \times 2/3 { g4( a2) }
+ }
+ \new Lyrics \lyricsto "" \lyrics { I want to break free __ }
+ >>
+}
@end lilypond
+
A complete list of modifiers and other options for layout can be found
in @ref{Chords}.
-@c FIXME: we talk about \midi before mentioning \paper (or \layout?)
@node Listening to output
@section Listening to output
connecting and controlling digital instruments. A MIDI file is like a
tape recording of a MIDI instrument.
-To create a MIDI from a music piece of music, add a @code{\midi}
-block. This causes LilyPond to create a MIDI file, so you can listen
-to what you just entered. It is great for checking the music.
-Octaves that are off or accidentals that were mistyped stand out very
-much when listening to the musical transcription.
+To create a MIDI from a music piece of music, add a
+@code{\midi} block causes LilyPond to create a MIDI file, so you
+can listen to the music you entered. It is great for checking the
+music: octaves that are off or accidentals that were mistyped stand
+out very much when listening to the musical transcription.
The @code{\midi} block is added to @code{\score}, for example,
-
@example
\score @{
- @var{...music...}
- \midi @{ \tempo 4=72 @}
+ @var{..music..}
+ \midi @{ \tempo 4=72 @}
@}
@end example
Here, the tempo is specified using the @code{\tempo} command. In this
case the tempo of quarter notes is set to 72 beats per minute. More
-information on auditory output in the notation manual can be found in
-@ref{Sound}.
+information on auditory output in the notation manual, @ref{Sound}.
If there is a @code{\midi} command in a @code{\score}, only MIDI will
be produced. If notation is needed too, a @code{\paper} block must be
-added
+added too
@example
\score @{
- @var{...music...}
- \midi @{ \tempo 4=72 @}
+ @var{..music..}
+ \midi @{ \tempo 4=72 @}
\paper @{ @}
@}
@end example
-@cindex paper block
+@cindex paper block
-@node Adding titles
-@section Adding titles
+@node Titling
+@section Titling
Bibliographic information is entered in a separate block, the
-@code{\header} block. The name of the piece, its composer, etc., are
-entered as an assignment, within @code{\header
-@{@tie{}@dots{}@tie{}@}}. The @code{\header} block is usually put at
-the top of the file. For example,
-
+@code{\header} block. The name of the piece, its composer, etc. are
+entered as an assignment, within @code{\header @{ @dots{} @}}. For
+example,
@example
\header @{
title = "Eight miniatures"
tagline = "small is beautiful"
@}
-@{ @dots{} @}
+\score @{ @dots{} @}
@end example
@cindex bibliographic information
When the file is processed the title and composer are printed above
the music. The `tagline' is a short line printed at bottom of the last
-page which normally says `Engraved by LilyPond, version @dots{}'. In
-the example above it is replaced by the line `small is
-beautiful.'@footnote{Nicely printed parts are good PR for us, so
+page which normally says ``Engraved by LilyPond, version @dots{}''. In
+the example above it is replaced by the line ``small is
+beautiful.''@footnote{Nicely printed parts are good PR for us, so
please leave the tagline if you can.}
+Normally, the @code{\header} is put at the top of the file. However,
+for a document that contains multiple pieces (e.g. an etude book, or
+an orchestral part with multiple movements), the header can be
+put in the @code{\score} block as follows; in this case, the name of
+each piece will be printed before each movement
-The @code{\header} block is usually put at the top of the file.
-
-A document may contains multiple pieces of music, examples are an
-etude book, or an orchestral part with multiple movements.
-@c FIXME: ugh. \header can only live at toplevel, or inside \score.
-@c If we allow it also to live inside \book, we do not need \score here?
-The @code{\book} block is used to group the individual @code{\score}
-blocks.
-
-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
-each movement.
-
-@ignore
-
-FIXME: introduce \BOOK
-
-FIXME: Using "Adagio" as a name is confusing, it's more common to be
-a plain tempo indication.
-
-Since today (CVS-1.211) we also allow headers and composite music
-inside book:
-
- \header { ... }
- \book {
- \header { ... }
- { ... }
- \header { ... }
- { ... }
- }
-
-@end ignore
@cindex Engraved by LilyPond
@cindex signature line
tagline = "small is beautiful"
@}
-\book @{
- \score @{
- @dots{}
- \header @{ piece = "Adagio" @}
- @}
- \score @{
- @dots{}
- \header @{ piece = "Menuetto" @}
- @}
+\score @{ @dots{}
+ \header @{ piece = "Adagio" @}
+@}
+\score @{ @dots{}
+ \header @{ piece = "Menuetto" @}
@}
@end example
@cindex polyphony
@cindex multiple voices
@cindex voices, more -- on a staff
+
When different melodic lines are combined on a single staff they are
-printed as polyphonic voices; each voice has its own stems, slurs and
+printed as polyphonic voices: each voice has its own stems, slurs and
beams, and the top voice has the stems up, while the bottom voice has
them down.
Entering such parts is done by entering each voice as a sequence (with
-@code{@{...@}}), and combining those simultaneously, separating the
+@code{@{ .. @}}), and combining those simultaneously, separating the
voices with @code{\\}
@lilypond[quote,verbatim,relative=3]
<< { a4 g2 f4~ f4 } \\
- { r4 g4 f2 f4 } >>
+ { r4 g4 f2 f4 } >>
@end lilypond
-For polyphonic music typesetting, spacer rests can also be convenient; these
+For polyphonic music typesetting, spacer rests can also be convenient: these
are rests that do not print. It is useful for filling up voices that
temporarily do not play. Here is the same example with a spacer rest
-instead of a normal rest---just use @samp{s} instead of @samp{r}
-
-@lilypond[quote,verbatim,relative=3]
+instead of a normal rest
+@lilypond[quote,relative=3]
<< { a4 g2 f4~ f4 } \\
- { s4 g4 f2 f4 } >>
+ { s4 g4 f2 f4 } >>
@end lilypond
-@noindent
Again, these expressions can be nested arbitrarily
-@lilypond[quote,fragment,verbatim,relative=3]
+@lilypond[quote,fragment,relative=3]
<<
\new Staff <<
{ a4 g2 f4~ f4 } \\
- { s4 g4 f2 f4 }
+ { s4 g4 f2 f4 }
>>
\new Staff <<
\clef bass
{ <c, g>1 ~ <c g>4 } \\
- { f4 d e2 ~ e4}
+ { f4 d e2 ~ e4}
>>
>>
@end lilypond
-More features of polyphonic typesetting in the notation manual are
-described in @ref{Polyphony}.
-
+More features of polyphonic typesetting in the notation manual
+in @ref{Polyphony}.
@node Piano staves
@section Piano staves
@cindex staff switch, manual
@cindex cross staff voice, manual
@cindex @code{\context}
-Piano music is typeset in two staves connected by a brace. Printing
-such a staff is similar to the polyphonic example in @ref{More staves},
+Piano music is typeset in two staves connected by a brace. Printing
+such a staff is similar to the polyphonic example in @ref{More staves}
@example
<< \new Staff @{ @dots{} @}
\new Staff @{ @dots{} @} >>
@end example
-
-@noindent
but now this entire expression must be interpreted as a
@code{PianoStaff}
-
@example
-\new PianoStaff << \new Staff @dots{} >>
+ \new PianoStaff << \new Staff @dots{} >>
@end example
Here is a full-fledged example
-@lilypond[quote,verbatim,relative=1,fragment]
+@lilypond[quote,relative=1,fragment]
\new PianoStaff <<
- \new Staff { \time 2/4 c4 c g' g }
+ \new Staff { \time 2/4 c4 c g' g }
\new Staff { \clef bass c,, c' e c }
>>
@end lilypond
More information on formatting piano music is in @ref{Piano music}.
-
@node Organizing larger pieces
@section Organizing larger pieces
By using variables, also known as identifiers, it is possible to break
up complex music expressions. An identifier is assigned as follows
-
+@c
@example
-namedMusic = \notes @{ @dots{} @}
+namedMusic = \notes @{ @dots{}
@end example
-@noindent
The contents of the music expression @code{namedMusic}, can be used
-later by preceding the name with a backslash, i.e., @code{\namedMusic}.
-In the next example, a two-note motive is repeated two times by using
+later by preceding the name with a backslash, i.e. @code{\namedMusic}.
+In the next example, a two note motive is repeated two times by using
variable substitution
-@lilypond[quote,raggedright,verbatim,nofragment]
+@lilypond[quote,raggedright,verbatim]
seufzer = \notes {
e'4( dis'4)
}
-{ \seufzer \seufzer }
+\score {
+ \new Staff { \seufzer \seufzer }
+}
@end lilypond
The name of an identifier should have alphabetic characters only;
It is possible to use variables for many other types of objects in the
input. For example,
-
@example
width = 4.5\cm
name = "Wendy"
aFivePaper = \paper @{ paperheight = 21.0 \cm @}
@end example
-
Depending on its contents, the identifier can be used in different
places. The following example uses the above variables
-
@example
\score @{
\notes @{ c4^\name @}
@node An orchestral part
@section An orchestral part
-In orchestral music, all notes are printed twice; in a part for
+In orchestral music, all notes are printed twice: both in a part for
the musicians, and in a full score for the conductor. Identifiers can
-be used to avoid double work. The music is entered once, and stored in
+be used to avoid double work: the music is entered once, and stored in
a variable. The contents of that variable is then used to generate
both the part and the score.
-It is convenient to define the notes in a special file. For example,
-suppose that the file @file{horn-music.ly} contains the following part
-of a horn/bassoon duo
-
+It is convenient to define the notes in a special file, for example,
+suppose that the @file{horn-music.ly} contains the following part of a
+horn/bassoon duo,
@example
hornNotes = \notes \relative c @{
\time 2/4
@}
@end example
-@noindent
Then, an individual part is made by putting the following in a file
@example
The line
@example
-\include "horn-music.ly"
+ \include "horn-music.ly"
@end example
@noindent
substitutes the contents of @file{horn-music.ly} at this position in
the file, so @code{hornNotes} is defined afterwards. The command
-@code{\transpose f@tie{}c'} indicates that the argument, being
-@code{\hornNotes}, should be transposed by a fifth downwards. Sounding
-@samp{f} is denoted by notated @code{c'}, which corresponds with
-tuning of a normal French Horn in@tie{}F. The transposition can be seen
-in the following output
+@code{\transpose f c'} indicates that the argument, being
+@code{\hornNotes}, should be transposed by a fifth downwards: sounding
+@code{f} is denoted by notated @code{c'}, which corresponds with
+tuning of a normal French Horn in F. The transposition can be seen in
+the following output
@lilypond[quote,raggedright]
\score {
In ensemble pieces, one of the voices often does not play for many
measures. This is denoted by a special rest, the multi-measure
-rest. It is entered with a capital @samp{R} followed by a duration
-(1@tie{}for a whole note, 2@tie{}for a half note, etc.). By multiplying the
+rest. It is entered with a capital @code{R} followed by a duration (1
+for a whole note, 2 for a half note, etc.) By multiplying the
duration, longer rests can be constructed. For example, this rest
-takes 3@tie{}measures in 2/4 time
-
+takes 3 measures in 2/4 time
@example
R2*3
@end example
When printing the part, multi-rests
must be condensed. This is done by setting a run-time variable
-
@example
\set Score.skipBars = ##t
@end example
-@noindent
-This command sets the property @code{skipBars} in the
+
+This commands sets the property @code{skipBars} property in the
@code{Score} context to true (@code{##t}). Prepending the rest and
this option to the music above, leads to the following result
@}
@end example
-@noindent
leading to
@lilypond[quote,raggedright]
}
\new Staff {
\clef bass
- r4 d,8 f | gis4 c | b bes |
- a8 e f4 | g d | gis f
+ r4 d,8 f | gis4 c | b bes |
+ a8 e f4 | g d | gis f
}
}
}
@end lilypond
-More in-depth information on preparing parts and scores can be found
-in the notation manual; see @ref{Orchestral music}.
-
-Setting run-time variables (`properties') is discussed in ref-TODO.
+More in-depth information on preparing parts and scores in the
+notation manual, in @ref{Orchestral music}.
+Setting run-time variables (``properties'') is discussed in ref-TODO.
@node Integrating text and music
@section Integrating text and music
@cindex La@TeX{}, music in
@cindex HTML, music in
@cindex Texinfo, music in
+
Some texts include music examples. Examples are musicological
treatises, songbooks or manuals like this. Such texts can be made by
hand, simply by importing a PostScript figure into the word processor.
However, there is an automated procedure to reduce the amount of work
-involved HTML, La@TeX{}, and Texinfo documents.
+involved HTML, La@TeX{}, and Texinfo documents.
A script called @code{lilypond-book} will extract the music fragments,
run format them, and put back the resulting notation. This program is
If there is no \verb+\score+ block in the fragment,
\texttt@{lilypond-book@} will supply one
-\begin[quote]@{lilypond@}
+\begin@{lilypond@}
c'4
\end@{lilypond@}
-\noindent
-In this example two things happened. A
+In this example two things happened: a
\verb+\score+ block was added, and the line width was set to natural
length.
Options are put in brackets.
-\begin[quote,staffsize=26,verbatim]@{lilypond@}
+\begin[staffsize=26,verbatim]@{lilypond@}
c'4 f16
\end@{lilypond@}
+
Larger examples can be put in a separate file, and introduced with
\verb+\lilypondfile+.
-\lilypondfile[quote,noindent]@{screech-boink.ly@}
+\lilypondfile@{screech-boink.ly@}
\end@{document@}
@end example
Under Unix, you can view the results as follows
-
@example
$ cd input/tutorial
$ mkdir -p out/
To convert the file into a nice PDF document, run the following
commands
-
@example
$ dvips -Ppdf -u +lilypond lilybook
$ ps2pdf lilybook.ps
@end example
+
Running lilypond-book and running latex creates a lot of temporary
files, which would clutter up the working directory. To remedy this,
-use the @code{--output=@var{dir}} option. It will create the files in
-a separate subdirectory @file{dir}.
+use the @code{output} option. It will create the files in a separate
+subdirectory @file{out}.
-Finally the result of the La@TeX{} example shown above.@footnote{Note
-that in this tutorial the example is processed with Texinfo. This gives
-slightly different results in layout.} This finishes the tutorial
-section.
+The result looks more or less like
-@page
+@separate
Documents for lilypond-book may freely mix music and text. For
-example,
+example
-@lilypond
-\score { \notes \relative c' {
- c2 g'2 \times 2/3 { f8 e d } c'2 g4
-} }
+@lilypond[quote,raggedright]
+\score {
+ \notes \relative c' {
+ c2 g'2 \times 2/3 { f8 e d } c'2 g4
+ }
+}
@end lilypond
-If there is no @code{\score} block in the fragment,
+If you have no @code{\score} block in the fragment,
@code{lilypond-book} will supply one
@lilypond[quote]
c'4
@end lilypond
-@noindent
-In this example two things happened. A
+In this example two things happened: a
@code{score} block was added, and the line width was set to natural
length.
-
-Release 2.3
-***********
-
-HEAD HACKERS
-
-Han-Wen Nienhuys
-Jan Nieuwenhuizen
-
-
-CONTRIBUTORS
-
-Peter Lutek
-Carl Sorensen
-Michael Welsh Duggan
-Pedro Kroger
-Erik Sandberg
-Guy Gascoigne-Piggford
-Hendrik Maryns
-
-BUG HUNTERS/SUGGESTIONS
-
-David Bobroff
-David Brandon
-Peter Rosenbeck
-Stephen Pollei
-Bertalan Fodor
-Thomas Scharlowski
-Yuval Harel
-Martin Norbäck
-Kristof Bastiaensen
-
-
-Release 2.2
+Release 2.1
***********
HEAD HACKERS
PACKAGE_NAME=LilyPond
MAJOR_VERSION=2
-MINOR_VERSION=3
-PATCH_LEVEL=5
+MINOR_VERSION=2
+PATCH_LEVEL=2
MY_PATCH_LEVEL=
srcdir=`dirname $0`
-case $1 in
- --noconf*) NOCONFIGURE=true;;
-esac
if [ ! -f aclocal.m4 -o stepmake/aclocal.m4 -nt aclocal.m4 ]; then
echo "stepmake/aclocal.m4 is newer. Copying file."
+++ /dev/null
-#!@BASH@
-# guile-gnome.sh -- download, compile, install g-wrap, guile-gnome TLA and
-# pango CVS
-
-# LilyPond has an experimental gnome canvas output backend -- hackers
-# only. This depends on unreleased version of guile-gnome, which
-# depends on an unreleased, forked version of g-wrap. We also need
-# pango CVS > 2004-06-12
-
-# Note: this install information is volatile, you'll probably want to
-# pull all from from guile-gnome-devel@gnu.org--2004 soon.
-
-set -ex
-
-# Where user built stuff will be installed
-OPT=$HOME/usr/pkg
-
-if [ -x /usr/bin/gcc34 ] ;then
- export GCC=gcc34
-fi
-
-if [ -x /usr/bin/gcc-3.4 ] ;then
- export GCC=gcc-3.4
-fi
-
-export AUTOMAKE=automake-1.8
-export ACLOCAL=aclocal-1.8
-export AUTOCONF=$(which autoconf2.50)
-export AUTOHEADER=$(which autoheader2.50)
-
-MY_LIBTOOL=$(dpkg -l libtool | tail -1 | awk '{ print $3 }')
-PANGO_LIBTOOL=1.5.6-1
-
-# Please state your love for the autotools today
-if [ -z "$I_LOVE_AUTOTOOLS" ]; then
- I_LOVE_AUTOTOOLS=no
-else
- I_LOVE_AUTOTOOLS=yes
-fi
-
-if [ -z "$AUTOCONF" ]; then
- unset AUTOCONF
-fi
-if [ -z "$AUTOHEADER" ]; then
- unset AUTOHEADER
-fi
-
-
-# test: the name of our download and build directory
-rm -rf test
-mkdir test
-cd test
-
-## 1. install gnome-devel
-## - Debian/unstable: apt-get install gnome-devel
-## - ...
-
-## 2. get pango CVS
-
-
-mkdir -p gnome/CVS
-cd gnome
-echo ":pserver:anonymous@anoncvs.gnome.org:/cvs/gnome" > CVS/Root
-echo "." > CVS/Repository
-cvs -z3 checkout -P pango
-cd pango
-rm -rf $OPT/pango
-if [ "$I_LOVE_AUTOTOOLS" = "no" ]; then
- sudo apt-get --yes --force-yes install libtool=$PANGO_LIBTOOL
-fi
-./autogen.sh --help
-./configure --prefix=$OPT/pango --enable-maintainer-mode --enable-gtk-doc
-make XFT_LIBS="-L/usr/lib -lXft -L/usr/X11R6/lib -lfreetype -lz -lXrender -lX11 -lfontconfig" install
-if [ "$I_LOVE_AUTOTOOLS" = "no" ]; then
- sudo apt-get --yes --force-yes install libtool=$MY_LIBTOOL
-fi
-
-cd ../..
-
-export PKG_CONFIG_PATH=$OPT/pango/lib/pkgconfig:$PKG_CONFIG_PATH
-
-
-## 3. *** NOTE: use guile-1.6 for g-wrap and guile-gnome ***
-## using GUILE CVS g-wrap/guile-gnome is experimental (read: segfaults)
-## Assuming that system has guile-1.6 installed in /usr/bin
-PATH=/usr/bin:$PATH
-
-if [ -d $OPT/libffi/ ]; then
- export LDFLAGS=-L$OPT/libffi/lib
- export CPPFLAGS=-I$OPT/libffi/include
-fi
-
-## 4. get g-wrap 2.0
-tla register-archive a.rottmann@gmx.at--2004-main \
- http://people.debian.org/~rotty/arch/a.rottmann@gmx.at/2004-main || true
-
-rm -rf g-wrap
-if true; then
- ## pull latest g-wrap from janneke -- this step is probably no longer
- ## necessary when you read this
- tla register-archive janneke@gnu.org--2004-gnome \
- http://lilypond.org/~janneke/{arch}/2004-gnome || true
- tla get janneke@gnu.org--2004-gnome/g-wrap--janneke g-wrap
-else
- ## tla get a.rottmann@gmx.at--2004-main/g-wrap--tng g-wrap
- tla get a.rottmann@gmx.at--2004-main/g-wrap--mainline--1.9.0 g-wrap
-fi
-cd g-wrap
-
-rm -rf $OPT/g-wrap
-sh autogen.sh --noconfigure
-mkdir =build
-cd =build
-../configure --prefix=$OPT/g-wrap
-make install
-
-# not a good idea
-## cp srfi-34.scm from CVS head ? --hwn
-#(cd $OPT/g-wrap/share/guile/site
-# mv srfi-34.scm srfi-34.scm-g-wrap
-# cp $OPT/guile/share/guile-1.7/srfi/srfi-34.scm .)
-
-cd ../..
-
-## 5. get guile-gnome
-tla register-archive guile-gnome-devel@gnu.org--2004 \
- http://people.debian.org/~rotty/arch/guile-gnome-devel@gnu.org/2004/ || true
-rm -rf guile-gnome
-tla get guile-gnome-devel@gnu.org--2004/dists--dev guile-gnome
-cd guile-gnome
-tla build-config -r configs/gnu.org/dev
-cd src
-
-## 6. get the gnome canvas module
-tla get guile-gnome-devel@gnu.org--2004/libgnomecanvas--dev libgnomecanvas
-
-rm -rf $OPT/guile-gnome
-if false; then
- libtoolize --copy --force
- $AUTOHEADER
- $ACLOCAL
- $AUTOMAKE --copy --force
- $AUTOCONF
-fi
-sh autogen.sh --noconfigure
-mkdir ../=build
-cd ../=build
-
-export GUILE_LOAD_PATH=$OPT/g-wrap/share/guile/site:$GUILE_LOAD_PATH
-export LD_LIBRARY_PATH=$OPT/g-wrap/lib:$LD_LIBRARY_PATH
-PKG_CONFIG_PATH=$OPT/g-wrap/lib/pkgconfig:$PKG_CONFIG_PATH
-
-../src/configure --prefix=$OPT/guile-gnome
-
-# Using libtool < 1.6.0 together with gcc-3.4 may trigger this problem:
-#
-# If a tag has not been given, and we're using a compiler which is
-# not one of the ones with which libtool was built, attempt to
-# infer the compiler from the first word of the command line passed
-# to libtool.
-#
-# Use gcc-3.3 or libtool-1.6.0
-make install CC=$GCC G_WRAP_MODULE_DIR=$OPT/g-wrap/share/guile/site
-
-GUILE_LOAD_PATH=$OPT/guile-gnome/share/guile:$GUILE_LOAD_PATH
-LD_LIBRARY_PATH=$OPT/guile-gnome/lib:$LD_LIBRARY_PATH
-
-# simple test
-guile -s ../src/libgnomecanvas/examples/canvas.scm
# For direct ps output: ps/lilyponddefs.ps
- GS_LIB="$datadir/ps:"${GS_LIB:=""}
- export GS_LIB
+ ## GS_LIB="$datadir/ps:"${GS_LIB:=""}
+ ## export GS_LIB
# For direct ps output fonts. Add all available TeX Type1 fonts
- tmppfadir=`kpsewhich ecrm10.pfa`
- GS_FONTPATH=$datadir/pfa:`dirname $tmppfadir`:${GS_FONTPATH:=""}
- export GS_FONTPATH
+ ## GS_FONTPATH=`kpsewhich -expand-path=\\$T1FONTS`:${GS_FONTPATH:=""}
+ ## export GS_FONTPATH
fi # remove for zsh
'ly/engraver-init.ly',
'ly/grace-init.ly',
'ly/gregorian-init.ly',
-'ly/music-functions-init.ly',
'ly/performer-init.ly',
'ly/property-init.ly',
'ly/scale-definitions-init.ly',
# more identifiers
for name in [
'ly/declarations-init.ly',
-'ly/declarations-init.ly',
'ly/params-init.ly',
]:
F = open(name, 'r')
'ly/norsk.ly',
'ly/suomi.ly',
'ly/svenska.ly',
-'ly/vlaams.ly',
]:
F = open(name, 'r')
for line in F.readlines():
tags = string.split(l, '@:')
if tags[0] == 'group':
group = tags[1]
- elif tags[0] == 'puorg':
- group = ''
elif tags[0] == 'char':
- name = tags[9]
- if group:
- name = group + '-' + name
m = {
'description': tags[1],
- 'name': name,
+ 'name': group + '-' + tags[9],
'tex': tags[10],
'code': string.atoi (tags[2]),
'breapth':string.atof (tags[3]),
#urg
if 0: #testing
tags.append ('Regular')
-
-
- encoding = re.sub (' ','-', tags[5])
- tags = tags[:-1]
name = tags[1:]
- global_info['DesignSize'] = string.atof (tags[4])
global_info['FontName'] = string.join (name,'-')
global_info['FullName'] = string.join (name,' ')
global_info['FamilyName'] = string.join (name[1:-1],
global_info['Weight'] = tags[4]
else: #testing
global_info['Weight'] = tags[-1]
-
global_info['FontBBox'] = '0 0 1000 1000'
global_info['Ascender'] = '0'
global_info['Descender'] = '0'
- global_info['EncodingScheme'] = encoding
+ global_info['EncodingScheme'] = 'FontSpecific'
return (global_info, charmetrics, deps)
file.write (r"""
%% LilyPond file to list all font symbols and the corresponding names
%% Automatically generated by mf-to-table.py
-\score{ \new Lyrics \lyrics { \time %d/8
+\score{ \lyrics \new Lyrics { \time %d/8
""" % (2*per_line+1))
count = 0
interscoreline = 1.0
indent = 0.0 \cm
\context {
- \Lyrics
+ \LyricsContext
\override SeparationItem #'padding = #2
minimumVerticalExtent = ##f
}
\context {
- \Score
+ \ScoreContext
\remove "Bar_number_engraver"
}
}
write_afm_header (afm)
afm.write ("Comment TfmCheckSum %d\n" % cs)
- afm.write ("Comment DesignSize %.2f\n" % g['DesignSize'])
-
- del g['DesignSize']
-
write_afm_metric (afm, g, m)
write_tex_defs (open (texfile_nm, 'w'), g, m)
list = open(filename, 'w')
else:
list = sys.stdout
- list.write ('<html><head><title>Rendered Examples</title>\n')
- list.write ('<style type="text/css">\n')
- list.write ('hr { border:0; height:1; color: #000000; background-color: #000000; }\n')
- list.write ('</style></head>\n')
-
+ list.write ('<html><title>Rendered Examples</title>\n')
list.write ('<body bgcolor=white>\n')
if inputs:
#define GUILE_PATCH_LEVEL 0
#endif
#endif
-
-/* define if you have pango CVS */
-#define HAVE_PANGO_CVS 0
-
-/* define if you have pango_fc_font_map_add_decoder_find_func */
-#define HAVE_PANGO_FC_FONT_MAP_ADD_DECODER_FIND_FUNC 0
package-depth = @package_depth@
-USER_CFLAGS = @CFLAGS@ @CPPFLAGS@ @GUILE_CFLAGS@ @PANGO_CFLAGS@
-USER_CXXFLAGS = @CXXFLAGS@ @CPPFLAGS@ @GUILE_CFLAGS@ @PANGO_CFLAGS@
+USER_CFLAGS = @CFLAGS@ @CPPFLAGS@ @GUILE_CFLAGS@
+USER_CXXFLAGS = @CXXFLAGS@ @CPPFLAGS@ @GUILE_CFLAGS@
USER_LDFLAGS = @LDFLAGS@ @GUILE_LDFLAGS@
-EXTRA_LIBES = @EXTRA_LIBES@ @LIBS@ @PANGO_LIBS@
+EXTRA_LIBES = @EXTRA_LIBES@ @LIBS@
PACKAGE = @PACKAGE@
package = @package@
# Uncomment the configuration options your package needs.
-
-gui_b=no
-AC_ARG_ENABLE(gui,
- [ --enable-gui compile with debugging info. Default: off],
- [gui_b=$enableval])
-
# must come before any header checks
STEPMAKE_COMPILE
AC_CHECK_FUNCS([gettext isinf memmem snprintf vsnprintf gettext])
-# This is developer only anyway, help pkgconfig a bit
-export PKG_CONFIG_PATH
-PKG_CONFIG_PATH=/usr/lib/pkgconfig:$PKG_CONFIG_PATH
-PKG_CONFIG_PATH=/opt/gnome/lib/pkgconfig:$PKG_CONFIG_PATH
-PKG_CONFIG_PATH=$HOME/usr/pkg/gnome/lib/pkgconfig:$PKG_CONFIG_PATH
-PKG_CONFIG_PATH=$HOME/usr/pkg/pango/lib/pkgconfig:$PKG_CONFIG_PATH
-
-#STEPMAKE_FREETYPE2
-if test "$gui_b" = "yes"; then
- STEPMAKE_GTK2
- STEPMAKE_PANGO
-fi
-
## Optional tools for building documentation, website, extra fonts.
# guile executable for some scripts
make$mc install to install LilyPond
make$mc help to see all possible targets
+Do not worry if ./Documentation should not build.
EOF
#!@PYTHON@
# lily-wins.py -- LilyPond command for .ly on Windows
-import getopt
import os
import re
import sys
-import time
-
-do_debug = 0
def usage ():
print 'Usage [-h,--help] lily-wins LY-FILE'
# print debugging stuff for now
def debug (s):
- if do_debug:
- print s
+ print s
def read_pipe (command):
debug ('command:' + command)
return re.sub ("(\s|[`'\"\\\\])", r'\\\1',x)
# return re.sub (r'''([^\\])([`'"\\\s])''', r'\1\\\2', x)
# help emacs'" broken python mode
-
-def usage ():
- print '''lily-wins [options] file
-
-Options supported:
-
- -h, --help this help screen
- -d, --debug print debugging information
-
-'''
debug (`sys.argv`)
-########
-# main
-(opts, files)=getopt.getopt (sys.argv[1:],'dh', ['help', 'debug'])
-
-for (o,a) in opts:
- if o == '-d' or o == '--debug':
- do_debug = 1
- elif o == '-h' or o == '--help':
- usage ()
- sys.exit (0)
-
-if files == []:
+if len (sys.argv) != 2 \
+ or sys.argv[1] == '-h' or sys.argv[1] == '--help':
usage ()
- sys.exit (1)
+ sys.exit (0)
+
+native_file = sys.argv[1]
-native_file = files[0]
-print 'Processing %s ...' % native_file
file = read_pipe ('/usr/bin/cygpath -au %s' % escape_shell (native_file))
if not file:
file = native_file
dir = '.'
base = os.path.basename (file)
stem = strip_extension (base, '.ly')
-debug ( `vars ()`)
+print `vars ()`
native_base = '%(dir)s/%(stem)s' % vars ()
native_base = read_pipe ('/usr/bin/cygpath -aw %s' % escape_shell (native_base))
pdfview = 'xpdf'
os.chdir (dir)
-pdffile = '%(stem)s.pdf' % vars ()
-if os.path.exists (pdffile):
- os.unlink (pdffile)
-
-
-script = '/usr/bin/lilypond'
-
if os.path.exists ('/usr/bin/ly2dvi'):
- script = '/usr/bin/ly2dvi'
-
-stat = system ('%s -p %s > %s.log 2>&1' % (script, escape_shell (base),
- escape_shell (stem)))
-
-if not os.path.exists (pdffile):
+ system ('/usr/bin/ly2dvi -p %s > %s.log 2>&1' % (escape_shell (base),
+ escape_shell (stem)))
+else:
+ system ('/usr/bin/lilypond %s > %s.log 2>&1' % (escape_shell (base),
+ escape_shell (stem)))
+if not os.path.exists ('%(stem)s.pdf' % vars ()):
# message box?
- sys.stderr.write ('PDF output not found. Error log: \n')
+ sys.stderr.write ('pdf output not found\n')
- map (sys.stderr.write, open (stem + '.log').readlines ()[-20:])
- sys.stderr.write ('A full log is in the file %s.log\n' % stem)
- sys.stderr.write ('\n\nPress enter to close window\n')
- sys.stdin.readline ()
-else:
-
- # run even if failed, to make sure that error
- system ('%s %s.pdf' % (escape_shell (pdfview), escape_shell (native_base)))
+system ('%s %s.pdf' % (escape_shell (pdfview), escape_shell (native_base)))
#cd $inst-doc/$packagedocdir &&
#ln -s $(find html/Documentation -name '*.ps.gz') .
-
- install -d -m755 $inst-doc/$infodir/lilypond
- cd $inst-doc/$infodir/lilypond && ln -sf ../../doc/$base-$ver/Documentation/user/out-www/*png .
}
;; - brackets '{[]}'
;; - ties '~'
;; - ligatures \[, \]
- '("\\(-?[][~}{]\\|\\\\[][]\\)" 0 font-lock-reference-face t)
+ '("\\(-?[][~}{]\\|\\\\[][]\\)" 0 font-lock-warning-face t)
;; "on top", ... vertical grouping:
;; - '<>'-chord brackets with '\\'-voice sep., not marcato '->'
(defvar LilyPond-region-file-prefix "emacs-lily"
"File prefix for commands on buffer or region.")
-(defvar LilyPond-master-file nil
- "Master file that Lilypond will be run on.")
-
;; FIXME: find ``\score'' in buffers / make settable?
-(defun LilyPond-get-master-file ()
- (or LilyPond-master-file
- (buffer-file-name)))
+(defun LilyPond-master-file ()
+ ;; duh
+ (buffer-file-name))
(defvar LilyPond-kick-xdvi nil
"If true, no simultaneous xdvi's are started, but reload signal is sent.")
(interactive)
(if (buffer-modified-p)
(progn (save-buffer)
- (setq LilyPond-command-next LilyPond-command-default))))
+ (setq LilyPond-command-default "LilyPond"))))
;;; return (dir base ext)
(defun split-file-name (name)
:type 'string)
;;;(make-variable-buffer-local 'LilyPond-command-last)
-(defvar LilyPond-command-next LilyPond-command-default)
-
(defvar LilyPond-command-current 'LilyPond-command-master)
;;;(make-variable-buffer-local 'LilyPond-command-master)
(defun LilyPond-command-current-midi ()
"Play midi corresponding to the current document."
(interactive)
- (LilyPond-command (LilyPond-command-menu "Midi") 'LilyPond-get-master-file))
+ (LilyPond-command (LilyPond-command-menu "Midi") 'LilyPond-master-file))
(defun LilyPond-command-all-midi ()
"Play midi corresponding to the current document."
(interactive)
- (LilyPond-command (LilyPond-command-menu "MidiAll") 'LilyPond-get-master-file))
+ (LilyPond-command (LilyPond-command-menu "MidiAll") 'LilyPond-master-file))
(defun count-rexp (start end rexp)
"Print number of found regular expressions in the region."
(defun LilyPond-string-current-midi ()
"Check the midi file of the following midi-score in the current document."
(let ((fnameprefix (if (eq LilyPond-command-current 'LilyPond-command-master)
- (substring (LilyPond-get-master-file) 0 -3); suppose ".ly"
+ (substring (LilyPond-master-file) 0 -3); suppose ".ly"
LilyPond-region-file-prefix))
(allcount (string-to-number (substring (count-midi-words) 0 -12)))
(count (string-to-number (substring (count-midi-words-backwards) 0 -12))))
(defun LilyPond-string-all-midi ()
"Return the midi files of the current document in ascending order."
(let ((fnameprefix (if (eq LilyPond-command-current 'LilyPond-command-master)
- (substring (LilyPond-get-master-file) 0 -3); suppose ".ly"
+ (substring (LilyPond-master-file) 0 -3); suppose ".ly"
LilyPond-region-file-prefix))
(allcount (string-to-number (substring (count-midi-words) 0 -12))))
(concat (if (> allcount 0) ; at least one midi-score
;; Should expand this to include possible keyboard shortcuts which
;; could then be mapped to define-key and menu.
`(
- ("LilyPond" . ("lilypond-bin %s" "%s" "%l" "LaTeX"))
- ("TeX" . ("tex '\\nonstopmode\\input %t'" "%t" "%d" "View"))
+ ("LilyPond" . ("lilypond-bin %s" . "LaTeX"))
+ ("TeX" . ("tex '\\nonstopmode\\input %t'" . "View"))
- ("2Dvi" . ("lilypond %s" "%s" "%d" "View"))
- ("2PS" . ("lilypond -P %s" "%s" "%p" "ViewPS"))
- ("2Midi" . ("lilypond -m %s" "%s" "%m" "Midi"))
+ ("2Dvi" . ("lilypond %s" . "View"))
+ ("2PS" . ("lilypond -P %s" . "ViewPS"))
+ ("2Midi" . ("lilypond -m %s" . "View"))
- ("Book" . ("lilypond-book %x" "%x" "%l" "LaTeX"))
- ("LaTeX" . ("latex '\\nonstopmode\\input %l'" "%l" "%d" "View"))
+ ("Book" . ("lilypond-book %x" . "LaTeX"))
+ ("LaTeX" . ("latex '\\nonstopmode\\input %l'" . "View"))
;; point-n-click (arg: exits upop USR1)
- ("SmartView" . ("xdvi %d"))
+ ("SmartView" . ("xdvi %d" . "LilyPond"))
;; refreshes when kicked USR1
- ("View" . (,(concat LilyPond-xdvi-command " %d")))
- ("ViewPS" . (,(concat LilyPond-gv-command " %p")))
+ ("View" . (,(concat LilyPond-xdvi-command " %d") . "LilyPond"))
+ ("ViewPS" . (,(concat LilyPond-gv-command " %p") . "LilyPond"))
;; The following are refreshed in LilyPond-command:
;; - current-midi depends on cursor position and
- ("Midi" . (,(concat LilyPond-midi-command " " (LilyPond-string-current-midi)))) ;
+ ("Midi" . (,(concat LilyPond-midi-command " " (LilyPond-string-current-midi)) . "LilyPond" )) ;
;; - all-midi depends on number of midi-score.
- ("MidiAll" . (,(concat LilyPond-all-midi-command " " (LilyPond-string-all-midi))))
+ ("MidiAll" . (,(concat LilyPond-all-midi-command " " (LilyPond-string-all-midi)) . "LilyPond"))
)
"AList of commands to execute on the current document.
:group 'LilyPond
:type 'string)
-(defun LilyPond-find-required-command (command file)
- "Find the first command in the chain that is needed to run
- (input file is newer than the output file)"
- (let* ((entry (cdr (assoc command LilyPond-command-alist)))
- (next-command (nth 3 entry)))
- (if (null next-command)
- command
- (let* ((src-string (nth 1 entry))
- (input (LilyPond-command-expand src-string file))
- (output (LilyPond-command-expand (nth 2 entry) file)))
- (if (or (file-newer-than-file-p input output)
- (and (equal "%s" src-string)
- (not (equal (buffer-name) file))
- (file-newer-than-file-p (buffer-name)
- output)))
- command
- (LilyPond-find-required-command next-command file))))))
+(defun xLilyPond-compile-sentinel (process msg)
+ (if (and process
+ (= 0 (process-exit-status process)))
+ (setq LilyPond-command-default
+ (cddr (assoc LilyPond-command-default LilyPond-command-alist)))))
+
+;; FIXME: shouldn't do this for stray View/xdvi
+(defun LilyPond-compile-sentinel (buffer msg)
+ (if (string-match "^finished" msg)
+ (setq LilyPond-command-default
+ (cddr (assoc LilyPond-command-default LilyPond-command-alist)))))
+
+;;(make-variable-buffer-local 'compilation-finish-function)
+(setq compilation-finish-function 'LilyPond-compile-sentinel)
(defun LilyPond-command-query (name)
"Query the user for what LilyPond command to use."
- (cond ((string-equal name LilyPond-region-file-prefix)
- (LilyPond-check-files (concat name ".tex")
- (list name)
- (list LilyPond-file-extension)))
- ((verify-visited-file-modtime (current-buffer))
- (and (buffer-modified-p)
- (y-or-n-p "Save buffer before next command? ")
- (LilyPond-save-buffer)))
- ((y-or-n-p "The command will be invoked to an already saved buffer. Revert it? ")
- (revert-buffer t t)))
-
- (let* ((default (LilyPond-find-required-command LilyPond-command-next name))
- (completion-ignore-case t)
+ (let* ((default (cond ((if (string-equal name LilyPond-region-file-prefix)
+ (LilyPond-check-files (concat name ".tex")
+ (list name)
+ (list LilyPond-file-extension))
+ (if (verify-visited-file-modtime (current-buffer))
+ (if (buffer-modified-p)
+ (if (y-or-n-p "Save buffer before next command? ")
+ (LilyPond-save-buffer)))
+ (if (y-or-n-p "The command will be invoked to an already saved buffer. Revert it? ")
+ (revert-buffer t t)))
+ ;;"LilyPond"
+ LilyPond-command-default))
+ (t LilyPond-command-default)))
+
+ (completion-ignore-case t)
+
(answer (or LilyPond-command-force
(completing-read
(concat "Command: (default " default ") ")
"Run command on the current document."
(interactive)
(LilyPond-command-select-master)
- (LilyPond-command (LilyPond-command-query (LilyPond-get-master-file))
- 'LilyPond-get-master-file))
+ (LilyPond-command (LilyPond-command-query (LilyPond-master-file))
+ 'LilyPond-master-file))
(defun LilyPond-command-lilypond ()
"Run lilypond for the current document."
(interactive)
- (LilyPond-command (LilyPond-command-menu "LilyPond") 'LilyPond-get-master-file)
+ (LilyPond-command (LilyPond-command-menu "LilyPond") 'LilyPond-master-file)
)
(defun LilyPond-command-formatdvi ()
"Format the dvi output of the current document."
(interactive)
- (LilyPond-command (LilyPond-command-menu "2Dvi") 'LilyPond-get-master-file)
+ (LilyPond-command (LilyPond-command-menu "2Dvi") 'LilyPond-master-file)
)
(defun LilyPond-command-formatps ()
"Format the ps output of the current document."
(interactive)
- (LilyPond-command (LilyPond-command-menu "2PS") 'LilyPond-get-master-file)
+ (LilyPond-command (LilyPond-command-menu "2PS") 'LilyPond-master-file)
)
(defun LilyPond-command-formatmidi ()
"Format the midi output of the current document."
(interactive)
- (LilyPond-command (LilyPond-command-menu "2Midi") 'LilyPond-get-master-file)
+ (LilyPond-command (LilyPond-command-menu "2Midi") 'LilyPond-master-file)
)
(defun LilyPond-command-smartview ()
"View the dvi output of current document."
(interactive)
- (LilyPond-command (LilyPond-command-menu "SmartView") 'LilyPond-get-master-file)
+ (LilyPond-command (LilyPond-command-menu "SmartView") 'LilyPond-master-file)
)
(defun LilyPond-command-view ()
"View the dvi output of current document."
(interactive)
- (LilyPond-command (LilyPond-command-menu "View") 'LilyPond-get-master-file)
+ (LilyPond-command (LilyPond-command-menu "View") 'LilyPond-master-file)
)
(defun LilyPond-command-viewps ()
"View the ps output of current document."
(interactive)
- (LilyPond-command (LilyPond-command-menu "ViewPS") 'LilyPond-get-master-file)
+ (LilyPond-command (LilyPond-command-menu "ViewPS") 'LilyPond-master-file)
)
;; FIXME, this is broken
(LilyPond-kill-midi))) ; stop and start playing
(if (and (member name (list "Midi" "MidiAll")) job-string)
(if (file-newer-than-file-p
- (LilyPond-get-master-file)
- (concat (substring (LilyPond-get-master-file) 0 -3) ".midi"))
+ (LilyPond-master-file)
+ (concat (substring (LilyPond-master-file) 0 -3) ".midi"))
(if (y-or-n-p "Midi older than source. Reformat midi?")
(progn
(LilyPond-command-formatmidi)
(sit-for 0 100)))
(setq job-string nil)))))
- (setq LilyPond-command-next
- (let* ((entry (assoc name LilyPond-command-alist))
- (next-command (nth 3 (cdr entry))))
- (or next-command
- LilyPond-command-default)))
-
+ (setq LilyPond-command-default name)
(if (string-equal job-string "no jobs")
(LilyPond-compile-file command name))))))))
;;; Some kind of mapping which includes :keys might be more elegant
;;; Put keys to LilyPond-command-alist and fetch them from there somehow.
'([ "LilyPond" LilyPond-command-lilypond t])
- '([ "TeX" (LilyPond-command (LilyPond-command-menu "TeX") 'LilyPond-get-master-file) ])
+ '([ "TeX" (LilyPond-command (LilyPond-command-menu "TeX") 'LilyPond-master-file) ])
'([ "2Dvi" LilyPond-command-formatdvi t])
'([ "2PS" LilyPond-command-formatps t])
'([ "2Midi" LilyPond-command-formatmidi t])
- '([ "Book" (LilyPond-command (LilyPond-command-menu "Book") 'LilyPond-get-master-file) ])
- '([ "LaTeX" (LilyPond-command (LilyPond-command-menu "LaTeX") 'LilyPond-get-master-file) ])
+ '([ "Book" (LilyPond-command (LilyPond-command-menu "Book") 'LilyPond-master-file) ])
+ '([ "LaTeX" (LilyPond-command (LilyPond-command-menu "LaTeX") 'LilyPond-master-file) ])
'([ "Kill jobs" LilyPond-kill-jobs t])
'("-----")
'([ "SmartView" LilyPond-command-smartview t])
(interactive)
(require 'ilisp)
(guile "lilyguile" (LilyPond-command-expand (cadr (assoc "2Dvi" LilyPond-command-alist))
- (funcall 'LilyPond-get-master-file)))
+ (funcall 'LilyPond-master-file)))
(comint-default-send (ilisp-process) "(define-module (*anonymous-ly-1*))")
(comint-default-send (ilisp-process) "(set! %load-path (cons \"/usr/share/ilisp/\" %load-path))")
(comint-default-send (ilisp-process) "(use-modules (guile-user) (guile-ilisp))")
return to_string (char (a + 'x'));
}
+
+Axis
+other_axis (Axis a)
+{
+ return a == Y_AXIS ? X_AXIS : Y_AXIS;
+}
+
+/*
+ TODO inline these.
+ */
+Axis
+post_incr (Axis &a)
+{
+ assert (a < NO_AXES);
+ Axis b= a;
+ a = Axis (int (a) + 1);
+ return b;
+}
+
+Axis
+incr (Axis &a)
+{
+ assert (a < NO_AXES);
+ a = Axis (int (a) + 1);
+ return a;
+}
+
+++ /dev/null
-/*
- file-name.cc - implement File_name
-
- source file of the Flower Library
-
- (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
- Jan Nieuwenhuizen <janneke@gnu.org>
-*/
-
-#include "config.h"
-#include <stdio.h>
-#include <errno.h>
-#include <limits.h>
-
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-
-#ifdef __CYGWIN__
-#include <sys/cygwin.h>
-#endif
-
-#include "file-name.hh"
-
-/* We don't have multiple roots, set this to '\0'? */
-#ifndef ROOTSEP
-#define ROOTSEP ':'
-#endif
-
-#ifndef DIRSEP
-#define DIRSEP '/'
-#endif
-
-#ifndef EXTSEP
-#define EXTSEP '.'
-#endif
-
-#ifdef __CYGWIN__
-static String
-dos_to_posix (String file_name)
-{
- char buf[PATH_MAX];
- char *s = file_name.get_copy_str0 ();
- /* urg, wtf? char const* argument gets modified! */
- cygwin_conv_to_posix_path (s, buf);
- delete s;
- return buf;
-}
-#endif /* __CYGWIN__ */
-
-/* Join components to full file_name. */
-String
-File_name::to_string () const
-{
- String s;
- if (!root_.is_empty ())
- s = root_ + ::to_string (ROOTSEP);
- if (!dir_.is_empty ())
- s += dir_ + ::to_string (DIRSEP);
- s += base_;
- if (!ext_.is_empty ())
- s += ::to_string (EXTSEP) + ext_;
- return s;
-}
-
-char const*
-File_name::to_str0 () const
-{
- return to_string ().to_str0 ();
-}
-
-File_name::File_name (String file_name)
-{
-#ifdef __CYGWIN__
- /* All system functions would work, even if we don't convert to
- posix file_name, but we'd think that \foe\bar\baz.ly is in the cwd.
- On by default. */
- file_name = dos_to_posix (file_name);
-#endif
-
- int i = file_name.index (ROOTSEP);
- if (i >= 0)
- {
- root_ = file_name.left_string (i);
- file_name = file_name.right_string (file_name.length () - i - 1);
- }
-
- i = file_name.index_last (DIRSEP);
- if (i >= 0)
- {
- dir_ = file_name.left_string (i);
- file_name = file_name.right_string (file_name.length () - i - 1);
- }
-
- i = file_name.index_last ('.');
- if (i >= 0)
- {
- base_ = file_name.left_string (i);
- ext_ = file_name.right_string (file_name.length () - i - 1);
- }
- else
- base_ = file_name;
-}
/*
- file-path.cc - implement File_path
-
- source file of the Flower Library
-
- (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
- Jan Nieuwenhuizen <janneke@gnu.org>
+ path.cc - manipulation of paths and filenames.
*/
#include "config.h"
#ifdef __CYGWIN__
#include <sys/cygwin.h>
+
+// URGURG
+#include "../lily/include/scm-option.hh"
#endif
-#include "file-name.hh"
#include "file-path.hh"
+
#ifndef PATHSEP
#define PATHSEP ':'
#endif
+/* We don't have multiple roots, set this to '\0'? */
+#ifndef ROOTSEP
+#define ROOTSEP ':'
+#endif
+
+#ifndef DIRSEP
+#define DIRSEP '/'
+#endif
+
+#ifndef EXTSEP
+#define EXTSEP '.'
+#endif
+
+
+
+#ifdef __CYGWIN__
+static String
+dos_to_posix (String path)
+{
+ char buf[PATH_MAX];
+ char *filename = path.get_copy_str0 ();
+ /* urg, wtf? char const* argument gets modified! */
+ cygwin_conv_to_posix_path (filename, buf);
+ delete filename;
+ return buf;
+}
+
+static String
+dos_to_posix_list (String path)
+{
+ char *filename = path.get_copy_str0 ();
+ int len = cygwin_win32_to_posix_path_list_buf_size (filename);
+ if (len < PATH_MAX)
+ len = PATH_MAX;
+ char *buf = new char[len];
+ /* urg, wtf? char const* argument gets modified! */
+ cygwin_win32_to_posix_path_list (filename, buf);
+ delete filename;
+
+ String ret = buf;
+ delete buf;
+ return ret;
+}
+#endif /* __CYGWIN__ */
+
+/* Join components to full path. */
+String
+Path::to_string () const
+{
+ String s;
+ if (!root.is_empty ())
+ s = root + ::to_string (ROOTSEP);
+ if (!dir.is_empty ())
+ s += dir + ::to_string (DIRSEP);
+ s += base;
+ if (!ext.is_empty ())
+ s += ::to_string (EXTSEP) + ext;
+ return s;
+}
+
+/**
+ @param path the original full filename
+ @return 4 components of the path. They can be empty
+*/
+Path
+split_path (String path)
+{
+#ifdef __CYGWIN__
+ /* All system functions would work, even if we don't convert to
+ posix path, but we'd think that \foe\bar\baz.ly is in the cwd.
+ On by default. */
+ if (!(testing_level_global & 1))
+ path = dos_to_posix (path);
+#endif
+
+ Path p;
+ int i = path.index (ROOTSEP);
+ if (i >= 0)
+ {
+ p.root = path.left_string (i);
+ path = path.right_string (path.length () - i - 1);
+ }
+
+ i = path.index_last (DIRSEP);
+ if (i >= 0)
+ {
+ p.dir = path.left_string (i);
+ path = path.right_string (path.length () - i - 1);
+ }
+
+ i = path.index_last ('.');
+ if (i >= 0)
+ {
+ p.base = path.left_string (i);
+ p.ext = path.right_string (path.length () - i - 1);
+ }
+ else
+ p.base = path;
+ return p;
+}
+
void
File_path::parse_path (String p)
{
- int len;
- while ((len = p.length ()) )
+#ifdef __CYGWIN__
+ if (testing_level_global & 4)
+ p = dos_to_posix_list (p);
+#endif
+
+ int l;
+
+ while ((l = p.length ()) )
{
int i = p.index (PATHSEP);
if (i <0)
- i = len;
- append (p.left_string (i));
- p = p.right_string (len - i - 1);
+ i = l;
+ add (p.left_string (i));
+ p = p.right_string (l- i - 1);
}
}
+
+
+
/** Find a file.
-
- Seach in the current dir (DUH! FIXME?), in the construction-arg
- (what's that?, and in any other appended directory, in this order.
+ It will search in the current dir, in the construction-arg, and
+ in any other added path, in this order.
@return
- The file name if found, or empty string if not found. */
-
+ The full path if found, or empty string if not found
+ */
String
-File_path::find (String name) const
+File_path::find (String nm) const
{
- if (!name.length () || (name == "-") )
- return name;
- int n = size ();
- for (int i = 0; i < n; i++)
+ if (!nm.length () || (nm == "-") )
+ return nm;
+ for (int i=0; i < size (); i++)
{
- String file_name = elem (i);
+ String path = elem (i);
String sep = ::to_string (DIRSEP);
- String right (file_name.right_string (1));
- if (file_name.length () && right != sep)
- file_name += ::to_string (DIRSEP);
+ String right (path.right_string (1));
+ if (path.length () && right != sep)
+ path += ::to_string (DIRSEP);
+
+ path += nm;
- file_name += name;
-#if 0 /* Check if directory. TODO: encapsulate for autoconf */
+#if 0
+ /*
+ Check if directory. TODO: encapsulate for autoconf
+ */
struct stat sbuf;
- if (stat (file_name.to_str0 (), &sbuf) != 0)
+ if (stat (path.to_str0 (), &sbuf) != 0)
continue;
if (! (sbuf.st_mode & __S_IFREG))
#if !STAT_MACROS_BROKEN
struct stat sbuf;
- if (stat (file_name.to_str0 (), &sbuf) != 0)
+ if (stat (path.to_str0 (), &sbuf) != 0)
continue;
if (S_ISDIR (sbuf.st_mode))
continue;
#endif
- /* ugh */
- FILE *f = fopen (file_name.to_str0 (), "r");
+ FILE *f = fopen (path.to_str0 (), "r"); // ugh!
if (f)
{
fclose (f);
- return file_name;
+ return path;
}
}
return "";
}
-/** Find a file.
-
- Seach in the current dir (DUH! FIXME?), in the construction-arg
- (what's that?, and in any other appended directory, in this order.
-
- Search for NAME, or name without extension, or name with any of
- EXTENSIONS, in that order.
-
- @return
- The file name if found, or empty string if not found. */
-String
-File_path::find (String name, char const *extensions[])
-{
- File_name file_name (name);
- if (name.is_empty () || name == "-")
- file_name.base_ = "-";
- else
- {
- String orig_ext = file_name.ext_;
- for (int i = 0; extensions[i]; i++)
- {
- file_name.ext_ = orig_ext;
- if (*extensions[i] && !file_name.ext_.is_empty ())
- file_name.ext_ += ".";
- file_name.ext_ += extensions[i];
- if (!find (file_name.to_string ()).is_empty ())
- break;
- }
- /* Reshuffle extension */
- file_name = File_name (file_name.to_string ());
- }
- return file_name.to_string ();
-}
-
-/** Append a directory, return false if failed. */
+/**
+ Add a directory, return false if failed
+ */
bool
-File_path::try_append (String s)
+File_path::try_add (String s)
{
if (s == "")
s = ".";
- if (FILE *f = fopen (s.to_str0 (), "r"))
- {
- fclose (f);
- append (s);
- return true;
- }
- return false;
+ FILE * f = fopen (s.to_str0 (), "r");
+ if (!f)
+ return false;
+ fclose (f);
+
+ add (s);
+ return true;
+}
+
+void
+File_path::add (String s)
+{
+#ifdef __CYGWIN__
+ if (testing_level_global & 2)
+ s = dos_to_posix (s);
+#endif
+
+ push (s);
}
String
File_path::to_string () const
{
String s;
- int n = size ();
- for (int i = 0; i < n; i++)
+ for (int i=0; i< size (); i++)
{
s = s + elem (i);
- if (i < n - 1)
+ if (i < size () -1 )
s += ":";
}
return s;
#ifndef AXES_HH
#define AXES_HH
-#include <assert.h>
-
enum Axis {
X_AXIS =0,
Y_AXIS =1,
NO_AXES=2,
};
-static inline
-Axis
-incr (Axis &a)
-{
- assert (a < NO_AXES);
- a = Axis (int (a) + 1);
- return a;
-}
-
-static inline
-Axis
-other_axis (Axis a)
-{
- return a == Y_AXIS ? X_AXIS : Y_AXIS;
-}
+
+class String;
+
+String axis_name_string (Axis);
+
+
+/**
+ the operator ++ for Axis.
+ */
+Axis other_axis (Axis);
+Axis post_incr (Axis &);
+Axis incr (Axis &);
+//Axis operator++ (Axis);
+
+
#endif // AXES_HH
+++ /dev/null
-/*
- file-name.hh -- declare File_name
-
- source file of the Flower Library
-
- (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#ifndef FILE_NAME_HH
-#define FILE_NAME_HH
-
-#include "array.hh"
-#include "string.hh"
-
-class File_name
-{
-public:
- String root_;
- String dir_;
- String base_;
- String ext_;
-
- File_name (String);
-
- String to_string () const;
- char const *to_str0 () const;
-};
-
-#endif /* FILE_NAME */
/*
- file-path.hh -- declare File_name and File_path
+ file-path.hh -- declare Path and File_path
source file of the Flower Library
#ifndef FILE_PATH_HH
#define FILE_PATH_HH
-#include "array.hh"
#include "string.hh"
+#include "array.hh"
+
/**
search in directories for a file.
TODO: add a unix style PATH interface
*/
-class File_path : private Array<String>
+class Path
{
public:
- String find (String name) const;
- String find (String name, char const *extensions[]);
+ String root;
+ String dir;
+ String base;
+ String ext;
+
String to_string () const;
- bool try_append (String str);
- void append (String str) { Array<String>::push (str); }
- void parse_path (String);
+};
+
+class File_path : private Array<String>
+{
+public:
+ String find (String nm) const;
+
+ Array<String>::push;
void prepend (String str) { Array<String>::insert (str, 0); }
+ String to_string ()const;
+ bool try_add (String str);
+ void add (String);
+ void parse_path (String);
};
+Path split_path (String path);
+
#endif /* FILE_PATH */
struct Offset;
struct Long_option_init;
struct Rational;
-class File_name;
-class File_path;
+struct File_path;
struct Getopt_long;
struct String_data;
struct String_handle;
#ifndef OFFSET_HH
#define OFFSET_HH
-#include "flower-proto.hh"
#include "real.hh"
#include "axes.hh"
#include "arithmetic-operator.hh"
-#include "string.hh"
+
+struct Offset;
Offset complex_multiply (Offset, Offset);
Offset complex_divide (Offset, Offset);
/** 2d vector
- should change to Complex -- how is vector == complex?
-
- ughr wat een beerput
+ should change to Complex
*/
-class Offset
-{
+struct Offset {
public:
Real coordinate_a_[NO_AXES];
- Real &operator[] (Axis i)
- {
+ Real &operator[] (Axis i) {
return coordinate_a_[i];
}
-
- Real operator[] (Axis i) const
- {
+ Real operator[] (Axis i) const{
return coordinate_a_[i];
}
- Offset& operator+= (Offset o)
- {
- (*this)[X_AXIS] += o[X_AXIS];
- (*this)[Y_AXIS] += o[Y_AXIS];
+ Offset& operator+= (Offset o) {
+ (*this)[X_AXIS] += o[X_AXIS];
+ (*this)[Y_AXIS] += o[Y_AXIS];
return *this;
}
-
- Offset operator - () const
- {
+ Offset operator - () const {
Offset o = *this;
o[X_AXIS] = - o[X_AXIS];
o[Y_AXIS] = - o[Y_AXIS];
return o;
}
-
- Offset& operator-= (Offset o)
- {
- (*this)[X_AXIS] -= o[X_AXIS];
- (*this)[Y_AXIS] -= o[Y_AXIS];
+ Offset& operator-= (Offset o) {
+ (*this)[X_AXIS] -= o[X_AXIS];
+ (*this)[Y_AXIS] -= o[Y_AXIS];
return *this;
}
- Offset &scale (Offset o)
- {
- (*this)[X_AXIS] *= o[X_AXIS];
- (*this)[Y_AXIS] *= o[Y_AXIS];
+ Offset &scale (Offset o) {
+ (*this)[X_AXIS] *= o[X_AXIS];
+ (*this)[Y_AXIS] *= o[Y_AXIS];
return *this;
}
-
- Offset &operator *= (Real a)
- {
- (*this)[X_AXIS] *= a;
- (*this)[Y_AXIS] *= a;
+ Offset &operator *= (Real a) {
+ (*this)[X_AXIS] *= a;
+ (*this)[Y_AXIS] *= a;
return *this;
}
- Offset (Real ix , Real iy)
- {
+ Offset (Real ix , Real iy) {
coordinate_a_[X_AXIS] =ix;
coordinate_a_[Y_AXIS] =iy;
}
-
- Offset ()
- {
- coordinate_a_[X_AXIS] = coordinate_a_[Y_AXIS]= 0.0;
+ Offset () {
+ coordinate_a_[X_AXIS]=
+ coordinate_a_[Y_AXIS]=
+ 0.0;
}
String to_string () const;
- Offset& mirror (Axis a)
- {
- coordinate_a_[a] = - coordinate_a_[a];
- return *this;
- }
-
+ void mirror (Axis);
Real arg () const;
Real length () const;
-
- //wtf, How is Offset a Complex? is this used?
- Offset operator *= (Offset z2)
- {
+ Offset operator *= (Offset z2) {
*this = complex_multiply (*this,z2);
return *this;
}
return o1;
}
-inline Offset
-mirror (Offset o, Axis a)
-{
- o.mirror (a);
- return o;
-}
-
-#endif /* OFFSET_HH */
+#endif // OFFSET_HH
/// "cccc"
String to_string (char c, int n = 1);
String to_string (int i, char const* format = 0);
-String to_string (double f, char const* format = 0);
+String to_string (double f , char const* format = 0);
String to_string (long b);
String to_string (bool b);
String to_string (char const* format, ... );
#include <typeinfo>
-#define classname(class_ptr) demangle_classname (typeid (*(class_ptr)))
+#define classname(class_ptr) demangle_classname (typeid (* (class_ptr)))
const char *
demangle_classname (std::type_info const &);
(c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
+
#ifndef WARN_HH
#define WARN_HH
#include "string.hh"
-void error (String message_string);
-void message (String s);
-void non_fatal_error (String);
void programming_error (String s);
void warning (String message_string);
-
-#define progress_indication message
-
-#endif /* WARN_HH */
+void error (String message_string);
+void non_fatal_error (String);
+#endif // WARN_HH
{
return sqrt (sqr (coordinate_a_[X_AXIS]) + sqr (coordinate_a_[Y_AXIS]));
}
+void
+Offset::mirror (Axis a)
+{
+ coordinate_a_[a] = - coordinate_a_[a];
+}
#include "parse-afm.hh"
#include "warn.hh"
-#define METATYPE1_BUG /* Parse Metatype1's (version unknown)
- 'Generated' global tag as comment. */
-
#define lineterm EOL /* line terminating character */
#define lineterm_alt '\r' /* alternative line terminating character */
#define normalEOF 1 /* return code from parsing routines used only */
ASCENDER, CHARBBOX, CODE, COMPCHAR, CAPHEIGHT, COMMENT,
DESCENDER, ENCODINGSCHEME, ENDCHARMETRICS, ENDCOMPOSITES,
ENDFONTMETRICS, ENDKERNDATA, ENDKERNPAIRS, ENDTRACKKERN,
- FAMILYNAME, FONTBBOX, FONTNAME, FULLNAME,
-#ifdef METATYPE1_BUG
- GENERATED,
-#endif
- ISFIXEDPITCH,
+ FAMILYNAME, FONTBBOX, FONTNAME, FULLNAME, ISFIXEDPITCH,
ITALICANGLE, KERNPAIR, KERNPAIRXAMT, LIGATURE, CHARNAME,
NOTICE, COMPCHARPIECE, STARTCHARMETRICS, STARTCOMPOSITES,
STARTFONTMETRICS, STARTKERNDATA, STARTKERNPAIRS,
"Ascender", "B", "C", "CC", "CapHeight", "Comment",
"Descender", "EncodingScheme", "EndCharMetrics", "EndComposites",
"EndFontMetrics", "EndKernData", "EndKernPairs", "EndTrackKern",
- "FamilyName", "FontBBox", "FontName", "FullName",
-#ifdef METATYPE1_BUG
- "Generated",
-#endif
- "IsFixedPitch",
+ "FamilyName", "FontBBox", "FontName", "FullName", "IsFixedPitch",
"ItalicAngle", "KP", "KPX", "L", "N",
"Notice", "PCC", "StartCharMetrics", "StartComposites",
"StartFontMetrics", "StartKernData", "StartKernPairs",
* reads all tokens until the next end-of-line.
*/
-static char*
-token (FILE *stream)
+static char *token (FILE *stream)
{
int ch, idx;
* more than one word (like Comment lines and FullName).
*/
-static char*
-linetoken (FILE *stream)
+static char *linetoken (FILE *stream)
{
int ch, idx;
* The algorithm is a standard Knuth binary search.
*/
-static enum parseKey
-recognize (register char *ident)
+static enum parseKey recognize ( register char *ident)
{
int lower = 0,
upper = (int) NOPE,
while ((upper >= lower) && !found)
{
midpoint = (lower + upper)/2;
- if (keyStrings[midpoint] == NULL)
- break;
+ if (keyStrings[midpoint] == NULL) break;
cmpvalue = strncmp (ident, keyStrings[midpoint], MAX_NAME);
- if (cmpvalue == 0)
- found = TRUE;
- else
- if (cmpvalue < 0)
- upper = midpoint - 1;
- else
- lower = midpoint + 1;
- }
+ if (cmpvalue == 0) found = TRUE;
+ else if (cmpvalue < 0) upper = midpoint - 1;
+ else lower = midpoint + 1;
+ } /* while */
- if (found)
- return (enum parseKey) midpoint;
- else
- return NOPE;
-}
+ if (found) return (enum parseKey) midpoint;
+ else return NOPE;
+
+} /* recognize */
/************************* parseGlobals *****************************/
* parseFile to determine if there is more file to parse.
*/
-static BOOL
-parseGlobals (FILE *fp, register AFM_GlobalFontInfo *gfi)
+static BOOL parseGlobals (FILE *fp, register AFM_GlobalFontInfo *gfi)
{
BOOL cont = TRUE, save = (gfi != NULL);
int error = AFM_ok;
strcpy (gfi->afmVersion, keyword);
break;
case COMMENT:
-#ifdef METATYPE1_BUG
- case GENERATED:
-#endif
keyword = linetoken (fp);
break;
case FONTNAME:
} /* parseGlobals */
-#if 0
+
/************************* initializeArray ************************/
/* Unmapped character codes are (at Adobe Systems) assigned the
* file is reset to be where it was upon entering this function.
*/
-static int
-initializeArray (FILE *fp, register int *cwi)
+static int initializeArray (FILE *fp, register int *cwi)
{
BOOL cont = TRUE, found = FALSE;
long opos = ftell (fp);
return (error);
} /* initializeArray */
-#endif
+
/************************* parseCharWidths **************************/
* parseFile to determine if there is more file to parse.
*/
-static int
-parseCharWidths (FILE *fp, register int *cwi)
+static int parseCharWidths (FILE *fp, register int *cwi)
{
BOOL cont = TRUE, save = (cwi != NULL);
int pos = 0, error = AFM_ok;
* parseFile to determine if there is more file to parse.
*/
-static int
-parseCharMetrics (FILE *fp, register AFM_Font_info *fi)
+static int parseCharMetrics (FILE *fp, register AFM_Font_info *fi)
{
BOOL cont = TRUE, firstTime = TRUE;
int error = AFM_ok, count = 0;
* parseFile to determine if there is more file to parse.
*/
-static int
-parseAFM_TrackKernData (FILE *fp, register AFM_Font_info *fi)
+static int parseAFM_TrackKernData (FILE *fp, register AFM_Font_info *fi)
{
BOOL cont = TRUE, save = (fi->tkd != NULL);
int pos = 0, error = AFM_ok, tcount = 0;
switch (recognize (keyword))
{
case COMMENT:
-#ifdef METATYPE1_BUG
- case GENERATED:
-#endif
keyword = linetoken (fp);
break;
case TRACKKERN:
* parseFile to determine if there is more file to parse.
*/
-static int
-parseAFM_PairKernData (FILE *fp, register AFM_Font_info *fi)
+static int parseAFM_PairKernData (FILE *fp, register AFM_Font_info *fi)
{
BOOL cont = TRUE, save = (fi->pkd != NULL);
int pos = 0, error = AFM_ok, pcount = 0;
* parseFile to determine if there is more file to parse.
*/
-static int
-parseAFM_CompCharData (FILE *fp, register AFM_Font_info *fi)
+static int parseAFM_CompCharData (FILE *fp, register AFM_Font_info *fi)
{
BOOL cont = TRUE, firstTime = TRUE, save = (fi->ccd != NULL);
int pos = 0, j = 0, error = AFM_ok, ccount = 0, pcount = 0;
* pointer upon return of this function is undefined.
*/
-int
-AFM_parseFile (FILE *fp, AFM_Font_info **fi, int flags)
+extern int AFM_parseFile (FILE *fp, AFM_Font_info **fi, int flags)
{
int code = AFM_ok; /* return code from each of the parsing routines */
/* storage data for the global variable ident */
if (!ident)
ident = (char *) calloc (MAX_NAME, sizeof (char));
- if (ident == NULL)
- {
- error = AFM_storageProblem;
- return error;
- }
-
+ if (ident == NULL) {error = AFM_storageProblem; return (error);}
+
(*fi) = (AFM_Font_info *) calloc (1, sizeof (AFM_Font_info));
- if ((*fi) == NULL)
- {
- error = AFM_storageProblem;
- return error;
- }
+ if ((*fi) == NULL) {error = AFM_storageProblem; return (error);}
if (flags & P_G)
{
- (*fi)->gfi = (AFM_GlobalFontInfo *) calloc (1,
- sizeof (AFM_GlobalFontInfo));
- if ((*fi)->gfi == NULL)
- {
- error = AFM_storageProblem;
- return error;
- }
+ (*fi)->gfi = (AFM_GlobalFontInfo *) calloc (1, sizeof (AFM_GlobalFontInfo));
+ if ((*fi)->gfi == NULL) {error = AFM_storageProblem; return (error);}
}
/* The AFM File begins with Global Font Information. This section */
{
(*fi)->cmi = (AFM_CharMetricInfo *)
calloc ((*fi)->numOfChars, sizeof (AFM_CharMetricInfo));
- if ((*fi)->cmi == NULL)
- {
- error = AFM_storageProblem;
- return error;
- }
+ if ((*fi)->cmi == NULL) {
+ error = AFM_storageProblem;
+ return (error);
+
+ }
code = parseCharMetrics (fp, *fi);
}
else
#include "warn.hh"
+
void
message (String s)
{
depth = ..
-SUBDIRS = test regression tutorial no-notation template mutopia
+SUBDIRS=test regression tutorial no-notation template mutopia
-examples = simple simple-song les-nereides puer-fragment wilhelmus paddy
+examples= les-nereides puer-fragment wilhelmus
LOCALSTEPMAKE_TEMPLATES=ly mutopia
EXTRA_DIST_FILES=paddy.abc
-\version "2.3.4"
+\version "2.2.0"
% A simple scale in LilyPond
%
%%
\score {
- \context Voice \relative c {
+ \context Voice \notes\relative c {
c' d e f g a b c
}
\paper { }
-\version "2.3.4"
+\version "2.2.0"
% Some beamed and slurred notes of different taste in LilyPond
%
% Type:
%%
\score {
- \context Voice \relative c {
+ \context Voice \notes\relative c {
a''2 ~ a4( e8[ )e] a,16[ a a a]
}
\paper { }
#(ly:set-option 'old-relative)
-\version "2.3.4"
+\version "2.2.0"
-one = \relative c{
+one = \notes\relative c{
c'' d e f
}
-two = \relative c{
+two = \notes\relative c{
\clef "bass"
c'2 g2
}
#(ly:set-option 'old-relative)
-\version "2.3.4"
-\encoding "latin1"
+\version "2.2.0"
+
\header {
composer = "ARTHUR GRAY"
title = "LES NÉRÉIDES"
(lambda (elt) (equal? text (ly:get-grob-property elt 'text))))
-treble = \new Voice \relative c''{
+treble = \new Voice \notes\relative c''{
\key a \major
r2
| %2
\bar "||"
}
-trebleTwo = \new Voice \relative c''{
+trebleTwo = \new Voice \notes\relative c''{
\stemDown
\slurDown
% \fingerDown
<a cis,>)]
}
-bass = \new Voice \relative c{
+bass = \new Voice \notes\relative c{
\partial 2
\key a \major
a)]
}
-bassTwo = \new Voice \relative c{
+bassTwo = \new Voice \notes\relative c{
\skip 2
\skip 1*2
\skip 2
cis'4( bis)
}
-middleDynamics = {
+middleDynamics = \notes{
\override Dynamics.TextScript #'padding = #-1 %tweak
s2
s1*2
s8\!
}
-theScore = \score{
+
+\score{
\context PianoStaff <<
\context Staff=treble <<
\treble
>>
\paper {
\context {
- \Score
+ \ScoreContext
pedalSustainStrings = #'("Ped." "*Ped." "*")
\remove Bar_number_engraver
}
}
\context {
- \PianoStaff
+ \PianoStaffContext
\accepts Dynamics
\override VerticalAlignment #'forced-distance = #7
}
}
}
-
-\book{
- \score { \theScore }
-}
-
+
%%% Local variables:
%%% LilyPond-indent-level:4
%%% End:
-\version "2.3.4"
+\version "2.2.0"
\header {
title = "Title"
subtitle = "Subtitle"
copyright = "Public Domain"
}
-\version "2.3.4"
+\version "2.2.0"
\include "nederlands.ly"
-global = {
+global = \notes {
\key a \minor
\time 2/4
s2*10
\bar "|."
}
-i = \context Staff \relative c''{
+i = \context Staff \notes\relative c''{
\context Voice=i
\voiceOne
}
-ii = \context Staff \relative c'{
+ii = \context Staff \notes\relative c'{
\context Voice=ii
\voiceTwo
}
-lower = \context Staff \relative c{
+lower = \context Staff \notes \relative c{
\context Voice=iii
<as as'>4 <es es'> | r <as as'> | <des, des'> <f f'> | <c c'> r |
\paper {
\context{
- \Voice
+ \VoiceContext
}
}
\midi {
}
-\version "2.3.4"
+\version "2.2.0"
manuscriptBreak = { \break }
-#(set-global-staff-size (/ (* 5.8 72.27) 25.4))
-
-\bookpaper {
-%#(set-global-staff-size (* 5.8 mm))
+\paper {
+ #(paper-set-staff-size (* 5.8 mm))
linewidth = #(* mm 160)
indent = 8\mm
interscoreline = 2.\mm
}
-melody = \relative c'' \repeat volta 2 \context Voice = singer {
+melody = \notes \relative c'' \repeat volta 2 \context Voice = singer {
\time 6/8
\autoBeamOff
s1*0^\markup { \bold \large\bigger\bigger { \hspace #-3.0 Lieblich, etwas geschwind } }
zieht mich him -- mel -- wärts, Sehn -- sucht zieht mich him -- mel -- wärts.
}
-pianoRH = \relative c''' \repeat volta 2 {
+pianoRH = \notes \relative c''' \repeat volta 2 {
#(set-accidental-style 'modern)
g16(_\p fis a g fis g f e d c b a ) |
<g e>8( <es fis a> <d f b> <c e c'>) r8 r |
<c c'>8 r r <c, g e>8 r r\fermata |
}
-pianoLH = \relative c'' \repeat volta 2 {
+pianoLH = \notes \relative c'' \repeat volta 2 {
#(set-accidental-style 'modern)
g16( fis a g fis g f e d c b a) |
\clef bass g4.( c,8) r r
<c g e c>8 <c e g> <c e g> <c e g> <c e g> <c e g> |
<c e g> r r <c, c,>8 r r\fermata \clef treble
}
-\book {
+
\score {
<< \time 6/8
\paper {
\context {
- \Lyrics
+ \LyricsContext
minimumVerticalExtent = #'(-1.0 . 0)
}
\context {
- \Score
+ \ScoreContext
\override Beam #'thickness = #0.55
\override SpacingSpanner #'spacing-increment = #1.0
\override Slur #'height-limit = #1.5
}
\context {
- \PianoStaff
+ \PianoStaffContext
\override VerticalAlignment #'forced-distance = #10
}
\context {
- \Staff
+ \StaffContext
minimumVerticalExtent = #'(-3. . 6)
}
- inputencoding = #"latin1"
}
\midi {
\tempo 4 = 70
}
}
-}
footer = "Mutopia-2001/04/27-xx"
}
-\version "2.3.4"
+\version "2.2.0"
dynamicUp = \override DynamicLineSpanner #'direction = #1
dynamicRevert = \revert DynamicLineSpanner #'direction
#(set-global-staff-size 16)
-vocalVerse = \relative c''{
+vocalVerse = \notes\relative c''{
\dynamicUp
\times 2/3 { g8[( as)] g } c4. g8 |
\times 2/3 { f8[( g)] f } c'4 f,8 r |
c!2. |
}
-vocalThrough = \relative c{
+vocalThrough = \notes\relative c{
\dynamicUp
g''8. g16 b8. b16 d8. d16 |
c4 b r |
be -- glük -- ke mich!
}
-trebleIntro = \relative c{
+trebleIntro = \notes\relative c{
r8^"\bf Mäßig"\pp <g' c>-. <c es>-. <g c>-. <c es>-. <g c>-. |
r8 <as c>-. <c es>-. <as c>-. <c es>-. <as c>-. |
r8 <as c>-. <c d>-. <as c>-. <c d>-. <as c>-. |
r8 <g b>-. <b d>-. <g b>-. <b d>-. <g b>-. |
}
-trebleVerseOne = \relative c{
+trebleVerseOne = \notes\relative c{
%5
r8 <g' c> <c es> <g c> <c es> <g c> |
r8 <f c'> <c' d> <f, c'> <c' d> <f, c'> |
<a a'>4.-> <f f'>8) |
}
-trebleEentje = \relative c' \context Voice {
+trebleEentje = \notes \relative c' \context Voice {
\stemBoth
<e e'>2 r4 |
<f as!>2\(\mf <as c>8.(-> <f as>16)\) |
<e g>2 r4 |
}
-trebleThrough = \relative c'{
+trebleThrough = \notes \relative c'{
\stemBoth
<e e'>2. |
%61
<g e' g>2.\fermata |
}
-bassIntro = \relative c{
+bassIntro = \notes\relative c{
\dynamicUp
%1
<c, c'>2 r4 |
<g g'>2 r4 |
}
-bassVerseOne = \relative c{
+bassVerseOne = \notes\relative c{
% \clef bass
\dynamicUp
%5
c,8 <c' e g>[ <e g c> <c e g> <e g c> <c e g>] |
}
-bassEentje = \relative c{
+bassEentje = \notes\relative c{
\dynamicUp
<c, c'>8 <c' f as!>[ <f as c> <c f as> <f as c> <c f as>] |
c,8 <c' e g>[ <e g c> <c e g> <e g c> <c e g>] |
c,8 <e' g>[ <g c> <e g> <g c> <e g>] |
}
-bassThrough = \relative c{
+bassThrough = \notes\relative c{
\dynamicUp
%61
<g, g'>8^"cresc." <g' b d>[ <b d f> <g b d> <as! b d >-> <b d f>] |
<c, g' c>2._\fermata |
}
-global = {
+global = \notes{
\time 3/4
\key es \major
\skip 1 * 3/4 * 4
\lyricThrough
} }
-vocals = \context Voice = leise {
+vocals = \context Voice = leise \notes {
\clef treble
% certainly no auto-beaming for vocals
\autoBeamOff
-\version "2.3.4"
+\version "2.2.0"
% #(ly:set-point-and-click 'line-column)
-forcedLastBreak = { \break }
+forcedLastBreak = \notes { \break }
%% We want this to perfectly match the Baerenreiter spacing.
%% If we're not using 6 systems, there's definately a problem.
}
-sarabandeA = \context Voice \relative c {
+sarabandeA = \context Voice \notes \relative c {
\override Staff.NoteCollision #'merge-differently-dotted = ##t
}
-sarabandeCelloGlobal = {
+sarabandeCelloGlobal = \notes{
\time 3/4
\key f \major
\clef bass
}
}
-sarabandeCelloScripts = {
+sarabandeCelloScripts = \notes{
}
sarabandeCelloStaff = \context Staff <<
% size perversions
smallerPaper = \paper {
- \context { \Staff
+ \context { \StaffContext
fontSize = #-1
\override StaffSymbol #'staff-space = #0.8
}
- \context { \Score
+ \context { \ScoreContext
\override SpacingSpanner #'spacing-increment = #0.96
}
baerPaper = \paper {
indent = 7. \mm
linewidth =183.5 \mm
-% interscoreline=4.0\mm
+ interscoreline=4.0\mm
\context {
- \Score
+ \ScoreContext
% \override System #'print-function = #box-grob-stencil
}
}
-\bookpaper {
- raggedbottom = ##t
-}
+
\score{
\sarabandeCelloStaff
\paper{
#(ly:set-option 'old-relative)
-\version "2.3.4"
+\version "2.2.0"
%{
Header for Petites Preludes.
footer = "Mutopia-2003/08/22-nr"
}
-one = \relative c{
+one = \notes\relative c{
\skip 1 |
\stemUp
r4 d''2 cis4 |
\bar "|."
}
-two = \relative c{
+two = \notes\relative c{
r16 d'' c bes a bes f g
a8.\mordent bes16 g8.\prall f16 |
\stemDown
fis1
}
-three = \relative c{
+three = \notes\relative c{
\stemUp
f2 e |
\stemBoth
\bar "|."
}
-four = \relative c{
+four = \notes\relative c{
\stemDown
d2 cis |
\skip 1*2 |
>>
}
-global = {
+global = \notes{
\time 4/4
\key f \major
}
\paper{
linewidth = 17.0 \cm
\context {
- \Score
+ \ScoreContext
\override SpacingSpanner #'spacing-increment = #2.0
}
}
style = "baroque"
copyright = "Public Domain"
maintainer = "hanwen@cs.uu.nl"
- %% TODO: handle \footer, \head[er] properly
- footer = "Mutopia-2002/08/19-6"
-
- tagline = \markup { \smaller
- \column <
- \fill-line < \footer "" >
- \fill-line < { "This music is part of the Mutopia project, "
- \typewriter { "http://sca.uwaterloo.ca/Mutopia/" }
- "." } >
- \fill-line < { "It has been typeset and placed in the public "
- "domain by " \maintainer "." } >
- \fill-line < { "Unrestricted modification and redistribution "
- "is permitted and encouraged---copy this music "
- "and share it!" } >
- >
- }
+ mutopiapublicdomain = "\\parbox{\\hsize}{\\thefooter\\quad\\small
+ \\\\This music is part of the Mutopia project,
+ \\texttt{http://www.mutopiaproject.org/}\\\\It has been typeset
+ and placed in the public domain by " + \maintainer +
+ ".\\\\Unrestricted modification and redistribution is permitted
+ and encouraged---copy this music and share it.}"
+ tagline = \mutopiapublicdomain
lastupdated = "2002/August/19"
+ footer = "Mutopia-2002/08/19-6"
}
%}
-\version "2.3.4"
+\version "2.2.0"
-dux = \context Voice=two \relative c''{
+dux = \context Voice=two \notes \relative c''{
\voiceTwo
\clef violin
}
-comes = \context Voice=one \relative c'' {
+comes = \context Voice=one \notes \relative c'' {
\voiceOne
\override MultiMeasureRest #'staff-position = #6
R1 |
f,16 g as4 g16 f e2 |
}
-bassdux = \context Voice=three \relative c' {
+bassdux = \context Voice=three \notes \relative c' {
\clef bass
R1 |
R |
>>
}
-
-\book {
\score {
- \context PianoStaff <<
+
+ \notes \context PianoStaff <<
\override Score.TimeSignature #'style = #'C
\context Staff = treble <<
\key c \minor
\paper {
linewidth = 18.0 \cm
- \context { \Score
+ \context { \ScoreContext
\override SpacingSpanner #'spacing-increment = #1.0
\override SpacingSpanner #'shortest-duration-space = #1.9
}
}
}
-}
+
\include "deutsch.ly"
#(set-global-staff-size 16)
-
-\version "2.3.4"
+\version "2.2.0"
\header {
title = "Romanzen"
u = { \change Staff = up \stemDown }
m = { \change Staff = mid \stemUp }
-
-%
-% d = .. complains about note names.
-%
-#(define d #{ \change Staff = down \stemUp #})
+d = { \change Staff = down \stemUp }
forcedBreak = \break
-global = { \key fis \major \time 6/8
+global = \notes { \key fis \major \time 6/8
\set Score.beatLength = #(ly:make-moment 3 8)
\repeat volta 2 { s2.*8 } s2.*26 \bar "|."
}
-righta = \transpose c cis' {
+righta = \notes \transpose c cis' {
% \stemUp \slurUp \tieUp
\stemUp
\override Slur #'attachment = #'(stem . stem)
}
-rightb = \transpose c cis' {
+rightb = \notes \transpose c cis' {
\relative c { \stemDown \slurDown
\repeat volta 2 {
a4^1( g8^1 b4^1 a8^1 |
}
}
-lefta = \transpose c cis {
+lefta = \notes \transpose c cis {
\stemUp \slurUp \tieUp
\repeat volta 2 {
f4^1( e8^1 g4^1 f8^1 |
f~ f\fermata |
}
-leftb = \transpose c cis {
+leftb = \notes \transpose c cis {
\stemDown \slurDown \tieDown
\repeat volta 2 {
f16^\p c f, c e c-3 g c-2 f, c f c |
c c8 c c16 r4_\fermata r8 \bar "|." |
}
-\score {
+\score { \notes
\context PianoStaff <<
#(set-accidental-style 'piano-cautionary)
\override PianoStaff.NoteCollision #'merge-differently-dotted = ##t
\RemoveEmptyStaffContext
}
\context {
- \Score
+ \ScoreContext
\override SpacingSpanner #'common-shortest-duration = #(ly:make-moment 1 8)
}
\context {
- \PianoStaff
+ \PianoStaffContext
\override VerticalAlignment #'forced-distance = #13.0
}
}
%}
-\version "2.3.4"
+\version "2.2.0"
\include "mozart-hrn3-defs.ly"
\include "mozart-hrn3-allegro.ly"
-
-\book {
-\score
-{
- { \transpose c' bes \allegro }
- \paper{ }
- \header { piece = "allegro" opus = "" }
- \midi{ \tempo 4=90 }
-}
-
-
-\score
-{
- { \transpose c' bes \romanze }
- \header { piece = "romanze" opus = "" }
- \midi{ \tempo 4 = 70 }
- \paper{}
-}
-
-
-\score
-{
- { \transpose c' bes \rondo }
- \header { piece = "rondo" opus = "" }
- \midi{ \tempo 4 = 100 }
- \paper { }
-}
-
-
-}
-\version "2.3.4"
+#(ly:set-option 'old-relative)
+\version "2.2.0"
\include "mozart-hrn3-defs.ly"
allegro =
-
+ \notes
\relative c'
{
\time 4/4
}
+
+\score
+{
+ \notes { \transpose c' bes \allegro }
+ \paper{ }
+ \header { piece = "allegro" opus = "" }
+ \midi{ \tempo 4=90 }
+}
+
endlonggrace = \revert Stem #'stroke-style
ritenuto = \markup { \italic "rit." }
-\version "2.3.4"
+\version "2.2.0"
-cresc = {
+cresc = \notes {
#(ly:export (make-event-chord (list (make-span-event 'CrescendoEvent START))))
\set crescendoText = \markup { \italic \bold "cresc." }
\set crescendoSpanner = #'dashed-line
\paper{
\context {
- \Score
+ \ScoreContext
skipBars = ##t
midiInstrument = #"french horn"
%% try to mimic Breitkopf
\override Slur #'beautiful = #0.3
}
\context {
- \Staff
+ \StaffContext
minimumVerticalExtent = #'(-4.5 . 4.5)
}
% #(define fonts my-sheet)
-\version "2.3.4"
+#(ly:set-option 'old-relative)
+
+\version "2.2.0"
\include "mozart-hrn3-defs.ly"
-romanze = \relative c' {
+romanze = \notes \relative c' {
\key f \major
\time 2/2
\set Score.skipBars = ##t
}
+
+\score
+{
+ \notes { \transpose c' bes \romanze }
+ \header { piece = "romanze" opus = "" }
+ \midi{ \tempo 4 = 70 }
+ \paper{}
+}
+
-\version "2.3.4"
+#(ly:set-option 'old-relative)
+\version "2.2.0"
% \include "mozart-hrn3-defs.ly"
-rondotheme = \relative c' {
+rondotheme = \notes \relative c' {
c'8[ c c] c[ c c]
c4( cis8 d) r g,
d'8[ d d] d[ d d]
e4.( d8) r r |
}
-lipbreaker = \relative c'
+lipbreaker = \notes \relative c'
{
r8 g'[-. g-.] c[( e) g,-.]
c[( e) g,-.] c[( e) g,-.]
bothsixteenth = { \set stemLeftBeamCount = 2
\set stemRightBeamCount = 2 }
-rondo = \relative c'
+rondo = \notes \relative c'
{
\partial 8
\time 6/8
\rondotheme
R2.*13 |
- r8 r^\fermata d' d[ e f]
+ r8 r^\fermata d d[ e f]
g[ ( e) c-.] d[( e) d-.]
c4 c8 d[ e f]
g[( e) c-.] d[( e) d-.]
d[( g)] r r4 r8
R2.*1
\lipbreaker
- c,,4 r8 c'[ d e]
+ c4 r8 c'[ d e]
d4( g8) c,[ d e]
d4 r8 r4 r8
R2. |
\mark "E"
R2.*9 |
\lipbreaker
- c,8[ c' c] c4.~
+ c8[ c' c] c4.~
c8[ c d] e[ e fis]
g4 r8 r4 r8
R2.
c4 r8 r4 r8 \bar "|."
}
+\score
+{
+ \notes { \transpose c' bes \rondo }
+ \header { piece = "rondo" opus = "" }
+ \midi{ \tempo 4 = 100 }
+ \paper { }
+}
+
#(ly:set-option 'old-relative)
-\version "2.3.2"
+\version "2.2.0"
\header {
texidoc = "@cindex Midi Volume Equaliser
The full orchestra plays a notes, where groups stop one after
-\version "2.3.2"
+\version "2.2.0"
\header {
texidoc = "The @code{Recording_group_engraver} will record events
listener = \paper {
\context {
- \Voice
+ \VoiceContext
\type "Recording_group_engraver"
recordEventSequence = #notice-the-events
}
-\version "2.3.4"
+\version "2.2.0"
\header {
title = "Puer natus est nobis (excerptum)"
subtitle = "Antiphona ad introitum VII"
%%% but this is intentional for editorial purposes (simplifies some
%%% global search/replace operations in emacs).
-cantus = \context VaticanaVoice = "cantus" {
+cantus = \context VaticanaVoice = "cantus" \notes {
\[ g4\melisma %%% Pu-
\pes
d'\melismaEnd
raggedright = ##t
packed = ##t
\context {
- \Score
+ \ScoreContext
\remove Bar_number_engraver
% \override SpacingSpanner #'spacing-increment = #0.5
timing = ##f
-\version "2.3.4"
+\version "2.2.0"
%% +.ly: Be the first .ly file for lys-to-tely.py.
%% Better to make lys-to-tely.py include "introduction.texi" or
%% other .texi documents too?
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Cautionary accidentals are indicated using either
}
\score {
- {
+ \notes {
c''4
cis''?4
\override Staff.Accidental #'cautionary-style = #'smaller
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "If two forced accidentals happen at the same time, only one
sharp sign is printed."
}
-\score { \transpose c c'
+\score { \notes \transpose c c'
\context Staff <<
\key g \major
\context Voice=va { \stemUp c' fis! }
-\version "2.3.4"
+\version "2.2.0"
\header {
\score {
-
+ \notes
\relative c {
disis
dis
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc="
-This shows how accidentals in different octaves are handled. The note names
-are also automatically printed but the octavation has been dropped out.
+This shows how accidentals in different octaves are handled.
+(DOCME)
"
-mel = \transpose c c' {
+mel = \notes \transpose c c' {
\time 4/4 \key d \major
gis4 g' g gis' | gis2 g' | g1 | gis | g | gis' | g |
fis4 f' f fis' | fis2 f' | f1 | fis | f | fis' | f |
-\version "2.3.4"
+\version "2.2.0"
\header {
\score {
- \context Voice \relative c'
+ \notes \context Voice \relative c'
{
cis4
c4
texidoc = "Quarter tone notation is supported, including
threequarters flat."
}
-\version "2.3.4"
+\version "2.2.0"
\score {
- \relative c'' {
+ \notes \relative c'' {
\time 12/4
ceses4
ceseh
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="
A sharp sign after a double sharp sign, as well as a flat sign
-thenotes = \relative cis' { \time 4/4
+thenotes = \notes \relative cis' { \time 4/4
gisis'4 gis gisis ges |
}
-\version "2.3.4"
+\version "2.2.0"
\header {
}
-mus = \relative c' {
+mus = \notes \relative c' {
f1~
f2~f4 % ~ f8
fis8 gis8 ~
}
\score {
- <<
+ \notes <<
\new NoteNames \mus
\new Voice { \key g \major \mus }
>>
wreak havoc in the spacing when unbroken."
}
-\version "2.3.4"
+\version "2.2.0"
-rechts = \relative c' {
+rechts = \notes \relative c' {
\clef treble
\time 3/4
c8 b2 <g b des f>8 ~ |
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="
-voicea = \transpose c c' {
+voicea = \notes \transpose c c' {
\stemUp
fis2 a2 f4 fis a2
}
-voiceb = \transpose c c' {
+voiceb = \notes \transpose c c' {
\stemDown
c2 fis2 f4 c f2
}
\score {
<<
-
+ \notes
\new NoteNames {
\set printOctaveNames = ##f
\voicea
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="
"
}
-foo = \relative c'' { \key as \major dis4 dis dis!^"force" dis? }
+foo = \notes\relative c'' { \key as \major dis4 dis dis!^"force" dis? }
\score {
<< \foo
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="
This shows how accidentals are handled.
"
}
-mel = { \key d \major \time 4/4
+mel = \notes { \key d \major \time 4/4
d4 dis dis8 dis, d4 | d dis disis8 d, dis4 | d des disis8 dis, d4 | dis deses d dis ~ | dis dis ~ dis8 d, dis4 ~ | \break
dis dis cis c | c cis cisis cis | c ces cisis c | cis ceses c cis ~ | cis cis ~ cis cis \bar "|." | \break
}
-\score {
+\score { \notes
<<
\context Staff \transpose c c'' \mel
\context NoteNames{
@example
\context @{
- \Score
+ \ScoreContext
\override BreakAlignment #'break-align-orders = #(make-vector 3 '(
instrument-name
left-edge
@example
\context @{
- \Voice
+ \VoiceContext
\consists Ambitus_engraver
Ambitus \set #'note-head-style = #'noteheads-2mensural
Ambitus \set #'join-heads = ##f
%}
-\version "2.3.4"
+\version "2.2.0"
-upper = \relative c {
+upper = \notes \relative c {
\clef "treble"
\key c \minor
as'' c e bes f cis d e f g f e d f d e
f d e e d f d e e d f d e e d f d e
}
-lower = \relative c {
+lower = \notes \relative c {
\clef "treble"
\key e \major
e'2 b4 g a c es fis a cis b a g f e d
>> }
\paper {
\context {
- \Score
+ \ScoreContext
\override BreakAlignment #'break-align-orders = #(make-vector 3 '(
instrument-name
left-edge
))
}
\context {
- \Voice
+ \VoiceContext
\consists Ambitus_engraver
}
}
-\version "2.3.4"
+\version "2.2.0"
\header {
\paper { raggedright= ##t }
-\score { \relative c'' {
+\score { \notes \relative c'' {
c1 c1
%% todo: should put something interesting in the .tex output.
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "The @code{\applyoutput} expression is the most flexible way to
\score {
- \context Voice \relative c' {
+\notes \context Voice \relative c' {
\stemUp
\set autoBeaming = ##f
{ <d f g b>8
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="
A square bracket on the left indicates that the player should not
}
\score{
- \relative c''{
+ \notes\relative c''{
\arpeggioBracket
<fis, d a >\arpeggio
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Arpeggio stays clear of accidentals and flipped note heads."
}
\score{
- \transpose c c' {
+ \notes \transpose c c' {
<fis'' g d a>\arpeggio
<fis, g d a>\arpeggio
<fis'' g d a>\arpeggio
\paper {
raggedright = ##t
\context{
- \Staff
+ \StaffContext
connectArpeggios = ##t
}
}
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="
Arpeggios are supported, both cross-staff and broken single staff.
\score{
- \context PianoStaff <<
+ \context PianoStaff\notes <<
\new Staff \relative c''{
<fis, d a>\arpeggio
\override Staff.Arpeggio #'arpeggio-direction = #1
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="No auto beams will be put over (manual) repeat bars."
}
\score {
- {
+ \notes {
\time 3/4
a'4 b' c''8 \bar ":|:" d''8
}
\header {
texidoc = "The autobeamer may be switched off for a single note
- with @code{\\noBeam}."
+ with @code{\noBeam}."
}
-\version "2.3.4"
+\version "2.2.0"
\score {
- { c8 c-\noBeam c c }
+ \notes { c8 c-\noBeam c c }
}
texidoc = "Automatic beaming is also done on tuplets."
}
-\version "2.3.4"
+\version "2.2.0"
\score{
- \relative c''{
+ \notes\relative c''{
c8 c c c
\times 4/6 { c c c c c c}
}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Tuplet-spanner should not put (visible) brackets on
beams even if they're auto generated."
}
-\score { \relative c' {
+\score { \notes \relative c' {
\set tupletSpannerDuration = #(ly:make-moment 1 4)
\override TupletBracket #'bracket-visibility = #'if-no-beam
\times 2/3 {
}
-\version "2.3.4"
+\version "2.2.0"
\paper { raggedright = ##t }
\score {
- \relative c'' {
+ \notes \relative c'' {
a\longa a\breve
a1 a2 a4 a8 a16 a32 a64 a64
}
\paper {
\context {
- \Staff
+ \StaffContext
\remove "Clef_engraver"
%% \remove "Staff_symbol_engraver"
}
-\version "2.3.4"
+\version "2.2.0"
\header {
\paper { raggedright= ##t }
\score {
- \context PianoStaff <<
+ \notes \context PianoStaff <<
\context Staff = "up" {
\autochange \context Voice = VA << \relative c' { g4 c e d c r4 a g } >>
}
texidoc = "With balloon texts, objects in the output can be marked,
with lines and explanatory text added."
}
-\version "2.3.4"
+\version "2.2.0"
\score {
- {
+ \notes {
\relative c' {
+++ /dev/null
-\version "2.3.4"
-\header {
- texidoc = "The meaning of @code{|} is stored in the
-identifier @code{pipeSymbol}."
-}
-
-pipeSymbol = \bar "||"
-
-\score {
- { c'2 | c'2 | }
-}
-
-\version "2.3.4"
+\version "2.2.0"
\header {
}
\score {
- \relative c'' {
+ \notes \relative c'' {
\partial 4 c4
c1 c c
\set Score.currentBarNumber = #99999
\paper {
raggedright = ##t
\context {
- \Score
+ \ScoreContext
\override BarNumber #'break-visibility = #all-visible
}
}
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="
\paper { raggedright = ##t }
-onestaff = \new Staff\relative c'' {
+onestaff = \new Staff\notes\relative c'' {
\set Staff.instr = instr
\set Staff.instrument = instrument \mark "B"
c1 \mark "A" \break c2 c2 \break
}
-grstaff = \relative c''
+grstaff = \notes \relative c''
\context GrandStaff <<
\new Staff {
-\version "2.3.4"
+\version "2.2.0"
\header{ texidoc="A knee is made automatically when a horizontal
beam fits in a gap between note heads that is larger than a predefined
}
\score {
- \context Staff \relative c''{
+ \context Staff \notes\relative c''{
c'8[ c,,] c8[ e']
c,16[ e g c e g c c,,]
}
"
}
-\version "2.3.4"
+\version "2.2.0"
\paper { raggedright= ##t }
-\score { \relative c'' {
+\score { \notes \relative c'' {
\set Score.allowBeamBreak = ##t
\time 3/16 c16-[ d e \break f-]
}}
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="Simple beams on middle staffline are allowed to be
}
\score{
- \relative c'{
+ \notes\relative c'{
%%\override Staff.Stem #'beamed-lengths = #'(3.50)
%% c8[ d]
%% d[ c]
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc = "Concave beams should be horizontal. Informally spoken,
\score{
- \relative c'{
+ \notes\relative c'{
%% This case seems easy: second beam should be horizontal.
-\version "2.3.4"
+\version "2.2.0"
\header{
}
\score {
- \context PianoStaff <<
- \context Staff = "up" \relative c''{
+ \notes \context PianoStaff <<
+ \context Staff = "up" \notes\relative c''{
b8[ \change Staff="down" d,, ]
c[ \change Staff="up" c'' ]
b,[ \change Staff="down" d^"no knee" ]
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Cross staff (kneed) beams do not cause extreme slopes."
}
\score {
- \context PianoStaff <<
+ \notes\context PianoStaff <<
\context Staff = up
\relative c'' <<
{
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="
Beams can be typeset over fixed distance aligned staves, beam
}
\score{
\context PianoStaff <<
- \context Staff=one \relative c'{
+ \context Staff=one \notes\relative c'{
\stemUp c8[ c \change Staff=two \stemUp c c]
c[ c c c]
\change Staff=one
\stemUp c8[ c \change Staff=one \stemDown c c]
r2
}
- \context Staff=two \relative c'{
+ \context Staff=two \notes\relative c'{
\clef bass
s1
s1
-\version "2.3.4"
+\version "2.2.0"
\header { texidoc = "@cindex Beam Damp
Beams are less steep than the notes they encompass. " }
\score{
- \relative c''{
+ \notes\relative c''{
% \stemUp
% a16[ b b c]
% c[ b b a]
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="Beamed stems have standard lengths if possible. Quantization is switched off in this example."
}
\score{
- \relative c'{
+ \notes\relative c'{
\override Beam #'position-callbacks =
#`(,Beam::least_squares
,Beam::check_concave
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="
Beams should behave reasonably well, even under extreme circumstances.
"
}
-extreme = \relative c'' {
+extreme = \notes\relative c'' {
\stemBoth
g8[ c c,]
c16[ c'' a f]
-\version "2.3.4"
+\version "2.2.0"
\header {
}
-\score {
+\score { \notes
\relative c'
{
\override Stem #'french-beaming = ##t
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc=" Funky kneed beams with beamlets also work. The beamlets
\score {
- \relative c' {
+ \notes\relative c' {
c16 c''8 c,,16
c16 c''8 c16
c16 c,,8 c16
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "In complex configurations of knee beaming, according to
}
-\score {
+\score { \notes
\relative c'
{
\override Beam #'auto-knee-gap = #7
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Point-symmetric beams should receive the same
}
\score{
- \relative c'{
+ \notes\relative c'{
a8[ b'' a,, b'']
b8[ a,, b'' a,,]
}
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="
\score {
- \context Voice \relative c {
+ \context Voice \notes\relative c {
d''8[ d d] d[ g d]
c c
}
-\version "2.3.4"
+\version "2.2.0"
\header {
"Beaming can be overidden for individual stems."
}
\score {
- \relative c'' {
+ \notes \relative c'' {
c32[ c
%% WARNING: #'beaming is written, so this
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Kneed beams (often happens with cross-staff beams)
"
}
-\score {
+\score { \notes
\context PianoStaff \relative c' <<
\context Staff = SA {
\stemDown
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Explicit beams may cross barlines. "
}
\score {
- \relative c'' { c2. c8[ c8 c8 c8] }
+\notes \relative c'' { c2. c8[ c8 c8 c8] }
\paper { raggedright= ##t }
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc=" Beams on ledgered notes should always reach the middle staff
\score {
- \context Voice \relative c {
+ \context Voice \notes\relative c {
f8[ f] f64[ f]
\grace {
f8[ e8]
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Beams and ties may be entered in postfix notation, separating the
\score
{
- \relative c''
+ \notes\relative c''
{
c8[~ c]
}
}
-\version "2.3.4"
+\version "2.2.0"
\score {
- \relative c''{
+ \notes \relative c''{
\time 3/8
a'16[ b] g[ b]
a32[ b] g[ b]
-\version "2.3.4"
+\version "2.2.0"
\header{
}
\score{
- \relative c' {
+ \notes\relative c' {
c8[ c] a''[ a]
a,[ a] c[ c]
d,8[ d] g'[ g]
-\version "2.3.4"
+\version "2.2.0"
\header
{
texidoc= "Quarter notes may be beamed: the beam is halted momentarily."
}
-\score { \relative c'' {
+\score {\notes \relative c'' {
c8[ c4 c8] % should warn here!
}
\paper { raggedright = ##t}
texidoc = "The number of beams does not change on a rest."
}
-\version "2.3.4"
+\version "2.2.0"
-\score { \relative c, {
+\score { \notes \relative c, {
\clef bass
e8[ r16 f d'8 e16 e16] c8[ c16 r16 bes8 r16 c16] |
}
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="
Engraving second intervals is tricky. We used to have problems with seconds
" }
\score{
- \relative c''{
+ \notes\relative c''{
\stemUp
b8[ c]
b16[ c]
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="Beams in unnatural direction, have shortened stems, but do not look too short."
}
\score{
- \relative c'{
+ \notes\relative c'{
\override Beam #'position-callbacks =
#`(,Beam::least_squares
,Beam::check_concave
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc = "Hairy case for beam, chord, and automatic knees."
\score{
- \relative c'{
+ \notes\relative c'{
%\stemUp
\clef alto
\time 3/4
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Automatic beaming works also in ternary time sigs."
}
\score {
- \relative c'' {
+ \notes \relative c'' {
\time 6/8
c8.[ c16 c16 c16]
}
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="
"
}
-\score { \context Staff \relative c'' {
+\score { \context Staff \notes \relative c'' {
c8.[ c16]
c8.[ c16 c8. c16]
c16[ c8.] |
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Beaming can be also given explicitly."
}
\paper { raggedright= ##t }
-\score {
+\score { \notes
\relative c'
{
c16[ c8.]
--- /dev/null
+
+\version "2.2.0"
+
+\header{
+texidoc="
+By inserting @TeX{} commands between systems, you can force pagebreaks.
+
+In reality, you'd use the LateX command @code{\\newpage} instead of (pagebreak)
+of course.
+"
+}
+
+
+#(define (set-page-break grob grob-c context)
+ (let*
+ ((meta (ly:grob-property grob 'meta))
+ (name (cdr (assoc 'name meta))))
+
+ (if (equal? 'NonMusicalPaperColumn name)
+ (ly:grob-set-property! grob 'between-system-string "(pagebreak)\n\n"))
+))
+
+\score {
+ \notes \relative c' {
+ c1
+ \context Score \applyoutput #set-page-break
+ \break
+
+ c1
+ }
+}
+
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="
\score{
- \relative c'' \context Voice{
+ \notes\relative c'' \context Voice{
\emptyText
c1 \noBreak c1 \noBreak \mark "nobreak" c1 \noBreak
c1 \break \mark "break" c1 \break \mark "break" c1
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="
% Gregorian notation:
%
\context VaticanaStaff {
- \relative c' {
+ \notes \relative c' {
% we turn bars and bar numbers off for Gregorian stuff
\override Staff.BarLine #'transparent = ##t
#(ly:set-option 'old-relative)
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="
Breathing signs are available in different tastes: commas (default),
% Modern notation:
%
\new Staff {
- \relative c'' {
+ \notes \relative c'' {
\key es \major \time 3/4
% this bar contains no \breathe
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="Property chordChanges: display chord names only when
}
\score {
- <<
+ \notes <<
\context ChordNames << \scheme \settings >>
\context Staff \transpose c c' \scheme
>>
-\version "2.3.4"
+\version "2.2.0"
\header {
-\version "2.3.4"
+\version "2.2.0"
\header {
\score
{
- { \context Voice \chords {
+\notes { \context Voice \chords {
c1_"(nothing)"
c:7_":7"
c:m_":m"
-\version "2.3.4"
+\version "2.2.0"
\header { texidoc = "The property @code{chordNameExceptions} can used
to store a list of special notations for specific chords.
Putting the exceptions list encoded as
@example
- \ @{ <c f g bes>1\\markup @{ \\super \"7\" \"wahh\" @} @}
+ \\notes @{ <c f g bes>1\\markup @{ \\super \"7\" \"wahh\" @} @}
@end example
into @code{chordNameExceptions} takes a little manoeuvring. The
following code transforms @code{chExceptionMusic} (which is a
% 7sus4 denoted with ^7 wahh
-chExceptionMusic = {
+chExceptionMusic = \notes {
<c f g bes>1-\markup { \super "7" "wahh" }}
% add to existing exceptions.
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "The layout of the major 7 can be tuned with
@code{majorSevenSymbol}."
-\version "2.3.4"
+\version "2.2.0"
\header {
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Scripts can also be attached to chord elements."
}
\score {
- \relative c''{
+ \notes \relative c''{
< c-. > 4
< c-> > 4
< c-. e-. g-. b-. >
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "
Tremolo repeats can be constructed for short tremolos (total duration smaller than 1/4) too. Only some of the beams are connected to the stems.
}
\score {
- \context Staff \relative c' {
+ \context Staff \notes \relative c' {
\repeat "tremolo" 2 { c32 e32 }
\stemDown
\repeat "tremolo" 2 { c32 e32 }
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="
}
\score {
- \context Voice \relative c' {
+ \context Voice \notes\relative c' {
\time 4/4
\repeat "tremolo" 16 { d32 e }
\repeat "tremolo" 8 { d16 e }
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Jazz chords may have unusual combinations."
}
-chs =
+chs = \notes
{
<c d f g>1
<c d e f g>1
% #(set-chord-name-style 'ignatzek)
\chs
}
- \context Staff \transpose c c' { \chs }
+ \context Staff \notes \transpose c c' { \chs }
>>
}
-\version "2.3.4" \header {
+\version "2.2.0" \header {
texidoc = "Octavation signs may be added to clefs. These
octavation signs may be placed below or above (meaning an octave
}
-\score {
+\score { \notes
\relative c'' {
-\version "2.3.4"
+\version "2.2.0"
\header{
\score {
- {
+ \notes{
\clef "treble" c'1^"{treble}" \bar "||"
\clef "french"c'1^"{french}" \bar "||"
}
-\version "2.3.4"
+\version "2.2.0"
\score {
- \new PianoStaff <<
+\notes \new PianoStaff <<
\context Staff = up {
s1 *2
}
\context Staff = down <<
- \applymusic #notes-to-clusters \relative c { <c e>4 <f a> <b e> \change Staff = up <e a>
+ \apply #notes-to-clusters \relative c { <c e>4 <f a> <b e> \change Staff = up <e a>
<a d> <d g> }
{ \clef bass s1 * 2 }
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Clusters are a device to denote that a complete range of
notes is to be played."
}
-fragment = \relative c' {
+fragment =\notes \relative c' {
c4 f4 <e d'>4
<g a>8 <e a> a4 c2 <d b>4 e4
c4 }
\score {
- <<
+ \notes <<
\new Staff \fragment
- \new Staff \applymusic #notes-to-clusters \fragment
+ \new Staff \apply #notes-to-clusters \fragment
>>
\paper { raggedright = ##t }
}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Single head notes may collide. "
}
\score {
-
+ \notes
- \context Staff \transpose c c' <<
+ \context Staff \notes \transpose c c' <<
{ c4 d e f g2 g4 a | } \\
{ g4 f e g g2 g2 }
>>
dots: notes with dots should go to the right, if there could be
confusion to which notes the dots belong."
}
-\version "2.3.4"
+\version "2.2.0"
\score {
- \relative c'' {
+ \notes \relative c'' {
<< <a c>2\\ { <b d>4 <b d>4 } >>
<< { <a c>2 } \\ { <b d>4. <b e>8 } >>
}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "If collision resolution finds dotted note head must
\paper { raggedright = ##t }
\score {
- \relative c {
+ \notes \relative c {
\key d \minor
\clef bass
<< <cis a' cis>4 \\ { g'8. bes16} >>
on the right side."
}
-\version "2.3.4"
+\version "2.2.0"
\paper { raggedright= ##t }
% todo: b2 (up) + b8 down looks strange compared to c2up + b8. (down)
\score{
- \context Staff <<
+ \context Staff \notes <<
\clef "bass"
{ b8. c'16 d'4 b8 c'8 d'4 b2 b2 }
\\
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Note heads in collisions should be merged if
they have the same positions in the extreme note heads.
\score {
- \relative c'' {
+\notes \relative c'' {
c4
<< { c4 d4 <c d>8 <c d> <c d> } \\ { c4 c <a b>8 <b c> <c d>8 } >>
}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc =
\score {
- \context Staff \relative c'' <<
+ \context Staff \notes \relative c'' <<
{
c2 c8 c4.
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "If NoteCollision has merge-differently-dotted = ##t note
\paper { raggedright= ##t }
\score {
- \context Staff \relative c'' <<
+ \context Staff \notes\relative c'' <<
{
g8[ g8]
\override Staff.NoteCollision #'merge-differently-dotted = ##t
texidoc = "When merging heads, the dots are merged too."
}
-\version "2.3.4"
+\version "2.2.0"
\score {
- {
+\notes {
\relative c'' \new Staff {
<< { d8. e16 } \\ { d8. b16 } >>
}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Oppositely stemmed chords, meshing into each other,
are resolved."
\score {
- \context Staff \transpose c c' {
+ \context Staff \notes \transpose c c' {
\time 3/4
% Here's what I was trying to do:
<< {
#(ly:set-option 'old-relative)
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="
In addition to normal collision rules, there is support for polyphony,
twovoice =
- \relative c' \context Staff <<
+\notes \relative c' \context Staff \notes <<
{ g4 f f e e d d c }
\\ { c4 c d d e e f f }
>>
-twovoicechords = \context Staff <<
+twovoicechords = \context Staff \notes <<
\relative c' {
e4 d c b a g f
}\\
>>
-threevoice = \context Staff <<
+threevoice = \context Staff \notes <<
{ g4 f e f g a g2 } \\
{ c4 d e d c d es } \\
{ e4 e e e e e e e }
>>
-hairyChord = \context Staff \relative c''
+hairyChord = \context Staff \notes \relative c''
<< e \\
fis, \\
cis' \\
\score{
- { \transpose c c' {
+ \notes { \transpose c c' {
\twovoice
\twovoicechords
\threevoice }
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Completion heads are broken across bar lines. This was
}
\score{
- \context Staff \relative c'' <<
+ \context Staff \notes \relative c'' <<
{ c2. c bes2 } \\
{ c2. a8 g4 f4. g4 f }
>>
\paper {
\context{
- \Voice
+ \VoiceContext
\remove "Note_heads_engraver"
\consists "Completion_heads_engraver"
}
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="
\score{
- \relative c'{
+ \notes\relative c'{
\time 2/4
c2. c8 d4 e f g a b c2.. b8 a g16 f4 e d c8. c2
}
\paper{
\context{
- \Voice
+ \VoiceContext
\remove "Note_heads_engraver"
\consists "Completion_heads_engraver"
}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Custodes may be engraved in various styles."
}
\score {
- {
+ \notes {
\override Staff.Custos #'neutral-position = #4
\override Staff.Custos #'style = #'hufnagel
}
\paper {
\context {
- \Staff
+ \StaffContext
\consists Custos_engraver
}
raggedright = ##t
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Dots move to the right when a collision with the (up)flag happens."
}
\score {
- \relative c''
+ \notes\relative c''
{
\time 8/4
\set Staff.autoBeaming = ##f
-\version "2.3.4" \header{
+\version "2.2.0" \header{
texidoc=" Noteheads can have dots, and rests too.
\score {
- \context Voice \relative c'' {
+ \context Voice \notes\relative c'' {
\time 6/8
d4. g,,
\stemDown
}
-\version "2.3.4"
+\version "2.2.0"
drh = \drums { cymc4.^"crash" hhc16^"h.h." hh \repeat "unfold" 5 {hhc8 hho hhc8 hh16 hh} hhc4 r4 r2 }
drl = \drums {\repeat "unfold" 3 {bd4 sn8 bd bd4 << bd ss >> } bd8 tommh tommh bd toml toml bd tomfh16 tomfh }
-timb = \drums { \repeat "unfold" 2 {timh4 ssh timl8 ssh r timh r4 ssh8 timl r4 cb8 cb} }
+timb = \drums \repeat "unfold" 2 {timh4 ssh timl8 ssh r timh r4 ssh8 timl r4 cb8 cb}
\score {
- \repeat "volta" 2 {
- <<
+ \repeat "volta" 2
+ <<
\new DrumStaff \with {
drumStyleTable = #timbales-style
\override StaffSymbol #'line-count = #2
\new DrumVoice {\stemDown \drl }
>>
>>
- }
\paper {}
%% broken:
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc = "Broken crescendi should be open on one side."
}
-\score { \relative c'' {
+\score { \notes \relative c'' {
c1 \< \break c1\! \> \break c1\!
}
\paper {
-\version "2.3.4"
+\version "2.2.0"
\header {texidoc = "Dynamic letters are kerned, and their weight
matches that of the hairpin signs. The dynamic scripts should be
\score {
-\relative c'' { c1\ff
+\notes\relative c'' { c1\ff
e,-.-> \f
e \rfz
c' \mf
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc=" Dynamics appear below or above the staff. If multiple
dynamics are linked with (de)crescendi, they should be on the same
\score{
-\relative c''{
+\notes\relative c''{
a1^\sfz
a1\fff\> c,,\!\pp a'' a\p
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Crescendi may start off-notes, however, they should not collapse into flat lines."
}
-\score { { \context Voice {
+\score { \notes { \context Voice {
<< f''1 { s4 s4 \< s4\! \> s4\! } >>
}}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = " Easy-notation (or Ez-notation) prints names in note heads.
}
\score {
- {
+ \notes {
\setEasyHeads
c'2 g'2 | g'1
\override NoteHead #'note-names = ##("U" "V" "W" "X" "Y" "Z" "z")
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "
Figured bass is created by the FiguredBass context which eats
the special @code{\figures @{ @}} mode, which allows you to type
numbers, like @code{<4 6+>}.
-You can also type letters by entering quoted strings, which is shown in the
-last bass figure.
-
+You can also type letters by entering quoted strings.
" }
-\score { <<
+\score { \notes <<
\context FiguredBass {
\figures {
<3 [5 7]>
<3+ 5- 7!>
<3 _! 5 _- 7>
<3 _ 5 _ 7>
+\override FiguredBass.BassFigure #'font-family = #'roman
<"V7" ["bla" 6] 7>
-
}
}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "With the new chord syntax, it is possible to associate
\score {
- \relative c'{
+ \notes \relative c'{
%% input order is not 1 2 3 , output is.
<c-1 g'-3 e-2 b'-4 d-5 f-6 a-7 c-8 > 4
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Automatic fingering tries to put fingering instructions
\score {
- \relative c' {
+ \notes\relative c' {
c4-4
<c-1 f-4>
< c-1 e-2 g-3 b-4 >
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc = "
The line-spanners connects to the Y position of the note on the next line.
\score{
\context PianoStaff <<
\set PianoStaff.followVoice = ##t
- \context Staff=one \relative c''{
+ \context Staff=one \notes\relative c''{
a1 \break
\change Staff=two
a,
-\version "2.3.4"
+\version "2.2.0"
\header { texidoc = "The magnification can be set for any font. Note
that this does not change variable symbols such as beams or slurs.
" }
\score {
- \relative c'' \context Voice {
+\notes \relative c'' \context Voice {
\override NoteHead #'font-magnification = #0.9
c4
\override NoteHead #'font-magnification = #0.8
-\version "2.3.4"
+\version "2.2.0"
\header {
%}
\score {
- {
+ \notes {
\override Staff.TimeSignature #'font-name = #"cmr17"
\set Score.skipBars = ##t
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="
}
\score{
- \relative c''{
+ \notes\relative c''{
\context Bottom
\applyoutput #(outputproperty-compatibility
(make-type-checker 'note-head-interface)
#(ly:set-option 'old-relative)
-\version "2.3.4"
+\version "2.2.0"
\header{
}
\score{
- \context Staff=one \relative c''{
+ \context Staff=one \notes\relative c''{
% gliss non gliss and
c4 \glissando d e \glissando f \glissando \break
% consecutive
\paper{
linewidth = 50.\mm indent = 0
\context{
- \Staff
+ \StaffContext
% makes for handier debugging
% \remove Clef_engraver
}
-\version "2.3.4"
+\version "2.2.0"
\header
{
texidoc = "The autobeamer is not confused by grace notes."
}
\score{
- \context Voice \relative c''{
+ \notes\context Voice \relative c''{
\grace a8 g16 f e f \grace a8 g16 f e f \grace a8 g16 f e f
\grace a8 g16 f e f |
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Bar line should come before the grace note."
}
-\score { \relative c' \context Staff {
+\score {\notes \relative c' \context Staff {
f1 \grace { a'16[ f] } g1 }
\paper { raggedright = ##t}
}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Grace notes do tricky things with timing. If a measure
"
}
-\score { \relative c'' { c1 \break
+\score { \notes\relative c'' { c1 \break
\grace c8
c1 }
\paper { raggedright= ##t }
-\version "2.3.4"
-\score { \relative c'' { c4 d8[ \grace { e32[ d c d] } e8] e[ e \grace { f16 } e8 e] }}
+\version "2.2.0"
+\score { \notes\relative c'' { c4 d8[ \grace { e32[ d c d] } e8] e[ e \grace { f16 } e8 e] }}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc="@cindex Grace End
}
\score {
- \context Voice \relative c' {
+ \context Voice \notes\relative c' {
c4 \grace { d16[ d16] }
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Grace code should not be confused by nested sequential musics, containing grace notes; practically speaking, this means that the end-bar and measure bar coincide in this example."
}
\score {
- {
+ \notes {
c''2 { \grace b'16 c''2 } \bar "|."
}
\paper {
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Grace code should not be confused by nested sequential musics, containing grace notes; practically speaking, this means that the end-bar and measure bar coincide in this example."
\score{
-
+\notes
{ c''2 { \grace b'16 c''2 } \bar "|." }
\paper {
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Grace code should not be confused by nested sequential musics, containing grace notes; practically speaking, this means that the end-bar and measure bar coincide in this example."
\paper { raggedright= ##t }
-\score { \context Voice {
+\score { \notes \context Voice {
{ \grace b'8 c''2 }
\grace b'16 c''4 c''4 \bar "|."
}}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "In nested syntax, graces are still properly handled."
}
\paper { raggedright= ##t }
-\score { \relative c'' {
+\score { \notes \relative c'' {
f1
\grace e8 f1
<< { \grace { e8 } f1 } >>
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Also in the nested syntax here, grace notes appear rightly."
}
-\score { \context Voice \relative c'' {
+\score { \notes \context Voice \relative c'' {
<<
{ \grace g32 f4 }
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Graces notes may have the same duration as the main note."
}
\score
-{ \relative c'' {
+{ \notes \relative c'' {
s2 <f>4
\grace g e4
}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Grace notes may be put in a @code{partcombine}r."
}
\score {
\new Staff
\partcombine
- \relative c'' {
+ \notes \relative c'' {
c4 d e f \grace f16 g1
}
- \relative c' {
+ \notes \relative c' {
c4 d e2 g1
}
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc = "Stripped version of trip.ly. Staves should be of correct length."
}
\paper { raggedright= ##t }
\score{
- \context PianoStaff \relative c'' <<
+ \context PianoStaff \notes \relative c'' <<
\new Staff {
r1
r1
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Pieces may begin with grace notes."
}
-\score { \relative c' \context Staff {
+\score {\notes \relative c' \context Staff {
\grace { a'16[ f] } g1
\bar "||" % test if | and || are synced.
\grace { a16[ bes] } c1
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc = "Here @code{startGraceMusic} should set @code{no-stem-extend} to
true; the two grace beams should be the same here.
\score {
- \context Voice \relative c {
+ \context Voice \notes\relative c {
\grace {
f8[ e8]
\override Stem #'no-stem-extend = ##t
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Grace notes in different voices/staves are synchronized."
}
-\score {\relative c'' << \context Staff { c2
+\score {\notes\relative c'' << \context Staff { c2
\grace c8
c4 c4 }
\new Staff { c2 \clef bass
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "There are three different kinds of grace types: the base
grace switches to smaller type, the appoggiatura inserts also a slur, and the
}
\score {
- \relative c'' { c4 \grace { d8 } c4
+ \notes \relative c'' { c4 \grace { d8 } c4
\appoggiatura { d8 } c
\acciaccatura { d } c
}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "When grace notes are entered with unfolded repeats,
line breaks take place before grace notes.
\score{
- \context Voice \relative c'{
+ \notes\context Voice \relative c'{
\repeat unfold 10 {\grace d8 c4 d e f}
}
-\version "2.3.4"
+\version "2.2.0"
\header {
\paper { raggedright= ##t }
-\score {\relative c' {
+\score {\notes\relative c' {
\repeat volta 2 {
c1
}
-\version "2.3.4"
+\version "2.2.0"
\header {
}
\score{
- \relative c''{\key a \minor \time 2/4
+ \notes\relative c''{\key a \minor \time 2/4
\repeat "volta" 2 {
\grace { a16[ b] } c4 c4 |
\grace { d16[ b] } c4 c4 |
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="
"
}
-\score { \context Voice = VA \relative c'' {
+\score {\notes \context Voice = VA \relative c'' {
\grace b8 c4\fermata
\grace { c32[ cis32] } gis4
\grace { cis32[ dis32] } e4
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc ="Hairpin crescendi may be dashed. "
}
\score {
- \relative c' {
+ \notes \relative c' {
\override Hairpin #'dash-fraction = #0.4
\override Hairpin #'dash-period = #1
f2\< g c1 d4\> b a gis\! }
-\version "2.3.4"
+\version "2.2.0"
\header {
\score {
- \relative c'' { c4 \> c4 c4\! c4_\ff \> c4 c4\!\p }
+\notes \relative c'' { c4 \> c4 c4\! c4_\ff \> c4 c4\!\p }
\paper { raggedright = ##t}
}
-\version "2.3.4"
+\version "2.2.0"
\header { texidoc =
\paper { raggedright= ##t }
-\score { \transpose c c''
+\score { \notes \transpose c c''
\context PianoStaff <<
\new Staff { c4 c c c \break s1 \break c4 c c c \break c c c c}
\new Staff { d4 d d d s1 s1 s1 s1 }
}
-\version "2.3.4"
+\version "2.2.0"
textFlat = \markup {\smaller \flat}
\score {
- \new Staff {
+ \notes \new Staff {
\set Staff.instrument = \markup { \column < "Clarinetti" { "in B" \textFlat } > }
\set Staff.instr = \markup { \smaller { "Cl(B" \textFlat ")" } }
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Instrument names are also printed on partial starting measures."
}
\score {
- \relative c'' { \set Staff.instrument = "foo" \partial 4 c4 c1 }
+ \notes \relative c'' { \set Staff.instrument = "foo" \partial 4 c4 c1 }
\paper { raggedright = ##t }
}
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="
Staff margins are also markings attached to barlines. They should be
\score {
- \context PianoStaff <<
+ \notes \context PianoStaff <<
\context Staff = treble {
\set PianoStaff.instrument = "Piano "
\set Staff.instrument = "Right " { c''4 }}
-\version "2.3.4"
+\version "2.2.0"
\header { texidoc = "Each clef have own accidental placing rules. " }
-#(set-global-staff-size 16)
-
-\score {
+\score { \notes
\relative cis' {
% \clef french % same as octaviated bass
\key cis \major cis \key ces \major ces
}
+ \paper{\paperSixteen}
+
}
-\version "2.3.4"
+\version "2.2.0"
\header { texidoc = "By setting @code{Staff.keySignature} directly,
key signatures can be set invidually per pitch.
"
}
-\score {
+\score { \notes
\relative c'
\context Staff {
\set Staff.keySignature = #'(((1 . 2) . 1) ((0 . 3) . -1))
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="
Key signatures may appear on key changes, even without a barline.
\score {
- \relative c''
+ \notes \relative c''
{
\set Staff.createKeyOnClefChange = ##t
\key bes \major c2
+++ /dev/null
-\header {
- texidoc = "LilyPond syntax can be used inside scheme to
-build music expressions, with the @code{#@{ ... #@}} syntax.
-Scheme forms can be introduced inside these blocks by escaping
-them with a @code{$}, both in a LilyPond context (see the @code{music} variable) or in a Scheme
-context (see the @code{$padding} and @code{$(* padding 2)} forms.)"
-}
-\version "2.3.4"
-\paper { raggedright = ##t }
-
-withPaddingA = #(def-music-function (location padding music) (number? ly:music?)
- #{ \override TextScript #'padding = #$padding
- $music
- \revert TextScript #'padding #})
-
-withPaddingB = #(def-music-function (location padding music) (number? ly:music?)
- #{ \override TextScript #'padding = #$(* padding 2)
- $music
- \revert TextScript #'padding #})
-
-withPaddingC = #(def-music-function (location padding music) (number? ly:music?)
- #{ \override TextScript #'padding = #(+ 1 $(* padding 2))
- $music
- \revert TextScript #'padding #})
-
- \score {
- \notes {
- c'^"1"
- \withPaddingA #2
- { c'^"2" c'^"3"}
- c'^"4"
- \withPaddingB #2
- { c'^"5" c'^"6"}
- c'^"7"
- \withPaddingC #2
- { c'^"8" c'^"9"}
- c'^"10"
- }
- }
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "With the @code{\\lyricsto} mechanism, individual lyric
\score {
<<
- \context Voice = "bla" \relative c'' {
+ \notes \context Voice = "bla" \relative c'' {
\autoBeamOff
c2( d4) e8[ c b c] f4
}
- \lyricsto "bla" \new Lyrics \lyrics { bla ab blob blob }
- \lyricsto "bla" \new Lyrics \lyrics {
+ \lyricsto "bla" \lyrics \new Lyrics { bla ab blob blob }
+ \lyricsto "bla" \lyrics \new Lyrics {
bla
\set ignoreMelismata = ##t
blob
}
- \lyricsto "bla" \new Lyrics \lyrics {
- nes ted lyrics voice with more words than no tes
- }
- >>
+ \lyricsto "bla" \lyrics \new Lyrics { nes ted lyrics voice with more words than no tes } >>
+
}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc ="Polyphonic rhythms and rests do not disturb
}
\score {
- {
+ \notes {
\clef violin
\time 8/8
\key des \major
\voiceTwo
ees'8 r8 r8 r8 ees' r8 r8 r8
}
- \lyricsto "two" \new Lyrics \lyrics {
- Do na
+ \lyricsto "two" \lyrics \new Lyrics {
+ Do na
}
- \lyricsto "one" \new Lyrics \lyrics {
- Do mi nus ex
- }
+ \lyrics \lyricsto "one" \new Lyrics
+ {
+ Do mi nus ex
+ }
>>
}
\paper { raggedright = ##t}
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc= "Lyrics can be set to a melody automatically. Excess lyrics will be
-m = \relative c'' {
+m = \notes \relative c'' {
\autoBeamOff
g8( a) r8 \times 2/3 { g'8( f e) } r8 \grace { d16[ c b] } e4
\emptyText
\melismaEnd
b }
-noise = \repeat unfold 6 \relative c'' { g16 g g g }
+noise = \repeat unfold 6 \notes \relative c'' { g16 g g g }
textI = \context Lyrics = "middle-1" \lyrics { la2 __ la -- la __ la la la la la }
textII = \context Lyrics = "middle-1" \lyrics { da -- da __ da -- da da da da da }
\score {
- << \context Staff = SA \noise
+ \notes << \context Staff = SA \noise
\context Lyrics = LA { s1 }
\context Staff = SB { s1 }
\context Lyrics = LB { s1 }
-\version "2.3.4"
+\version "2.2.0"
\header
{
\score {
<<
- \context Voice=A {
+ \context Voice=A \notes {
a1 ( a1 \break
a) a2( b) \break
a2
-\version "2.3.4"
+\version "2.2.0"
\header { texidoc= "In lyric extenders, a syllable may be extended over several notes. "}
\paper { raggedright= ##t }
\score{
- \relative c' <<
+\notes \relative c' <<
\context Voice = melody {
c8[ ( d] )
r4 f4 }
-\version "2.3.4"
+\version "2.2.0"
\header {
}
\score {
-<< \new Staff \relative c'' { \time 1/4 c16[ c c c]
+<< \notes \new Staff \relative c'' { \time 1/4 c16[ c c c]
\time 1/4
c16[ c c c]
\time 1/4
r c16[ c c]
}
- \new Lyrics \lyrics {
+ \lyrics \new Lyrics {
bla16 -- bla -- bla -- bla --
bla -- bla -- bla -- bla8 --
bla16 -- bla -- bla
linewidth = 3.4 \cm
\context {
- \Staff \remove "Time_signature_engraver"
+ \StaffContext \remove "Time_signature_engraver"
}
}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "In lyrics, hyphens may be used."
}
\score{
<<
- \context Staff { c' (c') c'( c') }
+ \context Staff \notes { c' (c') c'( c') }
\context Lyrics \lyrics { bla -- alb xxx -- yyy }
>>
}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "
\score{
- <<
- \relative c' \context Voice = "bla" {
+<< \notes \relative c' \context Voice = "bla" {
\autoBeamOff
c4( c16 d c b) c4
d16[ e f g]
}
- \lyricsto "bla" \context Lyrics \lyrics {
+ \lyrics \lyricsto "bla" \context Lyrics {
alllll __ tijd
izzz
- }
- >>
+ } >>
+
\paper { raggedright = ##t }
}
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="
\score {
\context StaffGroup <<
- \context Staff {
+ \notes \context Staff {
b1 \bar "|:" b1 \bar ":|"
}
\lyrics <<
this4 one has no BarEngraverAddedToContext1
}
>>
- \new Staff { b1 b1 }
+ \notes \new Staff { b1 b1 }
>>
\paper {
raggedright = ##t
\context {
- \Score
+ \ScoreContext
\accepts "LyricsWithBars"
}
\context {
- \Lyrics
+ \LyricsContext
\consists "Bar_engraver"
\name "LyricsWithBars"
}
-\version "2.3.4"
+\version "2.2.0"
\header
{
texidoc = "Melismata are triggered by manual beams."
\score {
<<
\new Staff
- \relative c'' {
+ \notes \relative c'' {
\set Staff.autoBeaming = ##f
c8 c8[ c8 c8] c8 }
texidoc = "The note markup function may be used to make metronome
markings. It works for a variety of flag, dot and duration settings."
}
-\version "2.3.4"
+\version "2.2.0"
-\score { { c4^\markup {
+\score { \notes { c4^\markup {
\note #"1" #1
\note #"2" #1
\note #"4" #1
-\version "2.3.4"
+\version "2.2.0"
\header {texidoc="Markup scripts may be stacked."}
\paper { raggedright = ##t}
-\score { { c''^\markup { "a" \column < "1" \bold "2" "3" > } } }
+\score { \notes { c''^\markup { "a" \column < "1" \bold "2" "3" > } } }
}
-\version "2.3.4" % to be updated
+\version "2.2.0" % to be updated
#(def-markup-command (upcase paper props str) (string?)
"Upcase the string characters. Syntax: \\upcase #\"string\""
(interpret-markup paper props (make-simple-markup (string-upcase str))))
\score {
- {
+ \notes {
c''-\markup \upcase #"hello world"
% produces a "HELLO WORLD" markup
}
}
-\version "2.3.4"
+\version "2.2.0"
%% TODO: should have 2/4 + 5/8 time sig style.
-\score {
+\score { \notes
\context Staff
\relative c' {
#(set-time-signature 2 4)
}
\paper {
raggedright = ##t
- \context { \Staff
+ \context { \StaffContext
\consists "Measure_grouping_engraver"
}
}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "There is limited support for mensural notation: note head
}
-\score { { \context Voice {
+\score {\notes { \context Voice {
\override NoteHead #'style = #'mensural
\transpose c d'' { c4 c2 c8 c16 c16 c1 c\breve c\longa }
\transpose c c' { c4 c2 c8 c16 c16 c1 c\breve c\longa }
}
-\version "2.3.4"
+\version "2.2.0"
-\score { \relative c'' { \tempo \breve = 100 c1 c1 \tempo 8.. = 50 c1 }
+\score { \notes \relative c'' { \tempo \breve = 100 c1 c1 \tempo 8.. = 50 c1 }
\paper { raggedright = ##t }
}
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="
"
}
-thenotes = \relative cis' {
+thenotes = \notes \relative cis' {
\set Score.skipBars = ##t
\time 4/4
R1 |
-\version "2.3.4"
+\version "2.2.0"
\header { texidoc=" You can write stencil callbacks in Scheme, thus
providing custom glyphs for notation elements. A simple example is
\score {
- \relative c' { c4 e
+ \notes \relative c' { c4 e
\override NoteHead #'print-function
=
-\version "2.3.4"
+\version "2.2.0"
\header
{
texidoc = "The multimeasure rest is centered exactly between bar lines."
}
\score {
-
+ \notes
{
\set Score.skipBars = ##t
\override Staff.BarLine #'hair-thickness = #7.5
-\version "2.3.4"
+\version "2.2.0"
\header {
}
\score {
- <<
+\notes <<
\new Staff { R1 R1 R1*3 }
\new Staff { \clef bass c1 \grace c8 c2 c2 c1 \grace c16 c2 c2 c1 }
>>
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "There are both long and short instrument names.
\context Staff <<
\set Staff.instrument = "instrument"
\set Staff.instr = "instr"
- {c''1 \break R1 }
+ \notes{c''1 \break R1 }
>>
\paper {
raggedright = ##t
\context {
- \Staff
+ \StaffContext
\consists Instrument_name_engraver
}
independent on prefatory matter in other staves."
}
-\version "2.3.4"
+\version "2.2.0"
\score {
- << \new Staff { R1 }
+\notes << \new Staff { R1 }
\new Staff { f'1 \clef bass }
>>
texidoc = "By setting texts starting with a multi-measure rest, an
extra spacing column is created. This should not cause problems."
}
-\version "2.3.4"
+\version "2.2.0"
\score {
<<
\set Score.skipBars = ##t
- \context Staff = flute \new Voice {
+ \context Staff = flute \notes \new Voice {
<< { R1*40 } { s1*0^"bla" }>>
}
>>
-\version "2.3.4"
+\version "2.2.0"
\header {
}
-\score { {
+\score { \notes {
\time 3/4
\set Score.skipBars = ##t
R2._\markup { \center-align < \musicglyph #"scripts-dfermata" \roman "Ad lib" > }
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="
}
-\score { {
+\score { \notes {
\time 3/4 \key cis \major
R2.*15
}
\paper {
\context {
- \Score
+ \ScoreContext
skipBars = ##t
}
raggedright = ##t
+++ /dev/null
-\header
-{
-texidoc = "Music function are generic music transformation functions,
-which can be used to extend music syntax seamlessly."
-
-}
-\version "2.3.4"
-
-#(define myBar
- (ly:make-music-function
- (list string?)
- (lambda (where type)
- (context-spec-music
- (context-spec-music (make-property-set 'whichBar type) 'Timing)
- 'Score))
-
- ))
-
-\score{
- {
- d4 \myBar #"|:" d4
-
- }
-}
-
}
-\version "2.3.4"
+\version "2.2.0"
#(define (notes-to-skip m)
"Convert all stuff with duration (notes, lyrics, bass figures, etc.) to skips.
\paper { raggedright= ##t }
-foobar = \transpose c c' { c4\>-^ c4-^ c4\!-^ c4-^ }
+foobar = \notes \transpose c c' { c4\>-^ c4-^ c4\!-^ c4-^ }
\score {
- \relative c'' \context Voice {
+ \notes \relative c'' \context Voice {
\foobar
- << \applymusic #(lambda (x) (music-map notes-to-skip x))
+ << \apply #(lambda (x) (music-map notes-to-skip x))
\foobar
{ d2 d2 } >>
}}
texts using a similar syntax as @code{\\markup}."
}
-\version "2.3.4"
+\version "2.2.0"
\score {
- {
+ \notes {
\fatText
f'1-\markup {
foo
raggedright = ##t
indent = #0
\context {
- \Staff
+ \StaffContext
\remove Time_signature_engraver
}
}
texidoc = "With the new markup syntax, text may be written in various manners."
}
-\version "2.3.4"
+\version "2.2.0"
\score {
-
+ \notes
{
f'-\markup {
foo
+++ /dev/null
-\header {
-
- texidoc = "newlyrics, multiple stanzas, multiple lyric voices."
-
-}
-
-%% only this works as advertised...
-<<
- \new Staff \relative {
- d'2 d c4 bes a2 \break
- c2 c d4 f g2
- }
- \newlyrics {
- My first Li -- ly song,
- Not much can go wrong!
- }
- \newlyrics {
- My next Li -- ly verse
- Not much can go wrong!
- }
- \new Staff \relative {
- \clef bass
- d2 d c4 bes a2 \break
- c2 c d4 f g2
- }
- \newlyrics {
- MY FIRST LI -- LY SONG,
- NOT MUCH CAN GO WRONG!
- }
- \newlyrics {
- MY NEXT LI -- LY VERSE
- NOT MUCH CAN GO WRONG!
- }
->>
-
-\version "2.3.4"
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc=" By default, text is set with empty horizontal dimensions.
to control the horizontal size of text. " }
\score{
- \relative c''{
+ \notes\relative c''{
%% \emptyText
%% short for \override TextScript #'no-spacing-rods = ##t
c2_"very wide and long text" c | \break
-\version "2.3.4"
+\version "2.2.0"
\header {
\score {
- \relative c''
+ \notes\relative c''
{
c4\startGroup\startGroup\startGroup
c4\stopGroup
\paper {
\context {
- \Staff \consists "Horizontal_bracket_engraver"
+ \StaffContext \consists "Horizontal_bracket_engraver"
}
raggedright = ##t
}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Note heads are flipped on the stem to prevent collisions.
\paper { raggedright= ##t }
-\score { \relative c''
+\score { \notes \relative c''
\context Voice {
<g a c>4
<c d g a>
Harmonic heads do not get dots. If @code{harmonicAccidentals} is unset, they also don't get accidentals."
}
-\version "2.3.4"
+\version "2.2.0"
\score {
- {
+ \notes {
< c'' f''\harmonic >4
\stemUp
< c'' f''\harmonic >4.
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="
Note head shapes may be set from several choices.
"
}
-pattern = <<
+pattern = \notes <<
\new Voice {
\override Stem #'direction = #UP
e'4
>>
\score {
- \transpose c c {
+ \notes \transpose c c {
\clef C
\override Staff.NoteHead #'style = #'default
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Note head lines (e.g. glissando)
run between centers of the note heads."
}
-su = { \change Staff = up}
-sd = { \change Staff = down}
+su = \notes{ \change Staff = up}
+sd = \notes{ \change Staff = down}
\score {
\context PianoStaff
- <<
+ \notes <<
\context Staff = up {
\set PianoStaff.connectArpeggios = ##t
\showStaffSwitch
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc=" The number of stafflines of a staff can be set. Ledger
}
\score {
-\context Voice \relative c {
+\context Voice \notes\relative c {
c' c c c | g' g g g \bar ":|"
}
\paper {
-\context { \Staff
+\context { \StaffContext
\override StaffSymbol #'line-count = #3
} }
\midi { }
}
-\version "2.3.4"
+\version "2.2.0"
\paper { raggedright = ##t}
\score {
- \relative c''' {
+ \notes\relative c''' \notes {
a2 b
#(set-octavation 1)
a2 b \break c''1 \break
"
}
-\version "2.3.4"
+\version "2.2.0"
% . There must be a minimum distance between the octavation line and the
% topmost staff line, taking into account the height of the closing
\paper { raggedright = ##t}
\score {
- \relative c''' {
+ \notes\relative c''' \notes {
a b c a
#(set-octavation 1)
a b c a
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc ="The a2 string is printed only on notes (i.e. not on rests),
and only after chords, solo or polyphony."
}
-vone = \relative a' { R1*2 g2 r2 g2 r2 a4 r4 g
+vone = \notes \relative a' { R1*2 g2 r2 g2 r2 a4 r4 g
}
-vtwo = \relative a' { R1*2 g2 r2 g2 r2 f4 r4 g }
+vtwo = \notes \relative a' { R1*2 g2 r2 g2 r2 f4 r4 g }
\score {
<< \set Score.skipBars = ##t
"
}
-\version "2.3.4"
+\version "2.2.0"
-vone = \relative a' { g4 g f f e e d d }
-vtwo = \relative a' { e4 e f f g g a a }
+vone = \notes \relative a' { g4 g f f e e d d }
+vtwo = \notes \relative a' { e4 e f f g g a a }
\score {
\partcombine \vone \vtwo
"
}
-\version "2.3.4"
+\version "2.2.0"
-vone =
+vone =\notes
%%%%%%%%%%%%%% 0 1 2 3
\relative c'' {
a8[ a] a8[ a]
}
-vtwo =
+vtwo =\notes
\relative c' {
\time 2/4
f8[ f]~ f8[ f] |
+++ /dev/null
-\header {
-
- texidoc = "SOLO is printed even if the solo voice ends before the
- other one."
-
-}
-
-\version "2.3.4"
-
-\score {
- <<
- \new Staff
- \partcombine
- { R1 * 2 }
- { c'8\> c'\! r2. }
- >>
-}
}
-\version "2.3.4"
+\version "2.2.0"
\score {
\new Staff
- \partcombine \relative c'' {
+ \partcombine \notes \relative c'' {
bes2(
a4)
}
- \relative c' {
+ \notes \relative c' {
r2 cis4
}
}
"
}
-vone = \relative a' { d4 r8 d8 d8 r8 d8 r8 d2 ~ d2 ~ d4 }
-vtwo = \relative g' { g4. g8 r2 g4 r4 r2 g4 }
+vone = \notes \relative a' { d4 r8 d8 d8 r8 d8 r8 d2 ~ d2 ~ d4 }
+vtwo = \notes \relative g' { g4. g8 r2 g4 r4 r2 g4 }
-\version "2.3.4"
+\version "2.2.0"
\score {
}
-\version "2.3.4"
+\version "2.2.0"
-vone = \relative a' { R1 a2 r4 r a a a a }
-vtwo = \relative a' { R1 f4 f4 f4 f f f a a }
+vone = \notes \relative a' { R1 a2 r4 r a a a a }
+vtwo = \notes \relative a' { R1 f4 f4 f4 f f f a a }
\score {
\partcombine \vone \vtwo
"
}
-\version "2.3.4"
+\version "2.2.0"
-vone = \relative a' { g2 g g g4 g f' c c( c) c c c ~ c
+vone = \notes \relative a' { g2 g g g4 g f' c c( c) c c c ~ c
c2. c4 c
}
-vtwo = \relative a' { f2 f4 f f2 g4 g c, f f f f f~ f ~ f
+vtwo = \notes \relative a' { f2 f4 f f2 g4 g c, f f f f f~ f ~ f
f4 f2. ~ f4
}
-\version "2.3.4"
+\version "2.2.0"
\header {
At a line-break, there are no vertical endings. " }
\score {
- \relative c'' {
+ \notes \relative c'' {
\set Staff.pedalSustainStyle = #'bracket
c4 d e \sustainDown b c c, \sustainUp \sustainDown d8[ c] e8[
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Unterminated piano pedal brackets run to the end of the piece. "
}
\score {
- {
+ \notes {
\set Staff.pedalSustainStyle = #'bracket
c4 \sustainDown
\bar "|."
-\version "2.3.4"
+\version "2.2.0"
\header
{
texidoc = "The standard piano pedals style comes with Ped symbols.
}
\score{
- \context Staff \relative c'{
+ \context Staff \notes\relative c'{
c4 d e f g
\sustainDown b c
c, d16[ c c c] e[ e \sustainUp \sustainDown e e ] f4 \sustainUp
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc="Ordinary slurs should work well with phrasing slur."
}
\score {
- \relative c'' {
+ \notes\relative c'' {
\time 6/4 c\((d e) f(e d)\)
}
\paper {
-\version "2.3.4"
+\version "2.2.0"
\header {
\paper { raggedright= ##t }
-\score{ {
+\score{ \notes {
a a a a \break
\mark A
a a a a}}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Distances between prefatory items (e.g. clef, bar,
}
-\score { \relative c'' {
+\score { \notes \relative c'' {
\set Staff.instrument = "fobar"
\bar "||:"
\key cis \major
}
-\version "2.3.4"
+\version "2.2.0"
\score {
- \relative c'' {
+ \notes \relative c'' {
<<
{ \grace e8 d2 }
\\ { a2 } >>
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Once properties take effect during a single time step only."
}
\score {
- \relative c' {
+ \notes \relative c' {
c4
\once \set Stem = #'()
c4
In this example, all instruments play sounding central C, the target is a instrument in F."
}
-\version "2.3.4"
+\version "2.2.0"
-\addquote clarinet {
+\addquote clarinet \notes {
\transposition bes
d'16 d'16 d'8
d'16 d'16 d'8
d'16 d'16 d'8
d'16 d'16 d'8
}
-\addquote sax {
+\addquote sax \notes {
\transposition es'
a8 a a a a a a a
}
\score {
- {
+ \notes{
\transposition f % french horn
g'4
music may be quoted. "
}
-\version "2.3.4"
+\version "2.2.0"
-\addquote bla \relative c' {
+\addquote bla \notes\relative c' {
fis4 g a b }
\score {
- \relative c'' {
+ \notes \relative c'' {
c8 d8 \quote bla 2 es8 gis
}
}
with @code{\mark NUMBER}, or with @code{Score.rehearsalMark}."
}
-\version "2.3.4"
-\score { \relative c'' {
+\version "2.2.0"
+\score { \notes \relative c'' {
c1 \mark \default
c1 \mark #7
c1 \mark \default
}
-\version "2.3.4"
+\version "2.2.0"
\score {
- \relative c''{
+ \notes \relative c''{
\set Score.markFormatter = #format-mark-numbers
c1 | \mark \markup { \musicglyph #"scripts-coda" }
c1 | \mark \default
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="
}
\score {
- \context Staff \relative c'' {
+ \context Staff \notes \relative c'' {
\repeat fold 3 { c^"3$\\times$ 0alt" d }
% less alts than body
\repeat fold 4 { c^"4$\\times$ 2alt" d } \alternative { e f }
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="
\paper { raggedright= ##t }
\score {
-
+\notes
\context Staff\relative c'' {
\repeat "volta" 2 { c1 \break } \alternative { d e }
c1
-\version "2.3.4"
+\version "2.2.0"
\header {
\score {
\context Staff <<
\set Score.skipBars = ##t
- {
+ \notes {
\repeat "percent" 2 { g2 a g a }
}
>>
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Measure repeats may be nested with beat repeats."
}
-\score { \relative c'' \context Voice { \time 4/4
+\score { \notes \relative c'' \context Voice { \time 4/4
% riff
\repeat "percent" 2 { r8. a16 g8. a16 bes8. a16 f8 d | a c8 ~ c8 d8 ~ d8 r8 r4 }
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Within a bar, beat repeats denote that a music snippet should be
played again."
}
-\score { \relative c'
+\score { \notes \relative c'
\context Voice { \time 4/4
\repeat "percent" 2 { c2 }
-\version "2.3.4"
+\version "2.2.0"
\header { texidoc = "Volta repeats may be unfolded through the Scheme
function @code{unfold-repeats}."
}
-nots = \relative c' {
+nots = \notes\relative c' {
c4 \repeat volta 2 c4 \alternative { d e }
}
\score {
- \context Voice {
+ \notes \context Voice {
\nots
\bar "||"
- \applymusic #unfold-repeats \nots
+ \apply #unfold-repeats \nots
}
\paper {raggedright = ##t}
}
-\version "2.3.4"
+\version "2.2.0"
\header {
- texidoc = "Unfolding tremolo repeats. All fragments fill one
- measure with 16th notes exactly."
+ texidoc = "Unfolding tremolo repeats. Both fragments fill one 2/4
+ measure with 32nd notes exactly."
}
\score{
- {
+ \notes{
\time 2/4
- \applymusic #unfold-repeats
- { \repeat tremolo 4 { c'16 e' } |
- \repeat tremolo 8 c'16 } |
-
- \time 3/4
- \applymusic #unfold-repeats
- { \repeat tremolo 6 { c'16 e' } |
- \repeat tremolo 12 c'16 } | \bar "|."
-
- \bar "|."
-
-
+ \apply #unfold-repeats
+ { \repeat tremolo 8 { c'32 e' } |
+ \repeat tremolo 16 c'32 } | \bar "|."
}
\paper { raggedright = ##t }
}
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="
\score {
- \context Voice \relative c'' {
+ \context Voice \notes\relative c'' {
\repeat unfold 3 { c^"3x 0a" d }
% less alts than body
\repeat unfold 4 { c^"4x 0a" d } \alternative { e f }
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "When too few alternatives are present, the first
}
-\score { \relative c'' \context Voice {
+\score { \notes \relative c'' \context Voice {
\repeat volta 3 c1
\alternative { d f } e4 } }
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="
% no alts.
\score {
- \context Voice \relative c'' {
+ \notes \context Voice \relative c'' {
% repeat non aligning with barlines.
\repeat volta 3 { c^"3$\\times$ 0alt" d e }
% less alts than body
texidoc = "Rests under beams are only moved if necessary."
}
-\version "2.3.4"
+\version "2.2.0"
-fig = \relative c' {
+fig = \notes \relative c' {
<a c e>8[ r <c e a> r <e a c> r <a c e>] r |
}
\score {
- \relative c' \new Staff {
+ \notes \relative c' \new Staff {
\fig
\transpose c c, \fig
\new Voice { \stemUp \transpose c f \fig }
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="
Rests should not collide with beams, stems and noteheads. Rests may
"
}
-scale = \relative c' {
+scale = \notes \relative c' {
c8 d e f g a b c c d e f g a b c
}
-rests = {
+rests = \notes {
r r r r r r r r r r r r r r r r
}
different = << {
- \relative c'' {
+ \notes \relative c'' {
r8 a e4 a e
}
}\\ {
- \relative c'' {
+ \notes \relative c'' {
r1
}} >>
-scales = \context Staff <<
+scales = \context Staff \notes <<
{ r1 r2 r2 \scale c''1 c'2 a'2 \rests }
\\
{ a'1 a'2 d'2 \rests r1 r2 r2 \scale }
>>
-restsII = \context Staff {
+restsII = \context Staff \notes {
r4 r8
\context Staff << { r8 } \\{ r8} >>
\context Staff << { r8} r8 \\{ r8} >>
}
\score{
- {
+ \notes {
\scales
\restsII
}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Whole and half rests moving outside the staff should get
ledger lines."
\score {
- {
+\notes {
\override Rest #'staff-position = #4
r1 \override Rest #'staff-position = #5
r1 \override Rest #'staff-position = #6
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Rests can have pitches--these will be affected by
\paper { raggedright= ##t }
-\score { \relative c''
+\score { \notes\relative c''
{
a4\rest b4\rest c4\rest
}
-\version "2.3.4"
+\version "2.2.0"
\score {
- \new Staff \relative c' {
+ \new Staff \notes \relative c' {
<< { r8 g''4 g8 r g4 g8 } \\
{ d,4 r d r } >>
}
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="
}
- \score { {
+ \score { \notes {
\time 4/4
r \longa * 1/4 r\breve * 1/2
r1 r2 r4 r8 r16 r32 r64 r128 r128
-\version "2.3.4"
+\version "2.2.0"
\header
{
texidoc = "In rhythmic staves stems should go up, and bar lines have the size for a 5 line staff. The whole note hangs from the rhythmic staff."
}
-\score { \context RhythmicStaff
+\score { \notes \context RhythmicStaff
{
r4 c4. c8 r8 c8 | c2 r2 | r1
}
-\version "2.3.4"
+\version "2.2.0"
\header {
}
\score {
- \relative c'' {
+\notes \relative c'' {
c4
<c d c'>\marcato
<< { c4^^ }\\
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Scripts can be stacked. The order is determined by a
priority field, but when objects have the same priority, the input
"
}
-\score{ \relative c'' { c4^"inner up"^"outer up"_"inner down"_"outer down" }
+\score{ \notes\relative c'' { c4^"inner up"^"outer up"_"inner down"_"outer down" }
\paper { raggedright = ##t}
}
-\version "2.3.4"
+\version "2.2.0"
\paper { raggedright= ##t }
texidoc = "Scripts may be stacked."
}
-\score { { c'''->-. } }
+\score { \notes { c'''->-. } }
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="
-\version "2.3.4"
+\version "2.2.0"
foollilypondbook = "
\score
"
-\version "2.3.4"
+\version "2.2.0"
foollilypondbook = "
\score
"
-\version "2.3.4"
+\version "2.2.0"
foollilypondbook = "
\score
"
-\version "2.3.4"
+\version "2.2.0"
foollilypondbook = "
\score
"
-\version "2.3.4"
+\version "2.2.0"
foollilypondbook = "
\score
"
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "The area underneath an (up) slur is minimised to improve the shape. "
}
\score{
-\relative c''{
+\notes\relative c''{
\slurUp
\stemDown
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="
"
}
\score{
- \relative c''{
+ \notes \relative c''{
\override Slur #'direction = #1
a8( a a4)
a4( a8 a)
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="
"
}
\score{
- \relative c''{
+ \notes \relative c''{
e1( \break a,)
\time 2/4
e'2( \break a,)(\break
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="
Slurs behave decently when broken across a linebreak.
\score{
\context PianoStaff <<
- \context Staff=one \relative c'{
+ \context Staff=one \notes\relative c'{
\stemUp \slurUp
c4( c \change Staff=two c c) |
\change Staff=one
c4( \change Staff=one c c \change Staff=two c)
r1
}
- \context Staff=two \relative c'{
+ \context Staff=two \notes\relative c'{
\clef bass
s1 s1 s1 s1 s1 s1 s1 s1 s1 s1
}
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="Slurs should not get confused by augmentation dots. With a lot
of dots, the problems becomes more visible."
}
\score {
- \relative c'' {
+ \notes\relative c'' {
c4.............( c)
}
\paper {
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="
Slurs should look nice and symmetric. The curvature may increase
}
\score{
- \relative c''{
+ \notes\relative c''{
\time 3/4
\slurUp
\stemBoth a ( \stemDown a \stemBoth a) a( c a) a( e' a,) a( g' a,)
-\version "2.3.4"
+\version "2.2.0"
\header
{
texidoc ="Slurs may be placed over rest. The slur will avoid colliding with
"
}
-\score{ { \stemDown c'4 ( r4 c'2)
+\score{ \notes { \stemDown c'4 ( r4 c'2)
\relative c'' {
% Finish with F if played separately
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc="An extra offset may be added between a slur and staccato(s)."
}
\paper { raggedright = ##t}
\score {
- \context Staff \relative c'' {
+ \context Staff \notes\relative c'' {
\override Slur
#'attachment-offset = #'((0 . 1) . (0 . 1))
a-.( g-. a)-.
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc="Trend of broken slur with user-overridden stem attachment should also
follow the same vertical direction it would have had in unbroken state."
}
\score {
- \relative c' {
+ \notes\relative c' {
\override Slur #'attachment = #'(stem . stem)
f( c' c c \break
c c c \stemUp c)
-\version "2.3.4"
+\version "2.2.0"
\header
{
texidoc = "Symmetric figures should lead to symmetric slurs."
}
\score{
- \relative c''<<
+ \notes\relative c''<<
\time 4/4
\context Staff{
f8(f f f) f(g g f) f(a a f) f(b b f)
-\version "2.3.4"
+\version "2.2.0"
\header
{
texidoc = "Symmetric figures should lead to symmetric slurs."
}
\score{
- \relative c'<<
+ \notes\relative c'<<
\time 6/8
\context Staff{
e8(e e) e(d e) e(c e) e(b e)
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Accidentals in different staves do not affect the
spacing of the quarter notes here."
}
-\score { \relative c'' << \new Staff { \time 4/4
+\score { \notes \relative c'' << \new Staff { \time 4/4
c8[ c8 cis8 cis8]
cis8[ cis8 cis8 cis]
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Accidentals do not influence the amount of stretchable space.
}
\score {
- \relative c'' \context GrandStaff {
+ \notes \relative c'' \context GrandStaff {
#(set-accidental-style 'piano-cautionary)
d16 d d d d d cis d
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Accidentals sticking out to the left
of a note will take a little more space, but only if the spacing is tight."
}
-\score { \relative c'' {
+\score { \notes \relative c'' {
\time 8/4
c2 c2 cis2 cis2 |
c8 c8 cis8 cis8 cis c c c]
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Downstem notes following a barline are
printed with some extra space. This is an optical correction similar
sd = \override Stem #'direction = #-1
su = \override Stem #'direction = #1
-\score { \relative c''
+\score { \notes\relative c''
{
%\override Staff.StaffSpacing #'stem-spacing-correction = #10
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Clef changes at the start of a line get much more space
}
-\score { {
+\score {\notes {
<< \new Staff {
c'2
\clef bass e16 f a
}>>
}
\paper { raggedright = ##t
-\context { \Staff
+\context { \StaffContext
TimeSignature = \turnOff
}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc ="Broken engraving of a bar at the end of a line does not upset
\score
{
- \relative c' {
+\notes \relative c' {
c2.. r8
c2.. r8
\time 3/4 \break
#(ly:set-option 'old-relative)
-\version "2.3.4"
+\version "2.2.0"
\header { texidoc = "
A voicelet (a very short voice to get polyphonic chords correct)
should not confuse the spacing engine."
\score {
- { \context Staff \relative c' {
+\notes { \context Staff \relative c' {
c4
<<
{ r4 dis'4 } \\
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "A clef can be folded below notes in a different staff, if
this does not disrupt the flow of the notes."
}
-\score { \relative c'' <<
+\score { \notes \relative c'' <<
\new Staff { c4 c16[ c c c] c4 c4 }
\new Staff { \clef bass c,2 \clef treble c'2 }
>>
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "A clef can be folded below notes in a different staff, if
show where columns are in the score."
}
-\score { \relative c'' <<
+\score { \notes \relative c'' <<
\new Staff { c4 c4 c4 \bar "|." }
\new Staff { \clef bass c,2 \clef treble c'2 }
>>
\paper { raggedright = ##t
- \context { \Score
+ \context { \ScoreContext
\override NonMusicalPaperColumn #'print-function = #Paper_column::print
\override PaperColumn #'print-function = #Paper_column::print
\override NonMusicalPaperColumn #'font-family = #'roman
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Spacing uses the duration of the notes, but disregards
"
}
-\score { \relative c''
+\score { \notes \relative c''
\context Voice
{
c8[ c8]
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Grace note spacing. Should it be tuned? "
}
\score {
- \context Voice \relative c'' { \grace { c16[ d] } c4 }
+ \notes \context Voice \relative c'' { \grace { c16[ d] } c4 }
\paper { raggedright = ##t}
}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "For knees, the spacing correction is such that the
width of the note heads and the thickness of the stem.
"
}
-\score {
+\score { \notes
{
g''8[ g g'' g'']
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc = "Concurrent tuplets should be equidistant on all staffs.
-multipart = \relative c'{
+multipart = \notes \relative c'{
\context StaffGroup <<
\new Staff \context Voice {
\times 2/10 { c8[ c c c c c c c c c] }
}
\score{
- {
+ \notes {
\multipart
}
}
-\score { \relative c'' \context Staff {
+\score { \notes \relative c'' \context Staff {
\set autoBeaming = ##f
a8[ a8 a8 a8]
a8 a8 a8 a8
}
}
-\version "2.3.4"
+\version "2.2.0"
-\version "2.3.4"
+\version "2.2.0"
\header {
\score {
- \relative c'' \new Staff { \repeat unfold 20 { c1 } }
+ \notes \relative c'' \new Staff { \repeat unfold 20 { c1 } }
\paper{
raggedlast = ##t
}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Rests get a little less space, since they are narrower.
However, the quarter rest in feta font is relatively wide, causing this
effect to be very small.
"
}
-\score { \relative c'' \context Staff {
+\score { \notes \relative c'' \context Staff {
\time 12/4
r4 c4 c4 c4 r4 r4 c4
}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Notes that are shorter than the common shortest note get a
}
-\score { \relative c''
+\score { \notes \relative c''
{
\time 2/4
c16 c c c c4 c4
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Upstem notes before a barline are printed with some extra
sd = \override Stem #'direction = #-1
su = \override Stem #'direction = #1
-\score { \relative e'
+\score { \notes\relative e'
{
%\override Staff.StaffSpacing #'stem-spacing-correction = #0.5
-\version "2.3.4"
+\version "2.2.0"
\header{
}
\score {
- \context Voice \relative c {
+ \context Voice \notes\relative c {
% make sure neutral is down.
\override Stem #'neutral-direction = #-1
\time 16/4 c''4 c c, c' d, c' e, c' f, c' g c a c b c
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "For juxtaposed chords with the same direction, a
slight optical correction is used. It is constant, and works only if
two chords have no common head-positions range."
}
-\score { \relative c'' {
+\score { \notes \relative c'' {
\stemDown
\time 12/4
f8[
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc ="Space from a normal note (or barline) to a grace note is
}
\score {
- \context Voice
+ \context Voice \notes
{ \time 2/4
\relative c'' {
e8 e \grace d8 e e \grace f8 e es, d' d
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "
When tightly spaced, the spaces between elements (hinterfleisch?)
}
\score {
- \relative c''{
+ \notes \relative c''{
r1 e4 f, e' f,
}
\paper {
+++ /dev/null
-\version "2.3.4"
-
-\header {
-
- texidoc = "At the beginning of a system, the @code{|:} repeat
-barline is drawn between the staves, but the @code{:|} is not."
-
- }
-
-\score {
- \new PianoStaff <<
- \context Staff = up {
- \bar "|:" r1
- \bar ":|" \break r1
- }
- \context Staff=down { r r }
- >>
- \paper{ raggedright = ##t }
-}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Span bars are drawn only between staff bar lines. By setting
bar lines to transparent, they are shown only between systems.
-Setting @code{SpanBar} transparent removes the barlines
+Setting @code{SpanBar} transparent does the removes the barlines
between systems.
"
}
\score {
- \relative c' \new StaffGroup <<
+ \notes \relative c' \new StaffGroup <<
\new Staff {
\override Score.BarLine #'transparent = ##t
a1 a1
>>
\paper {
\context {
- \Staff
+ \StaffContext
}
raggedright =##t
}
-\version "2.3.4"
+\version "2.2.0"
\header{
}
\score {
- \context Voice \relative c' {
+ \context Voice \notes\relative c' {
e'4-. f-. g-. d-. c-. b-.
\stemDown
e,-. d-. c-. b-. a-. g-.
\header { texidoc = " Staves starting and ending halfway include clefs
and bar lines. " }
-\version "2.3.4"
+\version "2.2.0"
\score {
- \new StaffGroup \relative c'' <<
+ \new StaffGroup \notes \relative c'' <<
\new Staff { c4 c c c \bar "||" c c c c }
{ \skip 4 \new Staff { c c c } }
>>
}
-\version "2.3.4"
+\version "2.2.0"
\score {
<<
fontSize = #-4
\override StaffSymbol #'staff-space = #(magstep -4)
}
- \relative c' {
+ \notes \relative c' {
\override DynamicText #'extra-offset = #'(0 . 3)
s1-\f c''8[(\< r a g]) e[ r d( <f a>])\! \times 2/3 { d4 d d }
}
\new Staff
- \relative c' {
+ \notes \relative c' {
\override DynamicText #'extra-offset = #'(0 . 3)
s1-\f c''8[(\< r a g]) e[ r d( <f a>])\! \times 2/3 { d4 d d }
}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "The staff is a grob (graphical object) which may be adjusted as well, for example, to have 6 thick lines and a slightly large @code{staff-space}.
}
-mus = \relative c' { c4 g' d'8 d d d }
+mus = \notes \relative c' { c4 g' d'8 d d d }
\score {
- <<
+ \notes <<
\new Staff {
\override Staff.StaffSymbol #'thickness = #2.0
\override Staff.StaffSymbol #'line-count = #6
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Stanza numbers are put left of their lyric. Theyr are aligned in a column."
\score {
<<
- \context Voice = "A" \relative c'' { r4 r4 c4 c4 }
+ \context Voice = "A" \notes \relative c'' { r4 r4 c4 c4 }
\lyricsto A \new Lyrics \lyrics {
\skip 2
\set stanza = "1."
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="
\score {
- \context Voice \relative c {
+ \context Voice \notes\relative c {
b''4 ~ b8(b8) e4 e,
}
-\version "2.3.4"
+\version "2.2.0"
\header {
}
\score {
- \relative c'' {
+ \notes \relative c'' {
\stemDown d c b a g f e
\stemBoth
\stemUp a b c d e f g a
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="
}
\score {
- \context Voice \relative c {
+ \context Voice \notes\relative c {
\time 12/4 c''4 c c c a f' f, a
}
\score {
- \context Voice \relative c {
+ \context Voice \notes\relative c {
\time 12/4 c''4 c c c a f' f, a
}
\paper {
raggedright = ##t
- \context { \Score
+ \context { \ScoreContext
\override SpacingSpanner #'stem-spacing-correction = #0.0
} }
}
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="
Stem tremolos or rolls are tremolo signs that look like beam segments
\score{
- \context Voice \relative c''{
+ \context Voice\notes \relative c''{
\override TextScript #'direction = #1
\override TextScript #'padding = #5
a1:4^":4" a:8^":8" c:16^":16" a:32^":32" a^"x" a:^":"
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "The size of every system is correctly determined; this
}
-\score {
+\score { \notes
\context Voice
{ \unset Staff.minimumVerticalExtent
\slurDown c4 ( g4 c''4)
\paper {
\context {
- \Score
+ \ScoreContext
\override System #'print-function = #box-grob-stencil
}
}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc =
"
}
-\score { {
+\score { \notes {
\context StaffGroup <<
c4
\context PianoStaff <<
}
-\version "2.3.4"
+\version "2.2.0"
\score {
- \new TabStaff {
+ \notes \new TabStaff {
\set TabStaff.stringTunings = #'(5 10 15 20)
\relative c'' { c4 d e f }
}
-\version "2.3.4"
+\version "2.2.0"
\header{ texidoc = "@cindex Tabulature
A sample tablature, with both normal staff and tab.
"
}
-partition = {
+partition = \notes {
\key e \major
<e\5 dis'\4>
<e dis'>
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "The @code{\\tag} command marks music expressions with a
\paper { raggedright= ##t }
common =
- \relative c'' {
+\notes \relative c'' {
c1
\relative c' <<
\score {
- \simultaneous {
+ \notes \simultaneous {
\new Staff {
\set Staff.instrument = #"both"
\common
}
\new Staff {
\set Staff.instrument = #"part"
- \applymusic #(remove-tag 'score) \common
+ \apply #(remove-tag 'score) \common
}
\new Staff {
\set Staff.instrument = #"score"
- \applymusic #(remove-tag 'part) \common
+ \apply #(remove-tag 'part) \common
}
}
}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc= "Text spanners should not repeat start text when broken."
}
\score {
- \relative c'' {
+ \notes \relative c'' {
\set crescendoText = #"cresc."
\set crescendoSpanner = #'dashed-line
c1\< c \break
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Tie engraver uses @code{busyGrobs} to keep track of
\score
{
- \context Staff \relative c''
- <<
- { \times 2/3 { c'8~ c8~ c8~ c8~ c8~ c8 } }
- \\
- { \voiceTwo \times 2/5 { a,4 ~a4 ~a4~ a4~ a4 }}
- \\
- { \voiceThree { b,8 ~ b8 ~ b8 ~ b8 }}
- >>
-
- \paper {
- raggedright = ##t
- }
+\notes \context Staff \relative c''
+ <<
+ { \times 2/3 { c'8~ c8~ c8~ c8~ c8~ c8 } }
+ \\
+ { \voiceTwo \times 2/5 { a,4 ~a4 ~a4~ a4~ a4 }}
+ \\
+ { \voiceThree { b,8 ~ b8 ~ b8 ~ b8 }}
+ >>
}
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="
When tying chords, the outer slurs point outwards, the inner slurs
}
-t = \relative c' { <c e g> ~ <c e g> }
+t = \notes \relative c' { <c e g> ~ <c e g> }
\score {
- \context Voice {
+\notes \context Voice {
\t
\transpose c g \t
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Ties should not collide with dots."
}
-\score{{\time 9/8 \key f \major\clef bass
+\score{\notes{\time 9/8 \key f \major\clef bass
g4 d8 bes4. ~ bes4 a8 \bar "|"
a8 gis8 d8 f4. gis,4. \bar "|"
a,4. ~ a,4 r8 r4 r8 \bar "|"
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Tieing a grace to the to a following grace or main note works."
}
\paper { raggedright= ##t }
-\score { \context Voice \relative c'' {
+\score { \notes \context Voice \relative c'' {
c4 \grace { c8 ~ c16 ~ } c4
}
}
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="
"
}
\score{
- \relative c''{
+ \notes\relative c''{
%b2~b4~b8~b16~b32~b64 r64\break
%a2~a4~a8~a16~a32~a64 r64
\time 8/4
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "In combination with a beam, the bracket of the tuplet
}
\paper { raggedright= ##t }
-\score { \context Voice\relative c'' {
+\score { \notes \context Voice\relative c'' {
\times 2/3 { r c8[ c8] }
\times 2/3 { c8[ c c] }
\times 2/3 { c16[ c16] c8[ c8] }
}
-\version "2.3.4"
+\version "2.2.0"
\paper {
indent = 0.0\mm
}
\score{
- \relative c'' {
+ \notes \relative c'' {
\set tupletNumberFormatFunction = #fraction-tuplet-formatter
\times 17/12 { c8 c4 c8 c8}
}
-\version "2.3.4"
-
-
+\version "2.2.0"
\header {
-
- texidoc=" Nested tuplets can be printed, using a manual hack to
- move the outer bracket up."
-
+ texidoc="By a manual hack for nested tuplets, an outer tuplet can be moved up."
}
#(define (make-text-checker-once text)
#(define text-checker-once #t)
\score {
- \relative c'' {
+ \notes\relative c'' {
\set tupletNumberFormatFunction = #fraction-tuplet-formatter
- \applyoutput #(lambda (gr org cur)
- (if (equal? (ly:grob-property gr 'text) "6:4")
- (set! (ly:grob-property gr 'extra-offset) '(0 . 1.5))))
- \times 4/6 {
+ \applyoutput #(outputproperty-compatibility (make-text-checker-once "2:3")
+ 'extra-offset '(0 . 1.5))
+ \times 2/3 {
\times 2/3 {
a a a
}
}
-\version "2.3.4"
+\version "2.2.0"
\score {
- \context Voice \relative c'' {
+ \context Voice \notes\relative c'' {
\times 2/3 { c'8 c,, c }
\times 2/3 { c'8 c'' c,, }
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Tuplets may contain rests. "
}
\score {
- \context Voice \relative c'' {
+ \context Voice \notes \relative c'' {
\time 2/4
\times 2/3 { r c,,, c''' }
\times 2/3 { r c c }
}
-\version "2.3.4"
+\version "2.2.0"
\score {
- \relative c' {
+ \notes \relative c' {
\times 4/5 { a'4 as g fis f }
\times 4/5 { fis4 e es d des }
\times 4/5 { fis,4 e es d des }
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Horizontal tuplet brackets are shifted vertically
\paper { raggedright= ##t }
-\score { \context Voice\relative c'' {
+\score { \notes \context Voice\relative c'' {
\times 2/3 { b'4 b b }
\times 2/3 { f4 f f }
\times 2/3 { g4 g g }
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="
\paper { raggedright= ##t }
\score{
- \context Voice \relative c'' {
+ \notes \context Voice \relative c'' {
\times 2/3 { a8 b c }
\times 2/3 { r8 b[ f] }
\override TupletBracket #'bracket-flare = #'(0.5 . 0.5)
-\version "2.3.4"
+\version "2.2.0"
\header { texidoc= "
}
\score {
- \relative c'
+ \notes \relative c'
\context PianoStaff <<
\set PianoStaff.followVoice = ##t
\context Staff = one \context Voice {
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc ="Broken volta spanners behave correctly at their left edge in all cases."
%}
-voiceB = {
+voiceB = \notes {
\clef bass
\set Staff.instrument = "Bass"
\set Staff.instr = "B"
}
}
}
-voiceC = {
+voiceC = \notes {
\repeat volta 2
{
f f
}
}
-voiceD = {
+voiceD = \notes {
\repeat volta 2
{
f f
}
}
}
-voiceE = {
+voiceE = \notes {
\repeat volta 2
{
f f\break
}
}
\score{
- <<
+ \notes <<
\new Staff
on more staves in a score."
}
-\version "2.3.4"
+\version "2.2.0"
-vmus = { \repeat volta 2 c1 \alternative { d e } }
+vmus = \notes { \repeat volta 2 c1 \alternative { d e } }
\score {
- \relative c'' <<
+ \notes \relative c'' <<
\new StaffGroup <<
\context Staff \vmus
\new Staff \vmus
-\version "2.3.4"
+\version "2.2.0"
\header {
title = "Screech and boink"
subtitle = "Random complex notation"
}
\score {
- \context PianoStaff <<
+ \notes \context PianoStaff <<
\context Staff = up {
\time 4/8
\key c \minor
\override Beam #'thickness = #0.3
\override Stem #'thickness = #4.0
g'16[ b16 fis16 g16]
- << \applymusic #notes-to-clusters {
+ << \apply #notes-to-clusters {
as16 <as b>
<g b>
<g cis>
>>
}
>>
- \midi { \tempo 8 = 60 }
\paper {
raggedright = ##t
\context {
- \Staff
+ \StaffContext
\consists Horizontal_bracket_engraver
}
}
+ \midi { \tempo 8 = 60 }
}
+++ /dev/null
-%% A simple song in LilyPond
-<<
- \relative {
- \clef bass
- d,2 d c4 bes a2 \break
- c2 c d4 f g2
- }
- \newlyrics {
- My first Li -- ly song,
- Not much can go wrong!
- }
->>
-
-%% Optional helper for automatic updating by convert-ly. May be omitted.
-\version "2.3.4"
-
-%% Optional helper for quick click and edit mode. May be omitted
-#(ly:set-point-and-click 'line-column)
-
+++ /dev/null
-%% A simple piece in LilyPond, a scale.
-\relative {
- c' d e f g a b c
-}
-
-%% Optional helper for automatic updating by convert-ly. May be omitted.
-\version "2.3.4"
-\version "2.3.4"
+\version "2.2.0"
\header {
}
-barOne = { \once \override Staff.BarLine #'bar-size = #2
+barOne = \notes { \once \override Staff.BarLine #'bar-size = #2
\bar "|" }
-barTwo = { \once \override Staff.BarLine #'extra-offset = #'(0 . 2)
+barTwo = \notes { \once \override Staff.BarLine #'extra-offset = #'(0 . 2)
\once \override Staff.BarLine #'bar-size = #2
\bar "|" }
\score {
- \relative c' {
+\notes \relative c' {
\set Score.timing = ##f
\override Staff.Stem #'transparent = ##t
f4 a2 \barTwo g4 a2 f2 \barOne g4( f) f(
-\version "2.3.4"
+\version "2.2.0"
\header {
dedication = "dedication"
title = "Title"
% insert a score otherwise lilypond-book gets confused.
\score {
- {
+ \notes {
c'4
}
}
-\version "2.3.4"
+\version "2.2.0"
\header {
title = "Song"
subtitle = "(tune)"
%%%%%%%%%%%% Keys'n'thangs %%%%%%%%%%%%%%%%%
-global = {
+global = \notes {
\time 4/4
}
-Key = { \key c \major }
+Key = \notes { \key c \major }
% ############ Horns ############
% ------ Trumpet ------
-trpt = \transpose c d \relative c'' {
+trpt = \notes \transpose c d \relative c'' {
\Key
c1 c c
}
-trpharmony = \transpose c' d { \jzchords }
+trpharmony = \chords \transpose c' d { \jzchords }
trumpet = {
\global
\set Staff.instrument = #"Trumpet"
}
% ------ Alto Saxophone ------
-alto = \transpose c a \relative c' {
+alto = \notes \transpose c a \relative c' {
\Key
c1 c c
}
-altoharmony = \transpose c' a { \jzchords }
+altoharmony = \chords \transpose c' a { \jzchords }
altosax = {
\global
\set Staff.instrument = #"Alto Sax"
}
% ------ Baritone Saxophone ------
-bari = \transpose c a' \relative c {
+bari = \notes \transpose c a' \relative c {
\Key
c1 c \sl d4^"Solo" d d d \nsl
}
-bariharmony = \transpose c' a \chords { \jzchords s1 s d2:maj e:m7 }
+bariharmony = \chords \transpose c' a { \jzchords s1 s d2:maj e:m7 }
barisax = {
\global
\set Staff.instrument = #"Bari Sax"
>>
}
% ------ Trombone ------
-tbone = \relative c {
+tbone = \notes \relative c {
\Key
c1 c c
}
}
% ############ Rhythm Section #############
% ------ Guitar ------
-gtr = \relative c'' {
+gtr = \notes \relative c'' {
\Key
c1 \sl b4 b b b \nsl c1
}
}
%% ------ Piano ------
-rhUpper = \relative c'' {
+rhUpper = \notes \relative c'' {
\voiceOne
\Key
c1 c c
}
-rhLower = \relative c' {
+rhLower = \notes \relative c' {
\voiceTwo
\Key
e1 e e
}
-lhUpper = \relative c' {
+lhUpper = \notes \relative c' {
\voiceOne
\Key
g1 g g
}
-lhLower = \relative c {
+lhLower = \notes \relative c {
\voiceTwo
\Key
c1 c c
}
% ------ Bass Guitar ------
-bass = \relative c {
+bass = \notes \relative c {
\Key
c1 c c
}
linewidth = 15.0 \cm
\context { \RemoveEmptyStaffContext }
\context {
- \Score
+ \ScoreContext
\override BarNumber #'padding = #3
\override RehearsalMark #'padding = #2
skipBars = ##t
}
\midi { \tempo 4 = 75 }
}
+
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Lead sheet format: chords with melody."
c4:m f:min7 g:maj c:aug d2:dim b:sus
}
-melody = \relative c' {
+melody = \notes \relative c' {
f4 e8[ c] d4 g | a2 ~ a2
}
\score {
- <<
+ \notes <<
\context ChordNames {
\set chordChanges = ##t
\harmonies
-\version "2.3.4"
+\version "2.2.0"
\header
{
texidoc = "Popsong format: chords, melody and lyrics."
}
-melody = \relative c'
+melody = \notes \relative c'
{
a b c d
}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Melody and lyrics."
}
-melody = \relative c'' {
+melody = \notes \relative c'' {
a b c d
}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Only a melody."
}
-melody = \relative c' {
+melody = \notes \relative c' {
a b c d
}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc ="Polyphonic piano music."
}
-upperOne = \relative c'' {
+upperOne = \notes\relative c'' {
\voiceOne
a b c d
}
-upperTwo = \relative c' {
+upperTwo = \notes\relative c' {
\voiceTwo
a2 c
}
-lowerOne = \relative c {
+lowerOne = \notes\relative c {
\voiceOne
a2 c
}
-lowerTwo = \relative c {
+lowerTwo = \notes\relative c {
\voiceTwo
a1
}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc ="
Dynamics on a separate line, neatly centered between staffs.
"
}
-upper = \relative c'' {
+upper = \notes\relative c'' {
a b c d
}
-lower = \relative c {
+lower = \notes\relative c {
a2 c
}
-dynamics = {
+dynamics = \notes {
s2\fff\> s4
s\!\pp
}
-pedal = {
+pedal = \notes {
s2\sustainDown s2\sustainUp
}
\consistsend "Axis_group_engraver"
}
\context {
- \PianoStaff
+ \PianoStaffContext
\accepts Dynamics
\override VerticalAlignment #'forced-distance = #7
}
\consists "Dynamic_performer"
}
\context {
- \PianoStaff
+ \PianoStaffContext
\accepts Dynamics
}
}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc ="Lyrics between two staffs."
}
-upper = \relative c'' {
+upper = \notes\relative c'' {
a b c d
}
-lower = \relative c {
+lower = \notes\relative c {
a2 c
}
>>
\paper {
\context {
- \GrandStaff
+ \GrandStaffContext
\accepts "Lyrics"
}
\context {
- %\Lyrics
- \Lyrics
+ %\LyricsContext
+ \LyricsContext
\consists "Bar_engraver"
}
}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc ="Classical song format: one staff with melody and lyrics,
and piano accompaniment."
}
-melody = \relative c'' {
+melody = \notes \relative c'' {
a b c d
}
Aaa Bee Cee Dee
}
-upper = \relative c'' {
+upper = \notes\relative c'' {
a b c d
}
-lower = \relative c {
+lower = \notes\relative c {
a2 c
}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Simple piano music."
}
-upper = \relative c'' {
+upper = \notes\relative c'' {
a b c d
}
-lower = \relative c {
+lower = \notes\relative c {
a2 c
}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "
"
}
-sopMusic = \relative c'' { c4 c c8[( b)] c4 }
+sopMusic = \notes \relative c'' { c4 c c8[( b)] c4 }
sopWords = \lyrics { hi4 hi hi hi }
-altoMusic = \relative c' { e4 f d e }
+altoMusic = \notes \relative c' { e4 f d e }
altoWords =\lyrics { ha4 ha ha ha }
-tenorMusic = \relative c' { g4 a f g }
+tenorMusic = \notes \relative c' { g4 a f g }
tenorWords = \lyrics { hu4 hu hu hu }
-bassMusic = \relative c { c4 c g c }
+bassMusic = \notes \relative c { c4 c g c }
bassWords = \lyrics { ho4 ho ho ho }
-\score {
+\score { \notes
\context StaffGroup <<
\context Lyrics = sopranos { s1 }
\context Staff = women <<
\context {
% a little smaller so lyrics can be closer to the staff.
- \Staff
+ \StaffContext
minimumVerticalExtent = #'(-3 . 3)
}
}
-\version "2.3.4"
+\version "2.2.0"
%% +.ly: Be the first .ly file for lys-to-tely.py.
%% Better to make lys-to-tely.py include "introduction.texi" or
%% other .texi documents too?
-\version "2.3.4"
+\version "2.2.0"
\header {
(add-script m "staccato"))
\score {
- \relative c'' {
- a b \applymusic #(lambda (x) (music-map add-staccato x)) { c c }
+ \notes\relative c'' {
+ a b \apply #(lambda (x) (music-map add-staccato x)) { c c }
}
\paper{ raggedright = ##t }
}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc= "@cindex make-music Fingering
m)
\score {
- \applymusic #(lambda (x) (add-text-script x "6") (display-music x) x ) { c'4-3 }
+ \apply #(lambda (x) (add-text-script x "6") (display-music x) x ) \notes { c'4-3 }
\paper{ raggedright = ##t }
}
"
}
-\version "2.3.4"
+\version "2.2.0"
#(define (kill-ambitus grob grob-context apply-context)
(if (memq 'ambitus-interface (ly:grob-property grob 'interfaces))
-voiceA = \relative c'' {
+voiceA = \notes \relative c'' {
c4 a d e f2
}
-voiceB = \relative c' {
+voiceB = \notes \relative c' {
es4 f g as b2
}
\score {
raggedright = ##t
\context {
- \Voice
+ \VoiceContext
\consists Ambitus_engraver
}
}
"
}
-\version "2.3.4"
+\version "2.2.0"
\score {
- \context Voice \relative c {
+ \context Voice \notes\relative c {
\time 3/4
\override Staff.Accidental #'style = #'default
cisis''^"Accidental style = \#'default" cisis! cisis? |
-\version "2.3.4"
+\version "2.2.0"
% TODO: split ancient-font into seperate files; possibly in
% different locations.
\header {
\override Staff.StaffSymbol #'line-count = #4
- \transpose c c {
+ \notes \transpose c c {
\override Staff.KeySignature #'style = #'vaticana
\override Staff.Accidental #'style = #'vaticana
\override NoteHead #'style = #'vaticana_punctum
% \override Staff.StaffSymbol #'line-count = #5
\context Staff \applyoutput #(outputproperty-compatibility (make-type-checker 'staff-symbol-interface) 'line-count 5)
- \transpose c c {
+ \notes \transpose c c {
\set autoBeaming = ##f
\override NoteHead #'style = #'neo_mensural
\override Rest #'style = #'neo_mensural
linethickness = #(/ staffspace 5.0)
indent = 0.0
\context {
- \Score
+ \ScoreContext
\accepts MensuralStaff
\accepts GregorianStaff
% timing = ##f %%%%%%%% FIXME: this has no effect
}
\context {
- \Voice
+ \VoiceContext
\name MensuralVoice
\alias Voice
\remove Ligature_bracket_engraver
autoBeaming = ##f
}
\context {
- \Voice
+ \VoiceContext
\name GregorianVoice
\alias Voice
\remove Ligature_bracket_engraver
autoBeaming = ##f
}
\context {
- \Staff
+ \StaffContext
\name MensuralStaff
\alias Staff
\accepts MensuralVoice
clefOctavation = #0
}
\context {
- \Staff
+ \StaffContext
\name GregorianStaff
\alias Staff
\accepts GregorianVoice
-\version "2.3.4"
+\version "2.2.0"
% TODO: move stuff from ancient-font into here? See comment
% for ancient-font.ly
\header {
}
\score {
- {
+ \notes {
\override Staff.TimeSignature #'style = #'neo_mensural
s1
}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "@cindex Bagpipe Music
linewidth = 14.0 \cm
indent = 0.0 \cm
\context {
- \Staff
+ \StaffContext
\override TimeSignature #'style = #'C
\override TimeSignature #'break-visibility = #begin-of-line-visible
}
}
-taor = { \grace {
+taor = \notes{ \grace {
g32[ d' g e']
}
}
-grip = {
+grip = \notes {
\grace {
g32[ b g ]
}
}
-thrd = {
+thrd = \notes {
\grace {
g32[ d' c']
}
}
-birl = {
+birl = \notes {
\grace {
g32[ a g]
}
}
-gstd = {
+gstd = \notes {
\grace {
g'32[ d' g]
}
}
-lgg = {
+lgg = \notes {
\grace {
g32
}
}
-lag = {
+lag = \notes {
\grace {
a32
}
}
-fgg = {
+fgg = \notes {
\grace {
f32[ g'32]
}
}
-dblb = {
+dblb = \notes {
\grace {
g'32[ b d']
}
}
-dblc = {
+dblc = \notes {
\grace {
g'32[ c' d']
}
}
-dble = {
+dble = \notes {
\grace {
g'32[ e' f']
}
}
-dblf = {
+dblf = \notes {
\grace {
g'32[ f' g']
}
}
-dblg = {
+dblg = \notes {
\grace {
g'32[ f']
}
}
-dbla = {
+dbla = \notes {
\grace {
a'32[ g']
}
}
-cg = {
+cg = \notes {
\grace {
c'32
}
}
-eg = {
+eg = \notes {
\grace {
e'32
}
}
-gg = {
+gg = \notes {
\grace {
g'32
}
}
-dg = {
+dg = \notes {
\grace {
d'32
}
}
-hag = {
+hag = \notes {
\grace {
a'32
}
}
-gefg = {
+gefg = \notes {
\grace {
g'32[ e' f']
}
}
-efg = {
+efg = \notes {
\grace {
e'32[ f']
}
}
-gdcg = {
+gdcg = \notes {
\grace {
g'32[ d' c']
}
}
-gcdg = {
+gcdg = \notes {
\grace {
g'32[ c' d']
}
}
\score {
- {
+ \notes {
\time 6/8 \partial 4
\tieUp
\slurUp
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "@cindex Bars Always
\score {
- \relative c''{
+ \notes \relative c''{
\set Score.barAlways = ##t
\set Score.defaultBarType = ":|:"
c4 c4 c4 c4 }
-\version "2.3.4"
+\version "2.2.0"
\header { texidoc = "@cindex Bar line lyric only
You can move @code{Bar_engraver} and @code{Span_bar_engraver} to
a different engraving context, if you want, for example, bar lines
}
\score {
- \relative c' \context ChoirStaff <<
+\notes \relative c' \context ChoirStaff <<
\new Staff { c1 c1 c1}
\context Lyrics \lyrics <<
{ bla1 die bla }
\paper {
raggedright = ##t
\context {
- \Lyrics
+ \LyricsContext
\consists Bar_engraver
% need procedure, since lyrics doesn't have a staff_sym engraver.
\override BarLine #'bar-size-procedure = #(lambda (x) 3.0)
}
\context {
- \Lyrics
+ \LyricsContext
\consists "Span_bar_engraver"
}
\context{
- \ChoirStaff
+ \ChoirStaffContext
\remove "Span_bar_engraver"
}
\context {
- \Staff
+ \StaffContext
\remove "Bar_engraver"
}
}}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "@cindex Bar Lines
There a many types of bar lines available.
% TODO: dashed "|", HJJ
\score
{
- \relative c'' {
+\notes \relative c'' {
c4
\bar "|." c
\bar "|:"c
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "@cindex Bar Number Every Fifth Reset
#(set-bar-number-visibility 4)
\score {
<<
- \transpose c c'' {
+ \notes \transpose c c'' {
\override Score.BarNumber #'break-visibility =#end-of-line-invisible
\override Score.RehearsalMark #'padding = #2.5
\mark "A" \resetBarnum
" }
-\version "2.3.4"
+\version "2.2.0"
\score {
- \context Staff \transpose c c' {
+ \context Staff \notes \transpose c c' {
\override Score.BarNumber #'break-visibility = #end-of-line-invisible
\set Score.barNumberVisibility = #(every-nth-bar-number-visible 4)
\override Score.BarNumber #'print-function =
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="@cindex Bar Number Show All
By default, bar numbers are printed only in the first measure. This
" }
\score{
- \relative c'{
+ \notes\relative c'{
c1 c c
\override Score.BarNumber
#'break-visibility = #end-of-line-invisible
}
-\version "2.3.4"
+\version "2.2.0"
wipeNote = {
\once \override NoteHead #'transparent = ##t
\score {
- \relative c'' {
+ \notes \relative c'' {
<< {
c8[~
\wipeNote
-\version "2.3.4"
+\version "2.2.0"
% keep for now, although merging into beam-auto-override is a possibility.
\header {
texidoc = "@cindex Auto Beaming 4/8
}
\score{
- \relative c''{
+ \notes\relative c''{
\time 4/8
%{
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "@cindex Auto Beaming Override
%% TODO: check doc string. -hw
\score{
- \relative c''{
+ \notes \relative c''{
#(override-auto-beam-setting '(end * * * *) 1 2)
\time 2/4
% one beam per measure
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc = "@cindex Beaming Presets
There are presets for the @code{auto-beam} engraver in the case of common
time signatures. " }
\score{
- \relative c''{
+ \notes \relative c''{
\time 1/2
c8 c c c
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="@cindex Beam Position Control
" }
\score {
- \context Voice \relative c {
+ \context Voice \notes\relative c {
%% from upper staffline (position 4) to centre (position 0)
\override Beam #'positions = #'(2 . 0)
c'8[ c]
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="@cindex Beam Count
" }
-fragment = {
+fragment = \notes {
#(override-auto-beam-setting '(end * * * *) 1 4)
f32 g a b b a g f
\score {
- \relative c \fragment
+ \notes\relative c \fragment
\paper { raggedright = ##t}
}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "@cindex Beam Dir Functions
\paper { raggedright = ##t}
\score {
- \relative c'' {\time 3/4
+ \notes\relative c'' {\time 3/4
\override Beam #'dir-function = #beam-dir-majority
c8[ g]
\override Beam #'dir-function = #beam-dir-mean
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="@cindex Beam Isknee
}
\score{
\context PianoStaff <<
- \context Staff=one \relative c'{
+ \context Staff=one \notes\relative c'{
s1
}
- \context Staff=two \relative c'{
+ \context Staff=two \notes\relative c'{
\clef bass
% no knee
\stemUp c8[ \change Staff=one \stemDown g'16 f]
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="@cindex Beam Neutral Direction
When a beam falls in the middle of the staff, the beams point normally
down. However, this behaviour can be altered, if desired.
" }
-fragment = {
+fragment = \notes {
b''8[ b]
\override Beam #'neutral-direction = #-1
b[ b]
\paper { raggedright = ##t}
\score {
- \relative c \fragment
+ \notes\relative c \fragment
\paper {raggedright = ##t }
}
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="@cindex Beam Over Rests
" }
\score{
- \relative c''{
+ \notes\relative c''{
r4 r8[ g a]
bes8[ r16 f g a]
bes8[ r16 \set stemLeftBeamCount = #1 f g a]
-\version "2.3.4"
+\version "2.2.0"
% possible rename to invis-notes.ly
% check if other documents call this "blank notes", though. I think
% invisible notes sounds better, but whatever it is, it should be
\header {
texidoc = "@cindex Invisible Notes
@cindex Blank Notes
-Invisible (or transparent) notes can be useful, when weird tricks are needed;
+Invisible (or transparent) can be useful, when wierd tricks are needed;
especially, a slur cannot be attach to a rest or spacer rest.
" }
\score {
- \relative c'' { c4 d4
+ \notes \relative c'' { c4 d4
\blanknotes e4 f4 \unblanknotes
g4 a
}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "@cindex Blank Paper Tab
@code{Bar_number_engraver}. Here is an empty staff with a tablature staff.
" }
-emptymusic = { \repeat unfold 4 { s1\break } \bar "|." }
+emptymusic = \notes { \repeat unfold 4 { s1\break } \bar "|." }
\score {
- <<
+\notes <<
\context Staff \emptymusic
\context TabStaff \emptymusic
>>
\paper {
\context {
- \Score
+ \ScoreContext
\remove Bar_number_engraver
}
}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc="@cindex Blank Paper
@code{Bar_number_engraver}.
" }
-
-
-\new Score \with {
- \override TimeSignature #'transparent = ##t
- \override NoteHead #'transparent = ##t
- defaultBarType = #""
- \remove Bar_number_engraver
-} {
- %% \clef treble
+\score {
+ \notes {
+ % \clef violin
\clef bass
\repeat unfold 3 { c1 \break }
+ }
+ \paper {
+ \context {
+ \ScoreContext
+ \override TimeSignature #'transparent = ##t
+ \override NoteHead #'transparent = ##t
+ defaultBarType = #""
+ \remove Bar_number_engraver
+ }
+ }
}
-
--- /dev/null
+
+\version "2.2.0"
+\header {
+texidoc = "@cindex Boxed Stencil
+
+The @code{print-function} can be overridden to draw a box around an arbitrary
+grob. " }
+
+
+ \score { \notes \relative c'' {
+
+ \override TextScript #'print-function =
+ #(make-stencil-boxer 0.1 0.3 0.2 Text_item::print)
+
+ c'4^"foo"
+
+\override Stem #'print-function =
+ #(make-stencil-boxer 0.05 0.25 0.25 Stem::print)
+
+\override Score.RehearsalMark #'print-function =
+ #(make-stencil-boxer 0.15 0.3 0.3 Text_item::print)
+ c8
+\revert Stem #'print-function
+
+ c4. c4 \mark "F" c1
+ }
+\paper{raggedright = ##t}
+}
+
+++ /dev/null
-
-\version "2.3.4"
-\header {
-texidoc = "@cindex Boxed Stencil
-
-The @code{print-function} can be overridden to draw a box around an arbitrary
-grob. " }
-
-
- \score { \relative c'' {
-
- \override TextScript #'print-function =
- #(make-stencil-boxer 0.1 0.3 0.2 Text_item::print)
-
- c'4^"foo"
-
-\override Stem #'print-function =
- #(make-stencil-boxer 0.05 0.25 0.25 Stem::print)
-
-\override Score.RehearsalMark #'print-function =
- #(make-stencil-boxer 0.15 0.3 0.3 Text_item::print)
- c8
-\revert Stem #'print-function
-
- c4. c4 \mark "F" c1
- }
-\paper{raggedright = ##t}
-}
-
}
-\version "2.3.4"
+\version "2.2.0"
-cadenza = \relative c' {
+cadenza = \notes \relative c' {
c4 d8 << { e f g } \\ { d4. } >>
g4 f2 g4 g
}
\score {
-
+ \notes
\relative c' \new GrandStaff <<
\new Staff { \cadenza c4 \bar "|." }
\new Staff {
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "@cindex Capital Letters
The font can be changed to small caps.
shapeNorm = \revert LyricText #'font-shape
\score { <<
- \relative c'' { c4 c4 c8 c8 c8 }
- \context Lyrics \lyrics {
+ \notes \relative c'' { c4 c4 c8 c8 c8 }
+ \lyrics \context Lyrics {
what4 is4 \shapeSC The8 Ma -- trix? }
>>
\paper { raggedright = ##t}
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="@cindex Cautionary Accidentals
Cautinary accidentals are displayed in slurs by default. They can be
shown also with accidentals of smaller size.
" }
-\score { \context Staff \transpose c c'' {
+\score { \notes \context Staff \transpose c c'' {
\key d \major
% \set Staff.autoReminders = #'cautionary
\override Staff.Accidental #'font-size = #0
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "@cindex Chord Names German
The english naming of chords (default) can be changed to german
% beses/beses
}
\score {
- <<
+\notes <<
\context ChordNames { \scm }
\new ChordNames {
\set instrument = #"german"
\context Voice { \scm } >>
\paper {
raggedright = ##t
- \context {\ChordNames \consists Instrument_name_engraver }}
+ \context {\ChordNamesContext \consists Instrument_name_engraver }}
}
-\version "2.3.4"
+\version "2.2.0"
\header {
}
-chs = \transpose c' c'
+chs = \notes \transpose c' c'
{
<c e g>1
<c es g>% m = minor triad
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% alternate Jazz notation
-efullmusicJazzAlt =
+efullmusicJazzAlt = \notes
{
<c e gis>1-\markup { "+" }
<c e g b>-\markup { \normal-size-super
efullJazzAlt = #(sequential-music-to-chord-exceptions efullmusicJazzAlt #f)
-epartialmusicJazzAlt = {
+epartialmusicJazzAlt = \notes{
<c d>1-\markup { \normal-size-super "2" }
<c es>-\markup { "m" }
<c f>-\markup { \normal-size-super "sus4" }
}
%}
- \new Staff \transpose c c' { \chs }
+ \new Staff \notes \transpose c c' { \chs }
>>
\paper {
indent = 3.\cm
\context {
- \ChordNames
+ \ChordNamesContext
\consists Instrument_name_engraver
}
}
-\version "2.3.4"
+\version "2.2.0"
\header { texidoc= "@cindex Chord Names No Inversions
Since there are several interpretations for recognizing
chord names, the lowest note is the bass note of a chord and the inversion
of the chord is found accordingly. " }
-scheme = {
+scheme = \notes {
<c' e' g'>1
<e' g' c''>
<e e' g' c''>
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Jazz chord names can also be printed without notes."
}
}
\paper{
\context{
- \ChordNames
+ \ChordNamesContext
\override BarLine #'bar-size = #4
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "@cindex Chord Octavation
Appending @code{_8} or @code{^8} to a clef name will
" }
\score {
- \context Voice \relative c {
+ \context Voice \notes\relative c {
\clef "bass_8" c4 c c c |
\clef "treble^8" c'''4 c c c |
}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "@cindex Clef End of Line
" }
\score {
- \transpose c c' {
+ \notes \transpose c c' {
\override Staff.Clef #'break-visibility = #end-of-line-visible
\override Staff.KeySignature #'break-visibility = #end-of-line-visible
\set Staff.explicitClefVisibility = #end-of-line-visible
-\version "2.3.4"
+\version "2.2.0"
\header{ texidoc = "
@cindex Clef Manual Control
}
-\score { {
+\score { \notes {
\set Staff.clefGlyph = #"clefs-F"
\set Staff.clefPosition = #2
c'4
-\version "2.3.4"
+\version "2.2.0"
% Ugh, we need to override some LaTeX titling stuff
\header {
- title = "Ouvertüre"
- subtitle = "Zu Heinrich Joseph v. Collins Trauerspiel"
- subsubtitle = \markup { \large \bold "Coriolan" }
+ title = "Ouvertüre\\vrule width0pt height 0pt depth 1ex"
+ subtitle = "\\normalsize Zu Heinrich Joseph v. Collins Trauerspiel\\vrule width0pt height 0pt depth 1ex"
+ subsubtitle = "\\Large\\bf Coriolan"
opus = "Op. 62"
- piece = \markup { \large Allegro con brio }
+ piece = "\\hspace*{30mm}\\normalfont\\large Allegro con brio"
composer = "Ludwig van Beethoven (1770-1827)"
texidoc = "@cindex Orchestra Score
-flauti = \relative c' {
+flauti = \notes \relative c' {
\set Staff.instrument = #"2 Flauti"
\set Staff.instr = #"Fl."
\time 4/4
\bar"|."
}
-oboi = \relative c' {
+oboi = \notes \relative c' {
\set Staff.instrument = #"2 Oboi"
\set Staff.instr = #"Ob."
c1 c
}
-clarinetti = \relative c' {
+clarinetti = \notes \relative c' {
\set Staff.instrument = \markup { \column < "Clarinetti" { "in B" \raisedFlat } > }
\set Staff.instr = \markup { \smaller { "Cl(B" \raisedFlat ")" } }
c1 c
}
-fagotti = \relative c' {
+fagotti = \notes \relative c' {
\set Staff.instrument = #"2 Fagotti"
\set Staff.instr = #"Fg."
c1 c
}
-corni = \relative c' {
+corni = \notes \relative c' {
\set Staff.instrument = \markup { \column < "Corni" { "in E" \raisedFlat } > }
\set Staff.instr = \markup { \smaller { "Cor(E" \raisedFlat ")" } }
c1 c
}
-trombe = \relative c' {
+trombe = \notes \relative c' {
\set Staff.instrument = \markup \column < "2 Trombe" "(C)" >
\set Staff.instr = \markup \column < "Tbe." "(C)" >
c1 c
}
-timpani = \relative c' {
+timpani = \notes \relative c' {
\set Staff.instrument = \markup \column < "Timpani" "(C-G)" >
\set Staff.instr = #"Timp."
c1 c
}
-violinoI = \relative c' {
+violinoI = \notes \relative c' {
\set Staff.instrument = #"Violino I "
\set Staff.instr = #"Vl. I "
c1 c
}
-violinoII = \relative c' {
+violinoII = \notes \relative c' {
\set Staff.instrument = #"Violino II "
\set Staff.instr = #"Vl. II "
c1 c
}
-viola = \relative c' {
+viola = \notes \relative c' {
\set Staff.instrument = #"Viola"
\set Staff.instr = #"Vla."
c1 c
%c
}
-violoncello = \relative c' {
+violoncello = \notes \relative c' {
\set Staff.instrument = \markup \column < "Violoncello" "e" "Contrabasso" >
\set Staff.instr = \markup \column < "Vc." "Cb." >
c1 c
}
-#(set-global-staff-size 16)
\score {
<<
\context StaffGroup ="legni" <<
>>
>>
\paper {
+ \paperSixteen
indent=100.0\mm
linewidth=150.0\mm
\context {
\RemoveEmptyStaffContext
}
\context {
- \Score
+ \OrchestralScoreContext
\override TimeSignature #'style = #'C
}
}
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="@cindex Count Systems
%% If we're not using 6 systems, there's definately a problem.
%% #(define (assert-system-count smob n) ...
+
#(define (display-systemno smob)
(let* ((this-system (ly:grob-system smob))
(systems (ly:spanner-broken-into
(ly:grob-original this-system))))
- (display smob)
- (display systems)
- (display this-system)
-
- (display (list-index systems this-system))
- (newline)))
+ (display smob)
+ (display (list-index systems this-system))
+ (newline)))
#(define (display-system-count smob)
\score{
- \relative c''{
+ \notes\relative c''{
\override NoteHead #'after-line-breaking-callback
- = #display-system-count
-% = #display-systemno
+ % = #display-system-count
+ = #display-systemno
c1
d
}
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="@cindex Crescendi
Crescendi can be printed in a number of different ways.
" }
\score{
-\relative c''{
+\notes\relative c''{
a1\fff\> a\pp\!
a\< a\!
\set crescendoText = \markup { \italic \bold "cresc." }
-\version "2.3.4"
+\version "2.2.0"
% TODO: check to see if this example can be simplified using \small
% or \tiny.
\header { texidoc = "@cindex Cue Notes
\score {
-
+ \notes
{
\set Staff.instrument = #"Horn in F"
\set Score.skipBars = ##t
@code{caesura}.
" }
-\version "2.3.4"
+\version "2.2.0"
\include "gregorian-init.ly"
\score {
<<
- \context Voice \transpose c c' {
+ \context Voice \notes \transpose c c' {
\set Score.timing = ##f
\set Score.barAlways = ##t
\override TextScript #'padding = #3
-\version "2.3.4"
+\version "2.2.0"
% possible rename to slurs-?
% TODO: find out what drarn means, and if there's an overlap with drarn.ly
\header{
"
}
-fragment = {
+fragment = \notes {
\override Slur #'direction = #1
\override Slur #'attachment = #'(head . head)
g''16(g)(g)(g)(d')(d)(d)(d)
\paper { raggedright = ##t}
\score {
- \relative c \fragment
+ \notes\relative c \fragment
\paper { raggedright = ##t}
}
-\version "2.3.4"
+\version "2.2.0"
\header{texidoc="@cindex Drarn
You can attach slurs and ties to noteheads.
" }
\score {
- \context Staff <<
+ \context Staff \notes <<
\relative c'' {
\time 3/8
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "@cindex Dynamic Absolute Volume
Absolute dynamics have an effect on MIDI files.
\score{
-\relative c''{
+\notes\relative c''{
%segfault in engraver
a1\ppp
a1\pp
-\version "2.3.4"
+\version "2.2.0"
% probably should be merged into refman.
\header{
texidoc = "@cindex Dynamic Piu Forte
piuf = \markup { \italic "pi\\`u" \dynamic "f" }
\score{
- \relative c''{
+ \notes\relative c''{
c-\piuf
c
c2\< c2\!
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "@cindex Embedded Postscript
By inserting the @TeX{} command \embeddedps, you can
%
\score {
- \relative c'' {
+ \notes \relative c'' {
a-"\\embeddedps{3 4 moveto 5 3 rlineto stroke}"
-"\\embeddedps{ [ 0 1 ] 0 setdash 3 5 moveto 5 -3 rlineto stroke}"
b-"\\embeddedps{3 4 moveto 0 0 1 2 8 4 20 3.5 rcurveto stroke}"
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "@cindex Embedded scm
(newline))
\score {
- \relative c' { c }
+ \notes\relative c' { c }
\paper {raggedright = ##t}
}
-\version "2.3.4"
+\version "2.2.0"
\header{ texidoc="@cindex Embedded Tex
You can embed Tex commands in your score. "}
-fragment = {
+fragment = \notes {
a''^"3 $\\times$ \\`a deux"
}
\paper { raggedright = ##t}
\score {
- \relative c \fragment
+ \notes\relative c \fragment
\paper { raggedright = ##t }
}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc ="In polyphonic notation, many voices can share a staff: In
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "The notation problem, creating a certain symbol,
% setup for Request->Element conversion. Guru-only
%
-MyStaff =\context {
+MyStaffContext=\context {
\type "Engraver_group_engraver"
\name Staff
}
-MyVoice = \context {
+MyVoiceContext = \context {
\type "Engraver_group_engraver"
\name Voice
\score {
\topVoice
\paper {
- \context { \MyStaff }
- \context { \MyVoice }
+ \context { \MyStaffContext }
+ \context { \MyVoiceContext }
}
}
-MyStaff = \context {
- \MyStaff
+MyStaffContext = \context {
+ \MyStaffContext
\consists "Staff_symbol_engraver"
}
\score {
\topVoice
\paper {
- \context { \MyStaff }
- \context { \MyVoice }
+ \context { \MyStaffContext }
+ \context { \MyVoiceContext }
}
}
-MyStaff = \context {
- \MyStaff
+MyStaffContext = \context {
+ \MyStaffContext
\consists "Clef_engraver"
\remove "Pitch_squash_engraver"
}
\score {
\topVoice
\paper {
- \context { \MyStaff }
- \context { \MyVoice }
+ \context { \MyStaffContext }
+ \context { \MyVoiceContext }
}
}
-MyVoice = \context {
- \MyVoice
+MyVoiceContext = \context {
+ \MyVoiceContext
\consists "Stem_engraver"
}
\score {
\topVoice
\paper {
- \context { \MyStaff }
- \context { \MyVoice }
+ \context { \MyStaffContext }
+ \context { \MyVoiceContext }
}
}
-MyVoice = \context {
- \MyVoice
+MyVoiceContext = \context {
+ \MyVoiceContext
\consists "Beam_engraver"
}
\score {
\topVoice
\paper {
- \context { \MyStaff }
- \context { \MyVoice }
+ \context { \MyStaffContext }
+ \context { \MyVoiceContext }
}
}
-MyVoice= \context {
- \MyVoice
+MyVoiceContext= \context {
+ \MyVoiceContext
\consists "Phrasing_slur_engraver"
\consists "Slur_engraver"
\consists "Script_engraver"
\score {
\topVoice
\paper {
- \context { \MyStaff }
- \context { \MyVoice }
+ \context { \MyStaffContext }
+ \context { \MyVoiceContext }
}
}
-MyStaff = \context {
- \MyStaff
+MyStaffContext = \context {
+ \MyStaffContext
\consists "Bar_engraver"
\consists "Time_signature_engraver"
\score {
\topVoice
\paper {
- \context { \MyStaff }
- \context { \MyVoice }
+ \context { \MyStaffContext }
+ \context { \MyVoiceContext }
}
}
-MyStaff = \context {
- \MyStaff
- \consists "Accidental_engraver"
- \consists "Key_engraver"
+MyStaffContext = \context
+ { \MyStaffContext
+ \consists "Accidental_engraver"
+ \consists "Key_engraver"
}
\score {
\topVoice
\paper {
- \context { \MyStaff }
- \context { \MyVoice }
+ \context { \MyStaffContext }
+ \context { \MyVoiceContext }
}
}
-\version "2.3.4"
+\version "2.2.0"
% definitely wil be renamed to something.
%{
\score {
<<
- \new Staff \relative c''{ c1 c c c c }
- \new StaffGroup \relative c''{
+ \new Staff \notes\relative c''{ c1 c c c c }
+ \new StaffGroup \notes\relative c''{
\new Staff
c1 c
<< c1 \new Staff { c1 } >>
\paper {
raggedright = ##t
\context{
- \Score
+ \ScoreContext
}
}
+++ /dev/null
-\version "2.2.0" \header {
-
- texidoc = "A hack to create feathered
-beams: manually make two beams overlap. This uses tuplets to
-condense the spacing."
-
- }
-
-\score {
- \notes \relative c' {
- \context Voice { << { \stemUp \once \override Voice.Beam #'positions = #'(0 . 0.5)
- \once \override Voice.TupletBracket #'number-visibility = ##f
- \times 1/2 { c8[ c c c c c c c]} } \\
- { \stemUp \once \override Voice.Beam #'positions = #'(0 . -0.5)
- \once \override Voice.TupletBracket #'number-visibility = ##f
- \times 1/2 { c[ c c c c c c c] }} >> } r2
- }
- \paper { raggedright = ##t }
-
-}
texidoc = "An alternate method to make bass figures is to use
@code{markup} texts."
}
-\version "2.3.4"
+\version "2.2.0"
nat = \markup { \natural }
sh = \markup { \smaller \raise #0.6 \sharp }
fl = \markup { \flat }
\score {
- \context Voice {
+ \context Voice \notes {
\clef bass
\override TextScript #'font-family = #'number
\override TextScript #'font-size = #-6
--- /dev/null
+\version "2.2.0"
+%possible rename to paper-fill-a4.ly -gp
+% candidate for reg -gp
+% Han says no, but keeping this comment temporarily so that I don't
+% forget and nominate it for reg again. :) -gp
+
+% test file to get a4 paper really filled,
+% without having to resort to the ever-ugly oversizing hack:
+%
+% `textheight = 310.0\mm'
+%
+% process this file with lilypond, and make sure footskip/headsep are set
+% at a reasonably (small) value. -- jcn
+%
+\header{ texidoc="@cindex Paper a4 Fill
+This should fill a4 paper. "
+}
+
+#(set-global-staff-size 13)
+
+\score{
+ \context Voice \notes\relative c'{
+ \clef alto
+ \repeat "unfold" 36 c1
+ }
+ \paper{
+ \paperThirteen
+ indent = 0.0\mm
+ % URG
+ % Vertical space is rather precious when typesetting
+ % music. But we can only set textheight here, and must
+ % guess and subtract the height needed for headers and
+ % footers. If we want a header or footer on some page,
+ % all other pages suffer shortened `textheight'.
+ % Try the maximum for a4, without loosing footers:
+ textheight = 297.0\mm - 7.0\mm
+ papersize = "a4"
+ linewidth = 15.0\mm
+ \context {
+ \StaffContext
+ minimumVerticalExtent = #(cons 0 0)
+ }
+ }
+}
+
-\version "2.3.4"
+\version "2.2.0"
% MERGED: stuff from follow-break.ly to follow-thread.ly
% followVoice: connect note heads with line when thread switches staff
\score {
- \relative c {
+ \notes\relative c {
\new PianoStaff <<
\set PianoStaff.followVoice = ##t
\context Staff=one \context Voice {
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc="@cindex Force hshift
Horizontal shift (@code{hshift}) can be forced in order to avoid collisions. " }
\score {
- \relative c'
+ \notes\relative c'
\context Staff << {
<d g>
<d g>
+++ /dev/null
-\header
-{
- texidoc = "Frets are supported as markup commands."
-}
-
-\version "2.3.4"
-
-\score {
- <<
- \new ChordNames \chords {d2. d d s fis fis fis s c c c}
-
- \context Voice=mel {
-% simple D chord
-
- d'2. ^\markup \fret-diagram-verbose #'((mute 6) (mute 5) (open 4) (place-fret 3 2) (place-fret 2 3) (place-fret 1 2))
- d' ^\markup \fret-diagram #"6-x;5-x;4-o;3-2;2-3;1-2;"
- d' ^\markup \fret-diagram-terse #"x;x;o;2;3;2;"
- r
-% fis major chord, 3/4 size, fingering labeled below string
-
- fis' ^\markup \override #'(size . 0.75) {\override #'(finger-code . below-string){\fret-diagram-verbose #'((place-fret 6 2 1) (barre 6 1 2) (place-fret 5 4 3) (place-fret 4 4 4) (place-fret 3 3 2) (place-fret 2 2 1) (place-fret 1 2 1))}}
- fis' ^\markup \override #'(finger-code . below-string) {\fret-diagram #"s:0.75;c:6-1-2;6-2-1;5-4-3;4-4-4;3-3-2;2-2-1;1-2-1;"}
- fis' ^\markup \override #'(size . 0.75) {\override #'(finger-code . below-string){\fret-diagram-terse #"2-1-(;4-3;4-4;3-2;2-1;2-1-);"}}
- r
-
-% c major barre chord, fingering labeled on frets
- c' ^\markup \override #'(dot-color . white) {
- \override #'(finger-code . in-dot)
- \fret-diagram-verbose #'((mute 6) (place-fret 5 3 1) (place-fret 4 5 2) (place-fret 3 5 3) (place-fret 2 5 4) (place-fret 1 3 1) (barre 5 1 3)) }
- % the chord below won't label on frets, because dot-color is black
- c' ^\markup \fret-diagram #"f:1;c:5-1-3;6-x;5-3-1;4-5-2;3-5-3;2-5-4;1-3-1;"
- c' ^\markup \override #'(dot-radius . 0.35) {
- \override #'(finger-code . in-dot) {
- \override #'(dot-color . white) {
- \fret-diagram-terse #"x;3-1-(;5-2;5-3;5-4;3-1-);"}}}
- r
-
-% c major scale using open strings
- c' ^\markup \fret-diagram-verbose #'((mute 6) (place-fret 5 3) (open 4) (place-fret 4 2) (place-fret 4 3) (open 3) (place-fret 3 2) (open 2) (place-fret 2 1) (mute 1))
- c' ^\markup \fret-diagram #'"6-x;5-3;4-o;4-2;4-3;3-o;3-2;2-o;2-1;1-x;"
- c' ^\markup \fret-diagram-terse #'"x;3;2 3;o 2;o 1;x;"
-
-% c major scale using no open strings
- c' ^\markup \fret-diagram-verbose #'((mute 6) (place-fret 5 3) (place-fret 5 5) (place-fret 4 2) (place-fret 4 3) (place-fret 4 5) (place-fret 3 2) (place-fret 3 4) (place-fret 3 5) (mute 2) (mute 1))
- c' ^\markup \fret-diagram #'"6-x;5-3;5-5;4-2;4-3;4-5;3-2;3-4;3-5;2-x;1-x;"
- c' ^\markup \fret-diagram-terse #'"x;3 5;2 3 5;2 4 5;x;x;"
-
-% g major scale, no open strings, two octaves on six strings, white dots
- g' ^\markup \override #'(dot-color . white) {\fret-diagram-terse #'"3 5;2 3 5;2 4 5;2 4 5;3 5;2 3;" }
- }
- >>
- \paper{ raggedright = ##t }
-}
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="@cindex Gourlay
}
\score{
- \context Staff \relative c'' <<
+ \notes \context Staff \relative c'' <<
{ \stemUp d2 d | d d | d4 d2. | \break c1 }
\\
{ \stemDown g4 g g g | \times 2/3 { g2 g2 g2 } | g4. g8 g2 | c1 }
-\version "2.3.4"
+\version "2.2.0"
\header {
title = "Gregorian Scripts"
texidoc = "@cindex Gregorian Scripts
\score {
\context VaticanaVoice {
\override VaticanaScript #'padding = #-0.5
- {
+ \notes {
a\ictus
a\circulus
a\semicirculus
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc ="@cindex Artificial Harmonics
}
\score {
- {
+ \notes {
<c' g'\harmonic>4
}
\paper {
-\version "2.3.4"
+\version "2.2.0"
#(if (not (defined? 'pieceTagLine))
"
}
-\score{ { c'4 }
+\score{ \notes{ c'4 }
\paper {raggedright=##t}
}
-\version "2.3.4"
+\version "2.2.0"
\header { texidoc = "@cindex Horizontal Shift
Notes may be manually horizontally shifted. " }
shiftV = \override NoteColumn #'horizontal-shift = #4
\score {
- \context Voice \relative c {
+ \context Voice \notes\relative c {
\context Staff <<
\new Voice {\stemUp \shiftI g'' }
-\version "2.3.4"
+\version "2.2.0"
\header { texidoc = "
\context Staff <<
\time 4/4
\partcombine
- \relative c'' {
+ \notes\relative c'' {
a4 c4.(g8) a4 |
g4 e' g(f) |
b, a c2
}
- \relative c'' {
+ \notes\relative c'' {
g4 e4.(d8) c4 |
g'4 c, e(f) |
d2 a
\paper{
linewidth=140.\mm
\context {
- \Voice
+ \VoiceContext
soloADue = ##f
}
}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc =
}
-improOn = {
+improOn = \notes {
\set squashedPosition = #0
\override NoteHead #'style = #'slash
}
-improOff = {
+improOff = \notes {
\unset squashedPosition
\revert NoteHead #'style
}
-global = { s1*3 \bar "|." }
+global = \notes { s1*3 \bar "|." }
\score {
<<
\context ChordNames \chords {
e8*7:m7 a2.:m7 bes4:m7 b1:m7 e8:m
}
- <<
+ \notes <<
\context Voice = melo \transpose c c' {
e8 e g a a16(bes)(a8) g \improOn
e8
>>
\paper {
\context {
- \Voice
+ \VoiceContext
\consists Pitch_squash_engraver
}
raggedright = ##t
-\version "2.3.4"
+\version "2.2.0"
\header { texidoc = "@cindex Incipit
This example shows how to make an ``incipit'' to indicate
scordatora tuning of a violin part, by overriding the @code{style} of
-violinincipit = \relative c''{
+violinincipit = \notes\relative c''{
\clef "french"
\time 2/2
\override Staff.TimeSignature #'style = #'old
\override Staff.TimeSignature #'style = #'C
}
-bcincipit = \relative c{
+bcincipit = \notes\relative c{
\clef bass
\override Staff.TimeSignature #'style = #'old
b2. cis4 |
\override Staff.TimeSignature #'style = #'C
}
-violin = \relative c''{
+violin = \notes\relative c''{
% Key signatures with different alterations in different octaves
% are broken since 1.3.58!
% \specialkey \keysignature f' fis'' g' gis''
<<{ a d}\\ { es,4}>>|
}
-BC = \relative c{
+BC = \notes\relative c{
\key d \major
\time 2/2
\clef "bass"
\score{
<<
- \context Staff = violin {{
+ \context Staff = violin {\notes{
\override Staff.Clef #'transparent = ##t
\violinincipit \bar ".|"
\revert Staff.Clef #'transparent
\endincipit
\violin
}}
- \new Staff {{
+ \new Staff {\notes{
\override Staff.Clef #'transparent = ##t
\bcincipit \bar ".|"
\revert Staff.Clef #'transparent
-\version "2.3.4"
+\version "2.2.0"
\header { texidoc = "@cindex Instrument Name Grandstaff
You can have a name for the whole @code{GrandStaff} in addition to
individual @code{Staff}s. " }
\score {
-
- \context GrandStaff <<
+ \notes
+ \notes \context GrandStaff <<
\context Staff = treble {
\set GrandStaff.instrument = "Violini "
\set Staff.instrument = " vn I" { c''4 }}
\paper {
raggedright = ##t
-\context { \GrandStaff \consists "Instrument_name_engraver" }
+\context { \GrandStaffContext \consists "Instrument_name_engraver" }
}}
-\version "2.3.4"
+\version "2.2.0"
\header { texidoc = "@cindex Ancient Vaticana
Vaticana ligature uses four staff lines, special clef, an notes
\include "gregorian-init.ly"
-cantus = \context VaticanaVoice = "cantus" {
+cantus = \context VaticanaVoice = "cantus" \notes {
\clef "vaticana_fa2"
\[ f\melisma \quilisma g \auctum \descendens a\melismaEnd \]
\[ \virga a\melisma g \pes a \inclinatum f \inclinatum d
raggedright = ##t
packed = ##t
\context {
- \Score
+ \ScoreContext
\remove Bar_number_engraver
timing = ##f
barAlways = ##t
-\version "2.3.4"
+\version "2.2.0"
% MERGE with title.ly -gp
%{
\score {
- \relative c'' { c1 c1 c1 c1 }
+ \notes \relative c'' { c1 c1 c1 c1 }
}
\score {
- \relative c'' { c1 c1 c1 c1 }
+ \notes \relative c'' { c1 c1 c1 c1 }
\header {
-\version "2.3.4"
+\version "2.2.0"
\header {
}
\score {
-<< \new Staff \relative c'' { \time 1/4 c16[ c c c]
+<< \notes \new Staff \relative c'' { \time 1/4 c16[ c c c]
\time 1/4
c16[ c c c]
\time 1/4
c16[ c c c]
}
- \new Lyrics \with {
+ \lyrics \new Lyrics \with {
% Otherwise lyrics are so far apart that hyphens don't disappear
- \override SeparationItem #'padding = #0.0
- }
- \lyrics {
- bla -- bla -- bla -- bla --
- bla -- bla -- bla -- bla --
+ \override SeparationItem #'padding = #0.0
+ }{ bla -- bla -- bla -- bla --
+ bla -- bla -- bla -- bla --
- \override LyricHyphen #'minimum-length = #0.7
- \override LyricHyphen #'spacing-procedure =
- #Hyphen_spanner::set_spacing_rods
+ \override LyricHyphen #'minimum-length = #0.7
+ \override LyricHyphen #'spacing-procedure =
+ #Hyphen_spanner::set_spacing_rods
bla -- bla -- bla -- bla
}>>
linewidth = 3.4 \cm
\context {
- \Staff \remove "Time_signature_engraver"
+ \StaffContext \remove "Time_signature_engraver"
}
}
% shorthand for Skip Lyric
-sl = { \skip 4 }
+sl = \notes { \skip 4 }
-\version "2.3.4"
+\version "2.2.0"
\score {
<<
- \context Voice = "A" {c4 c c c}
+ \context Voice = "A" \notes {c4 c c c}
\lyricsto "A" \context Lyrics=A \lyrics { foo __ \sl \sl bar }
\lyricsto "A" \context Lyrics=B \lyrics { foo -- \sl baz bar }
\lyricsto "A" \context Lyrics=C \lyrics { foo -- baz -- baaz bar }
+++ /dev/null
-
-\header {
- texidoc = "Use \\score block as markup command."
-}
-
-\version "2.3.4"
-
-tuning = \markup {
- \score {
- \new Staff \with {
- \remove Time_signature_engraver
- } {
- \clef bass <c, g, d g>1
- }
- \paper { raggedright = ##t }
- }
-}
-
-
-\header {
- title = "Solo Cello Suites"
- subtitle = "Suite IV"
- subsubtitle = \markup { \fill-line < { "Originalstimmung: " \tuning } > }
-}
-
-\relative {
- \time 4/8
- \times 2/3 { c'8 d e } \times 2/3 {c d e}
- \time 4/8
-
- % todo: tempo change example.
-
- g8 a8 g8 a \break
-}
-
-\version "2.3.4"
+\version "2.2.0"
% TODO:
% check with ancient- stuff. rename, merge, something. -gp
% graphical width of the ligatures rather to the musical moment in time.
% This is intended behaviour.
-voice = \transpose c c' {
+voice = \notes \transpose c c' {
\set Score.timing = ##f
\set Score.defaultBarType = "empty"
g\longa c\breve a\breve f\breve d'\longa^\fermata
\paper {
linethickness = \staffspace / 5.0
\context {
- \Voice
+ \VoiceContext
\name MensuralVoice
\alias Voice
\remove Ligature_bracket_engraver
\override NoteHead #'style = #'mensural
}
\context {
- \Staff
+ \StaffContext
\name MensuralStaff
\alias Staff
\accepts MensuralVoice
\accepts MensuralVoice
}
\context {
- \Score
+ \ScoreContext
\accepts MensuralStaff
}
}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc ="@cindex Ancient Mensural Note Heads
}
\score {
- {
+ \notes {
\relative c'' {
\override NoteHead #'style = #'mensural
c\maxima*1/8
-\version "2.3.4"
+\version "2.2.0"
% candidate for regression. -gp
\header {
texidoc="Converting LilyPond input to MIDI and then again back with
%}
-scales = \relative c {
+scales = \notes \relative c {
% [INSTRUMENT_NAME] bright acoustic
\key c \major % sharp-major
-\version "2.3.4"
+\version "2.2.0"
% possible rename to scheme- or something like that. -gp
\header { texidoc= "@cindex Scheme Manual Accidentals
(ly:grob-parent elt 1) 'staff-position) pos))))
\score {
- \context Voice \relative c'' {
+ \context Voice \notes \relative c'' {
c2.
<<
\set Staff.AccidentalPlacement = \turnOff
-\version "2.3.4"
+\version "2.2.0"
% possible rename to scheme- or something like that. -gp
\header { texidoc = "@cindex Scheme Move Text
Objects, like text, can be moved around by using some Scheme code.
(lambda (grob) (equal? text (ly:grob-property grob 'text))))
\score {
- \relative c''' {
+ \notes\relative c''' {
\override Stem #'direction = #1
\applyoutput #(outputproperty-compatibility (make-text-checker (make-simple-markup "m.d."))
'extra-offset '(-3.5 . -4.5))
-\version "2.3.4"
+\version "2.2.0"
\include "deutsch.ly"
% possible rename to scheme- something. -gp
% TODO: ask if it needs to have so many empty bars in the middle. -gp
-\version "2.3.4"
+\version "2.2.0"
-pat = \transpose c c' \repeat unfold 2 {
+pat = \notes \transpose c c' \repeat unfold 2 {
<< { \context Staff=up {r8 e16 f g e f g } }
{ \context Staff=down <<
\context Voice=vup { \stemUp \tieUp r16 d8.~d4 }
>>
}
-enda = { r8 f,16 a, c f c a, \stemUp c \change Staff = down
+enda = \notes { r8 f,16 a, c f c a, \stemUp c \change Staff = down
a, f, a, f, d, f, d, \change Staff = up \stemBoth
r8 g16 h d' f' d' h d' h g h d f e\prall d <e g c'>1^\fermata \bar "|."
}
-endb = {\stemUp \tieUp r16 c,8.~c,4~c,2 r16 h,,8.~h,,4~h,,2 c,1 \bar "|."}
-endc = {\stemDown \tieDown c,,2~c,, c,,~c,, c,,1_\fermata }
+endb = \notes {\stemUp \tieUp r16 c,8.~c,4~c,2 r16 h,,8.~h,,4~h,,2 c,1 \bar "|."}
+endc = \notes {\stemDown \tieDown c,,2~c,, c,,~c,, c,,1_\fermata }
\score {
- \transpose c c' \context PianoStaff <<
+ \notes \transpose c c' \context PianoStaff <<
\context Staff=up { \clef "G" }
\context Staff=down { \clef "F" }
- { \applymusic #transform {\pat {c e g c' e' }
+ { \apply #transform {\pat {c e g c' e' }
\pat {c d a d' f' }
\pat {h, d g d' f' }
\pat {c e g c' e' }
>>
\paper {
\context {
- \PianoStaff
+ \PianoStaffContext
\override VerticalAlignment #'forced-distance = #10
}
-\version "2.3.4"
+\version "2.2.0"
% possible rename to scheme- something. -gp
\header { texidoc = "@cindex Scheme Music Creation
-\version "2.3.4"
+\version "2.2.0"
% possible rename to bar-lines-foo. -gp
\header{ texidoc = "@cindex Bar Lines Remove
}
\score {
- \relative c'' {
+ \notes \relative c'' {
a b c d
d c b a
}
\paper {
raggedright = ##t
\context {
- \Staff
+ \StaffContext
whichBar = #""
\remove "Time_signature_engraver"
}
-\version "2.3.4"
+\version "2.2.0"
% possible rename to staff-something. -gp
\header{ texidoc = "@cindex Staff Remove
}
\score {
- { c4 d4 e8 d8 }
+ \notes { c4 d4 e8 d8 }
\paper {
raggedright = ##t
\context {
- \Staff
+ \StaffContext
\remove Staff_symbol_engraver
\consists Pitch_squash_engraver
\remove Clef_engraver
@code{RemoveEmptyStaffContext} take out the unused parts.
" }
-\version "2.3.4"
+\version "2.2.0"
\score {
- \relative c''
+ \notes\relative c''
\new StaffGroup \with {
\remove "System_start_delimiter_engraver"
\override SpanBar #'glyph = #":"
raggedright= ##t
\context {\RemoveEmptyStaffContext}
\context {
- \Score
+ \ScoreContext
\remove System_start_delimiter_engraver
}
}
-#(ly:set-point-and-click 'line-column)
-\version "2.3.4"
+\version "2.2.0"
\header {
-
-texidoc = "Stress optimal page breaking. This should look
- nice on 4 a6 pages. "
-
-
+ texidoc = "Stress optimal page breaking. This should look nice on 4 a6 pages."
copyright = "Copyright by /me"
title = "Title"
piece = "Piece"
}
-#(set-default-paper-size "a6")
-
-
-pattern = { a b c d \break }
-\book {
- \score {
- \context Staff \relative c' {
- %% 16: ideally cramped
- %% 17: very bad without density
- % \repeat unfold 17 { a b c d \break }
-
- \pattern
- \pattern
- % \noPageBreak
- \pattern
-
- % the following changes the location of the break.
- %
- % \pageBreak
-
- \pattern
- \pattern
- \pattern
- \pattern
- \repeat unfold 10 \pattern
- }
+\score {
+ \context Staff \notes \relative c' {
+ %% 16: ideally cramped
+ %% 17: very bad without density
+ \repeat unfold 17 { a b c d \break }
+ }
+ \paper {
+ #(set-default-paper-size "a6")
+ #(define page-breaking ly:optimal-page-breaks)
}
-
}
-\version "2.3.4"
+\version "2.2.0"
\header{ texidoc="@cindex Part Combine
In orchestral scores and hymns, voices are traditionally combined into
}
\score{
- \context Staff = flauti <<
+ \notes \context Staff = flauti <<
\time 4/4
\partcombine
\relative c'' {
-\version "2.3.4"
+\version "2.2.0"
% check with invisible-notes or blank-notes. possible rename. -gp
\header{ texidoc = "@cindex Partial Blank
When entering partially typeset music (i.e. for students to be
implemented by adding an invisible staff with a lot of fast notes. "
}
-quickmeasure = {
+quickmeasure = \notes {
\repeat unfold 16 c''16
}
-mel = \relative c' {c16 d16 e8 a4 g2 e8 d c2. g'1 e4 d c2}
+mel = \notes \relative c' {c16 d16 e8 a4 g2 e8 d c2. g'1 e4 d c2}
\score {
-\context PianoStaff <<
+\context PianoStaff \notes <<
\new Staff <<
\clef G
\new Voice {\mel}
\repeat unfold 4 \quickmeasure
}
>>
- \new Staff {\clef F s1*4}
+ \new Staff \notes {\clef F s1*4}
>>
\paper {}
}
-\version "2.3.4"
+\version "2.2.0"
\header{ texidoc="@cindex Phrasing Slur Height
The @code{PhrasingSlur} can be made higher in order to avoid collision
with other slurs. "
}
\score {
- \new Staff \relative c''{
+ \new Staff \notes\relative c''{
\override Staff.PhrasingSlur #'height-limit = #8.0
c8 \( (d e f) g ( a b c)
| c ( b a g) f ( e d c)\)
}
-\version "2.3.4"
+\version "2.2.0"
#(define ((futz-alignment-callback distance count) grob axis)
(Align_interface::fixed_distance_alignment_callback grob axis)) )
\score {
- \relative c'' \context PianoStaff
+ \notes \relative c'' \context PianoStaff
\with {
verticalAlignmentChildCallback = #(futz-alignment-callback 20 1)
-\version "2.3.4"
+\version "2.2.0"
\header{ texidoc="
\score {
- \relative c' <<
+ \notes \relative c' <<
\new Staff {
\time 3/4
c4 c c | c c c |
\new Staff {
\time 3/4
\set Staff.timeSignatureFraction = #'(9 . 8)
- \applymusic #(scale-music-function '(2 . 3))
+ \apply #(scale-music-function '(2 . 3))
\repeat unfold 6 { c8[ c c] }
}
\new Staff {
\time 3/4
\set Staff.timeSignatureFraction = #'(10 . 8)
- \applymusic #(scale-music-function '(3 . 5))
+ \apply #(scale-music-function '(3 . 5))
{ \repeat unfold 2 { c8[ c c] }
\repeat unfold 2 { c8[ c] }
| c4. c4. \times 2/3 { c8 c c } c4 }
-\version "2.3.4"
+\version "2.2.0"
\header{ texidoc="@cindex Time Signature Multiple
%% Should print bar lines according to the time signature of each staff. -HJJ
\score{
- \relative c' <<
+ \notes \relative c' <<
\new Staff {
\time 3/4
c4 c c | c c c |
\paper{
raggedright = ##t
\context{
- \Score
+ \ScoreContext
\remove "Timing_engraver"
}
\context{
- \Staff
+ \StaffContext
\consists "Timing_engraver"
}
-\version "2.3.4"
+\version "2.2.0"
\header { texidoc = "
@cindex Preset Extent
-\version "2.3.4"
+\version "2.2.0"
\header { texidoc = "@cindex Repeat Manual
By controlling manually the signs and numbers in repeats, an unusual
output can be produced. "
}
-\score { \relative c'' {
+\score { \notes \relative c'' {
% First a normal looking repeat:
c2 c
\set Score.repeatCommands = #'((volta "1."))
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="
\score {
<<
- \context Staff \relative c''{
+ \context Staff \notes\relative c''{
c c c c
% coda-klugde: let volta span only one bar
\set Staff.voltaSpannerDuration = #(ly:make-moment 1 1)
-\version "2.3.4"
+\version "2.2.0"
% possible rename to lyric-repeat or repeat-lyric.
\score{
<<
- \context Staff \relative c'{
+ \context Staff \notes\relative c'{
c d e f
\repeat "volta" 2 { g a b c }
\alternative { { c b a g } { f e d c } }
-\version "2.3.4"
+\version "2.2.0"
% candidate for regression. -gp
\header { texidoc = "@cindex Rest Dot Positions
Dots of rests should follow the rest positions. " }
-muz = \relative c'' {
+muz = \notes \relative c'' {
\time 6/1
r\longa r\breve |
r\longa. |
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "@cindex Rests
% happen, since there are no notes/stems in this example.
\score {
- \context Staff \relative c {
+ \context Staff \notes\relative c {
\set Score.timing = ##f
\override Staff.Rest #'style = #'mensural
r\maxima^"Rest style = \#'mensural"
-\version "2.3.4"
+\version "2.2.0"
% possible rename to scheme-something.
\header { texidoc="@cindex Scheme Reverse Music
Symmetric, or palindromical music can be produced, first, by printing
"
}
-music = \relative c'' { c4 d4( e4 f4 }
+music = \notes \relative c'' { c4 d4( e4 f4 }
#(define (reverse-music music)
(let* ((elements (ly:music-property music 'elements))
\score {
\context Voice {
\music
- \applymusic #reverse-music \music
+ \apply #reverse-music \music
}
\paper { raggedright = ##t}
}
-\version "2.3.4"
+\version "2.2.0"
\header { texidoc = "@cindex Rhythm Exercise
Rythmic exercises may be produced by removing the @code{Clef} engraver,
putting all notes to the same pitch and using transparent staff lines.
"
}
-\score { { c4 c4 c8[ c8] c2 c2 }
+\score { \notes { c4 c4 c8[ c8] c2 c2 }
\paper {
- \context { \Staff
+ \context { \StaffContext
\override StaffSymbol #'transparent = ##t
\consists Pitch_squash_engraver
\remove Clef_engraver
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "
"
}
-\score { {
+\score { \notes {
\key c \ionian c'8 -"C ionian, major" d'8 e'8 f'8 g'8 a'8 b'8 c''8
-\version "2.3.4"
+\version "2.2.0"
\header { texidoc = "@cindex Scheme Interactions
Using @code{ly:export}, the result of Scheme expressions can be passed
as LilyPond input. Within a Scheme expression, you can use, define or
" }
-foo = \transpose c c { d''4-. }
-bra = \transpose c c { e'4-. }
+foo = \notes \transpose c c { d''4-. }
+bra = \notes \transpose c c { e'4-. }
\score {
- \context Voice \relative c' {
+ \context Voice \notes\relative c' {
c4
#(ly:export (make-sequential-music (list foo foo foo )))
#(begin (define baz (make-simultaneous-music (list foo bra)))
% this chart is used in the manual too.
-\version "2.3.4"
+\version "2.2.0"
\header { texidoc = "@cindex Script Abbreviations
Some articulations may be entered using an abbreviation.
}
\score {
- \context Voice {
+ \notes \context Voice {
\override TextScript #'font-family = #'typewriter
\override TextScript #'font-shape = #'upright
c''4-._"c-." s4
-\version "2.3.4"
+\version "2.2.0"
% this chart is used in the manual too.
<<
\override Score.LyricText #'font-family = #'typewriter
\override Score.LyricText #'font-shape = #'upright
- \context Staff {
+ \context Staff \notes {
\set Score.timing = ##f
\set Score.barAlways = ##t
\override Staff.BarLine #'transparent = ##t
-\version "2.3.4"
+\version "2.2.0"
\header { texidoc = "@cindex Script Priority
Relative placements of different script types can be controlled
\score{
- \context Staff \relative g''{
+ \context Staff \notes \relative g''{
\override Score.TextScript #'script-priority = #-100
a4^\prall^\markup { \sharp }
-\version "2.3.4"
+\version "2.2.0"
\header { texidoc = "@cindex Stacked Text Articulation
Text and articulations may be stacked on top of each other. "
}
\score {
- \relative c' {
+ \notes\relative c' {
c2_"geen gedonder"_"jij gaat onder"
c2^^^.^|^"down"^"up"
}
-\version "2.3.4"
+\version "2.2.0"
% possible rename. -gp
\header { texidoc="@cindex Seperate Staccato
is attached to the notes."
}
-staccatos = { s4-. s-. s-. s s }
+staccatos = \notes { s4-. s-. s-. s s }
-music = \relative c' { c4 d e f g a b c d e }
+music = \notes\relative c' { c4 d e f g a b c d e }
\score {
\context Voice <<
-\version "2.3.4"
+\version "2.2.0"
\header{
texidoc="@cindex Slur Attachment Override
%% except that both slurs are stem <<-> stem.
%%
-fragment = {
+fragment = \notes {
\set autoBeaming = ##f
\override Stem #'direction = #1
\override Slur #'direction = #1
\score {
- \relative c \fragment
+ \notes\relative c \fragment
\paper { raggedright = ##t}
}
-\version "2.3.4"
+\version "2.2.0"
\header { texidoc ="@cindex Slur Beautiful
The curvature of a slur is adjusted to stay away from note heads and
"
}
-\score { {\relative c' {
+\score { \notes {\relative c' {
\stemDown \slurUp
c16( a' f' a a f a, c,)
c( a' f' a a f d, c)
-\version "2.3.4"
+\version "2.2.0"
\header {texidoc = "@cindex Slur, dotted
The appearance of slurs may be changed from solid to dotted or dashed.
"
}
\score{
- \relative c'{
+ \notes\relative c'{
c( d e c) |
\slurDotted
c( d e c) |
-\version "2.3.4"
+\version "2.2.0"
\header {
}
\score {
- \new PianoStaff
+ \notes \new PianoStaff
<<
\context Staff = up {
\clef bass
-\version "2.3.4"
+\version "2.2.0"
\header { texidoc = "@cindex Slur Minimum Length
By setting the minimum length of a slur, notes are more separated. "
}
\score{
- \relative c''{
+ \notes\relative c''{
\time 2/4
\override Slur #'minimum-length = #40
c(c)
-\version "2.3.4"
+\version "2.2.0"
\header { texidoc="@cindex Slur Ugly
Strange slurs can be produced by setting properties by hand. "
}
-baseWalk = \relative c {
+baseWalk = \notes \relative c {
d,8( a' d f a d f d a f d a)
}
\score {
- \context PianoStaff <<
+ \notes \context PianoStaff <<
\time 6/4
\context Staff=up { s1 * 6/4 }
\context Staff=down <<
\paper {
raggedright = ##t
\context {
- \Voice
+ \VoiceContext
\override Slur #'beautiful = #5.0
\override Slur #'direction = #1
\override Stem #'direction = #-1
}
\context {
- \PianoStaff
+ \PianoStaffContext
\override VerticalAlignment #'threshold = #'(5 . 5)
}
}
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc="@cindex Smart Transpose
music))
-music = \relative c' { c4 d e f g a b c }
+music = \notes \relative c' { c4 d e f g a b c }
\score {
- \context Staff {
+ \notes \context Staff {
\transpose c ais \music
- \applymusic #naturalise \transpose c ais \music
+ \apply #naturalise \transpose c ais \music
\transpose c deses \music
- \applymusic #naturalise \transpose c deses \music
+ \apply #naturalise \transpose c deses \music
}
\paper { raggedright = ##t}
}
-\version "2.3.4"
+\version "2.2.0"
% more yummy regression goodness. -gp
\header {
}
\score {
- \relative c''
+ \notes \relative c''
\context GrandStaff <<
\new Staff <<
\new Voice { \stemUp\slurUp\tieUp
-\version "2.3.4"
+\version "2.2.0"
\header { texidoc = "@cindex Spanner after break
#(debug-enable 'backtrace)
-\score { \relative c'' {
+\score {\notes \relative c'' {
\override Tie #'after-line-breaking-callback =
#my-callback
c1 ~ \break c2 ~ c
-\version "2.3.4"
+\version "2.2.0"
\header{ texidoc="@cindex Nested Staff Groups
Staffs can be nested in various combinations. Here, @code{StaffGroup}
"
}
-\score {
+\score { \notes
<<
\new StaffGroup <<
\new Staff {c' d' e' f'}
-\version "2.3.4"
+\version "2.2.0"
\header {
In this preliminary test of a modern score, the staff lines are washed
out temporarily. This is done by making a tuned @code{StaffContainer},
which @code{\skip}s some notes without printing lines either and
-creates a @code{\\new Staff} then in order to create the lines again.
+creates a @code{\new Staff} then in order to create the lines again.
(Be careful if you use this; it has been done by splitting the
grouping @code{Axis_group_engraver} and creating functionality into
separate contexts, but the clefs and time signatures may not do
\score {
- \relative c'' <<
+ \notes \relative c'' <<
\new StaffContainer {
%% need << >>, otherwise we descend to the voice inside SA
\paper {
\context {
- \Score
+ \ScoreContext
\accepts StaffContainer
\denies Staff
}
\name StaffContainer
}
\context {
- \Staff
+ \StaffContext
\remove Axis_group_engraver
\remove Separating_line_group_engraver
\remove Clef_engraver
-\version "2.3.4"
+\version "2.2.0"
\header {
}
-upper = \relative c'' {
+upper = \notes\relative c'' {
c1 d e f
}
-lower = \relative c {
+lower = \notes\relative c {
c1 b a g
}
-\version "2.3.4"
+\version "2.2.0"
\header { texidoc = "@cindex Staff Size
}
\score {
- \relative c' <<
+ \notes \relative c' <<
\new Staff \relative c'' {
\dynamicDown c,,4 \ff c c c
}
-\version "2.3.4"
+\version "2.2.0"
\header{ texidoc ="@cindex Staff Space
By just increasing @code{staff-space} on a staff, you may produce strange
}
\score {
- \relative c'' \context GrandStaff <<
+ \notes \relative c'' \context GrandStaff <<
\new Staff { c4 c4 }
\new Staff {
c4
}
>>
\paper { \context {
- \Staff
+ \StaffContext
\override StaffSymbol #'staff-space = #5.5
}
raggedright=##t }
-\version "2.3.4"
+\version "2.2.0"
\header { texidoc = "@cindex Stem Cross Staff
The chords which exceptionally cross staves may be produced by increasing
noFlag = \once \override Stem #'flag-style = #'no-flag
-\score {
+\score { \notes
\context PianoStaff
<< \new Staff {
\stemDown
-\version "2.3.4"
+\version "2.2.0"
\header { texidoc = "@cindex Stem Extend
Extending stems to the center line may be prevented using @code{no-stem-extend}.
}
\score {
- \context Voice \relative c {
+ \context Voice \notes\relative c {
\context Staff <<
\new Voice {
f2 f8 g a b
-\version "2.3.4"
+\version "2.2.0"
\header{ texidoc = "@cindex Stem Length
The length of stems can be altered. "
}
\score {
- \context Voice \relative c {
+ \context Voice \notes\relative c {
g''4 \override Stem #'length = #14 g4
\override Stem #'length = #3 g4 g,,4
}
-\version "2.3.4"
+\version "2.2.0"
\header {texidoc = "@cindex Tablature hammer
A hammer in tablature can be faked with slurs. "
}
\score{
\context TabStaff <<
- \relative c''{
+ \notes\relative c''{
c(d)
d(d)
d(c)
-\version "2.3.4"
+\version "2.2.0"
\header{ texidoc = "@cindex Tabulature
Tablature is internally done by overriding the note-head formatting function
"
}
-partition = {
+partition = \notes {
\key e \major
e8\5 fis\5 gis\5 a\5 b\5 cis'\5 dis'\5 e'\5
e8\4 fis\4 gis\4 a\4 b\4 cis'\4 dis'\4 e'\4
-\version "2.3.4"
+\version "2.2.0"
\header {
}
\score {
- {
+ \notes {
\relative c' {
\context Staff = One { c4 d e f }
<<
}
\paper {
\context {
- \Score
+ \ScoreContext
\consists Span_bar_engraver
% Avoid a vertical line at the beginning of the system:
\remove System_start_delimiter_engraver
\accepts "TemporaryStaff"
}
\context {
- \Staff
+ \StaffContext
\name "TemporaryStaff"
\alias "Staff"
\remove "Clef_engraver"
}
-\version "2.3.4"
+\version "2.2.0"
\score {
-\new Staff \relative c'' {
+\new Staff \notes \relative c'' {
\set Staff.instrument = #"rotatebox{90}{Chor}"
%% uncomment this for rotation
-\version "2.3.4"
+\version "2.2.0"
\header { texidoc = "@cindex text spanner
Text spanners can be used in the similar manner than markings for pedals
}
\score{
- \relative c''{
+ \notes\relative c''{
\override TextSpanner #'edge-text = #'("bla" . "blu")
a \startTextSpan
b c
-\version "2.3.4"
+\version "2.2.0"
\header { texidoc = "@cindex Textscript
There are different fonts and glyphs to be used with @code{\markup} command. "
}
\score{
- \relative c''{
+ \notes\relative c''{
\override TextScript #'font-shape = #'upright
c1^\markup { \dynamic "p" "ma sosten." }
c^\markup \huge "ABCD"
-\version "2.3.4"
+\version "2.2.0"
\score {
-\context Staff {
+\context Staff \notes {
\relative c'' <<
{
\once \override Stem #'transparent = ##t
-\version "2.3.4"
+\version "2.2.0"
\header { texidoc= "
}}
-\score { \relative c'
+\score { \notes \relative c'
{
\override Staff.TimeSignature #'print-function = #Text_item::print
\override Staff.TimeSignature #'text = #tsMarkup
-\version "2.3.4"
+\version "2.2.0"
% TODO: This file could be old. Ask about it later. -gp
\header { texidoc = "@cindex Time
%}
\score {
- \context Voice \relative c {
+ \context Voice \notes\relative c {
% LilyPond doesn't understand 'default =>> it does what you want
\override Staff.TimeSignature #'style = #'default
\time 1/1
-\version "2.3.4"
+\version "2.2.0"
% possible rename to bar-something.
\header{ texidoc = "@cindex Bar Length
}
\score {
- \context Voice \relative c {
+ \context Voice \notes\relative c {
% \set Score.measurePosition = #(ly:make-moment -1 4)
-\version "2.3.4"
-
+\version "2.2.0"
%{
- Markup titles also available for direct PostScript output:
+ Experimental markup titles are available in direct PostScript output:
export GS_LIB=$(pwd)/mf/out:/usr/share/texmf/fonts/type1/bluesky/cm
lilypond-bin -fps input/title/title-markup.ly
- PostScript fonts: WIP.
-
- * Nonstandardised install directory / how to locate a ps font?
- * Nonstandardised filenames?
-
-
-For century schoolbook font:
-
- Debian:
- cp -pv /usr/share/fonts/type1/gsfonts/c*.{afm,pfb} mf/out
-
- Red Hat (untested):
-
- cp -pv /usr/share/fonts/afms/adobe/c*.{afm,pfb} mf/out/
-
- cp -pv /usr/share/fonts/default/Type1/c*.{pfb,afm} mf/out
-
%}
\paper{
#(define page-breaking ly:optimal-page-breaks)
- %% Ughr, this breaks TeX output...
- %% fonts = #(make-century-schoolbook-tree 1.0)
- inputencoding = #"latin1"
}
latinTest = \markup { \latin-i "Hellö" }
%% bookTitle = \markup { \fill-line < \huge\bold \title > > }
}
-%% suggest harder :-)
-%% noPagebreak = #(make-event-chord (list (make-penalty-music 0 1e9)))
-
-\book {
-
- \score {
- \context Staff \relative c' {
- c2-\sizeTest c2-\spaceTest
- }
- \paper {
- #(paper-set-staff-size (* 11.0 pt))
- }
+\score {
+ \context Staff \notes \relative c' {
+ c2-\sizeTest c2-\spaceTest
}
-
- \score {
- \context Staff \relative c' {
- %% stress page breaking:
- %% 35 keep on 3 pages
- %% 36 spread evenly over 4 pages
- \repeat unfold 6 { a b c d \break }
-
- %% FIXME: TODO factor \pagebreak \noPagebreak into regtest
- %% Without this, page breaks are better, after measure: 12
- \noPagebreak
- \repeat unfold 30 { a b c d \break }
- c1
- }
- \header {
- %% Override automatic score title
- %% scoreTitle = \markup { "Tweetje" }
- opus = "opus 1"
- piece = "Second"
- }
- \paper {
+ \paper {
+% #(paper-set-staff-size (* 11.0 pt))
}
+}
+
+\header {
+ %% Override automatic score title
+ %% scoreTitle = \markup { "Tweetje" }
+ opus = "opus 1"
+ piece = "Second"
+}
+
+\score {
+ \context Staff \notes \relative c' {
+ %% stress page breaking:
+ %% 35 keep on 3 pages
+ %% 36 spread evenly over 4 pages
+ \repeat unfold 36 { a b c d \break }
+ c1
}
}
-\version "2.3.4"
+\version "2.2.0"
% MERGE with lilypond-
\header {
filename = "title.ly"
}
\score {
- \context Staff \relative c' {
+ \context Staff \notes \relative c' {
\repeat unfold 10 {
c d e f f e d c \break
c d e f f e d c
}
\score {
- \relative c' {
+ \notes \relative c' {
f e d c c d e f \break
f e d c c d e f
}
-\version "2.3.4"
+\version "2.2.0"
-fooBar = { << c''4 \\ g'4 >> }
+fooBar = \notes { << c''4 \\ g'4 >> }
#(ly:set-option 'parse-protect #f)
#(load-from-path "to-xml.scm")
-\version "2.3.4"
+\version "2.2.0"
\header{ texidoc = "@cindex Transposition
Transposing has also an effect key signature, if it is given using
% should the explicitly set key signature transpose also? -HJJ
-vOne = \relative c''{
+vOne = \notes \relative c''{
\clef"violin"
\key d \major
\time 2/4
c4 c |
}
-vTwo = \transpose c d { \vOne }
+vTwo = \notes \transpose c d { \vOne }
-vThree = \relative c''{
+vThree = \notes \relative c''{
\clef"violin"
% keysignature fis cis
\set Staff.keySignature = #'((0 . 2)(3 . 2))
}
-vFour = \transpose c d \vThree
+vFour = \notes \transpose c d \vThree
\score {
\context StaffGroup <<
-\version "2.3.4"
+\version "2.2.0"
\header { texidoc="@cindex Trill
The extended trill may be produced using @code{TextSpanner} with @code{trill}
\score {
- \context RhythmicStaff {
+ \context RhythmicStaff \notes {
\stemDown
\override Stem #'transparent = ##t
\override TextSpanner #'dash-fraction = #0.0
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc="@cindex Trills
\score {
<<
\context GrandStaff <<
- \new Staff \relative c'' {
+ \new Staff \notes\relative c'' {
\time 1/4
c4\prall
\time 3/8
"de suite"1
%}
}
- \new Staff \relative c'' {
+ \new Staff \notes\relative c'' {
% autobeamer has som problems here
d32[ \repeat unfold 3 { c d } c]
d8 ~ d32[\repeat unfold 3 { c32 d } c]
-\version "2.3.4"
+\version "2.2.0"
% regression. -gp
\header {
}
-mel = \context Staff {
+mel = \notes \context Staff {
\repeat tremolo 8 {c'32 e' }
\repeat percent 2 { c''8 d'' }
\repeat volta 2 {c'4 d' e' f'}
\bar "|."
}
-\score { {
+\score { \notes {
\mel \break
- \applymusic #unfold-repeats \mel
+ \apply #unfold-repeats \mel
}
}
-\version "2.3.4"
+\version "2.2.0"
\header {
}
-\score { \context Lyrics {
+\score { \context Lyrics \notes {
\override Score.RehearsalMark #'self-alignment-X = #LEFT
\mark #(ly:export (string-append "Processed with LilyPond version " (lilypond-version)))
s2
-\version "2.3.4"
+\version "2.2.0"
% TODO: huh? what's this file about? -gp
\header { texidoc = "
" }
\score {
- <<
+ \notes <<
\new Staff {
\set Staff.verticalExtent = #'(-15.0 . 0.0)
\clef alto
#(ly:set-option 'old-relative)
-\version "2.3.4"
+\version "2.2.0"
\header{
filename = "twinkle-pop.ly"
xtitle = "Ah, vous dirais-je, maman "
}
-melodie = \relative c'' {
+melodie = \notes\relative c'' {
\clef "violin"
\time 2/4
\score {
<<
- \context ChordNames \transpose c d\acc
- \context Staff=melody \transpose c d\melodie
- \context Lyrics \text
+ \chords \context ChordNames \transpose c d\acc
+ \notes \context Staff=melody \transpose c d\melodie
+ \lyrics \context Lyrics \text
>>
\header{
piece = "clarinet in B$\flat$"
-\version "2.3.4"
+\version "2.2.0"
\header {
texidoc = "Wilhelmus van Nassouwe"
}
%% hymn tricks
-#(define (prepend-grob-property grob-name
- grob-prop entry)
+#(define (override-alist-property grob-name alist-property 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))))))))
-
+ (let* ((grob-properties (ly:context-property context grob-name))
+ (alist-cons (chain-assoc-get alist-property grob-properties '()))
+ (new-alist-cons (assoc-set! alist-cons (car entry) (cdr entry)))
+ (new-props (assoc-set! (car grob-properties)
+ alist-property new-alist-cons)))
+ (ly:context-set-property! context grob-name (list new-props)))))
+
#(define (set-extra-space grob-name entry value)
- (prepend-grob-property grob-name 'space-alist
+ (override-alist-property grob-name 'space-alist
+ ;;;huh, broken? --jcn
+ ;;;(cons entry (cons 'fixed-space value))))
(cons entry (cons 'extra-space value))))
-
-noclefs = {
- s1
- \override Staff.Clef #'break-visibility = #(lambda (dir) (cons #t #t))
-}
-
-setMargins = {
+
+noclefs = \notes { s1 \set Staff.Clef = \turnOff }
+margins = {
%% first line left margin
- %% justified:
- %% \context Staff \applycontext #(set-extra-space 'TimeSignature 'first-note 4.5)
- %% raggedright:
- \context Staff \applycontext #(set-extra-space 'TimeSignature 'first-note 9.5)
+ \applycontext #(set-extra-space 'TimeSignature 'first-note 4.5)
%% next lines left margin
- \context Staff \applycontext #(set-extra-space 'KeySignature 'staff-bar 15)
+ %% \applycontext #(set-extra-space 'KeySignature 'first-note 15)
+ \applycontext #(set-extra-space 'KeySignature 'staff-bar 15)
%% next lines small key-signature margin
- \context Staff \applycontext #(set-extra-space 'LeftEdge 'key-signature 1.0)
+ \applycontext #(set-extra-space 'LeftEdge 'key-signature 1.0)
+
+ %% using StaffSymbol.width now
+ %% right margin
+ %%\applycontext #(set-extra-space 'BarLine 'right-edge 12.5)
}
-pipeSymbol = {
+smallBarLines = {
%% Set height of bar line to 2 staff-spaces
- \once \override Staff.BarLine #'bar-size-procedure = #(lambda (x) 2)
+ \override Staff.BarLine #'bar-size-procedure = #(lambda (x) 2)
%% Move barline one staff-space up
- \once \override Staff.BarLine #'extra-offset = #'(0 . 1)
- \bar "|"
+ \override Staff.BarLine #'extra-offset = #'(0 . 1)
}
-myBreak = { \bar "" \break }
+endBarLine = {
+ \revert Staff.BarLine #'bar-size-procedure
+ \revert Staff.BarLine #'extra-offset
+ \override Staff.BarLine #'extra-offset = #'(12 . 0)
+ \bar "|."
+}
\paper {
indent = 0.0\mm
textheight = 270.0\mm
}
-voice = \relative c' {
+voice = \notes \relative c' {
\clef violin
\key g \major
- d4 | g g a a b | a8 \myBreak
- b8 | c4 b a a | g2. \myBreak
-
- d4 | g g a a | b a8 \myBreak
- b8 | c4 b a a| g2. \myBreak
-
- %% Hack for better left tekst margin
- %% b8[ c] | d2 e4 d2 c4 | b a8 \myBreak
- \set melismaBusyProperties = #'()
- b8[ c] |
- \unset melismaBusyProperties
- d2 e4 d2 c4 b | a8 \myBreak
- b8 | c4 b a g | a2. \myBreak
-
- d,4 | g4.\melisma a8\melismaEnd b2 a2 g4 | fis e8 \myBreak
- d8 | e4 g g fis |
-
- \override NoteHead #'style = #'neo_mensural
+ \partial 4
+ d4 g g a a b a8
+ b8 c4 b a a g2.
- g\breve
+ d4 g g a a b a8
+ b8 c4 b a a g2.
- %% justified lines:
- %%\override Staff.BarLine #'extra-offset = #'(12 . 0)
- %% raggedright:
- \override Staff.BarLine #'extra-offset = #'(23 . 0)
- \bar "|."
+ b8[ c] d2 e4 d2 c4 b a8
+ b8 c4 b a g a2.
+
+ d,4 g4.\melisma a8\melismaEnd b2 a2 g4 fis e8
+ d8 e4 g g fis
+ \override NoteHead #'style = #'neo_mensural
+ g\breve
}
-stich = \relative c'' {
+stich = \notes \relative c'' {
\override Staff.NoteCollision #'merge-differently-dotted = ##t
\set fontSize = #-3
%% broken?
- \override Stem #'beamed-lengths = #(map (lambda (x) (* 0.2 x)) '(3.26))
+ \override Voice.Stem #'beamed-lengths = #(map (lambda (x) (* 0.2 x)) '(3.26))
\voiceTwo
\partial 4
Ben ick van duyt -- schen bloet,
Den Va -- der -- landt ghe -- trou -- we,
blyf ick tot in den doot!
- %% Hack for better left text margin:
- %% Een Prin -- ce van O -- ran -- gien
- Een " " Prin -- ce van O -- ran -- gien
+ Een Prin -- ce van O -- ran -- gien
Ben ick, vry, on -- ver -- veert;
Den Co -- ninck van His -- pan -- gien
Heb ick al -- tijt ghe -- eert.
\column < { \number "1" } { \smaller \smaller \note #"2" #-0.5 } >
}
-\paper {
- raggedright = ##t
-
- \context {
- \Score
- %% defaults
- %% (shortest-duration-space . 2.0)
- %% (spacing-increment . 1.2)
- %% (base-shortest-duration . ,(ly:make-moment 1 8))
- %% wider spacing
- \override SpacingSpanner #'shortest-duration-space = #3.0
- \override SpacingSpanner #'spacing-increment = #1.2
- \override SpacingSpanner #'base-shortest-duration = #(ly:make-moment 1 8)
- }
+linebreaks = \notes {
+ \repeat unfold 2 { s4 s1 s4 s8 \bar "" \break
+ s8 s1 s2. \bar "" \break }
+ s4 s2*3 s4 s8 \bar "" \break
+ s8 s1 s2. \bar "" \break
+ s4 s4*7 s4. \bar "" \break
+ s8 s1 s\breve \endBarLine
}
\score {
\context Staff <<
\override Staff.StaffSymbol #'width = #'80
\set Staff.autoBeaming = ##f
- \set Score.timing = ##f
- \setMargins
-
+ \margins
+ \smallBarLines
+
%% Less vertical space needed with lyrics
\set Staff.minimumVerticalExtent = #'(2 . 2)
+ %% Second time signature
+ %% \override Staff.TimeSignature #'print-function =
+ %% #(second-time-signature '(3 . 2) Time_signature::print)
+
%% Custom time signature
\override Staff.TimeSignature #'print-function = #Text_item::print
\override Staff.TimeSignature #'text = #oneHalfNoteTime
- \noclefs
-
+
+ %% Invisible alternating time signature
+ \notes {
+ \partial 4 s4
+ \override Staff.TimeSignature #'print-function = #'()
+ \repeat unfold 2 { \time 4/4 s1 \time 2/4 s2 \time 4/4 s1*2 }
+ \time 3/2 s2*3 \time 2/4 s2 \time 4/4 s1*2
+ \time 7/4 s4*7 \time 2/4 s2
+ \time 4/4 s1 \time 4/2 s1*2
+ }
+
\context Voice = "voice" \voice
+ \linebreaks
+ \noclefs
\context Voice = "stich" \stich
>>
\lyricsto "voice" \new Lyrics {
}
>>
\paper {}
- \midi {}
+% \midi {}
}
%%% Local variables:
/*
accidental-engraver.cc -- implement accidental_engraver
- source file of the GNU LilyPond music typesetter
-
(c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
Modified 2001--2002 by Rune Zedeler <rz@daimi.au.dk>
*/
-#include "accidental-placement.hh"
-#include "arpeggio.hh"
-#include "context.hh"
-#include "engraver-group-engraver.hh"
-#include "engraver.hh"
#include "event.hh"
+#include "spanner.hh"
#include "item.hh"
-#include "protected-scm.hh"
+#include "tie.hh"
#include "rhythmic-head.hh"
+#include "engraver-group-engraver.hh"
+#include "accidental-placement.hh"
#include "side-position-interface.hh"
-#include "spanner.hh"
-#include "tie.hh"
+#include "engraver.hh"
+#include "arpeggio.hh"
#include "warn.hh"
+#include "context.hh"
+#include "protected-scm.hh"
-class Accidental_entry
-{
-public:
+struct Accidental_entry {
bool done_;
- Music *melodic_;
- Grob *accidental_;
+ Music * melodic_;
+ Grob * accidental_;
Context *origin_;
- Grob *head_;
+ Grob* head_;
bool tied_;
-
Accidental_entry ();
};
{
tied_ = false;
done_ = false;
- melodic_ = 0;
+ melodic_ =0;
accidental_ = 0;
origin_ = 0;
head_ = 0;
}
-class Accidental_engraver : public Engraver
-{
-public:
- int get_bar_number ();
- void update_local_key_signature ();
-
+struct Accidental_engraver : Engraver {
protected:
TRANSLATOR_DECLARATIONS (Accidental_engraver);
virtual void process_music ();
virtual void process_acknowledged_grobs ();
virtual void finalize ();
+ void update_local_key_signature ();
public:
- Protected_scm last_keysig_; // ugh.
-
- /* Urgh. Since the accidentals depend on lots of variables, we have
- to store all information before we can really create the
- accidentals. */
+
+ Protected_scm last_keysig_;
+
+ /*
+ Urgh. Since the accidentals depend on lots of variables, we have to
+ store all information before we can really create the accidentals.
+ */
Link_array<Grob> left_objects_;
Link_array<Grob> right_objects_;
- Grob *accidental_placement_;
+ Grob * accidental_placement_;
Array<Accidental_entry> accidentals_;
Link_array<Spanner> ties_;
-};
-
-/*
- TODO:
+ SCM get_bar_num ();
+};
- ugh, it is not clear what properties are mutable and which
- aren't. eg. localKeySignature is changed at runtime, which means
- that references in grobs should always store ly_deep_copy ()s of
- those.
- */
static void
-set_property_on_children (Context *trans, char const *sym, SCM val)
+set_property_on_children (Context * trans, const char * sym, SCM val)
{
trans->set_property (sym, ly_deep_copy (val));
- for (SCM p = trans->children_contexts (); ly_c_pair_p (p); p = ly_cdr (p))
+ for (SCM p = trans->context_list_; gh_pair_p (p); p = ly_cdr (p))
{
- Context *trg = unsmob_context (ly_car (p));
+ Context *trg = unsmob_context (ly_car (p));
set_property_on_children (trg, sym, ly_deep_copy (val));
}
}
-Accidental_engraver::Accidental_engraver ()
-{
- accidental_placement_ = 0;
- last_keysig_ = SCM_EOL;
-}
void
Accidental_engraver::update_local_key_signature ()
{
last_keysig_ = get_property ("keySignature");
- set_property_on_children (context (), "localKeySignature", last_keysig_);
+ set_property_on_children (daddy_context_, "localKeySignature", last_keysig_);
- Context *trans = context ()->get_parent_context ();
+ Context * trans = daddy_context_->daddy_context_;
- /* Huh. Don't understand what this is good for. --hwn. */
+ /*
+ Huh. Don't understand what this is good for. --hwn.
+ */
while (trans && trans->where_defined (ly_symbol2scm ("localKeySignature")))
{
- trans->set_property ("localKeySignature", ly_deep_copy (last_keysig_));
- trans = trans->get_parent_context ();
+ trans->set_property ("localKeySignature",
+ ly_deep_copy (last_keysig_));
+ trans = trans->daddy_context_;
}
}
+Accidental_engraver::Accidental_engraver ()
+{
+ accidental_placement_ = 0;
+ last_keysig_ = SCM_EOL;
+}
+
void
Accidental_engraver::initialize ()
{
- update_local_key_signature ();
+ update_local_key_signature ();
}
+/*
-/** Calculate the number of accidentals on basis of the current local key
- sig (passed as argument)
-
- * First check step+octave (taking into account barnumbers if necessary).
-
- * Then check the global signature (only step).
-
- Return number of accidentals (0, 1 or 2). */
+ calculates the number of accidentals on basis of the current local key
+ sig (passed as argument)
+
+ Returns number of accidentals (0, 1 or 2).
+
+*/
static int
-number_accidentals_from_sig (bool *different, SCM sig, Pitch *pitch,
- int curbarnum, SCM laziness, bool ignore_octave)
+number_accidentals_from_sig (bool *different,
+ SCM sig, Pitch *pitch, SCM scurbarnum, SCM laziness,
+ bool ignore_octave)
{
+ int curbarnum = gh_scm2int (scurbarnum);
+
int n = pitch->get_notename ();
int o = pitch->get_octave ();
int a = pitch->get_alteration ();
SCM prev_local
= scm_assoc (scm_cons (scm_int2num (o), scm_int2num (n)), sig);
- if (ly_c_pair_p (prev_local))
+ if (gh_pair_p (prev_local))
{
- if (ly_c_pair_p (ly_cdr (prev_local))
- && ly_c_number_p (laziness))
+ if (gh_pair_p (ly_cdr (prev_local))
+ && gh_number_p (laziness)
+ )
{
- int barnum = ly_scm2int (ly_cddr (prev_local));
+ int barnum = gh_scm2int (ly_cddr (prev_local));
prev_local = scm_cons (ly_car (prev_local), ly_cadr (prev_local));
- if (curbarnum <= barnum + ly_scm2int (laziness))
+ if (curbarnum <= barnum + gh_scm2int (laziness))
prev_alt = prev_local;
}
}
if (prev_alt == SCM_BOOL_F)
prev_alt = scm_assoc (scm_int2num (n), sig);
+
prev_alt = (prev_alt == SCM_BOOL_F) ? scm_int2num (0) : ly_cdr (prev_alt);
- /* UGH. prev_acc can be #t in case of ties. What is this for? */
- int p = ly_c_number_p (prev_alt) ? ly_scm2int (prev_alt) : 0;
+ /*
+ UGH. prev_acc can be #t in case of ties. What is this for?
+
+ */
+ int p = gh_number_p (prev_alt) ? gh_scm2int (prev_alt) : 0;
+
+
int num;
- if (a == p && ly_c_number_p (prev_alt))
+ if (a == p && gh_number_p (prev_alt))
num = 0;
else if ( (abs (a)<abs (p) || p*a<0) && a != 0 )
num = 2;
static int
number_accidentals (bool *different,
- Pitch *pitch, Context *origin,
- SCM accidentals, int curbarnum)
+ Pitch *pitch, Context * origin,
+ SCM accidentals, SCM curbarnum)
{
int number = 0;
*different = false;
- if (ly_c_pair_p (accidentals) && !ly_c_symbol_p (ly_car (accidentals)))
+ if (gh_pair_p (accidentals) && !gh_symbol_p (ly_car (accidentals)))
warning (_f ("Accidental typesetting list must begin with context-name: %s",
ly_scm2string (ly_car (accidentals)).to_str0 ()));
- for (; ly_c_pair_p (accidentals) && origin;
- accidentals = ly_cdr (accidentals))
+ for (; gh_pair_p (accidentals) && origin; accidentals = gh_cdr (accidentals))
{
// If pair then it is a new accidentals typesetting rule to be checked
- SCM rule = ly_car (accidentals);
- if (ly_c_pair_p (rule))
+ SCM rule = gh_car (accidentals);
+ if (gh_pair_p (rule))
{
- SCM type = ly_car (rule);
- SCM laziness = ly_cdr (rule);
+ SCM type = gh_car (rule);
+ SCM lazyness = gh_cdr (rule);
SCM localsig = origin->get_property ("localKeySignature");
bool same_octave_b =
- ly_c_eq_p (ly_symbol2scm ("same-octave"), type);
+ gh_eq_p (ly_symbol2scm ("same-octave"), type);
bool any_octave_b =
- ly_c_eq_p (ly_symbol2scm ("any-octave"), type);
+ gh_eq_p (ly_symbol2scm ("any-octave"), type);
if (same_octave_b || any_octave_b)
{
bool d = false;
int n = number_accidentals_from_sig
- (&d, localsig, pitch, curbarnum, laziness, any_octave_b);
+ (&d, localsig, pitch, curbarnum, lazyness, any_octave_b);
*different = *different || d;
number = max (number, n);
}
/*
if symbol then it is a context name. Scan parent contexts to find it.
*/
- else if (ly_c_symbol_p (rule))
+ else if (gh_symbol_p (rule))
{
- Context *dad = origin;
+ Context * dad = origin;
while (dad && !dad->is_alias (rule))
- dad = dad->get_parent_context ();
+ dad = dad->daddy_context_;
if (dad)
origin = dad;
return number;
}
-int
-Accidental_engraver::get_bar_number ()
+SCM
+Accidental_engraver::get_bar_num ()
{
SCM barnum = get_property ("currentBarNumber");
SCM smp = get_property ("measurePosition");
-
- int bn = robust_scm2int (barnum, 0);
-
+
Moment mp = (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0);
- if (mp.main_part_ < Rational (0))
- bn--;
-
- return bn;
+ if (mp.main_part_ < Rational (0)
+ && gh_number_p (barnum))
+ barnum = scm_int2num (gh_scm2int (barnum) - 1);
+
+ return barnum ;
}
void
{
SCM accidentals = get_property ("autoAccidentals");
SCM cautionaries = get_property ("autoCautionaries");
- int barnum = get_bar_number ();
+ SCM barnum = get_bar_num ();
bool extra_natural_b = get_property ("extraNatural") == SCM_BOOL_T;
- for (int i = 0; i < accidentals_.size (); i++)
+ for (int i = 0; i < accidentals_.size (); i++)
{
if (accidentals_[i].done_ )
continue;
accidentals_[i].done_ = true;
- Grob *support = accidentals_[i].head_;
- Music *note = accidentals_[i].melodic_;
- Context *origin = accidentals_[i].origin_;
+ Grob * support = accidentals_[i].head_;
+ Music * note = accidentals_[i].melodic_;
+ Context * origin = accidentals_[i].origin_;
- Pitch *pitch = unsmob_pitch (note->get_property ("pitch"));
+ Pitch * pitch = unsmob_pitch (note->get_property ("pitch"));
if (!pitch)
continue;
level, so that we get the property settings for
Accidental from the respective Voice.
*/
- Grob *a
- = make_item_from_properties (origin->implementation (),
- ly_symbol2scm ("Accidental"),
- note->self_scm ());
+ Grob * a = make_item_from_properties (origin,
+ ly_symbol2scm ("Accidental"));
a->set_parent (support, Y_AXIS);
if (!accidental_placement_)
- accidental_placement_ = make_item ("AccidentalPlacement",
- a->self_scm ());
+ {
+ accidental_placement_ = make_item ("AccidentalPlacement");
+ announce_grob (accidental_placement_, a->self_scm ());
+ }
+
Accidental_placement::add_accidental (accidental_placement_, a);
- SCM accs = scm_cons (scm_int2num (pitch->get_alteration ()),
- SCM_EOL);
+ announce_grob (a, SCM_EOL);
+
+
+ SCM accs = gh_cons (scm_int2num (pitch->get_alteration ()), SCM_EOL);
if (num == 2 && extra_natural_b)
- accs = scm_cons (scm_int2num (0), accs);
+ accs = gh_cons (scm_int2num (0), accs);
+
+ /* TODO:
- /* TODO: add cautionary option in accidental. */
+ add cautionary option in accidental.
+ */
if (cautionary)
- a->set_property ("cautionary", SCM_BOOL_T);
+ {
+ a->set_property ("cautionary", SCM_BOOL_T);
+ }
+
support->set_property ("accidental-grob", a->self_scm ());
}
}
+
+
+
void
Accidental_engraver::finalize ()
{
void
Accidental_engraver::stop_translation_timestep ()
{
- for (int j = ties_.size (); j--;)
+ for (int j = ties_.size (); j --; )
{
- Grob *r = Tie::head (ties_[j], RIGHT);
+ Grob * r = Tie::head (ties_[j], RIGHT);
for (int i = accidentals_.size (); i--;)
if (accidentals_[i].head_ == r)
{
- if (Grob *g = accidentals_[i].accidental_)
+ if (Grob * g = accidentals_[i].accidental_)
{
g->set_property ("tie", ties_[j]->self_scm ());
- accidentals_[i].tied_ = true;
+ accidentals_[i].tied_ = true;
}
+
ties_.del (j);
break;
}
for (int i = accidentals_.size (); i--;)
{
- int barnum = get_bar_number ();
+ SCM barnum = get_bar_num ();
- Music *note = accidentals_[i].melodic_;
+ Music * note = accidentals_[i].melodic_;
Context * origin = accidentals_[i].origin_;
- Pitch *pitch = unsmob_pitch (note->get_property ("pitch"));
+ Pitch * pitch = unsmob_pitch (note->get_property ("pitch"));
if (!pitch)
continue;
-
+
int n = pitch->get_notename ();
int o = pitch->get_octave ();
int a = pitch->get_alteration ();
- SCM key = scm_cons (scm_int2num (o), scm_int2num (n));
+ SCM on_s = gh_cons (scm_int2num (o), scm_int2num (n));
- while (origin
- && origin->where_defined (ly_symbol2scm ("localKeySignature")))
+ while (origin)
{
/*
huh? we set props all the way to the top?
*/
- SCM localsig = origin->get_property ("localKeySignature");
+ SCM localsig = ly_deep_copy (origin->get_property ("localKeySignature"));
bool change = false;
if (accidentals_[i].tied_)
{
that of the tied note and of the key signature.
*/
localsig = ly_assoc_front_x
- (localsig, key, scm_cons (SCM_BOOL_T, scm_int2num (barnum)));
+ (localsig, on_s, gh_cons (SCM_BOOL_T, barnum));
change = true;
}
not really really correct if there are more than one
noteheads with the same notename.
*/
- localsig = ly_assoc_front_x (localsig, key,
- scm_cons (scm_int2num (a),
- scm_int2num (barnum)));
+ localsig = ly_assoc_front_x
+ (localsig, on_s, gh_cons (scm_int2num (a), barnum));
+
change = true;
}
if (change)
- origin->set_property ("localKeySignature", localsig);
-
- origin = origin->get_parent_context ();
+ origin->set_property ("localKeySignature", localsig);
+ origin = origin->daddy_context_;
}
}
+
+ for (int i = 0; i < accidentals_.size (); i++)
+ {
+ if (Grob *a = accidentals_[i].accidental_)
+ typeset_grob (a);
+ }
+
+ if (accidental_placement_)
+ typeset_grob (accidental_placement_);
accidental_placement_ = 0;
+
accidentals_.clear ();
left_objects_.clear ();
right_objects_.clear ();
void
Accidental_engraver::acknowledge_grob (Grob_info info)
{
- Music *note = info.music_cause ();
+ Music * note = info.music_cause ();
if (note
&& note->is_mus_type ("note-event")
&& Rhythmic_head::has_interface (info.grob_))
{
if (to_boolean ( get_property ("harmonicAccidentals"))
- || !ly_c_equal_p (info.grob_->get_property ("style"),
+ || !gh_equal_p (info.grob_->get_property ("style"),
ly_symbol2scm ("harmonic")))
{
Accidental_entry entry ;
entry.head_ = info.grob_;
- entry.origin_ = info.origin_trans_->context ();
+ entry.origin_ = info.origin_trans_->daddy_context_;
entry.melodic_ = note;
accidentals_.push (entry);
}
}
else if (Tie::has_interface (info.grob_))
- ties_.push (dynamic_cast<Spanner*> (info.grob_));
+ {
+ ties_.push (dynamic_cast<Spanner*> (info.grob_));
+ }
else if (Arpeggio::has_interface (info.grob_))
- left_objects_.push (info.grob_);
- else if (info.grob_
- ->internal_has_interface (ly_symbol2scm ("finger-interface")))
- left_objects_.push (info.grob_);
+ {
+ left_objects_.push (info.grob_);
+ }
+ else if (info.grob_->internal_has_interface (ly_symbol2scm ("finger-interface")))
+ {
+ left_objects_.push (info.grob_);
+ }
}
void
Accidental_engraver::process_music ()
{
SCM sig = get_property ("keySignature");
+
/* Detect key sig changes.
- Update all parents and children. */
+ Update all parents and children
+ */
if (last_keysig_ != sig)
- update_local_key_signature ();
+ {
+ update_local_key_signature ();
+ }
}
+
+
+
+
ENTER_DESCRIPTION (Accidental_engraver,
- "Make accidentals. "
- "Catch note heads, ties and notices key-change events. "
- "This engraver usually lives at Staff level, but "
+ "Make accidentals. Catches note heads, ties and notices key-change "
+ "events. This engraver usually lives at Staff level, but "
"reads the settings for Accidental at @code{Voice} level, "
"so you can @code{\\override} them at @code{Voice}. "
,
- "Accidental"
- ,
- ""
- ,
- "arpeggio-interface "
- "finger-interface "
- "rhythmic-head-interface "
- "tie-interface "
- ,
- "autoAccidentals "
- "autoCautionaries "
- "extraNatural "
- "harmonicAccidentals "
- "localKeySignature"
- ,
- "localKeySignature"
- );
+
+ "Accidental",
+ "",
+ "finger-interface rhythmic-head-interface tie-interface arpeggio-interface",
+ "localKeySignature harmonicAccidentals extraNatural autoAccidentals autoCautionaries",
+ "localKeySignature");
entry = SCM_EOL;
}
else
- entry = ly_cdr (entry);
+ entry = gh_cdr (entry);
- entry = scm_cons (a->self_scm (), entry);
+ entry = gh_cons (a->self_scm (), entry);
accs = scm_assq_set_x (accs, key, entry);
Link_array<Grob> *break_reminder,
Link_array<Grob> *real_acc)
{
- for (SCM acs =accs->get_property ("accidental-grobs"); ly_c_pair_p (acs);
- acs =ly_cdr (acs))
- for (SCM s = ly_cdar (acs); ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM acs =accs->get_property ("accidental-grobs"); gh_pair_p (acs);
+ acs =gh_cdr (acs))
+ for (SCM s = gh_cdar (acs); gh_pair_p (s); s = gh_cdr (s))
{
- Grob *a = unsmob_grob (ly_car (s));
+ Grob *a = unsmob_grob (gh_car (s));
if (unsmob_grob (a->get_property ("tie")))
break_reminder->push (a);
SCM
Accidental_placement::position_accidentals (Grob * me)
{
- if (!me->is_live ())
+ if (!me->live ())
return SCM_UNSPECIFIED;
SCM accs = me->get_property ("accidental-grobs");
Y-position, they share an Ape, and will be printed in overstrike.
*/
Link_array<Accidental_placement_entry> apes;
- for (SCM s = accs; ly_c_pair_p (s); s =ly_cdr (s))
+ for (SCM s = accs; gh_pair_p (s); s =gh_cdr (s))
{
Accidental_placement_entry *ape = new Accidental_placement_entry;
- ape->notename_ = ly_scm2int (ly_caar (s));
+ ape->notename_ = gh_scm2int (gh_caar (s));
- for (SCM t = ly_cdar (s); ly_c_pair_p (t); t =ly_cdr (t))
- ape->grobs_.push (unsmob_grob (ly_car (t)));
+ for (SCM t = gh_cdar (s); gh_pair_p (t); t =gh_cdr (t))
+ ape->grobs_.push (unsmob_grob (gh_car (t)));
apes.push (ape);
}
/*
accidental.cc -- implement Accidental_interface
- source file of the GNU LilyPond music typesetter
+ (c) 2001--2004 Han-Wen Nienhuys
- (c) 2001--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
+ */
#include "font-interface.hh"
#include "item.hh"
#include "stencil.hh"
#include "accidental-interface.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "pitch.hh"
/*
accidental-placement.cc
*/
+
+
Stencil
parenthesize (Grob*me, Stencil m)
{
if (to_boolean (a->get_property ("cautionary")))
{
SCM cstyle = a->get_property ("cautionary-style");
- parens = ly_c_equal_p (cstyle, ly_symbol2scm ("parentheses"));
+ parens = gh_equal_p (cstyle, ly_symbol2scm ("parentheses"));
}
SCM accs = a->get_property ("accidentals");
SCM scm_style = a->get_property ("style");
- if (!ly_c_symbol_p (scm_style)
+ if (!gh_symbol_p (scm_style)
&& !parens
&& scm_ilength (accs) == 1)
{
- if (ly_scm2int (ly_car (accs)) == FLAT)
+ if (gh_scm2int (gh_car (accs)) == FLAT)
{
Box stem = b;
Box bulb = b;
if (caut)
{
SCM cstyle = me->get_property ("cautionary-style");
- parens = ly_c_equal_p (cstyle, ly_symbol2scm ("parentheses"));
- smaller = ly_c_equal_p (cstyle, ly_symbol2scm ("smaller"));
+ parens = gh_equal_p (cstyle, ly_symbol2scm ("parentheses"));
+ smaller = gh_equal_p (cstyle, ly_symbol2scm ("smaller"));
}
SCM scm_style = me->get_property ("style");
String style;
- if (ly_c_symbol_p (scm_style))
+ if (gh_symbol_p (scm_style))
{
style = ly_symbol2string (scm_style);
}
if (smaller)
{
SCM ac = Font_interface::text_font_alist_chain (me);
- ac = scm_cons (scm_cons (scm_cons
+ ac = gh_cons (gh_cons (gh_cons
(ly_symbol2scm ("font-size"),
scm_int2num (-2)), SCM_EOL),
ac);
Stencil mol;
for (SCM s = me->get_property ("accidentals");
- ly_c_pair_p (s); s = ly_cdr (s))
+ gh_pair_p (s); s = gh_cdr (s))
{
- int alteration = ly_scm2int (ly_car (s));
+ int alteration = gh_scm2int (gh_car (s));
String font_char = get_fontcharname (style, alteration);
Stencil acc (fm->find_by_name ("accidentals-" + font_char));
#include <string.h>
-#include "warn.hh"
+#include "warn.hh" // error ()
#include "libc-extension.hh"
#include "afm.hh"
+#include "stencil.hh"
#include "dimensions.hh"
-Adobe_font_metric::Adobe_font_metric (AFM_Font_info *fi)
+Adobe_font_metric::Adobe_font_metric (AFM_Font_info * fi)
{
checksum_ = 0;
- font_info_ = fi;
- design_size_ = 1.0;
-
- for (int i = 256 >? fi->numOfChars; i--;)
+ font_inf_ = fi;
+
+ for (int i= 256 >? fi->numOfChars; i--;)
ascii_to_metric_idx_.push (-1);
for (int i=0; i < fi->numOfChars; i++)
{
AFM_CharMetricInfo * c = fi->cmi + i;
- /* Some TeX afm files contain code = -1. We don't know why,
- let's ignore it. */
+ /*
+ Some TeX afm files contain code = -1. We don't know why, let's
+ ignore it.
+
+ */
if (c->code >= 0)
ascii_to_metric_idx_[c->code] = i;
name_to_metric_dict_[c->name] = i;
}
}
-Adobe_font_metric::~Adobe_font_metric ()
-{
- AFM_free (font_info_);
-}
SCM
-Adobe_font_metric::make_afm (AFM_Font_info *fi,
- unsigned int checksum,
- Real design_size)
+Adobe_font_metric::make_afm (AFM_Font_info *fi, unsigned int checksum)
{
- Adobe_font_metric *fm = new Adobe_font_metric (fi);
+ Adobe_font_metric * fm = new Adobe_font_metric (fi);
fm->checksum_ = checksum;
- fm->design_size_ = design_size;
return fm->self_scm ();
}
-AFM_CharMetricInfo const*
+
+AFM_CharMetricInfo const *
Adobe_font_metric::find_ascii_metric (int a) const
{
if (ascii_to_metric_idx_[a] >=0)
{
int code = ascii_to_metric_idx_[a];
- if (code >= 0)
- return font_info_->cmi + code;
+ if (code>=0)
+ {
+ return font_inf_->cmi + code;
+ }
}
+
return 0;
}
-AFM_CharMetricInfo const*
+
+
+AFM_CharMetricInfo const *
Adobe_font_metric::find_char_metric (String nm) const
{
int idx = name_to_index (nm);
if (idx >= 0)
- return font_info_->cmi + idx;
- return 0;
+ return font_inf_->cmi+ idx;
+ else
+ return 0;
}
int
-Adobe_font_metric::name_to_index (String name) const
+Adobe_font_metric::name_to_index (String nm)const
{
- std::map<String,int>::const_iterator ai = name_to_metric_dict_.find (name);
+ std::map<String,int>::const_iterator ai = name_to_metric_dict_.find (nm);
+
if (ai == name_to_metric_dict_.end ())
return -1;
- return (*ai).second;
+ else
+ return (*ai).second;
}
int
Adobe_font_metric::count () const
{
- return font_info_->numOfChars;
+ return font_inf_->numOfChars ;
}
Box
Adobe_font_metric::get_ascii_char (int code) const
{
- AFM_CharMetricInfo const *c = find_ascii_metric (code);
- Box b (Interval (0, 0), Interval (0, 0));
+ AFM_CharMetricInfo const
+ * c = find_ascii_metric (code);
+ Box b (Interval (0,0),Interval (0,0));
if (c)
- b = afm_bbox_to_box (c->charBBox);
+ b = afm_bbox_to_box (c->charBBox);
+
return b;
}
-int
-Adobe_font_metric::index_to_ascii (int code) const
-{
- return font_info_->cmi[code].code;
-}
Box
Adobe_font_metric::get_indexed_char (int code) const
{
- if (code >= 0)
- return afm_bbox_to_box (font_info_->cmi[code].charBBox);
+ if (code>= 0)
+ return afm_bbox_to_box (font_inf_->cmi[code].charBBox);
else
- return Box (Interval (0, 0), Interval (0, 0));
+ return Box (Interval (0,0),Interval (0,0));
}
SCM
read_afm_file (String nm)
{
FILE *f = fopen (nm.to_str0 () , "r");
- char s[2048] = "";
+ char s[2048];
char *check_key = "Comment TfmCheckSum";
- char *size_key = "Comment DesignSize";
unsigned int cs = 0;
- Real ds = 1.0;
-
+
+ s[0] = 0;
/* Assume check_key in first 10 lines */
for (int i = 0; i < 10; i++)
{
fgets (s, sizeof (s), f);
if (strncmp (s, check_key, strlen (check_key)) == 0)
- sscanf (s + strlen (check_key), "%ud", &cs);
- else if (strncmp (s, size_key, strlen (size_key)) == 0)
- sscanf (s + strlen (size_key), "%lf", &ds);
+ {
+ sscanf (s + strlen (check_key), "%ud", &cs);
+ break;
+ }
}
rewind (f);
- AFM_Font_info *fi;
- int ok = AFM_parseFile (f, &fi, ~0);
+ AFM_Font_info * fi;
+ int ok = AFM_parseFile (f, &fi, ~1);
if (ok)
{
}
fclose (f);
- return Adobe_font_metric::make_afm (fi, cs, ds);
+ return Adobe_font_metric::make_afm (fi, cs);
}
-/* Actually, AFMs will be printers point, usually, but our .py script dumps
- real points. */
+/*
+ actually, AFMs will be printers point, usually, but our .py script dumps
+ real points.
+ */
Box
afm_bbox_to_box (AFM_BBox bb)
{
}
Offset
-Adobe_font_metric::get_indexed_wxwy (int k) const
+Adobe_font_metric::get_indexed_wxwy (int k)const
{
- AFM_CharMetricInfo const *mi = font_info_->cmi+ k;
+ AFM_CharMetricInfo const *mi = font_inf_->cmi+ k;
return 1/1000.0 PT * Offset (mi->wx, mi->wy);
}
-Real
-Adobe_font_metric::design_size () const
+
+
+Adobe_font_metric::~Adobe_font_metric ()
{
- return design_size_;
+ AFM_free (font_inf_);
}
-String
-Adobe_font_metric::coding_scheme () const
+/*
+ return a stencil, without fontification
+ */
+Stencil
+Adobe_font_metric::find_by_name (String s) const
{
- return font_info_->gfi->encodingScheme;
+ AFM_CharMetricInfo const *cm = find_char_metric (s);
+
+ if (!cm)
+ {
+ /*
+ Why don't we return empty?
+ */
+
+ Stencil m;
+ m.set_empty (false);
+ return m;
+ }
+
+ SCM at = (scm_list_n (ly_symbol2scm ("char"),
+ scm_int2num (cm->code),
+ SCM_UNDEFINED));
+
+ // at= fontify_atom ((Font_metric*)this, at);
+ Box b = afm_bbox_to_box (cm->charBBox);
+
+ return Stencil (b, at);
}
#include "group-interface.hh"
#include "axis-group-interface.hh"
#include "hara-kiri-group-spanner.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
MAKE_SCHEME_CALLBACK (Align_interface,alignment_callback,2);
SCM
Align_interface::alignment_callback (SCM element_smob, SCM axis)
{
Grob * me = unsmob_grob (element_smob);
- Axis ax = (Axis)ly_scm2int (axis);
+ Axis ax = (Axis)gh_scm2int (axis);
Grob * par = me->get_parent (ax);
if (par && !to_boolean (par->get_property ("positioning-done")))
{
Align_interface::align_elements_to_extents (par, ax);
}
- return scm_make_real (0.0);
+ return gh_double2scm (0.0);
}
MAKE_SCHEME_CALLBACK (Align_interface,fixed_distance_alignment_callback,2);
Align_interface::fixed_distance_alignment_callback (SCM element_smob, SCM axis)
{
Grob * me = unsmob_grob (element_smob);
- Axis ax = (Axis)ly_scm2int (axis);
+ Axis ax = (Axis)gh_scm2int (axis);
Grob * par = me->get_parent (ax);
if (par && !to_boolean (par->get_property ("positioning-done")))
{
Align_interface::align_to_fixed_distance (par, ax);
}
- return scm_make_real (0.0);
+ return gh_double2scm (0.0);
}
/*
SCM d = me->get_property ("stacking-dir");
- Direction stacking_dir = ly_c_number_p (d) ? to_dir (d) : CENTER;
+ Direction stacking_dir = gh_number_p (d) ? to_dir (d) : CENTER;
if (!stacking_dir)
stacking_dir = DOWN;
&& Hara_kiri_group_spanner::has_interface (elems[j]))
Hara_kiri_group_spanner::consider_suicide (elems[j]);
- if (!elems[j]->is_live ())
+ if (!elems[j]->live ())
elems.del (j);
}
SCM d = me->get_property ("stacking-dir");
- Direction stacking_dir = ly_c_number_p (d) ? to_dir (d) : CENTER;
+ Direction stacking_dir = gh_number_p (d) ? to_dir (d) : CENTER;
if (!stacking_dir)
stacking_dir = DOWN;
- Interval threshold = robust_scm2interval (me->get_property ("threshold"), Interval (0, Interval::infinity ()));
+ Interval threshold = robust_scm2interval ( me->get_property ("threshold"), Interval (0, Interval::infinity ()));
Array<Interval> dims;
FIXME: uncommenting freaks out the Y-alignment of
line-of-score.
*/
- if (ly_c_number_p (align))
- center_offset = total.linear_combination (ly_scm2double (align));
+ if (gh_number_p (align))
+ center_offset = total.linear_combination (gh_scm2double (align));
for (int j = 0 ; j < all_grobs.size (); j++)
all_grobs[j]->translate_axis (all_translates[j] - center_offset, a);
Axis
Align_interface::axis (Grob*me)
{
- return Axis (ly_scm2int (ly_car (me->get_property ("axes"))));
+ return Axis (gh_scm2int (ly_car (me->get_property ("axes"))));
}
void
{
while (g)
{
- if (ly_c_number_p (g->get_property ("forced-distance")))
+ if (gh_number_p (g->get_property ("forced-distance")))
return g;
g = g->get_parent (Y_AXIS);
#include "config.h"
#include "main.hh"
#include "all-font-metrics.hh"
+
#include "warn.hh"
#include "afm.hh"
#include "tfm.hh"
#include "scm-hash.hh"
#include "kpath.hh"
-static const char *default_font_str0_ = "cmr10";
+static const char * default_font_str0_ = "cmr10";
All_font_metrics::All_font_metrics (String path)
{
/*
TODO: our AFM handling is broken: the units in an AFM file are
relative to the design size (1000 units = 1 designsize). Hence we
- should include design size when generating an AFM metric.
-
- ugr: copied from find_tfm.
+ should include design size when generating an AFM metric.
*/
Adobe_font_metric *
All_font_metrics::find_afm (String name)
{
SCM sname = ly_symbol2scm (name.to_str0 ());
+
SCM name_string = scm_makfrom0str (name.to_str0 ());
+
SCM val;
+
if (!afm_p_dict_->try_retrieve (sname, &val))
{
- String filename;
+ String path;
- if (filename.is_empty ())
- filename = search_path_.find (name + ".afm");
+ if (path.is_empty ())
+ path = search_path_.find (name + ".afm");
- if (filename.is_empty ())
+ if (path.is_empty ())
{
String p = kpathsea_find_afm (name.to_str0 ());
if (p.length ())
- filename = p;
+ path = p;
}
- if (filename.is_empty ())
+ if (path.is_empty ())
return 0;
if (verbose_global_b)
- progress_indication ("[" + filename);
- val = read_afm_file (filename);
- unsmob_metrics (val)->filename_ = filename;
+ progress_indication ("[" + path);
+ val = read_afm_file (path);
+ unsmob_metrics (val)->path_ = path;
- unsmob_metrics (val)->description_ = scm_cons (name_string,
- scm_make_real (1.0));
+ unsmob_metrics (val)->description_ = gh_cons (name_string, gh_double2scm (1.0));
if (verbose_global_b)
progress_indication ("]");
- afm_p_dict_->set (sname, val);
+ afm_p_dict_->set (sname,val);
+
scm_gc_unprotect_object (val);
+
Adobe_font_metric *afm
= dynamic_cast<Adobe_font_metric*> (unsmob_metrics (val));
- /* Only check checksums if there is one. We take the risk that
- some file has valid checksum 0 */
+ /*
+ only check checksums if there is one. We take the risk that
+ some file has valid checksum 0
+ */
if (afm->checksum_)
{
Tex_font_metric * tfm = find_tfm (name);
/* FIXME: better warning message
- (maybe check upon startup for feta16.afm, feta16.tfm?) */
+ (maybe check upon startup for feta16.afm, feta16.tfm?)
+ */
if (tfm && tfm->info_.checksum != afm->checksum_)
{
- // FIXME: broken sentence
String s = _f ("checksum mismatch for font file: `%s'",
- filename.to_str0 ());
- s += " " + _f ("does not match: `%s'",
- tfm->filename_.to_str0 ());
+ path.to_str0 ());
+ s += " " + _f ("does not match: `%s'", tfm->path_.to_str0 ()); // FIXME
s += "\n";
s += " TFM: " + to_string ((int) tfm->info_.checksum);
s += " AFM: " + to_string ((int) afm->checksum_);
}
-Tex_font_metric*
+Tex_font_metric *
All_font_metrics::find_tfm (String name)
{
SCM sname = ly_symbol2scm (name.to_str0 ());
SCM name_string = scm_makfrom0str (name.to_str0 ());
+
SCM val;
if (!tfm_p_dict_->try_retrieve (sname, &val))
{
- String filename;
+ String path;
- if (filename.is_empty ())
+ if (path.is_empty ())
{
String p = kpathsea_find_tfm (name.to_str0 ());
if (p.length ())
- filename = p;
+ path = p;
}
- if (filename.is_empty ())
- filename = search_path_.find (name + ".tfm");
- if (filename.is_empty ())
+ if (path.is_empty ())
+ path = search_path_.find (name + ".tfm");
+ if (path.is_empty ())
return 0;
if (verbose_global_b)
- progress_indication ("[" + filename);
+ progress_indication ("[" + path);
- val = Tex_font_metric::make_tfm (filename);
+ val = Tex_font_metric::make_tfm (path);
if (verbose_global_b)
progress_indication ("]");
- unsmob_metrics (val)->filename_ = filename;
- unsmob_metrics (val)->description_ = scm_cons (name_string,
- scm_make_real (1.0));
+ unsmob_metrics (val)->path_ = path;
+ unsmob_metrics (val)->description_ = gh_cons (name_string, gh_double2scm (1.0));
tfm_p_dict_->set (sname, val);
+
scm_gc_unprotect_object (val);
}
- return dynamic_cast<Tex_font_metric*> (unsmob_metrics (val));
+ return
+ dynamic_cast<Tex_font_metric*> (unsmob_metrics (val));
}
-Font_metric*
+
+
+Font_metric *
All_font_metrics::find_font (String name)
{
if ((name.left_string (4) == "feta") ||
(name.left_string (8) == "parmesan"))
{
- Font_metric *f = find_afm (name);
+ Font_metric * f = find_afm (name);
if (f)
return f;
else
if (f)
return f;
else
- f = find_afm (name);
+ f =find_afm (name);
if (f)
- return f;
+ return f ;
}
warning (_f ("can't find font: `%s'", name.to_str0 ()));
return 0;
}
-All_font_metrics *all_fonts_global;
-
-
-LY_DEFINE (ly_font_load, "ly:font-load", 1, 0, 0,
- (SCM name),
- "Load the font @var{name}. ")
-{
- SCM_ASSERT_TYPE (ly_c_string_p (name), name, SCM_ARG1, __FUNCTION__, "string");
-
- Font_metric * fm = all_fonts_global->find_font (ly_scm2string (name));
-
- return fm->self_scm ();
-}
SCM key_signature = get_property ("keySignature");
ambitus_->set_property ("accidentals", key_signature);
-
+ typeset_grob (ambitus_);
is_typeset = true;
}
}
void
Ambitus_engraver::create_ambitus ()
{
- ambitus_ = make_item ("Ambitus",SCM_EOL);
+ ambitus_ = make_item ("Ambitus");
is_typeset = false;
+ announce_grob (ambitus_, SCM_EOL);
}
void
#include "note-head.hh"
#include "item.hh"
#include "font-interface.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "lookup.hh"
/*
if (ignore_octave_b)
prev = ly_assoc_cdr (scm_int2num (notename), key_signature);
else
- prev = scm_assoc (scm_cons (scm_int2num (octave), scm_int2num (notename)),
+ prev = scm_assoc (gh_cons (scm_int2num (octave), scm_int2num (notename)),
key_signature);
/* should really be true unless prev == SCM_BOOL_F */
- if (ly_c_pair_p (prev) && ly_c_pair_p (ly_cdr (prev)))
+ if (gh_pair_p (prev) && gh_pair_p (ly_cdr (prev)))
{
- prev = scm_cons (ly_car (prev), ly_cadr (prev));
+ prev = gh_cons (ly_car (prev), ly_cadr (prev));
}
/* If an accidental was not found */
prev = scm_assoc (scm_int2num (notename), key_signature);
SCM prev_acc = (prev == SCM_BOOL_F) ? scm_int2num (0) : ly_cdr (prev);
- int sig_alteration = ly_c_number_p (prev_acc) ? ly_scm2int (prev_acc) : 0;
+ int sig_alteration = gh_number_p (prev_acc) ? gh_scm2int (prev_acc) : 0;
if (alteration == sig_alteration) // no accidental at all needed
return 0;
SCM
Ambitus::print (SCM smob)
{
- Item *me = (Item*) unsmob_grob (smob);
- Stencil stencil;
+ Item *me = (Item *)unsmob_grob (smob);
+ Stencil stencil = Stencil ();
SCM scm_note_head_style = me->get_property ("note-head-style");
String note_head_style;
- if (ly_c_symbol_p (scm_note_head_style))
+ if (gh_symbol_p (scm_note_head_style))
{
String note_head_style =
ly_symbol2string (scm_note_head_style);
}
SCM c0 = me->get_property ("c0-position");
- if (ly_c_number_p (c0))
+ if (gh_number_p (c0))
{
- p_min += ly_scm2int (c0);
- p_max += ly_scm2int (c0);
+ p_min += gh_scm2int (c0);
+ p_max += gh_scm2int (c0);
}
// create heads
if (to_boolean (me->get_property ("join-heads")) &&
((p_max - p_min) >= 3))
{
- Real linethickness = me->get_paper ()->get_dimension (ly_symbol2scm ("linethickness"));
- Real blotdiameter = me->get_paper ()->get_dimension (ly_symbol2scm ("blotdiameter"));
+ Real linethickness = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness"));
+ Real blotdiameter = me->get_paper ()->get_realvar (ly_symbol2scm ("blotdiameter"));
Interval x_extent = 0.5 * Interval (-linethickness, +linethickness);
Interval y_extent = 0.5 * Interval (p_min + 1.35, p_max - 1.35);
Box line_box (x_extent, y_extent);
SCM key_signature = me->get_property ("key-signature");
SCM scm_accidentals_style = me->get_property ("accidentals-style");
String accidentals_style;
- if (ly_c_symbol_p (scm_accidentals_style))
+ if (gh_symbol_p (scm_accidentals_style))
{
accidentals_style =
ly_symbol2string (scm_accidentals_style);
-/*
- apply-context-iterator.cc -- implement Apply_context_iterator
-
- source file of the GNU LilyPond music typesetter
-
- (c) 2004 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
-*/
-
#include "simple-music-iterator.hh"
#include "context.hh"
#include "music.hh"
-#include "input.hh"
/**
Iterate a property.
{
SCM proc = get_music ()->get_property ("procedure");
- if (ly_c_procedure_p (proc))
- scm_call_1 (proc, get_outlet ()->self_scm ());
- else
- get_music ()->origin ()->warning (_("\\applycontext argument is not a procedure"));
+ scm_call_1 (proc, get_outlet ()->self_scm ());
Simple_music_iterator::process (m);
}
{
if (arpeggio_req_)
{
- arpeggio_ = make_item ("Arpeggio",arpeggio_req_->self_scm ());
+ arpeggio_ = make_item ("Arpeggio");
+ announce_grob (arpeggio_, arpeggio_req_->self_scm ());
}
}
void
Arpeggio_engraver::stop_translation_timestep ()
{
- arpeggio_ = 0;
+ if (arpeggio_)
+ {
+ typeset_grob (arpeggio_);
+ arpeggio_ = 0;
+ }
arpeggio_req_ = 0;
}
*/
#include "stencil.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "arpeggio.hh"
#include "grob.hh"
#include "stem.hh"
Grob *me = unsmob_grob (smob);
Grob * common = me;
- for (SCM s = me->get_property ("stems"); ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = me->get_property ("stems"); gh_pair_p (s); s = ly_cdr (s))
{
Grob * stem = unsmob_grob (ly_car (s));
common = common->common_refpoint (Staff_symbol_referencer::get_staff_symbol (stem),
Interval heads;
Real my_y = me->relative_coordinate (common, Y_AXIS);
- for (SCM s = me->get_property ("stems"); ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = me->get_property ("stems"); gh_pair_p (s); s = ly_cdr (s))
{
Grob * stem = unsmob_grob (ly_car (s));
Grob * ss = Staff_symbol_referencer::get_staff_symbol (stem);
Grob *me = unsmob_grob (smob);
Grob * common = me;
- for (SCM s = me->get_property ("stems"); ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = me->get_property ("stems"); gh_pair_p (s); s = ly_cdr (s))
{
Grob * stem = unsmob_grob (ly_car (s));
common = common->common_refpoint (Staff_symbol_referencer::get_staff_symbol (stem),
Interval heads;
Real my_y = me->relative_coordinate (common, Y_AXIS);
- for (SCM s = me->get_property ("stems"); ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = me->get_property ("stems"); gh_pair_p (s); s = ly_cdr (s))
{
Grob * stem = unsmob_grob (ly_car (s));
Grob * ss = Staff_symbol_referencer::get_staff_symbol (stem);
heads.unite (iv + ss->relative_coordinate (common, Y_AXIS) - my_y);
}
- Real lt = me->get_paper ()->get_dimension (ly_symbol2scm ("linethickness"));
+ Real lt = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness"));
Real sp = 1.5 * Staff_symbol_referencer::staff_space (me);
Real dy = heads.length () + sp;
Real x = 0.7;
Arpeggio::width_callback (SCM smob, SCM axis)
{
Grob * me = unsmob_grob (smob);
- Axis a = (Axis)ly_scm2int (axis);
+ Axis a = (Axis)gh_scm2int (axis);
assert (a == X_AXIS);
Stencil arpeggio = Font_interface::get_default_font (me)->find_by_name ("scripts-arpeggio");
Audio_column::Audio_column (Moment at_mom)
{
at_mom_ = at_mom;
+ performance_ = 0;
}
void
Link_array<Context>
Audio_element_info::origin_contexts (Translator* end) const
{
- Context * t = origin_trans_->context ();
+ Context * t = origin_trans_->daddy_context_;
Link_array<Context> r;
do {
r.push (t);
- t = t->get_parent_context ();
- } while (t && t != end->context ());
+ t = t->daddy_context_;
+ } while (t && t != end->daddy_context_);
return r;
}
#include "duration.hh"
#include "context.hh"
+/*
+ TODO: documentme.
+ */
class Auto_beam_engraver : public Engraver
{
TRANSLATOR_DECLARATIONS (Auto_beam_engraver);
void
Auto_beam_engraver::process_music ()
{
- if (ly_c_string_p (get_property ("whichBar")))
+ if (gh_string_p (get_property ("whichBar")))
{
consider_end (shortest_mom_);
junk_beam ();
}
/* second guess: property generic time exception */
- SCM m = scm_assoc (ly_append3 (function, wild, time), settings);
+ SCM m = scm_assoc (gh_append3 (function, wild, time), settings);
if (m != SCM_BOOL_F && unsmob_moment (ly_cdr (m)))
moment = * unsmob_moment (ly_cdr (m));
/* third guess: property time exception, specific for duration type */
- m = scm_assoc (ly_append3 (function, type, time), settings);
+ m = scm_assoc (gh_append3 (function, type, time), settings);
if (m != SCM_BOOL_F && unsmob_moment (ly_cdr (m)))
moment = * unsmob_moment (ly_cdr (m));
/* fourth guess [user override]: property plain generic */
- m = scm_assoc (ly_append3 (function, wild, wild), settings);
+ m = scm_assoc (gh_append3 (function, wild, wild), settings);
if (m != SCM_BOOL_F && unsmob_moment (ly_cdr (m)))
moment = * unsmob_moment (ly_cdr (m));
/* fifth guess [user override]: property plain, specific for duration type */
- m = scm_assoc (ly_append3 (function, type, wild), settings);
+ m = scm_assoc (gh_append3 (function, type, wild), settings);
if (m != SCM_BOOL_F && unsmob_moment (ly_cdr (m)))
moment = * unsmob_moment (ly_cdr (m));
stems_ = new Link_array<Item>;
grouping_ = new Beaming_info_list;
- beam_settings_ = updated_grob_properties (context (), ly_symbol2scm ("Beam"));
+ beam_settings_ = updated_grob_properties (daddy_context_, ly_symbol2scm ("Beam"));
beam_start_moment_ = now_mom ();
beam_start_location_ = *unsmob_moment (get_property ("measurePosition"));
- subdivide_beams_ = ly_scm2bool (get_property ("subdivideBeams"));
+ subdivide_beams_ = gh_scm2bool (get_property ("subdivideBeams"));
beat_length_ = *unsmob_moment (get_property ("beatLength"));
}
{
finished_grouping_->beamify (beat_length_, subdivide_beams_);
Beam::set_beaming (finished_beam_, finished_grouping_);
+ typeset_grob (finished_beam_);
finished_beam_ = 0;
delete finished_grouping_;
while (current && !current->is_alias (to_type_sym))
{
last = current;
- current = current->get_parent_context ();
+ current = current->daddy_context_;
}
- if (current && current->id_string () == to_id)
+ if (current && current->id_string_ == to_id)
{
String msg;
msg += _ ("Can't switch translators, I'm there already");
Moment now = get_outlet ()->now_mom ();
Moment *splitm = 0;
- for (; ly_c_pair_p (split_list_); split_list_ = ly_cdr (split_list_))
+ for (; gh_pair_p (split_list_); split_list_ = gh_cdr (split_list_))
{
- splitm = unsmob_moment (ly_caar (split_list_));
+ splitm = unsmob_moment (gh_caar (split_list_));
if ((*splitm + start_moment_) > now)
break ;
- SCM tag = ly_cdar (split_list_);
+ SCM tag = gh_cdar (split_list_);
Direction d = to_dir (tag);
if (d && d != where_dir_)
Grob * it = unsmob_grob (get_property ("currentCommandColumn"));
staffline_->set_bound (LEFT,it);
+
+ announce_grob (staffline_, SCM_EOL);
}
}
Spanner*
Axis_group_engraver::get_spanner ()
{
- return make_spanner ("VerticalAxisGroup", SCM_EOL);
+ return make_spanner ("VerticalAxisGroup");
}
/*
if (!staffline_)
return ;
- String type = context ()->context_name ();
+ String type = daddy_context_->context_name ();
SCM dims = get_property ("verticalExtent");
if (is_number_pair (dims))
staffline_->set_bound (RIGHT,it);
+ typeset_grob (staffline_);
staffline_ = 0;
}
Spanner*
Hara_kiri_engraver::get_spanner ()
{
- Spanner * sp = make_spanner ("RemoveEmptyVerticalGroup", SCM_EOL);
+ Spanner * sp = make_spanner ("RemoveEmptyVerticalGroup");
return sp;
}
{
for (SCM ax = me->get_property ("axes"); ax != SCM_EOL ; ax = ly_cdr (ax))
{
- Axis a = (Axis) ly_scm2int (ly_car (ax));
+ Axis a = (Axis) gh_scm2int (ly_car (ax));
if (!e->get_parent (a))
e->set_parent (me, a);
Axis_group_interface::relative_group_extent (Axis a, Grob *common, SCM elts)
{
Interval r;
- for (SCM s = elts; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = elts; gh_pair_p (s); s = ly_cdr (s))
{
Grob * se = unsmob_grob (ly_car (s));
Interval dims = se->extent (common, a);
Axis_group_interface::group_extent_callback (SCM element_smob, SCM scm_axis)
{
Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) ly_scm2int (scm_axis);
+ Axis a = (Axis) gh_scm2int (scm_axis);
SCM elts = me->get_property ("elements");
Grob * common = common_refpoint_of_list (elts, me, a);
SCM axes = me->get_property ("axes");
- if (!ly_c_pair_p (axes)
+ if (!gh_pair_p (axes)
|| scm_c_memq (sa1, axes) == SCM_BOOL_F
|| scm_c_memq (sa2, axes) == SCM_BOOL_F)
{
- SCM ax = scm_cons (sa1, SCM_EOL);
+ SCM ax = gh_cons (sa1, SCM_EOL);
if (a1 != a2)
- ax= scm_cons (sa2, ax);
+ ax= gh_cons (sa2, ax);
me->set_property ("axes", ax);
}
if (!has_interface (me))
return childs;
- for (SCM ep = me->get_property ("elements"); ly_c_pair_p (ep); ep = ly_cdr (ep))
+ for (SCM ep = me->get_property ("elements"); gh_pair_p (ep); ep = ly_cdr (ep))
{
Grob* e = unsmob_grob (ly_car (ep));
if (e)
/*
- balloon.cc -- implement Balloon
-
- source file of the GNU LilyPond music typesetter
-
- (c) 2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
+ balloon.cc -- implement Balloon objects
+ */
#include "text-item.hh"
#include "grob.hh"
#include "font-interface.hh"
#include "stencil.hh"
#include "lily-guile.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "misc.hh"
-class Balloon_interface
+struct Balloon_interface
{
+
public:
DECLARE_SCHEME_CALLBACK (print, (SCM));
static bool has_interface (Grob*);
SCM
Balloon_interface::print (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me= unsmob_grob (smob);
SCM cb = me->get_property ("balloon-original-callback");
- SCM stil = SCM_EOL;
+ SCM scm_mol = SCM_EOL;
- if (ly_c_procedure_p (cb))
- stil = scm_call_1 (cb, smob);
+ if (gh_procedure_p (cb))
+ {
+ scm_mol = scm_call_1 (cb, smob);
+ }
- if (!unsmob_stencil (stil))
- return stil;
+ if (!unsmob_stencil (scm_mol))
+ return scm_mol;
SCM scm_off = me->get_property ("balloon-text-offset");
if (!is_number_pair (scm_off))
- return stil;
+ return scm_mol;
Offset off = ly_scm2offset (scm_off);
- Stencil *s = unsmob_stencil (stil);
- Box orig_extent = s->extent_box ();
+ Stencil * m = unsmob_stencil (scm_mol);
+ Box orig_extent = m->extent_box ();
Box box_extent = orig_extent;
- Real w = robust_scm2double (me->get_property ("balloon-padding"), .1);
+ Real w = robust_scm2double (me->get_property ("balloon-padding"), .1);
box_extent.widen (w, w);
-
- // FIXME
+
+
Stencil fr = Lookup::frame (box_extent, 0.1, 0.05);
- fr.add_stencil (*s);
+ fr.add_stencil (*m);
+
+
+
SCM bt = me->get_property ("balloon-text");
SCM chain = Font_interface::text_font_alist_chain (me);
- chain = scm_cons (me->get_property ("balloon-text-props"), chain);
+ chain = gh_cons (me->get_property ("balloon-text-props"), chain);
- SCM text = Text_item::interpret_markup (me->get_paper ()->self_scm (),
- chain, bt);
- Stencil *text_stil = unsmob_stencil (text);
-
+ SCM text = Text_item::interpret_markup (me->get_paper ()->self_scm (), chain, bt);
+
+
+ Stencil *text_mol = unsmob_stencil (text);
+
Offset z1;
+
for (int i = X_AXIS; i < NO_AXES; i++)
{
- Axis a ((Axis)i);
+ Axis a ((Axis)i);
z1[a] = box_extent [a].linear_combination (sign (off[a]));
- text_stil->align_to (a, -sign (off[a]));
+ text_mol->align_to (a, -sign (off[a]));
}
Offset z2 = z1 + off;
-
+
fr.add_stencil (Line_interface::line (me, z1, z2));
- text_stil->translate (z2);
- fr.add_stencil (*text_stil);
-
- fr = Stencil (orig_extent, fr.expr ());
+ text_mol->translate (z2);
+ fr.add_stencil (*text_mol);
+
+ fr = Stencil (orig_extent, fr.get_expr ());
return fr.smobbed_copy ();
}
{
if (!bar_)
{
- bar_ = make_item ("BarLine", SCM_EOL);
+ bar_ = make_item ("BarLine");
SCM gl = get_property ("whichBar");
if (scm_equal_p (gl, bar_->get_property ("glyph")) != SCM_BOOL_T)
bar_->set_property ("glyph", gl);
+
+ announce_grob (bar_, SCM_EOL);
}
}
void
Bar_engraver::process_acknowledged_grobs ()
{
- if (!bar_ && ly_c_string_p (get_property ("whichBar")))
- create_bar ();
+ if (!bar_ && gh_string_p (get_property ("whichBar")))
+ {
+ create_bar ();
+ }
}
void
Bar_engraver::typeset_bar ()
{
- bar_ = 0;
+ if (bar_)
+ {
+ typeset_grob (bar_);
+ bar_ =0;
+ }
}
/*
Bar_engraver::stop_translation_timestep ()
{
if (!bar_)
- /* guh. Use properties! */
- get_score_engraver ()->forbid_breaks ();
+ {
+ get_score_engraver ()->forbid_breaks (); // guh. Use properties!
+ }
else
typeset_bar ();
}
#include "bar-line.hh"
#include "string.hh"
#include "stencil.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "font-interface.hh"
#include "all-font-metrics.hh"
SCM s = me->get_property ("glyph");
SCM barsiz_proc = me->get_property ("bar-size-procedure");
- if (ly_c_string_p (s) && ly_c_procedure_p (barsiz_proc))
+ if (gh_string_p (s) && gh_procedure_p (barsiz_proc))
{
String str =ly_scm2string (s);
- SCM siz = scm_call_1 (barsiz_proc, me->self_scm ());
+ SCM siz = gh_call1 (barsiz_proc, me->self_scm ());
Real sz = robust_scm2double (siz, 0);
if (sz < 0)
return SCM_EOL;
Real hair = robust_scm2double (me->get_property ("hair-thickness"), 1);
Real fatline = robust_scm2double (me->get_property ("thick-thickness"), 1);
- Real staffline = me->get_paper ()->get_dimension (ly_symbol2scm ("linethickness"));
+ Real staffline = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness"));
Real staff_space = Staff_symbol_referencer::staff_space (me);
kern *= staffline;
if (str == "||:")
str = "|:";
+
if (str == "")
{
return Lookup::blank (Box (Interval (0, 0), Interval (-h/2, h/2)));
Stencil
Bar_line::simple_barline (Grob *me,Real w, Real h)
{
- Real blot = me->get_paper ()->get_dimension (ly_symbol2scm ("blotdiameter"));
+ Real blot = me->get_paper ()->get_realvar (ly_symbol2scm ("blotdiameter"));
return Lookup::round_filled_box (Box (Interval (0,w), Interval (-h/2, h/2)), blot);
}
SCM g = me->get_property ("glyph");
SCM orig = g;
Direction bsd = item->break_status_dir ();
- if (ly_c_string_p (g) && bsd)
+ if (gh_string_p (g) && bsd)
{
SCM proc = me->get_property ("break-glyph-function");
- g = scm_call_2 (proc, g, scm_int2num (bsd));
+ g = gh_call2 (proc, g, scm_int2num (bsd));
}
- if (!ly_c_string_p (g))
+ if (!gh_string_p (g))
{
me->set_property ("print-function", SCM_EOL);
me->set_extent (SCM_EOL, X_AXIS);
// leave y_extent for spanbar?
}
- if (! ly_c_equal_p (g, orig))
+ if (! gh_equal_p (g, orig))
me->set_property ("glyph", g);
return SCM_UNSPECIFIED;
Grob*me = unsmob_grob (smob);
Real ss = Staff_symbol_referencer::staff_space (me);
SCM size = me->get_property ("bar-size");
- if (ly_c_number_p (size))
- return scm_make_real (ly_scm2double (size)*ss);
+ if (gh_number_p (size))
+ return gh_double2scm (gh_scm2double (size)*ss);
else if (Staff_symbol_referencer::get_staff_symbol (me))
{
/*
calculation. That's a nonsense value, which would collapse the
barline so we return 0.0 in the next alternative.
*/
- return scm_make_real ((Staff_symbol_referencer::line_count (me) -1) * ss);
+ return gh_double2scm ((Staff_symbol_referencer::line_count (me) -1) * ss);
}
else
return scm_int2num (0);
#include "lily-guile.hh"
#include "paper-column.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "side-position-interface.hh"
#include "item.hh"
#include "moment.hh"
SCM wb = get_property ("whichBar");
- if (ly_c_string_p (wb))
+ if (gh_string_p (wb))
{
SCM smp = get_property ("measurePosition");
{
SCM bn = get_property ("currentBarNumber");
SCM proc = get_property ("barNumberVisibility");
- if (ly_c_number_p (bn) && ly_c_procedure_p (proc)
- && to_boolean (scm_call_1(proc, bn)))
+ if (gh_number_p (bn) && gh_procedure_p (proc)
+ && to_boolean (gh_call1(proc, bn)))
{
create_items ();
// guh.
text_->set_property
- ("text", scm_makfrom0str (to_string (ly_scm2int (bn)).to_str0 ()));
+ ("text", scm_makfrom0str (to_string (gh_scm2int (bn)).to_str0 ()));
}
}
}
if (text_)
{
text_->set_property ("side-support-elements", get_property ("stavesFound"));
-
+ typeset_grob (text_);
text_ =0;
}
}
if (text_)
return;
- text_ = make_item ("BarNumber", SCM_EOL);
+ text_ = make_item ("BarNumber");
Side_position_interface::set_axis (text_,Y_AXIS);
+
+ announce_grob (text_, SCM_EOL);
}
ENTER_DESCRIPTION (Bar_number_engraver,
{
SCM b = get_property ("autoBeaming");
if (!to_boolean (b))
- context ()->set_property ("beamMelismaBusy", ml ? SCM_BOOL_T :SCM_BOOL_F);
+ daddy_context_->set_property ("beamMelismaBusy", ml ? SCM_BOOL_T :SCM_BOOL_F);
}
void
set_melisma (true);
prev_start_ev_ = start_ev_;
- beam_ = make_spanner ("Beam", start_ev_->self_scm ());
+ beam_ = make_spanner ("Beam");
SCM smp = get_property ("measurePosition");
Moment mp = (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0);
beam_info_ = new Beaming_info_list;
/* urg, must copy to Auto_beam_engraver too */
+ announce_grob (beam_, start_ev_->self_scm ());
}
}
{
finished_beam_info_->beamify (beat_length_, subdivide_beams_);
Beam::set_beaming (finished_beam_, finished_beam_info_);
-
+ typeset_grob (finished_beam_);
delete finished_beam_info_;
finished_beam_info_ =0;
finished_beam_ = 0;
bool beam_;
};
-Beam_performer::Beam_performer ()
-{
- beam_ = false;
- start_ev_ = 0;
- now_stop_ev_ = 0;
-}
-
void
Beam_performer::process_music ()
{
{
SCM b = get_property ("autoBeaming");
if (!to_boolean (b))
-context ()->set_property ("beamMelismaBusy", ml ? SCM_BOOL_T :SCM_BOOL_F);
+ daddy_context_->set_property ("beamMelismaBusy", ml ? SCM_BOOL_T :SCM_BOOL_F);
}
void
ENTER_DESCRIPTION (Beam_performer,"","",
"beam-event","","","");
+Beam_performer::Beam_performer ()
+{
+ beam_ = false;
+}
#include "staff-symbol-referencer.hh"
#include "beam.hh"
#include "stem.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "group-interface.hh"
#include "align-interface.hh"
Grob *me = unsmob_grob (smob);
SCM s = me->get_property ("positions");
- Real yl = ly_scm2double (ly_car (s));
- Real yr = ly_scm2double (ly_cdr (s));
+ Real yl = gh_scm2double (gh_car (s));
+ Real yr = gh_scm2double (gh_cdr (s));
/*
Real slt = Staff_symbol_referencer::line_thickness (me) / ss;
SCM sdy = me->get_property ("least-squares-dy");
- Real dy_mus = ly_c_number_p (sdy) ? ly_scm2double (sdy) : 0.0;
+ Real dy_mus = gh_number_p (sdy) ? gh_scm2double (sdy) : 0.0;
Real straddle = 0.0;
Real sit = (thickness - slt) / 2;
#if DEBUG_QUANTING
SCM inspect_quants = me->get_property ("inspect-quants");
if (debug_beam_quanting_flag
- && ly_c_pair_p (inspect_quants))
+ && gh_pair_p (inspect_quants))
{
Drul_array<Real> ins = ly_scm2interval (inspect_quants);
#include "misc.hh"
#include "least-squares.hh"
#include "stem.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "lookup.hh"
#include "group-interface.hh"
#include "staff-symbol-referencer.hh"
{
SCM func = me->get_property ("space-function");
- if (ly_c_procedure_p (func))
+ if (gh_procedure_p (func))
{
- SCM s = scm_call_2 (func, me->self_scm (), scm_int2num (get_beam_count (me)));
- return ly_scm2double (s);
+ SCM s = gh_call2 (func, me->self_scm (), scm_int2num (get_beam_count (me)));
+ return gh_scm2double (s);
}
else
{
Beam::get_beam_count (Grob *me)
{
int m = 0;
- for (SCM s = me->get_property ("stems"); ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = me->get_property ("stems"); gh_pair_p (s); s = ly_cdr (s))
{
Grob *stem = unsmob_grob (ly_car (s));
m = m >? (Stem::beam_multiplicity (stem).length () + 1);
Real line = Staff_symbol_referencer::line_thickness (me);
Real thickness = get_thickness (me);
- Real beam_translation = ly_scm2int (beam_count) < 4
+ Real beam_translation = gh_scm2int (beam_count) < 4
? (2*staff_space + line - thickness) / 2.0
: (3*staff_space + line - thickness) / 3.0;
- return scm_make_real (beam_translation);
+ return gh_double2scm (beam_translation);
}
{
me->warning (_ ("removing beam with less than two stems"));
- unsmob_grob (ly_car (stems))->set_property ("beam", SCM_EOL);
+ unsmob_grob (gh_car (stems))->set_property ("beam", SCM_EOL);
me->suicide ();
return SCM_UNSPECIFIED;
Direction left_dir,
Direction right_dir)
{
- Slice lslice = int_list_to_slice (ly_cdr (left_beaming));
+ Slice lslice = int_list_to_slice (gh_cdr (left_beaming));
int best_count = 0;
int best_start = 0;
(i - lslice[left_dir])* left_dir <= 0 ; i+= left_dir)
{
int count =0;
- for ( SCM s = ly_car (right_beaming); ly_c_pair_p (s); s = ly_cdr (s))
+ for ( SCM s = gh_car (right_beaming); gh_pair_p (s); s = gh_cdr (s))
{
- int k = - right_dir * ly_scm2int (ly_car (s)) + i;
+ int k = - right_dir * gh_scm2int (gh_car (s)) + i;
if (scm_c_memq (scm_int2num (k), left_beaming) != SCM_BOOL_F)
count ++;
}
SCM this_beaming = this_stem->get_property ("beaming");
Direction this_dir = get_grob_direction (this_stem);
- if (ly_c_pair_p (last_beaming) && ly_c_pair_p (this_beaming))
+ if (gh_pair_p (last_beaming) && gh_pair_p (this_beaming))
{
int start_point = position_with_maximal_common_beams
(last_beaming, this_beaming,
new_slice.set_empty ();
SCM s = index_get_cell (this_beaming, d);
- for (; ly_c_pair_p (s); s = ly_cdr (s))
+ for (; gh_pair_p (s); s = gh_cdr (s))
{
int new_beam_pos =
- start_point - this_dir * ly_scm2int (ly_car (s));
+ start_point - this_dir * gh_scm2int (gh_car (s));
new_slice.add_point (new_beam_pos);
- scm_set_car_x (s, scm_int2num (new_beam_pos));
+ gh_set_car_x (s, scm_int2num (new_beam_pos));
}
}
else
{
- scm_set_car_x ( this_beaming, SCM_EOL);
- SCM s = ly_cdr (this_beaming);
- for (; ly_c_pair_p (s); s = ly_cdr (s))
+ gh_set_car_x ( this_beaming, SCM_EOL);
+ SCM s = gh_cdr (this_beaming);
+ for (; gh_pair_p (s); s = gh_cdr (s))
{
- int np = - this_dir * ly_scm2int (ly_car (s));
- scm_set_car_x (s, scm_int2num (np));
+ int np = - this_dir * gh_scm2int (gh_car (s));
+ gh_set_car_x (s, scm_int2num (np));
last_int.add_point (np);
}
}
if (i == stems.size () -1)
{
- scm_set_cdr_x (this_beaming, SCM_EOL);
+ gh_set_cdr_x (this_beaming, SCM_EOL);
}
- if (scm_ilength (ly_cdr (this_beaming)) > 0)
+ if (scm_ilength (gh_cdr (this_beaming)) > 0)
{
last_beaming = this_beaming;
last_dir = this_dir;
else
pos= ly_scm2realdrul (posns);
- scale_drul (&pos, Staff_symbol_referencer::staff_space (me));
+ scale_drul ( &pos, Staff_symbol_referencer::staff_space (me));
Real dy = pos[RIGHT] - pos[LEFT];
Real dydx = (dy && dx) ? dy/dx : 0;
Real last_xposn = -1;
Real last_stem_width = -1 ;
- Real gap_length = robust_scm2double (me->get_property ("gap"), 0.0);
+ Real gap_length =robust_scm2double ( me->get_property ("gap"), 0.0);
Stencil the_beam;
- Real lt = me->get_paper ()->get_dimension (ly_symbol2scm ("linethickness"));
+ Real lt = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness"));
for (int i = 0; i<= stems.size (); i++)
{
right from the left stem, and rfliebertjes pointing left from
right stem.
*/
- SCM left = (i > 0) ? ly_cdr (last_beaming) : SCM_EOL;
- SCM right = st ? ly_car (this_beaming) : SCM_EOL;
+ SCM left = (i>0) ? gh_cdr (last_beaming) : SCM_EOL;
+ SCM right = st ? gh_car (this_beaming) : SCM_EOL;
Array<int> full_beams;
Array<int> lfliebertjes;
Array<int> rfliebertjes;
for (SCM s = left;
- ly_c_pair_p (s); s =ly_cdr (s))
+ gh_pair_p (s); s =gh_cdr (s))
{
- int b = ly_scm2int (ly_car (s));
- if (scm_c_memq (ly_car (s), right) != SCM_BOOL_F)
+ int b = gh_scm2int (gh_car (s));
+ if (scm_c_memq (gh_car (s), right) != SCM_BOOL_F)
{
full_beams.push (b);
}
}
}
for (SCM s = right;
- ly_c_pair_p (s); s =ly_cdr (s))
+ gh_pair_p (s); s =gh_cdr (s))
{
- int b = ly_scm2int (ly_car (s));
- if (scm_c_memq (ly_car (s), left) == SCM_BOOL_F)
+ int b = gh_scm2int (gh_car (s));
+ if (scm_c_memq (gh_car (s), left) == SCM_BOOL_F)
{
rfliebertjes.push (b);
}
w += stem_width/ 2 ;
- Real blot = me->get_paper ()->get_dimension (ly_symbol2scm ("blotdiameter"));
+ Real blot = me->get_paper ()->get_realvar (ly_symbol2scm ("blotdiameter"));
Stencil whole = Lookup::beam (dydx, w, thick, blot);
Stencil gapped;
int gap_count = 0;
- if (ly_c_number_p (me->get_property ("gap-count")))
+ if (gh_number_p (me->get_property ("gap-count")))
{
- gap_count = ly_scm2int (me->get_property ("gap-count"));
+ gap_count = gh_scm2int (me->get_property ("gap-count"));
gapped = Lookup::beam (dydx, w - 2 * gap_length, thick, blot);
full_beams.sort (default_compare);
int t = Stem::duration_log (st);
SCM proc = me->get_property ("flag-width-function");
- SCM result = scm_call_1 (proc, scm_int2num (t));
- nw_f = ly_scm2double (result);
+ SCM result = gh_call1 (proc, scm_int2num (t));
+ nw_f = gh_scm2double (result);
}
else
nw_f = break_overshoot / 2;
#if (DEBUG_QUANTING)
SCM quant_score = me->get_property ("quant-score");
if (debug_beam_quanting_flag
- && ly_c_string_p (quant_score))
+ && gh_string_p (quant_score))
{
/*
Link_array<Grob> stems=
Pointer_group_interface__extract_grobs (me, (Grob*)0, "stems");
- for (int i=0; i < stems.size (); i++)
+ for (int i=0; i <stems.size (); i++)
do {
Grob *s = stems[i];
Direction sd = get_grob_direction (s);
} while (flip (&d) != DOWN);
SCM func = me->get_property ("dir-function");
- SCM s = scm_call_2 (func,
- scm_cons (scm_int2num (count[UP]),
+ SCM s = gh_call2 (func,
+ gh_cons (scm_int2num (count[UP]),
scm_int2num (count[DOWN])),
- scm_cons (scm_int2num (total[UP]),
+ gh_cons (scm_int2num (total[UP]),
scm_int2num (total[DOWN])));
- if (ly_c_number_p (s) && ly_scm2int (s))
+ if (gh_number_p (s) && gh_scm2int (s))
return to_dir (s);
/* If dir is not determined: get default */
Beam::consider_auto_knees (Grob* me)
{
SCM scm = me->get_property ("auto-knee-gap");
- if (!ly_c_number_p (scm))
+ if (!gh_number_p (scm))
return ;
- Real threshold = ly_scm2double (scm);
+ Real threshold = gh_scm2double (scm);
Int_set gaps;
SCM shorten_elt =
robust_list_ref (beam_count -1, shorten_list);
- Real shorten_f = ly_scm2double (shorten_elt) * staff_space;
+ Real shorten_f = gh_scm2double (shorten_elt) * staff_space;
/* your similar cute comment here */
shorten_f *= forced_fraction;
if (shorten_f)
- me->set_property ("shorten", scm_make_real (shorten_f));
+ me->set_property ("shorten", gh_double2scm (shorten_f));
}
/* Call list of y-dy-callbacks, that handle setting of
{
// one wonders if such genericity is necessary --hwn.
SCM callbacks = me->get_property ("position-callbacks");
- for (SCM i = callbacks; ly_c_pair_p (i); i = ly_cdr (i))
- scm_call_1 (ly_car (i), me->self_scm ());
+ for (SCM i = callbacks; gh_pair_p (i); i = ly_cdr (i))
+ gh_call1 (ly_car (i), me->self_scm ());
}
set_stem_lengths (me);
where the second part goes.
*/
me->set_property ("least-squares-dy",
- scm_make_real (pos[RIGHT] - pos[LEFT]));
+ gh_double2scm (pos[RIGHT] - pos[LEFT]));
}
else
{
minimise_least_squares (&dydx, &y, ideals);
dy = dydx * dx;
- me->set_property ("least-squares-dy", scm_make_real (dy));
+ me->set_property ("least-squares-dy", gh_double2scm (dy));
pos = Interval (y, (y+dy));
}
*/
bool is_concave1 = false;
SCM gap = me->get_property ("concaveness-gap");
- if (ly_c_number_p (gap))
+ if (gh_number_p (gap))
{
- Real r1 = ly_scm2double (gap);
+ Real r1 = gh_scm2double (gap);
Real dy = Stem::chord_start_y (stems.top ())
- Stem::chord_start_y (stems[0]);
Real concaveness2 = 0;
SCM thresh = me->get_property ("concaveness-threshold");
Real r2 = infinity_f;
- if (!is_concave1 && ly_c_number_p (thresh))
+ if (!is_concave1 && gh_number_p (thresh))
{
- r2 = ly_scm2double (thresh);
+ r2 = gh_scm2double (thresh);
Interval iv;
iv.add_point (Stem::chord_start_y (stems[0]));
r /= Staff_symbol_referencer::staff_space (me);
me->set_property ("positions", ly_interval2scm (Drul_array<Real> (r, r)));
- me->set_property ("least-squares-dy", scm_make_real (0));
+ me->set_property ("least-squares-dy", gh_double2scm (0));
}
return SCM_UNSPECIFIED;
return SCM_UNSPECIFIED;
SCM s = me->get_property ("damping");
- int damping = ly_scm2int (s);
+ int damping = gh_scm2int (s);
if (damping)
{
{
Slice l;
- for ( SCM s = ly_car (beaming); ly_c_pair_p (s) ; s = ly_cdr (s))
+ for ( SCM s = gh_car (beaming); gh_pair_p (s) ; s = gh_cdr (s))
{
- if (scm_c_memq (ly_car (s), ly_cdr (beaming)) != SCM_BOOL_F)
+ if (scm_c_memq (gh_car (s), gh_cdr (beaming)) != SCM_BOOL_F)
- l.add_point (ly_scm2int (ly_car (s)));
+ l.add_point (gh_scm2int (gh_car (s)));
}
return l;
bool gap = false;
Real thick =0.0;
- if (ly_c_number_p (me->get_property ("gap-count"))
- &&ly_scm2int (me->get_property ("gap-count")))
+ if (gh_number_p (me->get_property ("gap-count"))
+ &&gh_scm2int (me->get_property ("gap-count")))
{
gap = true;
thick = get_thickness (me);
Beam::rest_collision_callback (SCM element_smob, SCM axis)
{
Grob *rest = unsmob_grob (element_smob);
- Axis a = (Axis) ly_scm2int (axis);
+ Axis a = (Axis) gh_scm2int (axis);
- if (ly_c_number_p (rest->get_property ("staff-position")))
- return scm_int2num (0);
+ if (gh_number_p (rest->get_property ("staff-position")))
+ return gh_int2scm (0);
assert (a == Y_AXIS);
Grob *st = unsmob_grob (rest->get_property ("stem"));
Grob *stem = st;
if (!stem)
- return scm_make_real (0.0);
+ return gh_double2scm (0.0);
Grob *beam = unsmob_grob (stem->get_property ("beam"));
if (!beam
|| !Beam::has_interface (beam)
|| !Beam::visible_stem_count (beam))
- return scm_make_real (0.0);
+ return gh_double2scm (0.0);
Drul_array<Real> pos (0, 0);
SCM s = beam->get_property ("positions");
- if (ly_c_pair_p (s) && ly_c_number_p (ly_car (s)))
+ if (gh_pair_p (s) && gh_number_p (ly_car (s)))
pos = ly_scm2interval (s);
Real staff_space = Staff_symbol_referencer::staff_space (rest);
< rad)
shift = ceil (fabs (shift)) *sign (shift);
- return scm_make_real (staff_space * shift);
+ return gh_double2scm (staff_space * shift);
}
bool
Beam::is_knee (Grob* me)
{
SCM k = me->get_property ("knee");
- if (ly_c_boolean_p (k))
- return ly_scm2bool (k);
+ if (gh_boolean_p (k))
+ return gh_scm2bool (k);
bool knee = false;
int d = 0;
- for (SCM s = me->get_property ("stems"); ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = me->get_property ("stems"); gh_pair_p (s); s = ly_cdr (s))
{
Direction dir = get_grob_direction (unsmob_grob (ly_car (s)));
if (d && d != dir)
d = dir;
}
- me->set_property ("knee", ly_bool2scm (knee));
+ me->set_property ("knee", gh_bool2scm (knee));
return knee;
}
do
{
if (splits[d].infos_.size () != 1)
- splits[d].infos_.boundary (-d, 0).beams_i_drul_[-d] = middle_beams;
+ {
+ splits[d].infos_.boundary (-d, 0).beams_i_drul_[-d] = middle_beams;
+ }
}
while (flip (&d) != LEFT);
}
/*
-
-
- ^ x x
- |
-height <indent>
- |
- v x x
-
-
-
For small w, the height should be proportional to w, for w ->
infinity, the height should rise to a limit asymptotically.
* F (x) = 2/pi * atan (pi x/2)
- * F (x) = 1/alpha * x^alpha / (1 + x^alpha)
+ * F (x) 1/alpha * x^alpha / (1 + x^alpha)
* (etc.)
no experiments for determining the best combinations of F, h_inf and
r_0.
-
- The indent is proportional to the height of the slur for small
- slurs. For large slurs, this gives a certain hookiness at the end,
- so we increase the indent.
-
- ind = G(w)
-
- w -> 0, G(w) -> .5 h
-
- w -> inf, G(w) -> 2*h
-
- eg.
-
-
- G(w) = h (w/(w+h_inf) 1.5 + .5 h
-
-
*/
Bezier
{
Bezier curve;
Real height = slur_height (width, h_inf, r_0);
- Real indent = (width/(h_inf+ width)*1.5 + 0.5) * height;
+ Real indent = height;
curve.control_[0] = Offset (0, 0);
curve.control_[1] = Offset (indent, height);
+++ /dev/null
-/*
- book-paper-def.cc -- implement Output_def
-
- source file of the GNU LilyPond music typesetter
-
- (c) 2004 Han-Wen Nienhuys <hanwen@xs4all.nl>
-*/
-
-#include "dimensions.hh"
-#include "font-metric.hh"
-#include "ly-module.hh"
-#include "output-def.hh"
-#include "scaled-font-metric.hh"
-#include "virtual-font-metric.hh"
-
-Real
-output_scale (Output_def *od)
-{
- return ly_scm2double (od->lookup_variable (ly_symbol2scm ("outputscale")));
-}
-
-/* TODO: should add nesting for Output_def here too. */
-Font_metric *
-find_scaled_font (Output_def *mod,
- Font_metric *f, Real m, SCM input_enc_name)
-{
- if (mod->parent_)
- return find_scaled_font (mod->parent_, f, m, input_enc_name);
-
- Real lookup_mag = m;
- if (!dynamic_cast<Virtual_font_metric*> (f))
- lookup_mag /= output_scale (mod);
-
- SCM font_table = mod->lookup_variable (ly_symbol2scm ("scaled-fonts"));
- if (scm_hash_table_p (font_table) != SCM_BOOL_T)
- {
- font_table = scm_c_make_hash_table (11);
- mod->set_variable (ly_symbol2scm ("scaled-fonts"), font_table);
- }
-
-
- SCM sizes = scm_hashq_ref (font_table, f->self_scm (), SCM_BOOL_F);
- if (sizes != SCM_BOOL_F)
- {
- SCM met = scm_assoc (scm_make_real (lookup_mag), sizes);
- if (ly_c_pair_p (met))
- return unsmob_metrics (ly_cdr (met));
- }
- else
- sizes = SCM_EOL;
-
- /* Hmm. We're chaining font - metrics. Should consider whether to
- merge virtual-font and scaled_font. */
- SCM val = SCM_EOL;
- if (Virtual_font_metric * vf = dynamic_cast<Virtual_font_metric*> (f))
- {
- /* For fontify_atom (), the magnification and name must be known
- at the same time. That's impossible for
-
- Scaled (Virtual_font (Font1,Font2))
-
- so we replace by
-
- Virtual_font (Scaled (Font1), Scaled (Font2)) */
- SCM lst = SCM_EOL;
- SCM *t = &lst;
- for (SCM s = vf->get_font_list (); ly_c_pair_p (s); s = ly_cdr (s))
- {
- Font_metric *scaled = find_scaled_font (mod,
- unsmob_metrics (ly_car (s)),
- m, input_enc_name);
- *t = scm_cons (scaled->self_scm (), SCM_EOL);
- t = SCM_CDRLOC (*t);
- }
-
- vf = new Virtual_font_metric (lst);
- val = vf->self_scm ();
- }
- else
- {
- if (!ly_c_symbol_p (input_enc_name))
- {
- SCM var = ly_module_lookup (mod->scope_,
- ly_symbol2scm ("inputencoding"));
- if (var != SCM_BOOL_F)
- input_enc_name = scm_variable_ref (var);
- if (!ly_c_symbol_p (input_enc_name))
- input_enc_name = ly_symbol2scm ("latin1");
- }
-
- val = Modified_font_metric::make_scaled_font_metric (input_enc_name,
- f, lookup_mag);
- }
-
- sizes = scm_acons (scm_make_real (lookup_mag), val, sizes);
- scm_gc_unprotect_object (val);
- scm_hashq_set_x (font_table, f->self_scm (), sizes);
- return unsmob_metrics (val);
-}
-
-/* TODO: this is a nasty interface. During formatting,
- the Output_def should be scaled to the output_scale_
- specified in the toplevel Output_def. */
-Output_def *
-scale_output_def (Output_def *o, Real amount)
-{
- SCM proc = ly_scheme_function ("scale-paper");
- SCM new_pap = scm_call_2 (proc, o->self_scm (), scm_double2num (amount));
- scm_gc_protect_object (new_pap);
-
- return unsmob_output_def (new_pap);
-}
-
-LY_DEFINE (ly_bookpaper_fonts, "ly:bookpaper-fonts",
- 1, 0, 0,
- (SCM bp),
- "Return fonts scaled up BP")
-{
- Output_def *b = unsmob_output_def (bp);
-
- SCM font_table = b->lookup_variable (ly_symbol2scm ("scaled-fonts"));
-
- SCM_ASSERT_TYPE (b, bp, SCM_ARG1, __FUNCTION__, "bookpaper");
-
- SCM ell = SCM_EOL;
- if (scm_hash_table_p (font_table) == SCM_BOOL_T)
- {
- SCM func = ly_scheme_function ("hash-table->alist");
-
- for (SCM s = scm_call_1 (func, font_table); ly_c_pair_p (s);
- s = ly_cdr (s))
- {
- SCM entry = ly_car (s);
- for (SCM t = ly_cdr (entry); ly_c_pair_p (t); t = ly_cdr (t))
- {
- Font_metric *fm = unsmob_metrics (ly_cdar (t));
-
- if (dynamic_cast<Modified_font_metric*> (fm))
- ell = scm_cons (fm->self_scm (), ell);
- }
- }
- }
- return ell;
-}
+++ /dev/null
-/*
- book.cc -- implement Book
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#include <stdio.h>
-
-#include "book.hh"
-#include "global-context.hh"
-#include "ly-module.hh"
-#include "main.hh"
-#include "music-iterator.hh"
-#include "music-output.hh"
-#include "music.hh"
-#include "output-def.hh"
-#include "paper-book.hh"
-#include "score.hh"
-#include "stencil.hh"
-#include "warn.hh"
-
-#include "ly-smobs.icc"
-
-Book::Book ()
- : Input ()
-{
- bookpaper_ = 0;
- header_ = SCM_EOL;
- assert (!scores_.size ());
- smobify_self ();
-}
-
-Book::~Book ()
-{
-}
-
-IMPLEMENT_SMOBS (Book);
-IMPLEMENT_DEFAULT_EQUAL_P (Book);
-
-SCM
-Book::mark_smob (SCM s)
-{
- Book *book = (Book*) SCM_CELL_WORD_1 (s);
- int score_count = book->scores_.size ();
- for (int i = 0; i < score_count; i++)
- scm_gc_mark (book->scores_[i]->self_scm ());
-
- if (book->bookpaper_)
- scm_gc_mark (book->bookpaper_->self_scm ());
- return book->header_;
-}
-
-int
-Book::print_smob (SCM, SCM p, scm_print_state*)
-{
- scm_puts ("#<Book>", p);
- return 1;
-}
-
-/* This function does not dump the output; outname is required eg. for
- dumping header fields. */
-Paper_book *
-Book::process (String outname, Output_def *default_def)
-{
- Paper_book *paper_book = new Paper_book ();
- Real scale = ly_scm2double (bookpaper_->c_variable ("outputscale"));
-
- Output_def * scaled_bookdef = scale_output_def (bookpaper_, scale);
-
- paper_book->bookpaper_ = scaled_bookdef;
- scm_gc_unprotect_object (scaled_bookdef->self_scm());
-
- paper_book->header_ = header_;
-
- int score_count = scores_.size ();
- for (int i = 0; i < score_count; i++)
- {
- SCM systems = scores_[i]->book_rendering (outname,
- paper_book->bookpaper_,
- default_def);
-
- /* If the score is empty, generate no output. Should we
- do titling? */
- if (SCM_NFALSEP(scm_vector_p (systems)))
- {
- Score_lines sc;
- sc.lines_ = systems;
- sc.header_ = header_;
- paper_book->score_lines_.push (sc);
- }
- }
-
- return paper_book;
-}
-
#include "box.hh"
#include "array.hh"
-#include "axes.hh"
void
Box::translate (Offset o)
#include "paper-column.hh"
#include "break-algorithm.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "system.hh"
#include "paper-score.hh"
#include "paper-column.hh"
/*
this is hardcoded, but this shouldn't happen anyway.
- used to be get_dimension (ly_symbol2scm ("loose_column_distance"));
+ used to be get_realvar (ly_symbol2scm ("loose_column_distance"));
*/
sp->default_space_ = 1.0;
Break_algorithm::set_pscore (Paper_score*s)
{
pscore_ = s;
- linewidth_ = s->paper_->get_dimension (ly_symbol2scm ("linewidth"));
+ linewidth_ = s->paper_->get_realvar (ly_symbol2scm ("linewidth"));
}
Array<Column_x_positions>
#include "item.hh"
#include "align-interface.hh"
#include "axis-group-interface.hh"
-#include "context.hh"
-#include "translator-group.hh"
+
class Break_align_engraver : public Engraver
{
{
Grob * e = unsmob_grob (smob);
Break_align_interface::add_element (align_,e);
-
+ typeset_grob (e);
}
void
void
Break_align_engraver::stop_translation_timestep ()
{
- for (SCM p = column_alist_; ly_c_pair_p (p); p = ly_cdr (p))
+ for (SCM p = column_alist_; gh_pair_p (p); p = ly_cdr (p))
{
SCM pair = ly_car (p);
add_column (ly_cdr (pair));
}
column_alist_ = SCM_EOL;
- align_ = 0;
- left_edge_ = 0;
+ if (align_)
+ {
+ typeset_grob (align_);
+ align_ = 0;
+ }
+ if (left_edge_)
+ {
+ typeset_grob (left_edge_);
+ left_edge_ = 0;
+ }
}
return ;
SCM align_name = item->get_property ("break-align-symbol");
- if (!ly_c_symbol_p (align_name))
+ if (!gh_symbol_p (align_name))
return ;
if (!align_)
{
- align_ = make_item ("BreakAlignment", SCM_EOL);
+ align_ = make_item ("BreakAlignment");
-
+ announce_grob (align_, SCM_EOL);
- Context*origin = inf.origin_contexts (this)[0];
- left_edge_ = make_item_from_properties (origin->implementation (),
- ly_symbol2scm ("LeftEdge"),
- SCM_EOL
- );
- add_to_group (left_edge_->get_property ("break-align-symbol"),
- left_edge_);
+ left_edge_ = make_item ("LeftEdge");
+ add_to_group (left_edge_->get_property ("break-align-symbol"), left_edge_);
+ announce_grob (left_edge_, SCM_EOL);
}
add_to_group (align_name, item);
}
else
{
- group = make_item ("BreakAlignGroup", item->self_scm () );
+ group = make_item ("BreakAlignGroup");
group->set_property ("break-align-symbol", align_name);
group->set_parent (align_, Y_AXIS);
+ announce_grob (group, item->self_scm ());
column_alist_ = scm_assoc_set_x (column_alist_, align_name, group->self_scm ());
}
ENTER_DESCRIPTION (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}. "
- ,
- /* creats*/ "BreakAlignment BreakAlignGroup LeftEdge",
- /* accepts */ "",
- /* acks */ "break-aligned-interface",
- /* reads */ "",
- /* write */ "");
+/* descr */ "Align grobs with corresponding break-align-symbols into groups, and order the groups according to breakAlignOrder",
+/* creats*/ "BreakAlignment BreakAlignGroup LeftEdge",
+/* accepts */ "",
+/* acks */ "break-aligned-interface"
+,/* reads */ "",
+/* write */ "");
#include "lily-guile.hh"
#include "break-align-interface.hh"
#include "dimensions.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "paper-column.hh"
#include "group-interface.hh"
#include "align-interface.hh"
Break_align_interface::alignment_callback (SCM element_smob, SCM axis)
{
Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) ly_scm2int (axis);
+ Axis a = (Axis) gh_scm2int (axis);
assert (a == X_AXIS);
Grob *par = me->get_parent (a);
Break_align_interface::do_alignment (par);
}
- return scm_make_real (0);
+ return gh_double2scm (0);
}
MAKE_SCHEME_CALLBACK (Break_align_interface,self_align_callback,2);
Break_align_interface::self_align_callback (SCM element_smob, SCM axis)
{
Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) ly_scm2int (axis);
+ Axis a = (Axis) gh_scm2int (axis);
assert (a == X_AXIS);
Item* item = dynamic_cast<Item*> (me);
Item *me = dynamic_cast<Item*> (grob);
SCM elts = me->get_property ("elements");
SCM order_vec = me->get_property ("break-align-orders");
- if (!ly_c_vector_p (order_vec)
- || ly_vector_length (order_vec) < 3)
+ if (!gh_vector_p (order_vec)
+ || gh_vector_length (order_vec) < 3)
return Pointer_group_interface__extract_grobs (me, (Grob*)0,
"elements");
SCM order = scm_vector_ref (order_vec,
- scm_int2num (me->break_status_dir() + 1));
+ gh_int2scm (me->break_status_dir() + 1));
/*
Copy in order specified in BREAK-ALIGN-ORDER.
*/
Link_array<Grob> new_elts;
- for (; ly_c_pair_p (order); order = ly_cdr (order))
+ for (; gh_pair_p (order); order = ly_cdr (order))
{
- SCM sym = ly_car (order);
+ SCM sym = gh_car (order);
- for (SCM s =elts; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s =elts; gh_pair_p (s); s = gh_cdr (s))
{
- Grob *g = unsmob_grob (ly_car (s));
+ Grob *g = unsmob_grob (gh_car (s));
if (g && sym == g->get_property ("break-align-symbol"))
{
new_elts.push (g);
/*
Find the first grob with a space-alist entry.
*/
- for (SCM s = l->get_property ("elements");
- ly_c_pair_p (s) ; s = ly_cdr (s))
+ for (SCM s= l->get_property ("elements");
+ gh_pair_p (s) ; s = gh_cdr (s))
{
- Grob *elt = unsmob_grob (ly_car (s));
+ Grob *elt = unsmob_grob (gh_car (s));
if (edge_idx < 0
&& elt->get_property ("break-align-symbol")
edge_idx = idx;
SCM l =elt->get_property ("space-alist");
- if (ly_c_pair_p (l))
+ if (gh_pair_p (l))
{
alist= l;
break;
reason.
*/
for (SCM s = r ? r->get_property ("elements") : SCM_EOL;
- !ly_c_symbol_p (rsym) && ly_c_pair_p (s); s = ly_cdr (s))
+ !gh_symbol_p (rsym) && gh_pair_p (s); s = gh_cdr (s))
{
- Grob * elt =unsmob_grob (ly_car (s));
+ Grob * elt =unsmob_grob (gh_car (s));
rsym = elt->get_property ("break-align-symbol");
}
edge_idx = next_idx;
SCM entry = SCM_EOL;
- if (ly_c_symbol_p (rsym))
+ if (gh_symbol_p (rsym))
entry = scm_assq (rsym, alist);
- bool entry_found = ly_c_pair_p (entry);
+ bool entry_found = gh_pair_p (entry);
if (!entry_found)
{
String sym_string;
- if (ly_c_symbol_p (rsym))
+ if (gh_symbol_p (rsym))
sym_string = ly_symbol2string (rsym);
String orig_string ;
if (entry_found)
{
- entry = ly_cdr (entry);
+ entry = gh_cdr (entry);
- distance = ly_scm2double (ly_cdr (entry));
- type = ly_car (entry) ;
+ distance = gh_scm2double (gh_cdr (entry));
+ type = gh_car (entry) ;
}
if (r)
if (unsmob_grob (src))
return substitute_grob (unsmob_grob (src));
- else if (ly_c_vector_p (src))
+ else if (gh_vector_p (src))
{
int len = SCM_VECTOR_LENGTH (src);
SCM nv = scm_c_make_vector (len, SCM_UNDEFINED);
do_break_substitution (scm_vector_ref (src, si)));
}
}
- else if (ly_c_pair_p (src))
+ else if (ly_pair_p (src))
{
/*
UGH! breaks on circular lists.
SCM oldcdr = ly_cdr (src);
if (newcar == SCM_UNDEFINED
- && (ly_c_pair_p (oldcdr) || oldcdr == SCM_EOL))
+ && (gh_pair_p (oldcdr) || oldcdr == SCM_EOL))
{
/*
This is tail-recursion, ie.
SCM l = SCM_EOL;
SCM * tail = &l;
- for (SCM s = grob_list; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = grob_list; gh_pair_p (s); s = gh_cdr (s))
{
- SCM n= substitute_grob (unsmob_grob (ly_car (s)));
+ SCM n= substitute_grob (unsmob_grob (gh_car (s)));
if (n != SCM_UNDEFINED)
{
- *tail = scm_cons (n, SCM_EOL);
+ *tail = gh_cons (n, SCM_EOL);
tail = SCM_CDRLOC (*tail);
}
}
int sp_index = len;
int it_index = 0;
- for (SCM s = grob_list; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = grob_list; gh_pair_p (s); s = gh_cdr (s))
{
- Grob * g = unsmob_grob (ly_car (s));
+ Grob * g = unsmob_grob (gh_car (s));
Slice sr = grob_system_range (g);
sr.intersect (system_range);
SCM l = SCM_EOL;
SCM *tail = &l;
- for (SCM s = alist; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = alist; gh_pair_p (s); s = gh_cdr (s))
{
- SCM sym = ly_caar (s);
- SCM val = ly_cdar (s);
+ SCM sym = gh_caar (s);
+ SCM val = gh_cdar (s);
SCM type = scm_object_property (sym, ly_symbol2scm ("backend-type?"));
if (type == grob_list_p)
else
val = do_break_substitution (val);
- *tail = scm_cons (scm_cons (sym, val), SCM_EOL);
+ *tail = gh_cons (gh_cons (sym, val), SCM_EOL);
tail = SCM_CDRLOC (*tail);
}
{
if (breathing_sign_req_ && ! breathing_sign_)
{
- breathing_sign_ = make_item ("BreathingSign", breathing_sign_req_->self_scm ());
+ breathing_sign_ = make_item ("BreathingSign");
+
+ announce_grob (breathing_sign_, breathing_sign_req_->self_scm ());
breathing_sign_req_ = 0;
}
}
void
Breathing_sign_engraver::stop_translation_timestep ()
{
- breathing_sign_ = 0;
+ if (breathing_sign_)
+ {
+ typeset_grob (breathing_sign_);
+ breathing_sign_ = 0;
+ }
breathing_sign_req_ = 0;
}
#include "breathing-sign.hh"
#include "string.hh"
#include "stencil.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "lookup.hh"
#include "dimensions.hh"
else
staff_size = 0.0;
- Real blotdiameter = me->get_paper ()->get_dimension (ly_symbol2scm ("blotdiameter"));
+ Real blotdiameter = me->get_paper ()->get_realvar (ly_symbol2scm ("blotdiameter"));
/*
* Draw a small vertical line through the uppermost (or, depending
else
staff_size = 0.0;
- Real blotdiameter = me->get_paper ()->get_dimension (ly_symbol2scm ("blotdiameter"));
+ Real blotdiameter = me->get_paper ()->get_realvar (ly_symbol2scm ("blotdiameter"));
/*
* Draw a vertical line that is vertically centered in the staff
else
staff_size = 0.0;
- Real blotdiameter = me->get_paper ()->get_dimension (ly_symbol2scm ("blotdiameter"));
+ Real blotdiameter = me->get_paper ()->get_realvar (ly_symbol2scm ("blotdiameter"));
// like a "|" type bar
Interval xdim (0, thickness);
else
staff_size = 0.0;
- Real blotdiameter = me->get_paper ()->get_dimension (ly_symbol2scm ("blotdiameter"));
+ Real blotdiameter = me->get_paper ()->get_realvar (ly_symbol2scm ("blotdiameter"));
// like a "||" type bar
Interval xdim (0, thickness);
Real inter_f = Staff_symbol_referencer::staff_space (me)/2;
int sz = Staff_symbol_referencer::line_count (me)-1;
- return scm_make_real (inter_f * sz * d);
+ return gh_double2scm (inter_f * sz * d);
}
ADD_INTERFACE (Breathing_sign, "breathing-sign-interface",
*/
String warn2= "Change_iterator::process (): "
+ get_outlet ()->context_name () + " = `"
- + get_outlet ()->id_string () + "': ";
+ + get_outlet ()->id_string_ + "': ";
warning (warn2);
get_music ()->origin ()->warning (warn1);
}
while (current && !current->is_alias (to_type))
{
last = current;
- current = current->get_parent_context ();
+ current = current->daddy_context_;
}
- if (current && current->id_string () == to_id)
+ if (current && current->id_string_ == to_id)
{
String msg;
msg += _ ("Can't switch translators, I'm there already");
Context * where = get_outlet ();
while (!dest && where)
{
- dest = find_context_below (where, to_type, to_id);
- where = where->get_parent_context ();
+ dest = where->find_context_below (to_type, to_id);
+ where = where->daddy_context_;
}
if (dest)
We could change the current translator's id, but that would make
errors hard to catch
- last->translator_id_string () = get_change ()->change_to_id_string ();
+ last->translator_id_string_ = get_change ()->change_to_id_string_;
*/
error (_ ("I'm one myself"));
}
#include "engraver.hh"
#include "chord-name.hh"
#include "event.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "font-interface.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "dimensions.hh"
#include "item.hh"
#include "pitch.hh"
else if (n->get_property ("bass") == SCM_BOOL_T)
bass = p;
else
- pitches = scm_cons (p, pitches);
+ pitches = gh_cons (p, pitches);
}
if (inversion_event)
{
SCM oct = inversion_event->get_property ("octavation");
- if (ly_c_number_p (oct))
+ if (gh_number_p (oct))
{
Pitch *p = unsmob_pitch (inversion_event->get_property ("pitch"));
- int octavation = ly_scm2int (oct);
+ int octavation = gh_scm2int (oct);
Pitch orig = p->transposed (Pitch (-octavation, 0,0));
- pitches= scm_cons (orig.smobbed_copy (), pitches);
+ pitches= gh_cons (orig.smobbed_copy (), pitches);
}
else
programming_error ("Inversion does not have original pitch.");
SCM name_proc = get_property ("chordNameFunction");
SCM markup = scm_call_4 (name_proc, pitches, bass, inversion,
- context ()->self_scm ());
+ daddy_context_->self_scm ());
/*
Ugh.
*/
- SCM chord_as_scm = scm_cons (pitches, scm_cons (bass, inversion));
+ SCM chord_as_scm = gh_cons (pitches, gh_cons (bass, inversion));
- chord_name_ = make_item ("ChordName",notes_[0]->self_scm ());
+ chord_name_ = make_item ("ChordName");
chord_name_->set_property ("text", markup);
-
+ announce_grob (chord_name_, notes_[0]->self_scm ());
SCM s = get_property ("chordChanges");
- if (to_boolean (s) && ly_c_pair_p (last_chord_)
- && ly_c_equal_p (chord_as_scm, last_chord_))
+ if (to_boolean (s) && gh_pair_p (last_chord_)
+ && gh_equal_p (chord_as_scm, last_chord_))
chord_name_->set_property ("begin-of-line-visible", SCM_BOOL_T);
last_chord_ = chord_as_scm;
void
Chord_name_engraver::stop_translation_timestep ()
{
+ if (chord_name_)
+ {
+ typeset_grob (chord_name_);
+ }
chord_name_ = 0;
notes_.clear ();
}
#include "chord-name.hh"
#include "stencil.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "font-interface.hh"
#include "grob.hh"
#include "paper-column.hh"
/*
- new-chord-tremolo-engraver.cc -- implement Chord_tremolo_engraver
+ new-chord-tremolo-engraver.cc -- implement Chord_tremolo_engraver
- source file of the GNU LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
- (c) 2000--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 2000--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
+ */
#include "engraver.hh"
#include "beam.hh"
/**
-This acknowledges repeated music with "tremolo" style. It typesets
-a beam.
+ This acknowledges repeated music with "tremolo" style. It typesets
+ a beam.
-TODO:
+ TODO:
-- perhaps use engraver this to steer other engravers? That would
-create dependencies between engravers, which is bad.
+ - perhaps use engraver this to steer other engravers? That would
+ create dependencies between engravers, which is bad.
-- create dots if appropriate.
+ - create dots if appropriate.
-- create TremoloBeam iso Beam?
+ - create TremoloBeam iso Beam?
*/
class Chord_tremolo_engraver : public Engraver
Chord_tremolo_engraver::process_music ()
{
if (repeat_ && sequential_body_b_ && !beam_)
- {
- beam_ = make_spanner ("Beam", repeat_->self_scm ());
- beam_->set_property ("chord-tremolo", SCM_BOOL_T);
-
- SCM smp = get_property ("measurePosition");
- Moment mp
- = (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0);
- beam_start_location_ = mp;
- }
+ {
+ beam_ = make_spanner ("Beam");
+ beam_->set_property ("chord-tremolo", SCM_BOOL_T);
+
+ SCM smp = get_property ("measurePosition");
+ Moment mp
+ = (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0);
+ beam_start_location_ = mp;
+ announce_grob (beam_, repeat_->self_scm ());
+ }
}
void
void
Chord_tremolo_engraver::typeset_beam ()
{
- finished_beam_ = 0;
+ if (finished_beam_)
+ {
+ typeset_grob (finished_beam_);
+ finished_beam_ = 0;
+ }
}
void
if (Stem::duration_log (s) != 1)
{
- beam_->set_property ("gap-count", scm_int2num (flags_ - total_duration_flags_));
+ beam_->set_property ("gap-count", gh_int2scm (flags_ - total_duration_flags_));
}
if (info.music_cause ()->is_mus_type ("rhythmic-event"))
else if (repeat_ &&
flags_ && !sequential_body_b_ && Stem::has_interface (info.grob_))
{
- stem_tremolo_ = make_item ("StemTremolo", repeat_->self_scm ());
+ stem_tremolo_ = make_item ("StemTremolo");
+ announce_grob (stem_tremolo_, repeat_->self_scm ());
stem_tremolo_->set_property ("flag-count",
scm_int2num (flags_));
stem_tremolo_->set_property ("stem",
void
Chord_tremolo_engraver::stop_translation_timestep ()
{
+ typeset_beam ();
+
if (stem_tremolo_)
{
- repeat_ = 0;
- if (beam_)
- programming_error ("Huh, beam and stem tremolo?");
+ typeset_grob (stem_tremolo_);
stem_tremolo_ = 0;
+ repeat_ = 0;
}
-
- typeset_beam ();
}
SCM basic = ly_symbol2scm ("Clef");
- execute_pushpop_property (context (), basic, glyph_sym, SCM_UNDEFINED);
- execute_pushpop_property (context (), basic, glyph_sym, glyph);
+ execute_pushpop_property (daddy_context_, basic, glyph_sym, SCM_UNDEFINED);
+ execute_pushpop_property (daddy_context_, basic, glyph_sym, glyph);
}
/**
if (item)
{
if (Bar_line::has_interface (info.grob_)
- && ly_c_string_p (get_property ("clefGlyph")))
+ && gh_string_p (get_property ("clefGlyph")))
create_clef ();
}
}
{
if (!clef_)
{
- Item *c = make_item ("Clef", SCM_EOL);
-
+ Item *c= make_item ("Clef");
+ announce_grob (c, SCM_EOL);
clef_ = c;
SCM cpos = get_property ("clefPosition");
- if (ly_c_number_p (cpos))
- clef_->set_property ("staff-position", cpos);
+ if (gh_number_p (cpos))
+ Staff_symbol_referencer::set_position (clef_, gh_scm2int (cpos));
SCM oct = get_property ("clefOctavation");
- if (ly_c_number_p (oct) && ly_scm2int (oct))
+ if (gh_number_p (oct) && gh_scm2int (oct))
{
- Item * g = make_item ("OctavateEight", SCM_EOL);
+ Item * g = make_item ("OctavateEight");
- int abs_oct = ly_scm2int (oct) ;
+ int abs_oct = gh_scm2int (oct) ;
int dir = sign (abs_oct);
abs_oct = abs (abs_oct) + 1;
- SCM txt = scm_number_to_string (scm_int2num (abs_oct),
+ SCM txt = scm_number_to_string (gh_int2scm (abs_oct),
SCM_MAKINUM (10));
g->set_property ("text",
g->set_parent (clef_, X_AXIS);
g->set_property ("direction", scm_int2num (dir));
octavate_ = g;
-
+ announce_grob (octavate_, SCM_EOL);
}
}
}
if (to_boolean (force_clef))
{
- Context * w = context ()->where_defined (ly_symbol2scm ("forceClef"));
+ Context * w = daddy_context_->where_defined (ly_symbol2scm ("forceClef"));
w->set_property ("forceClef", SCM_EOL);
}
}
}
}
+ typeset_grob (clef_);
clef_ =0;
+ if (octavate_)
+ {
+ typeset_grob (octavate_);
+ }
+
octavate_ = 0;
}
}
SCM glyph = s->get_property ("glyph-name");
- if (ly_c_string_p (glyph))
+ if (gh_string_p (glyph))
{
String str = ly_scm2string (glyph);
{
Grob *me = unsmob_grob (smob);
SCM glyph_scm = me->get_property ("glyph-name");
- if (!ly_c_string_p (glyph_scm))
+ if (!gh_string_p (glyph_scm))
return SCM_EOL;
String glyph = String (ly_scm2string (glyph_scm));
void
Cluster_spanner_engraver::typeset_grobs ()
{
- finished_spanner_ = 0;
- beacon_ = 0;
+ if (finished_spanner_ )
+ {
+ typeset_grob (finished_spanner_);
+ finished_spanner_ = 0;
+ }
+
+ if (beacon_)
+ {
+ typeset_grob (beacon_);
+ beacon_ = 0;
+ }
}
bool
{
SCM c0scm = get_property ("middleCPosition");
- int c0 = ly_c_number_p (c0scm) ? ly_scm2int (c0scm) : 0;
+ int c0 = gh_number_p (c0scm) ? gh_scm2int (c0scm) : 0;
int pmax = INT_MIN;
int pmin = INT_MAX;
pmin = pmin <? p;
}
- beacon_ = make_item ("ClusterSpannerBeacon", cluster_notes_[0]->self_scm ());
+ beacon_ = make_item ("ClusterSpannerBeacon");
beacon_->set_property ("positions",
- scm_cons (scm_int2num (pmin),
- scm_int2num (pmax)));
+ scm_cons (gh_int2scm (pmin),
+ gh_int2scm (pmax)));
+ announce_grob (beacon_, cluster_notes_[0]->self_scm ());
}
if (beacon_ && !spanner_)
{
- spanner_ = make_spanner ("ClusterSpanner", cluster_notes_[0]->self_scm () );
+ spanner_ = make_spanner ("ClusterSpanner");
+ announce_grob (spanner_, cluster_notes_[0]->self_scm ());
}
if (beacon_ && spanner_)
#include "lookup.hh"
#include "box.hh"
#include "interval.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "warn.hh"
SCM shape_scm = me->get_property ("style");
String shape;
- if (ly_c_symbol_p (shape_scm))
+ if (gh_symbol_p (shape_scm))
{
shape = ly_symbol2string (shape_scm);
}
}
- Stencil out;
+ Stencil out = Stencil ();
Array<Offset> points;
points.clear ();
int size = bottom_points.size ();
Grob *commonx = left_bound->common_refpoint (right_bound, X_AXIS);
SCM cols =me->get_property ("columns");
- if (!ly_c_pair_p (cols))
+ if (!gh_pair_p (cols))
{
me->warning ("junking empty cluster");
me->suicide ();
line with the center of the note heads?
*/
- for (SCM s = cols; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = cols; gh_pair_p (s); s = ly_cdr (s))
{
Grob * col = unsmob_grob (ly_car (s));
Interval yext = col->extent (commony, Y_AXIS);
{
Spanner * next = orig->broken_intos_[spanner->get_break_index () + 1];
SCM cols = next->get_property ("columns");
- if (ly_c_pair_p (cols))
+ if (gh_pair_p (cols))
{
Grob *next_commony = common_refpoint_of_list (cols, next, Y_AXIS);
Grob * col = unsmob_grob (ly_car (scm_last_pair (cols)));
Real distance;
if (incr_scm != SCM_EOL)
{
- distance = ly_scm2double (incr_scm);
+ distance = gh_scm2double (incr_scm);
}
else
{
// also for all associated grobs (NoteSpacing, SeparationItem).
Grob *sl = Staff_symbol_referencer::get_staff_symbol (item);
for (SCM tail = parent->get_property ("elements");
- ly_c_pair_p (tail);
+ gh_pair_p (tail);
tail = ly_cdr (tail))
{
Item *sibling = unsmob_item (ly_car (tail));
"setting `spacing-increment = "
"0.01': ptr=%ul", parent));
sibling_parent->set_property ("forced-spacing",
- scm_make_real (0.01));
+ gh_double2scm (0.01));
#endif
sibling->set_parent (column, X_AXIS);
}
{
delta_pitch = pitch - prev_pitch;
prev_primitive->set_property ("delta-pitch",
- scm_int2num (delta_pitch));
+ gh_int2scm (delta_pitch));
}
prev_pitch = pitch;
prev_primitive = primitive;
}
- primitive->set_property ("delta-pitch", scm_int2num (0));
+ primitive->set_property ("delta-pitch", gh_int2scm (0));
}
void
// prepare ligature for typesetting
build_ligature (ligature, primitives);
collect_accidentals (ligature, primitives);
+
+ // now actually typeset
+ for (int i = 0; i < primitives.size (); i++)
+ {
+ typeset_grob (primitives[i].grob_);
+ }
}
ENTER_DESCRIPTION (Coherent_ligature_engraver,
return ;
if (!col_)
{
- col_ = make_item ("NoteCollision", SCM_EOL);
-
+ col_ = make_item ("NoteCollision");
+ announce_grob (col_, SCM_EOL);
}
for (int i=0; i< note_columns_.size (); i++)
void
Collision_engraver::stop_translation_timestep ()
{
- col_ =0;
+ if (col_)
+ {
+ typeset_grob (col_);
+ col_ =0;
+ }
note_columns_.clear ();
}
#include <ctype.h>
#include "rhythmic-head.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "event.hh"
#include "dots.hh"
#include "dot-column.hh"
for (int i = 0;
left_to_do_ && i < note_reqs_.size (); i++)
{
+ Item *note = make_item ("NoteHead");
Music * req = note_reqs_[i];
- Item *note = make_item ("NoteHead", req->self_scm ());
if (scratch_note_reqs_.size ())
{
req = scratch_note_reqs_[i];
req->set_property ("duration", note_dur.smobbed_copy ());
note->set_property ("duration-log",
- scm_int2num (note_dur.duration_log ()));
+ gh_int2scm (note_dur.duration_log ()));
int dots= note_dur.dot_count ();
if (dots)
{
- Item * d = make_item ("Dots", SCM_EOL);
+ Item * d = make_item ("Dots");
Rhythmic_head::set_dots (note, d);
/*
measly attempt to save an eeny-weenie bit of memory.
*/
- if (dots != ly_scm2int (d->get_property ("dot-count")))
- d->set_property ("dot-count", scm_int2num (dots));
+ if (dots != gh_scm2int (d->get_property ("dot-count")))
+ d->set_property ("dot-count", gh_int2scm (dots));
d->set_parent (note, Y_AXIS);
+ announce_grob (d, SCM_EOL);
dots_.push (d);
}
int pos = pit->steps ();
SCM c0 = get_property ("middleCPosition");
- if (ly_c_number_p (c0))
- pos += ly_scm2int (c0);
+ if (gh_number_p (c0))
+ pos += gh_scm2int (c0);
- note->set_property ("staff-position", scm_int2num (pos));
+ note->set_property ("staff-position", gh_int2scm (pos));
+ announce_grob (note,req->self_scm ());
notes_.push (note);
}
{
for (int i= 0; i < notes_.size (); i++)
{
- Grob * p = make_spanner ("Tie", SCM_EOL);
+ Grob * p = make_spanner ("Tie");
Tie::set_interface (p); // cannot remove yet!
Tie::set_head (p, LEFT, prev_notes_[i]);
Tie::set_head (p, RIGHT, notes_[i]);
ties_.push (p);
-
+ announce_grob (p, SCM_EOL);
}
}
void
Completion_heads_engraver::stop_translation_timestep ()
{
+ for (int i = ties_.size (); i--;)
+ typeset_grob (ties_[i]);
ties_.clear ();
+ for (int i=0; i < notes_.size (); i++)
+ {
+ typeset_grob (notes_[i]);
+ }
if (notes_.size ())
prev_notes_ = notes_;
notes_.clear ();
+ for (int i=0; i < dots_.size (); i++)
+ {
+ typeset_grob (dots_[i]);
+ }
dots_.clear ();
for (int i = scratch_note_reqs_.size (); i--;)
/*
translator-def.cc -- implement Context_def
-
+
source file of the GNU LilyPond music typesetter
-
+
(c) 2000--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
+
+ */
-/* TODO: should junk this class an replace by
- a single list of context modifications? */
+/*
+ TODO: should junk this class an replace by
+ a single list of context modifications?
+ */
-#include "context-def.hh"
-#include "engraver.hh"
#include "lily-proto.hh"
-#include "output-def.hh"
-#include "performer.hh"
-#include "score-context.hh"
+#include "context-def.hh"
#include "translator-group.hh"
#include "warn.hh"
+#include "music-output-def.hh"
+#include "ly-smobs.icc"
+#include "score-context.hh"
+
+#include "performer.hh"
+#include "engraver.hh"
+
+int
+Context_def::print_smob (SCM smob, SCM port, scm_print_state*)
+{
+ Context_def* me = (Context_def*) SCM_CELL_WORD_1 (smob);
+
+ scm_puts ("#<Context_def ", port);
+ scm_display (me->context_name_, port);
+ scm_puts (">", port);
+ return 1;
+}
+
+
+SCM
+Context_def::mark_smob (SCM smob)
+{
+ Context_def* me = (Context_def*) SCM_CELL_WORD_1 (smob);
+
+ scm_gc_mark (me->description_);
+ scm_gc_mark (me->context_aliases_);
+ scm_gc_mark (me->accept_mods_);
+ scm_gc_mark (me->translator_mods_);
+ scm_gc_mark (me->property_ops_);
+ scm_gc_mark (me->translator_group_type_);
+
+ return me->context_name_;
+}
+
Context_def::Context_def ()
{
context_name_ = ly_symbol2scm ("");
}
+Context_def::~Context_def ()
+{
+}
+
Context_def::Context_def (Context_def const & s)
: Input (s)
{
context_name_ = s.context_name_;
}
-Context_def::~Context_def ()
-{
-}
-
-#include "ly-smobs.icc"
-IMPLEMENT_SMOBS (Context_def);
-IMPLEMENT_DEFAULT_EQUAL_P (Context_def);
-
-int
-Context_def::print_smob (SCM smob, SCM port, scm_print_state*)
-{
- Context_def* me = (Context_def*) SCM_CELL_WORD_1 (smob);
-
- scm_puts ("#<Context_def ", port);
- scm_display (me->context_name_, port);
- scm_puts (">", port);
- return 1;
-}
-
-SCM
-Context_def::mark_smob (SCM smob)
-{
- Context_def* me = (Context_def*) SCM_CELL_WORD_1 (smob);
-
- scm_gc_mark (me->description_);
- scm_gc_mark (me->context_aliases_);
- scm_gc_mark (me->accept_mods_);
- scm_gc_mark (me->translator_mods_);
- scm_gc_mark (me->property_ops_);
- scm_gc_mark (me->translator_group_type_);
-
- return me->context_name_;
-}
void
Context_def::add_context_mod (SCM mod)
{
- SCM tag = ly_car (mod);
- if (ly_symbol2scm ("description") == tag)
+ SCM tag = gh_car (mod);
+ if (ly_symbol2scm ("description") == tag)
{
- description_ = ly_cadr (mod);
- return;
+ description_ = gh_cadr (mod);
+ return ;
}
- SCM sym = ly_cadr (mod);
- if (ly_c_string_p (sym))
+ SCM sym = gh_cadr (mod);
+ if (gh_string_p (sym))
sym = scm_string_to_symbol (sym);
if (ly_symbol2scm ("consists") == tag
|| ly_symbol2scm ("remove") == tag)
{
if (!get_translator (sym))
- error (_f ("Program has no such type: `%s'",
- ly_symbol2string (sym).to_str0 ()));
+ error (_f ("Program has no such type: `%s'", ly_symbol2string (sym).to_str0 ()));
else
- translator_mods_ = scm_cons (scm_list_2 (tag, sym), translator_mods_);
+ translator_mods_ = gh_cons (scm_list_2 (tag, sym), translator_mods_ );
}
else if (ly_symbol2scm ("accepts") == tag
|| ly_symbol2scm ("denies") == tag)
- accept_mods_ = scm_cons (scm_list_2 (tag, sym), accept_mods_);
+ {
+ accept_mods_ = gh_cons (scm_list_2 (tag, sym), accept_mods_);
+ }
else if (ly_symbol2scm ("poppush") == tag
|| ly_symbol2scm ("pop") == tag
|| ly_symbol2scm ("push") == tag
|| ly_symbol2scm ("assign") == tag
|| ly_symbol2scm ("unset") == tag)
- property_ops_ = scm_cons (mod, property_ops_);
+ {
+ property_ops_ = gh_cons (mod, property_ops_);
+ }
else if (ly_symbol2scm ("alias") == tag)
- context_aliases_ = scm_cons (sym, context_aliases_);
+ {
+ context_aliases_ = gh_cons (sym, context_aliases_);
+ }
else if (ly_symbol2scm ("translator-type") == tag)
- translator_group_type_ = sym;
+ {
+ translator_group_type_ = sym;
+ }
else if (ly_symbol2scm ("context-name") == tag)
- context_name_ = sym;
+ {
+ context_name_ = sym;
+ }
else
- programming_error ("Unknown context mod tag.");
+ {
+ programming_error ("Unknown context mod tag.");
+ }
}
+
+
SCM
Context_def::get_context_name () const
{
SCM
Context_def::get_accepted (SCM user_mod) const
{
- SCM mods = scm_reverse_x (scm_list_copy (accept_mods_), user_mod);
+ SCM mods = scm_reverse_x (scm_list_copy (accept_mods_),
+ user_mod);
SCM acc = SCM_EOL;
- for (SCM s = mods; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = mods; gh_pair_p (s); s = gh_cdr (s))
{
- SCM tag = ly_caar (s);
- SCM sym = ly_cadar (s);
+ SCM tag = gh_caar (s);
+ SCM sym = gh_cadar (s);
if (tag == ly_symbol2scm ("accepts"))
- acc = scm_cons (sym, acc);
+ acc = gh_cons (sym, acc);
else if (tag == ly_symbol2scm ("denies"))
acc = scm_delete_x (sym, acc);
}
return acc;
}
+
Link_array<Context_def>
-Context_def::path_to_acceptable_context (SCM type_sym, Output_def *odef) const
+Context_def::path_to_acceptable_context (SCM type_sym, Music_output_def* odef) const
{
- assert (ly_c_symbol_p (type_sym));
+ assert (gh_symbol_p (type_sym));
SCM accepted = get_accepted (SCM_EOL);
Link_array<Context_def> accepteds;
- for (SCM s = accepted; ly_c_pair_p (s); s = ly_cdr (s))
- if (Context_def *t = unsmob_context_def (find_context_def (odef,
- ly_car (s))))
+ for (SCM s = accepted; gh_pair_p (s); s = ly_cdr (s))
+ {
+ Context_def *t = unsmob_context_def (odef->find_context_def (ly_car (s)));
+ if (!t)
+ continue;
accepteds.push (t);
+ }
Link_array<Context_def> best_result;
for (int i=0; i < accepteds.size (); i++)
{
- /* do not check aliases, because \context Staff should not
- create RhythmicStaff. */
- if (ly_c_equal_p (accepteds[i]->get_context_name (), type_sym))
+ /*
+ don't check aliases, because \context Staff should not create RhythmicStaff.
+ */
+ if (gh_equal_p (accepteds[i]->get_context_name (), type_sym))
{
best_result.push (accepteds[i]);
return best_result;
}
}
-
+
int best_depth= INT_MAX;
for (int i=0; i < accepteds.size (); i++)
{
result.insert (g,0);
best_result = result;
- /* this following line was added in 1.9.3, but hsould've been
- there all along... Let's hope it doesn't cause nightmares. */
+ /*
+ this following line was added in 1.9.3, but hsould've been
+ there all along... Let's hope it doesn't cause nightmares.
+ */
best_depth = result.size ();
}
}
return best_result;
}
+IMPLEMENT_SMOBS (Context_def);
+IMPLEMENT_DEFAULT_EQUAL_P (Context_def);
+
+
SCM
Context_def::get_translator_names (SCM user_mod) const
{
SCM l1 = SCM_EOL;
SCM l2 = SCM_EOL;
- SCM mods = scm_reverse_x (scm_list_copy (translator_mods_), user_mod);
+ SCM mods = scm_reverse_x (scm_list_copy (translator_mods_),
+ user_mod);
- for (SCM s = mods; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = mods; gh_pair_p (s); s = gh_cdr (s))
{
- SCM tag = ly_caar (s);
- SCM arg = ly_cadar (s);
+ SCM tag = gh_caar (s);
+ SCM arg = gh_cadar (s);
- if (ly_c_string_p (arg))
+ if (gh_string_p (arg))
arg = scm_string_to_symbol (arg);
if (ly_symbol2scm ("consists") == tag)
- l1 = scm_cons (arg, l1);
+ l1 = gh_cons (arg, l1);
else if (ly_symbol2scm ("consists-end") == tag)
- l2 = scm_cons (arg, l2);
+ l2 = gh_cons (arg, l2);
else if (ly_symbol2scm ("remove") == tag)
{
l1 = scm_delete_x (arg, l1);
l2 = scm_delete_x (arg, l2);
}
}
+
return scm_append_x (scm_list_2 (l1, l2));
}
+
SCM
-filter_performers (SCM ell)
+filter_performers (SCM l)
{
- for (SCM *tail = ℓ ly_c_pair_p (*tail); tail = SCM_CDRLOC (*tail))
+ for (SCM *tail = &l; gh_pair_p (*tail); tail = SCM_CDRLOC (*tail))
{
- if (dynamic_cast<Performer*> (unsmob_translator (ly_car (*tail))))
+ if (dynamic_cast<Performer*> (unsmob_translator (gh_car (*tail))))
{
- *tail = ly_cdr (*tail);
- if (!ly_c_pair_p (*tail))
+ *tail = gh_cdr (*tail);
+ if (!gh_pair_p (*tail))
break ;
}
}
- return ell;
+ return l;
}
+
SCM
-filter_engravers (SCM ell)
+filter_engravers (SCM l)
{
- SCM *tail = ℓ
- for (; ly_c_pair_p (*tail) ; tail = SCM_CDRLOC (*tail))
+ for (SCM *tail = &l; gh_pair_p (*tail) ; tail = SCM_CDRLOC (*tail))
{
- if (dynamic_cast<Engraver*> (unsmob_translator (ly_car (*tail))))
+ if (dynamic_cast<Engraver*> (unsmob_translator (gh_car (*tail))))
{
- *tail = ly_cdr (*tail);
- if (!ly_c_pair_p (*tail))
+ *tail = gh_cdr (*tail);
+ if (!gh_pair_p (*tail))
break ;
}
}
- return ell;
+ return l;
}
Context *
Context_def::instantiate (SCM ops)
{
- Context *tg = 0;
+ Context * tg = 0;
if (context_name_ == ly_symbol2scm ("Score"))
tg = new Score_context ();
SCM trans_names = get_translator_names (ops);
- Translator *g = get_translator (translator_group_type_);
+ Translator * g = get_translator (translator_group_type_);
g = g->clone ();
- g->simple_trans_list_ = SCM_EOL;
-
- for (SCM s = trans_names; ly_c_pair_p (s) ; s = ly_cdr (s))
- {
- Translator *t = get_translator (ly_car (s));
- if (!t)
- warning (_f ("can't find: `%s'", s));
- else
- {
- Translator *tr = t->clone ();
- SCM str = tr->self_scm ();
- g->simple_trans_list_ = scm_cons (str, g->simple_trans_list_);
- tr->daddy_context_ = tg;
- scm_gc_unprotect_object (str);
- }
- }
-
+ g->simple_trans_list_ = names_to_translators (trans_names, tg);
tg->implementation_ = g->self_scm ();
if (dynamic_cast<Engraver*> (g))
g->simple_trans_list_ = filter_performers (g->simple_trans_list_);
return tg;
}
+
SCM
Context_def::clone_scm () const
{
Context_def * t = new Context_def (*this);
+
SCM x = t->self_scm ();
scm_gc_unprotect_object (x);
return x;
Context_def::make_scm ()
{
Context_def* t = new Context_def;
- SCM x = t->self_scm ();
+
+ SCM x =t->self_scm ();
scm_gc_unprotect_object (x);
return x;
}
void
Context_def::apply_default_property_operations (Context *tg)
{
- apply_property_operations (tg, property_ops_);
+ apply_property_operations (tg , property_ops_);
}
SCM
Context_def::to_alist () const
{
- SCM ell = SCM_EOL;
-
- ell = scm_cons (scm_cons (ly_symbol2scm ("consists"),
- get_translator_names (SCM_EOL)), ell);
- ell = scm_cons (scm_cons (ly_symbol2scm ("description"), description_), ell);
- ell = scm_cons (scm_cons (ly_symbol2scm ("aliases"), context_aliases_), ell);
- ell = scm_cons (scm_cons (ly_symbol2scm ("accepts"), get_accepted (SCM_EOL)),
- ell);
- ell = scm_cons (scm_cons (ly_symbol2scm ("property-ops"), property_ops_),
- ell);
- ell = scm_cons (scm_cons (ly_symbol2scm ("context-name"), context_name_),
- ell);
-
- if (ly_c_symbol_p (translator_group_type_))
- ell = scm_cons (scm_cons (ly_symbol2scm ("group-type"),
- translator_group_type_), ell);
- return ell;
+ SCM l = SCM_EOL;
+
+ l = gh_cons (gh_cons (ly_symbol2scm ("consists"),
+ get_translator_names (SCM_EOL)), l);
+ l = gh_cons (gh_cons (ly_symbol2scm ("description"), description_), l);
+ l = gh_cons (gh_cons (ly_symbol2scm ("aliases"), context_aliases_), l);
+ l = gh_cons (gh_cons (ly_symbol2scm ("accepts"), get_accepted (SCM_EOL)), l);
+ l = gh_cons (gh_cons (ly_symbol2scm ("property-ops"), property_ops_), l);
+ l = gh_cons (gh_cons (ly_symbol2scm ("context-name"), context_name_), l);
+
+ if (gh_symbol_p (translator_group_type_))
+ l = gh_cons (gh_cons (ly_symbol2scm ("group-type"), translator_group_type_), l);
+
+ return l;
}
Context *tr = unsmob_context (context);
SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "Context");
- return scm_makfrom0str (tr->id_string (). to_str0 ());
+ return scm_makfrom0str (tr->id_string_. to_str0 ());
}
LY_DEFINE (ly_context_name, "ly:context-name",
{
Context *tr = unsmob_context (context);
SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "Context");
- return ly_symbol2scm (tr->context_name ().to_str0 ());
+ return unsmob_context_def (tr->definition_)->get_context_name ();
}
LY_DEFINE (ly_context_pushpop_property, "ly:context-pushpop-property",
{
Context *tg = unsmob_context (context);
SCM_ASSERT_TYPE (tg, context, SCM_ARG1, __FUNCTION__, "context");
- SCM_ASSERT_TYPE (ly_c_symbol_p (grob), grob, SCM_ARG2, __FUNCTION__, "symbol");
- SCM_ASSERT_TYPE (ly_c_symbol_p (eltprop), eltprop, SCM_ARG3, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE (gh_symbol_p (grob), grob, SCM_ARG2, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE (gh_symbol_p (eltprop), eltprop, SCM_ARG3, __FUNCTION__, "symbol");
execute_pushpop_property (tg, grob, eltprop, val);
- return SCM_UNSPECIFIED;
+ return SCM_UNDEFINED;
}
LY_DEFINE (ly_context_property, "ly:context-property",
Context *t = unsmob_context (c);
Context * tr= (t);
SCM_ASSERT_TYPE (tr, c, SCM_ARG1, __FUNCTION__, "Translator group");
- SCM_ASSERT_TYPE (ly_c_symbol_p (name), name, SCM_ARG2, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE (gh_symbol_p (name), name, SCM_ARG2, __FUNCTION__, "symbol");
return tr->internal_get_property (name);
}
{
Context *tr = unsmob_context (context);
SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "Context");
- SCM_ASSERT_TYPE (ly_c_symbol_p (name), name, SCM_ARG2, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE (gh_symbol_p (name), name, SCM_ARG2, __FUNCTION__, "symbol");
tr->internal_set_property (name, val);
{
Context *tr = unsmob_context (context);
SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "Context");
- SCM_ASSERT_TYPE (ly_c_symbol_p (name), name, SCM_ARG2, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE (gh_symbol_p (name), name, SCM_ARG2, __FUNCTION__, "symbol");
tr = tr->where_defined (name);
if (tr)
{
Context *tr = unsmob_context (context);
SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "Context");
- SCM_ASSERT_TYPE (ly_c_symbol_p (name), name, SCM_ARG2, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE (gh_symbol_p (name), name, SCM_ARG2, __FUNCTION__, "symbol");
tr->unset_property (name);
return SCM_UNSPECIFIED;
Context *tr = unsmob_context (context);
SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "Context");
- tr = tr->get_parent_context () ;
+ tr = tr->daddy_context_ ;
if (tr)
return tr->self_scm ();
else
{
Context *tr = unsmob_context (context);
SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "context");
- SCM_ASSERT_TYPE (ly_c_symbol_p (name), name, SCM_ARG2, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE (gh_symbol_p (name), name, SCM_ARG2, __FUNCTION__, "symbol");
while (tr)
{
if (tr->is_alias (name))
return tr->self_scm ();
- tr = tr->get_parent_context () ;
+ tr = tr->daddy_context_ ;
}
return SCM_BOOL_F;
}
+
+#if 0
+/*
+ What is this used for? Should remove? --hwn
+ */
+LY_DEFINE (ly_context_properties, "ly:context-properties",
+ 1, 0, 0, (SCM context),
+ "Return all properties of @var{context} in an alist.")
+{
+ Context *tr = unsmob_context (context);
+ SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "Context");
+ return tr->properties_as_alist ();
+}
+#endif
String c_id;
SCM ci = get_music ()->get_property ("context-id");
- if (ly_c_string_p (ci))
+ if (gh_string_p (ci))
c_id = ly_scm2string (ci);
SCM ops = get_music ()->get_property ("property-operations");
#include "context-def.hh"
#include "context.hh"
#include "warn.hh"
-#include "output-def.hh"
+#include "music-output-def.hh"
#include "scm-hash.hh"
#include "main.hh"
#include "ly-smobs.icc"
void
Context::check_removal ()
{
- for (SCM p = context_list_; ly_c_pair_p (p); p = ly_cdr (p))
+ for (SCM p = context_list_; gh_pair_p (p); p = gh_cdr (p))
{
Context *trg = unsmob_context (ly_car (p));
Context::add_context (Context*t)
{
SCM ts = t->self_scm ();
- context_list_ = ly_append2 (context_list_,
- scm_cons (ts, SCM_EOL));
+ context_list_ = gh_append2 (context_list_,
+ gh_cons (ts, SCM_EOL));
t->daddy_context_ = this;
if (!t->init_)
scm_gc_unprotect_object (properties_scm_);
}
+Context *
+Context::find_context_below (SCM n, String id)
+{
+ if ((is_alias (n) && (id_string_ == id || id.is_empty ())))
+ return this;
+
+ Context* r = 0;
+ for (SCM p = context_list_; !r && gh_pair_p (p); p = ly_cdr (p))
+ {
+ Context * t = unsmob_context (ly_car (p));
+
+ r = dynamic_cast<Context*> (t)->find_context_below (n, id);
+ }
+
+ return r;
+}
Context*
return get_score_context ()->find_create_context (n, id, operations);
- Context * existing = find_context_below (this, n,id);
+ Context * existing = find_context_below (n,id);
if (existing)
return existing;
none.
*/
SCM
-Context::default_child_context_name () const
+default_child_context_name (Context const *tg)
{
- return ly_c_pair_p (accepts_list_)
- ? ly_car (scm_last_pair (accepts_list_))
+ return gh_pair_p (tg->accepts_list_)
+ ? ly_car (scm_last_pair (tg->accepts_list_))
: SCM_EOL;
}
bool
Context::is_bottom_context () const
{
- return !ly_c_symbol_p (default_child_context_name ());
+ return !gh_symbol_p (default_child_context_name (this));
}
Context*
{
if (!is_bottom_context ())
{
- SCM nm = default_child_context_name ();
- SCM st = find_context_def (get_output_def (), nm);
+ SCM nm = default_child_context_name (this);
+ SCM st = get_output_def ()->find_context_def (nm);
Context_def *t = unsmob_context_def (st);
if (!t)
Context::is_alias (SCM sym) const
{
if (sym == ly_symbol2scm ("Bottom")
- && !ly_c_pair_p (accepts_list_))
+ && !gh_pair_p (accepts_list_))
return true;
if (sym == unsmob_context_def (definition_)->get_context_name ())
return true;
*/
Context *
find_context_below (Context * where,
- SCM type, String id)
+ String type, String id)
{
- if (where->is_alias (type))
+ if (where->is_alias (ly_symbol2scm (type.to_str0 ())))
{
- if (id == "" || where->id_string () == id)
+ if (id == "" || where->id_string_ == id)
return where;
}
Context * found = 0;
- for (SCM s = where->children_contexts ();
- !found && ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = where->context_list_;
+ !found && gh_pair_p (s); s = gh_cdr (s))
{
- Context * tr = unsmob_context (ly_car (s));
+ Context * tr = unsmob_context (gh_car (s));
found = find_context_below (tr, type, id);
}
return 0;
}
-Output_def *
+Music_output_def *
Context::get_output_def () const
{
return (daddy_context_)
bool
Context::try_music (Music* m)
{
- Translator* t = implementation ();
+ Translator* t = unsmob_translator (implementation_);
if (!t)
return false;
programming_error ("No Global context!");
return 0;
}
-
-Context*
-Context::get_parent_context () const
-{
- return daddy_context_;
-}
-
-Translator_group*
-Context::implementation () const
-{
- return dynamic_cast<Translator_group*> (unsmob_translator (implementation_));
-}
/*
delay typeset until we're at the next moment, so we can silence custodes at the end of the piece.
*/
+ for (int i = custodes_.size (); i--;)
+ {
+ typeset_grob (custodes_[i]);
+ }
pitches_.clear ();
custos_permitted = false;
void
Custos_engraver::process_acknowledged_grobs ()
{
- if (ly_c_string_p (get_property ("whichBar")))
+ if (gh_string_p (get_property ("whichBar")))
custos_permitted = true;
if (custos_permitted)
int p = pitches_[i].steps ();
SCM c0 = get_property ("middleCPosition");
- if (ly_c_number_p (c0))
- p += ly_scm2int (c0);
+ if (gh_number_p (c0))
+ p += gh_scm2int (c0);
c->set_property ("staff-position",
- scm_int2num (p));
+ gh_int2scm (p));
}
Item*
Custos_engraver::create_custos ()
{
- Item* custos = make_item ("Custos", SCM_EOL);
-
+ Item* custos = make_item ("Custos");
+ announce_grob (custos, SCM_EOL);
custodes_.push (custos);
return custos;
for (int i = custodes_.size (); i--;)
{
custodes_[i]->suicide ();
+ typeset_grob (custodes_[i]);
}
custodes_.clear ();
}
SCM scm_style = me->get_property ("style");
String style;
- if (ly_c_symbol_p (scm_style))
+ if (gh_symbol_p (scm_style))
{
style = ly_symbol2string (scm_style);
}
void
set_grob_direction (Grob*me, Direction d)
{
- SCM sd = scm_int2num (d);
+ SCM sd = gh_int2scm (d);
me->set_property ("direction", sd);
}
void
Dot_column_engraver::stop_translation_timestep ()
{
+ if (dotcol_)
+ {
+
/*
Add the stem to the support so dots stay clear of flags.
See [Ross, p 171]
*/
- if (stem_ && dotcol_)
+ if (stem_)
dotcol_->set_property ("stem", stem_->self_scm ());
+ typeset_grob (dotcol_);
dotcol_ =0;
+ }
heads_.clear ();
stem_ =0;
}
{
if (!dotcol_)
{
- dotcol_ = make_item ("DotColumn", SCM_EOL);
-
+ dotcol_ = make_item ("DotColumn");
+ announce_grob (dotcol_, SCM_EOL);
}
Dot_column::add_head (dotcol_, info.grob_);
Dot_column::force_shift_callback (SCM element_smob, SCM axis)
{
Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) ly_scm2int (axis);
+ Axis a = (Axis) gh_scm2int (axis);
assert (a == Y_AXIS);
me = me->get_parent (X_AXIS);
do_shifts (me);
}
- return scm_make_real (0.0);
+ return gh_double2scm (0.0);
}
MAKE_SCHEME_CALLBACK (Dot_column,side_position, 2);
Dot_column::side_position (SCM element_smob, SCM axis)
{
Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) ly_scm2int (axis);
+ Axis a = (Axis) gh_scm2int (axis);
assert (a == X_AXIS);
Grob * stem = unsmob_grob (me->get_property ("stem"));
dots.sort (compare_position);
for (int i = dots.size (); i--;)
- if (!dots[i]->is_live ())
+ if (!dots[i]->live ())
dots.del (i);
Dot_configuration cfg;
#include "dots.hh"
#include "item.hh"
#include "stencil.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "font-interface.hh"
#include "lookup.hh"
#include "staff-symbol-referencer.hh"
SCM c = sc->get_property ("dot-count");
- if (ly_c_number_p (c))
+ if (gh_number_p (c))
{
Stencil d = Font_interface::get_default_font (sc)->find_by_name (String ("dots-dot"));
Real dw = d.extent (X_AXIS).length ();
mol = Lookup::blank (Box (Interval (0,0),
Interval (0,0)));
- for (int i = ly_scm2int (c); i--;)
+ for (int i = gh_scm2int (c); i--;)
{
d.translate_axis (2*dw,X_AXIS);
mol.add_at_edge (X_AXIS, RIGHT, d, dw, 0);
if (!tab)
tab = get_property ("drumStyleTable");
+ Item *note = make_item ("NoteHead");
Music * ev = events_[i];
- Item *note = make_item ("NoteHead", ev->self_scm ());
Duration dur = *unsmob_duration (ev->get_property ("duration"));
- note->set_property ("duration-log", scm_int2num (dur.duration_log ()));
+ note->set_property ("duration-log", gh_int2scm (dur.duration_log ()));
if (dur.dot_count ())
{
- Item * d = make_item ("Dots", ev->self_scm ());
+ Item * d = make_item ("Dots");
Rhythmic_head::set_dots (note, d);
if (dur.dot_count ()
!= robust_scm2int (d->get_property ("dot-count"), 0))
- d->set_property ("dot-count", scm_int2num (dur.dot_count ()));
+ d->set_property ("dot-count", gh_int2scm (dur.dot_count ()));
d->set_parent (note, Y_AXIS);
-
+ announce_grob (d, SCM_EOL);
dots_.push (d);
}
if (scm_hash_table_p (tab) == SCM_BOOL_T)
defn = scm_hashq_ref (tab, drum_type, SCM_EOL);
- if (ly_c_pair_p (defn))
+ if (gh_pair_p (defn))
{
- SCM pos = ly_caddr (defn);
- SCM style =ly_car (defn);
- SCM script = ly_cadr (defn);
+ SCM pos = gh_caddr (defn);
+ SCM style =gh_car (defn);
+ SCM script = gh_cadr (defn);
if (scm_integer_p (pos) == SCM_BOOL_T)
note->set_property ("staff-position", pos);
- if (ly_c_symbol_p (style))
+ if (gh_symbol_p (style))
note->set_property ("style", style);
- if (ly_c_string_p (script))
+ if (gh_string_p (script))
{
- Item *p = make_item ("Script", ev->self_scm ());
+ Item *p = make_item ("Script");
SCM desc = SCM_EOL;
make_script_from_event (p, &desc,
- context (), script,
+ daddy_context_, script,
0);
if (p->get_property ("follow-into-staff"))
p->set_property ("staff-padding", SCM_EOL);
+ announce_grob (p, ev->self_scm ());
p->set_parent (note, Y_AXIS);
Side_position_interface::add_support (p, note);
}
}
+
+
+ announce_grob (note,ev->self_scm ());
notes_.push (note);
}
}
void
Drum_notes_engraver::stop_translation_timestep ()
{
+ for (int i=0; i < notes_.size (); i++)
+ {
+ typeset_grob (notes_[i]);
+ }
notes_.clear ();
+ for (int i=0; i < dots_.size (); i++)
+ {
+ typeset_grob (dots_[i]);
+ }
dots_.clear ();
+ for (int i=0; i < scripts_.size (); i++)
+ {
+ typeset_grob (scripts_[i]);
+ }
scripts_.clear ();
events_.clear ();
SCM sym = n->get_property ("drum-type");
SCM defn = SCM_EOL;
- if (ly_c_symbol_p (sym)
+ if (gh_symbol_p (sym)
&& (scm_hash_table_p (tab) == SCM_BOOL_T))
defn = scm_hashq_ref (tab, sym, SCM_EOL);
return SCM_BOOL_F;
}
-LY_DEFINE (ly_duration_less_p, "ly:duration<?",
+LY_DEFINE (duration_less, "ly:duration<?",
2, 0, 0, (SCM p1, SCM p2),
"Is @var{p1} shorter than @var{p2}?")
{
return SCM_BOOL_F;
}
-LY_DEFINE (ly_make_duration, "ly:make-duration",
+LY_DEFINE (make_duration, "ly:make-duration",
1, 3, 0, (SCM length, SCM dotcount, SCM num, SCM den),
"@var{length} is the negative logarithm (base 2) of the duration:\n"
"1 is a half note, 2 is a quarter note, 3 is an eighth\n"
{
SCM_ASSERT_TYPE (scm_integer_p (dotcount) == SCM_BOOL_T,
dotcount, SCM_ARG2, __FUNCTION__, "integer");
- dots = ly_scm2int (dotcount);
+ dots = gh_scm2int (dotcount);
}
bool compress = false;
if (num != SCM_UNDEFINED)
{
- SCM_ASSERT_TYPE (ly_c_number_p (num), length, SCM_ARG3, __FUNCTION__, "integer");
+ SCM_ASSERT_TYPE (gh_number_p (num), length, SCM_ARG3, __FUNCTION__, "integer");
compress = true;
}
else
- num = scm_int2num (1);
+ num = gh_int2scm (1);
if (den != SCM_UNDEFINED)
{
- SCM_ASSERT_TYPE (ly_c_number_p (den), length, SCM_ARG4, __FUNCTION__, "integer");
+ SCM_ASSERT_TYPE (gh_number_p (den), length, SCM_ARG4, __FUNCTION__, "integer");
compress = true;
}
else
- den = scm_int2num (1);
+ den = gh_int2scm (1);
- Duration p (ly_scm2int (length), dots);
+ Duration p (gh_scm2int (length), dots);
if (compress)
- p = p.compressed (Rational (ly_scm2int (num), ly_scm2int (den)));
+ p = p.compressed (Rational (gh_scm2int (num), gh_scm2int (den)));
return p.smobbed_copy ();
}
-LY_DEFINE (ly_duration_log, "ly:duration-log",
+LY_DEFINE (duration_log, "ly:duration-log",
1, 0, 0, (SCM dur),
"Extract the duration log from @var{dur}")
{
SCM_ASSERT_TYPE (unsmob_duration (dur), dur, SCM_ARG1, __FUNCTION__, "duration");
- return scm_int2num (unsmob_duration (dur)->duration_log ());
+ return gh_int2scm (unsmob_duration (dur)->duration_log ());
}
-LY_DEFINE (ly_duration_dot_count, "ly:duration-dot-count",
- 1, 0, 0, (SCM dur),
- "Extract the dot count from @var{dur}")
+LY_DEFINE (dot_count_log, "ly:duration-dot-count", 1, 0, 0, (SCM dur),
+ "Extract the dot count from @var{dur}"
+)
{
SCM_ASSERT_TYPE (unsmob_duration (dur), dur, SCM_ARG1, __FUNCTION__, "duration");
- return scm_int2num (unsmob_duration (dur)->dot_count ());
+ return gh_int2scm (unsmob_duration (dur)->dot_count ());
}
+
LY_DEFINE (ly_intlog2, "ly:intlog2",
1, 0, 0, (SCM d),
"The 2-logarithm of 1/@var{d}.")
{
- SCM_ASSERT_TYPE (ly_c_number_p (d), d, SCM_ARG1, __FUNCTION__, "integer");
- int log = intlog2 (ly_scm2int (d));
- return scm_int2num (log);
+ SCM_ASSERT_TYPE (gh_number_p (d), d, SCM_ARG1, __FUNCTION__, "integer");
+ int log = intlog2 (gh_scm2int (d));
+ return gh_int2scm (log);
}
-LY_DEFINE (ly_duration_factor, "ly:duration-factor",
+LY_DEFINE (compression_factor, "ly:duration-factor",
1, 0, 0, (SCM dur),
"Extract the compression factor from @var{dur}. Return as a pair.")
{
SCM_ASSERT_TYPE (unsmob_duration (dur), dur, SCM_ARG1, __FUNCTION__, "duration");
Rational r = unsmob_duration (dur)->factor ();
- return scm_cons (scm_int2num (r.num ()), scm_int2num (r.den ()));
+ return gh_cons (gh_int2scm (r.num ()), gh_int2scm (r.den ()));
}
int
{
if (!line_spanner_)
{
- Music * rq = accepted_spanreqs_drul_[START];
- line_spanner_ = make_spanner ("DynamicLineSpanner", rq ? rq->self_scm (): SCM_EOL );
+ line_spanner_ = make_spanner ("DynamicLineSpanner");
+ Music * rq = accepted_spanreqs_drul_[START];
if (script_ev_)
- rq = script_ev_;
+ rq = script_ev_ ;
+ announce_grob (line_spanner_, rq ? rq->self_scm (): SCM_EOL);
}
}
*/
if (script_ev_)
{
- script_ = make_item ("DynamicText", script_ev_->self_scm ());
+ script_ = make_item ("DynamicText");
script_->set_property ("text",
script_ev_->get_property ("text"));
Axis_group_interface::add_element (line_spanner_, script_);
+ announce_grob (script_, script_ev_->self_scm ());
}
Music *stop_ev = accepted_spanreqs_drul_ [STOP] ?
start_type = "crescendo";
SCM s = get_property ((start_type + "Spanner").to_str0 ());
- if (!ly_c_symbol_p (s) || s == ly_symbol2scm ("hairpin"))
+ if (!gh_symbol_p (s) || s == ly_symbol2scm ("hairpin"))
{
- cresc_ = make_spanner ("Hairpin", accepted_spanreqs_drul_[START]->self_scm ());
+ cresc_ = make_spanner ("Hairpin");
cresc_->set_property ("grow-direction",
- scm_int2num ((start_type == "crescendo")
+ gh_int2scm ((start_type == "crescendo")
? BIGGER : SMALLER));
}
*/
else
{
- cresc_ = make_spanner ("TextSpanner", accepted_spanreqs_drul_[START]->self_scm ());
+ cresc_ = make_spanner ("TextSpanner");
cresc_->set_property ("style", s);
- context ()->set_property ((start_type
+ daddy_context_->set_property ((start_type
+ "Spanner").to_str0 (), SCM_EOL);
s = get_property ((start_type + "Text").to_str0 ());
/*
FIXME: use get_markup () to check type.
*/
- if (ly_c_string_p (s) || ly_c_pair_p (s))
+ if (gh_string_p (s) || gh_pair_p (s))
{
cresc_->set_property ("edge-text",
- scm_cons (s, scm_makfrom0str ("")));
- context ()->set_property ((start_type + "Text").to_str0 (),
+ gh_cons (s, scm_makfrom0str ("")));
+ daddy_context_->set_property ((start_type + "Text").to_str0 (),
SCM_EOL);
}
}
add_bound_item (line_spanner_, cresc_->get_bound (LEFT));
+ announce_grob (cresc_, accepted_spanreqs_drul_[START]->self_scm ());
}
}
}
typeset_all ();
if (line_spanner_
- && !line_spanner_->is_live ())
+ && !line_spanner_->live ())
line_spanner_ = 0;
if (line_spanner_)
{
}
if (cresc_
- && !cresc_->is_live ())
+ && !cresc_->live ())
cresc_ = 0;
if (cresc_)
{
Maybe just check at typeset_grob ()?
*/
if (finished_cresc_
- && !finished_cresc_->is_live ())
+ && !finished_cresc_->live ())
finished_cresc_ = 0;
if (finished_line_spanner_
- && !finished_line_spanner_->is_live ())
+ && !finished_line_spanner_->live ())
finished_line_spanner_ = 0;
if (finished_cresc_)
add_bound_item (finished_line_spanner_,
finished_cresc_->get_bound (RIGHT));
}
+ typeset_grob (finished_cresc_);
finished_cresc_ =0;
}
+ if (script_)
+ {
+ typeset_grob (script_);
script_ = 0;
+ }
if (finished_line_spanner_)
{
/*
finished_line_spanner_->set_bound (LEFT, ci);
}
+ typeset_grob (finished_line_spanner_);
finished_line_spanner_ = 0;
}
}
{
if (line_spanner_
/* Don't refill killed spanner */
- && line_spanner_->is_live ())
+ && line_spanner_->live ())
{
Side_position_interface::add_support (line_spanner_,i.grob_);
add_bound_item (line_spanner_,dynamic_cast<Item*> (i.grob_));
if (script_ && !script_->get_parent (X_AXIS))
{
SCM head = scm_last_pair (i.grob_->get_property ("note-heads"));
- if (ly_c_pair_p (head))
- script_->set_parent (unsmob_grob (ly_car (head)), X_AXIS);
+ if (gh_pair_p (head))
+ script_->set_parent (unsmob_grob (gh_car (head)), X_AXIS);
}
}
DynamicText doesn't really have a script-priority field.
*/
- if (ly_c_number_p (p)
- && ly_scm2int (p) < ly_scm2int (script_->get_property ("script-priority")))
+ if (gh_number_p (p)
+ && gh_scm2int (p) < gh_scm2int (script_->get_property ("script-priority")))
{
Side_position_interface::add_support (line_spanner_, i.grob_);
SCM proc = get_property ("dynamicAbsoluteVolumeFunction");
SCM svolume = SCM_EOL;
- if (ly_c_procedure_p (proc))
+ if (gh_procedure_p (proc))
{
// urg
- svolume = scm_call_1 (proc, script_req_->get_property ("text"));
+ svolume = gh_call1 (proc, script_req_->get_property ("text"));
}
Real volume = robust_scm2double (svolume, 0.5);
*/
SCM min = get_property ("midiMinimumVolume");
SCM max = get_property ("midiMaximumVolume");
- if (ly_c_number_p (min) || ly_c_number_p (max))
+ if (gh_number_p (min) || gh_number_p (max))
{
Interval iv (0, 1);
- if (ly_c_number_p (min))
- iv[MIN] = ly_scm2double (min);
- if (ly_c_number_p (max))
- iv[MAX] = ly_scm2double (max);
+ if (gh_number_p (min))
+ iv[MIN] = gh_scm2double (min);
+ if (gh_number_p (max))
+ iv[MAX] = gh_scm2double (max);
volume = iv[MIN] + iv.length () * volume;
}
else
*/
SCM s = get_property ("midiInstrument");
- if (!ly_c_string_p (s))
+ if (!gh_string_p (s))
s = get_property ("instrument");
- if (!ly_c_string_p (s))
+ if (!gh_string_p (s))
s = scm_makfrom0str ("piano");
SCM eq = get_property ("instrumentEqualizer");
- if (ly_c_procedure_p (eq))
+ if (gh_procedure_p (eq))
{
- s = scm_call_1 (eq, s);
+ s = gh_call1 (eq, s);
}
if (is_number_pair (s))
SCM meta = info.grob_->internal_get_property (meta_sym);
SCM nm = scm_assoc (name_sym, meta);
- if (ly_c_pair_p (nm))
+ if (gh_pair_p (nm))
nm = ly_cdr (nm);
else
{
SCM acklist = scm_hashq_ref (tab, nm, SCM_UNDEFINED);
if (acklist == SCM_BOOL_F)
{
- acklist = find_acknowledge_engravers (scm_cons (self_scm (), get_simple_trans_list ()), meta);
+ acklist = find_acknowledge_engravers (gh_cons (self_scm (), get_simple_trans_list ()), meta);
scm_hashq_set_x (tab, nm, acklist);
}
- for (SCM p = acklist; ly_c_pair_p (p); p = ly_cdr (p))
+ for (SCM p = acklist; gh_pair_p (p); p = ly_cdr (p))
{
Translator * t = unsmob_translator (ly_car (p));
Engraver * eng = dynamic_cast<Engraver*> (t);
void
Engraver_group_engraver::initialize ()
{
- SCM tab = scm_make_vector (scm_int2num (61), SCM_BOOL_F);
- context ()->set_property ("acknowledgeHashTable", tab);
+ SCM tab = scm_make_vector (gh_int2scm (61), SCM_BOOL_F);
+ daddy_context_->set_property ("acknowledgeHashTable", tab);
Translator_group::initialize ();
}
engraver_valid (Translator*tr, SCM ifaces)
{
SCM ack_ifs = scm_assoc (ly_symbol2scm ("interfaces-acked"), tr->translator_description ());
- ack_ifs = ly_cdr (ack_ifs);
- for (SCM s = ifaces; ly_c_pair_p (s); s = ly_cdr (s))
+ ack_ifs = gh_cdr (ack_ifs);
+ for (SCM s = ifaces; ly_pair_p (s); s = ly_cdr (s))
if (scm_c_memq (ly_car (s), ack_ifs) != SCM_BOOL_F)
return true;
return false;
SCM
find_acknowledge_engravers (SCM gravlist, SCM meta_alist)
{
- SCM ifaces = ly_cdr (scm_assoc (ly_symbol2scm ("interfaces"), meta_alist));
+ SCM ifaces = gh_cdr (scm_assoc (ly_symbol2scm ("interfaces"), meta_alist));
SCM l = SCM_EOL;
- for (SCM s = gravlist; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = gravlist; ly_pair_p (s); s = ly_cdr (s))
{
Translator* tr = unsmob_translator (ly_car (s));
if (engraver_valid (tr, ifaces))
recurse_down_engravers (Context * c, Engraver_method ptr, bool context_first)
{
Engraver_group_engraver * tg
- = dynamic_cast<Engraver_group_engraver*> (c->implementation ());
+ = dynamic_cast<Engraver_group_engraver*> (unsmob_translator (c->implementation_));
if (!context_first)
(tg->*ptr) ();
}
- for (SCM s = c->children_contexts () ; ly_c_pair_p (s);
- s =ly_cdr (s))
+ for (SCM s = c->context_list_ ; gh_pair_p (s);
+ s =gh_cdr (s))
{
- recurse_down_engravers (unsmob_context (ly_car (s)), ptr, context_first);
+ recurse_down_engravers (unsmob_context (gh_car (s)), ptr, context_first);
}
if (context_first)
void
engraver_each (SCM list, Engraver_method method)
{
- for (SCM p = list; ly_c_pair_p (p); p = ly_cdr (p))
+ for (SCM p = list; gh_pair_p (p); p = ly_cdr (p))
{
Engraver * e = dynamic_cast<Engraver*>(unsmob_translator (ly_car (p)));
if (e)
+void
+Engraver::typeset_grob (Grob*p)
+{
+ Engraver *dad = get_daddy_engraver ();
+ if (dad)
+ dad->typeset_grob (p);
+}
+
Engraver::Engraver ()
Score_engraver*
Engraver::get_score_engraver () const
{
- return dynamic_cast<Score_engraver*> (get_score_context ()->implementation ());
+ SCM t = get_score_context ()->implementation_;
+ return dynamic_cast<Score_engraver*> (unsmob_translator (t));
}
if (last_processed_mom_ < Moment (0))
{
for (SCM s = dynamic_cast<Music_sequence *> (get_music ())->music_list ();
- ly_c_pair_p (s); s = ly_cdr (s))
+ gh_pair_p (s); s = ly_cdr (s))
{
Music *mus = unsmob_music (ly_car (s));
new_pit = new_pit.to_relative_octave (last);
SCM check = get_property ("absolute-octave");
- if (ly_c_number_p (check) &&
- new_pit.get_octave () != ly_scm2int (check))
+ if (gh_number_p (check) &&
+ new_pit.get_octave () != gh_scm2int (check))
{
- Pitch expected_pit (ly_scm2int (check),
+ Pitch expected_pit (gh_scm2int (check),
new_pit.get_notename (),
new_pit.get_alteration ());
origin ()->warning (_f ("octave check failed; expected %s, found: %s",
SCM newlist = SCM_EOL;
Pitch *p = unsmob_pitch (pit);
- for (SCM s = l; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = l; gh_pair_p (s); s = ly_cdr (s))
{
SCM key = ly_caar (s);
SCM alter = ly_cdar (s);
- if (ly_c_pair_p (key))
+ if (gh_pair_p (key))
{
- Pitch orig (ly_scm2int (ly_car (key)),
- ly_scm2int (ly_cdr (key)),
- ly_scm2int (alter));
+ Pitch orig (gh_scm2int (ly_car (key)),
+ gh_scm2int (ly_cdr (key)),
+ gh_scm2int (alter));
orig =orig.transposed (*p);
- SCM key = scm_cons (scm_int2num (orig.get_octave ()),
+ SCM key = gh_cons (scm_int2num (orig.get_octave ()),
scm_int2num (orig.get_notename ()));
- newlist = scm_cons (scm_cons (key, scm_int2num (orig.get_alteration ())),
+ newlist = gh_cons (gh_cons (key, scm_int2num (orig.get_alteration ())),
newlist);
}
- else if (ly_c_number_p (key))
+ else if (gh_number_p (key))
{
- Pitch orig (0, ly_scm2int (key), ly_scm2int (alter));
+ Pitch orig (0, gh_scm2int (key), gh_scm2int (alter));
orig = orig.transposed (*p);
key =scm_int2num (orig.get_notename ());
alter = scm_int2num (orig.get_alteration ());
- newlist = scm_cons (scm_cons (key, alter), newlist);
+ newlist = gh_cons (gh_cons (key, alter), newlist);
}
}
return scm_reverse_x (newlist, SCM_EOL);
alist_equal_p (SCM a, SCM b)
{
for (SCM s = a;
- ly_c_pair_p (s); s = ly_cdr (s))
+ gh_pair_p (s); s = ly_cdr (s))
{
SCM key = ly_caar (s);
SCM val = ly_cdar (s);
SCM l = scm_assoc (key, b);
if (l == SCM_BOOL_F
- || !ly_c_equal_p ( ly_cdr (l), val))
+ || !gh_equal_p ( ly_cdr (l), val))
return false;
}
{
if (ev_)
{
- extender_ = make_spanner ("LyricExtender", ev_->self_scm ());
+ extender_ = make_spanner ("LyricExtender");
+ announce_grob (extender_, ev_->self_scm ());
}
}
{
if (pending_extender_ && pending_extender_->get_bound (RIGHT))
{
+ typeset_grob (pending_extender_);
pending_extender_ = 0;
}
if (extender_ || pending_extender_)
{
- Context *voice = get_voice_to_lyrics (context ());
+ Context *voice = get_voice_to_lyrics (daddy_context_);
Grob* h = (voice) ? get_current_note_head (voice) : 0;
if (h)
if (!sp->get_bound (RIGHT))
{
SCM heads = sp->get_property ("heads");
- if (ly_c_pair_p (heads))
+ if (gh_pair_p (heads))
{
- Item* it = dynamic_cast<Item*> (unsmob_grob (ly_car (heads)));
+ Item* it = dynamic_cast<Item*> (unsmob_grob (gh_car (heads)));
if (it)
sp->set_bound (RIGHT, it);
}
if (!extender_->get_bound (RIGHT))
extender_->warning (_ ("unterminated extender"));
+ typeset_grob (extender_);
extender_ = 0;
}
if (!pending_extender_->get_bound (RIGHT))
pending_extender_->warning (_("unterminated extender"));
+ typeset_grob (pending_extender_);
pending_extender_ =0;
}
}
void
Figured_bass_engraver::stop_translation_timestep ()
{
- figure_ = 0;
+ if (figure_)
+ {
+ typeset_grob (figure_);
+ figure_ = 0;
+ }
figures_.clear ();
rest_req_ = 0;
{
if (rest_req_)
{
- figure_ = make_item ("BassFigure", rest_req_->self_scm ());
+ figure_ = make_item ("BassFigure");
+ announce_grob (figure_, rest_req_->self_scm ()); // todo
figure_->set_property ("text" , scm_makfrom0str ("-"));
}
else if (figures_.size ())
{
SCM proc = get_property ("bassFigureFormatFunction");
- if (ly_c_procedure_p (proc))
+ if (gh_procedure_p (proc))
{
SCM l = SCM_EOL;
SCM * t = &l;
*t = scm_cons (figures_[i]->self_scm (), SCM_EOL);
t = SCM_CDRLOC (*t);
}
- figure_ = make_item ("BassFigure", figures_[0]->self_scm ());
- scm_call_3 (proc, l, context ()->self_scm (),
+ figure_ = make_item ("BassFigure");
+ scm_call_3 (proc, l, daddy_context_->self_scm (),
figure_->self_scm ());
+ announce_grob (figure_, figures_[0]->self_scm ()); // todo
}
}
}
void
Fingering_engraver::make_script (Direction d, Music *r, int i)
{
- Item *fingering = make_item ("Fingering", r->self_scm ());
+ Item *fingering = make_item ("Fingering");
Axis a = Y_AXIS;
Axis other = other_axis (a);
// Hmm
int priority = 200;
SCM s = fingering->get_property ("script-priority");
- if (ly_c_number_p (s))
- priority = ly_scm2int (s);
+ if (gh_number_p (s))
+ priority = gh_scm2int (s);
/* See script-engraver.cc */
priority += i;
- fingering->set_property ("script-priority", scm_int2num (priority));
+ fingering->set_property ("script-priority", gh_int2scm (priority));
if (!is_direction (fingering->get_property ("direction")))
{
if (d)
- fingering->set_property ("direction", scm_int2num (d));
+ fingering->set_property ("direction", gh_int2scm (d));
else
- fingering->set_property ("direction", scm_int2num (RIGHT));
+ fingering->set_property ("direction", gh_int2scm (RIGHT));
}
SCM dig = r->get_property ("digit");
- fingering->set_property ("text", scm_number_to_string (dig, scm_int2num (10)));
+ fingering->set_property ("text", scm_number_to_string (dig, gh_int2scm (10)));
+ announce_grob (fingering, r->self_scm ());
fingerings_.push (fingering);
}
if (!fingerings_.size ())
return;
+ for (int i=0; i < fingerings_.size (); i++)
+ {
+ Item *ti = fingerings_[i];
+ typeset_grob (ti);
+ }
fingerings_.clear ();
}
#include "font-metric.hh"
#include "font-interface.hh"
#include "grob.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "warn.hh"
/*
- font-metric.cc -- implement Font_metric
+ font-metric.cc -- implement Font_metric
source file of the GNU LilyPond music typesetter
#include <math.h>
#include <ctype.h>
-#include "scaled-font-metric.hh"
#include "virtual-methods.hh"
#include "warn.hh"
#include "stencil.hh"
#include "font-metric.hh"
#include "string.hh"
-Real
-Font_metric::design_size () const
+Box
+Font_metric::text_dimension (String text) const
{
- return 1.0;
-}
+ Interval ydims;
+ Real w=0.0;
+
+ for (int i = 0; i < text.length (); i++)
+ {
+
+ switch (text[i])
+ {
+ case '\\':
+ // accent marks use width of base letter
+ if (i +1 < text.length ())
+ {
+ if (text[i+1]=='\'' || text[i+1]=='`' || text[i+1]=='"' ||
+ text[i+1]=='^')
+ {
+ i++;
+ break;
+ }
+ // for string width \\ is a \ and \_ is a _.
+ if (text[i+1]=='\\' || text[i+1]=='_')
+ {
+ break;
+ }
+ }
+
+ for (i++; (i < text.length ()) && !isspace (text[i])
+ && text[i]!='{' && text[i]!='}'; i++)
+ ;
+ // ugh.
+ i--; // Compensate for the increment in the outer loop!
+ break;
+ case '{': // Skip '{' and '}'
+ case '}':
+ break;
+
+ default:
+ Box b = get_ascii_char ((unsigned char)text[i]);
+
+ // Ugh, use the width of 'x' for unknown characters
+ if (b[X_AXIS].length () == 0)
+ b = get_ascii_char ((unsigned char)'x');
+
+ w += b[X_AXIS].length ();
+ ydims.unite (b[Y_AXIS]);
+ break;
+ }
+ }
+ if (ydims.is_empty ())
+ ydims = Interval (0,0);
-String
-Font_metric::coding_scheme () const
-{
- return "FontSpecific";
+ return Box (Interval (0, w), ydims);
}
-Stencil
-Font_metric::find_by_name (String s) const
+
+
+Font_metric::~Font_metric ()
{
- int idx = name_to_index (s);
- Box b;
-
- SCM expr = SCM_EOL;
- if (idx >= 0)
- {
- expr = scm_list_3 (ly_symbol2scm ("char"),
- self_scm (),
- scm_int2num (index_to_ascii (idx)));
- b = get_indexed_char (idx);
- }
-
- Stencil q (b, expr);
- return q;
}
Font_metric::Font_metric ()
{
}
-
-Font_metric::~Font_metric ()
-{
-}
-
int
Font_metric::count () const
{
Box
Font_metric::get_ascii_char (int) const
{
- return Box (Interval (0, 0), Interval (0, 0));
+ return Box (Interval (0,0),Interval (0,0));
}
Box
return get_ascii_char (k);
}
+
int
Font_metric::name_to_index (String) const
{
}
Offset
-Font_metric::get_indexed_wxwy (int) const
+Font_metric::get_indexed_wxwy (int )const
{
- return Offset (0, 0);
+ return Offset (0,0);
}
void
-Font_metric::derived_mark () const
+Font_metric::derived_mark ()const
{
+
}
SCM
Font_metric::mark_smob (SCM s)
{
- Font_metric *m = (Font_metric*) SCM_CELL_WORD_1 (s);
+ Font_metric * m = (Font_metric*) SCM_CELL_WORD_1 (s);
+
m->derived_mark ();
return m->description_;
}
IMPLEMENT_DEFAULT_EQUAL_P (Font_metric);
IMPLEMENT_TYPE_P (Font_metric, "ly:font-metric?");
+Stencil
+Font_metric::find_by_name (String) const
+{
+ Stencil m ;
+ return m;
+}
-LY_DEFINE (ly_find_glyph_by_name, "ly:find-glyph-by-name",
- 2, 0, 0,
+LY_DEFINE (ly_find_glyph_by_name, "ly:find-glyph-by-name", 2 , 0, 0,
(SCM font, SCM name),
"This function retrieves a Stencil for the glyph named @var{name} "
"in "
{
Font_metric *fm = unsmob_metrics (font);
SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "font-metric");
- SCM_ASSERT_TYPE (ly_c_string_p (name), name, SCM_ARG2, __FUNCTION__, "string");
+ SCM_ASSERT_TYPE (gh_string_p (name), name, SCM_ARG2, __FUNCTION__, "string");
- Stencil m = fm->find_by_name (ly_scm2string (name));
+ Stencil m = fm->find_by_name (ly_scm2string (name));
- /* TODO: make optional argument for default if not found. */
+ /*
+ TODO: make optional argument for default if not found.
+ */
return m.smobbed_copy ();
}
-LY_DEFINE (ly_get_glyph, "ly:get-glyph",
- 2, 0, 0,
+LY_DEFINE (ly_get_glyph, "ly:get-glyph", 2 , 0, 0,
(SCM font, SCM index),
- "Retrieve a Stencil for the glyph numbered @var{index} "
- "in @var{font}.")
+ "This function retrieves a Stencil for the glyph numbered @var{index} in "
+"@var{font}. ")
{
Font_metric *fm = unsmob_metrics (font);
SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "font-metric");
- SCM_ASSERT_TYPE (ly_c_number_p (index), index, SCM_ARG2, __FUNCTION__, "number");
+ SCM_ASSERT_TYPE (gh_number_p (index), index, SCM_ARG2, __FUNCTION__, "number");
- return fm->get_ascii_char_stencil (ly_scm2int (index)).smobbed_copy ();
+ return fm->get_ascii_char_stencil (gh_scm2int (index)).smobbed_copy ();
}
-LY_DEFINE (ly_text_dimension,"ly:text-dimension",
- 2, 0, 0,
+LY_DEFINE (ly_text_dimension,"ly:text-dimension", 2 , 0, 0,
(SCM font, SCM text),
- "Given the font metric in @var{font} and the string @var{text}, "
- "compute the extents of that text in that font. "
- "The return value is a pair of number-pairs.")
+ "Given the font metric in @var{font} and the string @var{text}, compute "
+"the extents of that text in that font. The return value is a pair of "
+"number-pairs.")
{
Box b;
- Modified_font_metric*fm = dynamic_cast<Modified_font_metric*>
- (unsmob_metrics (font));
- SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "modified font metric");
- SCM_ASSERT_TYPE (ly_c_string_p (text), text, SCM_ARG2, __FUNCTION__, "string");
-
- b = fm->text_dimension (ly_scm2string (text));
-
- return scm_cons (ly_interval2scm (b[X_AXIS]), ly_interval2scm (b[Y_AXIS]));
-}
-
-LY_DEFINE (ly_font_filename,"ly:font-filename",
- 1, 0, 0,
- (SCM font),
- "Given the font metric @var{font}, "
- "return the corresponding file name.")
-{
Font_metric *fm = unsmob_metrics (font);
SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "font-metric");
- return ly_car (fm->description_);
-}
-
+ SCM_ASSERT_TYPE (gh_string_p (text), text, SCM_ARG2, __FUNCTION__, "string");
-#include "afm.hh"
-
-LY_DEFINE (ly_font_name,"ly:font-name",
- 1, 0, 0,
- (SCM font),
- "Given the font metric @var{font}, "
- "return the corresponding name.")
-{
- Font_metric *fm = unsmob_metrics (font);
-
- SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "font-metric");
-
-
- if (Modified_font_metric* mfm = dynamic_cast<Modified_font_metric*> (fm))
- return ly_font_name (mfm->original_font ()->self_scm ());
- else if (Adobe_font_metric* afm = dynamic_cast<Adobe_font_metric*> (fm))
- {
- return scm_makfrom0str (afm->font_info_->gfi->fontName);
- }
- else
- return SCM_BOOL_F;
-}
-
-
-
-LY_DEFINE (ly_font_magnification,"ly:font-magnification", 1 , 0, 0,
- (SCM font),
- "Given the font metric @var{font}, return the "
- "magnification, relative to the current outputscale.")
-{
- Font_metric *fm = unsmob_metrics (font);
- SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "font-metric");
- return ly_cdr (fm->description_);
-}
-
-LY_DEFINE (ly_font_design_size,"ly:font-design-size", 1 , 0, 0,
- (SCM font),
- "Given the font metric @var{font}, return the "
- "design size, relative to the current outputscale.")
-{
- Font_metric *fm = unsmob_metrics (font);
- SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "font-metric");
- return scm_make_real (fm->design_size ());
-}
-
-
-
-int
-Font_metric::index_to_ascii (int i) const
-{
- return i;
+ b = fm->text_dimension (ly_scm2string (text));
+
+ return gh_cons (ly_interval2scm (b[X_AXIS]), ly_interval2scm (b[Y_AXIS]));
}
Stencil
-Font_metric::get_ascii_char_stencil (int code) const
+Font_metric::get_ascii_char_stencil (int code) const
{
- SCM at = scm_list_3 (ly_symbol2scm ("char"),
- this->self_scm (),
- scm_int2num (code));
+ SCM at = scm_list_n (ly_symbol2scm ("char"), gh_int2scm (code),
+ SCM_UNDEFINED);
+ at = fontify_atom (this, at);
Box b = get_ascii_char (code);
return Stencil (b, at);
}
Stencil
-Font_metric::get_indexed_char_stencil (int code) const
+Font_metric::get_indexed_char_stencil (int code) const
{
- SCM at = scm_list_3 (ly_symbol2scm ("char"),
- self_scm (),
- scm_int2num (code));
+ SCM at = scm_list_n (ly_symbol2scm ("char"), gh_int2scm (code),
+ SCM_UNDEFINED);
+ at = fontify_atom (this, at);
Box b = get_indexed_char (code);
return Stencil (b, at);
}
-
-int
-/*Font_metric::*/
-get_encoded_index (Font_metric *m, String input_coding, int code)
-{
- String font_coding = m->coding_scheme ();
- if (font_coding == input_coding)
- return code;
- SCM s = scm_call_3 (ly_scheme_function ("encoded-index"),
- scm_makfrom0str (input_coding.to_str0 ()),
- scm_makfrom0str (font_coding.to_str0 ()),
- scm_int2num (code));
- return ly_scm2int (s);
-}
#include <math.h>
-
-#include "all-font-metrics.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "font-interface.hh"
#include "warn.hh"
"in the alist chain @var{chain}.\n"
"(An alist chain is a list of alists, containing grob properties).\n")
{
- Output_def *pap = unsmob_output_def (paper);
+ Paper_def *pap = unsmob_paper (paper);
SCM_ASSERT_TYPE (pap, paper, SCM_ARG1, __FUNCTION__, "paper definition");
Font_metric *fm = select_font (pap, chain);
(SCM paper, SCM name),
"Return the paper variable @var{name}.")
{
- Output_def *pap = unsmob_output_def (paper);
+ Paper_def *pap = unsmob_paper (paper);
SCM_ASSERT_TYPE (pap, paper, SCM_ARG1, __FUNCTION__, "paper definition");
- return scm_make_real (pap->get_dimension (name));
+ return gh_double2scm (pap->get_realvar (name));
}
bool
return (val == SCM_BOOL_F || field_val == ly_symbol2scm ("*") || field_val == val);
}
-
-/*
- TODO: this triggers a great number of font-loads (feta11 upto
- parmesan23). We could make a Delayed_load_font_metric for which the
- design size is specced in advance.
- */
Font_metric*
-get_font_by_design_size (Output_def* paper, Real requested,
- SCM font_vector, SCM input_encoding_name)
+get_font_by_design_size (Paper_def* paper, Real requested,
+ SCM font_vector)
{
int n = SCM_VECTOR_LENGTH (font_vector);
Real size = 1e6;
for (; i < n; i++)
{
- SCM entry = SCM_VECTOR_REF (font_vector, i);
- Font_metric *fm = unsmob_metrics (scm_force (entry));
- size = fm->design_size ();
-
+ size = gh_scm2double (gh_car (SCM_VECTOR_REF (font_vector, i)));
if (size > requested)
break ;
last_size = size;
size = last_size;
}
}
-
- Font_metric *fm = unsmob_metrics (scm_force (SCM_VECTOR_REF (font_vector, i)));
- return
- find_scaled_font (paper, fm, requested / size, input_encoding_name);
-
+
+ return paper->find_font (gh_cdr (SCM_VECTOR_REF (font_vector, i)),
+ requested / size);
}
Font_metric*
-get_font_by_mag_step (Output_def* paper, Real requested_step,
- SCM font_vector, Real default_size, SCM input_encoding_name)
+get_font_by_mag_step (Paper_def* paper, Real requested_step,
+ SCM font_vector, Real default_size)
{
return get_font_by_design_size (paper,
default_size * pow (2.0, requested_step / 6.0),
- font_vector, input_encoding_name);
+ font_vector);
}
Font_metric *
-select_encoded_font (Output_def *paper, SCM chain, SCM encoding_name)
+select_font (Paper_def *paper, SCM chain)
{
SCM name = ly_assoc_chain (ly_symbol2scm ("font-name"), chain);
- if (!ly_c_pair_p (name) || !ly_c_string_p (ly_cdr (name)))
+ if (!gh_pair_p (name) || !gh_string_p (gh_cdr (name)))
{
SCM fonts = paper->lookup_variable (ly_symbol2scm ("fonts"));
name = properties_to_font_size_family (fonts, chain);
}
else
- name = ly_cdr (name);
+ name = gh_cdr (name);
+
- if (ly_c_string_p (name))
+ if (gh_string_p (name))
{
SCM mag = ly_assoc_chain (ly_symbol2scm ("font-magnification"), chain);
- Real rmag = ly_c_pair_p (mag) ? robust_scm2double (ly_cdr (mag), 1.0) : 1;
-
- Font_metric * fm = all_fonts_global->find_font (ly_scm2string (name));
-
-
- return find_scaled_font (paper, fm, rmag, encoding_name);
+ Real rmag = gh_pair_p (mag) ? robust_scm2double (gh_cdr (mag), 1.0) : 1;
+
+ return paper->find_font (name, rmag);
}
else if (scm_instance_p (name))
{
SCM font_size = ly_assoc_chain (ly_symbol2scm ("font-size"), chain);
Real req = 0.0;
- if (ly_c_pair_p (font_size))
- req = ly_scm2double (ly_cdr (font_size));
+ if (gh_pair_p (font_size))
+ req = gh_scm2double (ly_cdr (font_size));
return get_font_by_mag_step (paper, req,
- vec, ly_scm2double (base_size), encoding_name);
+ vec, gh_scm2double (base_size));
}
assert (0);
return 0;
}
-Font_metric *
-select_font (Output_def *paper, SCM chain)
-{
- return select_encoded_font (paper, chain, SCM_EOL);
-}
+
/*
We only want to process a grob once.
*/
- if (gi.origin_trans_->context () != context ())
+ if (gi.origin_trans_->daddy_context_ != daddy_context_)
return ;
- if (ly_c_number_p (sz) && ly_scm2double (sz))
+ if (gh_number_p (sz) && gh_scm2double (sz))
{
- Real font_size = ly_scm2double (sz);
+ Real font_size = gh_scm2double (sz);
font_size += robust_scm2double (gi.grob_->get_property ("font-size"), 0);
- gi.grob_->set_property ("font-size", scm_make_real (font_size));
+ gi.grob_->set_property ("font-size", gh_double2scm (font_size));
}
}
SCM busy = get_property ("busyGrobs");
Moment now = now_mom ();
- while (ly_c_pair_p (busy) && unsmob_moment (ly_caar (busy))->main_part_ == now.main_part_)
- busy = ly_cdr (busy);
+ while (gh_pair_p (busy) && unsmob_moment (gh_caar (busy))->main_part_ == now.main_part_)
+ busy = gh_cdr (busy);
- while (ly_c_pair_p (busy))
+ while (gh_pair_p (busy))
{
- Grob *g = unsmob_grob (ly_cdar (busy));
+ Grob *g = unsmob_grob (gh_cdar (busy));
if (Rhythmic_head::has_interface (g))
{
get_score_engraver ()->forbid_breaks ();
}
- busy = ly_cdr (busy);
+ busy = gh_cdr (busy);
}
}
if (!strlen (doc))
return ;
- if (!ly_c_vector_p (doc_hash_table ))
- doc_hash_table = scm_make_vector (scm_int2num (59), SCM_EOL);
+ if (!gh_vector_p (doc_hash_table ))
+ doc_hash_table = scm_make_vector (gh_int2scm (59), SCM_EOL);
String s = String (" - ") + "LilyPond procedure: " + fname + " " + varlist
+ "\n" + doc ;
scm_set_procedure_property_x (func, ly_symbol2scm ("documentation"),
scm_makfrom0str (s.to_str0 ()));
- SCM entry = scm_cons (scm_makfrom0str (varlist), scm_makfrom0str (doc));
+ SCM entry = gh_cons (scm_makfrom0str (varlist), scm_makfrom0str (doc));
scm_hashq_set_x (doc_hash_table, ly_symbol2scm (fname), entry);
}
{
if (event_)
{
- line_ = make_spanner ("Glissando", event_->self_scm ());
+ line_ = make_spanner ("Glissando");
+ announce_grob (line_, event_->self_scm ());
}
}
{
if (last_line_ && last_line_->get_bound (RIGHT))
{
+ typeset_grob (last_line_);
last_line_ =0;
}
if (line_)
#include "global-context.hh"
#include "score-context.hh"
#include "context-def.hh"
-#include "output-def.hh"
+#include "music-output-def.hh"
#include "grace-fixup.hh"
-Global_context::Global_context (Output_def *o, Moment final)
+Global_context::Global_context (Music_output_def *o, Moment final)
{
output_def_ = o;
final_mom_ = final;
- definition_ = find_context_def (o, ly_symbol2scm ("Global"));
+ definition_ = o->find_context_def (ly_symbol2scm ("Global"));
unsmob_context_def (definition_)->apply_default_property_operations (this);
accepts_list_ = scm_list_1 (ly_symbol2scm ("Score"));
}
-Output_def*
+Music_output_def*
Global_context::get_output_def () const
{
return output_def_;
Score_context*
Global_context::get_score_context () const
{
- return (ly_c_pair_p (context_list_))
- ? dynamic_cast<Score_context*> (unsmob_context (ly_car (context_list_)))
+ return (gh_pair_p (context_list_))
+ ? dynamic_cast<Score_context*> (unsmob_context (gh_car (context_list_)))
: 0;
}
if (!get_score_context ())
{
SCM key = ly_symbol2scm ("Score");
- Context_def * t = unsmob_context_def (find_context_def (get_output_def (), key));
+ Context_def * t = unsmob_context_def (get_output_def ()
+ ->find_context_def (key));
if (!t)
error (_f ("can't find `%s' context", "Score"));
Global_context::apply_finalizations ()
{
SCM lst = get_property ("finalizations");
- set_property ("finalizations", SCM_EOL);
- for (SCM s = lst; ly_c_pair_p (s); s = ly_cdr (s))
- /* TODO: make safe. */
- scm_primitive_eval (ly_car (s));
+ set_property ("finalizations" , SCM_EOL);
+ for (SCM s = lst ; gh_pair_p (s); s = gh_cdr (s))
+ {
+ scm_primitive_eval (gh_car (s)); // TODO: make safe.
+ }
}
-/* Add a function to execute before stepping to the next time step. */
+/*
+ Add a function to execute before stepping to the next time step.
+*/
void
Global_context::add_finalization (SCM x)
{
SCM lst = get_property ("finalizations");
lst = scm_cons (x, lst);
- set_property ("finalizations", lst);
+ set_property ("finalizations" ,lst);
}
Moment
#include "main.hh"
#include "paper-column.hh"
#include "paper-score.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "simple-spacer.hh"
#include "system.hh"
Break_node first_node ;
optimal_paths.push (first_node);
- bool ragged_right = to_boolean (pscore_->paper_->c_variable ("raggedright"));
- bool ragged_last = to_boolean (pscore_->paper_->c_variable ("raggedlast"));
+ bool ragged_right = to_boolean (pscore_->paper_->get_scmvar ("raggedright"));
+ bool ragged_last = to_boolean (pscore_->paper_->get_scmvar ("raggedlast"));
Real worst_force = 0.0;
for (int break_idx = 1; break_idx< breaks.size (); break_idx++)
cp.cols_ = line;
Interval line_dims
- = line_dimensions_int (pscore_->paper_, optimal_paths[start_idx].line_);
+ = pscore_->paper_->line_dimensions_int (optimal_paths[start_idx].line_);
Simple_spacer * sp = generate_spacing_problem (line, line_dims);
bool last_line = break_idx == breaks.size ()-1;
bool ragged = ragged_right
if (pc->original_)
{
SCM pen = pc->get_property ("penalty");
- if (ly_c_number_p (pen) && fabs (ly_scm2double (pen)) < 10000)
+ if (gh_number_p (pen) && fabs (gh_scm2double (pen)) < 10000)
{
- break_penalties += ly_scm2double (pen);
+ break_penalties += gh_scm2double (pen);
}
}
void
Grace_iterator::process (Moment m)
{
- Moment main;
+ Moment main ;
main.main_part_ = - start_mom_.grace_part_ + m.grace_part_;
Music_wrapper_iterator::process (main);
- /* We can safely do this, since \grace should always be inside
- sequential. */
+ /*
+ We can safely do this, since \grace should always be inside
+ sequential.
+ */
descend_to_child (child_iter_->get_outlet ());
}
/* all other combinations should be valid (unless I made a
mistake) */
- primitive->set_property ("prefix-set", scm_int2num (prefix_set));
+ primitive->set_property ("prefix-set", gh_int2scm (prefix_set));
}
}
Music *music_cause = primitives[i].music_cause ();
int context_info = 0;
int pitch = unsmob_pitch (music_cause->get_property ("pitch"))->steps ();
- int prefix_set = ly_scm2int (primitive->get_property ("prefix-set"));
+ int prefix_set = gh_scm2int (primitive->get_property ("prefix-set"));
if (prefix_set & PES_OR_FLEXA)
if (!i) // ligature may not start with 2nd head of pes or flexa
if (prev_primitive)
prev_primitive->set_property ("context-info",
- scm_int2num (prev_context_info));
+ gh_int2scm (prev_context_info));
prev_primitive = primitive;
prev_prefix_set = prefix_set;
prev_context_info = context_info;
}
if (prev_primitive)
prev_primitive->set_property ("context-info",
- scm_int2num (prev_context_info));
+ gh_int2scm (prev_context_info));
}
void
{
String str;
int prefix_set =
- ly_scm2int (primitive->get_property ("prefix-set"));
+ gh_scm2int (primitive->get_property ("prefix-set"));
check_prefix ("virga", VIRGA, prefix_set, &str);
check_prefix ("stropha", STROPHA, prefix_set, &str);
check_prefix ("inclinatum", INCLINATUM, prefix_set, &str);
Link_array<Context>
Grob_info::origin_contexts (Translator* end) const
{
- Context * t = origin_trans_->context ();
+ Context * t = origin_trans_->daddy_context_;
Link_array<Context> r;
do {
r.push (t);
- t = t->get_parent_context ();
- } while (t && t != end->context ());
+ t = t->daddy_context_;
+ } while (t && t != end->daddy_context_);
return r;
}
-/*
- grob-interface.cc -- implement graphic objects interface
-
- source file of the GNU LilyPond music typesetter
-
- (c) 2002--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#include "protected-scm.hh"
+#include "protected-scm.hh"
#include "grob-interface.hh"
#include "lily-guile.hh"
#include "grob.hh"
SCM d = scm_makfrom0str (descr);
SCM l = parse_symbol_list (vars);
+
ly_add_interface (s,d,l);
}
LY_DEFINE (ly_add_interface, "ly:add-interface", 3,0,0, (SCM a, SCM b, SCM c),
"Add an interface description.")
{
- SCM_ASSERT_TYPE (ly_c_symbol_p (a), a, SCM_ARG1, __FUNCTION__, "symbol");
- SCM_ASSERT_TYPE (ly_c_string_p (b), b, SCM_ARG2, __FUNCTION__, "string");
- SCM_ASSERT_TYPE (ly_c_list_p (c), c, SCM_ARG3, __FUNCTION__, "list of syms");
- if (!ly_c_vector_p (all_ifaces))
- all_ifaces = scm_make_vector (scm_int2num (40), SCM_EOL);
+ SCM_ASSERT_TYPE (gh_symbol_p (a), a, SCM_ARG1, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE (gh_string_p (b), b, SCM_ARG2, __FUNCTION__, "string");
+ SCM_ASSERT_TYPE (gh_list_p (c), c, SCM_ARG3, __FUNCTION__, "list of syms");
+ if (!gh_vector_p (all_ifaces))
+ {
+ all_ifaces = scm_make_vector (gh_int2scm (40), SCM_EOL);
+ }
SCM entry = scm_list_n (a, b, c, SCM_UNDEFINED);
scm_hashq_set_x (all_ifaces, a, entry);
+
return SCM_UNSPECIFIED;
}
return all_ifaces;
}
-
void
check_interfaces_for_property (Grob const *me, SCM sym)
{
return ;
}
- SCM ifs = me->get_property ("interfaces");
+ SCM ifs = me->get_property ("interfaces");
bool found = false;
- for (; !found && ly_c_pair_p (ifs); ifs =ly_cdr (ifs))
+ for (; !found && gh_pair_p (ifs); ifs =gh_cdr (ifs))
{
- SCM iface = scm_hashq_ref (all_ifaces , ly_car (ifs), SCM_BOOL_F);
+ SCM iface = scm_hashq_ref (all_ifaces , gh_car (ifs), SCM_BOOL_F);
if (iface == SCM_BOOL_F)
{
- String msg = to_string (_f ("Unknown interface `%s'",
- ly_symbol2string (ly_car (ifs)).to_str0 ()));
+ String msg = to_string ("Unknown interface `%s'",
+ ly_symbol2string (gh_car (ifs)).to_str0 ());
programming_error (msg);
continue;
}
- found= found || (scm_c_memq (sym, ly_caddr (iface)) != SCM_BOOL_F);
+ found= found || (scm_c_memq (sym, gh_caddr (iface)) != SCM_BOOL_F);
}
if (!found)
{
- String str = to_string (_f ("Grob `%s' has no interface for property `%s'",
- me->name ().to_str0 (),
- ly_symbol2string (sym).to_str0 ()));
- programming_error (str);
+ String str = to_string ("Grob %s has no interface for property %s",
+ me->name ().to_str0 (),
+ ly_symbol2string (sym).to_str0 ());
+ programming_error (str);
}
}
void
Grob_pq_engraver::initialize ()
{
- context ()->set_property ("busyGrobs", SCM_EOL);
+ daddy_context_->set_property ("busyGrobs", SCM_EOL);
}
LY_DEFINE (ly_grob_pq_less_p, "ly:grob-pq-less?",
2, 0 ,0, (SCM a, SCM b),
"Compare 2 grob priority queue entries. Internal")
{
- if (Moment::compare (*unsmob_moment (ly_car (a)),
- *unsmob_moment (ly_car (b))) < 0)
+ if (Moment::compare (*unsmob_moment (gh_car (a)),
+ *unsmob_moment (gh_car (b))) < 0)
return SCM_BOOL_T;
else
return SCM_BOOL_F;
SCM busy= get_property ("busyGrobs");
busy = scm_merge_x (lst, busy, ly_grob_pq_less_p_proc);
- context ()->set_property ("busyGrobs", busy);
+ daddy_context_->set_property ("busyGrobs", busy);
}
}
Moment now = now_mom ();
SCM start_busy = get_property ("busyGrobs");
SCM busy = start_busy;
- while (ly_c_pair_p (busy) && *unsmob_moment (ly_caar (busy)) == now)
+ while (gh_pair_p (busy) && *unsmob_moment (gh_caar (busy)) == now)
{
- busy = ly_cdr (busy);
+ busy = gh_cdr (busy);
}
if (start_busy != busy)
- context ()->set_property ("busyGrobs", busy);
+ daddy_context_->set_property ("busyGrobs", busy);
}
void
SCM start_busy = get_property ("busyGrobs");
SCM busy = start_busy;
- while (ly_c_pair_p (busy) && *unsmob_moment (ly_caar (busy)) < now)
+ while (gh_pair_p (busy) && *unsmob_moment (gh_caar (busy)) < now)
{
/*
The grob-pq-engraver is not water tight, and stuff like
tupletSpannerDuration confuses it.
*/
- busy = ly_cdr (busy);
+ busy = gh_cdr (busy);
}
if (start_busy != busy)
- context ()->set_property ("busyGrobs", busy);
+ daddy_context_->set_property ("busyGrobs", busy);
}
#include "group-interface.hh"
#include "misc.hh"
#include "paper-score.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "grob.hh"
#include "spanner.hh"
#include "item.hh"
if (handle != SCM_BOOL_F)
{
- scm_set_cdr_x (handle, scm_cons (thing, ly_cdr (handle)));
+ gh_set_cdr_x (handle, gh_cons (thing, gh_cdr (handle)));
}
else
{
mutable prop list.
*/
handle = scm_sloppy_assq (sym, immutable_property_alist_);
- SCM tail = (handle != SCM_BOOL_F) ? ly_cdr (handle) : SCM_EOL;
- SCM val = scm_cons (thing, tail);
+ SCM tail = (handle != SCM_BOOL_F) ? gh_cdr (handle) : SCM_EOL;
+ SCM val = gh_cons (thing, tail);
- mutable_property_alist_ = scm_cons (scm_cons (sym, val),
+ mutable_property_alist_ = gh_cons (gh_cons (sym, val),
mutable_property_alist_);
}
}
Grob::internal_set_property (SCM s, SCM v)
{
/* Perhaps we simply do the assq_set, but what the heck. */
- if (!is_live ())
+ if (!live ())
return;
if (internal_type_checking_global_b)
s = scm_sloppy_assq (sym, immutable_property_alist_);
- if (internal_type_checking_global_b && ly_c_pair_p (s))
+ if (internal_type_checking_global_b && gh_pair_p (s))
{
- if (!type_check_assignment (sym, ly_cdr (s),
+ if (!type_check_assignment (sym, gh_cdr (s),
ly_symbol2scm ("backend-type?")))
abort ();
bool
-Grob::is_live () const
+Grob::live () const
{
return immutable_property_alist_ != SCM_EOL;
}
#include "warn.hh"
#include "spanner.hh"
#include "item.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "system.hh"
-LY_DEFINE (ly_grob_set_property_x, "ly:grob-set-property!",
- 3, 0, 0, (SCM grob, SCM sym, SCM val),
- "Set @var{sym} in grob @var{grob} to value @var{val}")
+LY_DEFINE (ly_grob_set_property,"ly:grob-set-property!", 3, 0, 0,
+ (SCM grob, SCM sym, SCM val),
+ "Set @var{sym} in grob @var{grob} to value @var{val}")
{
- Grob *sc = unsmob_grob (grob);
+ Grob * sc = unsmob_grob (grob);
SCM_ASSERT_TYPE (sc, grob, SCM_ARG1, __FUNCTION__, "grob");
- SCM_ASSERT_TYPE (ly_c_symbol_p (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE (gh_symbol_p (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
if (!type_check_assignment (sym, val, ly_symbol2scm ("backend-type?")))
error ("typecheck failed");
return SCM_UNSPECIFIED;
}
-LY_DEFINE (ly_grob_property, "ly:grob-property",
+LY_DEFINE (ly_get_property, "ly:grob-property",
2, 0, 0, (SCM grob, SCM sym),
"Return the value of a value in grob @var{g} of property @var{sym}. "
"It will return @code{' ()} (end-of-list) "
{
Grob *sc = unsmob_grob (grob);
SCM_ASSERT_TYPE (sc, grob, SCM_ARG1, __FUNCTION__, "grob");
- SCM_ASSERT_TYPE (ly_c_symbol_p (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE (gh_symbol_p (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
return sc->internal_get_property (sym);
}
-LY_DEFINE (ly_spanner_get_bound, "ly:spanner-get-bound",
- 2, 0, 0, (SCM slur, SCM dir),
+LY_DEFINE (spanner_get_bound, "ly:spanner-get-bound", 2 , 0, 0,
+ (SCM slur, SCM dir),
"Get one of the bounds of @var{spanner}. @var{dir} is @code{-1} "
"for left, and @code{1} for right.")
{
/* TODO: make difference between scaled and unscalead variable in
calling (i.e different funcs.) */
-LY_DEFINE (ly_grob_paper, "ly:grob-paper",
- 1, 0, 0, (SCM g),
- "Get @code{\\paper} definition from grob @var{g}.")
+LY_DEFINE (ly_grob_paper,"ly:grob-paper", 1, 0, 0,
+ (SCM g),
+ "Get @code{\\paper} definition from grob @var{g}.")
{
Grob * sc = unsmob_grob (g);
SCM_ASSERT_TYPE (sc, g, SCM_ARG1, __FUNCTION__, "grob");
return sc->get_paper ()->self_scm ();
}
-LY_DEFINE (ly_grob_alist_chain, "ly:grob-alist-chain",
- 1, 1, 0, (SCM g, SCM global),
- "Get an alist chain for grob @var{g}, with @var{global} as the "
- "global default. If unspecified, @code{font-defaults} "
- "from the paper block is taken. ")
+
+LY_DEFINE(ly_grob_alist_chain, "ly:grob-alist-chain",
+ 1, 1, 0,
+ (SCM g, SCM global),
+ "Get an alist chain for grob @var{g}, with @var{global} as the "
+ "global default. If unspecified, @code{font-defaults} "
+ "from the paper block is taken. "
+ )
{
- Grob *sc = unsmob_grob (g);
+ Grob * sc = unsmob_grob (g);
SCM_ASSERT_TYPE (sc, g, SCM_ARG1, __FUNCTION__, "grob");
if (global == SCM_UNDEFINED)
- global
- = sc->get_paper ()->lookup_variable (ly_symbol2scm ("font-defaults"));
+ global = sc->get_paper ()->lookup_variable (ly_symbol2scm ("font-defaults"));
return sc->get_property_alist_chain (global);
}
-LY_DEFINE (ly_get_extent, "ly:grob-extent",
- 3, 0, 0, (SCM grob, SCM refp, SCM axis),
+
+LY_DEFINE (ly_get_extent, "ly:grob-extent", 3, 0, 0,
+ (SCM grob, SCM refp, SCM axis),
"Get the extent in @var{axis} direction of @var{grob} relative to "
"the grob @var{refp}")
{
- Grob *sc = unsmob_grob (grob);
- Grob *ref = unsmob_grob (refp);
+ Grob * sc = unsmob_grob (grob);
+ Grob * ref = unsmob_grob (refp);
SCM_ASSERT_TYPE (sc, grob, SCM_ARG1, __FUNCTION__, "grob");
SCM_ASSERT_TYPE (ref, refp, SCM_ARG2, __FUNCTION__, "grob");
+
SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG3, __FUNCTION__, "axis");
- return ly_interval2scm ( sc->extent (ref, Axis (ly_scm2int (axis))));
+ return ly_interval2scm ( sc->extent (ref, Axis (gh_scm2int (axis))));
}
-LY_DEFINE (ly_grob_parent, "ly:grob-parent",
- 2, 0, 0, (SCM grob, SCM axis),
+LY_DEFINE (ly_get_parent, "ly:grob-parent", 2, 0, 0, (SCM grob, SCM axis),
"Get the parent of @var{grob}. @var{axis} is 0 for the X-axis, "
"1 for the Y-axis.")
{
- Grob *sc = unsmob_grob (grob);
+ Grob * sc = unsmob_grob (grob);
SCM_ASSERT_TYPE (sc, grob, SCM_ARG1, __FUNCTION__, "grob");
SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG2, __FUNCTION__, "axis");
- Grob *par = sc->get_parent (Axis (ly_scm2int (axis)));
+ Grob *par = sc->get_parent (Axis (gh_scm2int (axis)));
return par ? par->self_scm () : SCM_EOL;
}
-LY_DEFINE (ly_grob_system, "ly:grob-system",
+LY_DEFINE (ly_get_system, "ly:grob-system",
1, 0, 0, (SCM g),
"Return the System Grob of @var{g}.")
{
return SCM_EOL;
}
-LY_DEFINE (ly_grob_original, "ly:grob-original",
+LY_DEFINE (ly_get_original, "ly:grob-original",
1, 0, 0, (SCM grob),
"Return the unbroken original Grob of @var{grob}.")
{
return me->original_ ? me->original_->self_scm () : me->self_scm ();
}
+/* FIXME: ly prefix? spanner in name? */
/* TODO: maybe we should return a vector -- random access is more
logical for this list? */
-LY_DEFINE (ly_spanner_broken_into, "ly:spanner-broken-into",
+LY_DEFINE (get_broken_into, "ly:spanner-broken-into",
1, 0, 0, (SCM spanner),
"Return broken-into list for @var{spanner}.")
{
SCM s = SCM_EOL;
for (int i = me->broken_intos_.size (); i--;)
- s = scm_cons (me->broken_intos_[i]->self_scm (), s);
+ s = gh_cons (me->broken_intos_[i]->self_scm (), s);
return s;
}
SCM_ASSERT_TYPE (me, g, SCM_ARG1, __FUNCTION__, "grob");
me->suicide ();
- return SCM_UNSPECIFIED;
+ return SCM_UNDEFINED;
}
LY_DEFINE (ly_grob_translate_axis_x, "ly:grob-translate-axis!",
{
Grob *me = unsmob_grob (g);
SCM_ASSERT_TYPE (me, g, SCM_ARG1, __FUNCTION__, "grob");
- SCM_ASSERT_TYPE (ly_c_number_p (d), d, SCM_ARG2, __FUNCTION__, "dimension");
+ SCM_ASSERT_TYPE (gh_number_p (d), d, SCM_ARG2, __FUNCTION__, "dimension");
SCM_ASSERT_TYPE (is_axis (a), a, SCM_ARG3, __FUNCTION__, "axis");
- me->translate_axis (ly_scm2double (d), Axis (ly_scm2int (a)));
- return SCM_UNSPECIFIED;
+ me->translate_axis (gh_scm2double (d), Axis (gh_scm2int (a)));
+ return SCM_UNDEFINED;
}
LY_DEFINE (ly_spanner_p, "ly:spanner?",
Grob *me = unsmob_grob (g);
bool b = dynamic_cast<Spanner*> (me);
- return ly_bool2scm (b);
+ return gh_bool2scm (b);
}
LY_DEFINE (ly_item_p, "ly:item?",
{
Grob *me = unsmob_grob (g);
bool b = dynamic_cast<Item*> (me);
- return ly_bool2scm (b);
+ return gh_bool2scm (b);
}
LY_DEFINE (ly_item_break_dir, "ly:item-break-dir",
{
Item *me = dynamic_cast<Item*> (unsmob_grob (it));
SCM_ASSERT_TYPE (me, it, SCM_ARG1, __FUNCTION__, "Item");
- return scm_int2num (me->break_status_dir ());
+ return gh_int2scm (me->break_status_dir ());
}
subclass.
*/
+//#define HASHING_FOR_MUTABLE_PROPS
#define HASH_SIZE 3
#define INFINITY_MSG "Infinity or NaN encountered"
smobify_self ();
+#ifdef HASHING_FOR_MUTABLE_PROPS
+ mutable_property_alist_ = scm_c_make_hash_table (HASH_SIZE);
+#endif
SCM meta = get_property ("meta");
- if (ly_c_pair_p (meta))
+ if (gh_pair_p (meta))
{
SCM ifs = scm_assoc (ly_symbol2scm ("interfaces"), meta);
*/
bool itc = internal_type_checking_global_b;
internal_type_checking_global_b = false;
- internal_set_property (ly_symbol2scm ("interfaces"), ly_cdr (ifs));
+ internal_set_property (ly_symbol2scm ("interfaces"), gh_cdr (ifs));
internal_type_checking_global_b = itc;
}
if (is_number_pair (xt))
cb = xt;
else if (cb != SCM_BOOL_F
- && !ly_c_procedure_p (cb) && !ly_c_pair_p (cb)
- && ly_c_procedure_p (get_property ("print-function")))
+ && !gh_procedure_p (cb) && !gh_pair_p (cb)
+ && gh_procedure_p (get_property ("print-function")))
cb = stencil_extent_proc;
dim_cache_[a].dimension_ = cb;
pscore_ = 0;
smobify_self ();
+
+#ifdef HASHING_FOR_MUTABLE_PROPS
+ mutable_property_alist_ = scm_c_make_hash_table (HASH_SIZE);
+#endif
}
Grob::~Grob ()
{
+ /*
+ do nothing scm-ish and no unprotecting here.
+ */
}
Grob::stencil_extent (SCM element_smob, SCM scm_axis)
{
Grob *s = unsmob_grob (element_smob);
- Axis a = (Axis) ly_scm2int (scm_axis);
+ Axis a = (Axis) gh_scm2int (scm_axis);
Stencil *m = s->get_stencil ();
Interval e ;
return ly_interval2scm (e);
}
-Output_def*
+Paper_def*
Grob::get_paper () const
{
return pscore_ ? pscore_->paper_ : 0;
}
-
-/*
- Recursively track all dependencies of this Grob. The
- status_ field is used as a mark-field. It is marked with
- BUSY during execution of this function, and marked with FINAL
- when finished.
-
- FUNCPTR is the function to call to update this element.
-*/
void
Grob::calculate_dependencies (int final, int busy, SCM funcname)
{
if (status_ >= final)
return;
- if (status_ == busy)
+ if (status_== busy)
{
programming_error ("Element is busy, come back later");
return;
status_= busy;
- for (SCM d = get_property ("dependencies"); ly_c_pair_p (d);
+ for (SCM d = get_property ("dependencies"); gh_pair_p (d);
d = ly_cdr (d))
{
unsmob_grob (ly_car (d))
SCM proc = internal_get_property (funcname);
- if (ly_c_procedure_p (proc))
- scm_call_1 (proc, this->self_scm ());
+ if (gh_procedure_p (proc))
+ gh_call1 (proc, this->self_scm ());
- status_ = final;
+ status_= final;
}
Stencil *
Grob::get_stencil () const
{
- if (!is_live ())
+ if (!live ())
{
return 0;
}
mol = get_uncached_stencil ();
- if (is_live ())
+ if (live ())
{
Grob *me = (Grob*)this;
me->set_property ("stencil", mol);
SCM proc = get_property ("print-function");
SCM mol = SCM_EOL;
- if (ly_c_procedure_p (proc))
- mol = scm_apply_0 (proc, scm_list_n (this->self_scm (), SCM_UNDEFINED));
+ if (gh_procedure_p (proc))
+ mol = gh_apply (proc, scm_list_n (this->self_scm (), SCM_UNDEFINED));
+
+ Stencil *m = unsmob_stencil (mol);
- if (Stencil *m = unsmob_stencil (mol))
- {
- if (to_boolean (get_property ("transparent")))
- mol = Stencil (m->extent_box (), SCM_EOL).smobbed_copy ();
- else
- {
- SCM origin = ly_symbol2scm ("no-origin");
+ if (unsmob_stencil (mol))
+ {
+ SCM origin = ly_symbol2scm ("no-origin");
- if (store_locations_global_b)
- {
- SCM cause = get_property ("cause");
- if (Music*m = unsmob_music (cause))
- {
- SCM music_origin = m->get_property ("origin");
- if (unsmob_input (music_origin))
- origin = music_origin;
- }
- }
-
- // ugr.
- mol = Stencil (m->extent_box (),
- scm_list_n (origin, m->expr (), SCM_UNDEFINED)
- ). smobbed_copy ();
+ if (store_locations_global_b)
+ {
+ SCM cause = get_property ("cause");
+ if (Music*m = unsmob_music (cause))
+ {
+ SCM music_origin = m->get_property ("origin");
+ if (unsmob_input (music_origin))
+ origin = music_origin;
+ }
}
- }
+
+ // ugr.
+
+ mol = Stencil (m->extent_box (),
+ scm_list_n (origin, m->get_expr (), SCM_UNDEFINED)
+ ). smobbed_copy ();
+
+ m = unsmob_stencil (mol);
+ }
+
+ /*
+ transparent retains dimensions of element.
+ */
+ if (m && to_boolean (get_property ("transparent")))
+ mol = Stencil (m->extent_box (), SCM_EOL).smobbed_copy ();
return mol;
}
programming_error ("Null dependency added");
}
+
void
Grob::handle_broken_dependencies ()
{
because some Spanners have enormously long lists in their
properties.
*/
- for (SCM s = mutable_property_alist_; ly_c_pair_p (s);
- s = ly_cdr (s))
+ for (SCM s = mutable_property_alist_; gh_pair_p (s);
+ s = gh_cdr (s))
{
- sp->substitute_one_mutable_property (ly_caar (s),
- ly_cdar (s));
+ sp->substitute_one_mutable_property (gh_caar (s),
+ gh_cdar (s));
}
}
System *system = get_system ();
- if (is_live ()
+ if (live ()
&& system && common_refpoint (system, X_AXIS) && common_refpoint (system, Y_AXIS))
{
substitute_mutable_properties (system ? system->self_scm () : SCM_UNDEFINED,
void
Grob::suicide ()
{
- if (!is_live ())
+ if (!live ())
return;
+#if 0 // see below.
+ String nm = name ();
+#endif
mutable_property_alist_ = SCM_EOL;
immutable_property_alist_ = SCM_EOL;
dim_cache_[a].offset_callbacks_ = SCM_EOL;
dim_cache_[a].offsets_left_ = 0;
}
+
+#if 0
+ /*
+ This can make debugging a little easier: we can still know what
+ the object used to be. However, since all its links have been
+ broken, it's usually more convenient to set a conditional
+ breakpoint in GDB before the property lists are wiped.
+ */
+ mutable_property_alist_ = scm_acons (ly_symbol2scm ("name"),
+ scm_makfrom0str (nm.to_str0()),
+ mutable_property_alist_
+ );
+#endif
}
void
if (original_)
{
Item * it = dynamic_cast<Item*> (this);
- substitute_mutable_properties (scm_int2num (it->break_status_dir ()),
+ substitute_mutable_properties (gh_int2scm (it->break_status_dir ()),
original_->mutable_property_alist_);
}
}
while (dim_cache_[a].offsets_left_)
{
int l = --me->dim_cache_[a].offsets_left_;
- SCM cb = scm_list_ref (dim_cache_[a].offset_callbacks_, scm_int2num (l));
- SCM retval = scm_call_2 (cb, self_scm (), scm_int2num (a));
+ SCM cb = scm_list_ref (dim_cache_[a].offset_callbacks_, gh_int2scm (l));
+ SCM retval = gh_call2 (cb, self_scm (), gh_int2scm (a));
- Real r = ly_scm2double (retval);
+ Real r = gh_scm2double (retval);
if (isinf (r) || isnan (r))
{
programming_error (INFINITY_MSG);
bool
Grob::is_empty (Axis a)const
{
- return ! (ly_c_pair_p (dim_cache_[a].dimension_) ||
- ly_c_procedure_p (dim_cache_[a].dimension_));
+ return ! (gh_pair_p (dim_cache_[a].dimension_) ||
+ gh_procedure_p (dim_cache_[a].dimension_));
}
Interval
Dimension_cache * d = (Dimension_cache *)&dim_cache_[a];
Interval ext ;
- if (ly_c_pair_p (d->dimension_))
+ if (gh_pair_p (d->dimension_))
;
- else if (ly_c_procedure_p (d->dimension_))
+ else if (gh_procedure_p (d->dimension_))
{
/*
FIXME: add doco on types, and should typecheck maybe?
*/
- d->dimension_= scm_call_2 (d->dimension_, self_scm (), scm_int2num (a));
+ d->dimension_= gh_call2 (d->dimension_, self_scm (), gh_int2scm (a));
}
else
return ext;
- if (!ly_c_pair_p (d->dimension_))
+ if (!gh_pair_p (d->dimension_))
return ext;
ext = ly_scm2interval (d->dimension_);
/*
signs ?
*/
- if (ly_c_pair_p (extra))
+ if (gh_pair_p (extra))
{
- ext[BIGGER] += ly_scm2double (ly_cdr (extra));
- ext[SMALLER] += ly_scm2double (ly_car (extra));
+ ext[BIGGER] += gh_scm2double (ly_cdr (extra));
+ ext[SMALLER] += gh_scm2double (ly_car (extra));
}
extra = get_property (a == X_AXIS
? "minimum-X-extent"
: "minimum-Y-extent");
- if (ly_c_pair_p (extra))
+ if (gh_pair_p (extra))
{
- ext.unite (Interval (ly_scm2double (ly_car (extra)),
- ly_scm2double (ly_cdr (extra))));
+ ext.unite (Interval (gh_scm2double (ly_car (extra)),
+ gh_scm2double (ly_cdr (extra))));
}
ext.translate (x);
Grob *
common_refpoint_of_list (SCM elist, Grob *common, Axis a)
{
- for (; ly_c_pair_p (elist); elist = ly_cdr (elist))
+ for (; gh_pair_p (elist); elist = ly_cdr (elist))
{
Grob * s = unsmob_grob (ly_car (elist));
if (!s)
{
SCM meta = get_property ("meta");
SCM nm = scm_assoc (ly_symbol2scm ("name"), meta);
- nm = (ly_c_pair_p (nm)) ? ly_cdr (nm) : SCM_EOL;
- return ly_c_symbol_p (nm) ? ly_symbol2string (nm) : classname (this);
+ nm = (gh_pair_p (nm)) ? ly_cdr (nm) : SCM_EOL;
+ return gh_symbol_p (nm) ? ly_symbol2string (nm) : classname (this);
}
void
{
if (!has_offset_callback (cb, a))
{
- dim_cache_[a].offset_callbacks_ = scm_cons (cb, dim_cache_[a].offset_callbacks_);
+ dim_cache_[a].offset_callbacks_ = gh_cons (cb, dim_cache_[a].offset_callbacks_);
dim_cache_[a].offsets_left_ ++;
}
}
void
Grob::set_extent (SCM dc, Axis a)
{
- dim_cache_[a].dimension_ = dc;
+ dim_cache_[a].dimension_ =dc;
}
void
{
Link_array<Grob> arr;
- for (SCM s = l; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = l; gh_pair_p (s); s = gh_cdr (s))
{
- SCM e = ly_car (s);
+ SCM e = gh_car (s);
arr.push (unsmob_grob (e));
}
{
SCM s = SCM_EOL;
for (int i = a.size (); i; i--)
- s = scm_cons (a[i-1]->self_scm (), s);
+ s = gh_cons (a[i-1]->self_scm (), s);
return s;
}
"staff-symbol interfaces dependencies X-extent Y-extent extra-X-extent "
"meta layer before-line-breaking-callback "
"after-line-breaking-callback extra-Y-extent minimum-X-extent "
- // FIXME: page-penalty?
- "minimum-Y-extent page-penalty transparent "
- );
+ "minimum-Y-extent transparent");
#include "spanner.hh"
#include "font-interface.hh"
#include "dimensions.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "warn.hh"
#include "paper-column.hh"
#include "lookup.hh"
/*
Ugh. property name is not general.
*/
- Real padding = ly_scm2double (me->get_property ("if-text-padding"));
+ Real padding = gh_scm2double (me->get_property ("if-text-padding"));
Drul_array<bool> broken;
Drul_array<Item*> bounds ;
Hara_kiri_group_spanner::y_extent (SCM element_smob, SCM scm_axis)
{
Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) ly_scm2int (scm_axis);
+ Axis a = (Axis) gh_scm2int (scm_axis);
assert (a == Y_AXIS);
consider_suicide (me);
{
Spanner*sp = dynamic_cast<Spanner*> (me);
SCM worth = me->get_property ("items-worth-living");
- if (ly_c_pair_p (worth))
+ if (gh_pair_p (worth))
return ;
if (!to_boolean (me->get_property ("remove-first"))
Hara_kiri_group_spanner::force_hara_kiri_callback (SCM element_smob, SCM axis)
{
Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) ly_scm2int (axis);
+ Axis a = (Axis) gh_scm2int (axis);
assert (a == Y_AXIS);
consider_suicide (me);
- return scm_make_real (0.0);
+ return gh_double2scm (0.0);
}
Hara_kiri_group_spanner::force_hara_kiri_in_parent_callback (SCM element_smob, SCM axis)
{
Grob *daughter = unsmob_grob (element_smob);
- Axis a = (Axis) ly_scm2int (axis);
+ Axis a = (Axis) gh_scm2int (axis);
assert (a == Y_AXIS);
force_hara_kiri_callback (daughter->get_parent (a)->self_scm (), axis);
- return scm_make_real (0.0);
+ return gh_double2scm (0.0);
}
void
{
for (int k = 0; k < push_count_; k++)
{
- Spanner * sp = make_spanner ("HorizontalBracket", events_[k]->self_scm ());
+ Spanner * sp = make_spanner ("HorizontalBracket");
+ announce_grob (sp, events_[k]->self_scm ());
for (int i = 0; i < bracket_stack_.size (); i++)
{
/*
for (int i = pop_count_; i--;)
{
if (bracket_stack_.size ())
- bracket_stack_.pop ();
+ typeset_grob (bracket_stack_.pop ());
}
pop_count_ = 0;
push_count_ = 0;
#include "lookup.hh"
#include "group-interface.hh"
#include "directional-element-interface.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "staff-symbol-referencer.hh"
struct Horizontal_bracket
if (!sp->get_bound (RIGHT))
{
SCM heads = sp->get_property ("heads");
- if (ly_c_pair_p (heads))
+ if (gh_pair_p (heads))
{
- Item* it = dynamic_cast<Item*> (unsmob_grob (ly_car (heads)));
+ Item* it = dynamic_cast<Item*> (unsmob_grob (gh_car (heads)));
if (it)
sp->set_bound (RIGHT, it);
}
hyphen_->suicide ();
}
+ typeset_grob (hyphen_);
hyphen_ = 0;
}
finished_hyphen_->warning (_("unterminated hyphen; removing"));
finished_hyphen_->suicide ();
}
+ typeset_grob (finished_hyphen_);
finished_hyphen_ =0;
}
}
{
if (ev_)
{
- hyphen_ = make_spanner ("LyricHyphen", ev_->self_scm ()
-);
+ hyphen_ = make_spanner ("LyricHyphen");
+ announce_grob (hyphen_, ev_->self_scm ());
}
}
{
if (finished_hyphen_ && finished_hyphen_->get_bound (RIGHT))
{
+ typeset_grob (finished_hyphen_);
finished_hyphen_ = 0;
}
if (finished_hyphen_ && hyphen_)
{
programming_error ("Haven't finished hyphen yet.");
+ typeset_grob (finished_hyphen_);
finished_hyphen_ =0;
}
-/*
- identifier-smob.cc -- implement glue to pass Scheme expressions off as
- identifiers.
+/*
+identifier-smob.cc -- implement glue to pass Scheme expressions off as
+identifiers.
- source file of the GNU LilyPond music typesetter
+source file of the GNU LilyPond music typesetter
- (c) 2002--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
+(c) 2002--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
#include "identifier-smob.hh"
-
+/*
+ C&P from example/box.c
+ */
scm_t_bits package_tag;
+/* Print a textual represenation of the smob to a given port. */
static int
print_box (SCM b, SCM port, scm_print_state *)
{
return 1;
}
+
/* This defines the primitve `make-box', which returns a new smob of
type `box', initialized to `#f'. */
-LY_DEFINE (ly_export, "ly:export",
- 1, 0, 0, (SCM arg),
- "Export a Scheme object to the parser, "
- "so it is treated as an identifier.")
+LY_DEFINE (package_identifier, "ly:export", 1, 0, 0, (SCM arg),
+ "Export a Scheme object to the parser, so it is treated as an identifier.")
{
+ /* This macro creates the new objects, stores the value `#f' into it
+ and returns it to the caller. */
SCM_RETURN_NEWSMOB (package_tag, arg);
}
+
+/* This is the primitive `box-ref' which returns the object stored in
+ the box. */
SCM
unpack_identifier (SCM box)
{
scm_set_smob_mark (package_tag, scm_markcdr);
scm_set_smob_print (package_tag, print_box);
}
-
ADD_SCM_INIT_FUNC (package, init_box_type);
allow_includes_b_ = true;
}
-/** Set the new input file to NAME, remember old file. */
+/** set the new input to s, remember old file.
+*/
void
-Includable_lexer::new_input (String name, Sources *sources)
+Includable_lexer::new_input (String s, Sources * global_sources)
{
if (!allow_includes_b_)
{
return;
}
- Source_file *file = sources->get_file (name);
- if (!file)
+ Source_file * sl = global_sources->get_file (s);
+ if (!sl)
{
- String msg = _f ("can't find file: `%s'", name);
+ String msg = _f ("can't find file: `%s'", s);
msg += "\n";
- msg += _f ("(search path: `%s')",
- sources->path_->to_string ().to_str0 ());
+ msg += _f ("(search path: `%s')", global_sources->path_C_->to_string ().to_str0 ());
msg += "\n";
LexerError (msg.to_str0 ());
+
return;
}
- filename_strings_.push (file->name_string ());
+ filename_strings_.push (sl->name_string ());
char_count_stack_.push (0);
if (yy_current_buffer)
state_stack_.push (yy_current_buffer);
if (verbose_global_b)
- progress_indication (String ("[") + name);
+ progress_indication (String ("[") + s);
- include_stack_.push (file);
+ include_stack_.push (sl);
- /* Ugh. We'd want to create a buffer from the bytes directly.
+ /*
+ ugh. We'd want to create a buffer from the bytes directly.
- Whoops. The size argument to yy_create_buffer is not the
- filelength but a BUFFERSIZE. Maybe this is why reading stdin fucks up. */
- yy_switch_to_buffer (yy_create_buffer (file->get_istream (), YY_BUF_SIZE));
+ Whoops. The size argument to yy_create_buffer is not the
+ filelength but a BUFFERSIZE. Maybe this is why reading stdin fucks up.
+
+ */
+ yy_switch_to_buffer (yy_create_buffer (sl->get_istream (), YY_BUF_SIZE));
}
+/*
+ Unused.
+ */
void
-Includable_lexer::new_input (String name, String data, Sources *sources)
+Includable_lexer::new_input (String name, String data, Sources* sources)
{
- Source_file *file = new Source_file (name, data);
+ Source_file* file = new Source_file (name, data);
sources->add (file);
filename_strings_.push (name);
}
/** pop the inputstack. conceptually this is a destructor, but it
- does not destruct the Source_file that Includable_lexer::new_input
- creates. */
+ does not destruct the Source_file that Includable_lexer::new_input creates. */
bool
Includable_lexer::close_input ()
{
#endif
return false;
}
- yy_switch_to_buffer (state_stack_.pop ());
- return true;
+ else
+ {
+ yy_switch_to_buffer (state_stack_.pop ());
+ return true;
+ }
}
char const*
#include "font-metric.hh"
#include "parse-afm.hh"
-class Adobe_font_metric : public Simple_font_metric
+struct Adobe_font_metric : Font_metric
{
-public:
- AFM_Font_info *font_info_;
- unsigned int checksum_;
- Real design_size_;
-
- ~Adobe_font_metric ();
+ AFM_Font_info * font_inf_;
virtual int name_to_index (String) const;
virtual int count () const;
- virtual int index_to_ascii (int) const;
virtual Box get_ascii_char (int) const;
virtual Box get_indexed_char (int) const;
virtual Offset get_indexed_wxwy (int) const;
- virtual String coding_scheme () const;
- static SCM make_afm (AFM_Font_info*, unsigned, Real);
- virtual Real design_size () const;
-
-protected:
+
AFM_CharMetricInfo const *find_char_metric (String name) const;
AFM_CharMetricInfo const *find_ascii_metric (int) const;
+ String to_string () const;
+ ~Adobe_font_metric ();
+ static SCM make_afm (AFM_Font_info*, unsigned);
+
+ unsigned int checksum_;
+protected:
Array<int> ascii_to_metric_idx_;
std::map<String,int> name_to_metric_dict_;
+ virtual Stencil find_by_name (String) const;
+
Adobe_font_metric (AFM_Font_info*);
};
-SCM read_afm_file (String);
-Box afm_bbox_to_box (AFM_BBox);
+SCM read_afm_file (String fn);
+Box afm_bbox_to_box (AFM_BBox bb);
+
#endif /* AFM_HH */
#ifndef ALIGN_INTERFACE_HH
#define ALIGN_INTERFACE_HH
+#include "axes.hh"
#include "lily-proto.hh"
#include "lily-guile.hh"
SCM font_descriptions () const;
};
-extern All_font_metrics *all_fonts_global;
-
#endif /* ALL_FONTS_HH */
void add_audio_item (Audio_item* i);
Moment at_mom () const;
+ void print () const;
Link_array<Audio_item> audio_items_;
+ Performance * performance_;
private:
Audio_column (Audio_column const&);
#include "real.hh"
#include "drul-array.hh"
#include "interval.hh"
+#include "axes.hh"
#include "offset.hh"
#include "array.hh"
#include "polynomial.hh"
+++ /dev/null
-/*
- book-paper-def.hh -- declare Output_def
-
- source file of the GNU LilyPond music typesetter
-
- (c) 2004 Jan Nieuwenhuizen <janneke@gnu.org>
-*/
-
-#ifndef BOOK_PAPER_DEF_HH
-#define BOOK_PAPER_DEF_HH
-
-#include "lily-proto.hh"
-#include "output-def.hh"
-
-class Output_def : public Output_def
-{
-public:
- VIRTUAL_COPY_CONSTRUCTOR (Output_def, Output_def);
- Output_def (Output_def const &);
-
- Output_def ();
-
- virtual void derived_mark ();
-};
-
-#endif /* BOOK_PAPER_DEF_HH */
+++ /dev/null
-/*
- book.hh -- declare Book
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#ifndef BOOK_HH
-#define BOOK_HH
-
-#include "input.hh"
-#include "lily-proto.hh"
-#include "parray.hh"
-#include "smobs.hh"
-
-class Book : public Input
-{
- DECLARE_SMOBS (Book, foo);
-
-public:
- SCM header_;
- Output_def *bookpaper_;
-
- Link_array<Score> scores_;
- Book ();
-
- Paper_book* process (String, Output_def*);
-};
-DECLARE_UNSMOB (Book, book);
-
-#endif /* BOOK_HH */
#include "real.hh"
#include "interval.hh"
#include "offset.hh"
+#include "axes.hh"
+
struct Box
{
class Coherent_ligature_engraver : public Ligature_engraver
{
+
public:
TRANSLATOR_DECLARATIONS(Coherent_ligature_engraver);
virtual void typeset_ligature (Spanner *ligature,
Array<Grob_info> primitives);
virtual void get_set_column (Item *, Paper_column *);
+
private:
void collect_accidentals (Spanner *, Array<Grob_info>);
};
*/
-#ifndef CONTEXT_DEF_HH
-#define CONTEXT_DEF_HH
+#ifndef TRANSLATOR_DEF_HH
+#define TRANSLATOR_DEF_HH
#include "lily-proto.hh"
#include "smobs.hh"
void add_context_mod (SCM);
SCM default_child_context_name ();
SCM get_context_name () const;
- SCM get_accepted (SCM) const;
- SCM get_property_ops () const { return property_ops_; }
+ SCM get_accepted (SCM) const;
+ SCM get_property_ops () const { return property_ops_; }
SCM get_translator_names (SCM) const;
void set_acceptor (SCM accepts, bool add);
- Link_array<Context_def> path_to_acceptable_context (SCM type_string,
- Output_def*) const;
+ Link_array<Context_def> path_to_acceptable_context (SCM type_string, Music_output_def* odef) const;
Context * instantiate (SCM extra_ops);
SCM to_alist () const;
- static SCM make_scm ();
-
- SCM clone_scm () const;
- void apply_default_property_operations (Context*);
+ static SCM make_scm () ;
+ SCM clone_scm ()const;
+ void apply_default_property_operations (Context *);
private:
- DECLARE_SMOBS (Context_def, foo);
+ DECLARE_SMOBS (Context_def,foo);
Context_def ();
Context_def (Context_def const&);
};
-DECLARE_UNSMOB (Context_def, context_def);
+DECLARE_UNSMOB(Context_def,context_def);
+
-#endif /* CONTEXT_DEF_HH */
+#endif /* TRANSLATOR_DEF_HH */
DECLARE_SMOBS (Context, dummy);
void terminate ();
-
-private:
- friend class Interpretation_context_handle;
- int iterator_count_;
- bool init_;
-
-protected:
- Context * daddy_context_;
+public:
SCM definition_;
SCM properties_scm_;
SCM context_list_;
SCM accepts_list_;
SCM aliases_;
- SCM implementation_;
- String id_string_;
- friend class Context_def;
-public:
- String id_string () const { return id_string_; }
- SCM children_contexts () const { return context_list_; }
- SCM default_child_context_name () const;
-
- Translator_group* implementation () const;
- Context * get_parent_context () const;
+ Context * daddy_context_;
+
Context ();
-
- /*
- properties:
- */
void execute_pushpop_property (SCM prop, SCM sym, SCM val);
SCM internal_get_property (SCM name_sym) const;
- SCM properties_as_alist () const;
- void internal_set_property (SCM var_sym, SCM value);
- Context *where_defined (SCM name_sym) const;
- void unset_property (SCM var_sym);
-
Context *remove_context (Context*trans);
void check_removal ();
+
+ SCM properties_as_alist () const;
+ void unset_property (SCM var_sym);
+ void internal_set_property (SCM var_sym, SCM value);
+
+ Context *where_defined (SCM name_sym) const;
String context_name () const;
Global_context * get_global_context () const;
virtual Score_context * get_score_context () const;
- virtual Output_def *get_output_def () const;
- virtual Moment now_mom () const;
- virtual Context *get_default_interpreter ();
-
bool is_alias (SCM) const;
void add_alias (SCM);
void add_context (Context *trans);
bool is_bottom_context () const;
bool is_removable () const;
bool try_music (Music *);
-
+
+ virtual Music_output_def *get_output_def () const;
+ virtual Moment now_mom () const;
+ Context *find_context_below (SCM context_name, String id);
Context *find_create_context (SCM context_name,
- String id, SCM ops);
+ String id, SCM ops);
Link_array<Context> path_to_acceptable_context (SCM alias,
- Output_def*) const;
+ Music_output_def*) const;
+ virtual Context *get_default_interpreter ();
+ String id_string_;
+ SCM implementation_;
+private:
+ friend class Interpretation_context_handle;
+ int iterator_count_;
+ bool init_;
};
/*
void execute_pushpop_property (Context * trg, SCM prop, SCM eltprop, SCM val);
SCM updated_grob_properties (Context* tg, SCM sym);
Context * find_context_below (Context * where,
- SCM type_sym, String id);
+ String type, String id);
bool melisma_busy (Context*);
Context *get_voice_to_lyrics (Context *lyrics);
#define CHAR *CHAR_TO_PT *PT_TO_MM
#define INTERNAL_UNIT "mm"
-
#endif
String print_dimen (Real);
friend class Engraver_group_engraver;
protected:
+ /*
+ Call this when you're finished with ELEM_P.
+ */
+ virtual void typeset_grob (Grob*elem);
/*
take note of item/spanner
put item in spanner. Adjust local key; etc.
*/
virtual void process_acknowledged_grobs () {}
-
+ /**
+ Announce element. Default: pass on to daddy. Utility
+ */
+ virtual void announce_grob (Grob*, SCM cause);
virtual void announce_grob (Grob_info);
Engraver_group_engraver*get_daddy_engraver () const;
public:
- /**
- Announce element. Default: pass on to daddy. Utility
- */
- void announce_grob (Grob*, SCM cause);
-
Score_engraver * get_score_engraver () const;
/**
override other ctor
TRANSLATOR_DECLARATIONS(Engraver);
};
-#define make_item(x,cause) make_item_from_properties (this, ly_symbol2scm (x), cause)
-#define make_spanner(x,cause) make_spanner_from_properties (this, ly_symbol2scm (x), cause)
-Item* make_item_from_properties (Translator * tg, SCM x, SCM cause);
-Spanner* make_spanner_from_properties (Translator * tg, SCM x, SCM cause);
+#define make_item(x) make_item_from_properties (daddy_context_, ly_symbol2scm (x))
+#define make_spanner(x) make_spanner_from_properties (daddy_context_, ly_symbol2scm (x))
+Item* make_item_from_properties (Context * tg, SCM x);
+Spanner* make_spanner_from_properties (Context * tg, SCM x);
{
public:
SCM description_;
- String filename_;
+ String path_;
virtual int count () const;
virtual Offset get_indexed_wxwy (int) const;
virtual Box get_indexed_char (int index) const;
virtual Box get_ascii_char (int ascii) const;
+ virtual Box text_dimension (String) const;
virtual int name_to_index (String) const;
- virtual int index_to_ascii (int) const;
- virtual Real design_size () const;
+
virtual Stencil find_by_name (String) const;
virtual Stencil get_indexed_char_stencil (int k) const;
- virtual Stencil get_ascii_char_stencil (int k) const;
- virtual String coding_scheme () const;
+ virtual Stencil get_ascii_char_stencil (int k) const;
DECLARE_SMOBS (Font_metric,);
-
private:
- /* No copying, no implicit copy constructor. */
- Font_metric (Font_metric const&);
-
+ Font_metric (Font_metric const&); // no copy.
protected:
virtual void derived_mark () const;
Font_metric ();
};
-int get_encoded_index (Font_metric *m, String input_coding, int code);
-
-struct Simple_font_metric : public Font_metric
-{
-public:
-
-};
-
-
DECLARE_UNSMOB(Font_metric, metrics);
#endif /* FONT_METRIC_HH */
class Global_context : public virtual Context
{
PQueue<Moment> extra_mom_pq_;
- Output_def* output_def_;
+ Music_output_def* output_def_;
- friend class Output_def;
+ friend class Music_output_def;
public:
- Global_context (Output_def*, Moment final);
+ Global_context (Music_output_def*, Moment final);
int get_moments_left () const;
Moment sneaky_insert_extra_moment (Moment);
void add_moment_to_process (Moment);
virtual void prepare (Moment);
virtual void one_time_step ();
virtual void finish ();
- virtual Output_def* get_output_def () const;
+ virtual Music_output_def* get_output_def () const;
virtual Moment now_mom () const;
virtual Context *get_default_interpreter ();
*/
enum Grob_status {
ORPHAN=0, // not yet added to Paper_score
+ VIRGIN,
PRECALCING,
PRECALCED, // calcs before spacing done
POSTCALCING, // busy calculating. This is used to trap cyclic deps.
typedef void (Grob::*Grob_method_pointer) (void);
-// looking at gtk+/pango docstrings .. WIP
-/**
- * Grob:
- * @internal_get_property: get property #NAME.
- *
- * Class structure for #Grob.
- **/
+/* Basic G[raphical output] O[bject]. */
class Grob
{
-private:
- DECLARE_SMOBS (Grob, foo);
- void init ();
-
protected:
SCM immutable_property_alist_;
SCM mutable_property_alist_;
friend class Spanner;
- void substitute_mutable_properties (SCM, SCM);
- char status_;
-
+ void substitute_mutable_properties(SCM,SCM);
+
public:
Grob *original_;
- /* TODO: junk this member. */
- Paper_score *pscore_;
+ /**
+ Administration: Where are we?. This is mainly used by Super_element and
+ Grob::calcalute_dependencies ()
+
+ 0 means ORPHAN,
+ */
+ char status_;
+
+ /*
+ IDEA: make this a global variable. This is the same for all
+ elements, I think it is safe to assume that we will not have
+ scores being formatted multithreadedly.
+ */
+ Paper_score *pscore_;
Dimension_cache dim_cache_[NO_AXES];
Grob (SCM basic_props);
Grob (Grob const&);
- VIRTUAL_COPY_CONSTRUCTOR (Grob, Grob);
- DECLARE_SCHEME_CALLBACK (stencil_extent, (SCM smob, SCM axis));
+ VIRTUAL_COPY_CONSTRUCTOR(Grob,Grob);
String name () const;
-
-
+
/*
- Properties
+ properties
*/
SCM internal_get_property (SCM) const;
void internal_set_property (SCM, SCM val);
void add_to_list_property (SCM, SCM);
-
- SCM get_property_alist_chain (SCM) const;
- static SCM ly_grob_set_property (SCM, SCM,SCM);
- static SCM ly_grob_property (SCM, SCM);
-
- void warning (String) const;
- void programming_error (String) const;
+ void warning (String)const;
+ void programming_error (String)const;
- Output_def *get_paper () const;
+ void set_elt_pointer (const char*, SCM val);
+ friend class Property_engraver; // UGHUGHUGH.
+ /*
+ related classes.
+ */
+ Paper_def *get_paper () const;
+
+ /**
+ add a dependency. It may be the 0 pointer, in which case, it is ignored.
+ */
void add_dependency (Grob*);
- virtual System *get_system () const;
+ virtual System * get_system () const;
+
+ /**
+ Recursively track all dependencies of this Grob. The
+ status_ field is used as a mark-field. It is marked with
+ #busy# during execution of this function, and marked with #final#
+ when finished.
+ #funcptr# is the function to call to update this element.
+ */
void calculate_dependencies (int final, int busy, SCM funcname);
virtual void discretionary_processing ();
virtual SCM do_derived_mark () const;
- Stencil *get_stencil () const;
+ Stencil * get_stencil () const;
SCM get_uncached_stencil () const;
+ SCM get_property_alist_chain (SCM) const;
void suicide ();
- bool is_live () const;
- bool is_empty (Axis a) const;
+ bool live () const;
+ DECLARE_SCHEME_CALLBACK (stencil_extent, (SCM smob, SCM axis));
+
+ static SCM ly_grob_set_property (SCM, SCM,SCM);
+ static SCM ly_grob_property (SCM, SCM);
+
bool internal_has_interface (SCM intf);
- static bool has_interface (Grob *me);
+ static bool has_interface (Grob*me);
virtual void handle_broken_dependencies ();
virtual void handle_prebroken_dependencies ();
+ DECLARE_SMOBS (Grob,foo);
+
+ void init ();
+public:
+ bool is_empty (Axis a) const;
+
Interval extent (Grob * refpoint, Axis) const;
void translate_axis (Real, Axis);
- Real relative_coordinate (Grob const *refp, Axis) const;
- Grob *common_refpoint (Grob const *s, Axis a) const;
+ Real relative_coordinate (Grob const* refp, Axis) const;
+ Grob*common_refpoint (Grob const* s, Axis a) const;
+
// duh. slim down interface here. (todo)
- bool has_offset_callback (SCM callback, Axis) const;
+ bool has_offset_callback (SCM callback, Axis)const;
void add_offset_callback (SCM callback, Axis);
- bool has_extent_callback (SCM, Axis) const;
- void set_extent (SCM, Axis);
+ bool has_extent_callback (SCM, Axis)const;
+ void set_extent (SCM , Axis);
Real get_offset (Axis a) const;
void set_parent (Grob* e, Axis);
-
- // URG
- Grob *get_parent (Axis a) const
- {
- return dim_cache_[a].parent_;
- }
-
+
+ Grob *get_parent (Axis a) const { return dim_cache_[a].parent_; }
DECLARE_SCHEME_CALLBACK (fixup_refpoint, (SCM));
};
-DECLARE_UNSMOB (Grob, grob);
-Spanner *unsmob_spanner (SCM);
-Item *unsmob_item (SCM);
+DECLARE_UNSMOB(Grob,grob);
+Spanner* unsmob_spanner (SCM );
+Item* unsmob_item (SCM );
-Grob *common_refpoint_of_list (SCM elt_list, Grob *, Axis a);
-Grob *common_refpoint_of_array (Link_array<Grob> const&, Grob *, Axis a);
+Grob*common_refpoint_of_list (SCM elt_list, Grob * , Axis a);
+Grob*common_refpoint_of_array (Link_array<Grob> const&, Grob * , Axis a);
void set_break_subsititution (SCM criterion);
SCM substitute_mutable_property_alist (SCM alist);
-Link_array<Grob> ly_scm2grobs (SCM ell);
+Link_array<Grob> ly_scm2grobs (SCM l);
SCM ly_grobs2scm (Link_array<Grob> a);
#endif /* GROB_HH */
{
Link_array<T> arr;
- for (SCM s = elt->get_property (name); ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = elt->get_property (name); gh_pair_p (s); s = gh_cdr (s))
{
- SCM e = ly_car (s);
+ SCM e = gh_car (s);
arr.push (dynamic_cast<T*> (unsmob_grob (e)));
}
--- /dev/null
+/*
+ file-results.hh -- declare functions for processing one input file.
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1998--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#ifndef FILE_RESULTS_HH
+#define FILE_RESULTS_HH
+
+#include "lily-proto.hh"
+#include "source.hh"
+#include "parray.hh"
+#include "protected-scm.hh"
+
+class Input_file_results
+{
+public:
+ Sources sources_;
+ Array<String> inclusion_names_;
+ Array<String> target_strings_;
+ Protected_scm header_;
+
+ int score_count_;
+
+ void do_deps (String);
+
+ Input_file_results (String init, String in, String out);
+ ~Input_file_results ();
+
+private:
+ /* Make sure we never get an implicit constructor.*/
+ Input_file_results ();
+};
+
+extern Input_file_results* global_input_file;
+
+void do_one_file (char const* file);
+
+#endif /* FILE_RESULTS_HH */
+
#define LILY_GUILE_HH
+/*
+ TODO: the GH interface is deprecated as of GUILE 1.6
+
+ Remove all gh_XXX functions.
+ */
+#include <guile/gh.h>
+
+
/* GUILE only includes version in headers (libguile/version.h) as of
1.5.x. For some strange reason, they call it SCM.*VERSION.
#define scm_t_bits scm_bits_t
+#define fix_guile_1_4_gh_scm2newstr(str, lenp) gh_scm2newstr (str, (int*)lenp)
+#define gh_scm2newstr(str, lenp) fix_guile_1_4_gh_scm2newstr (str, lenp)
+
#define fix_guile_1_4_scm_primitive_eval(form) scm_eval_3 (form, 1, SCM_EOL)
#define scm_primitive_eval(form) fix_guile_1_4_scm_primitive_eval (form)
return scm_make_vector (SCM_MAKINUM (k), val);
}
#define scm_c_define_gsubr scm_make_gsubr
+#define scm_c_eval_string(str) gh_eval_str ((char*)str)
#define scm_remember_upto_here_1(s) scm_remember (&s)
#define scm_gc_protect_object scm_protect_object
#define scm_gc_unprotect_object scm_unprotect_object
/*
- Using this trick we cache the value of scm_str2symbol ("fooo") where
+ Using this trick we cache the value of gh_symbol2scm ("fooo") where
"fooo" is a constant string. This is done at the cost of one static
variable per ly_symbol2scm() use, and one boolean evaluation for
every call.
SCM value = cached; /* We store this one locally, since G++ -O2 fucks up else */ \
if ( __builtin_constant_p ((x)))\
{ if (!cached)\
- value = cached = scm_gc_protect_object (scm_str2symbol((x)));\
+ value = cached = scm_gc_protect_object (gh_symbol2scm((x)));\
} else\
- value = scm_str2symbol ((char*) (x)); \
+ value = gh_symbol2scm ((char*) (x)); \
value; })
#else
-inline SCM ly_symbol2scm(char const* x) { return scm_str2symbol((x)); }
+inline SCM ly_symbol2scm(char const* x) { return gh_symbol2scm((x)); }
#endif
extern SCM global_lily_module;
-/*
- TODO: rename me to ly_c_lily_module_eval
- */
#define ly_scheme_function(x) ({static SCM cached; \
SCM value = cached; /* We store this one locally, since G++ -O2 fucks up else */ \
if ( __builtin_constant_p ((x)))\
{ if (!cached)\
- value = cached = scm_gc_protect_object (scm_eval(scm_str2symbol (x), global_lily_module));\
+ value = cached = scm_gc_protect_object (scm_eval(gh_symbol2scm (x), global_lily_module));\
} else\
- value = scm_eval(scm_str2symbol (x), global_lily_module);\
+ value = scm_eval(gh_symbol2scm (x), global_lily_module);\
value; })
Drul_array<Real> ly_scm2realdrul (SCM);
Slice int_list_to_slice (SCM l);
SCM ly_interval2scm (Drul_array<Real>);
-char *ly_scm2newstr (SCM str, size_t *lenp);
Real robust_scm2double (SCM, double);
int robust_scm2int (SCM, int);
inline SCM ly_caddr (SCM x) { return SCM_CADDR (x); }
inline SCM ly_cdadr (SCM x) { return SCM_CDADR (x); }
inline SCM ly_caadr (SCM x) { return SCM_CAADR (x); }
-inline SCM ly_cadar (SCM x) { return SCM_CADAR (x); }
/* inserts at front, removing dublicates */
inline SCM ly_assoc_front_x(SCM alist, SCM key, SCM val)
{
return scm_acons(key, val, scm_assoc_remove_x (alist, key));
}
-inline bool ly_c_pair_p (SCM x) { return SCM_NFALSEP (scm_pair_p (x)); }
-inline bool ly_c_symbol_p (SCM x) { return SCM_SYMBOLP (x); }
-inline bool ly_c_boolean_p (SCM x) { return SCM_BOOLP (x); }
-inline bool ly_c_char_p (SCM x) { return SCM_CHARP (x); }
-inline bool ly_c_number_p (SCM x) { return SCM_NUMBERP (x); }
-inline bool ly_c_string_p (SCM x) { return SCM_STRINGP (x); }
-inline bool ly_c_vector_p (SCM x) { return SCM_VECTORP (x); }
-inline bool ly_c_list_p (SCM x) { return SCM_NFALSEP (scm_list_p (x)); }
-inline bool ly_c_procedure_p (SCM x) { return SCM_NFALSEP (scm_procedure_p (x)); }
-inline bool ly_c_eq_p (SCM x, SCM y) { return SCM_EQ_P (x, y); }
-inline bool ly_c_equal_p (SCM x, SCM y) {
- return SCM_NFALSEP (scm_equal_p (x, y));
-}
-
-inline bool ly_scm2bool (SCM x) { return SCM_NFALSEP (x); }
-inline char ly_scm2char (SCM x) { return SCM_CHAR(x); }
-inline int ly_scm2int (SCM x) { return scm_num2int (x, 0, "ly_scm2int"); }
-inline double ly_scm2double (SCM x) { return scm_num2dbl (x, "ly_scm2double"); }
-inline unsigned long ly_length (SCM x) {
- return scm_num2ulong (scm_length (x), 0, "ly_length");
-}
-inline unsigned long ly_vector_length (SCM x) { return SCM_VECTOR_LENGTH (x); }
-
-inline SCM ly_bool2scm (bool x) { return SCM_BOOL (x); }
-
-inline SCM ly_append2 (SCM x1, SCM x2) {
- return scm_append (scm_listify (x1, x2, SCM_UNDEFINED));
-}
-inline SCM ly_append3 (SCM x1, SCM x2, SCM x3) {
- return scm_append (scm_listify (x1, x2, x3, SCM_UNDEFINED));
-}
-inline SCM ly_append4 (SCM x1, SCM x2, SCM x3, SCM x4) {
- return scm_append (scm_listify (x1, x2, x3, x4, SCM_UNDEFINED));
-}
+#ifdef PARANOID
+#define gh_pair_p ly_pair_p
+bool ly_pair_p (SCM x);
+#else
+inline bool ly_pair_p (SCM x) { return SCM_NFALSEP (scm_pair_p (x)); }
+#endif
+inline bool ly_symbol_p (SCM x) { return SCM_SYMBOLP (x); }
+inline bool ly_number_p (SCM x) { return SCM_NUMBERP (x); }
+inline bool ly_procedure_p (SCM x) { return SCM_NFALSEP (scm_procedure_p (x)); }
/*
display and print newline.
#include "array.hh"
void read_lily_scm_file (String);
-void ly_c_init_guile ();
+void ly_init_guile ();
bool is_direction (SCM s);
bool is_number_pair (SCM);
SCM index_set_cell (SCM cell, Direction d, SCM val);
SCM ly_snoc (SCM s, SCM list);
-SCM ly_split_list (SCM s, SCM lst);
-SCM ly_unique (SCM lst);
-SCM ly_list_qsort_uniq_x (SCM lst);
+SCM ly_split_list (SCM s, SCM list);
+SCM ly_unique (SCM list);
void \
TYPE ## _ ## FUNC ## _init_functions () \
{ \
- TYPE :: FUNC ## _proc = scm_c_define_gsubr (#TYPE "::" #FUNC, \
- (ARGCOUNT), 0, 0, \
- (Scheme_function_unknown)TYPE :: FUNC); \
+ TYPE :: FUNC ## _proc = gh_new_procedure ## ARGCOUNT ## _0 (#TYPE "::" #FUNC, \
+ ((Scheme_function_ ## ARGCOUNT)TYPE :: FUNC)); \
scm_c_export (#TYPE "::" #FUNC, NULL);\
} \
\
class Beaming_info_list;
class Bezier;
class Bezier_bow;
-class Book;
-class Output_def;
class Break_algorithm;
class Change_iterator;
class Change_translator;
class Lyric_phrasing_engraver;
class Mensural_ligature_engraver;
class Midi_chunk;
+class Midi_def;
class Midi_duration;
class Midi_dynamic;
class Midi_header;
class Music_iterator;
class Music_list;
class Music_output;
-class Output_def;
+class Music_output_def;
class Music_sequence;
class Music_wrapper;
class Music_wrapper_iterator;
class Output_property;
class Paper_book;
class Paper_column;
-class Output_def;
-class Paper_system;
+class Paper_def;
+class Paper_line;
class Paper_outputter;
class Paper_score;
class Paper_stream;
class Event;
class Event_chord;
class Event_chord_iterator;
-class Modified_font_metric;
+class Scaled_font_metric;
class Scheme_hash_table;
class Score;
class Grob;
virtual void create_line_spanner ();
virtual void initialize ();
virtual void finalize ();
+ virtual void typeset_grob (Grob*);
public:
TRANSLATOR_DECLARATIONS(Line_group_engraver_group);
};
/*
ly-module.hh -- declare module related helper functions
- source file of the GNU LilyPond music typesetter
+ source file of the GNU LilyPond music typesetter
(c) 2002--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
*/
+
#ifndef LY_MODULE_HH
#define LY_MODULE_HH
#include "lily-guile.hh"
-SCM ly_make_anonymous_module (bool safe);
-SCM ly_import_module (SCM dest, SCM src);
-SCM ly_module2alist (SCM mod);
+SCM ly_make_anonymous_module ();
+void ly_import_module (SCM dest, SCM src);
+SCM ly_module_to_alist (SCM mod);
SCM ly_module_lookup (SCM module, SCM sym);
-SCM ly_modules_lookup (SCM modules, SCM sym, SCM);
+SCM ly_modules_lookup (SCM modules, SCM sym);
SCM ly_module_symbols (SCM mod);
void ly_reexport_module (SCM mod);
-inline bool ly_c_module_p (SCM x) { return SCM_MODULEP(x); }
+inline bool ly_module_p (SCM x) { return SCM_MODULEP(x); }
void ly_clear_anonymous_modules ();
-SCM ly_use_module (SCM mod, SCM used);
+
#endif /* LY_MODULE_HH */
#define IMPLEMENT_TYPE_P(CL, FUNCNAME)\
-SCM CL ## _type_p_proc;\
void init_type_ ## CL ()\
{\
SCM subr = scm_c_define_gsubr (FUNCNAME, 1, 0, 0, (Scheme_function_unknown) CL::smob_p);\
- CL ## _type_p_proc = subr;\
ly_add_function_documentation (subr, FUNCNAME, "(SCM x)", "Is @var{x} a @code{" #CL "} object?");\
scm_c_export (FUNCNAME, NULL);\
}\
{ \
CL * ptr = new CL (*this);\
SCM s; \
- s = scm_cons (SCM_PACK (CL::smob_tag_), SCM_PACK (ptr)); \
+ s = gh_cons (SCM_PACK (CL::smob_tag_), SCM_PACK (ptr)); \
scm_gc_register_collectable_memory ((CL*)this, sizeof (CL), #CL " smob"); \
\
return s; \
#define IMPLEMENT_SMOBS(CL) \
IMPLEMENT_BASE_SMOBS (CL) \
-void \
+SCM \
CL::smobify_self () \
{ \
- SCM s = unprotected_smobify_self ();\
+ SCM s = unprotected_smobify_self ();\
scm_gc_protect_object (s);\
+ return s;\
}\
SCM \
CL::unprotected_smobify_self () \
void set_default_output (String s);
String find_file (String);
void call_constructors ();
-
-Array<String> get_inclusion_names ();
-void set_inclusion_names (Array<String>);
-
-
+extern Array<String> get_inclusion_names ();
+extern void set_inclusion_names (Array<String>);
extern String init_name_global;
+/* FIXME: in warn.cc */
+void progress_indication (String);
+
/* options */
+extern bool dependency_global_b;
+extern String dependency_prefix_global;
extern Array<String> dump_header_fieldnames_global;
extern bool no_paper_global_b;
extern String output_format_global;
/* misc */
+extern All_font_metrics *all_fonts_global;
extern Array<String> failed_files;
extern int exit_status_global;
extern File_path global_path;
+extern int score_count_global;
+
+extern Paper_book *paper_book;
#endif /* MAIN_HH */
--- /dev/null
+/*
+ midi-def.hh -- declare Midi_def
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997--2004 Jan Nieuwenhuizen <janneke@gnu.org>
+*/
+
+
+#ifndef MIDI_DEF_HH
+#define MIDI_DEF_HH
+
+#include "lily-proto.hh"
+#include "real.hh"
+#include "string.hh"
+#include "moment.hh"
+#include "music-output-def.hh"
+
+/**
+ definitions for midi output. Rather empty
+ */
+class Midi_def : public Music_output_def
+{
+ static int score_count_;
+
+public:
+ Midi_def ();
+ VIRTUAL_COPY_CONSTRUCTOR (Music_output_def, Midi_def);
+
+ int get_tempo (Moment moment);
+ void set_tempo (Moment moment, int count_per_minute_i);
+};
+
+#endif /* MIDI_DEF_HH */
+++ /dev/null
-/*
- music-head.hh -- declare music_function
-
- source file of the GNU LilyPond music typesetter
-
- (c) 2004 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
-*/
-
-#ifndef MUSIC_FUNCTION_HH
-#define MUSIC_FUNCTION_HH
-
-#include "lily-guile.hh"
-
-SCM ly_make_music_function (SCM, SCM);
-SCM get_music_function_transform (SCM);
-bool is_music_function (SCM);
-
-#endif /* MUSIC_FUNCTION_HH */
-
--- /dev/null
+/*
+ music-output-def.hh -- declare Music_output_def
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+
+#ifndef Music_output_DEF_HH
+#define Music_output_DEF_HH
+
+#include "string.hh"
+#include "lily-proto.hh"
+#include "lily-guile.hh"
+#include "virtual-methods.hh"
+#include "smobs.hh"
+#include "input.hh"
+
+/**
+ Definition of how to output lilypond.
+ */
+class Music_output_def
+{
+public:
+ Scheme_hash_table * translator_tab_;
+ Input input_origin_;
+
+ SCM scope_;
+ SCM scaled_fonts_;
+
+ Music_output_def (Music_output_def const&);
+ Music_output_def ();
+ VIRTUAL_COPY_CONSTRUCTOR (Music_output_def, Music_output_def);
+
+ Context *get_group_translator (String type) const;
+ void assign_context_def (SCM transdef);
+ SCM find_context_def (SCM name) const;
+ String outname_string () ;
+ SCM get_scmvar (String id)const;
+ SCM lookup_variable (SCM sym) const;
+ void set_variable (SCM, SCM sym);
+
+ DECLARE_SMOBS (Music_output_def,);
+};
+
+DECLARE_UNSMOB(Music_output_def,music_output_def);
+#endif // Music_output_DEF_HH
(c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
+
+
#ifndef MUSIC_HH
#define MUSIC_HH
friend SCM ly_extended_make_music(SCM,SCM);
};
-DECLARE_TYPE_P(Music);
+
DECLARE_UNSMOB(Music,music);
Music* make_music_by_name (SCM sym);
SCM ly_deep_mus_copy (SCM);
-SCM ly_music_scorify (SCM);
-#endif /* MUSIC_HH */
+#endif // MUSIC_HH
(c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
-#ifndef MY_LILY_LEXER_HH
-#define MY_LILY_LEXER_HH
+#ifndef LEXER_HH
+#define LEXER_HH
#include "includable-lexer.hh"
void kill_lexer ();
void set_lexer ();
+/// lexer for LilyPond
class My_lily_lexer : public Includable_lexer
{
-public:
Protected_scm scopes_;
- Protected_scm encoding_;
-
-private:
- int lookup_keyword (String);
- int scan_bare_word (String);
- SCM scan_markup_word (String);
- int scan_escaped_word (String);
- int identifier_type (SCM);
- char escaped_char (char) const;
-
public:
String main_input_name_;
- void *lexval;
+ void * lexval;
bool main_input_b_;
-
- Sources *sources_;
- /* Scheme hash tables with (oct name acc) values, and symbol keys. */
+ /*
+ Scheme hash tables with (oct name acc) values, and symbol keys
+ */
Protected_scm chordmodifier_tab_;
Protected_scm pitchname_tab_stack_;
+ Keyword_table * keytable_;
+ int errorlevel_;
- Keyword_table *keytable_;
- int error_level_;
- Input last_input_;
-
- My_lily_lexer (Sources*);
- My_lily_lexer (My_lily_lexer const&);
+ My_lily_lexer ();
~My_lily_lexer ();
-
int yylex ();
+ Input last_input_;
void prepare_for_next_token ();
int try_special_identifiers (SCM* ,SCM);
Input here_input () const;
void start_main_input ();
SCM lookup_identifier (String s);
- SCM lookup_identifier_symbol (SCM s);
+ void push_note_state (SCM tab);
void push_chord_state (SCM tab);
+ void push_markup_state ();
void push_figuredbass_state ();
void push_lyric_state ();
- void push_initial_state ();
- void push_markup_state ();
- void push_note_state (SCM tab);
void pop_state ();
void LexerError (char const *);
- void set_encoding (String);
- SCM encoding () const;
void set_identifier (SCM name_string, SCM);
bool is_note_state () const;
bool is_chord_state () const;
bool is_lyric_state () const;
bool is_figure_state () const;
+private:
+ int lookup_keyword (String);
+ int scan_bare_word (String);
+ SCM scan_markup_word (String);
+ int scan_escaped_word (String);
+ int identifier_type (SCM);
+ char escaped_char (char) const;
};
-#endif /* MY_LILY_LEXER_HH */
+#endif
(c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
+
#ifndef MY_LILY_PARSER_HH
#define MY_LILY_PARSER_HH
-#include "array.hh"
-#include "duration.hh"
-#include "input.hh"
+#include "lily-proto.hh"
+#include "string.hh"
#include "parray.hh"
+#include "lily-proto.hh"
+#include "lily-proto.hh"
+#include "duration.hh"
#include "pitch.hh"
-#include "smobs.hh"
#include "string.hh"
+#include "array.hh"
+#include "input.hh"
/**
State for the parser. Do not ever add any variables to parse
*/
class My_lily_parser
{
- DECLARE_SMOBS (My_lily_parser, );
- friend int yyparse (void*);
-
- Array<Input> define_spots_;
+public:
+ My_lily_parser (Input_file_results * sources);
+ ~My_lily_parser ();
- char const* here_str0 () const;
- Simultaneous_music *get_chord (Pitch tonic,
- Array<Pitch> *adds, Array<Pitch> *subs,
- Pitch *inversion, Pitch* bass, Duration d);
- void set_chord_tremolo (int type_i);
- void set_last_duration (Duration const *);
- void set_last_pitch (Pitch const *);
+ void do_init_file ();
+ void parse_file (String init, String file, String out_name);
public:
- My_lily_lexer *lexer_;
- Sources *sources_;
Duration default_duration_;
String output_basename_;
- // Protected_scm header_;
- int score_count_;
- int book_count_;
+
+ Scheme_hash_table *default_header_;
+
int fatal_error_;
+ Input_file_results * input_file_;
int error_level_;
- bool ignore_version_b_;
- SCM last_beam_start_;
- My_lily_parser (Sources *sources);
- My_lily_parser (My_lily_parser const&);
+ My_lily_lexer * lexer_;
+ bool ignore_version_b_;
- DECLARE_SCHEME_CALLBACK (paper_description, ());
+ SCM last_beam_start_;
+ void beam_check (SCM);
Input here_input () const;
+ void push_spot ();
Input pop_spot ();
- void beam_check (SCM);
- void do_init_file ();
+
void do_yyparse ();
- void parse_file (String init, String name, String out_name);
- void parse_string (String ly_code);
void parser_error (String);
- void push_spot ();
+
void set_yydebug (bool);
-};
-DECLARE_UNSMOB (My_lily_parser, my_lily_parser);
-SCM ly_parse_file (SCM);
-SCM ly_parse_string (SCM);
-// SCM ly_parser_add_book_and_score (SCM, SCM);
-SCM ly_parser_print_book (SCM, SCM);
-SCM ly_parser_print_score (SCM, SCM);
-SCM ly_parser_bookify (SCM, SCM);
-SCM ly_parser_scorify (SCM, SCM);
+ DECLARE_SCHEME_CALLBACK (paper_description, ());
+private:
+
+ Array<Input> define_spots_;
+
+ char const* here_str0 () const;
-Output_def *get_paper (My_lily_parser *parser);
-Output_def *get_midi (My_lily_parser *parser);
-Output_def *get_bookpaper (My_lily_parser *parser);
+ Simultaneous_music * get_chord (Pitch tonic, Array<Pitch>* adds,
+ Array<Pitch>* subs, Pitch* inversion,
+ Pitch* bass, Duration d);
+
+ void set_chord_tremolo (int type_i);
+ void set_last_duration (Duration const *);
+ void set_last_pitch (Pitch const *);
+ friend int yyparse (void*);
+};
-#endif /* MY_LILY_PARSER_HH */
+#endif // MY_LILY_PARSER_HH
+++ /dev/null
-/*
- music-output-def.hh -- declare Output_def
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#ifndef MUSIC_OUTPUT_DEF_HH
-#define MUSIC_OUTPUT_DEF_HH
-
-#include "string.hh"
-#include "lily-proto.hh"
-#include "lily-guile.hh"
-#include "virtual-methods.hh"
-#include "smobs.hh"
-#include "input.hh"
-
-/*
- Output settings for a block of music.
-
- This devolved into a rather empty class. The distinction between
- various instances is made in the parser, which creates
- midi/paper/bookpaper blocks depending on the keyword read.
-
- The data structure is set up as recursive: the definitions not
- supplied in paper are looked up in bookpaper. This is done through
- the parent_ field of Output_def. However, such nesting is limited to
- two levels,
-
- * first because the parser hard-codes the different types
- of output block.
-
- * Second, because the prime benefit of multiple levels
- (eg. bookpaper containing paper for a score, containing paper of a
- \score embedded in \markup) requires scaling the Stencils (eg. the
- one coming from score at markup level)
-
- */
-class Output_def
-{
-public:
- VIRTUAL_COPY_CONSTRUCTOR (Output_def, Output_def);
- DECLARE_SMOBS (Output_def,);
-public:
- Output_def * parent_;
- Input input_origin_;
- SCM scope_;
-
- Output_def (Output_def const&);
- Output_def ();
- virtual void derived_mark ();
-
- /*
- variables.
- */
- SCM c_variable (String id) const;
- SCM lookup_variable (SCM sym) const;
- void set_variable (SCM sym, SCM val);
- Real get_dimension (SCM symbol) const;
-};
-
-void assign_context_def (Output_def *m, SCM transdef);
-SCM find_context_def (Output_def const *m, SCM name);
-
-int get_tempo (Output_def*def, Moment moment);
-void set_tempo (Output_def*def, Moment moment, int count_per_minute_i);
-
-Interval line_dimensions_int (Output_def*def, int);
-
-
-Font_metric *select_encoded_font (Output_def *paper, SCM input_encoding, SCM chain);
-Font_metric *select_font (Output_def *paper, SCM chain);
-
-DECLARE_UNSMOB (Output_def, output_def);
-
-
-Font_metric *find_scaled_font (Output_def * od,
- Font_metric *f, Real m, SCM input_enc_name);
-Output_def *scale_output_def (Output_def *def, Real scale);
-Real output_scale (Output_def*);
-
-#endif /* MUSIC_OUTPUT_DEF_HH */
+++ /dev/null
-/*
- pangofc-afm-decoder.h --
-
- source file of the GNU LilyPond music typesetter
-
- Copyright (C) 2004 Jan Nieuwenhuizen <janneke@gnu.org>
-
- Note: in C and with explicit LPGL header for easier use with PANGO
- outside of LilyPond.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifndef __PANGOFC_AFM_DECODER_H__
-#define __PANGOFC_AFM_DECODER_H__
-
-#include "config.h"
-#if HAVE_PANGO_FC_FONT_MAP_ADD_DECODER_FIND_FUNC
-
-/* Note: in C and with explicit header for use outside of LilyPond. */
-
-#include <pango/pangofc-fontmap.h>
-
-G_BEGIN_DECLS
-
-#define PANGO_TYPE_FC_AFM_DECODER (pango_fc_afm_decoder_get_type ())
-#define PANGO_FC_AFM_DECODER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FC_AFM_DECODER, PangoFcAfmDecoder))
-#define PANGO_IS_FC_AFM_DECODER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FC_AFM_DECODER))
-
-#define PANGO_FC_AFM_DECODER_CLASS(clss) (G_TYPE_CHECK_CLASS_CAST ((clss), PANGO_TYPE_FC_AFM_DECODER, PangoFcAfmDecoderClass))
-#define PANGO_IS_FC_AFM_DECODER_CLASS(clss) (G_TYPE_CHECK_CLASS_TYPE ((clss), PANGO_TYPE_FC_AFM_DECODER))
-#define PANGO_FC_AFM_DECODER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_FC_AFM_DECODER, PangoFcAfmDecoderClass))
-
-typedef struct _PangoFcAfmDecoder PangoFcAfmDecoder;
-typedef struct _PangoFcAfmDecoderClass PangoFcAfmDecoderClass;
-typedef struct _PangoFcAfmDecoderPrivate PangoFcAfmDecoderPrivate;
-
-
-/**
- * PangoFcAfmDecoder:
- *
- * #PangoFcAfmDecoder implements an PangoFcDecoder for fonts
- * with an afm mapping.
- **/
-struct _PangoFcAfmDecoder
-{
- PangoFcDecoder parent_instance;
-
- /*< private >*/
- PangoFcAfmDecoderPrivate *priv;
-};
-
-PangoFcAfmDecoder *pango_fc_afm_decoder_new (void);
-PangoFcDecoder *pango_fc_afm_find_decoder (FcPattern *pattern, gpointer user_data);
-void pango_fc_afm_add_decoder (char const *family_name);
-
-/**
- * PangoFcAfmDecoderClass:
- * @read_afm: Read afm mapping for #fcfont.
- *
- * Class structure for #PangoFcAfmDecoder.
- **/
-struct _PangoFcAfmDecoderClass
-{
- /*< private >*/
- PangoFcDecoderClass parent_class;
-
- /*< public >*/
- void (*read_afm) (PangoFcAfmDecoder *self, PangoFcFont *fcfont);
-};
-
-G_END_DECLS
-
-#endif /* HAVE_PANGO_FC_FONT_MAP_ADD_DECODER_FIND_FUNC */
-
-#endif /* __PANGOFC_AFM_DECODER_H__ */
(c) 2004 Jan Nieuwenhuizen <janneke@gnu.org>
*/
+
#ifndef PAPER_BOOK_HH
#define PAPER_BOOK_HH
#include "protected-scm.hh"
#include "smobs.hh"
-struct Score_lines
-{
- SCM lines_;
- SCM header_;
-
- Score_lines () ;
- void gc_mark ();
-};
+#define PAGE_LAYOUT "ps"
-/*
-
-This class is rather empty. It collects systems (Paper_system), and
-exports them to the output backend, either as systems or as completely
-formatted pages.
-
-*/
class Paper_book
{
- DECLARE_SMOBS (Paper_book, );
-
- SCM lines_;
- SCM pages_;
public:
- SCM header_;
- Array<Score_lines> score_lines_;
- Output_def *bookpaper_;
-
- Paper_book ();
+ Array<SCM> headers_;
+ Array<SCM> global_headers_;
+ Link_array<Paper_def> papers_;
+ Array<SCM> scores_;
+ Real height_;
+ SCM copyright_;
+ SCM tagline_;
+ Paper_book ();
+ void init ();
+ Link_array<Page> *pages ();
SCM lines ();
- SCM pages ();
- Stencil book_title ();
- Stencil score_title (int);
- void classic_output (String);
+ SCM scopes (int);
+ Stencil* title (int);
void output (String);
+ void classic_output (String);
+ DECLARE_SMOBS (Paper_book, )
};
DECLARE_UNSMOB (Paper_book, paper_book)
+/*
+ paper-def.hh -- declare Paper_def
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1996--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+
+#ifndef PAPER_DEF_HH
+#define PAPER_DEF_HH
+
+
+#include "lily-proto.hh"
+#include "lily-guile.hh"
+#include "real.hh"
+#include "array.hh"
+#include "interval.hh"
+#include "music-output-def.hh"
+
+
+/**
+
+ Symbols, dimensions and constants pertaining to visual output.
+
+ This struct takes care of all kinds of symbols, dimensions and
+ constants. Most of them are related to the point-size of the fonts,
+ so therefore, the lookup table for symbols is also in here.
+
+ TODO:
+
+ add support for multiple fontsizes
+
+ remove all utility funcs
+
+
+ add support for other len->wid conversions.
+
+
+ Interesting variables:
+
+ /// The distance between lines
+ interline
+
+*/
+class Paper_def : public Music_output_def
+{
+protected:
+ VIRTUAL_COPY_CONSTRUCTOR (Music_output_def, Paper_def);
+
+public:
+ static int score_count_;
+
+ Paper_def ();
+ Paper_def (Paper_def const&);
+ virtual ~Paper_def ();
+
+ Paper_outputter* get_paper_outputter (String) const;
+ SCM font_descriptions () const;
+ void reinit ();
+ Interval line_dimensions_int (int) const;
+ void output_settings (Paper_outputter*) const;
+ Font_metric *find_font (SCM name, Real mag);
+
+ /* JUNKME */
+ Real get_realvar (SCM symbol) const;
+
+ friend int yyparse (void*);
+};
+
+Paper_def * unsmob_paper (SCM x);
+Font_metric *select_font (Paper_def *paper, SCM chain);
+
+#endif /* PAPER_DEF_HH */
--- /dev/null
+/*
+ paper-line.hh -- declare Paper_line
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+#ifndef PAPER_LINE_HH
+#define PAPER_LINE_HH
+
+#include "lily-proto.hh"
+#include "smobs.hh"
+#include "offset.hh"
+
+class Paper_line
+{
+ DECLARE_SMOBS (Paper_line,)
+ SCM stencils_;
+ Offset dim_;
+ bool is_title_;
+
+public:
+ Paper_line (Offset, SCM, bool = false);
+
+ int number_;
+ Offset dim () const;
+ SCM stencils () const;
+ bool is_title () const;
+};
+
+DECLARE_UNSMOB (Paper_line, paper_line);
+
+#endif /* PAPER_LINE_HH */
#include "lily-guile.hh"
#include "protected-scm.hh"
-/*
- Glue between the backend (grobs, systems, pages) and the output file.
- proxy for Scheme backends.
-*/
-class Paper_outputter
-{
- SCM output_module_;
- String filename_;
- SCM file_;
+/**
+ Interface for a Grob to output itself; The Paper_score contains a
+ pointer to a Paper_outputter, and this enables every grob to output
+ itself.
- SCM file ();
+ The Paper_outputter contains a reference to an output stream
+ (Paper_stream). */
+class Paper_outputter
+{
+ bool verbatim_scheme_b_;
public:
- DECLARE_SMOBS (Paper_outputter,);
-public:
- SCM dump_string (SCM);
+ SCM output_func_;
+ SCM output_module_;
+ Protected_scm file_;
+
+ String basename_;
+ Paper_outputter (String nm);
+ ~Paper_outputter ();
+
+ void dump_scheme (SCM);
+
+ void output_metadata (Paper_def*, SCM);
+ void output_music_output_def (Music_output_def* odef);
void output_scheme (SCM scm);
- Paper_outputter (String nm, String format);
- SCM scheme_to_string (SCM);
- void output_stencil (Stencil);
+ void output_expr (SCM expr, Offset o);
+ void output_header (Paper_def*, SCM, int);
+ void output_line (SCM, Offset*, bool);
};
-Paper_outputter *get_paper_outputter (String, String);
-DECLARE_UNSMOB (Paper_outputter, outputter);
-
#endif /* PAPER_OUTPUTTER_HH */
class Paper_score : public Music_output
{
public:
- Output_def *paper_;
+ Paper_def *paper_;
System *system_;
Paper_score ();
+++ /dev/null
-/*
- paper-system.hh -- declare Paper_system
-
- source file of the GNU LilyPond music typesetter
-
- (c) 2004 Jan Nieuwenhuizen <janneke@gnu.org>
-*/
-#ifndef PAPER_LINE_HH
-#define PAPER_LINE_HH
-
-#include "lily-proto.hh"
-#include "smobs.hh"
-#include "offset.hh"
-#include "stencil.hh"
-
-/*
- A formatted "system" (A block of titling also is a Paper_system)
-
- To save memory, we don't keep around the System grobs, but put the
- formatted content of the grob is put into a Paper_system. Page-breaking handles
- Paper_system objects.
-
- */
-class Paper_system
-{
- DECLARE_SMOBS (Paper_system, );
- Stencil stencil_;
- bool is_title_;
-
-public:
- Real penalty_;
- int number_;
-
- Paper_system (Stencil, bool);
-
- Offset dim () const;
- Stencil to_stencil () const;
- SCM stencils () const;
- bool is_title () const;
- Real penalty () const;
-};
-
-DECLARE_UNSMOB (Paper_system, paper_line);
-
-#endif /* PAPER_LINE_HH */
-/*
- lily-guile.hh encapsulate guile
- source file of the GNU LilyPond music typesetter
-
- (c) 2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
-*/
-
-#ifndef PARSE_SCM_HH
-#define PARSE_SCM_HH
+#ifndef PARSE_SCM
+#define PARSE_SCM
#include "input.hh"
#include "lily-guile.hh"
char const* str;
int nchars;
Input start_location_;
- bool safe_;
};
SCM catch_protected_parse_body (void *);
SCM protected_ly_parse_scm (Parse_start *, bool);
+
SCM ly_parse_scm (char const *, int *, Input, bool);
-#endif /* PARSE_SCM_HH */
+#endif
Link_array<Audio_staff> audio_staffs_;
Cons<Audio_element> *audio_elem_p_list_;
- Output_def *midi_;
+ Midi_def *midi_;
};
#endif /* PERFORMANCE_HH */
#include "font-metric.hh"
-/* Perhaps junk this, and move this to paper_def as interface? */
-struct Modified_font_metric : public Font_metric
+/*
+ Perhaps junk this, and move this to paper_def as interface?
+ */
+struct Scaled_font_metric : public Font_metric
{
-public:
- Box text_dimension (String);
-
-
- static SCM make_scaled_font_metric (SCM, Font_metric*, Real);
+ virtual Box text_dimension (String) const;
+ virtual Stencil find_by_name (String) const;
+ static SCM make_scaled_font_metric (Font_metric*, Real);
virtual int count () const;
virtual Offset get_indexed_wxwy (int) const;
virtual int name_to_index (String) const;
- virtual String coding_scheme () const;
-
- virtual Font_metric * original_font () const;
-
protected:
-
- SCM coding_vector_;
- SCM coding_table_;
- SCM coding_mapping_;
- SCM coding_description_;
- friend SCM ly_font_encoding_alist (SCM);
-
- virtual Real design_size () const;
- virtual void derived_mark () const;
- virtual Box get_indexed_char (int) const;
- virtual int index_to_ascii (int) const;
- virtual Box get_ascii_char (int) const;
+ virtual Box get_indexed_char (int)const;
+ virtual Box get_ascii_char (int)const;
Font_metric *orig_;
Real magnification_;
- String coding_scheme_;
-
- Modified_font_metric (String, Font_metric*, Real);
- Box tex_kludge (String) const;
+ Scaled_font_metric (Font_metric*,Real);
};
-
-#endif /* SCALED_FONT_METRIC_HH */
+#endif
virtual void initialize ();
virtual void finalize ();
virtual void announce_grob (Grob_info);
+ virtual void typeset_grob (Grob*elem);
virtual void stop_translation_timestep ();
public:
#ifndef SCORE_HH
#define SCORE_HH
+#include "input.hh"
#include "lily-proto.hh"
-#include "input.hh"
#include "parray.hh"
#include "smobs.hh"
-#include "virtual-methods.hh"
class Score : public Input
{
- DECLARE_SMOBS (Score, foo);
-
public:
- Link_array<Output_def> defs_;
+ Link_array<Music_output_def> defs_;
SCM music_;
SCM header_;
Score ();
Score (Score const&);
- SCM book_rendering (String, Output_def*, Output_def*);
+ DECLARE_SMOBS (Score,foo);
};
+DECLARE_UNSMOB (Score,score);
-DECLARE_UNSMOB (Score, score);
SCM ly_run_translator (SCM, SCM);
SCM ly_render_output (SCM, SCM);
-void default_rendering (SCM, SCM, SCM, SCM, SCM);
+void default_rendering (SCM,SCM,SCM,SCM);
#endif /* SCORE_HH */
For example,
Complex_smob::Complex_smob () {
- scm_member_ = SCM_EOL;
+ scm_member_ =SCM_EOL;
smobify_self ();
scm_member_ = <..what you want to store..>
}
- after construction, the self_scm () field of a complex smob is
- protected from Garbage Collection. This protection should be
- removed once the object is put into another (reachable) Scheme data
- structure, i.e.
+ after creation, the self_scm() field of a complex smob is protected
+ from Garbage Collection. This protection should be removed once the
+ object is put into another (reachable) Scheme data structure, ie.
- Complex_smob *p = new Complex_smob;
+ Complex_smob * p = new Complex_smob;
list = scm_cons (p->self_scm (), list);
scm_gc_unprotect_object (p->self_scm ());
- Complex smobs are made with DECLARE_SMOBS (Classname,) in the class
+ Complex smobs are made with DECLARE_SMOBS(Classname,) in the class
declaration.
CALLING INTERFACE
For implementating a class, the following should be provided
- - an equal_p () function (a default is in the
+ - an equal_p() function (a default is in the
IMPLEMENT_DEFAULT_EQUAL_P macro in ly-smobs.icc)
- mark_smob () function, that calls scm_gc_mark () on all Scheme
- a print_smob () function, that displays a representation for
debugging purposes
- - A call to one of the IMPLEMENT_SMOBS or IMPLEMENT_SIMPLE_SMOBS macros
- from file "ly-smobs.icc"
+ - A call to one of the IMPLEMENT_SMOBS or IMPLEMENT_SIMPLE_SMOBS macros
+ from file "ly-smobs.icc"
+
*/
-#define DECLARE_SIMPLE_SMOBS(CL, dummy) \
+#define DECLARE_SIMPLE_SMOBS(CL,dummy) \
public: \
SCM smobbed_copy () const; \
DECLARE_BASE_SMOBS(CL)
#define DECLARE_BASE_SMOBS(CL) \
- friend class Non_existent_class; \
-private: \
+ friend class Non_existant_class ; \
+private:\
static scm_t_bits smob_tag_; \
static SCM mark_smob (SCM); \
static size_t free_smob (SCM s); \
virtual ~CL ();\
SCM unprotected_smobify_self ();\
private: \
- void smobify_self (); \
+ SCM smobify_self (); \
SCM self_scm_; \
public: \
SCM self_scm () const { return self_scm_; } \
return CL::unsmob (s); \
}
-#define DECLARE_TYPE_P(CL) extern SCM CL ## _type_p_proc
+
#endif /* SMOBS_HH */
-/*
- source-file.hh -- declare Source_file
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1999--2004 Jan Nieuwenhuizen <janneke@gnu.org>
-*/
#ifndef SOURCE_FILE_HH
#define SOURCE_FILE_HH
Protected_scm str_port_;
};
-char *gulp_file (String fn, int *len);
+char * gulp_file (String fn, int *len);
-#endif /* SOURCE_FILE_HH */
+#endif // SOURCE_FILE_HH //
#include "cons.hh"
#include "flower-proto.hh"
-/* A set of sourcefiles. */
+/*
+ a set of sourcefiles.
+ */
class Sources
{
Sources (Sources const&) {}
- Cons<Source_file> *sourcefile_list_;
- bool is_binary_;
-
public:
Sources ();
~Sources ();
- Source_file *get_file (String &filename );
- Source_file *get_sourcefile (char const*);
+ Source_file * get_file (String &filename );
+ Source_file* get_sourcefile (char const* str0 );
void add (Source_file* sourcefile );
- void set_path (File_path*);
+ void set_path (File_path*p);
void set_binary (bool);
- const File_path *path_;
+ const File_path * path_C_;
+private:
+ Cons<Source_file> *sourcefile_list_;
+ bool is_binary_ ;
};
-#endif /* SOURCE_HH */
+#endif // SOURCE_HH //
#include <stdlib.h> // size_t
#include "lily-proto.hh"
#include "box.hh"
+#include "axes.hh"
#include "direction.hh"
#include "lily-guile.hh"
#include "smobs.hh"
It is implemented as a "tree" of scheme expressions, as in
- Expr = combine Expr-list
- | translate Offset Expr
- | origin (ORIGIN) Expr
- | no-origin Expr
- | (SCHEME)
- ;
+ Expr = combine Expr Expr
+ | translate Offset Expr
+ | SCHEME
+ ;
SCHEME is a Scheme expression that --when eval'd-- produces the
desired output.
- Notes:
-
- * Because of the way that Stencil is implemented, it is the most
- efficient to add "fresh" stencils to what you're going to build.
- * Do not create Stencil objects on the heap. That includes passing
- around Stencil* which are produced by unsmob_stencil(). Either
- copy Stencil objects, or use SCM references.
+ Because of the way that Stencil is implemented, it is the most
+ efficient to add "fresh" stencils to what you're going to build.
- * Empty stencils have empty dimensions. If add_at_edge is used to
- init the stencil, we assume that
+ Dimension behavior:
- DIMENSIONS = (Interval (0,0),Interval (0,0)
+ Empty stencils have empty dimensions. If add_at_edge is used to
+ init the stencil, we assume that
+ DIMENSIONS = (Interval (0,0),Interval (0,0)
*/
class Stencil
{
Stencil ();
Offset origin () const;
- SCM expr () const;
+ SCM get_expr () const;
/**
Set dimensions to empty, or to (Interval (0,0),Interval (0,0) */
DECLARE_UNSMOB(Stencil,stencil);
SCM fontify_atom (Font_metric const*, SCM atom);
-void interpret_stencil_expression (SCM expr,
- void (*func) (void*, SCM),
- void *func_arg,
- Offset o);
-
Stencil create_stencil (SCM print);
-SCM find_expression_fonts (SCM expr);
-#endif /* STENCIL_HH */
+
+
+#endif
public:
DECLARE_SCHEME_CALLBACK (print, (SCM));
DECLARE_SCHEME_CALLBACK (interpret_markup, (SCM, SCM, SCM));
- DECLARE_SCHEME_CALLBACK (interpret_string, (SCM, SCM, SCM, SCM));
static bool has_interface (Grob*);
static bool markup_p (SCM) ;
void read_char_metrics ();
Tex_font_char_metric read_char_metric (Char_code code);
Tex_font_char_metric read_char ();
- void read_lig_kern_program (Array<Tfm_ligature>* ligatures,
- Array <Tfm_kern>* kerns);
+ void read_lig_kern_program (Array<Tfm_ligature>* ligatures, Array <Tfm_kern>* kerns);
+
Binary_source_file input_;
public:
Tex_font_metric_reader ( String name);
+
Tfm_info info_;
Tfm_header header_;
Array<Tex_font_char_metric> char_metrics_;
Array<int> ascii_to_metric_idx_;
};
+
#endif /* TFM_READER_HH */
struct Tex_font_char_metric
{
- bool exists_;
+ bool exists_b_;
Char_code code_;
Real width_, height_, depth_, italic_correction_;
Fix width_fix_, height_fix_, depth_fix_, italic_correction_fix_;
Array<Tfm_kern> kerns_;
Array<Tfm_ligature> ligatures_;
+ String to_string () const;
Tex_font_char_metric ();
Box dimensions () const;
};
-class Tex_font_metric : public Simple_font_metric
+class Tex_font_metric : public Font_metric
{
public:
static SCM make_tfm (String filename);
virtual int count () const;
virtual Box get_ascii_char (int) const;
- virtual Real design_size () const;
- virtual String coding_scheme () const;
- virtual void derived_mark () const;
- virtual int name_to_index (String) const;
-
+ Tex_font_char_metric const *find_ascii (int ascii, bool warn=true) const;
+
+ String to_string () const;
Tfm_info info_;
Tfm_header header_;
Array<Tex_font_char_metric> char_metrics_;
Array<int> ascii_to_metric_idx_;
- SCM encoding_table_;
-
private:
- Tex_font_char_metric const *find_ascii (int ascii, bool warn=true) const;
Tex_font_metric ();
};
class Translator
{
void init ();
-
public:
- Context * context () const { return daddy_context_; }
+ Music_output_def * output_def_;
Translator (Translator const &);
+ Context * daddy_context_ ;
+ void removal_processing ();
+ virtual Music_output_def *get_output_def () const;
SCM internal_get_property (SCM symbol) const;
-
- virtual Output_def *get_output_def () const;
virtual Translator_group* get_daddy_translator ()const;
virtual Moment now_mom () const;
+
+public:
+ DECLARE_SMOBS (Translator, dummy);
+
+protected: // should be private.
+ SCM simple_trans_list_;
+ friend class Context_def;
+
+public:
+ Score_context * get_score_context () const;
+ Global_context * get_global_context () const;
+
+ TRANSLATOR_DECLARATIONS(Translator);
virtual bool try_music (Music *req);
virtual void stop_translation_timestep ();
virtual void start_translation_timestep ();
virtual void process_music ();
virtual void do_announces ();
virtual void finalize ();
-
- Score_context * get_score_context () const;
- Global_context * get_global_context () const;
-
- TRANSLATOR_DECLARATIONS(Translator);
- DECLARE_SMOBS (Translator, dummy);
-protected: // should be private.
- Context * daddy_context_ ;
- SCM simple_trans_list_;
- friend class Context_def;
- friend class Context;
};
/**
class Virtual_font_metric : public Font_metric
{
SCM font_list_;
-
public:
- SCM get_font_list () const;
- Virtual_font_metric (SCM namelist);
- virtual Real design_size () const;
+ Virtual_font_metric (SCM namelist, Real, Paper_def*);
+
virtual int count () const;
virtual Box get_indexed_char (int ascii) const;
virtual Box get_ascii_char (int ascii) const;
virtual Offset get_indexed_wxwy (int) const;
virtual int name_to_index (String)const;
virtual Stencil find_by_name (String) const;
- virtual String coding_scheme () const;
protected:
virtual void derived_mark () const;
--- /dev/null
+/*
+ scores.cc -- implement some globals
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+#include "config.h"
+
+#include <errno.h>
+#include <sys/types.h>
+#include <stdio.h>
+
+
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#include <unistd.h>
+
+
+#include "main.hh"
+#include "score.hh"
+#include "string.hh"
+#include "paper-def.hh"
+#include "warn.hh"
+#include "parray.hh"
+#include "file-path.hh"
+#include "input-file-results.hh"
+#include "my-lily-parser.hh"
+#include "source.hh"
+#include "lily-version.hh"
+#include "scm-hash.hh"
+#include "ly-module.hh"
+
+#include "paper-book.hh"
+
+bool store_locations_global_b;
+
+/*
+ TODO: should merge with My_lily_parser.
+ */
+
+/*
+ no ! suffix since it doesn't modify 1st argument.
+ */
+LY_DEFINE (ly_set_point_and_click, "ly:set-point-and-click", 1, 0, 0,
+ (SCM what),
+ "Set the options for Point-and-click source specials output. The\n"
+"argument is a symbol. Possible options are @code{none} (no source specials),\n"
+"@code{line} and @code{line-column}")
+{
+ /*
+ UGH.
+ */
+ SCM val = SCM_BOOL_F;
+ if (ly_symbol2scm ("line-column") == what)
+ val = gh_eval_str ("line-column-location");
+ else if (what == ly_symbol2scm ("line"))
+ val = gh_eval_str ("line-location");
+
+ scm_module_define (global_lily_module, ly_symbol2scm ("point-and-click"), val);
+
+ store_locations_global_b =gh_procedure_p (val);
+ return SCM_UNSPECIFIED;
+}
+
+void
+write_dependency_file (String fn,
+ Array<String> targets,
+ Array<String> deps)
+{
+ const int WRAPWIDTH = 65;
+
+ progress_indication (_f ("dependencies output to `%s'...", fn.to_str0 ()));
+ progress_indication ("\n");
+ FILE * f = fopen (fn.to_str0 (), "w");
+ if (!f)
+ warning (_f ("can't open file: `%s'", fn));
+
+ fprintf (f, "# Generated automatically by: %s\n", gnu_lilypond_version_string ().to_str0 ());
+
+ String out;
+ for (int i=0; i < targets.size (); i ++)
+ out += dependency_prefix_global + targets[i] + " ";
+ out += ": ";
+
+ for (int i=0; i < deps.size (); i ++)
+ {
+ if (out.length () > WRAPWIDTH)
+ {
+ fprintf (f, "%s\\\n", out.to_str0 ());
+ out = " ";
+ }
+ String dep = deps[i];
+ if (!dependency_prefix_global.is_empty ())
+ {
+ if (dep.index ('/') < 0)
+ dep = dependency_prefix_global + dep;
+ }
+ out += " " + dep;
+ }
+ fprintf (f, "%s\n", out.to_str0 ());
+}
+
+
+void
+Input_file_results::do_deps (String output)
+{
+ if (dependency_global_b)
+ {
+ Path p = split_path (output);
+ p.ext = "dep";
+ write_dependency_file (p.to_string (),
+ target_strings_,
+ inclusion_names_);
+ }
+}
+
+Input_file_results::~Input_file_results ()
+{
+ inclusion_names_.clear ();
+ if (header_)
+ header_ = SCM_EOL;
+
+ global_input_file = 0;
+
+ ly_clear_anonymous_modules ();
+}
+
+
+
+Input_file_results* global_input_file;
+
+Input_file_results::Input_file_results (String init, String in_file, String out_file)
+{
+ header_ = ly_make_anonymous_module ();
+ global_input_file = this;
+ score_count_ = 0;
+ sources_.set_path (&global_path);
+
+
+ progress_indication (_f ("Now processing `%s'", in_file.to_str0 ()));
+ progress_indication ("\n");
+
+ My_lily_parser parser (this);
+ parser.parse_file (init, in_file, out_file);
+
+ if (parser.error_level_)
+ {
+ exit_status_global = 1;
+ failed_files.push (in_file);
+ }
+
+
+ do_deps (out_file);
+}
+
+/* Distill full input file name from command argument. PATH describes
+ file name with added default extension, ".ly" if none. "-" is
+ STDIN. */
+Path
+distill_inname (String str)
+{
+ Path p = split_path (str);
+ if (str.is_empty () || str == "-")
+ p.base = "-";
+ else
+ {
+ String orig_ext = p.ext;
+ char const *extensions[] = {"ly", "", 0};
+ for (int i = 0; extensions[i]; i++)
+ {
+ p.ext = orig_ext;
+ if (*extensions[i] && !p.ext.is_empty ())
+ p.ext += ".";
+ p.ext += extensions[i];
+ if (!global_path.find (p.to_string ()).is_empty ())
+ break;
+ }
+ /* Reshuffle extension */
+ p = split_path (p.to_string ());
+ }
+ return p;
+}
+
+/* ugr. */
+void
+do_one_file (char const *file)
+{
+ String infile (file);
+ Path inpath = distill_inname (infile);
+
+ /* By default, use base name of input file for output file name */
+ Path outpath = inpath;
+ if (inpath.to_string () != "-")
+ outpath.ext = output_format_global;
+
+ /* By default, write output to cwd; do not copy directory part
+ of input file name */
+ outpath.root = "";
+ outpath.dir = "";
+
+ if (!output_name_global.is_empty ())
+ outpath = split_path (output_name_global);
+
+ String init;
+ if (!init_name_global.is_empty ())
+ init = init_name_global;
+ else
+ init = "init.ly";
+
+ String in_file = inpath.to_string ();
+ String out_file = outpath.to_string ();
+
+ if (init.length () && global_path.find (init).is_empty ())
+ {
+ warning (_f ("can't find file: `%s'", init));
+ warning (_f ("(search path: `%s')", global_path.to_string ().to_str0 ()));
+ return;
+ }
+
+ if ((in_file != "-") && global_path.find (in_file).is_empty ())
+ {
+ warning (_f ("can't find file: `%s'", in_file));
+ return;
+ }
+
+ paper_book = new Paper_book ();;
+ Input_file_results inp_file (init, in_file, out_file);
+ if (output_format_global == PAGE_LAYOUT)
+ paper_book->output (out_file);
+
+ scm_gc_unprotect_object (paper_book->self_scm ());
+ paper_book = 0;
+}
{
Input *ip = unsmob_input (sip);
SCM_ASSERT_TYPE (ip, sip, SCM_ARG1, __FUNCTION__, "input location");
- SCM_ASSERT_TYPE (ly_c_string_p (msg), msg, SCM_ARG2, __FUNCTION__, "string");
+ SCM_ASSERT_TYPE (gh_string_p (msg), msg, SCM_ARG2, __FUNCTION__, "string");
String m = ly_scm2string (msg);
ip->message (m);
- return SCM_UNSPECIFIED;
+ return SCM_UNDEFINED;
}
-/*
- TODO: rename this function. ly:input-location? vs ly:input-location
- */
LY_DEFINE (ly_input_location, "ly:input-location", 1, 0, 0, (SCM sip),
"Return input location in @var{sip} as (filename line column).")
{
void
Instrument_name_engraver::initialize ()
{
- context ()->set_property ("instrumentSupport", SCM_EOL);
+ daddy_context_->set_property ("instrumentSupport", SCM_EOL);
}
void
{
text_->set_property ("side-support-elements",
get_property ("instrumentSupport"));
+ typeset_grob (text_);
text_ = 0;
}
}
return ;
- text_ = make_item ("InstrumentName", SCM_EOL);
+ text_ = make_item ("InstrumentName");
if (text_->get_property ("text") != txt)
text_->set_property ("text", txt);
-
+ announce_grob (text_, SCM_EOL);
}
void
&& Axis_group_interface::has_axis (i.grob_, Y_AXIS)))
&& !Align_interface::has_interface (i.grob_))
{
- SCM nl = scm_cons (i.grob_->self_scm (),
+ SCM nl = gh_cons (i.grob_->self_scm (),
get_property ("instrumentSupport"));
- context ()->set_property ("instrumentSupport", nl);
+ daddy_context_->set_property ("instrumentSupport", nl);
}
}
Also create text if barlines in other groups. This allows
a name to be attached to lyrics or chords.
*/
- if (ly_c_string_p (get_property ("whichBar")))
+ if (gh_string_p (get_property ("whichBar")))
create_text ();
}
if (txt == SCM_EOL)
return ;
- text_ = make_item ("VocalName", SCM_EOL);
+ text_ = make_item ("VocalName");
if (text_->get_property ("text") != txt)
text_->set_property ("text", txt);
-
+ announce_grob (text_, SCM_EOL);
}
if (!dynamic_cast<Item*> (me))
me->programming_error ("only items can be breakable.");
- Item * i = dynamic_cast<Item*> (me->get_parent (X_AXIS));
- return (i) ? Item::is_breakable (i) : to_boolean (me->get_property ("breakable"));
+ Item * i =dynamic_cast<Item*> (me->get_parent (X_AXIS));
+ return (i) ? Item::is_breakable (i) : to_boolean (me->get_property ("breakable"));
}
Paper_column *
more complicated things.
*/
SCM vis = get_property ("break-visibility");
- if (ly_c_procedure_p (vis))
+ if (gh_procedure_p (vis))
{
- SCM args = scm_list_n (scm_int2num (break_status_dir ()), SCM_UNDEFINED);
- SCM result = scm_apply_0 (vis, args);
- bool trans = ly_scm2bool (ly_car (result));
- bool empty = ly_scm2bool (ly_cdr (result));
+ SCM args = scm_list_n (gh_int2scm (break_status_dir ()), SCM_UNDEFINED);
+ SCM result = gh_apply (vis, args);
+ bool trans = gh_scm2bool (ly_car (result));
+ bool empty = gh_scm2bool (ly_cdr (result));
if (empty && trans)
suicide ();
{
if (!item_)
{
- item_ = make_item ("KeySignature", key_ev_ ? key_ev_->self_scm () : SCM_EOL);
+ item_ = make_item ("KeySignature");
item_->set_property ("c0-position",
get_property ("middleCPosition"));
if (to_boolean (get_property ("printKeyCancellation")))
item_->set_property ("old-accidentals", get_property ("lastKeySignature"));
item_->set_property ("new-accidentals", get_property ("keySignature"));
+
+ announce_grob (item_, key_ev_ ? key_ev_->self_scm () : SCM_EOL);
}
if (!def)
{
SCM vis = get_property ("explicitKeySignatureVisibility");
- if (ly_c_procedure_p (vis))
+ if (gh_procedure_p (vis))
item_->set_property ("break-visibility",vis);
}
}
{
if (ev->is_mus_type ("key-change-event"))
{
- /* do this only once, just to be on the safe side. */
if (!key_ev_)
{
+ /*
+ do this only once, just to be on the safe side.
+ */
key_ev_ = ev;
read_ev (key_ev_);
}
+
return true;
}
return false;
}
}
else if (Bar_line::has_interface (info.grob_)
- && ly_c_pair_p (get_property ("keySignature")))
+ && gh_pair_p (get_property ("keySignature")))
{
create_key (true);
}
void
Key_engraver::stop_translation_timestep ()
{
- item_ = 0;
- context ()->set_property ("lastKeySignature", get_property ("keySignature"));
+ if (item_)
+ {
+ typeset_grob (item_);
+ item_ = 0;
+ }
}
Key_engraver::read_ev (Music const * r)
{
SCM p = r->get_property ("pitch-alist");
- if (!ly_c_pair_p (p))
+ if (!gh_pair_p (p))
return;
SCM n = scm_list_copy (p);
SCM accs = SCM_EOL;
for (SCM s = get_property ("keyAccidentalOrder");
- ly_c_pair_p (s); s = ly_cdr (s))
+ gh_pair_p (s); s = ly_cdr (s))
{
- if (ly_c_pair_p (scm_member (ly_car (s), n)))
+ if (gh_pair_p (scm_member (ly_car (s), n)))
{
- accs = scm_cons (ly_car (s), accs);
+ accs = gh_cons (ly_car (s), accs);
n = scm_delete_x (ly_car (s), n);
}
}
- for (SCM s = n ; ly_c_pair_p (s); s = ly_cdr (s))
- if (ly_scm2int (ly_cdar (s)))
- accs = scm_cons (ly_car (s), accs);
+ for (SCM s = n ; gh_pair_p (s); s = ly_cdr (s))
+ if (gh_scm2int (ly_cdar (s)))
+ accs = gh_cons (ly_car (s), accs);
- context ()->set_property ("keySignature", accs);
- context ()->set_property ("tonic" ,
+ daddy_context_->set_property ("keySignature", accs);
+ daddy_context_->set_property ("tonic" ,
r->get_property ("tonic"));
}
Key_engraver::start_translation_timestep ()
{
key_ev_ = 0;
+ daddy_context_->set_property ("lastKeySignature", get_property ("keySignature"));
}
void
Key_engraver::initialize ()
{
- context ()->set_property ("keySignature", SCM_EOL);
- context ()->set_property ("lastKeySignature", SCM_EOL);
+ daddy_context_->set_property ("keySignature", SCM_EOL);
+ daddy_context_->set_property ("lastKeySignature", SCM_EOL);
Pitch p (0,0,0);
- context ()->set_property ("tonic", p.smobbed_copy ());
+ daddy_context_->set_property ("tonic", p.smobbed_copy ());
}
SCM pitchlist = key_req_->get_property ("pitch-alist");
SCM proc = ly_scheme_function ("alterations-in-key");
- SCM acc = scm_call_1 (proc, pitchlist);
+ SCM acc = gh_call1 (proc, pitchlist);
Pitch key_do (0,
- ly_scm2int (ly_caar (pitchlist)),
- ly_scm2int (ly_cdar (pitchlist)));
+ gh_scm2int (ly_caar (pitchlist)),
+ gh_scm2int (ly_cdar (pitchlist)));
Pitch c_do (0, 0, 0);
/* MIDI keys are too limited for lilypond scales.
We check for minor scale and assume major otherwise. */
SCM minor = scm_c_eval_string ("minor");
- audio_ = new Audio_key (ly_scm2int (acc),
+ audio_ = new Audio_key (gh_scm2int (acc),
SCM_BOOL_T != scm_equal_p (minor, c_pitchlist));
Audio_element_info info (audio_, key_req_);
#include "item.hh"
#include "stencil.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "font-interface.hh"
#include "staff-symbol-referencer.hh"
#include "lookup.hh"
the thinking to other parties.
- TODO: put this in Scheme
+
+ - lots of values trivially shared (key doesn't change very
+ often). Compute those once, and use that as cache for the rest.
TODO: can we do without c0pos? it's partly musical.
int
alteration_pos (SCM what, int alter, int c0p)
{
- if (ly_c_pair_p (what))
- return ly_scm2int (ly_car (what)) * 7 + ly_scm2int (ly_cdr (what)) + c0p;
+ if (gh_pair_p (what))
+ return gh_scm2int (ly_car (what)) * 7 + gh_scm2int (ly_cdr (what)) + c0p;
- int p = ly_scm2int (what);
+ int p = gh_scm2int (what);
// Find the c in the range -4 through 2
int from_bottom_pos = c0p + 4;
{
p -= 7; /* Typeset below c_position */
}
-
/* Provide for the four cases in which there's a glitch
it's a hack, but probably not worth
the effort of finding a nicer solution.
SCM scm_style = me->get_property ("style");
String style;
- if (ly_c_symbol_p (scm_style))
+ if (gh_symbol_p (scm_style))
{
style = ly_symbol2string (scm_style);
}
SCM c0s = me->get_property ("c0-position");
int c0p = 0;
- if (ly_c_number_p (c0s))
- c0p = ly_scm2int (c0s);
+ if (gh_number_p (c0s))
+ c0p = gh_scm2int (c0s);
/*
SCM lists are stacks, so we work from right to left, ending with
*/
Font_metric *fm = Font_interface::get_default_font (me);
- for (SCM s = newas; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = newas; gh_pair_p (s); s = ly_cdr (s))
{
- int alteration = ly_scm2int (ly_cdar (s));
+ int alteration = gh_scm2int (ly_cdar (s));
String font_char =
Accidental_interface::get_fontcharname (style, alteration);
Stencil acc (fm->find_by_name ("accidentals-" + font_char));
mol.add_at_edge (X_AXIS, LEFT, Lookup::blank (Box (x,y)), 0, 0);
Stencil natural;
- if (ly_c_pair_p (old))
+ if (gh_pair_p (old))
natural=Font_interface::get_default_font (me)->
find_by_name (String ("accidentals-") + style + String ("0"));
- for (; ly_c_pair_p (old); old = ly_cdr (old))
+ for (; gh_pair_p (old); old = ly_cdr (old))
{
SCM found = scm_assoc (ly_caar (old), newas);
if (found == SCM_BOOL_F
#include "string.hh"
#include "main.hh"
#include "kpath.hh"
-#include "source-file.hh"
#include "warn.hh"
String
kpathsea_find_afm (char const * name)
{
#if (KPATHSEA && HAVE_KPSE_FIND_FILE)
- char * name_ptr = kpse_find_file (name, kpse_afm_format, false);
+ char * name_ptr = kpse_find_file (name, kpse_afm_format, true);
if (!name_ptr)
{
}
String
-kpathsea_find_tfm (char const *name)
+kpathsea_find_tfm (char const * name)
{
- String filename = global_path.find (String (name) + ".tfm");
+ String p = global_path.find (String (name) + ".tfm");
+
+ if (p.length ())
+ return p;
+
#if (KPATHSEA && HAVE_KPSE_FIND_FILE)
- if (filename.is_empty ())
- {
- /* If invoked for a TeX font, we could do TRUE (must exist).
- We could also do:
- p = kpse_find_file (name, kpse_mf_format, false);
- if (p)
- p = kpse_find_file (name, kpse_mf_format, true);
-
- but we assume that if there is a .PFA, there is also a .TFM,
- and it's no use generating TFMs on the fly, because PFAs cannot
- be generated on the fly. */
- char *p = kpse_find_file (name, kpse_tfm_format, false);
- if (!p)
- warning (_f ("kpathsea can not find TFM file: `%s'", name));
- else
- filename = p;
- }
+ char * name_ptr = kpse_find_file (name, kpse_tfm_format, true);
+ if (!name_ptr)
+ warning (_f ("kpathsea can not find TFM file: `%s'", name));
+ else
+ return name_ptr;
+
#endif
- return filename;
+ return "";
}
-#if KPATHSEA
-/* FIXME: this should be part of kpathsea */
-static kpse_file_format_type
-kpathsea_find_format (String name)
+void
+initialize_kpathsea (char *av0)
{
- for (int i = 0; i < kpse_last_format; i++)
- {
- if (!kpse_format_info[i].type)
- kpse_init_format ((kpse_file_format_type) i);
-
- char const **suffixes[] = { kpse_format_info[i].suffix,
- kpse_format_info[i].alt_suffix };
- for (int j = 0; j < 2; j++)
- for (char const **p = suffixes[j]; p && *p; p++)
- {
- String suffix = *p;
- if (name.right_string (suffix.length ()) == suffix)
- return (kpse_file_format_type) i;
- }
- }
- return kpse_last_format;
-}
-#endif
+#if KPATHSEA && HAVE_KPATHSEA_KPATHSEA_H
+ /*
+ We take two pronged approach to tfms:
-String
-kpathsea_gulp_file_to_string (String name)
-{
- String filename = global_path.find (name);
+ * the lilypond tfms (feta*.tfm) are found through our own routines.
-#if (KPATHSEA && HAVE_KPSE_FIND_FILE)
- if (filename.is_empty ())
- {
- char *p = kpse_find_file (name.to_str0 (), kpathsea_find_format (name),
- true);
- if (p)
- filename = p;
- else
- warning (_f ("kpathsea can not find file: `%s'", name));
- }
-#endif
+ * the TeX tfms are found through vanilla kpathsea.
- if (filename.is_empty ())
- error (_f ("can't find file: `%s'", name));
+ (* other TFMs are not found, i.e. don't use them. )
- if (verbose_global_b)
- progress_indication ("[" + filename);
+ PRO:
+
+ - TFM and AFM checksums always match in Lily.
- int filesize;
- char *str = gulp_file (filename, &filesize);
- String string (str);
- delete[] str;
-
- if (verbose_global_b)
- progress_indication ("]");
+ - less hassle, no kpathsea spaghetti
- return string;
-}
+ CON:
-LY_DEFINE (ly_kpathsea_gulp_file, "ly:kpathsea-gulp-file",
- 1, 0, 0, (SCM name),
- "Read the file @var{name}, and return its contents in a string. "
- "The file is looked up using the search path and kpathsea.")
-{
- SCM_ASSERT_TYPE (ly_c_string_p (name), name, SCM_ARG1, __FUNCTION__, "string");
- return scm_makfrom0str
- (kpathsea_gulp_file_to_string (ly_scm2string (name)).to_str0 ());
-}
+ - feta PK files are often recreated, locally
+ Solution: cache PK files locally?
+
+ - need env. vars to make sure that TeX finds the TFMs
+
+ - Outdated PK (TFM?) font files are not automatically removed,
+ since VERSION is not part of the standard location.
-void
-initialize_kpathsea (char *av0)
-{
-#if KPATHSEA && HAVE_KPATHSEA_KPATHSEA_H
+
+ ALTERNATIVE
+
+ we have tried to come up with schemes that leave this kind of work
+ to kpathsea with objective of fixing the CONs, but miserably
+ failed. TeX installations and kpathsea itself form a buggy,
+ inconsistent, and unorderly mess.
+
+ */
/*
initialize kpathsea
kpse_maketex_option ("tfm", TRUE);
#endif
}
+
+
#include <iostream>
using namespace std;
-#include "music-function.hh"
+
#include "source-file.hh"
#include "parse-scm.hh"
#include "lily-guile.hh"
#include "string.hh"
#include "string-convert.hh"
#include "my-lily-lexer.hh"
+#include "input-file-results.hh"
#include "interval.hh"
#include "lily-guile.hh"
#include "parser.hh"
void strip_trailing_white (String&);
void strip_leading_white (String&);
String lyric_fudge (String s);
-int music_function_type (SCM);
-SCM lookup_markup_command (String s);
-bool is_valid_version (String s);
+
+SCM
+lookup_markup_command (String s);
+
+bool
+is_valid_version (String s);
+
#define start_quote() \
yy_push_state (quote);\
yylval.string = new String
-#define start_lyric_quote() \
- yy_push_state (lyric_quote);\
- yylval.string = new String
-
#define yylval \
(*(YYSTYPE*)lexval)
%option never-interactive
%option warn
+%x renameinput
+%x version
%x chords
-%x encoding
-%x figures
%x incl
%x lyrics
-%x lyric_quote
-%x longcomment
-%x markup
%x notes
+%x figures
%x quote
-%x renameinput
-%x version
+%x longcomment
+%x markup
A [a-zA-Z]
AA {A}|_
}
}
-<INITIAL,notes>\\encoding{WHITE}* {
- yy_push_state (encoding);
-}
<INITIAL,chords,lyrics,notes,figures>\\version{WHITE}* {
yy_push_state (version);
}
<INITIAL,chords,lyrics,notes,figures>\\renameinput{WHITE}* {
yy_push_state (renameinput);
}
-<encoding>\"[^"]*\" {
- String s (YYText () + 1);
- s = s.left_string (s.index_last ('\"'));
- set_encoding (s);
- yy_pop_state ();
-}
<version>\"[^"]*\" { /* got the version number */
- String s (YYText () + 1);
+ String s (YYText ()+1);
s = s.left_string (s.index_last ('\"'));
- yy_pop_state ();
- if (!is_valid_version (s))
+ yy_pop_state();
+ if (!is_valid_version (s))
return INVALID;
}
-<renameinput>\"[^"]*\" {
+<renameinput>\"[^"]*\" { /* got the version number */
String s (YYText ()+1);
s = s.left_string (s.index_last ('\"'));
progress_indication ("\n");
progress_indication (_f ("input renamed to: `%s'", s.to_str0 ()));
progress_indication ("\n");
- scm_module_define (ly_car (scopes_),
+ scm_module_define (gh_car (scopes_),
ly_symbol2scm ("input-file-name"),
scm_makfrom0str (s.to_str0()));
}
-<encoding>. {
- LexerError (_ ("No quoted string found after \\encoding").to_str0 ());
- yy_pop_state ();
-}
+
<version>. {
- LexerError (_ ("No quoted string found after \\version").to_str0 ());
+ LexerError ("No quoted string found after \\version");
yy_pop_state ();
}
<renameinput>. {
- LexerError (_ ("No quoted string found after \\renameinput").to_str0 ());
+ LexerError ("No quoted string found after \\renameinput");
yy_pop_state ();
}
<longcomment>{
{
start_main_input ();
main_input_b_ = true;
-/*
-This is broken - we should switch to \notes when the pitchnames are loaded.
-Then we get spanish etc. correct. --hwn.
-
-*/
- SCM nn = lookup_identifier ("pitchnames");
- push_note_state (alist_to_hashq (nn));
}
else
error (_ ("\\maininput not allowed outside init files"));
yy_push_state (incl);
}
<incl>\"[^"]*\";? { /* got the include file name */
-/* FIXME: semicolon? */
String s (YYText ()+1);
s = s.left_string (s.index_last ('"'));
- new_input (s, sources_);
+ new_input (s, &global_input_file->sources_);
yy_pop_state ();
}
<incl>\\{BLACK}*;?{WHITE} { /* got the include identifier */
-/* FIXME: semicolon? */
String s = YYText () + 1;
strip_trailing_white (s);
if (s.length () && (s[s.length () - 1] == ';'))
s = s.left_string (s.length () - 1);
SCM sid = lookup_identifier (s);
- if (ly_c_string_p (sid)) {
- new_input (ly_scm2string (sid), sources_);
+ if (gh_string_p (sid)) {
+ new_input (ly_scm2string (sid), &global_input_file->sources_);
yy_pop_state ();
} else {
String msg (_f ("wrong or undefined identifier: `%s'", s ));
if (sval == SCM_UNDEFINED)
{
sval = SCM_UNSPECIFIED;
- error_level_ = 1;
+ errorlevel_ = 1;
}
for (int i=0; i < n; i++)
}
<INITIAL,notes,lyrics>{
\<\< {
- return DOUBLE_ANGLE_OPEN;
+ return LESSLESS;
}
\>\> {
- return DOUBLE_ANGLE_CLOSE;
+ return MOREMORE;
}
}
<figures>{
*yylval.string += YYText ();
}
}
-<lyric_quote>{
- \\{ESCAPED} {
- *yylval.string += to_string (escaped_char (YYText ()[1]));
- }
- [^\\"]+ {
- *yylval.string += YYText ();
- }
- \" {
-
- yy_pop_state ();
-
- /* yylval is union. Must remember STRING before setting SCM*/
- String *sp = yylval.string;
- yylval.scm = scm_makfrom0str (sp->to_str0 ());
- delete sp;
- return LYRICS_STRING;
- }
- . {
- *yylval.string += YYText ();
- }
-}
<lyrics>{
\" {
- start_lyric_quote ();
+ start_quote ();
}
{FRACTION} {
yylval.scm = scan_fraction (YYText ());
yylval.scm = scm_makfrom0str (s.to_str0 ());
- return LYRICS_STRING;
+ return STRING;
}
. {
return YYText ()[0];
\> {
return '>';
}
- \\score {
- return SCORE;
- }
{MARKUPCOMMAND} {
- String str (YYText () + 1);
+ String str (YYText() + 1);
SCM s = lookup_markup_command (str);
- if (ly_c_pair_p (s) && ly_c_symbol_p (ly_cdr (s)) ) {
- yylval.scm = ly_car(s);
- SCM tag = ly_cdr(s);
+ if (gh_pair_p (s) && gh_symbol_p (gh_cdr (s)) ) {
+ yylval.scm = gh_car(s);
+ SCM tag = gh_cdr(s);
if (tag == ly_symbol2scm("markup0"))
return MARKUP_HEAD_MARKUP0;
if (tag == ly_symbol2scm("empty"))
return scan_escaped_word (str);
}
[{}] {
- return YYText ()[0];
+ return YYText()[0];
}
[^#{}"\\ \t\n\r\f]+ {
String s (YYText ());
char c = s[s.length () - 1];
- /* brace open is for not confusing dumb tools. */
- if (c == '{' || c == '}')
+ if (c == '{' || c == '}') // brace open is for not confusing dumb tools.
here_input ().warning (
_ ("Brace found at end of markup. Did you forget a space?"));
yylval.scm = scm_makfrom0str (s.to_str0 ());
}
<<EOF>> {
- if (main_input_b_)
- {
- main_input_b_ = false;
- if (!close_input ())
- /* Returns YY_NULL */
- yyterminate ();
+ main_input_b_ = false;
+ if (! close_input ()) {
+ yyterminate (); // can't move this, since it actually rets a YY_NULL
}
- else if (!close_input ())
- /* Returns YY_NULL */
- yyterminate ();
}
int cnv=sscanf (YYText (), "%lf", &r);
assert (cnv == 1);
- yylval.scm = scm_make_real (r);
+ yylval.scm = gh_double2scm (r);
return REAL;
}
%%
void
-My_lily_lexer::push_chord_state (SCM tab)
+My_lily_lexer::push_note_state (SCM tab)
{
- pitchname_tab_stack_ = scm_cons (tab, pitchname_tab_stack_);
- yy_push_state (chords);
+ pitchname_tab_stack_ = gh_cons (tab, pitchname_tab_stack_);
+ yy_push_state (notes);
}
void
-My_lily_lexer::push_figuredbass_state ()
+My_lily_lexer::push_figuredbass_state()
{
yy_push_state (figures);
}
-
void
-My_lily_lexer::push_initial_state ()
+My_lily_lexer::push_chord_state (SCM tab)
{
- yy_push_state (INITIAL);
+ pitchname_tab_stack_ = gh_cons (tab, pitchname_tab_stack_);
+ yy_push_state (chords);
}
void
yy_push_state (markup);
}
-void
-My_lily_lexer::push_note_state (SCM tab)
-{
- pitchname_tab_stack_ = scm_cons (tab, pitchname_tab_stack_);
- yy_push_state (notes);
-}
-
void
My_lily_lexer::pop_state ()
{
if (YYSTATE == notes || YYSTATE == chords)
- pitchname_tab_stack_ = ly_cdr (pitchname_tab_stack_);
+ pitchname_tab_stack_ = gh_cdr (pitchname_tab_stack_);
yy_pop_state ();
}
return l;
}
SCM sid = lookup_identifier (str);
- if (is_music_function (sid))
- {
- yylval.scm = get_music_function_transform (sid);
-
- return music_function_type (yylval.scm);
- }
-
if (sid != SCM_UNDEFINED)
{
yylval.scm = sid;
SCM sym = ly_symbol2scm (str.to_str0 ());
if ((YYSTATE == notes) || (YYSTATE == chords)) {
SCM handle = SCM_BOOL_F;
- if (ly_c_pair_p (pitchname_tab_stack_))
- handle = scm_hashq_get_handle (ly_car (pitchname_tab_stack_), sym);
+ if (gh_pair_p (pitchname_tab_stack_))
+ handle = scm_hashq_get_handle (gh_car (pitchname_tab_stack_), sym);
- if (ly_c_pair_p (handle)) {
+ if (gh_pair_p (handle)) {
yylval.scm = ly_cdr (handle);
if (unsmob_pitch (yylval.scm))
return (YYSTATE == notes) ? NOTENAME_PITCH : TONICNAME_PITCH;
- else if (ly_c_symbol_p (yylval.scm))
+ else if (gh_symbol_p (yylval.scm))
return DRUM_PITCH;
}
else if ((handle = scm_hashq_get_handle (chordmodifier_tab_, sym))!= SCM_BOOL_F)
/* 2.1.2x something -> \property -> \set. */
-Lilypond_version oldest_version ("2.2.0");
+Lilypond_version oldest_version ("2.1.25");
bool
int n = String_convert::dec2int (left);
int d = String_convert::dec2int (right);
- return scm_cons (scm_int2num (n), scm_int2num (d));
+ return gh_cons (gh_int2scm (n), gh_int2scm (d));
}
// Breaks for flex 2.5.31
lookup_markup_command (String s)
{
SCM proc = ly_scheme_function ("lookup-markup-command");
- return scm_call_1 (proc, scm_makfrom0str (s.to_str0 ()));
-}
-
-
-int
-music_function_type (SCM func)
-{
- SCM type= scm_object_property (func, ly_symbol2scm ("music-function-signature-keyword"));
- if (type == ly_symbol2scm ("scm"))
- {
- return MUSIC_FUNCTION_SCM;
- }
- else if (type == ly_symbol2scm ("music"))
- {
- return MUSIC_FUNCTION_MUSIC;
- }
- else if (type == ly_symbol2scm ("scm-music"))
- {
- return MUSIC_FUNCTION_SCM_MUSIC;
- }
- else if (type == ly_symbol2scm ("music-music"))
- {
- return MUSIC_FUNCTION_MUSIC_MUSIC;
- }
- else if (type == ly_symbol2scm ("scm-music-music"))
- {
- return MUSIC_FUNCTION_SCM_MUSIC_MUSIC;
- }
- else if (type == ly_symbol2scm ("scm-scm-music"))
- {
- return MUSIC_FUNCTION_SCM_SCM_MUSIC;
- }
- else if (type == ly_symbol2scm ("noarg"))
- {
- return MUSIC_FUNCTION;
- }
- else
- {
- /* TODO: print location */
- error ("Can not find sigature for music function.");
- }
- return MUSIC_FUNCTION_SCM;
+ return scm_call_1 (proc, scm_makfrom0str (s.to_str0 ()));
}
protected:
virtual Spanner *create_ligature_spanner ();
virtual void acknowledge_grob (Grob_info);
+ virtual void typeset_ligature (Spanner *ligature, Array<Grob_info>);
+
public:
TRANSLATOR_DECLARATIONS (Ligature_bracket_engraver);
+
+private:
+ void typeset_ligature_bracket ();
};
Spanner *
Ligature_bracket_engraver::create_ligature_spanner ()
{
- return make_spanner ("LigatureBracket", SCM_EOL);
+ return make_spanner ("LigatureBracket");
}
+void
+Ligature_bracket_engraver::typeset_ligature (Spanner *ligature, Array<Grob_info>)
+{
+ typeset_grob (ligature);
+}
void
Ligature_bracket_engraver::acknowledge_grob (Grob_info info)
{
SCM target_callback = ly_symbol2scm ("print-function");
SCM source_callback = ly_symbol2scm ("ligature-primitive-callback");
- SCM noteHeadProperties = updated_grob_properties (context (), ly_symbol2scm ("NoteHead"));
+ SCM noteHeadProperties = updated_grob_properties (daddy_context_, ly_symbol2scm ("NoteHead"));
SCM value = ly_cdr (scm_sloppy_assq (source_callback, noteHeadProperties));
- execute_pushpop_property (context (), ly_symbol2scm ("NoteHead"),
+ execute_pushpop_property (daddy_context_, ly_symbol2scm ("NoteHead"),
target_callback, value);
}
{
SCM symbol = ly_symbol2scm ("NoteHead");
SCM key = ly_symbol2scm ("print-function");
- execute_pushpop_property (context (), symbol, key, SCM_UNDEFINED);
+ execute_pushpop_property (daddy_context_, symbol, key, SCM_UNDEFINED);
}
void
}
ligature_start_mom_ = now_mom ();
-
- // TODO: dump cause into make_item/spanner.
- // announce_grob (ligature_, reqs_drul_[START]->self_scm ());
+
+ announce_grob (ligature_, reqs_drul_[START]->self_scm ());
override_stencil_callback ();
}
}
source file of the GNU LilyPond music typesetter
(c) 1998--2004 Jan Nieuwenhuizen <janneke@gnu.org>
- Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include <ctype.h>
#include "lily-proto.hh"
-#include "version.hh"
-/* MacOS S fix:
- source-file.hh includes cmath which undefines isinf and isnan
+/* macosx fix:
- FIXME: #ifdef MACOS_X?
+
+ source-file.hh includes cmath which undefines isinf and isnan
*/
inline int my_isinf (Real r) { return isinf (r); }
inline int my_isnan (Real r) { return isnan (r); }
+
#include "libc-extension.hh"
#include "lily-guile.hh"
#include "main.hh"
SCM write = scm_primitive_eval (ly_symbol2scm ("write"));
// scm_apply (write, port, SCM_EOL);
- scm_call_2 (write, s, port);
+ gh_call2 (write, s, port);
return scm_strport_to_string (port);
}
String
ly_symbol2string (SCM s)
{
- assert (ly_c_symbol_p (s));
+ assert (gh_symbol_p (s));
return String ((Byte*)SCM_STRING_CHARS (s), (int) SCM_STRING_LENGTH (s));
}
LY_DEFINE (ly_gulp_file, "ly:gulp-file",
1, 0, 0, (SCM name),
- "Read the file @var{name}, and return its contents in a string. "
+ "Read the file @var{name}, and return its contents in a string. "
"The file is looked up using the search path.")
{
- SCM_ASSERT_TYPE (ly_c_string_p (name), name, SCM_ARG1, __FUNCTION__, "string");
return scm_makfrom0str (gulp_file_to_string (ly_scm2string (name)).to_str0 ());
}
void
ly_display_scm (SCM s)
{
- scm_display (s, scm_current_output_port ());
- scm_newline (scm_current_output_port ());
+ gh_display (s);
+ gh_newline ();
}
};
String
ly_scm2string (SCM s)
{
- assert (ly_c_string_p (s));
+ assert (gh_string_p (s));
char *p = SCM_STRING_CHARS (s);
String r (p);
return r;
}
-char *
-ly_scm2newstr (SCM str, size_t *lenp)
-{
- SCM_ASSERT_TYPE (ly_c_string_p (str), str, SCM_ARG1, __FUNCTION__, "string");
-
- size_t len = SCM_STRING_LENGTH (str);
- if (char *new_str = (char *) malloc ((len + 1) * sizeof (char)))
- {
- memcpy (new_str, SCM_STRING_CHARS (str), len);
- new_str[len] = '\0';
-
- if (lenp)
- *lenp = len;
-
- return new_str;
- }
- return 0;
-}
-
SCM
index_get_cell (SCM s, Direction d)
{
index_set_cell (SCM s, Direction d, SCM v)
{
if (d == LEFT)
- scm_set_car_x (s, v);
+ gh_set_car_x (s, v);
else if (d == RIGHT)
- scm_set_cdr_x (s, v);
+ gh_set_cdr_x (s, v);
return s;
}
-LY_DEFINE (ly_warn, "ly:warn",
- 1, 0, 0, (SCM str),
- "Scheme callable function to issue the warning @code{msg}.")
+LY_DEFINE (ly_warning,"ly:warn", 1, 0, 0,
+ (SCM str), "Scheme callable function to issue the warning @code{msg}.")
{
- SCM_ASSERT_TYPE (ly_c_string_p (str), str, SCM_ARG1, __FUNCTION__, "string");
+ SCM_ASSERT_TYPE (gh_string_p (str), str, SCM_ARG1, __FUNCTION__, "string");
progress_indication ("\n");
warning ("lily-guile: " + ly_scm2string (str));
return SCM_BOOL_T;
}
-LY_DEFINE (ly_dir_p, "ly:dir?",
- 1, 0, 0, (SCM s),
+LY_DEFINE (ly_dir_p, "ly:dir?", 1,0, 0, (SCM s),
"type predicate. A direction is @code{-1}, @code{0} or "
"@code{1}, where @code{-1} represents "
"left or down and @code{1} represents right or up.")
{
- if (ly_c_number_p (s))
+ if (gh_number_p (s))
{
- int i = ly_scm2int (s);
+ int i = gh_scm2int (s);
return (i>= -1 && i <= 1) ? SCM_BOOL_T : SCM_BOOL_F;
}
return SCM_BOOL_F;
bool
is_number_pair (SCM p)
{
- return ly_c_pair_p (p)
- && ly_c_number_p (ly_car (p)) && ly_c_number_p (ly_cdr (p));
+ return gh_pair_p (p) && gh_number_p (ly_car (p)) && gh_number_p (ly_cdr (p));
}
typedef void (*Void_fptr) ();
scm_init_funcs_->push (f);
}
+
void
ly_init_ly_module (void *)
{
scm_primitive_load_path (scm_makfrom0str ("lily.scm"));
}
+
SCM global_lily_module;
void
-ly_c_init_guile ()
+ly_init_guile ()
{
global_lily_module = scm_c_define_module ("lily", ly_init_ly_module, 0);
scm_c_use_module ("lily");
}
-unsigned int
-ly_scm_hash (SCM s)
+unsigned int ly_scm_hash (SCM s)
{
return scm_ihashv (s, ~1u);
}
+
+
bool
is_direction (SCM s)
{
- if (ly_c_number_p (s))
+ if (gh_number_p (s))
{
- int i = ly_scm2int (s);
+ int i = gh_scm2int (s);
return i>= -1 && i <= 1;
}
return false;
}
+
bool
is_axis (SCM s)
{
- if (ly_c_number_p (s))
+ if (gh_number_p (s))
{
- int i = ly_scm2int (s);
+ int i = gh_scm2int (s);
return i== 0 || i == 1;
}
return false;
}
+
Direction
to_dir (SCM s)
{
- return SCM_INUMP (s) ? (Direction) ly_scm2int (s) : CENTER;
+ return SCM_INUMP (s) ? (Direction) gh_scm2int (s) : CENTER;
}
Interval
ly_scm2interval (SCM p)
{
- return Interval (ly_scm2double (ly_car (p)), ly_scm2double (ly_cdr (p)));
+ return Interval (gh_scm2double (ly_car (p)),
+ gh_scm2double (ly_cdr (p)));
}
Drul_array<Real>
ly_scm2realdrul (SCM p)
{
- return Drul_array<Real> (ly_scm2double (ly_car (p)),
- ly_scm2double (ly_cdr (p)));
+ return Drul_array<Real> (gh_scm2double (ly_car (p)),
+ gh_scm2double (ly_cdr (p)));
}
SCM
ly_interval2scm (Drul_array<Real> i)
{
- return scm_cons (scm_make_real (i[LEFT]), scm_make_real (i[RIGHT]));
+ return gh_cons (gh_double2scm (i[LEFT]),
+ gh_double2scm (i[RIGHT]));
}
+
+
+
bool
to_boolean (SCM s)
{
- return ly_c_boolean_p (s) && ly_scm2bool (s);
+ return gh_boolean_p (s) && gh_scm2bool (s);
}
-/* Appendable list L: the cdr contains the list, the car the last cons
- in the list. */
+/*
+ Appendable list L: the cdr contains the list, the car the last cons
+ in the list.
+ */
SCM
appendable_list ()
{
- SCM s = scm_cons (SCM_EOL, SCM_EOL);
- scm_set_car_x (s, s);
+ SCM s = gh_cons (SCM_EOL, SCM_EOL);
+ gh_set_car_x (s, s);
return s;
}
void
appendable_list_append (SCM l, SCM elt)
{
- SCM newcons = scm_cons (elt, SCM_EOL);
+ SCM newcons = gh_cons (elt, SCM_EOL);
- scm_set_cdr_x (ly_car (l), newcons);
- scm_set_car_x (l, newcons);
+ gh_set_cdr_x (ly_car (l), newcons);
+ gh_set_car_x (l, newcons);
}
+
SCM
ly_offset2scm (Offset o)
{
- return scm_cons (scm_make_real (o[X_AXIS]), scm_make_real (o[Y_AXIS]));
+ return gh_cons (gh_double2scm (o[X_AXIS]), gh_double2scm (o[Y_AXIS]));
}
Offset
ly_scm2offset (SCM s)
{
- return Offset (ly_scm2double (ly_car (s)),
- ly_scm2double (ly_cdr (s)));
+ return Offset (gh_scm2double (ly_car (s)),
+ gh_scm2double (ly_cdr (s)));
}
+
LY_DEFINE (ly_number2string, "ly:number->string",
1, 0, 0, (SCM s),
"Convert @var{num} to a string without generating many decimals.")
{
- SCM_ASSERT_TYPE (ly_c_number_p (s), s, SCM_ARG1, __FUNCTION__, "number");
+ SCM_ASSERT_TYPE (gh_number_p (s), s, SCM_ARG1, __FUNCTION__, "number");
char str[400]; // ugh.
if (scm_exact_p (s) == SCM_BOOL_F)
{
- Real r (ly_scm2double (s));
+ Real r (gh_scm2double (s));
if (my_isinf (r) || my_isnan (r))
{
sprintf (str, "%08.4f", r);
}
else
- sprintf (str, "%d", ly_scm2int (s));
+ sprintf (str, "%d", gh_scm2int (s));
return scm_makfrom0str (str);
}
+/*
+ Undef this to see if GUILE GC is causing too many swaps.
+ */
+//#define TEST_GC
+#ifdef TEST_GC
+#include <libguile/gc.h>
+
+static void *
+greet_sweep (void *dummy1, void *dummy2, void *dummy3)
+{
+ fprintf (stderr, "entering sweep\n");
+}
+
+static void *
+wave_sweep_goodbye (void *dummy1, void *dummy2, void *dummy3)
+{
+ fprintf (stderr, "leaving sweep\n");
+}
+#endif
+
+
+#include "version.hh"
LY_DEFINE (ly_version, "ly:version", 0, 0, 0, (),
"Return the current lilypond version as a list, e.g. @code{(1 3 127 uu1)}. ")
{
- char const* vs = "\'(" MAJOR_VERSION " " MINOR_VERSION " " PATCH_LEVEL " " MY_PATCH_LEVEL ")" ;
+ char const* vs = "\'(" MAJOR_VERSION " " MINOR_VERSION " " PATCH_LEVEL " " MY_PATCH_LEVEL ")" ;
- return scm_c_eval_string ((char*)vs);
+ return gh_eval_str ((char*)vs);
}
LY_DEFINE (ly_unit, "ly:unit", 0, 0, 0, (),
return scm_number_p (d);
}
+static void
+init_functions ()
+{
+#ifdef TEST_GC
+ scm_c_hook_add (&scm_before_mark_c_hook, greet_sweep, 0, 0);
+ scm_c_hook_add (&scm_before_sweep_c_hook, wave_sweep_goodbye, 0, 0);
+#endif
+}
+
+ADD_SCM_INIT_FUNC (funcs, init_functions);
+
SCM
ly_deep_copy (SCM src)
{
- if (ly_c_pair_p (src))
- return scm_cons (ly_deep_copy (ly_car (src)), ly_deep_copy (ly_cdr (src)));
- else if (ly_c_vector_p (src))
+ if (gh_pair_p (src))
+ {
+ return gh_cons (ly_deep_copy (ly_car (src)), ly_deep_copy (ly_cdr (src)));
+ }
+ else if (gh_vector_p (src))
{
- int len = SCM_VECTOR_LENGTH (src);
- SCM nv = scm_c_make_vector (len, SCM_UNDEFINED);
- for (int i =0 ; i < len ; i++)
+ int l = SCM_VECTOR_LENGTH (src);
+ SCM nv = scm_c_make_vector (l, SCM_UNDEFINED);
+ for (int i =0 ; i< l ; i++)
{
- SCM si = scm_int2num (i);
+ SCM si = gh_int2scm (i);
scm_vector_set_x (nv, si, ly_deep_copy (scm_vector_ref (src, si)));
}
}
+ else
+ return src;
+
return src;
}
SCM
ly_assoc_chain (SCM key, SCM achain)
{
- if (ly_c_pair_p (achain))
+ if (gh_pair_p (achain))
{
SCM handle = scm_assoc (key, ly_car (achain));
- if (ly_c_pair_p (handle))
+ if (gh_pair_p (handle))
return handle;
else
return ly_assoc_chain (key, ly_cdr (achain));
SCM
ly_assoc_cdr (SCM key, SCM alist)
{
- if (ly_c_pair_p (alist))
- {
- SCM trykey = ly_caar (alist);
- if (ly_c_pair_p (trykey) && to_boolean (scm_equal_p (key, ly_cdr (trykey))))
- return ly_car (alist);
- else
- return ly_assoc_cdr (key, ly_cdr (alist));
- }
- return SCM_BOOL_F;
+ if (gh_pair_p (alist)) {
+ SCM trykey = ly_caar (alist);
+ if (gh_pair_p (trykey) && to_boolean (scm_equal_p (key,ly_cdr (trykey))))
+ return ly_car (alist);
+ else
+ return ly_assoc_cdr (key, ly_cdr (alist));
+ }
+ else
+ return SCM_BOOL_F;
}
-/* LST has the form "sym1 sym2 sym3\nsym4\nsym5"
- i.e. \n and ' ' can be used interchangeably as separators. */
+/*
+ LIST has the form "sym1 sym2 sym3\nsym4\nsym5"
+
+ i.e. \n and ' ' can be used interchangeably as separators.
+ */
SCM
-parse_symbol_list (char const *lst)
+parse_symbol_list (const char * list)
{
- char *s = strdup (lst);
+ char * s = strdup (list);
char *orig = s;
SCM create_list = SCM_EOL;
char * e = s + strlen (s) - 1;
while (e >= s && isspace (*e))
- *e-- = 0;
+ *e -- = 0;
for (char * p = s; *p; p++)
- if (*p == '\n')
- *p = ' ';
+ {
+ if (*p == '\n')
+ *p = ' ' ;
+ }
- if (!s[0])
+ if (!s[0] )
s = 0;
+
+
while (s)
{
if (next)
*next++ = 0;
- create_list = scm_cons (ly_symbol2scm (s), create_list);
+ create_list = gh_cons (ly_symbol2scm (s), create_list);
s = next;
}
return create_list;
}
+
SCM
-ly_truncate_list (int k, SCM lst)
+ly_truncate_list (int k, SCM l )
{
if (k == 0)
- lst = SCM_EOL;
+ {
+ l = SCM_EOL;
+ }
else
{
- SCM s = lst;
+ SCM s = l;
k--;
- for (; ly_c_pair_p (s) && k--; s = ly_cdr (s))
+ for (; gh_pair_p (s) && k--; s = ly_cdr (s))
;
- if (ly_c_pair_p (s))
- scm_set_cdr_x (s, SCM_EOL);
+ if (gh_pair_p (s))
+ {
+ gh_set_cdr_x (s, SCM_EOL);
+ }
}
- return lst;
+ return l;
}
+
String
print_scm_val (SCM val)
{
String realval = ly_scm2string (ly_write2scm (val));
if (realval.length () > 200)
- realval = realval.left_string (100)
- + "\n :\n :\n"
- + realval.right_string (100);
+ realval = realval.left_string (100) + "\n :\n :\n" + realval.right_string (100);
+
return realval;
}
if (val == SCM_EOL || val == SCM_BOOL_F)
return ok;
- if (!ly_c_symbol_p (sym))
+ if (!gh_symbol_p (sym))
#if 0
return false;
#else
SCM type = scm_object_property (sym, type_symbol);
- if (type != SCM_EOL && !ly_c_procedure_p (type))
+ if (type != SCM_EOL && !gh_procedure_p (type))
{
warning (_f ("Can't find property type-check for `%s' (%s).",
ly_symbol2string (sym).to_str0 (),
else
{
if (val != SCM_EOL
- && ly_c_procedure_p (type)
- && scm_call_1 (type, val) == SCM_BOOL_F)
+ && gh_procedure_p (type)
+ && gh_call1 (type, val) == SCM_BOOL_F)
{
SCM errport = scm_current_error_port ();
ok = false;
SCM typefunc = ly_scheme_function ("type-name");
- SCM type_name = scm_call_1 (typefunc, type);
+ SCM type_name = gh_call1 (typefunc, type);
scm_puts (_f ("Type check for `%s' failed; value `%s' must be of type `%s'",
ly_unique (SCM list)
{
SCM unique = SCM_EOL;
- for (SCM i = list; ly_c_pair_p (i); i = ly_cdr (i))
+ for (SCM i = list; gh_pair_p (i); i = ly_cdr (i))
{
- if (!ly_c_pair_p (ly_cdr (i))
- || !ly_c_equal_p (ly_car (i), ly_cadr (i)))
- unique = scm_cons (ly_car (i), unique);
+ if (!gh_pair_p (ly_cdr (i))
+ || !gh_equal_p (ly_car (i), ly_cadr (i)))
+ unique = gh_cons (ly_car (i), unique);
}
return scm_reverse_x (unique, SCM_EOL);
}
-
-static int
-scm_default_compare (void const *a, void const *b)
-{
- SCM pa = *(SCM*) a;
- SCM pb = *(SCM*) b;
- if (pa == pb)
- return 0;
- return pa < pb ? -1 : 1;
-}
-
-/* Modify LST in place: qsort it. */
-SCM
-ly_list_qsort_uniq_x (SCM lst)
-{
- int len = scm_ilength (lst);
- SCM *arr = new SCM[len];
- int k = 0;
- for (SCM s = lst; SCM_NNULLP (s); s = SCM_CDR (s))
- arr[k++] = SCM_CAR (s);
-
- assert (k == len);
- qsort (arr, len, sizeof (SCM), &scm_default_compare);
-
- SCM *tail = &lst;
- for (int i = 0; i < len; i++)
- if (!i || arr[i] != arr[i - 1])
- {
- SCM_SETCAR (*tail, arr[i]);
- tail = SCM_CDRLOC (*tail);
- }
-
- *tail = SCM_EOL;
- delete[] arr;
-
- return lst;
-}
-
-
/* tail add */
SCM
ly_snoc (SCM s, SCM list)
{
- return ly_append2 (list, scm_list_n (s, SCM_UNDEFINED));
+ return gh_append2 (list, scm_list_n (s, SCM_UNDEFINED));
}
+
/* Split list at member s, removing s.
- Return (BEFORE . AFTER) */
+ Return (BEFORE . AFTER) */
SCM
ly_split_list (SCM s, SCM list)
{
SCM before = SCM_EOL;
SCM after = list;
- for (; ly_c_pair_p (after);)
+ for (; gh_pair_p (after);)
{
SCM i = ly_car (after);
after = ly_cdr (after);
- if (ly_c_equal_p (i, s))
+ if (gh_equal_p (i, s))
break;
- before = scm_cons (i, before);
+ before = gh_cons (i, before);
}
- return scm_cons ( scm_reverse_x (before, SCM_EOL), after);
+ return gh_cons ( scm_reverse_x (before, SCM_EOL), after);
}
SCM p = scm_current_output_port ();
scm_puts ("(", p);
- for (; ly_c_pair_p (s); s =ly_cdr (s))
+ for (; gh_pair_p (s); s =gh_cdr (s))
{
- scm_display (ly_car (s), p);
+ scm_display (gh_car (s), p);
scm_puts (" ", p);
}
scm_puts (")", p);
{
Slice s;
s.set_empty ();
- for (; ly_c_pair_p (l); l = ly_cdr (l))
- if (ly_c_number_p (ly_car (l)))
- s.add_point (ly_scm2int (ly_car (l)));
+ for (; gh_pair_p (l); l = gh_cdr (l))
+ {
+ if (gh_number_p (gh_car (l)))
+ s.add_point (gh_scm2int (gh_car (l)));
+ }
+
return s;
}
-/* Return I-th element, or last elt L. If I < 0, then we take the first
- element.
-
- PRE: length (L) > 0 */
+
+/*
+ Return I-th element, or last elt L. If I < 0, then we take the first
+ element.
+
+ PRE: length (L) > 0
+ */
SCM
robust_list_ref (int i, SCM l)
{
- while (i-- > 0 && ly_c_pair_p (ly_cdr (l)))
- l = ly_cdr (l);
- return ly_car (l);
+ while (i-- > 0 && gh_pair_p (gh_cdr (l)))
+ l = gh_cdr (l);
+
+ return gh_car (l);
}
+
+
Real
robust_scm2double (SCM k, double x)
{
- if (ly_c_number_p (k))
- x = ly_scm2double (k);
+ if (gh_number_p (k))
+ x = gh_scm2double (k);
return x;
}
{
if (is_number_pair (k))
o = ly_scm2offset (k);
+
return o;
}
+
int
robust_scm2int (SCM k, int o)
{
if (scm_integer_p (k) == SCM_BOOL_T)
- o = ly_scm2int (k);
+ o = gh_scm2int (k);
+
return o;
}
+
SCM
alist_to_hashq (SCM alist)
{
int i = scm_ilength (alist);
if (i < 0)
- return scm_make_vector (scm_int2num (0), SCM_EOL);
+ return scm_make_vector (gh_int2scm (0), SCM_EOL);
- SCM tab = scm_make_vector (scm_int2num (i), SCM_EOL);
- for (SCM s = alist; ly_c_pair_p (s); s = ly_cdr (s))
+ SCM tab = scm_make_vector (gh_int2scm (i), SCM_EOL);
+ for (SCM s = alist; gh_pair_p (s); s = ly_cdr (s))
{
SCM pt = ly_cdar (s);
scm_hashq_set_x (tab, ly_caar (s), pt);
/*
Debugging mem leaks:
*/
-LY_DEFINE (ly_protects, "ly:protects",
- 0, 0, 0, (),
+LY_DEFINE (ly_protects, "ly:protects", 0, 0, 0, (),
"Return hash of protected objects.")
{
return scm_protects;
}
#endif
-
-
-#if HAVE_PANGO_FC_FONT_MAP_ADD_DECODER_FIND_FUNC
-
-#include "pangofc-afm-decoder.hh"
-
-LY_DEFINE (ly_pango_add_afm_decoder, "ly:pango-add-afm-decoder",
- 1, 0, 0, (SCM font_family),
- "Add pango afm decoder for FONT-FAMILY.")
-{
- SCM_ASSERT_TYPE (ly_c_string_p (font_family), font_family, SCM_ARG1, __FUNCTION__, "font_family");
- pango_fc_afm_add_decoder (ly_scm2newstr (font_family, 0));
- return SCM_UNSPECIFIED;
-}
-
-#endif
#include "grob.hh"
#include "staff-symbol-referencer.hh"
#include "lookup.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
Stencil
Real off = dash_period - on;
SCM at = scm_list_n (ly_symbol2scm ("dashed-line"),
- scm_make_real (thick),
- scm_make_real (on),
- scm_make_real (off),
- scm_make_real (to[X_AXIS] - from[X_AXIS]),
- scm_make_real (to[Y_AXIS] - from[Y_AXIS]),
+ gh_double2scm (thick),
+ gh_double2scm (on),
+ gh_double2scm (off),
+ gh_double2scm (to[X_AXIS] - from[X_AXIS]),
+ gh_double2scm (to[Y_AXIS] - from[Y_AXIS]),
SCM_UNDEFINED);
Box box;
Line_interface::make_line (Real th, Offset from, Offset to)
{
SCM at = scm_list_n (ly_symbol2scm ("draw-line"),
- scm_make_real (th),
- scm_make_real (from[X_AXIS]),
- scm_make_real (from[Y_AXIS]),
- scm_make_real (to[X_AXIS]),
- scm_make_real (to[Y_AXIS]),
+ gh_double2scm (th),
+ gh_double2scm (from[X_AXIS]),
+ gh_double2scm (from[Y_AXIS]),
+ gh_double2scm (to[X_AXIS]),
+ gh_double2scm (to[Y_AXIS]),
SCM_UNDEFINED);
Box box;
SCM type = me->get_property ("style");
SCM dash_fraction = me->get_property ("dash-fraction");
- if (ly_c_number_p (dash_fraction) || type == ly_symbol2scm ("dotted-line"))
+ if (gh_number_p (dash_fraction) || type == ly_symbol2scm ("dotted-line"))
{
Real fraction
#include "item.hh"
#include "spanner.hh"
#include "line-spanner.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "paper-column.hh"
#include "staff-symbol-referencer.hh"
#include "font-interface.hh"
double h = l>w/2 ? sqrt (l*l-w*w/4) : 0;
SCM list = scm_list_n (ly_symbol2scm ("zigzag-line"),
- ly_bool2scm (true),
- scm_make_real (w),
- scm_make_real (h),
- scm_make_real (thick),
- scm_make_real (dx),
- scm_make_real (dy),
+ gh_bool2scm (true),
+ gh_double2scm (w),
+ gh_double2scm (h),
+ gh_double2scm (thick),
+ gh_double2scm (dx),
+ gh_double2scm (dy),
SCM_UNDEFINED);
Box b;
b.add_point (Offset (0,0));
{
Offset dz = to -from ;
SCM type = me->get_property ("style");
- if (ly_c_symbol_p (type)
+ if (gh_symbol_p (type)
&& (type == ly_symbol2scm ("line")
|| type == ly_symbol2scm ("dashed-line")
|| type == ly_symbol2scm ("dotted-line")
? zigzag_stencil (me, from, to)
: Line_interface::line (me, from, to);
}
- else if (ly_c_symbol_p (type)
+ else if (gh_symbol_p (type)
&& type == ly_symbol2scm ("trill"))
{
SCM alist_chain = Font_interface::text_font_alist_chain (me);
- SCM style_alist = scm_list_n (scm_cons (ly_symbol2scm ("font-encoding"),
- ly_symbol2scm ("fetaMusic")),
+ SCM style_alist = scm_list_n (gh_cons (ly_symbol2scm ("font-encoding"),
+ ly_symbol2scm ("music")),
SCM_UNDEFINED);
Font_metric *fm = select_font (me->get_paper (),
- scm_cons (style_alist,
+ gh_cons (style_alist,
alist_chain));
Stencil m = fm->find_by_name ("scripts-trill-element");
Stencil mol;
Lookup::dot (Offset p, Real radius)
{
SCM at = (scm_list_n (ly_symbol2scm ("dot"),
- scm_make_real (p[X_AXIS]),
- scm_make_real (p[Y_AXIS]),
- scm_make_real (radius),
+ gh_double2scm (p[X_AXIS]),
+ gh_double2scm (p[Y_AXIS]),
+ gh_double2scm (radius),
SCM_UNDEFINED));
Box box;
box.add_point (p - Offset (radius, radius));
Interval (min_y, max_y));
SCM at = scm_list_n (ly_symbol2scm ("beam"),
- scm_make_real (width),
- scm_make_real (slope),
- scm_make_real (thick),
- scm_make_real (blot),
+ gh_double2scm (width),
+ gh_double2scm (slope),
+ gh_double2scm (thick),
+ gh_double2scm (blot),
SCM_UNDEFINED);
return Stencil (b, at);
}
for (int i= 4; i -- ;)
{
- l = scm_cons (ly_offset2scm (b.control_[i]), l);
+ l = gh_cons (ly_offset2scm (b.control_[i]), l);
}
SCM at = (scm_list_n (ly_symbol2scm ("dashed-slur"),
- scm_make_real (thick),
- scm_make_real (dash),
+ gh_double2scm (thick),
+ gh_double2scm (dash),
ly_quote_scm (l),
SCM_UNDEFINED));
Lookup::horizontal_line (Interval w, Real th)
{
SCM at = scm_list_n (ly_symbol2scm ("horizontal-line"),
- scm_make_real (w[LEFT]),
- scm_make_real (w[RIGHT]),
- scm_make_real (th),
+ gh_double2scm (w[LEFT]),
+ gh_double2scm (w[RIGHT]),
+ gh_double2scm (th),
SCM_UNDEFINED);
Lookup::filled_box (Box b)
{
SCM at = (scm_list_n (ly_symbol2scm ("filledbox"),
- scm_make_real (-b[X_AXIS][LEFT]),
- scm_make_real (b[X_AXIS][RIGHT]),
- scm_make_real (-b[Y_AXIS][DOWN]),
- scm_make_real (b[Y_AXIS][UP]),
+ gh_double2scm (-b[X_AXIS][LEFT]),
+ gh_double2scm (b[X_AXIS][RIGHT]),
+ gh_double2scm (-b[Y_AXIS][DOWN]),
+ gh_double2scm (b[Y_AXIS][UP]),
SCM_UNDEFINED));
return Stencil (b,at);
}
SCM at = (scm_list_n (ly_symbol2scm ("round-filled-box"),
- scm_make_real (-b[X_AXIS][LEFT]),
- scm_make_real (b[X_AXIS][RIGHT]),
- scm_make_real (-b[Y_AXIS][DOWN]),
- scm_make_real (b[Y_AXIS][UP]),
- scm_make_real (blotdiameter),
+ gh_double2scm (-b[X_AXIS][LEFT]),
+ gh_double2scm (b[X_AXIS][RIGHT]),
+ gh_double2scm (-b[Y_AXIS][DOWN]),
+ gh_double2scm (b[Y_AXIS][UP]),
+ gh_double2scm (blotdiameter),
SCM_UNDEFINED));
return Stencil (b,at);
Box box;
for (int i = 0; i < shrinked_points.size (); i++)
{
- SCM x = scm_make_real (shrinked_points[i][X_AXIS]);
- SCM y = scm_make_real (shrinked_points[i][Y_AXIS]);
- shrinked_points_scm = scm_cons (x, scm_cons (y, shrinked_points_scm));
+ SCM x = gh_double2scm (shrinked_points[i][X_AXIS]);
+ SCM y = gh_double2scm (shrinked_points[i][Y_AXIS]);
+ shrinked_points_scm = gh_cons (x, gh_cons (y, shrinked_points_scm));
box.add_point (points[i]);
}
SCM polygon_scm = scm_list_n (ly_symbol2scm ("polygon"),
ly_quote_scm (shrinked_points_scm),
- scm_make_real (blotdiameter),
+ gh_double2scm (blotdiameter),
SCM_UNDEFINED);
Stencil polygon = Stencil (box, polygon_scm);
SCM list = SCM_EOL;
for (int i= 8; i--;)
{
- list = scm_cons (scontrols[indices[i]], list);
+ list = gh_cons (scontrols[indices[i]], list);
}
SCM at = (scm_list_n (ly_symbol2scm ("bezier-sandwich"),
ly_quote_scm (list),
- scm_make_real (linethick),
+ gh_double2scm (linethick),
SCM_UNDEFINED));
Box b (curve.extent (X_AXIS),
curve.extent (Y_AXIS));
Need the weird order b.o. the way PS want its arguments
*/
SCM list = SCM_EOL;
- list = scm_cons (ly_offset2scm (bottom_curve.control_[3]), list);
- list = scm_cons (ly_offset2scm (bottom_curve.control_[0]), list);
- list = scm_cons (ly_offset2scm (bottom_curve.control_[1]), list);
- list = scm_cons (ly_offset2scm (bottom_curve.control_[2]), list);
- list = scm_cons (ly_offset2scm (top_curve.control_[0]), list);
- list = scm_cons (ly_offset2scm (top_curve.control_[3]), list);
- list = scm_cons (ly_offset2scm (top_curve.control_[2]), list);
- list = scm_cons (ly_offset2scm (top_curve.control_[1]), list);
+ list = gh_cons (ly_offset2scm (bottom_curve.control_[3]), list);
+ list = gh_cons (ly_offset2scm (bottom_curve.control_[0]), list);
+ list = gh_cons (ly_offset2scm (bottom_curve.control_[1]), list);
+ list = gh_cons (ly_offset2scm (bottom_curve.control_[2]), list);
+ list = gh_cons (ly_offset2scm (top_curve.control_[0]), list);
+ list = gh_cons (ly_offset2scm (top_curve.control_[3]), list);
+ list = gh_cons (ly_offset2scm (top_curve.control_[2]), list);
+ list = gh_cons (ly_offset2scm (top_curve.control_[1]), list);
SCM horizontal_bend = scm_list_n (ly_symbol2scm ("bezier-sandwich"),
ly_quote_scm (list),
- scm_make_real (0.0),
+ gh_double2scm (0.0),
SCM_UNDEFINED);
Interval x_extent = top_curve.extent (X_AXIS);
Stencil
Lookup::repeat_slash (Real w, Real s, Real t)
{
- SCM wid = scm_make_real (w);
- SCM sl = scm_make_real (s);
- SCM thick = scm_make_real (t);
+ SCM wid = gh_double2scm (w);
+ SCM sl = gh_double2scm (s);
+ SCM thick = gh_double2scm (t);
SCM slashnodot = scm_list_n (ly_symbol2scm ("repeat-slash"),
wid, sl, thick, SCM_UNDEFINED);
b[Y_AXIS] = Interval (0 <? protude , 0 >? protude);
SCM s = scm_list_n (ly_symbol2scm ("symmetric-x-triangle"),
- scm_make_real (thick),
- scm_make_real (iv.length ()),
- scm_make_real (protude), SCM_UNDEFINED);
+ gh_double2scm (thick),
+ gh_double2scm (iv.length ()),
+ gh_double2scm (protude), SCM_UNDEFINED);
return Stencil (b, s);
}
{
SCM_ASSERT_TYPE (is_axis (a), a, SCM_ARG1, __FUNCTION__, "axis") ;
SCM_ASSERT_TYPE (is_number_pair (iv), iv, SCM_ARG2, __FUNCTION__, "number pair") ;
- SCM_ASSERT_TYPE (ly_c_number_p (t), a, SCM_ARG3, __FUNCTION__, "number") ;
- SCM_ASSERT_TYPE (ly_c_number_p (p), a, SCM_ARG4, __FUNCTION__, "number") ;
+ SCM_ASSERT_TYPE (gh_number_p (t), a, SCM_ARG3, __FUNCTION__, "number") ;
+ SCM_ASSERT_TYPE (gh_number_p (p), a, SCM_ARG4, __FUNCTION__, "number") ;
- return Lookup::bracket ((Axis)ly_scm2int (a), ly_scm2interval (iv),
- ly_scm2double (t),
- ly_scm2double (p),
- 0.95 * ly_scm2double (t)).smobbed_copy ();
+ return Lookup::bracket ((Axis)gh_scm2int (a), ly_scm2interval (iv),
+ gh_scm2double (t),
+ gh_scm2double (p),
+ 0.95 * gh_scm2double (t)).smobbed_copy ();
}
{
SCM_ASSERT_TYPE (is_number_pair (xext), xext, SCM_ARG1, __FUNCTION__, "number pair") ;
SCM_ASSERT_TYPE (is_number_pair (yext), yext, SCM_ARG2, __FUNCTION__, "number pair") ;
- SCM_ASSERT_TYPE (ly_c_number_p (blot), blot, SCM_ARG3, __FUNCTION__, "number") ;
+ SCM_ASSERT_TYPE (gh_number_p (blot), blot, SCM_ARG3, __FUNCTION__, "number") ;
return Lookup::round_filled_box (Box (ly_scm2interval (xext), ly_scm2interval (yext)),
- ly_scm2double (blot)).smobbed_copy ();
+ gh_scm2double (blot)).smobbed_copy ();
}
/*
ly-module.cc -- implement guile module stuff.
-
+
source file of the GNU LilyPond music typesetter
-
+
(c) 2002--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
*/
-#include "main.hh"
#include "string.hh"
#include "lily-guile.hh"
#include "ly-module.hh"
static int module_count;
void
-ly_init_anonymous_module (void *data)
+ly_init_anonymous_module (void * data)
{
(void) data;
+ scm_c_use_module ("lily");
}
+Protected_scm anon_modules;
+
SCM
-ly_make_anonymous_module (bool safe)
+ly_make_anonymous_module ()
{
- SCM mod = SCM_EOL;
- if (!safe)
- {
- String s = "*anonymous-ly-" + to_string (module_count++) + "*";
- mod = scm_c_define_module (s.to_str0 (), ly_init_anonymous_module, 0);
- ly_use_module (mod, global_lily_module);
- }
- else
- {
- SCM proc = ly_scheme_function ("make-safe-lilypond-module");
- mod = scm_call_0 (proc);
- }
+ String s = "*anonymous-ly-" + to_string (module_count++) + "*";
+ SCM mod = scm_c_define_module (s.to_str0(), ly_init_anonymous_module, 0);
+ anon_modules = scm_cons (mod, anon_modules);
return mod;
}
-SCM
-ly_use_module (SCM mod, SCM used)
+void
+ly_clear_anonymous_modules ()
{
- SCM expr
- = scm_list_3 (ly_symbol2scm ("module-use!"),
- mod,
- scm_list_2 (ly_symbol2scm ("module-public-interface"),
- used));
+ SCM s = anon_modules;
+ anon_modules = SCM_EOL;
- return scm_eval (expr, global_lily_module);
+ for (; gh_pair_p (s) ; s = gh_cdr (s))
+ {
+ SCM tab= scm_c_make_hash_table (2);
+ /* UGH. */
+ SCM_STRUCT_DATA (gh_car (s))[scm_module_index_obarray]
+ = (long unsigned int) tab;
+ }
}
#define FUNC_NAME __FUNCTION__
{
(void) result;
SCM module = (SCM) closure;
- if (scm_variable_bound_p (val) == SCM_BOOL_T)
- scm_module_define (module, key, scm_variable_ref (val));
+ scm_module_define (module, key, scm_variable_ref (val));
return SCM_EOL;
}
/* Ugh signature of scm_internal_hash_fold () is inaccurate. */
typedef SCM (*Hash_cl_func)();
-/*
- Check me. This is NOT an actual import. It just copies the
- definitions.
-
- If a variable in changed in SRC, we DEST doesn't see the
- definitions.
- */
-LY_DEFINE (ly_import_module, "ly:import-module",
- 2, 0, 0, (SCM dest, SCM src),
- "Import all bindings from module SRC into DEST.")
+void
+ly_import_module (SCM dest, SCM src)
{
SCM_VALIDATE_MODULE (1, src);
scm_internal_hash_fold ((Hash_cl_func) &ly_module_define, (void*) dest,
SCM_EOL, SCM_MODULE_OBARRAY (src));
- return SCM_UNSPECIFIED;
}
static SCM
return scm_cons (scm_cons (key, scm_variable_ref (val)), result);
}
-LY_DEFINE (ly_module2alist, "ly:module->alist",
- 1, 0, 0, (SCM mod),
- "Dump the contents of module @var{mod} as an alist.")
+SCM
+ly_module_to_alist (SCM mod)
{
SCM_VALIDATE_MODULE (1, mod);
+
+
SCM obarr= SCM_MODULE_OBARRAY (mod);
return scm_internal_hash_fold ((Hash_cl_func) &entry_to_alist, NULL, SCM_EOL, obarr);
#undef FUNC_NAME
}
-/* Lookup SYM in a list of modules, which do not have to be related.
- Return the first instance. */
-LY_DEFINE (ly_modules_lookup, "ly:modules-lookup",
- 2, 1, 0,
- (SCM modules, SCM sym, SCM def),
- "Lookup @var{sym} in the list @var{modules}, "
- "returning the first occurence. "
- "If not found, return @var{default}, or @code{#f}.")
+SCM
+ly_modules_lookup (SCM modules, SCM sym)
{
- for (SCM s = modules; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = gh_car (modules); SCM_MODULEP (s); s = ly_cdr (s))
{
- SCM mod = ly_car (s);
- SCM v = scm_sym2var (sym, scm_module_lookup_closure (mod),
- SCM_UNDEFINED);
- if (SCM_VARIABLEP(v) && SCM_VARIABLE_REF(v) != SCM_UNDEFINED)
- return SCM_VARIABLE_REF(v);
+ SCM v = scm_sym2var (sym, scm_module_lookup_closure (s), SCM_UNDEFINED);
+ if (v != SCM_UNDEFINED)
+ return v;
}
-
- if (def != SCM_UNDEFINED)
- return def;
- return SCM_BOOL_F;
+ return SCM_UNDEFINED;
}
+
+SCM export_function;
+
void
ly_export (SCM module, SCM namelist)
{
- static SCM export_function;
if (!export_function)
export_function = scm_permanent_object (scm_c_lookup ("module-export!"));
SCM melisma_properties = tr->get_property ("melismaBusyProperties");
bool busy = false;
- for (; ly_c_pair_p (melisma_properties);
- melisma_properties = ly_cdr (melisma_properties))
- busy = busy || to_boolean (tr->internal_get_property (ly_car (melisma_properties)));
+ for (; gh_pair_p (melisma_properties);
+ melisma_properties = gh_cdr (melisma_properties))
+ busy = busy || to_boolean (tr->internal_get_property (gh_car (melisma_properties)));
return busy;
}
SCM grobs = tr->get_property ("busyGrobs");
Moment now = tr->now_mom ();
- for (; ly_c_pair_p (grobs); grobs = ly_cdr (grobs))
+ for (; gh_pair_p (grobs); grobs = gh_cdr (grobs))
{
- SCM grob = ly_cdar (grobs);
- Moment end =*unsmob_moment (ly_caar (grobs));
+ SCM grob = gh_cdar (grobs);
+ Moment end =*unsmob_moment (gh_caar (grobs));
/*
Lyric_combine_music::get_music () const
{
SCM l = get_property ("elements");
- if (!ly_c_pair_p (l))
+ if (!gh_pair_p (l))
return 0;
- return unsmob_music (ly_car (l));
+ return unsmob_music (gh_car (l));
}
Lyric_combine_music::get_lyrics () const
{
SCM l = get_property ("elements");
- if (!ly_c_pair_p (l))
+ if (!gh_pair_p (l))
return 0;
- l = ly_cdr (l);
- if (!ly_c_pair_p (l))
+ l = gh_cdr (l);
+ if (!gh_pair_p (l))
return 0;
- return unsmob_music (ly_car (l));
+ return unsmob_music (gh_car (l));
}
{
if (event_)
{
- text_= make_item ("LyricText",event_->self_scm ());
+ text_= make_item ("LyricText");
text_->set_property ("text", event_->get_property ("text"));
+ announce_grob (text_, event_->self_scm ());
}
}
return c;
SCM voice_name = lyrics->get_property ("associatedVoice");
- String nm = lyrics->id_string ();
+ String nm = lyrics->id_string_;
- if (ly_c_string_p (voice_name))
+ if (gh_string_p (voice_name))
nm = ly_scm2string (voice_name);
else
{
Context *voice = 0;
while (parent && !voice)
{
- voice = find_context_below (parent, ly_symbol2scm ("Voice"), nm);
- parent = parent->get_parent_context ();
+ voice = parent->find_context_below (ly_symbol2scm ("Voice"), nm);
+ parent = parent->daddy_context_;
}
if (voice)
voice = 0;
while (parent && !voice)
{
- voice = find_context_below (parent, ly_symbol2scm ("Voice"), "");
- parent = parent->get_parent_context ();
+ voice = parent->find_context_below (ly_symbol2scm ("Voice"), "");
+ parent = parent->daddy_context_;
}
return voice;
get_current_note_head (Context * voice)
{
for (SCM s = voice->get_property ("busyGrobs");
- ly_c_pair_p (s); s = ly_cdr (s))
+ gh_pair_p (s); s = gh_cdr (s))
{
- Item*g = dynamic_cast<Item*> (unsmob_grob (ly_cdar (s)));
+ Item*g = dynamic_cast<Item*> (unsmob_grob (gh_cdar (s)));
if (g && !g->get_column ()
&& Note_head::has_interface (g))
{
if (text_)
{
- Context * voice = get_voice_to_lyrics (context ());
+ Context * voice = get_voice_to_lyrics (daddy_context_);
if (voice)
{
{
text_->set_parent (head, X_AXIS);
if (melisma_busy (voice))
- text_->set_property ("self-alignment-X", scm_int2num (LEFT));
+ text_->set_property ("self-alignment-X", gh_int2scm (LEFT));
}
}
+ typeset_grob (text_);
text_ =0;
}
event_ =0;
#include "lookup.hh"
#include "stencil.hh"
#include "paper-column.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "lyric-extender.hh"
#include "note-head.hh"
#include "group-interface.hh"
Grob *common = l->common_refpoint (r, X_AXIS);
- Real sl = me->get_paper ()->get_dimension (ly_symbol2scm ("linethickness"));
+ Real sl = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness"));
Link_array<Grob> heads (Pointer_group_interface__extract_grobs (me, (Grob*)0,
"heads"));
#include "box.hh"
#include "lookup.hh"
#include "stencil.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "paper-column.hh"
#include "spanner.hh"
#include "item.hh"
}
while (flip (&d) != LEFT);
- Real lt = me->get_paper ()->get_dimension (ly_symbol2scm ("linethickness"));
+ Real lt = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness"));
Real th = robust_scm2double (me->get_property ("thickness"), 1) * lt ;
Real h = robust_scm2double (me->get_property ("height"), 0.5);
{
// FIXME: won't work with fancy lyrics
if (lreqs_.size ()
- && ly_c_string_p (lreqs_[0]->get_property ("text"))
+ && gh_string_p (lreqs_[0]->get_property ("text"))
&& ly_scm2string (lreqs_[0]->get_property ("text")).length ())
{
audio_ = new Audio_text (Audio_text::LYRIC,
#include <libintl.h>
#endif
-#include "all-font-metrics.hh"
-#include "file-name.hh"
-#include "file-path.hh"
-#include "getopt-long.hh"
-#include "global-ctor.hh"
-#include "kpath.hh"
#include "lily-guile.hh"
#include "lily-version.hh"
-#include "main.hh"
+#include "all-font-metrics.hh"
+#include "getopt-long.hh"
#include "misc.hh"
-#include "output-def.hh"
#include "string.hh"
+#include "main.hh"
+#include "file-path.hh"
+#include "input-file-results.hh"
#include "warn.hh"
+#include "lily-guile.hh"
+#include "paper-def.hh"
+#include "midi-def.hh"
+#include "global-ctor.hh"
+#include "kpath.hh"
+
+Array<String> failed_files;
/*
* Global options that can be overridden through command line.
*/
+/* Write dependencies file? */
+bool dependency_global_b = false;
+
+/* Prepend to dependencies */
+String dependency_prefix_global;
+
/* Names of header fields to be dumped to a separate file. */
Array<String> dump_header_fieldnames_global;
/* Verbose progress indication? */
bool verbose_global_b = false;
-/* Scheme code to execute before parsing, after .scm init
- This is where -e arguments are appended to.
-*/
+/* Scheme code to execute before parsing, after .scm init */
String init_scheme_code_string = "(begin #t ";
-
/*
* Miscellaneous global stuff.
*/
+
+All_font_metrics *all_fonts_global;
+int exit_status_global;
File_path global_path;
+/* Number of current score output block. If there's more than one
+ score block, this counter will be added to the output filename. */
+int score_count_global;
+
/*
* File globals.
{_i ("FIELD"), "header", 'H', _i ("write header field to BASENAME.FIELD")},
{_i ("DIR"), "include", 'I', _i ("add DIR to search path")},
{_i ("FILE"), "init", 'i', _i ("use FILE as init file")},
+ {0, "dependencies", 'M', _i ("write Makefile dependencies")},
{0, "no-paper", 'm', _i ("produce MIDI output only")},
{_i ("FILE"), "output", 'o', _i ("write output to FILE")},
+ {_i ("DIR"), "dep-prefix", 'P', _i ("prepend DIR to dependencies")},
{0, "safe-mode", 's', _i ("run in safe mode")},
{0, "version", 'v', _i ("print version number")},
{0, "verbose", 'V', _i ("be verbose")},
if (char const *lilypond_prefix = getenv ("LILYPONDPREFIX"))
prefix_directory[1] = lilypond_prefix;
- global_path.append ("");
+ global_path.add ("");
/* Adding mf/out make lilypond unchanged source directory, when setting
LILYPONDPREFIX to lilypond-x.y.z */
if (verbose_global_b)
dir_info (stderr);
- ly_c_init_guile ();
+ ly_init_guile ();
call_constructors ();
progress_indication ("\n");
all_fonts_global = new All_font_metrics (global_path.to_string ());
init_scheme_code_string += ")";
- scm_c_eval_string ((char*) init_scheme_code_string.to_str0 ());
+ gh_eval_str ((char*) init_scheme_code_string.to_str0 ());
/* We accept multiple independent music files on the command line to
reduce compile time when processing lots of small files.
Starting the GUILE engine is very time consuming. */
-
- SCM files = SCM_EOL;
- SCM *tail = &files;
+ bool first = true;
while (char const *arg = option_parser->get_next_arg ())
{
- *tail = scm_cons (scm_makfrom0str (arg), SCM_EOL);
- tail = SCM_CDRLOC (*tail);
+#if 0
+ /* Code to debug memory leaks. Cannot call from within .ly
+ since then we get the protects from the parser state too. */
+ scm_gc ();
+ scm_call_0 (ly_scheme_function ("dump-gc-protects"));
+#endif
+ do_one_file (arg);
+ first = false;
}
delete option_parser;
option_parser = 0;
- if (files == SCM_EOL)
+ /* No FILE arguments is now a usage error to help newbies. If you
+ want a filter, you're not a newbie and should know to use file
+ argument `-'. */
+ if (first)
{
- /* No FILE arguments is now a usage error to help newbies. If you
- want a filter, you're not a newbie and should know to use file
- argument `-'. */
usage ();
exit (2);
}
- SCM result = scm_call_1 (ly_scheme_function ("lilypond-main"), files);
- (void) result;
-
-
- /* Unreachable. */
- exit (0);
+ if (exit_status_global)
+ {
+ printf ("Failed files: ");
+ for (int i = 0; i < failed_files.size (); i++)
+ printf ("%s ", failed_files[i].to_str0 ());
+ printf ("\n");
+ }
+ exit (exit_status_global);
}
static void
{
bool help_b = false;
option_parser = new Getopt_long (argc, argv, options_static);
- while (Long_option_init const *opt = (*option_parser) ())
+ while (Long_option_init const * opt = (*option_parser) ())
{
switch (opt->shortname_char_)
{
case 'o':
{
String s = option_parser->optional_argument_str0_;
- File_name file_name (s);
- output_name_global = file_name.to_string ();
+ Path p = split_path (s);
+ if (s != "-" && p.ext.is_empty ())
+ p.ext = output_format_global;
+ output_name_global = p.to_string ();
}
break;
case 'e':
}
output_format_global = option_parser->optional_argument_str0_;
break;
+ case 'P':
+ dependency_prefix_global = option_parser->optional_argument_str0_;
+ break;
case 'H':
dump_header_fieldnames_global
.push (option_parser->optional_argument_str0_);
break;
case 'I':
- global_path.append (option_parser->optional_argument_str0_);
+ global_path.push (option_parser->optional_argument_str0_);
break;
case 'i':
init_name_global = option_parser->optional_argument_str0_;
case 's':
safe_global_b = true;
break;
+ case 'M':
+ dependency_global_b = true;
+ break;
case 'm':
no_paper_global_b = true;
break;
{
SCM lst = get_property ("stavesFound");
text_->set_property ("side-support-elements" , lst);
+ typeset_grob (text_);
text_ =0;
}
mark_ev_ = 0;
if (text_)
return;
- text_ = make_item ("RehearsalMark", ev->self_scm ());
+ text_ = make_item ("RehearsalMark");
+ announce_grob (text_, ev->self_scm ());
}
SCM m = mark_ev_->get_property ("label");
SCM proc = get_property ("markFormatter");
if (!Text_item::markup_p (m) &&
- ly_c_procedure_p (proc))
+ gh_procedure_p (proc))
{
- if (!ly_c_number_p (m))
+ if (!gh_number_p (m))
m = get_property ("rehearsalMark");
if (scm_integer_p (m) == SCM_BOOL_T
&& scm_exact_p (m) == SCM_BOOL_T)
{
- int mark_count = ly_scm2int (m);
+ int mark_count = gh_scm2int (m);
mark_count ++;
- context ()->set_property ("rehearsalMark",
- scm_int2num (mark_count));
+ daddy_context_->set_property ("rehearsalMark",
+ gh_int2scm (mark_count));
}
- if (ly_c_number_p (m))
- m = scm_call_2 (proc, m, context ()->self_scm ());
+ if (gh_number_p (m))
+ m = scm_call_2 (proc, m, daddy_context_->self_scm ());
else
warning ("rehearsalMark does not have integer value.");
}
if (grouping_)
{
grouping_->set_bound (RIGHT, unsmob_grob (get_property ("currentCommandColumn")));
+ typeset_grob (grouping_);
grouping_->suicide ();
grouping_= 0;
}
{
grouping_->set_bound (RIGHT,
unsmob_grob (get_property ("currentMusicalColumn")));
-
+ typeset_grob (grouping_);
grouping_ = 0;
}
return;
SCM grouping = get_property ("beatGrouping");
- if (ly_c_pair_p (grouping))
+ if (gh_pair_p (grouping))
{
Moment *measpos = unsmob_moment (get_property ("measurePosition"));
Rational mp = measpos->main_part_;
Rational bl = beatlen->main_part_;
Rational where (0);
- for (SCM s = grouping; ly_c_pair_p (s);
- where += Rational (ly_scm2int (ly_car (s))) * bl,
- s = ly_cdr (s)
+ for (SCM s = grouping; gh_pair_p (s);
+ where += Rational (gh_scm2int (gh_car (s))) * bl,
+ s = gh_cdr (s)
)
{
- int grouplen = ly_scm2int (ly_car (s));
+ int grouplen = gh_scm2int (gh_car (s));
if (where == mp)
{
if (grouping_)
continue;
}
- grouping_ = make_spanner ("MeasureGrouping", SCM_EOL);
+ grouping_ = make_spanner ("MeasureGrouping");
grouping_->set_bound (LEFT, unsmob_grob (get_property ("currentMusicalColumn")));
-
+ announce_grob (grouping_, SCM_EOL);
stop_grouping_mom_ = now.main_part_ + Rational (grouplen - 1) * bl ;
*/
-#include "output-def.hh"
+#include "paper-def.hh"
#include "spanner.hh"
#include "measure-grouping-spanner.hh"
#include "lookup.hh"
{
if (m->is_mus_type ("melisma-playing-event"))
{
- return melisma_busy (context ());
+ return melisma_busy (daddy_context_);
}
else if (m->is_mus_type ("melisma-span-event"))
{
SCM sd = event_->get_property ("span-direction");
Direction d = to_dir (sd);
if (d == START)
- context ()->set_property ("melismaBusy", SCM_BOOL_T);
+ daddy_context_->set_property ("melismaBusy", SCM_BOOL_T);
else
- context ()->unset_property (ly_symbol2scm ("melismaBusy"));
+ daddy_context_->unset_property (ly_symbol2scm ("melismaBusy"));
}
}
#include "rhythmic-head.hh"
#include "note-head.hh"
#include "staff-symbol-referencer.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "font-interface.hh"
/*
Spanner *
Mensural_ligature_engraver::create_ligature_spanner ()
{
- return make_spanner ("MensuralLigature", SCM_EOL);
+ return make_spanner ("MensuralLigature");
}
/*
programming_error ("last_primitive undefined");
break;
}
- last_primitive->set_property ("primitive", scm_int2num (output));
+ last_primitive->set_property ("primitive", gh_int2scm (output));
break;
case MLP_BB:
case MLP_LB:
programming_error ("primitive undefined");
break;
}
- last_primitive->set_property ("primitive", scm_int2num (output));
- primitive->set_property ("primitive", scm_int2num (MLP_NONE));
+ last_primitive->set_property ("primitive", gh_int2scm (output));
+ primitive->set_property ("primitive", gh_int2scm (MLP_NONE));
break;
case MLP_SS:
// delayed primitive with two note heads
programming_error ("last_primitive undefined");
break;
}
- last_last_primitive->set_property ("primitive", scm_int2num (output));
- last_primitive->set_property ("primitive", scm_int2num (MLP_NONE));
+ last_last_primitive->set_property ("primitive", gh_int2scm (output));
+ last_primitive->set_property ("primitive", gh_int2scm (MLP_NONE));
break;
default:
programming_error (_f ("unexpected case fall-through"));
Array<Grob_info> primitives)
{
Real thickness = robust_scm2double (ligature->get_property ("thickness"), 1.4);
- thickness *= ligature->get_paper ()->get_dimension (ly_symbol2scm ("linethickness"));
+ thickness *= ligature->get_paper ()->get_realvar (ly_symbol2scm ("linethickness"));
Real head_width =
Font_interface::get_default_font (ligature)->
for (int i = 0; i < primitives.size (); i++)
{
Item *primitive = dynamic_cast<Item*> (primitives[i].grob_);
- int output = ly_scm2int (primitive->get_property ("primitive"));
+ int output = gh_scm2int (primitive->get_property ("primitive"));
primitive->set_property ("thickness",
- scm_make_real (thickness));
+ gh_double2scm (thickness));
switch (output) {
case MLP_NONE:
primitive->set_property ("head-width",
- scm_make_real (half_flexa_width));
+ gh_double2scm (half_flexa_width));
break;
case MLP_sc:
case MLP_ss:
case MLP_cs:
primitive->set_property ("head-width",
- scm_make_real (head_width));
+ gh_double2scm (head_width));
break;
case MLP_BB:
case MLP_LB:
case MLP_SS:
primitive->set_property ("head-width",
- scm_make_real (half_flexa_width));
+ gh_double2scm (half_flexa_width));
primitive->set_property ("flexa-width",
- scm_make_real (flexa_width));
+ gh_double2scm (flexa_width));
break;
default:
programming_error (_f ("unexpected case fall-through"));
}
distance +=
- ly_scm2double (current->get_property ("head-width")) -
- ly_scm2double (current->get_property ("thickness"));
+ gh_scm2double (current->get_property ("head-width")) -
+ gh_scm2double (current->get_property ("thickness"));
}
}
if (i > 0)
{
Item *primitive = dynamic_cast<Item*> (info.grob_);
- int output = ly_scm2int (primitive->get_property ("primitive"));
+ int output = gh_scm2int (primitive->get_property ("primitive"));
if (output & MLP_ANY)
{
int delta_pitch = (pitch.steps () - last_pitch.steps ());
primitive->set_property ("join-left-amount",
- scm_int2num (delta_pitch));
+ gh_int2scm (delta_pitch));
}
}
last_pitch = pitch;
#include "lookup.hh"
#include "staff-symbol-referencer.hh"
#include "note-head.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "warn.hh"
/*
{
Real staff_space = Staff_symbol_referencer::staff_space (me);
Real height = 0.6 * staff_space;
- Stencil stencil;
+ Stencil stencil = Stencil ();
if (add_cauda)
{
}
Stencil out;
- int primitive = ly_scm2int (primitive_scm);
+ int primitive = gh_scm2int (primitive_scm);
int delta_pitch = 0;
Real thickness = 0.0;
Real flexa_width = 0.0;
SCM join_left_scm = me->get_property ("join-left-amount");
if (join_left_scm != SCM_EOL)
{
- int join_left = ly_scm2int (join_left_scm);
+ int join_left = gh_scm2int (join_left_scm);
if (!join_left)
programming_error (_f ("Mensural_ligature: (join_left == 0)"));
- Real blotdiameter = (me->get_paper ()->get_dimension (ly_symbol2scm ("blotdiameter")));
+ Real blotdiameter = (me->get_paper ()->get_realvar (ly_symbol2scm ("blotdiameter")));
Interval x_extent = Interval (0, thickness);
Interval y_extent = (join_left > 0) ?
Interval (-join_left * 0.5 * staff_space, 0) :
text_->set_parent (bar_line_, X_AXIS);
text_->set_property ("side-support-elements" , get_property ("stavesFound"));
-
+ typeset_grob (text_);
text_ =0;
}
mark_ev_ = 0;
if (text_)
return;
- text_ = make_item ("MetronomeMark", rq->self_scm () );
+ text_ = make_item ("MetronomeMark");
+ announce_grob (text_, rq->self_scm ());
}
SCM proc = get_property ("metronomeMarkFormatter");
SCM result= scm_call_2 (proc, mark_ev_->self_scm (),
- context ()->self_scm ());
+ daddy_context_->self_scm ());
text_->set_property ("text", result);
}
/*
- midi-def.cc -- implement midi output def functions
+ midi-def.cc -- implement Midi_def
source file of the GNU LilyPond music typesetter
*/
#include <math.h>
-
#include "misc.hh"
-#include "output-def.hh"
-#include "moment.hh"
+#include "midi-def.hh"
+#include "performance.hh"
#include "warn.hh"
#include "scm-hash.hh"
-
+Midi_def::Midi_def ()
+{
+ // ugh
+ set_tempo (Moment (Rational (1, 4)), 60);
+}
int
-get_tempo (Output_def * def,
- Moment one_beat_mom)
+Midi_def::get_tempo (Moment one_beat_mom)
{
SCM wis = ly_symbol2scm ("whole-in-seconds");
- Moment *w = unsmob_moment (def->lookup_variable (wis));
+ Moment *w = unsmob_moment (lookup_variable (wis));
Moment wholes_per_min = Moment (60);
if (!w)
}
void
-set_tempo (Output_def * def,
- Moment one_beat_mom,
- int beats_per_minute_i)
+Midi_def::set_tempo (Moment one_beat_mom, int beats_per_minute_i)
{
Moment beats_per_second = Moment (beats_per_minute_i) / Moment (60);
Moment m = Moment (1)/Moment (beats_per_second * one_beat_mom);
- def->set_variable (ly_symbol2scm ("whole-in-seconds"), m.smobbed_copy ());
+ set_variable (ly_symbol2scm ("whole-in-seconds"), m.smobbed_copy ());
}
UGH. don't use eval.
*/
SCM proc = ly_scheme_function ("midi-program");
- SCM program = scm_call_1 (proc, ly_symbol2scm (audio_->str_.to_str0 ()));
+ SCM program = gh_call1 (proc, ly_symbol2scm (audio_->str_.to_str0 ()));
found = (program != SCM_BOOL_F);
if (found)
- program_byte = ly_scm2int (program);
+ program_byte = gh_scm2int (program);
else
warning (_f ("no such MIDI instrument: `%s'", audio_->str_.to_str0 ()));
+++ /dev/null
-/*
- scaled-font-metric.cc -- declare Modified_font_metric
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1999--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
- */
-
-#include <ctype.h>
-
-#include "warn.hh"
-#include "scaled-font-metric.hh"
-#include "string.hh"
-#include "stencil.hh"
-
-Modified_font_metric::Modified_font_metric (String coding, Font_metric* m, Real magn)
-{
- coding_vector_ = SCM_EOL;
- coding_mapping_ = SCM_EOL;
- coding_table_ = SCM_EOL;
- coding_description_ = SCM_EOL;
-
- coding_scheme_ = coding;
- magnification_ = magn;
-
- SCM desc = m->description_;
-
- Real total_mag = magn * ly_scm2double (ly_cdr (desc));
- assert (total_mag);
-
- description_ = scm_cons (ly_car (desc), scm_make_real (total_mag));
- orig_ = m;
-
- if (coding_scheme_ != "TeX"
- && coding_scheme_ != "ASCII"
- && coding_scheme_ != orig_->coding_scheme ())
- {
- coding_vector_ = scm_call_1 (ly_scheme_function ("get-coding-vector"),
- scm_makfrom0str (coding_scheme_.to_str0 ()));
-
- if (!ly_c_vector_p (coding_vector_))
- {
- programming_error ("get-coding-vector should return vector");
- coding_vector_ = scm_c_make_vector (256, ly_symbol2scm (".notdef"));
- }
-
-
- coding_table_ = scm_call_1 (ly_scheme_function ("get-coding-table"),
- scm_makfrom0str (orig_->coding_scheme ().to_str0 ()));
-
- coding_mapping_ = scm_call_2 (ly_scheme_function ("make-encoding-mapping"),
- coding_vector_,
- coding_table_);
-
- coding_description_= SCM_EOL;
-
- coding_description_ = scm_acons (ly_symbol2scm ("input-name"),
- scm_makfrom0str (coding_scheme_.to_str0 ()),
- coding_description_);
-
- coding_description_ = scm_acons (ly_symbol2scm ("input-vector"),
- coding_vector_, coding_description_);
- coding_description_ = scm_acons (ly_symbol2scm ("output-name"),
- scm_makfrom0str (orig_->coding_scheme ().to_str0 ()),
- coding_description_);
- coding_description_ = scm_acons (ly_symbol2scm ("output-table"),
- coding_table_,
- coding_description_);
-
- coding_description_ = scm_acons (ly_symbol2scm ("char-mapping"),
- coding_mapping_,
- coding_description_);
- }
-}
-
-
-
-LY_DEFINE (ly_font_encoding_alist, "ly:font-encoding-alist",
- 1, 0, 0,
- (SCM font),
- "Given the Modified_font_metric @var{font}, return an "
- "alist. Keys are input-name, input-vector, "
- "output-name, output-table, mapping.")
-{
- Modified_font_metric *fm
- = dynamic_cast<Modified_font_metric*> (unsmob_metrics (font));
-
- SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "Modified_font_metric");
- return fm->coding_description_;
-}
-
-SCM
-Modified_font_metric::make_scaled_font_metric (SCM coding, Font_metric *m, Real s)
-{
- /*
- UGOHR.
- */
- if (ly_c_symbol_p (coding))
- coding = scm_symbol_to_string (coding);
-
- String scheme = ly_scm2string (coding);
-
- Modified_font_metric *sfm = new Modified_font_metric (scheme, m, s);
-
- return sfm->self_scm ();
-}
-
-Real
-Modified_font_metric::design_size () const
-{
- return orig_->design_size ();
-}
-
-
-Box
-Modified_font_metric::get_indexed_char (int i) const
-{
- Box b = orig_->get_indexed_char (i);
- b.scale (magnification_);
- return b;
-}
-
-Box
-Modified_font_metric::get_ascii_char (int i) const
-{
- Box b = orig_->get_ascii_char (i);
- b.scale (magnification_);
- return b;
-}
-
-int
-Modified_font_metric::count () const
-{
- return orig_->count ();
-}
-
-Offset
-Modified_font_metric::get_indexed_wxwy (int k) const
-{
- Offset o = orig_->get_indexed_wxwy (k);
- return o * magnification_;
-}
-
-int
-Modified_font_metric::name_to_index (String s) const
-{
- return orig_->name_to_index (s);
-}
-
-int
-Modified_font_metric::index_to_ascii (int k) const
-{
- return orig_->index_to_ascii (k);
-}
-
-String
-Modified_font_metric::coding_scheme () const
-{
- return coding_scheme_;
-}
-
-void
-Modified_font_metric::derived_mark () const
-{
- scm_gc_mark (coding_vector_);
- scm_gc_mark (coding_description_);
- scm_gc_mark (coding_table_);
- scm_gc_mark (coding_mapping_);
-}
-
-Box
-Modified_font_metric::tex_kludge (String text) const
-{
- Interval ydims;
- Real w=0.0;
-
- /*
- TODO: put this klutchness behind ly:option switch.
- */
- for (int i = 0; i < text.length (); i++)
- {
- switch (text[i])
- {
- case '\\':
- // accent marks use width of base letter
- if (i +1 < text.length ())
- {
- if (text[i+1]=='\'' || text[i+1]=='`' || text[i+1]=='"' ||
- text[i+1]=='^')
- {
- i++;
- break;
- }
- // for string width \\ is a \ and \_ is a _.
- if (text[i+1]=='\\' || text[i+1]=='_')
- {
- break;
- }
- }
-
- for (i++; (i < text.length ()) && !isspace (text[i])
- && text[i]!='{' && text[i]!='}'; i++)
- ;
-
- // ugh.
- i--; // Compensate for the increment in the outer loop!
- break;
- case '{': // Skip '{' and '}'
- case '}':
- break;
-
- default:
- Box b = get_ascii_char ((unsigned char)text[i]);
-
- // Ugh, use the width of 'x' for unknown characters
- if (b[X_AXIS].length () == 0)
- b = get_ascii_char ((unsigned char)'x');
-
- w += b[X_AXIS].length ();
- ydims.unite (b[Y_AXIS]);
- break;
- }
- }
-
- if (ydims.is_empty ())
- ydims = Interval (0, 0);
-
- return Box (Interval (0, w), ydims);
-}
-
-Box
-Modified_font_metric::text_dimension (String text)
-{
- Box b;
- if (coding_scheme_ == "TeX")
- {
- b = tex_kludge (text);
- }
- else if (coding_scheme_ == "ASCII"
- || coding_scheme_ == orig_->coding_scheme ())
- {
- Interval ydims;
-
- Real w=0.0;
-
- for (int i = 0; i < text.length (); i++)
- {
- Box b = get_ascii_char ((unsigned char)text[i]);
-
- w += b[X_AXIS].length ();
- ydims.unite (b[Y_AXIS]);
- }
- if (ydims.is_empty ())
- ydims = Interval (0, 0);
-
- b = Box(Interval(0,w), ydims);
- }
- else
- {
- Interval ydims;
- Real w = 0.0;
-
- for (int i = 0; i < text.length (); i++)
- {
- SCM sym = scm_vector_ref (coding_vector_,
- SCM_MAKINUM((unsigned char) text[i]));
-
- Box char_box;
-
- if (!ly_c_symbol_p (sym))
- continue;
-
- char const * chars = SCM_SYMBOL_CHARS(sym);
-
- int idx = orig_->name_to_index (chars);
- if (idx >= 0)
- {
- char_box = orig_->get_indexed_char (idx);
- }
-
- char_box.scale (magnification_);
- if (!char_box[X_AXIS].is_empty ())
- w += char_box[X_AXIS][RIGHT]; // length ?
-
- ydims.unite (char_box[Y_AXIS]);
- }
-
- if (ydims.is_empty ())
- ydims = Interval (0, 0);
-
-
- b = Box (Interval (0, w), ydims);
- }
-
- return b;
-}
-
-Font_metric*
-Modified_font_metric::original_font () const
-{
- return orig_;
-}
/*
moment.cc -- implement Moment
-
+
source file of the GNU LilyPond music typesetter
-
+
(c) 1999--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
+
+ */
+
#include "lily-guile.hh"
#include "moment.hh"
#include "warn.hh"
-
-
-Moment::Moment ()
-{
-}
-
-Moment::Moment (int m)
-{
- main_part_ = Rational (m);
- grace_part_ = Rational ( 0);
-}
-
-Moment::Moment (Rational m, Rational g)
-{
- main_part_ = m;
- grace_part_ = g;
-}
-
-Moment::Moment (Rational m)
-{
- main_part_ = m;
- grace_part_ = Rational (0);
-}
-
#include "ly-smobs.icc"
+
IMPLEMENT_SIMPLE_SMOBS (Moment);
IMPLEMENT_TYPE_P (Moment, "ly:moment?");
return SCM_EOL;
}
+
+
+
int
Moment::print_smob (SCM s, SCM port, scm_print_state *)
{
return 1;
}
-/* TODO: add optional factor argument. */
-LY_DEFINE (ly_make_moment, "ly:make-moment",
- 2, 2, 0, (SCM n, SCM d, SCM gn, SCM gd),
+/*
+ TODO: add optional factor argument.
+*/
+LY_DEFINE (make_moment,"ly:make-moment", 2,2,0, (SCM n, SCM d, SCM gn, SCM gd),
"Create the rational number with main timing @var{n}/@var{d}, "
"and optional grace timin @var{gn}/@var{gd}.\n"
"\n"
"\n"
- "Moment is a point in musical time. "
- "It is consists of a pair of rationals (@var{m},@var{g}), "
- "where @var{m} is the timing for the main\n"
- "notes, and @var{g} the timing for grace notes. "
- "In absence of grace notes, @var{g} is zero.\n")
+ "Moment is a point in musical time. It is consists of a pair of\n"
+ "rationals (@var{m},@var{g}), where @var{m} is the timing for the main\n"
+ "notes, and @var{g} the timing for grace notes. In absence of grace\n"
+ "notes, @var{g} is zero.\n"
+ )
{
SCM_ASSERT_TYPE (SCM_INUMP (n), n, SCM_ARG1, __FUNCTION__, "integer");
SCM_ASSERT_TYPE (SCM_INUMP (d), d, SCM_ARG2, __FUNCTION__, "integer");
if (gn != SCM_UNDEFINED)
{
SCM_ASSERT_TYPE (SCM_INUMP (gn), gn, SCM_ARG3, __FUNCTION__, "integer");
- grace_num = ly_scm2int (gn);
+ grace_num = gh_scm2int (gn);
}
int grace_den = 1;
if (gd != SCM_UNDEFINED)
{
SCM_ASSERT_TYPE (SCM_INUMP (gd), gd, SCM_ARG4, __FUNCTION__, "integer");
- grace_den = ly_scm2int (gd);
+ grace_den = gh_scm2int (gd);
}
- return Moment (Rational (ly_scm2int (n), ly_scm2int (d)),
+ return Moment (Rational (gh_scm2int (n), gh_scm2int (d)),
Rational (grace_num, grace_den)).smobbed_copy ();
}
-LY_DEFINE (ly_add_moment, "ly:add-moment",
- 2, 0, 0, (SCM a, SCM b),
- "Add two moments.")
+LY_DEFINE (add_moment,"ly:add-moment", 2,0,0, (SCM a, SCM b),
+ "Add two moments."
+ )
{
- Moment *ma = unsmob_moment (a);
- Moment *mb = unsmob_moment (b);
+ Moment * ma = unsmob_moment (a);
+ Moment * mb = unsmob_moment (b);
SCM_ASSERT_TYPE (ma, a, SCM_ARG1, __FUNCTION__, "moment");
SCM_ASSERT_TYPE (mb, b, SCM_ARG2, __FUNCTION__, "moment");
+
return (*ma + *mb).smobbed_copy ();
}
-LY_DEFINE (ly_mul_moment,"ly:mul-moment",
- 2, 0, 0, (SCM a, SCM b),
- "Multiply two moments.")
+
+LY_DEFINE (mul_moment,"ly:mul-moment", 2,0,0, (SCM a, SCM b),
+ "Multiply two moments."
+ )
{
- Moment *ma = unsmob_moment (a);
- Moment *mb = unsmob_moment (b);
+ Moment * ma = unsmob_moment (a);
+ Moment * mb = unsmob_moment (b);
SCM_ASSERT_TYPE (ma, a, SCM_ARG1, __FUNCTION__, "moment");
SCM_ASSERT_TYPE (mb, b, SCM_ARG2, __FUNCTION__, "moment");
- return (*ma * *mb).smobbed_copy ();
+
+ return (*ma * *mb).smobbed_copy ();
}
-LY_DEFINE (ly_div_moment,"ly:div-moment",
- 2, 0, 0, (SCM a, SCM b),
- "Divide two moments.")
+
+
+LY_DEFINE (div_moment,"ly:div-moment", 2,0,0, (SCM a, SCM b),
+ "Divide two moments."
+ )
{
- Moment *ma = unsmob_moment (a);
- Moment *mb = unsmob_moment (b);
+ Moment * ma = unsmob_moment (a);
+ Moment * mb = unsmob_moment (b);
SCM_ASSERT_TYPE (ma, a, SCM_ARG1, __FUNCTION__, "moment");
SCM_ASSERT_TYPE (mb, b, SCM_ARG2, __FUNCTION__, "moment");
- return (*ma / *mb).smobbed_copy ();
+
+ return (*ma / *mb).smobbed_copy ();
}
-LY_DEFINE (ly_moment_less_p,"ly:moment<?",
- 2, 0, 0, (SCM a, SCM b),
+LY_DEFINE (ly_moment_less_p,"ly:moment<?", 2,0,0, (SCM a, SCM b),
"Compare two moments.")
{
- Moment *ma = unsmob_moment (a);
- Moment *mb = unsmob_moment (b);
+ Moment * ma = unsmob_moment (a);
+ Moment * mb = unsmob_moment (b);
SCM_ASSERT_TYPE (ma, a, SCM_ARG1, __FUNCTION__, "moment");
SCM_ASSERT_TYPE (mb, b, SCM_ARG2, __FUNCTION__, "moment");
- return ly_bool2scm (*ma < *mb);
+
+ return gh_bool2scm (*ma < *mb);
}
+
+
SCM
Moment::equal_p (SCM a, SCM b)
{
return Rational::compare (a.grace_part_, b.grace_part_);
}
+Moment::Moment ()
+{
+
+}
+
+Moment::Moment (int m)
+{
+ main_part_ = Rational (m);
+ grace_part_ = Rational ( 0);
+}
+
+Moment::Moment (Rational m, Rational g)
+{
+ main_part_ = m;
+ grace_part_ = g;
+}
+
+Moment::Moment (Rational m)
+{
+ main_part_ = m;
+ grace_part_ = Rational (0);
+}
+
void
Moment::operator += (Moment const &src)
{
grace_part_ /= src.main_part_;
}
+
+
int
-Moment::den () const
-{
- return main_part_.den ();
-}
+Moment::den () const { return main_part_.den (); }
int
-Moment::num () const
-{
- return main_part_.num ();
-}
+Moment::num () const { return main_part_.num (); }
bool
Moment::to_bool () const
main_part_.set_infinite (k);
}
+
String
Moment::to_string () const
{
if (rest_ev_ && !mmrest_
&& stop_moment_ > now_mom ())
{
- mmrest_ = make_spanner ("MultiMeasureRest", rest_ev_->self_scm ());
+ mmrest_ = make_spanner ("MultiMeasureRest");
if (text_events_.size ())
{
for (int i = 0; i < text_events_.size (); i++)
{
+ Spanner *sp
+ = make_spanner ("MultiMeasureRestText");
Music* e = text_events_[i];
- Spanner *sp
- = make_spanner ("MultiMeasureRestText", e->self_scm () );
SCM t = e->get_property ("text");
SCM dir = e->get_property ("direction");
sp->set_property ("text",t);
sp->set_property ("direction",dir);
numbers_.push (sp);
+ announce_grob (sp, e->self_scm ());
}
/*
Grob *last =0;
for (int i=0; i <numbers_.size (); i++)
{
- if (scm_int2num (d) == numbers_[i]->get_property ("direction"))
+ if (gh_int2scm (d) == numbers_[i]->get_property ("direction"))
{
if (last)
Side_position_interface::add_support (numbers_[i], last);
else
{
Spanner *sp
- = make_spanner ("MultiMeasureRestNumber", rest_ev_->self_scm () );
+ = make_spanner ("MultiMeasureRestNumber");
numbers_.push (sp);
+ announce_grob (sp, rest_ev_->self_scm ());
}
for (int i =0 ; i < numbers_.size (); i++)
numbers_[i]->set_parent (mmrest_, Y_AXIS);
}
+ announce_grob (mmrest_, rest_ev_->self_scm ());
start_measure_
- = ly_scm2int (get_property ("currentBarNumber"));
+ = gh_scm2int (get_property ("currentBarNumber"));
}
- bar_seen_ = ly_c_string_p (get_property ("whichBar"));
+ bar_seen_ = gh_string_p (get_property ("whichBar"));
}
void
SCM smp = get_property ("measurePosition");
Moment mp = (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0);
+ if (mmrest_
+ && !mp.to_bool ()
+ && mmrest_->get_bound (LEFT) && mmrest_->get_bound (RIGHT))
+ {
+ typeset_grob (mmrest_);
+ for (int i = 0 ; i < numbers_.size (); i++)
+ {
+ typeset_grob (numbers_[i]);
+ }
+
+ /*
+ we must keep mmrest_ around to set measure-count, so
+ no mmrest_ = 0 here.
+ */
+ }
+
if (last_rest_)
{
+ /* sanity check */
+ if (last_rest_->get_bound (LEFT) && last_rest_->get_bound (RIGHT)
+ && last_rest_->get_bound (LEFT) != last_rest_->get_bound (RIGHT))
+ {
+ typeset_grob (last_rest_);
+
+ for (int i = 0; i < last_numbers_.size ();i++)
+ {
+ typeset_grob (last_numbers_[i]);
+ }
+ }
last_rest_ = 0;
last_numbers_.clear ();
}
last_rest_ = mmrest_;
last_numbers_ = numbers_;
- int cur = ly_scm2int (get_property ("currentBarNumber"));
+ int cur = gh_scm2int (get_property ("currentBarNumber"));
int num = cur - start_measure_;
/*
We can't plug a markup directly into the grob, since the
measure-count determines the formatting of the mmrest.
*/
- last_rest_->set_property ("measure-count", scm_int2num (num));
+ last_rest_->set_property ("measure-count", gh_int2scm (num));
SCM sml = get_property ("measureLength");
Rational ml = (unsmob_moment (sml)) ? unsmob_moment (sml)->main_part_ : Rational (1);
{
SCM thres = get_property ("restNumberThreshold");
int t = 1;
- if (ly_c_number_p (thres))
- t = ly_scm2int (thres);
+ if (gh_number_p (thres))
+ t = gh_scm2int (thres);
if (num <= t)
last->suicide ();
else
{
SCM text
- = scm_number_to_string (scm_int2num (num), SCM_MAKINUM (10));
+ = scm_number_to_string (gh_int2scm (num), SCM_MAKINUM (10));
last->set_property ("text", text);
}
}
void
Multi_measure_rest_engraver::finalize ()
{
+ if (mmrest_)
+ {
+ typeset_grob (mmrest_);
+ }
+ if (last_rest_)
+ {
+ typeset_grob (last_rest_);
+ }
+
+ for (int i = 0; i < last_numbers_.size ();i++)
+ typeset_grob (last_numbers_[i]);
+
+ for (int i = 0; i < numbers_.size ();i++)
+ typeset_grob (numbers_[i]);
+
}
ENTER_DESCRIPTION (Multi_measure_rest_engraver,
#include "multi-measure-rest.hh"
#include "warn.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "paper-column.hh" // urg
#include "font-interface.hh"
#include "rest.hh"
int measures = 0;
SCM m (me->get_property ("measure-count"));
- if (ly_c_number_p (m))
+ if (gh_number_p (m))
{
- measures = ly_scm2int (m);
+ measures = gh_scm2int (m);
}
mol.translate_axis (x_off, X_AXIS);
{
int measures = 0;
SCM m (me->get_property ("measure-count"));
- if (ly_c_number_p (m))
+ if (gh_number_p (m))
{
- measures = ly_scm2int (m);
+ measures = gh_scm2int (m);
}
if (measures <= 0)
return Stencil ();
SCM limit = me->get_property ("expand-limit");
- if (measures > ly_scm2int (limit))
+ if (measures > gh_scm2int (limit))
{
Real padding = 0.15;
Stencil s = big_rest (me, (1.0 - 2*padding) * space);
Real ss = Staff_symbol_referencer::staff_space (me);
- Real slt = me->get_paper ()->get_dimension (ly_symbol2scm ("linethickness"));
+ Real slt = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness"));
Real y = slt * thick_thick/2 * ss;
Real ythick = hair_thick * slt * ss;
Box b (Interval (0, 0 >? (width - 2 * ythick)), Interval (-y, y));
Stencil r (musfont->find_by_name ("rests-" + to_string (k)));
symbols_width += r.extent (X_AXIS).length ();
- mols = scm_cons (r.smobbed_copy (), mols);
+ mols = gh_cons (r.smobbed_copy (), mols);
}
else
{
r.translate_axis (staff_space, Y_AXIS);
}
symbols_width += r.extent (X_AXIS).length ();
- mols = scm_cons (r.smobbed_copy (), mols);
+ mols = gh_cons (r.smobbed_copy (), mols);
}
count ++;
}
}
Stencil mol;
- for (SCM s = mols; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = mols; gh_pair_p (s); s = gh_cdr (s))
{
- mol.add_at_edge (X_AXIS, LEFT, *unsmob_stencil (ly_car (s)), inner_padding, 0);
+ mol.add_at_edge (X_AXIS, LEFT, *unsmob_stencil (gh_car (s)), inner_padding, 0);
}
mol.align_to (X_AXIS, LEFT);
mol.translate_axis (outer_padding_factor * inner_padding, X_AXIS);
+++ /dev/null
-/*
- music-function.cc -- implement music_function
-
- source file of the GNU LilyPond music typesetter
-
- (c) 2004 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
-*/
-#include "music-function.hh"
-#include "string.hh"
-#include "music.hh"
-
-static scm_t_bits music_function_tag;
-
-/* Print a textual represenation of the smob to a given port. */
-static int
-print_music_function (SCM b, SCM port, scm_print_state *)
-{
- SCM value = SCM_CELL_OBJECT_1 (b);
-
- scm_puts ("#<Music function ", port);
- scm_write (value, port);
- scm_puts (">", port);
-
- /* Non-zero means success. */
- 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.")
-{
- String str = "";
- for (SCM s = signature; ly_c_pair_p (s); s = ly_cdr (s))
- {
- if (str != "")
- str += "-";
-
- if (ly_car (s) == Music_type_p_proc)
- str += "music";
- else if (ly_c_procedure_p (ly_car (s)))
- str += "scm";
- }
- if (str == "") str = "noarg";
- scm_set_object_property_x (func, ly_symbol2scm ("music-function-signature"),
- signature);
-
- scm_set_object_property_x (func, ly_symbol2scm ("music-function-signature-keyword"),
- ly_symbol2scm (str.to_str0 ()));
-
- SCM_RETURN_NEWSMOB (music_function_tag, func);
-}
-
-bool
-is_music_function (SCM music_function)
-{
- return (SCM_NIMP (music_function) && SCM_CELL_TYPE (music_function) == music_function_tag);
-}
-
-
-SCM
-get_music_function_transform (SCM music_function)
-{
- if (!is_music_function (music_function))
- return SCM_UNDEFINED;
-
- return SCM_CELL_OBJECT_1 (music_function);
-}
-
-static void
-init_music_function (void)
-{
- music_function_tag = scm_make_smob_type ("music-function", 0);
- scm_set_smob_mark (music_function_tag, scm_markcdr);
- scm_set_smob_print (music_function_tag, print_music_function);
-}
-
-ADD_SCM_INIT_FUNC (music_function_tag, init_music_function);
SCM ctor = m->get_property ("iterator-ctor") ;
SCM iter = SCM_EOL;
- if (ly_c_procedure_p (ctor))
+ if (gh_procedure_p (ctor))
{
- iter = scm_call_0 (ctor);
+ iter = gh_call0 (ctor);
p = unsmob_iterator (iter);
}
else
{
while (child && child != me)
{
- child = child->get_parent_context ();
+ child = child->daddy_context_;
}
return child == me;
--- /dev/null
+/*
+ music-output-def.cc -- implement Music_output_def
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+#include "scm-hash.hh"
+
+#include "warn.hh"
+#include "music-output-def.hh"
+#include "global-context.hh"
+#include "context-def.hh"
+#include "main.hh"
+#include "file-path.hh"
+#include "lily-guile.hh"
+#include "ly-module.hh"
+
+#include "ly-smobs.icc"
+
+Music_output_def::Music_output_def ()
+{
+ scaled_fonts_ = SCM_EOL;
+ translator_tab_ = new Scheme_hash_table;
+ scope_ = SCM_EOL;
+ smobify_self ();
+
+ scm_gc_unprotect_object (translator_tab_->self_scm ());
+ scope_ = ly_make_anonymous_module ();
+}
+
+Music_output_def::~Music_output_def ()
+{
+}
+
+Music_output_def::Music_output_def (Music_output_def const &s)
+{
+ scope_ = SCM_EOL;
+ translator_tab_ = 0;
+ scaled_fonts_ = SCM_EOL;
+ smobify_self ();
+
+ translator_tab_ = new Scheme_hash_table (*s.translator_tab_);
+ scm_gc_unprotect_object (translator_tab_->self_scm ());
+
+ scaled_fonts_ = scm_list_copy (s.scaled_fonts_);
+
+ scope_= ly_make_anonymous_module ();
+ if (ly_module_p (s.scope_))
+ ly_import_module (scope_, s.scope_);
+}
+
+
+IMPLEMENT_SMOBS (Music_output_def);
+IMPLEMENT_DEFAULT_EQUAL_P (Music_output_def);
+
+SCM
+Music_output_def::mark_smob (SCM m)
+{
+ Music_output_def * mo = (Music_output_def*) SCM_CELL_WORD_1 (m);
+ if (mo->translator_tab_)
+ scm_gc_mark (mo->translator_tab_->self_scm ());
+ scm_gc_mark (mo->scope_);
+
+ return mo->scaled_fonts_;
+}
+
+void
+Music_output_def::assign_context_def (SCM transdef)
+{
+ Context_def *tp = unsmob_context_def (transdef);
+ assert (tp);
+
+ translator_tab_->set (tp->get_context_name (), transdef);
+
+ String nm = ly_symbol2string (tp->get_context_name ()) + "Context";
+
+
+ scm_module_define (scope_, ly_symbol2scm (nm.to_str0 ()), transdef);
+}
+
+/*
+ find the translator for NAME. NAME must be a symbol.
+*/
+SCM
+Music_output_def::find_context_def (SCM name) const
+{
+ SCM val =SCM_EOL;
+ translator_tab_->try_retrieve (name, &val);
+ return val;
+}
+
+int
+Music_output_def::print_smob (SCM s, SCM p, scm_print_state *)
+{
+ Music_output_def * def = unsmob_music_output_def (s);
+ scm_puts ("#< ", p);
+ scm_puts (classname (def), p);
+
+ (void)def;
+ scm_puts (">", p);
+ return 1;
+}
+
+SCM
+Music_output_def::get_scmvar (String s) const
+{
+ return lookup_variable (ly_symbol2scm (s.to_str0 ()));
+}
+
+void
+Music_output_def::set_variable (SCM sym, SCM val)
+{
+ scm_module_define (scope_, sym, val);
+}
+
+SCM
+Music_output_def::lookup_variable (SCM sym) const
+{
+ SCM var = ly_module_lookup (scope_, sym);
+
+ return scm_variable_ref (var);
+}
+
+LY_DEFINE (ly_paper_lookup, "ly:paper-lookup",
+ 2, 0,0, (SCM pap, SCM sym),
+ "Lookup @var{sym} in @var{pap}. "
+ "Return the value or @code{'()} if undefined.")
+{
+ Music_output_def *op = unsmob_music_output_def (pap);
+ SCM_ASSERT_TYPE (op, pap, SCM_ARG1, __FUNCTION__, "Paper");
+ SCM_ASSERT_TYPE (gh_symbol_p (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
+
+ SCM var = ly_module_lookup (op->scope_, sym);
+ if (SCM_VARIABLEP (var))
+ return SCM_VARIABLE_REF (var);
+ else
+ return SCM_EOL;
+}
+
+LY_DEFINE (ly_output_def_scope, "ly:output-def-scope",
+ 1, 0,0, (SCM def),
+ "Get the variable scope inside @var{def}.")
+{
+ Music_output_def *op = unsmob_music_output_def (def);
+ SCM_ASSERT_TYPE (op, def, SCM_ARG1, __FUNCTION__, "Output definition");
+ return op->scope_;
+}
+
+LY_DEFINE (ly_output_def_clone, "ly:output-def-clone",
+ 1, 0, 0, (SCM def),
+ "Clone @var{def}.")
+{
+ Music_output_def *op = unsmob_music_output_def (def);
+ SCM_ASSERT_TYPE (op, def, SCM_ARG1, __FUNCTION__, "Output definition");
+ SCM s = op->clone ()->self_scm ();
+ scm_gc_unprotect_object (s);
+ return s;
+}
+
Music_sequence::append_music (Music *m)
{
set_property ("elements",
- ly_append2 (music_list (), scm_cons (m->self_scm (), SCM_EOL)));
+ gh_append2 (music_list (), gh_cons (m->self_scm (), SCM_EOL)));
scm_gc_unprotect_object (m->self_scm ());
}
void
transpose_music_list (SCM l, Pitch rq)
{
- for (SCM s = l; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = l; gh_pair_p (s); s = ly_cdr (s))
unsmob_music (ly_car (s))->transpose (rq);
}
Moment cumulative;
Moment last_len;
- for (SCM s = l; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = l; gh_pair_p (s); s = ly_cdr (s))
{
Moment l = unsmob_music (ly_car (s))->get_length ();
if (last_len.grace_part_ && l.main_part_)
Music_sequence::maximum_length (SCM l)
{
Moment dur = 0;
- for (SCM s = l; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = l; gh_pair_p (s); s = ly_cdr (s))
{
Music * m = unsmob_music (ly_car (s));
Moment l = m->get_length ();
int count=0;
Pitch last = p;
- for (SCM s = l; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = l; gh_pair_p (s); s = ly_cdr (s))
{
if (Music *m = unsmob_music (ly_car (s)))
{
void
compress_music_list (SCM l, Moment m)
{
- for (SCM s = l; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = l; gh_pair_p (s); s = ly_cdr (s))
unsmob_music (ly_car (s))->compress (m);
}
{
Moment m;
- for (SCM s = l; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = l; gh_pair_p (s); s = ly_cdr (s))
{
m = m <? unsmob_music (ly_car (s))->start_mom ();
}
{
Moment m;
- for (SCM s = l; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = l; gh_pair_p (s); s = ly_cdr (s))
{
Music * mus = unsmob_music (ly_car (s));
Moment l = mus->get_length ();
*/
-
#include "music-wrapper.hh"
+
+
Music_wrapper::Music_wrapper ()
: Music ()
{
(c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
-#include "input-smob.hh"
-#include "ly-smobs.icc"
#include "main.hh"
-#include "music-list.hh"
+#include "input-smob.hh"
#include "music.hh"
-#include "pitch.hh"
-#include "score.hh"
+#include "music-list.hh"
#include "warn.hh"
+#include "pitch.hh"
+#include "ly-smobs.icc"
+#include "main.hh"
bool
Music::name () const
{
SCM nm = get_property ("name");
- if (ly_c_symbol_p (nm))
+ if (gh_symbol_p (nm))
{
return ly_symbol2string (nm);
}
SCM lst = get_property ("length");
if (unsmob_moment (lst))
return *unsmob_moment (lst);
- else if (ly_c_procedure_p (lst))
+ else if (gh_procedure_p (lst))
{
- SCM res = scm_call_1 (lst, self_scm ());
+ SCM res = gh_call1 (lst, self_scm ());
return *unsmob_moment (res);
}
Music::start_mom () const
{
SCM lst = get_property ("start-moment-function");
- if (ly_c_procedure_p (lst))
+ if (gh_procedure_p (lst))
{
- SCM res = scm_call_1 (lst, self_scm ());
+ SCM res = gh_call1 (lst, self_scm ());
return *unsmob_moment (res);
}
print_alist (SCM a, SCM port)
{
/* SCM_EOL -> catch malformed lists. */
- for (SCM s = a; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = a; gh_pair_p (s); s = ly_cdr (s))
{
scm_display (ly_caar (s), port);
scm_puts (" = ", port);
Music* m = unsmob_music (s);
SCM nm = m->get_property ("name");
- if (ly_c_symbol_p (nm) || ly_c_string_p (nm))
+ if (gh_symbol_p (nm) || gh_string_p (nm))
scm_display (nm, p);
else
scm_puts (classname (m),p);
return ip ? ip : & dummy_input_global;
}
-
-Music*
-make_music_by_name (SCM sym)
-{
- SCM make_music_proc = ly_scheme_function ("make-music");
- SCM rv = scm_call_1 (make_music_proc, sym);
-
- /* UGH. */
- scm_gc_protect_object (rv);
- return unsmob_music (rv);
-}
-
LY_DEFINE (ly_music_length, "ly:music-length",
1, 0, 0, (SCM mus),
"Get the length of music expression @var{mus}, and return as a @code{Moment} object.")
{
Music * sc = unsmob_music (mus);
SCM_ASSERT_TYPE (sc, mus, SCM_ARG1, __FUNCTION__, "music");
- SCM_ASSERT_TYPE (ly_c_symbol_p (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE (gh_symbol_p (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
return sc->internal_get_property (sym);
}
{
Music * sc = unsmob_music (mus);
SCM_ASSERT_TYPE (sc, mus, SCM_ARG1, __FUNCTION__, "music");
- SCM_ASSERT_TYPE (ly_c_symbol_p (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE (gh_symbol_p (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
bool ok = type_check_assignment (sym, val, ly_symbol2scm ("music-type?"));
if (ok)
"for creating music objects. "
)
{
- SCM_ASSERT_TYPE (ly_c_string_p (type), type, SCM_ARG1, __FUNCTION__, "string");
+ SCM_ASSERT_TYPE (gh_string_p (type), type, SCM_ARG1, __FUNCTION__, "string");
SCM s = make_music (ly_scm2string (type))->self_scm ();
unsmob_music (s)->immutable_property_alist_ = props;
scm_gc_unprotect_object (s);
"of music objects.")
{
if (scm_list_p (lst) == SCM_BOOL_T)
- while (ly_c_pair_p (lst))
+ while (gh_pair_p (lst))
{
- if (!unsmob_music (ly_car (lst)))
+ if (!unsmob_music (gh_car (lst)))
return SCM_BOOL_F;
- lst = ly_cdr (lst);
+ lst = gh_cdr (lst);
}
return SCM_BOOL_T;
copy = unsmob_music (m)->clone ()->self_scm ();
scm_gc_unprotect_object (copy);
}
- else if (ly_c_pair_p (m))
- copy = scm_cons (ly_deep_mus_copy (ly_car (m)),
+ else if (gh_pair_p (m))
+ copy = gh_cons (ly_deep_mus_copy (ly_car (m)),
ly_deep_mus_copy (ly_cdr (m)));
return copy;
}
return sc->self_scm ();
}
-LY_DEFINE (ly_music_scorify, "ly:music-scorify",
- 1, 0, 0,
- (SCM music),
- "Return MUSIC encapsulated in SCORE.")
+Music*
+make_music_by_name (SCM sym)
{
-#if 0
- SCM_ASSERT_TYPE (ly_c_music_p (music), music, SCM_ARG1, __FUNCTION__, "music");
-#endif
- Score *score = new Score;
-
- /* URG? */
- SCM check_funcs = ly_scheme_function ("toplevel-music-functions");
- for (; ly_c_pair_p (check_funcs); check_funcs = ly_cdr (check_funcs))
- music = scm_call_1 (ly_car (check_funcs), music);
-
- score->music_ = music;
- scm_gc_unprotect_object (score->self_scm ());
- return score->self_scm ();
+ SCM make_music_proc = ly_scheme_function ("make-music");
+ SCM rv = scm_call_1 (make_music_proc, sym);
+
+ /* UGH. */
+ scm_gc_protect_object (rv);
+ return unsmob_music (rv);
}
+
#include "lily-proto.hh"
#include "scm-hash.hh"
#include "interval.hh"
+#include "input-file-results.hh"
#include "lily-guile.hh"
#include "parser.hh"
#include "keyword.hh"
#include "ly-module.hh"
-static Keyword_ent the_key_tab[] = {
+static Keyword_ent the_key_tab[]={
+ {"acciaccatura", ACCIACCATURA},
{"accepts", ACCEPTS},
+ {"addlyrics", ADDLYRICS},
{"addquote", ADDQUOTE},
{"alias", ALIAS},
{"alternative", ALTERNATIVE},
+ {"apply", APPLY},
+ {"applycontext", APPLYCONTEXT},
+ {"applyoutput", APPLYOUTPUT},
+ {"appoggiatura", APPOGGIATURA},
+ {"autochange", AUTOCHANGE},
{"bar", BAR},
- {"book", BOOK},
- {"bookpaper", BOOKPAPER},
+ {"breathe", BREATHE},
{"change", CHANGE},
{"chords", CHORDS},
{"clef", CLEF},
{"drums", DRUMS},
{"description", DESCRIPTION},
{"figures",FIGURES},
+ {"grace", GRACE},
{"grobdescriptions", GROBDESCRIPTIONS},
{"header", HEADER},
{"key", KEY},
{"lyrics", LYRICS},
- {"lyricsto", LYRICSTO},
+ {"lyricsto", NEWADDLYRICS},
{"mark", MARK},
{"markup", MARKUP},
{"midi", MIDI},
{"name", NAME},
{"new", NEWCONTEXT},
- {"newlyrics", NEWLYRICS},
{"notes", NOTES},
{"octave", OCTAVE},
{"once", ONCE},
{"override", OVERRIDE},
{"paper", PAPER},
+ {"partcombine", PARTCOMBINE},
{"partial", PARTIAL},
{"quote", QUOTE},
{"relative", RELATIVE},
{"type", TYPE},
{"unset", UNSET},
{"with", WITH},
- {0, 0}
+ {0,0}
};
-My_lily_lexer::My_lily_lexer (Sources *sources)
+My_lily_lexer::My_lily_lexer ()
{
keytable_ = new Keyword_table (the_key_tab);
- encoding_ = SCM_EOL;
- chordmodifier_tab_ = scm_make_vector (scm_int2num (1), SCM_EOL);
+
+ chordmodifier_tab_ = scm_make_vector (gh_int2scm (1), SCM_EOL);
pitchname_tab_stack_ = SCM_EOL;
- sources_ = sources;
+
scopes_ = SCM_EOL;
- error_level_ = 0;
- main_input_b_ = false;
- add_scope (ly_make_anonymous_module (false));
-}
-
-My_lily_lexer::My_lily_lexer (My_lily_lexer const &src)
- : Includable_lexer ()
-{
- keytable_ = new Keyword_table (*src.keytable_);
- encoding_ = src.encoding_;
- chordmodifier_tab_ = src.chordmodifier_tab_;
- pitchname_tab_stack_ = src.pitchname_tab_stack_;
- sources_ = src.sources_;
- scopes_ = src.scopes_;
- error_level_ = src.error_level_;
- main_input_b_ = src.main_input_b_;
-}
-
-My_lily_lexer::~My_lily_lexer ()
-{
- delete keytable_;
-}
+ add_scope (ly_make_anonymous_module ());
+ errorlevel_ =0;
-SCM
-My_lily_lexer::encoding () const
-{
- return encoding_ ;
+ main_input_b_ = false;
}
-
void
My_lily_lexer::add_scope (SCM module)
{
ly_reexport_module (scm_current_module ());
scm_set_current_module (module);
- for (SCM s = scopes_; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = scopes_; gh_pair_p (s); s = gh_cdr (s))
{
- ly_use_module (module, ly_car (s));
+ /*
+ UGH. how to do this more neatly?
+ */
+ SCM expr = scm_list_n (ly_symbol2scm ("module-use!"),
+ module, scm_list_n (ly_symbol2scm ("module-public-interface"),
+ gh_car (s), SCM_UNDEFINED),
+ SCM_UNDEFINED);
+
+ scm_primitive_eval (expr);
}
+
scopes_ = scm_cons (module, scopes_);
}
SCM
My_lily_lexer::remove_scope ()
{
- SCM sc = ly_car (scopes_);
- scopes_ = ly_cdr (scopes_);
- scm_set_current_module (ly_car (scopes_));
+ SCM sc = gh_car (scopes_);
+ scopes_ = gh_cdr (scopes_);
+ scm_set_current_module (gh_car (scopes_));
return sc;
}
}
SCM
-My_lily_lexer::lookup_identifier_symbol (SCM sym)
+My_lily_lexer::lookup_identifier (String s)
{
- for (SCM s = scopes_; ly_c_pair_p (s); s = ly_cdr (s))
+ SCM sym = ly_symbol2scm (s.to_str0());
+ for (SCM s = scopes_; gh_pair_p (s); s = gh_cdr (s))
{
- SCM var = ly_module_lookup (ly_car (s), sym);
+ SCM var = ly_module_lookup (gh_car (s), sym);
if (var != SCM_BOOL_F)
return scm_variable_ref (var);
}
return SCM_UNDEFINED;
}
-SCM
-My_lily_lexer::lookup_identifier (String name)
-{
- return lookup_identifier_symbol (ly_symbol2scm (name.to_str0 ()));
-}
-
void
My_lily_lexer::start_main_input ()
{
// yy_flex_debug = 1;
- new_input (main_input_name_, sources_);
+
+ new_input (main_input_name_, &global_input_file->sources_);
/* Do not allow \include in --safe-mode */
- allow_includes_b_ = allow_includes_b_ && !safe_global_b;
+ allow_includes_b_ = allow_includes_b_ && ! safe_global_b;
- scm_module_define (ly_car (scopes_),
+ scm_module_define (gh_car (scopes_),
ly_symbol2scm ("input-file-name"),
scm_makfrom0str (main_input_name_.to_str0 ()));
}
void
My_lily_lexer::set_identifier (SCM name, SCM s)
{
- SCM sym = name;
- if (ly_c_string_p (name))
- sym = scm_string_to_symbol (name);
+ assert (gh_string_p (name));
- if (ly_c_symbol_p (sym))
+ if (lookup_keyword (ly_scm2string (name)) >= 0)
{
- if (lookup_keyword (ly_symbol2string (sym)) >= 0)
- {
- warning (_f ("Identifier name is a keyword: `%s'", SCM_SYMBOL_CHARS (sym)));
- }
+ size_t sz;
+ char * str = gh_scm2newstr (name, &sz) ;
+ warning (_f ("Identifier name is a keyword: `%s'", str));
+ free (str);
+ }
- SCM mod = ly_car (scopes_);
+ SCM sym = scm_string_to_symbol (name);
+ SCM mod = gh_car (scopes_);
- scm_module_define (mod, sym, s);
- }
-
- else
- {
- programming_error ("Identifier is not a symbol.");
- }
+ scm_module_define (mod, sym, s);
+}
+
+My_lily_lexer::~My_lily_lexer ()
+{
+ delete keytable_;
}
My_lily_lexer::LexerError (char const *s)
{
if (include_stack_.is_empty ())
- progress_indication (_f ("error at EOF: %s", s) + String ("\n"));
+ {
+ progress_indication (_f ("error at EOF: %s", s)+ String ("\n"));
+ }
else
{
- error_level_ |= 1;
+ errorlevel_ |= 1;
Input spot (get_source_file (), here_str0 ());
spot.error (s);
}
{
last_input_ = here_input ();
}
-
-void
-My_lily_lexer::set_encoding (String s)
-{
- if (s.length ())
- encoding_ = ly_symbol2scm (s.to_str0 ());
- else
- encoding_ = SCM_EOL;
-}
Jan Nieuwenhuizen <janneke@gnu.org>
*/
-#include "book.hh"
-#include "file-name.hh"
-#include "file-path.hh"
-#include "lily-version.hh"
-#include "ly-module.hh"
-#include "main.hh"
-#include "my-lily-lexer.hh"
#include "my-lily-parser.hh"
-#include "output-def.hh"
-#include "paper-book.hh"
-#include "parser.hh"
-#include "score.hh"
-#include "source.hh"
+#include "my-lily-lexer.hh"
#include "warn.hh"
+#include "main.hh"
+#include "parser.hh"
+#include "input-file-results.hh"
+#include "scm-hash.hh"
-
-My_lily_parser::My_lily_parser (Sources *sources)
+My_lily_parser::My_lily_parser (Input_file_results * source)
{
- book_count_ = 0;
- score_count_ = 0;
+ input_file_ = source;
lexer_ = 0;
- sources_ = sources;
default_duration_ = Duration (2,0);
error_level_ = 0;
last_beam_start_ = SCM_EOL;
- smobify_self ();
-}
-
-My_lily_parser::My_lily_parser (My_lily_parser const &src)
-{
- book_count_ = src.book_count_;
- score_count_ = src.score_count_;
- lexer_ = 0;
- sources_ = src.sources_;
- default_duration_ = src.default_duration_;
- error_level_ = src.error_level_;
- last_beam_start_ = src.last_beam_start_;
-
- smobify_self ();
- lexer_ = new My_lily_lexer (*src.lexer_);
+ default_header_ =0;
}
My_lily_parser::~My_lily_parser ()
{
- // FIXME: Memleak: del lexer
-}
-
-#include "ly-smobs.icc"
-
-IMPLEMENT_SMOBS (My_lily_parser);
-IMPLEMENT_TYPE_P (My_lily_parser, "ly:my-lily-parser?");
-IMPLEMENT_DEFAULT_EQUAL_P (My_lily_parser);
-
-SCM
-My_lily_parser::mark_smob (SCM s)
-{
- My_lily_parser *parser = (My_lily_parser*) ly_cdr (s);
- (void) parser;
- return SCM_EOL;
-}
-
-int
-My_lily_parser::print_smob (SCM s, SCM port, scm_print_state*)
-{
- scm_puts ("#<my_lily_parser ", port);
- My_lily_parser *parser = (My_lily_parser*) ly_cdr (s);
- (void) parser;
- scm_puts (" >", port);
- return 1;
+ delete lexer_;
+ if (default_header_)
+ scm_gc_unprotect_object (default_header_->self_scm ());
}
-
/* Process one .ly file, or book. */
void
-My_lily_parser::parse_file (String init, String name, String out_name)
+My_lily_parser::parse_file (String init, String in_file, String out_file)
{
- lexer_ = new My_lily_lexer (sources_);
- output_basename_ = out_name;
+ lexer_ = new My_lily_lexer;
+ output_basename_ = out_file;
- lexer_->main_input_name_ = name;
+ lexer_->main_input_name_ = in_file;
progress_indication (_ ("Parsing..."));
progress_indication ("\n");
set_yydebug (0);
- lexer_->new_input (init, sources_);
+ lexer_->new_input (init, &input_file_->sources_);
/* Read .ly IN_FILE, lex, parse, write \score blocks from IN_FILE to
OUT_FILE (unless IN_FILE redefines output file name). */
error_level_ = 1;
}
- error_level_ = error_level_ | lexer_->error_level_;
- delete lexer_;
- lexer_ = 0;
-}
+ input_file_->inclusion_names_ = lexer_->filename_strings_;
-void
-My_lily_parser::parse_string (String ly_code)
-{
- My_lily_lexer *parent = lexer_;
- lexer_ = (parent == 0 ? new My_lily_lexer (sources_)
- : new My_lily_lexer (*parent));
-
- lexer_->main_input_name_ = "<string>";
- lexer_->main_input_b_ = true;
-
- set_yydebug (0);
- lexer_->new_input (lexer_->main_input_name_, ly_code, sources_);
- do_yyparse ();
-
- if (!define_spots_.is_empty ())
- {
- define_spots_.top ().warning (_ ("Braces don't match"));
- error_level_ = 1;
- }
-
- error_level_ = error_level_ | lexer_->error_level_;
-
- if (parent != 0)
- {
- parent->keytable_ = lexer_->keytable_;
- parent->encoding_ = lexer_->encoding_;
- parent->chordmodifier_tab_ = lexer_->chordmodifier_tab_;
- parent->pitchname_tab_stack_ = lexer_->pitchname_tab_stack_;
- parent->sources_ = lexer_->sources_;
- parent->scopes_ = lexer_->scopes_;
- parent->error_level_ = lexer_->error_level_;
- parent->main_input_b_ = lexer_->main_input_b_;
- }
-
- delete lexer_;
- lexer_ = 0;
+ error_level_ = error_level_ | lexer_->errorlevel_; // ugh naming.
}
void
{
here_input ().error (s);
error_level_ = 1;
+ exit_status_global = 1;
}
+
+
Input
My_lily_parser::pop_spot ()
{
/*
Parsing looks ahead , so we really want the previous location of the
lexer, not lexer_->here_input ().
- */
-
+ */
/*
Actually, that gets very icky when there are white space, because
the line-numbers are all wrong. Let's try the character before
- the current token. That gets the right result for note/duration
- stuff, but doesn't mess up for errors in the 1st token of the
- line.
- */
+ the current token. That gets the right result for
+ note/duration stuff, but doesn't mess up for errors in the 1st token of the line.
+
+ */
Input hi (lexer_->here_input ());
char const * bla = hi.defined_str0_;
return Input (hi.source_file_, bla);
}
+#include "paper-def.hh"
+#include "context-def.hh"
-/****************************************************************/
-
-
-/*
- junkme?
- */
-bool store_locations_global_b;
-
-/* Do not append `!' suffix, since 1st argument is not modified. */
-LY_DEFINE (ly_set_point_and_click, "ly:set-point-and-click",
- 1, 0, 0, (SCM what),
- "Set the options for Point-and-click source specials output. The\n"
-"argument is a symbol. Possible options are @code{none} (no source specials),\n"
-"@code{line} and @code{line-column}")
-{
- /* UGH. */
- SCM val = SCM_BOOL_F;
- if (ly_symbol2scm ("line-column") == what)
- val = ly_scheme_function ("line-column-location");
- else if (what == ly_symbol2scm ("line"))
- val = ly_scheme_function ("line-location");
-
- scm_module_define (global_lily_module, ly_symbol2scm ("point-and-click"),
- val);
- store_locations_global_b = ly_c_procedure_p (val);
- return SCM_UNSPECIFIED;
-}
-
-LY_DEFINE (ly_parse_file, "ly:parse-file",
- 1, 0, 0, (SCM name),
- "Parse a single @code{.ly} file. "
- "Upon failure, throw @code{ly-file-failed} key.")
-{
- SCM_ASSERT_TYPE (ly_c_string_p (name), name, SCM_ARG1, __FUNCTION__, "string");
- char const *file = SCM_STRING_CHARS (name);
- char const *extensions[] = {"ly", "", 0};
- String file_name = global_path.find (file, extensions);
-
- /* By default, use base name of input file for output file name,
- write output to cwd; do not use root and directory parts of input
- file name. */
- File_name out_file_name (file_name);
- out_file_name.ext_ = "";
- out_file_name.root_ = "";
- out_file_name.dir_ = "";
-
- if (!output_name_global.is_empty ())
- out_file_name = File_name (output_name_global);
-
- String init;
- if (!init_name_global.is_empty ())
- init = init_name_global;
- else
- init = "init.ly";
-
- String out_file = out_file_name.to_string ();
-
- if (init.length () && global_path.find (init).is_empty ())
- {
- warning (_f ("can't find init file: `%s'", init));
- warning (_f ("(search path: `%s')",
- global_path.to_string ().to_str0 ()));
- exit (2);
- }
-
- if ((file_name != "-") && global_path.find (file_name).is_empty ())
- {
- warning (_f ("can't find file: `%s'", file_name));
- scm_throw (ly_symbol2scm ("ly-file-failed"),
- scm_list_1 (scm_makfrom0str (file_name.to_str0 ())));
- }
- else
- {
- Sources sources;
- sources.set_path (&global_path);
-
- progress_indication (_f ("Now processing `%s'", file_name.to_str0 ()));
- progress_indication ("\n");
-
- My_lily_parser *parser = new My_lily_parser (&sources);
-
- // TODO: use $parser
- scm_module_define (global_lily_module, ly_symbol2scm ("parser"),
- parser->self_scm ());
- parser->parse_file (init, file_name, out_file);
-
- bool error = parser->error_level_;
- parser = 0;
- if (error)
- /* TODO: pass renamed input file too. */
- scm_throw (ly_symbol2scm ("ly-file-failed"),
- scm_list_1 (scm_makfrom0str (file_name.to_str0 ())));
- }
- return SCM_UNSPECIFIED;
-}
-
-LY_DEFINE (ly_parse_string, "ly:parse-string",
- 1, 0, 0, (SCM ly_code),
- "Parse the string LY_CODE. "
- "Upon failure, throw @code{ly-file-failed} key.")
-{
- SCM_ASSERT_TYPE (ly_c_string_p (ly_code), ly_code, SCM_ARG1, __FUNCTION__, "string");
-
- Sources sources;
- sources.set_path (&global_path);
- My_lily_parser *parser = new My_lily_parser (&sources);
- scm_module_define (global_lily_module, ly_symbol2scm ("parser"),
- parser->self_scm ());
- parser->parse_string (ly_scm2string (ly_code));
- parser = 0;
-
- return SCM_UNSPECIFIED;
-}
-
-LY_DEFINE (ly_clone_parser, "ly:clone-parser",
- 1, 0, 0, (SCM parser_smob),
- "Return a clone of PARSER_SMOB.")
-{
- My_lily_parser *parser = unsmob_my_lily_parser (parser_smob);
- My_lily_parser *clone = new My_lily_parser (*parser);
-
- /* FIXME: should copy scopes too. */
- return scm_gc_unprotect_object (clone->self_scm ());
-}
-
-LY_DEFINE (ly_parser_define, "ly:parser-define",
- 3, 0, 0, (SCM parser_smob, SCM symbol, SCM val),
- "Bind SYMBOL to VAL in PARSER_SMOB's module.")
-{
- My_lily_parser *parser = unsmob_my_lily_parser (parser_smob);
- SCM_ASSERT_TYPE (ly_c_symbol_p (symbol), symbol, SCM_ARG2, __FUNCTION__, "symbol");
- SCM_ASSERT_TYPE (parser, parser_smob, SCM_ARG2, __FUNCTION__, "parser");
-
+My_lily_parser * current_parser;
- parser->lexer_->set_identifier (scm_symbol_to_string (symbol), val);
- return SCM_UNSPECIFIED;
-}
-
-LY_DEFINE (ly_parser_lookup, "ly:parser-lookup",
- 2, 0, 0, (SCM parser_smob, SCM symbol),
- "Lookup @var{symbol} in @var{parser_smob}'s module. "
- "Undefined is '().")
-{
- My_lily_parser *parser = unsmob_my_lily_parser (parser_smob);
+MAKE_SCHEME_CALLBACK (My_lily_parser,paper_description, 0);
- SCM_ASSERT_TYPE (ly_c_symbol_p (symbol), symbol, SCM_ARG2, __FUNCTION__, "symbol");
- SCM_ASSERT_TYPE (parser, parser_smob, SCM_ARG2, __FUNCTION__, "parser");
-
- SCM val= parser->lexer_->lookup_identifier (ly_scm2string (scm_symbol_to_string (symbol)));
- if (val != SCM_UNDEFINED)
- return val;
- else
- return SCM_EOL;
-}
-
-LY_DEFINE (ly_parser_parse_string, "ly:parser-parse-string",
- 2, 0, 0, (SCM parser_smob, SCM ly_code),
- "Parse the string LY_CODE with PARSER_SMOB."
- "Upon failure, throw @code{ly-file-failed} key.")
-{
- My_lily_parser *parser = unsmob_my_lily_parser (parser_smob);
-
- SCM_ASSERT_TYPE (parser, parser_smob, SCM_ARG1, __FUNCTION__, "parser");
- SCM_ASSERT_TYPE (ly_c_string_p (ly_code), ly_code, SCM_ARG2, __FUNCTION__, "string");
-
- parser->parse_string (ly_scm2string (ly_code));
-
- return SCM_UNSPECIFIED;
-}
-
-Output_def*
-get_paper (My_lily_parser *parser)
-{
- SCM id = parser->lexer_->lookup_identifier ("$defaultpaper");
- Output_def *paper = unsmob_output_def (id);
- paper = paper ? paper->clone () : new Output_def;
- paper->set_variable (ly_symbol2scm ("is-paper"), SCM_BOOL_T);
-
- paper->parent_ =unsmob_output_def (parser->lexer_->lookup_identifier ("$defaultbookpaper"));
- return paper;
-}
-
-
-Output_def*
-get_midi (My_lily_parser *parser)
-{
- SCM id = parser->lexer_->lookup_identifier ("$defaultmidi");
- Output_def *paper = unsmob_output_def (id);
- paper = paper ? paper->clone () : new Output_def;
- paper->set_variable (ly_symbol2scm ("is-midi"), SCM_BOOL_T);
- return paper;
-}
-
-
-Output_def*
-get_bookpaper (My_lily_parser *parser)
-{
- SCM id = parser->lexer_->lookup_identifier ("$defaultbookpaper");
- Output_def *paper = unsmob_output_def (id);
-
- paper = paper ? dynamic_cast<Output_def*> (paper->clone ()) : new Output_def;
- paper->set_variable (ly_symbol2scm ("is-bookpaper"), SCM_BOOL_T);
- return paper;
-}
-
-
-/* TODO: move this to Scheme? Why take the parser arg, and all the back
- & forth between scm and c++? */
-LY_DEFINE (ly_parser_print_score, "ly:parser-print-score",
- 2, 0, 0,
- (SCM parser_smob, SCM score_smob),
- "Print score, i.e., the classic way.")
+SCM
+My_lily_parser::paper_description ()
{
- My_lily_parser *parser = unsmob_my_lily_parser (parser_smob);
- Score *score = unsmob_score (score_smob);
-
- SCM_ASSERT_TYPE (parser, parser_smob, SCM_ARG1, __FUNCTION__, "parser");
- SCM_ASSERT_TYPE (score, score_smob, SCM_ARG2, __FUNCTION__, "score");
+ My_lily_parser * me = current_parser;
- SCM header = ly_c_module_p (score->header_) ? score->header_
- : parser->lexer_->lookup_identifier ("$globalheader");
-
- File_name outname (parser->output_basename_);
- int *c = &parser->book_count_;
- if (*c)
- outname.base_ += "-" + to_string (*c);
- (*c)++;
-
- SCM os = scm_makfrom0str (outname.to_string ().to_str0 ());
- SCM bookpaper = get_bookpaper (parser)->self_scm ();
- for (int i = 0; i < score->defs_.size (); i++)
- default_rendering (score->music_, score->defs_[i]->self_scm (),
- bookpaper,
- header, os);
+ Music_output_def *id = unsmob_music_output_def (me->lexer_->lookup_identifier ("$defaultpaper"));
+ Paper_def *p = dynamic_cast<Paper_def*> (id->clone ());
- if (score->defs_.is_empty ())
+ SCM al = p->translator_tab_->to_alist ();
+ SCM l = SCM_EOL;
+ for (SCM s = al ; gh_pair_p (s); s = ly_cdr (s))
{
- Output_def *paper = get_paper (parser);
- default_rendering (score->music_, paper->self_scm (),
- get_bookpaper (parser)->self_scm (),
- header, os);
- scm_gc_unprotect_object (paper->self_scm ());
+ Context_def * td = unsmob_context_def (ly_cdar (s));
+ l = gh_cons (gh_cons (ly_caar (s), td->to_alist ()), l);
}
- return SCM_UNSPECIFIED;
+ return l;
}
-
-
-LY_DEFINE (ly_parser_set_note_names, "ly:parser-set-note-names",
- 2, 0, 0, (SCM parser, SCM names),
- "Replace current note names in @var{parser}. "
- "@var{names} is an alist of symbols. "
- "This only has effect if the current mode is notes.")
-{
- My_lily_parser *p = unsmob_my_lily_parser (parser);
- SCM_ASSERT_TYPE(p, parser, SCM_ARG1, __FUNCTION__, "Lilypond parser");
-
- if (p->lexer_->is_note_state ())
- {
- p->lexer_->pop_state ();
- p->lexer_->push_note_state (alist_to_hashq (names));
- }
-
- return SCM_UNSPECIFIED;
-}
-
-LY_DEFINE (ly_parser_print_book, "ly:parser-print-book",
- 2, 0, 0, (SCM parser_smob, SCM book_smob),
- "Print book.")
-{
- My_lily_parser *parser = unsmob_my_lily_parser (parser_smob);
- Book *book = unsmob_book (book_smob);
- Output_def *bp = unsmob_output_def (parser->lexer_->lookup_identifier ("$defaultbookpaper"));
- SCM_ASSERT_TYPE (parser, parser_smob, SCM_ARG1, __FUNCTION__, "Lilypond parser");
- SCM_ASSERT_TYPE (book, book_smob, SCM_ARG2, __FUNCTION__, "Book");
-
- /* ugh. changing argument.*/
- book->bookpaper_ = bp;
-
- File_name outname (parser->output_basename_);
- int *c = &parser->book_count_;
- if (*c)
- outname.base_ += "-" + to_string (*c);
- (*c)++;
-
- Output_def *paper = get_paper (parser);
-
- Paper_book* pb = book->process (outname.to_string (), paper);
-
- pb->output (outname.to_string ());
-
- scm_gc_unprotect_object (paper->self_scm ());
- scm_gc_unprotect_object (pb->self_scm ());
-
- return SCM_UNSPECIFIED;
-}
SCM arts = note_ev->get_property ("articulations");
- for (SCM s = arts; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = arts; gh_pair_p (s); s = gh_cdr (s))
{
- Music * m = unsmob_music (ly_car (s));
+ Music * m = unsmob_music (gh_car (s));
if (!m)
continue;
{
Finger_tuple ft ;
- Grob * g= make_item ("Script", event->self_scm () );
- make_script_from_event (g, &ft.description_, context (),
+ Grob * g= make_item ("Script");
+ make_script_from_event (g, &ft.description_, daddy_context_,
event->get_property ("articulation-type"), 0);
if (g)
{
ft.script_ =g ;
articulations_.push (ft);
+ announce_grob (g, event->self_scm ());
ft.script_->set_parent (head, X_AXIS);
}
{
Finger_tuple ft;
- ft.script_ = make_item ("Fingering", event->self_scm () );
+ ft.script_ = make_item ("Fingering");
+ announce_grob (ft.script_, event->self_scm ());
Side_position_interface::add_support (ft.script_, head);
- int d = ly_scm2int (event->get_property ("digit"));
+ int d = gh_scm2int (event->get_property ("digit"));
/*
TODO:
*/
event->origin ()->warning (_("music for the martians."));
}
- SCM sstr = scm_number_to_string (scm_int2num (d), scm_int2num (10)) ;
+ SCM sstr = scm_number_to_string (gh_int2scm (d), gh_int2scm (10)) ;
ft.script_->set_property ("text", sstr);
ft.finger_event_ = event;
*/
for (int i = 0; i < fingerings_.size (); i++)
{
- fingerings_[i].position_ = ly_scm2int (fingerings_[i].head_ -> get_property ( "staff-position"));
+ fingerings_[i].position_ = gh_scm2int (fingerings_[i].head_ -> get_property ( "staff-position"));
}
for (int i = fingerings_.size (); i--;)
f->add_offset_callback (Self_alignment_interface::aligned_on_self_proc, Y_AXIS);
f->add_offset_callback (Side_position_interface::aligned_side_proc, X_AXIS);
- f->set_property ("direction", scm_int2num (hordir));
+ f->set_property ("direction", gh_int2scm (hordir));
+ typeset_grob (f);
}
int finger_prio = 200;
Grob* f = ft.script_;
f->set_parent (ft.head_, X_AXIS);
f->set_property ("script-priority",
- scm_int2num (finger_prio + i));
+ gh_int2scm (finger_prio + i));
f->add_offset_callback (Side_position_interface::aligned_side_proc, Y_AXIS);
f->add_offset_callback (Self_alignment_interface::centered_on_parent_proc, X_AXIS);
f->add_offset_callback (Self_alignment_interface::aligned_on_self_proc, X_AXIS);
- f->set_property ("direction", scm_int2num (UP));
+ f->set_property ("direction", gh_int2scm (UP));
+ typeset_grob (f);
}
for (int i = 0; i < down.size (); i++)
Grob* f = ft.script_;
f->set_parent (ft.head_, X_AXIS);
f->set_property ("script-priority",
- scm_int2num (finger_prio + down.size () - i));
+ gh_int2scm (finger_prio + down.size () - i));
f->add_offset_callback (Self_alignment_interface::centered_on_parent_proc, X_AXIS);
f->add_offset_callback (Self_alignment_interface::aligned_on_self_proc, X_AXIS);
f->add_offset_callback (Side_position_interface::aligned_side_proc, Y_AXIS);
- f->set_property ("direction", scm_int2num (DOWN));
+ f->set_property ("direction", gh_int2scm (DOWN));
+ typeset_grob (f);
}
}
sc->set_property ("direction-source", stem_->self_scm ());
SCM follow = scm_assoc (ly_symbol2scm ("follow-into-staff"), articulations_[i].description_);
- if (ly_c_pair_p (follow) && to_boolean (ly_cdr (follow)))
+ if (gh_pair_p (follow) && to_boolean (gh_cdr (follow)))
{
sc->add_offset_callback (Side_position_interface::quantised_position_proc, Y_AXIS);
sc->set_property ("staff-padding" , SCM_EOL);
}
+ typeset_grob (sc);
}
stem_ = 0;
bool start_new_syllable () ;
void find_voice ();
- bool music_found_;
bool made_association_;
Context * lyrics_context_;
Context * music_context_;
New_lyric_combine_music_iterator::New_lyric_combine_music_iterator ()
{
- music_found_ = false;
made_association_ = false;
lyric_iter_ =0;
music_context_ =0;
if (lyric_iter_)
lyrics_context_ = find_context_below (lyric_iter_->get_outlet (),
- ly_symbol2scm ("Lyrics"), "");
+ "Lyrics", "");
/*
We do not create a Lyrics context, because the user might
{
SCM voice_name = get_music ()->get_property ("associated-context");
- if (ly_c_string_p (voice_name))
+ if (gh_string_p (voice_name))
{
Context *t = get_outlet ();
- while (t && t->get_parent_context ())
- t = t->get_parent_context ();
+ while (t && t->daddy_context_)
+ t = t->daddy_context_;
String name = ly_scm2string (voice_name);
- Context *voice = find_context_below (t, ly_symbol2scm ("Voice"), name);
- if (voice)
+ Context *voice = find_context_below (t, "Voice", name);
+ if (!voice)
+ get_music ()->origin ()->warning (_f ("cannot find Voice: %s",
+ name.to_str0 ()) + "\n");
+ else
music_context_ = voice;
}
if (!music_context_)
return ;
- if (!music_context_->get_parent_context ())
+ if (!music_context_->daddy_context_)
{
/*
The melody has died.
{
Moment m= lyric_iter_->pending_moment ();
lyric_iter_->process (m);
-
- music_found_ = true;
}
}
void
New_lyric_combine_music_iterator::do_quit ()
{
- if (!music_found_)
- {
- SCM voice_name = get_music ()->get_property ("associated-context");
-
- String name;
- if (ly_c_string_p (voice_name))
- name = ly_scm2string (voice_name);
-
- get_music ()->origin ()->warning (_f ("Haven't found Voice `%s'.",
- name.to_str0 ()) + "\n");
- }
-
if (lyric_iter_)
lyric_iter_->quit ();
}
#include "note-column.hh"
#include "note-head.hh"
#include "rhythmic-head.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "axis-group-interface.hh"
#include "item.hh"
#include "stem.hh"
Note_collision_interface::force_shift_callback (SCM element_smob, SCM axis)
{
Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) ly_scm2int (axis);
+ Axis a = (Axis) gh_scm2int (axis);
assert (a == X_AXIS);
me = me->get_parent (a);
do_shifts (me);
}
- return scm_make_real (0.0);
+ return gh_double2scm (0.0);
}
/* Do not merge notes typeset in different style. */
- if ( !ly_c_equal_p (nu->get_property ("style"),
+ if ( !gh_equal_p (nu->get_property ("style"),
nd->get_property ("style") ) )
merge_possible = false;
d->suicide ();
}
- if (wipe_ball && wipe_ball->is_live ())
+ if (wipe_ball && wipe_ball->live ())
{
wipe_ball->set_property ("transparent", SCM_BOOL_T);
wipe_ball->set_property ("stencil", SCM_EOL);
while (flip (&d) != UP);
Link_array<Grob> done;
- for (; ly_c_pair_p (hand); hand =ly_cdr (hand))
+ for (; gh_pair_p (hand); hand =ly_cdr (hand))
{
Grob * s = unsmob_grob (ly_caar (hand));
- Real amount = ly_scm2double (ly_cdar (hand));
+ Real amount = gh_scm2double (ly_cdar (hand));
s->translate_axis (amount *wid, X_AXIS);
done.push (s);
}
- for (; ly_c_pair_p (autos); autos =ly_cdr (autos))
+ for (; gh_pair_p (autos); autos =ly_cdr (autos))
{
Grob * s = unsmob_grob (ly_caar (autos));
- Real amount = ly_scm2double (ly_cdar (autos));
+ Real amount = gh_scm2double (ly_cdar (autos));
if (!done.find (s))
s->translate_axis (amount * wid, X_AXIS);
Drul_array<Link_array<Grob> > clash_groups;
SCM s = me->get_property ("elements");
- for (; ly_c_pair_p (s); s = ly_cdr (s))
+ for (; gh_pair_p (s); s = ly_cdr (s))
{
SCM car = ly_car (s);
SCM sh
= clashes[i]->get_property ("horizontal-shift");
- if (ly_c_number_p (sh))
- shift.push (ly_scm2int (sh));
+ if (gh_number_p (sh))
+ shift.push (gh_scm2int (sh));
else
shift.push (0);
}
do
{
for (int i=0; i < clash_groups[d].size (); i++)
- tups = scm_cons (scm_cons (clash_groups[d][i]->self_scm (),
- scm_make_real (offsets[d][i])),
+ tups = gh_cons (gh_cons (clash_groups[d][i]->self_scm (),
+ gh_double2scm (offsets[d][i])),
tups);
}
while (flip (&d) != UP);
SCM tups = SCM_EOL;
SCM s = me->get_property ("elements");
- for (; ly_c_pair_p (s); s = ly_cdr (s))
+ for (; gh_pair_p (s); s = ly_cdr (s))
{
Grob * se = unsmob_grob (ly_car (s));
SCM force = se->get_property ("force-hshift");
- if (ly_c_number_p (force))
+ if (gh_number_p (force))
{
- tups = scm_cons (scm_cons (se->self_scm (), force),
+ tups = gh_cons (gh_cons (se->self_scm (), force),
tups);
}
}
#include "note-column.hh"
#include "stem.hh"
#include "warn.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "group-interface.hh"
#include "staff-symbol-referencer.hh"
#include "rest.hh"
SCM s1 = p1->get_property ("horizontal-shift");
SCM s2 = p2->get_property ("horizontal-shift");
- int h1 = (ly_c_number_p (s1))? ly_scm2int (s1) :0;
- int h2 = (ly_c_number_p (s2)) ? ly_scm2int (s2):0;
+ int h1 = (gh_number_p (s1))? gh_scm2int (s1) :0;
+ int h2 = (gh_number_p (s2)) ? gh_scm2int (s2):0;
return h1 - h2;
}
iv.set_empty ();
SCM h = me->get_property ("note-heads");
- for (; ly_c_pair_p (h); h = ly_cdr (h))
+ for (; gh_pair_p (h); h = ly_cdr (h))
{
Grob *se = unsmob_grob (ly_car (h));
Grob *stem = unsmob_grob (me->get_property ("stem"));
if (stem && Stem::has_interface (stem))
return Stem::get_direction (stem);
- else if (ly_c_pair_p (me->get_property ("note-heads")))
+ else if (gh_pair_p (me->get_property ("note-heads")))
return (Direction)sign (head_positions_interval (me).center ());
programming_error ("Note column without heads and stem!");
bool both = false;
if (Rest::has_interface (h))
{
- if (ly_c_pair_p (me->get_property ("note-heads")))
+ if (gh_pair_p (me->get_property ("note-heads")))
both = true;
else
me->set_property ("rest", h->self_scm ());
Note_column::translate_rests (Grob*me, int dy)
{
Grob * r = unsmob_grob (me->get_property ("rest"));
- if (r && !ly_c_number_p (r->get_property ("staff-position")))
+ if (r && !gh_number_p (r->get_property ("staff-position")))
{
r->translate_axis (dy * Staff_symbol_referencer::staff_space (r)/2.0, Y_AXIS);
}
{
SCM heads = me->get_property ("note-heads");
Grob * acc = 0;
- for (;ly_c_pair_p (heads); heads =ly_cdr (heads))
+ for (;gh_pair_p (heads); heads =gh_cdr (heads))
{
- Grob * h = unsmob_grob (ly_car (heads));
+ Grob * h = unsmob_grob (gh_car (heads));
acc = h ? unsmob_grob (h->get_property ("accidental-grob")) : 0;
if (acc)
break;
head_ = info.grob_;
if (to_boolean (get_property ("followVoice")))
{
- Context * tr = context ();
+ Context * tr = daddy_context_;
while (tr && !tr->is_alias (ly_symbol2scm ( "Staff")))
- tr = tr->get_parent_context () ;
+ tr = tr->daddy_context_ ;
if (tr
&& tr->is_alias (ly_symbol2scm ("Staff")) && tr != last_staff_)
Should probably store follow_ in line_, and suicide at some
later point */
if (follow_)
- line_ = make_spanner ("VoiceFollower", head_->self_scm ());
+ line_ = make_spanner ("VoiceFollower");
line_->set_bound (LEFT, last_head_);
line_->set_bound (RIGHT, head_);
+ announce_grob (line_, head_->self_scm ());
follow_ = false;
}
void
Note_head_line_engraver::stop_translation_timestep ()
{
- line_ = 0;
+ if (line_)
+ {
+ typeset_grob (line_);
+ line_ = 0;
+ }
if (head_)
last_head_ = head_;
head_ = 0;
#include "rhythmic-head.hh"
#include "staff-symbol-referencer.hh"
#include "lookup.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
/*
Note_head contains the code for printing note heads.
{
Grob *staff = Staff_symbol_referencer::get_staff_symbol (me);
Real inter_f = Staff_symbol_referencer::staff_space (me)/2;
- int line_count = ((abs (pos) < interspaces)
- ? 0
- : (abs (pos) - interspaces) / 2);
- Stencil stencil;
+ int line_count = (abs (pos) < interspaces)
+ ? 0
+ : (abs (pos) - interspaces) / 2;
+ Stencil stencil = Stencil ();
+
+
if (line_count)
{
Real ledgerlinethickness =
internal_print (Grob *me, bool with_ledgers)
{
SCM style = me->get_property ("style");
- if (!ly_c_symbol_p (style))
+ if (!gh_symbol_p (style))
{
return Stencil ();
}
- SCM log = scm_int2num (Note_head::get_balltype (me));
+ SCM log = gh_int2scm (Note_head::get_balltype (me));
SCM proc = me->get_property ("glyph-name-procedure");
SCM scm_font_char = scm_call_2 (proc, log, style);
String font_char = "noteheads-" + ly_scm2string (scm_font_char);
{
Grob *me = unsmob_grob (smob);
- return ly_interval2scm (head_extent (me, (Axis) ly_scm2int (axis)));
+ return ly_interval2scm (head_extent (me, (Axis) gh_scm2int (axis)));
}
MAKE_SCHEME_CALLBACK (Note_head,brew_ez_stencil,1);
SCM spitch = unsmob_music (cause)->get_property ("pitch");
Pitch* pit = unsmob_pitch (spitch);
- SCM idx = scm_int2num (pit->get_notename ());
+ SCM idx = gh_int2scm (pit->get_notename ());
SCM names = me->get_property ("note-names");
SCM charstr = SCM_EOL;
- if (ly_c_vector_p (names))
+ if (gh_vector_p (names))
charstr = scm_vector_ref (names, idx);
else
{
SCM at = scm_list_n (ly_symbol2scm ("ez-ball"),
charstr,
- scm_int2num (b),
- scm_int2num (1-b),
+ gh_int2scm (b),
+ gh_int2scm (1-b),
SCM_UNDEFINED);
Box bx (Interval (0, 1.0), Interval (-0.5, 0.5));
Stencil m (bx, at);
if (brewer == Note_head::print_proc)
{
SCM style = me->get_property ("style");
- if (!ly_c_symbol_p (style))
+ if (!gh_symbol_p (style))
{
return 0.0;
}
- SCM log = scm_int2num (Note_head::get_balltype (me));
+ SCM log = gh_int2scm (Note_head::get_balltype (me));
SCM proc = me->get_property ("glyph-name-procedure");
SCM scm_font_char = scm_call_2 (proc, log, style);
String font_char = "noteheads-" + ly_scm2string (scm_font_char);
Fallback
*/
SCM v = me->get_property ("stem-attachment-function");
- if (!ly_c_procedure_p (v))
+ if (!gh_procedure_p (v))
return 0.0;
- SCM result = scm_call_2 (v, me->self_scm (), scm_int2num (a));
- if (!ly_c_pair_p (result))
+ SCM result = scm_call_2 (v, me->self_scm (), gh_int2scm (a));
+ if (!gh_pair_p (result))
return 0.0;
result = (a == X_AXIS) ? ly_car (result) : ly_cdr (result);
Note_head::get_balltype (Grob*me)
{
SCM s = me->get_property ("duration-log");
- return ly_c_number_p (s) ? ly_scm2int (s) <? 2 : 0;
+ return gh_number_p (s) ? gh_scm2int (s) <? 2 : 0;
}
ADD_INTERFACE (Note_head,"note-head-interface",
#include <ctype.h>
#include "rhythmic-head.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "event.hh"
#include "dots.hh"
#include "dot-column.hh"
{
for (int i=0; i < note_reqs_.size (); i++)
{
+ Item *note = make_item ("NoteHead");
Music * req = note_reqs_[i];
- Item *note = make_item ("NoteHead", req->self_scm ());
Duration dur = *unsmob_duration (req->get_property ("duration"));
- note->set_property ("duration-log", scm_int2num (dur.duration_log ()));
+ note->set_property ("duration-log", gh_int2scm (dur.duration_log ()));
if (dur.dot_count ())
{
- Item * d = make_item ("Dots", note->self_scm ());
+ Item * d = make_item ("Dots");
Rhythmic_head::set_dots (note, d);
if (dur.dot_count ()
!= robust_scm2int (d->get_property ("dot-count"), 0))
- d->set_property ("dot-count", scm_int2num (dur.dot_count ()));
+ d->set_property ("dot-count", gh_int2scm (dur.dot_count ()));
d->set_parent (note, Y_AXIS);
-
+ announce_grob (d, SCM_EOL);
dots_.push (d);
}
int pos = pit ? pit->steps () : 0;
SCM c0 = get_property ("middleCPosition");
- if (ly_c_number_p (c0))
- pos += ly_scm2int (c0);
+ if (gh_number_p (c0))
+ pos += gh_scm2int (c0);
- note->set_property ("staff-position", scm_int2num (pos));
+ note->set_property ("staff-position", gh_int2scm (pos));
+ announce_grob (note,req->self_scm ());
notes_.push (note);
}
}
void
Note_heads_engraver::stop_translation_timestep ()
{
+ for (int i=0; i < notes_.size (); i++)
+ {
+ typeset_grob (notes_[i]);
+ }
notes_.clear ();
+ for (int i=0; i < dots_.size (); i++)
+ {
+ typeset_grob (dots_[i]);
+ }
dots_.clear ();
note_reqs_.clear ();
}
}
if (s.length ())
{
- Item * t = make_item ("NoteName", events_[0]->self_scm () );
+ Item * t = make_item ("NoteName");
t->set_property ("text", scm_makfrom0str (s.to_str0 ()));
+ announce_grob (t, events_[0]->self_scm ());
texts_.push (t);
}
}
void
Note_name_engraver::stop_translation_timestep ()
{
+ for (int i=0; i < texts_.size (); i++)
+ {
+ typeset_grob (texts_[i]);
+ }
texts_.clear () ;
events_.clear ();
}
#include "separation-item.hh"
#include "staff-spacing.hh"
#include "accidental-placement.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
/*
Interval left_head_wid;
do
{
- for (SCM s = props[d]; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = props[d]; gh_pair_p (s); s = gh_cdr (s))
{
- Item * it= dynamic_cast<Item*> (unsmob_grob (ly_car (s)));
+ Item * it= dynamic_cast<Item*> (unsmob_grob (gh_car (s)));
if (d == RIGHT && it->break_status_dir () != col_dir)
{
Item *
Note_spacing::left_column (Grob *me)
{
- if (!me->is_live ())
+ if (!me->live ())
return 0;
return dynamic_cast<Item*> (me)->get_column ();
Item *
Note_spacing::right_column (Grob*me)
{
- if (!me->is_live ())
+ if (!me->live ())
return 0;
SCM right = me->get_property ("right-items");
Item *mincol = 0;
int min_rank = INT_MAX;
bool prune = false;
- for (SCM s = right ; ly_c_pair_p (s) ; s = ly_cdr (s))
+ for (SCM s = right ; gh_pair_p (s) ; s = gh_cdr (s))
{
- Item * ri = unsmob_item (ly_car (s));
+ Item * ri = unsmob_item (gh_car (s));
Item * col = ri->get_column ();
int rank = Paper_column::get_rank (col);
{
// I'm a lazy bum. We could do this in-place.
SCM newright = SCM_EOL;
- for (SCM s = right ; ly_c_pair_p (s) ; s =ly_cdr (s))
+ for (SCM s = right ; gh_pair_p (s) ; s =gh_cdr (s))
{
- if (unsmob_item (ly_car (s))->get_column () == mincol)
- newright = scm_cons (ly_car (s), newright);
+ if (unsmob_item (gh_car (s))->get_column () == mincol)
+ newright = gh_cons (gh_car (s), newright);
}
me->set_property ("right-items", newright);
do
{
- for (SCM s = props[d]; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = props[d]; gh_pair_p (s); s = gh_cdr (s))
{
- Item * it= dynamic_cast<Item*> (unsmob_grob (ly_car (s)));
+ Item * it= dynamic_cast<Item*> (unsmob_grob (gh_car (s)));
if (d == RIGHT)
acc_right = acc_right || Note_column::accidentals (it);
Grob *stem = Note_column::get_stem (it);
- if (!stem || !stem->is_live ())
+ if (!stem || !stem->live ())
{
if (d == RIGHT && Separation_item::has_interface (it))
{
#include "spanner.hh"
#include "font-interface.hh"
#include "dimensions.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "warn.hh"
#include "paper-column.hh"
#include "staff-symbol-referencer.hh"
Interval span_points;
Grob *common = me->get_bound (LEFT)->common_refpoint (me->get_bound (RIGHT), X_AXIS);
- Output_def * paper = me->get_paper ();
+ Paper_def * paper = me->get_paper ();
Drul_array<bool> broken;
Interval ext;
if (Note_column::has_interface (b))
{
- for (SCM s = b->get_property ("note-heads"); ly_c_pair_p (s); s =ly_cdr (s))
- ext.unite (unsmob_grob (ly_car (s))->extent (common, X_AXIS));
+ for (SCM s = b->get_property ("note-heads"); gh_pair_p (s); s =gh_cdr (s))
+ ext.unite (unsmob_grob (gh_car (s))->extent (common, X_AXIS));
}
if (ext.is_empty ())
Real x = b->relative_coordinate (common, X_AXIS);
ext = Interval (x,x);
}
+
span_points[d] = (broken [d]) ? b->extent (common, X_AXIS)[-d] : ext[d];
if (broken[d])
b = Stencil (Box (b.extent (X_AXIS),
Interval (0.1,0.1)),
- b.expr ());
+ b.get_expr ());
b.translate_axis (bracket_span_points[LEFT], X_AXIS);
text.translate_axis (span_points[LEFT], X_AXIS);
{
finished_= span_;
span_ = 0;
- if (ly_c_string_p (ott))
+ if (gh_string_p (ott))
{
- span_ = make_spanner ("OttavaBracket", SCM_EOL);
+ span_ = make_spanner ("OttavaBracket");
span_->set_property ("text", ott);
-
+ announce_grob (span_, SCM_EOL);
SCM c0 (get_property ("middleCPosition"));
SCM oc0 (get_property ("originalCentralCPosition"));
if (scm_less_p (oc0, c0) == SCM_BOOL_T)
- span_->set_property ("direction", scm_int2num (DOWN));
+ span_->set_property ("direction", gh_int2scm (DOWN));
}
}
last_ottavation_ = ott;
}
while (flip (&d) != LEFT);
+ typeset_grob (finished_);
finished_ = 0;
}
}
+++ /dev/null
-/*
- music-output-def.cc -- implement Output_def
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#include "context-def.hh"
-#include "file-path.hh"
-#include "global-context.hh"
-#include "interval.hh"
-#include "lily-guile.hh"
-#include "ly-module.hh"
-#include "main.hh"
-#include "output-def.hh"
-#include "output-def.hh"
-#include "scm-hash.hh"
-#include "warn.hh"
-
-Output_def::Output_def ()
-{
- scope_ = SCM_EOL;
- parent_ = 0;
- smobify_self ();
-
- scope_ = ly_make_anonymous_module (false);
-}
-
-Output_def::Output_def (Output_def const &s)
-{
- scope_ = SCM_EOL;
- parent_ = 0;
- smobify_self ();
-
- input_origin_ = s.input_origin_;
- scope_= ly_make_anonymous_module (false);
- if (ly_c_module_p (s.scope_))
- ly_import_module (scope_, s.scope_);
-}
-
-Output_def::~Output_def ()
-{
-}
-
-#include "ly-smobs.icc"
-IMPLEMENT_SMOBS (Output_def);
-IMPLEMENT_DEFAULT_EQUAL_P (Output_def);
-
-SCM
-Output_def::mark_smob (SCM m)
-{
- Output_def *mo = (Output_def*) SCM_CELL_WORD_1 (m);
-
- /* FIXME: why is this necessary?
- all bookpaper_ should be protected by themselves. */
- if (mo->parent_)
- scm_gc_mark (mo->parent_->self_scm ());
-
- mo->derived_mark ();
- return mo->scope_;
-}
-
-void
-Output_def::derived_mark ()
-{
-}
-
-void
-assign_context_def (Output_def * m, SCM transdef)
-{
- Context_def *tp = unsmob_context_def (transdef);
- assert (tp);
-
- if (tp)
- {
- SCM sym = tp->get_context_name ();
- scm_module_define (m->scope_, sym, transdef);
- }
-}
-
-/* find the translator for NAME. NAME must be a symbol. */
-SCM
-find_context_def (Output_def const *m, SCM name)
-{
- Context_def *cd = unsmob_context_def (m->lookup_variable (name));
- return cd ? cd->self_scm () : SCM_EOL;
-}
-
-int
-Output_def::print_smob (SCM s, SCM p, scm_print_state *)
-{
- Output_def * def = unsmob_output_def (s);
- scm_puts ("#< ", p);
- scm_puts (classname (def), p);
-
- (void)def;
- scm_puts (">", p);
- return 1;
-}
-
-Real
-Output_def::get_dimension (SCM s) const
-{
- SCM val = lookup_variable (s);
- return ly_scm2double (val);
-}
-
-SCM
-Output_def::lookup_variable (SCM sym) const
-{
- SCM var = ly_module_lookup (scope_, sym);
- if (SCM_VARIABLEP (var) && SCM_VARIABLE_REF(var) != SCM_UNDEFINED)
- return SCM_VARIABLE_REF (var);
-
- if (parent_)
- return parent_->lookup_variable (sym);
-
- return SCM_EOL;
-}
-
-SCM
-Output_def::c_variable (String s) const
-{
- return lookup_variable (ly_symbol2scm (s.to_str0 ()));
-}
-
-void
-Output_def::set_variable (SCM sym, SCM val)
-{
- scm_module_define (scope_, sym, val);
-}
-
-LY_DEFINE (ly_paper_lookup, "ly:output-def-lookup",
- 2, 0, 0, (SCM pap, SCM sym),
- "Lookup @var{sym} in @var{pap}. "
- "Return the value or @code{'()} if undefined.")
-{
- Output_def *op = unsmob_output_def (pap);
- SCM_ASSERT_TYPE (op, pap, SCM_ARG1, __FUNCTION__, "Output_def");
- SCM_ASSERT_TYPE (ly_c_symbol_p (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
-
- return op->lookup_variable (sym);
-}
-
-LY_DEFINE (ly_output_def_scope, "ly:output-def-scope",
- 1, 0, 0, (SCM def),
- "Get the variable scope inside @var{def}.")
-{
- Output_def *op = unsmob_output_def (def);
- SCM_ASSERT_TYPE (op, def, SCM_ARG1, __FUNCTION__, "Output definition");
- return op->scope_;
-}
-
-LY_DEFINE (ly_output_def_parent, "ly:output-def-parent",
- 1, 0, 0, (SCM def),
- "Get the parent output-def of @var{def}.")
-{
- Output_def *op = unsmob_output_def (def);
- SCM_ASSERT_TYPE (op, def, SCM_ARG1, __FUNCTION__, "Output definition");
- return op->parent_ ? op->parent_->self_scm () : SCM_EOL;
-}
-
-LY_DEFINE (ly_output_def_clone, "ly:output-def-clone",
- 1, 0, 0, (SCM def),
- "Clone @var{def}.")
-{
- Output_def *op = unsmob_output_def (def);
- SCM_ASSERT_TYPE (op, def, SCM_ARG1, __FUNCTION__, "Output definition");
- SCM s = op->clone ()->self_scm ();
- scm_gc_unprotect_object (s);
- return s;
-}
-
-LY_DEFINE (ly_output_description, "ly:output-description",
- 1, 0, 0, (SCM output_def),
- "Return the description of translators in @var{output-def}.")
-{
- Output_def *id = unsmob_output_def (output_def);
-
- SCM al = ly_module2alist (id->scope_);
-
- SCM ell = SCM_EOL;
- for (SCM s = al; ly_c_pair_p (s); s = ly_cdr (s))
- {
- Context_def * td = unsmob_context_def (ly_cdar (s));
- SCM key = ly_caar (s);
- if (td && key == td->get_context_name ())
- ell = scm_cons (scm_cons (key, td->to_alist ()), ell);
- }
- return ell;
-}
-
-/* FIXME. This is broken until we have a generic way of
- putting lists inside the \paper block. */
-Interval
-line_dimensions_int (Output_def *def, int n)
-{
- Real lw = def->get_dimension (ly_symbol2scm ("linewidth"));
- Real ind = n ? 0.0 : def->get_dimension (ly_symbol2scm ("indent"));
- return Interval (ind, lw);
-}
-
-LY_DEFINE (ly_paper_def_p, "ly:paper-def?",
- 1, 0, 0, (SCM def),
- "Is @var{def} a paper definition?")
-{
- return ly_bool2scm (unsmob_output_def (def));
-}
-
-LY_DEFINE (ly_bookpaper_outputscale, "ly:bookpaper-outputscale",
- 1, 0, 0, (SCM bp),
- "Get outputscale for BP.")
-{
- Output_def *b = unsmob_output_def (bp);
- SCM_ASSERT_TYPE (b, bp, SCM_ARG1, __FUNCTION__, "bookpaper");
- return scm_make_real (output_scale (b));
-}
-
-LY_DEFINE (ly_make_output_def, "ly:make-output-def",
- 0, 0, 0, (),
- "Make a output def.")
-{
- Output_def *bp = new Output_def ;
- return scm_gc_unprotect_object (bp->self_scm ());
-}
-
-
- if (ly_c_procedure_p (pred))
+ if (gh_procedure_p (pred))
{
/*
should typecheck pred.
dynamic_cast<Context *> (inf.origin_trans_);
if (!d)
- d = dynamic_cast<Context *> (inf.origin_trans_->context ());
+ d = dynamic_cast<Context *> (inf.origin_trans_->daddy_context_);
SCM proc = o->get_property ("procedure");
scm_call_3 (proc,
inf.grob_->self_scm (),
d->self_scm (),
- context ()->self_scm ());
+ daddy_context_->self_scm ());
}
}
}
+++ /dev/null
-/*
- pango-afm-decoder.c -- AFM fontencoding for Pango fontconfig
-
- source file of the GNU LilyPond music typesetter
-
- Copyright (C) 2004 Jan Nieuwenhuizen <janneke@gnu.org>
-
- Note: in C and with explicit LPGL header for easier use with PANGO
- outside of LilyPond.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#include "config.h"
-#if HAVE_PANGO_FC_FONT_MAP_ADD_DECODER_FIND_FUNC
-
-/* Need to access to PangoFcFont.full_pattern. */
-#define PANGO_ENABLE_BACKEND
-
-#include <pango/pango-font.h>
-#include <pango/pangoxft.h>
-#include <pango/pangofc-font.h>
-#include <gdk/gdkx.h>
-#include <X11/Xft/Xft.h>
-
-#include "pangofc-afm-decoder.hh"
-
-#ifdef DEBUG_PANGO_AFM
-#include <stdio.h>
-#define dprintf(args...) fprintf (stderr, args)
-#else
-#define dprintf(args...)
-#endif
-
-struct _PangoFcAfmDecoderPrivate
-{
- GString encoding[256];
- //GString file_name;
- char const *file_name;
- PangoFcFont *fc_font;
-};
-
-static void pango_fc_afm_decoder_init (PangoFcAfmDecoder *fontmap);
-static void pango_fc_afm_decoder_class_init (PangoFcAfmDecoderClass *clss);
-static void pango_fc_afm_decoder_finalize (GObject *object);
-
-static FcCharSet *pango_fc_afm_get_charset (PangoFcDecoder *decoder,
- PangoFcFont *fcfont);
-static PangoGlyph pango_fc_afm_get_glyph (PangoFcDecoder *decoder,
- PangoFcFont *fcfont, guint32 wc);
-static void pango_fc_afm_decoder_set_file_name (PangoFcAfmDecoder *self,
- char const *file_name);
-
-static PangoFcDecoderClass *parent_class;
-
-#if 0
-/* ugly warning */
-G_DEFINE_TYPE (PangoFcAfmDecoder, pango_fc_afm_decoder, PANGO_TYPE_FC_DECODER);
-#else
-GType
-pango_fc_afm_decoder_get_type (void)
-{
- static GType object_type = 0;
-
- if (!object_type)
- {
- static const GTypeInfo object_info =
- {
- sizeof (PangoFcAfmDecoderClass),
- (GBaseInitFunc) 0,
- (GBaseFinalizeFunc) 0,
- (GClassInitFunc) pango_fc_afm_decoder_class_init,
- 0, /* class_finalize */
- 0, /* class_data */
- sizeof (PangoFcAfmDecoder),
- 0, /* n_preallocs */
- (GInstanceInitFunc) pango_fc_afm_decoder_init,
- 0, /* value table */
- };
-
- object_type = g_type_register_static (PANGO_TYPE_FC_DECODER,
- "PangoFcAfmDecoder",
- &object_info, (GTypeFlags)0);
- }
-
- return object_type;
-}
-#endif
-
-static void
-pango_fc_afm_decoder_init (PangoFcAfmDecoder *fcafmdecoder)
-{
- PangoFcAfmDecoderPrivate *priv = fcafmdecoder->priv;
- priv = fcafmdecoder->priv
- = G_TYPE_INSTANCE_GET_PRIVATE (fcafmdecoder,
- PANGO_TYPE_FC_AFM_DECODER,
- PangoFcAfmDecoderPrivate);
- /*
- init members
- */
-}
-
-static void
-pango_fc_afm_decoder_class_init (PangoFcAfmDecoderClass *clss)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (clss);
- object_class->finalize = pango_fc_afm_decoder_finalize;
- g_type_class_add_private (object_class, sizeof (PangoFcAfmDecoderPrivate));
-
- PangoFcDecoderClass *parent_class = PANGO_FC_DECODER_CLASS (clss);
- parent_class->get_charset = pango_fc_afm_get_charset;
- parent_class->get_glyph = pango_fc_afm_get_glyph;
-}
-
-static void
-pango_fc_afm_decoder_finalize (GObject *object)
-{
-#if 0
- PangoFcAfmDecoder *fcafmdecoder = PANGO_FC_AFM_DECODER (object);
- PangoFcAfmDecoderPrivate *priv = fcafmdecoder->priv;
-#endif
-
- /*
- destroy members
- */
- G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
-static FcCharSet *
-pango_fc_afm_get_charset (PangoFcDecoder *decoder, PangoFcFont *fcfont)
-{
- (void) decoder;
- //dprintf ("get charset: %s\n", fcfont->font_pattern);
- dprintf ("get charset: \n");
-#if 0
- FcCharSet *charset = 0;
- FcPatternGetCharSet (fcfont->font_pattern, FC_CHARSET, 0, &charset);
-#else
- /* Return plain, undecoded charset.
- TODO:
- - actually read AFM?
- - caching?
- - PUA mapping ? */
- (void) fcfont;
- int i;
- FcChar32 chr = 0;
- FcCharSet *charset = FcCharSetCreate ();
- for (i = 0; i < 256; i++)
- if (!FcCharSetAddChar (charset, chr++))
- return 0;
-#endif
- return charset;
-}
-
-static PangoGlyph
-pango_fc_afm_get_glyph (PangoFcDecoder *decoder, PangoFcFont *fcfont,
- guint32 wc)
-{
- (void) decoder;
-#if 0
- XftFont *xft_font;
- xft_font = XftFontOpenPattern (GDK_DISPLAY (),
- FcPatternDuplicate (fcfont->font_pattern));
- PangoGlyph g = XftCharIndex (0, xft_font, wc);
- dprintf ("get glyph! 0x%x --> 0x%x\n", wc, (unsigned)g);
-#else
- /* TODO:
- - PUA mapping?
-
- Shortcut PUA mapping/AFM reading: The Feta charsets are encoded
- without any gaps, starting at 0x21. *grin* */
- (void) fcfont;
- return wc - 0x21;
-#endif
-}
-
-static void
-pango_fc_afm_decoder_set_file_name (PangoFcAfmDecoder *self,
- char const *file_name)
-{
- self->priv->file_name = file_name;
-}
-
-PangoFcAfmDecoder *
-pango_fc_afm_decoder_new (void)
-{
- return PANGO_FC_AFM_DECODER (g_object_new (PANGO_TYPE_FC_AFM_DECODER, 0));
-}
-
-PangoFcDecoder *
-pango_fc_afm_find_decoder (FcPattern *pattern, gpointer user_data)
-{
- FcChar8 *family_name;
-
- if (FcPatternGetString (pattern, FC_FAMILY, 0, &family_name)
- == FcResultMatch)
- {
- dprintf ("Family name: %s\n", family_name);
- dprintf ("user_data: %s\n", (char const*) user_data);
-
- if (!strcasecmp ((char const*) family_name, (char const*) user_data))
- {
- PangoFcAfmDecoder *afm = pango_fc_afm_decoder_new ();
- char const *file_name = "feta20.afm";
- pango_fc_afm_decoder_set_file_name (afm, file_name);
- dprintf ("Adding decoder: %s\n", file_name);
- return PANGO_FC_DECODER (afm);
- }
- }
- return 0;
-}
-
-void
-pango_fc_afm_add_decoder (char const *family_name)
-{
- PangoFcFontMap *fc_map
- = PANGO_FC_FONT_MAP (pango_xft_get_font_map (GDK_DISPLAY (), 0));
-
- pango_fc_font_map_add_decoder_find_func (fc_map, pango_fc_afm_find_decoder,
- (gpointer)family_name, 0);
-}
-
-#ifdef PANGO_FC_AFM_DECODER_TEST
-
-#include <gtk/gtk.h>
-#include <libgnomecanvas/libgnomecanvas.h>
-#include <pango/pangoft2.h>
-#include <pango/pangox.h>
-#include <pango/pangoxft.h>
-
-#include "pangofc-afm-decoder.hh"
-
-#define CANVAS_WIDTH 600
-#define CANVAS_HEIGHT 300
-
-static void
-exit_clicked (GtkWidget *widget, gpointer data)
-{
- gtk_widget_destroy (GTK_WIDGET (data));
- gtk_main_quit ();
-}
-
-static gint
-delete_event (GtkWidget *widget, GdkEvent *event, gpointer data)
-{
- gtk_widget_destroy (widget);
- gtk_main_quit ();
- return TRUE;
-}
-
-GnomeCanvas *
-make_canvas (int width, int height)
-{
- GtkWidget *window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- GtkWidget *vbox = gtk_vbox_new (FALSE, 0);
- GtkWidget *canvas = gnome_canvas_new ();
- GtkWidget *hbox = gtk_hbox_new (TRUE, 0);
- GtkWidget *button = gtk_button_new_with_label ("Exit");
-
- gtk_container_add (GTK_CONTAINER (window), vbox);
- gtk_widget_set_size_request (canvas, width, height);
- gtk_box_pack_start (GTK_BOX (vbox), canvas, TRUE, TRUE, 0);
- gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
-
- gtk_signal_connect (GTK_OBJECT (button), "clicked",
- (GtkSignalFunc) exit_clicked, window);
-
- gtk_signal_connect (GTK_OBJECT (window), "delete_event",
- (GtkSignalFunc) delete_event, 0);
-
- gtk_widget_show_all (window);
- return GNOME_CANVAS (canvas);
-}
-
-#define gnome_canvas_text(x, y, font, text) \
- gnome_canvas_item_new (root, text_item, "x", x, "y", y, "font", font, \
- "text", text, "anchor", GTK_ANCHOR_SOUTH_WEST, \
- "fill_color", "black", 0)
-
-int
-main (int argc, char **argv)
-{
- gtk_init (&argc, &argv);
- GnomeCanvas *canvas = make_canvas (CANVAS_WIDTH, CANVAS_HEIGHT);
-
- /* Register GNU LilyPond FETA AFM decoders. */
- pango_fc_afm_add_decoder ("lilypond-feta");
- pango_fc_afm_add_decoder ("lilypond-braces");
- pango_fc_afm_add_decoder ("lilypond-dyn");
- pango_fc_afm_add_decoder ("lilypond-parmesan");
-
- int text_item = gnome_canvas_text_get_type ();
- GnomeCanvasGroup *root = gnome_canvas_root (canvas);
- char const *g_clef_utf8 = "\302\220";
-
- gnome_canvas_text (45.0, 122.5, "LilyPond-feta-nummer 16", "3");
- gnome_canvas_text (45.0, 142.5, "LilyPond-feta-nummer, r 16", "4");
- gnome_canvas_text (10.0, 142.0, "LilyPond-feta, 32", g_clef_utf8);
-
- gtk_main ();
- return 0;
-}
-#endif /* PANGO_FC_AFM_DECODER_TEST */
-
-#endif /* HAVE_PANGO_FC_FONT_MAP_ADD_DECODER_FIND_FUNC */
(c) 2004 Jan Nieuwenhuizen <janneke@gnu.org>
*/
+#include <stdio.h>
+#include <math.h>
+
#include "ly-module.hh"
#include "main.hh"
-#include "output-def.hh"
#include "paper-book.hh"
+#include "paper-def.hh"
#include "paper-outputter.hh"
+#include "paper-line.hh"
#include "paper-score.hh"
-#include "paper-system.hh"
#include "stencil.hh"
-#include "warn.hh"
-#include "ly-smobs.icc"
+static Real const MIN_COVERAGE = 0.66;
+
+static SCM
+stencil2line (Stencil* stil, bool is_title = false)
+{
+ static SCM z;
+ if (!z)
+ z = scm_permanent_object (ly_offset2scm (Offset (0, 0)));
+ Offset dim = Offset (stil->extent (X_AXIS).length (),
+ stil->extent (Y_AXIS).length ());
+ Paper_line *pl = new Paper_line (dim, scm_cons (stil->smobbed_copy (),
+ SCM_EOL), is_title);
+
+ return scm_gc_unprotect_object (pl->self_scm ());
+}
+
+/* Simplistic page interface */
+class Page
+{
+public:
+ Paper_def *paper_;
+ static int page_count_;
+ int number_;
+ int line_count_;
+
+ Protected_scm lines_;
+ Protected_scm header_;
+ Protected_scm footer_;
+ Protected_scm copyright_;
+ Protected_scm tagline_;
+
+ Stencil *get_header () { return unsmob_stencil (header_); }
+ Stencil *get_copyright () { return unsmob_stencil (copyright_); }
+ Stencil *get_tagline () { return unsmob_stencil (tagline_); }
+ Stencil *get_footer () { return unsmob_stencil (footer_); }
+
+ /* actual height filled with text. */
+ Real height_;
+
+ // HMMM all this size stuff to paper/paper-outputter?
+ Real hsize_;
+ Real vsize_;
+ Real left_margin_;
+ Real top_margin_;
+ Real bottom_margin_;
+ Real foot_sep_;
+ Real head_sep_;
+ Real text_width_;
+
+ /* available area for text. */
+ Real text_height ();
+
+ Page (Paper_def*, int);
+ void output (Paper_outputter*, bool);
+};
+
+int Page::page_count_ = 0;
+
+Page::Page (Paper_def *paper, int number)
+{
+ paper_ = paper;
+ number_ = number;
+ page_count_++;
+
+ height_ = 0;
+ lines_ = SCM_EOL;
+ line_count_ = 0;
+
+ hsize_ = paper->get_realvar (ly_symbol2scm ("hsize"));
+ vsize_ = paper->get_realvar (ly_symbol2scm ("vsize"));
+ top_margin_ = paper->get_realvar (ly_symbol2scm ("top-margin"));
+ bottom_margin_ = paper->get_realvar (ly_symbol2scm ("bottom-margin"));
+ head_sep_ = paper->get_realvar (ly_symbol2scm ("head-sep"));
+ foot_sep_ = paper->get_realvar (ly_symbol2scm ("foot-sep"));
+ text_width_ = paper->get_realvar (ly_symbol2scm ("linewidth"));
+ left_margin_ = (hsize_ - text_width_) / 2;
+
+ copyright_ = SCM_EOL;
+ tagline_ = SCM_EOL;
+
+ SCM make_header = ly_scheme_function ("make-header");
+ SCM make_footer = ly_scheme_function ("make-footer");
+
+ header_ = scm_call_2 (make_header, paper_->self_scm (),
+ scm_int2num (number_));
+ // FIXME: why does this (generates Stencil) not trigger font load?
+ if (get_header ())
+ get_header ()->align_to (Y_AXIS, UP);
+
+ footer_ = scm_call_2 (make_footer, paper_->self_scm (),
+ scm_int2num (number_));
+ if (get_footer ())
+ get_footer ()->align_to (Y_AXIS, UP);
+}
+
+void
+Page::output (Paper_outputter *out, bool is_last)
+{
+ progress_indication ("[" + to_string (number_));
+ out->output_scheme (scm_list_1 (ly_symbol2scm ("start-page")));
+ Offset o (left_margin_, top_margin_);
+ Real vfill = line_count_ > 1 ? (text_height () - height_) / (line_count_ - 1)
+ : 0;
+
+ Real coverage = height_ / text_height ();
+ if (coverage < MIN_COVERAGE)
+ /* Do not space out a badly filled page. This is too simplistic
+ (ie broken), because this should not vary too much between
+ (subsequent?) pages in a book. */
+ vfill = 0;
+
+ if (get_header ())
+ {
+ out->output_line (stencil2line (get_header ()), &o, false);
+ o[Y_AXIS] += head_sep_;
+ }
+ for (SCM s = lines_; s != SCM_EOL; s = ly_cdr (s))
+ {
+ SCM line = ly_car (s);
+ out->output_line (line, &o,
+ is_last && ly_cdr (s) != SCM_EOL && !get_copyright ()
+ && !get_tagline () && !get_footer ());
+
+ /* Do not put vfill between title and its music, */
+ if (scm_pair_p (ly_cdr (s))
+ && (!unsmob_paper_line (line)->is_title () || vfill < 0))
+ o[Y_AXIS] += vfill;
+ /* rather put extra just before the title. */
+ if (ly_cdr (s) != SCM_EOL
+ && (unsmob_paper_line (ly_cadr (s))->is_title () && vfill > 0))
+ o[Y_AXIS] += vfill;
+ }
+
+ o[Y_AXIS] = vsize_ - bottom_margin_;
+ if (get_copyright ())
+ o[Y_AXIS] -= get_copyright ()->extent (Y_AXIS).length ();
+ if (get_tagline ())
+ o[Y_AXIS] -= get_tagline ()->extent (Y_AXIS).length ();
+ if (get_footer ())
+ o[Y_AXIS] -= get_footer ()->extent (Y_AXIS).length ();
+
+ if (get_copyright ())
+ out->output_line (stencil2line (get_copyright ()), &o,
+ is_last && !get_tagline () && !get_footer ());
+ if (get_tagline ())
+ out->output_line (stencil2line (get_tagline ()), &o,
+ is_last && !get_footer ());
+ if (get_footer ())
+ out->output_line (stencil2line (get_footer ()), &o, is_last);
+ out->output_scheme (scm_list_2 (ly_symbol2scm ("stop-page"),
+ gh_bool2scm (is_last && !get_footer ())));
+ progress_indication ("]");
+}
+
+Real
+Page::text_height ()
+{
+ Real h = vsize_ - top_margin_ - bottom_margin_;
+ if (get_header ())
+ h -= get_header ()->extent (Y_AXIS).length () + head_sep_;
+ if (get_copyright () || get_tagline () || get_footer ())
+ h -= foot_sep_;
+ if (get_copyright ())
+ h -= get_copyright ()->extent (Y_AXIS).length ();
+ if (get_tagline ())
+ h -= get_tagline ()->extent (Y_AXIS).length ();
+ if (get_footer ())
+ h -= get_footer ()->extent (Y_AXIS).length ();
+ return h;
+}
+
+/****************************************************************/
+
+/* Current global paper book. Gives default_rendering access from
+ input-file-results. */
+Paper_book *paper_book;
Paper_book::Paper_book ()
{
- pages_ = SCM_BOOL_F;
- lines_ = SCM_BOOL_F;
- header_ = SCM_EOL;
+ copyright_ = SCM_EOL;
+ tagline_ = SCM_EOL;
- bookpaper_ = 0;
smobify_self ();
}
{
}
+#include "ly-smobs.icc"
+
IMPLEMENT_DEFAULT_EQUAL_P (Paper_book);
IMPLEMENT_SMOBS (Paper_book)
IMPLEMENT_TYPE_P (Paper_book, "ly:paper-book?")
SCM
Paper_book::mark_smob (SCM smob)
{
- Paper_book *b = (Paper_book*) SCM_CELL_WORD_1 (smob);
- for (int i = 0; i < b->score_lines_.size (); i++)
- b->score_lines_[i].gc_mark ();
-
- if (b->bookpaper_)
- scm_gc_mark (b->bookpaper_->self_scm ());
- scm_gc_mark (b->header_);
- scm_gc_mark (b->pages_);
- return b->lines_;
+ Paper_book *pb = (Paper_book*) SCM_CELL_WORD_1 (smob);
+ for (int i = 0; i < pb->headers_.size (); i++)
+ scm_gc_mark (pb->headers_[i]);
+ for (int i = 0; i < pb->global_headers_.size (); i++)
+ scm_gc_mark (pb->global_headers_[i]);
+ for (int i = 0; i < pb->papers_.size (); i++)
+ scm_gc_mark (pb->papers_[i]->self_scm ());
+ for (int i = 0; i < pb->scores_.size (); i++)
+ scm_gc_mark (pb->scores_[i]);
+
+ scm_gc_mark (pb->copyright_);
+
+ return pb->tagline_;
}
int
return 1;
}
-Array<String>
-split_string (String s, char c)
-{
- Array<String> rv;
- while (s.length ())
- {
- int i = s.index (c);
-
- if (i == 0)
- {
- s = s.nomid_string (0, 1);
- continue;
- }
-
- if (i < 0)
- i = s.length () ;
-
- rv.push (s.cut_string (0, i));
- s = s.nomid_string (0, i);
- }
-
- return rv;
-}
-
-SCM
-dump_fields ()
-{
- SCM fields = SCM_EOL;
- for (int i = dump_header_fieldnames_global.size (); i--; )
- fields
- = scm_cons (ly_symbol2scm (dump_header_fieldnames_global[i].to_str0 ()),
- fields);
- return fields;
-}
-
-LY_DEFINE (ly_output_formats, "ly:output-formats",
- 0, 0, 0, (),
- "Formats passed to --format as a list of strings, "
- "used for the output.")
-{
- Array<String> output_formats = split_string (output_format_global, ',');
-
- SCM lst = SCM_EOL;
- int output_formats_count = output_formats.size ();
- for (int i = 0; i < output_formats_count; i ++)
- lst = scm_cons (scm_makfrom0str (output_formats[i].to_str0 ()), lst);
-
- return lst;
-}
-
void
Paper_book::output (String outname)
{
- if (!score_lines_.size ())
+ if (!papers_.size ())
return;
-
- /* Generate all stencils to trigger font loads. */
- pages ();
-
- SCM formats = ly_output_formats ();
- for (SCM s = formats; ly_c_pair_p (s); s = ly_cdr (s))
- {
- String format = ly_scm2string (ly_car (s));
- Paper_outputter *out = get_paper_outputter (outname + "." + format,
- format);
-
- SCM scopes = SCM_EOL;
- if (ly_c_module_p (header_))
- scopes = scm_cons (header_, scopes);
-
- String mod_nm = "scm framework-" + format;
-
- SCM mod = scm_c_resolve_module (mod_nm.to_str0 ());
- SCM func = scm_c_module_lookup (mod, "output-framework");
-
- func = scm_variable_ref (func);
- scm_apply_0 (func, scm_list_n (out->self_scm (),
- self_scm (),
- scopes,
- dump_fields (),
- scm_makfrom0str (outname.to_str0 ()),
- SCM_UNDEFINED));
-
- scm_gc_unprotect_object (out->self_scm ());
- progress_indication ("\n");
- }
-}
-
-void
-Paper_book::classic_output (String outname)
-{
+
/* Generate all stencils to trigger font loads. */
- lines ();
+ Link_array<Page> *pages = this->pages ();
- // ugh code dup
- SCM scopes = SCM_EOL;
- if (ly_c_module_p (header_))
- scopes = scm_cons (header_, scopes);
+ Paper_def *paper = papers_[0];
+ Paper_outputter *out = paper->get_paper_outputter (outname);
+ out->output_header (paper, scopes (0), pages->size ());
- if (ly_c_module_p (score_lines_[0].header_))
- scopes = scm_cons (score_lines_[0].header_, scopes);
- //end ugh
+ int page_count = pages->size ();
+ for (int i = 0; i < page_count; i++)
+ (*pages)[i]->output (out, i + 1 == page_count);
- Array<String> output_formats = split_string (output_format_global, ',');
+ out->output_scheme (scm_list_1 (ly_symbol2scm ("end-output")));
- for (int i = 0; i < output_formats.size (); i++)
- {
- String format = output_formats[i];
- String mod_nm = "scm framework-" + format;
-
- SCM mod = scm_c_resolve_module (mod_nm.to_str0 ());
- SCM func = scm_c_module_lookup (mod, "output-classic-framework");
+ /*
+ Ugh
+ */
+ for (int i =pages->size (); i--;)
+ delete pages->elem(i);
+ delete pages;
- func = scm_variable_ref (func);
-
- Paper_outputter *out = get_paper_outputter (outname + "." + format,
- format);
-
- scm_apply_0 (func, scm_list_5 (out->self_scm (), self_scm (), scopes,
- dump_fields (),
- scm_makfrom0str (outname.to_str0 ())));
-
- scm_gc_unprotect_object (out->self_scm ());
- progress_indication ("\n");
- }
-}
-
-LY_DEFINE (ly_paper_book_pages, "ly:paper-book-pages",
- 1, 0, 0, (SCM pb),
- "Return pages in book PB.")
-{
- return unsmob_paper_book(pb)->pages ();
+
+ progress_indication ("\n");
}
-LY_DEFINE (ly_paper_book_scopes, "ly:paper-book-scopes",
- 1, 0, 0, (SCM book),
- "Return pages in paper book @var{book}.")
+SCM
+Paper_book::scopes (int i)
{
- Paper_book *pb = unsmob_paper_book(book);
- SCM_ASSERT_TYPE(pb, book, SCM_ARG1, __FUNCTION__, "Paper_book");
-
SCM scopes = SCM_EOL;
- if (ly_c_module_p (pb->header_))
- scopes = scm_cons (pb->header_, scopes);
-
+ if (headers_[i])
+ scopes = scm_cons (headers_[i], scopes);
+ if (global_headers_[i] && global_headers_[i] != headers_[i])
+ scopes = scm_cons (global_headers_[i], scopes);
return scopes;
}
-LY_DEFINE (ly_paper_book_lines, "ly:paper-book-lines",
- 1, 0, 0, (SCM pb),
- "Return lines in book PB.")
+Stencil*
+Paper_book::title (int i)
{
- return unsmob_paper_book (pb)->lines ();
-}
-
-LY_DEFINE (ly_paper_book_book_paper, "ly:paper-book-book-paper",
- 1, 0, 0, (SCM pb),
- "Return pages in book PB.")
-{
- return unsmob_paper_book (pb)->bookpaper_->self_scm ();
-}
-
-/* TODO: resurrect more complex user-tweaks for titling? */
-Stencil
-Paper_book::book_title ()
-{
- SCM title_func = bookpaper_->lookup_variable (ly_symbol2scm ("book-title"));
- Stencil title;
-
- SCM scopes = SCM_EOL;
- if (ly_c_module_p (header_))
- scopes = scm_cons (header_, scopes);
-
-
- SCM tit = SCM_EOL;
- if (ly_c_procedure_p (title_func))
- tit = scm_call_2 (title_func,
- bookpaper_->self_scm (),
- scopes);
-
- if (unsmob_stencil (tit))
- title = *unsmob_stencil (tit);
-
- if (!title.is_empty ())
- title.align_to (Y_AXIS, UP);
+ SCM user_title = ly_scheme_function ("user-title");
+ SCM book_title = ly_scheme_function ("book-title");
+ SCM score_title = ly_scheme_function ("score-title");
+ SCM field = (i == 0 ? ly_symbol2scm ("bookTitle")
+ : ly_symbol2scm ("scoreTitle"));
+
+ Stencil *title = 0;
+ SCM scopes = this->scopes (i);
+ SCM s = ly_modules_lookup (scopes, field);
+ if (s != SCM_UNDEFINED && scm_variable_bound_p (s) == SCM_BOOL_T)
+ title = unsmob_stencil (scm_call_2 (user_title,
+ papers_[0]->self_scm (),
+ scm_variable_ref (s)));
+ else
+ title = unsmob_stencil (scm_call_2 (i == 0 ? book_title : score_title,
+ papers_[0]->self_scm (),
+ scopes));
+ if (title)
+ title->align_to (Y_AXIS, UP);
return title;
}
-Stencil
-Paper_book::score_title (int i)
+void
+Paper_book::classic_output (String outname)
{
- SCM title_func = bookpaper_->lookup_variable (ly_symbol2scm ("score-title"));
-
- Stencil title;
+ int count = scores_.size ();
+ Paper_outputter *out = papers_.top ()->get_paper_outputter (outname);
+ out->output_header (papers_.top (), scopes (count - 1), 0);
+
+ int line_count = SCM_VECTOR_LENGTH ((SCM) scores_.top ());
+ for (int i = 0; i < line_count; i++)
+ out->output_line (scm_vector_ref ((SCM) scores_.top (), scm_int2num (i)),
+ 0, i == line_count - 1);
+
+ out->output_scheme (scm_list_1 (ly_symbol2scm ("end-output")));
+ progress_indication ("\n");
+}
- // ugh code dup
- SCM scopes = SCM_EOL;
- if (ly_c_module_p (header_))
- scopes = scm_cons (header_, scopes);
- if (ly_c_module_p (score_lines_[i].header_))
- scopes = scm_cons (score_lines_[i].header_, scopes);
- //end ugh
+/* calculate book height, #lines, stencils. */
+void
+Paper_book::init ()
+{
+ int score_count = scores_.size ();
- SCM tit = SCM_EOL;
- if (ly_c_procedure_p (title_func))
- tit = scm_call_2 (title_func,
- bookpaper_->self_scm (),
- scopes);
+ /* Calculate the full book height. Hmm, can't we cache system
+ heights while making stencils? */
+ height_ = 0;
+ for (int i = 0; i < score_count; i++)
+ {
+ Stencil *title = this->title (i);
+ if (title)
+ height_ += title->extent (Y_AXIS).length ();
- if (unsmob_stencil (tit))
- title = *unsmob_stencil (tit);
+ int line_count = SCM_VECTOR_LENGTH ((SCM) scores_[i]);
+ for (int j = 0; j < line_count; j++)
+ {
+ SCM s = scm_vector_ref ((SCM) scores_[i], scm_int2num (j));
+ height_ += unsmob_paper_line (s)->dim ()[Y_AXIS];
+ }
+ }
- if (!title.is_empty ())
- title.align_to (Y_AXIS, UP);
-
- return title;
+ Paper_def *paper = papers_[0];
+ SCM scopes = this->scopes (0);
+
+ SCM make_tagline = ly_scheme_function ("make-tagline");
+ tagline_ = scm_call_2 (make_tagline, paper->self_scm (), scopes);
+ Real tag_height = 0;
+ if (Stencil *s = unsmob_stencil (tagline_))
+ tag_height = s->extent (Y_AXIS).length ();
+ height_ += tag_height;
+
+ SCM make_copyright = ly_scheme_function ("make-copyright");
+ copyright_ = scm_call_2 (make_copyright, paper->self_scm (), scopes);
+ Real copy_height = 0;
+ if (Stencil *s = unsmob_stencil (copyright_))
+ copy_height = s->extent (Y_AXIS).length ();
+ height_ += copy_height;
}
-
+
SCM
Paper_book::lines ()
{
- if (lines_ != SCM_BOOL_F)
- return lines_;
-
- lines_ = SCM_EOL;
- Stencil title = book_title ();
-
- if (!title.is_empty ())
- {
- Paper_system *pl = new Paper_system (title, true);
- lines_ = scm_cons (pl->self_scm (), lines_);
- scm_gc_unprotect_object (pl->self_scm ());
- }
-
- int score_count = score_lines_.size ();
+ int score_count = scores_.size ();
+ SCM lines = SCM_EOL;
for (int i = 0; i < score_count; i++)
{
- Stencil title = score_title (i);
- if (!title.is_empty ())
- {
- Paper_system *pl = new Paper_system (title, true);
- lines_ = scm_cons (pl->self_scm (), lines_);
- scm_gc_unprotect_object (pl->self_scm ());
- }
-
- if (scm_vector_p (score_lines_[i].lines_) == SCM_BOOL_T)
- {
- // guh.
- SCM line_list = scm_vector_to_list (score_lines_[i].lines_);
-
- line_list = scm_reverse (line_list);
- lines_ = scm_append (scm_list_2 (line_list, lines_));
- }
+ if (Stencil *title = this->title (i))
+ lines = ly_snoc (stencil2line (title, true), lines);
+ lines = scm_append (scm_list_2 (lines, scm_vector_to_list (scores_[i])));
}
-
- lines_ = scm_reverse (lines_);
-
+ //debug helper; ughr
int i = 0;
- Paper_system *last = 0;
- for (SCM s = lines_; s != SCM_EOL; s = ly_cdr (s))
- {
- Paper_system * p = unsmob_paper_line (ly_car (s));
- p->number_ = ++i;
-
- if (last && last->is_title ())
- // ugh, hardcoded.
- p->penalty_ = 10000;
- last = p;
- }
-
- return lines_;
+ for (SCM s = lines; s != SCM_EOL; s = ly_cdr (s))
+ unsmob_paper_line (ly_car (s))->number_ = ++i;
+ return lines;
}
-SCM
+Link_array<Page>*
Paper_book::pages ()
{
- if (SCM_BOOL_F != pages_)
- return pages_;
-
- pages_ = SCM_EOL;
- Output_def *paper = bookpaper_;
- SCM proc = paper->c_variable ("page-breaking");
- pages_ = scm_apply_0 (proc, scm_list_2 (lines (), self_scm ()));
- return pages_;
-}
+ init ();
+ Page::page_count_ = 0;
+ Paper_def *paper = papers_[0];
+ Page *page = new Page (paper, 1);
+
+ Real text_height = page->text_height ();
+
+ Real copy_height = 0;
+ if (Stencil *s = unsmob_stencil (copyright_))
+ copy_height = s->extent (Y_AXIS).length ();
+
+ Real tag_height = 0;
+ if (Stencil *s = unsmob_stencil (tagline_))
+ tag_height = s->extent (Y_AXIS).length ();
+
+ SCM all = lines ();
+ SCM proc = paper->get_scmvar ("page-breaking");
+ SCM breaks = scm_apply_0 (proc, scm_list_n (all, gh_double2scm (height_),
+ gh_double2scm (text_height),
+ gh_double2scm (-copy_height),
+ gh_double2scm (-tag_height),
+ SCM_UNDEFINED));
+
+ /* Copyright on first page. */
+ if (unsmob_stencil (copyright_))
+ page->copyright_ = copyright_;
+
+ Link_array<Page> *pages = new Link_array<Page>;
+ int page_count = SCM_VECTOR_LENGTH ((SCM) breaks);
+ int line = 1;
+ for (int i = 0; i < page_count; i++)
+ {
+ if (i)
+ page = new Page (paper, i+1);
+ int next = i + 1 < page_count
+ ? gh_scm2int (scm_vector_ref (breaks, gh_int2scm (i))) : 0;
+ while ((!next && all != SCM_EOL) || line <= next)
+ {
+ SCM s = ly_car (all);
+ page->lines_ = ly_snoc (s, page->lines_);
+ page->height_ += unsmob_paper_line (s)->dim ()[Y_AXIS];
+ page->line_count_++;
+ all = ly_cdr (all);
+ line++;
+ }
+ pages->push (page);
+ }
+ /* Tagline on last page. */
+ if (unsmob_stencil (tagline_))
+ page->tagline_ = tagline_;
-/****************************************************************/
+ return pages;
+}
-Score_lines::Score_lines ()
+static SCM
+c_ragged_page_breaks (SCM lines, Real book_height, Real text_height,
+ Real first, Real last)
{
- lines_ = SCM_EOL;
- header_ = SCM_EOL;
+ int page_number = 0;
+ int page_count = int (book_height / text_height + 0.5);
+ SCM breaks = SCM_EOL;
+ Real page_height = text_height + first;
+ Real h = 0;
+ int number = 0;
+ for (SCM s = lines; s != SCM_EOL; s = ly_cdr (s))
+ {
+ Paper_line *pl = unsmob_paper_line (ly_car (s));
+ if (!pl->is_title () && h < page_height)
+ number++;
+ h += pl->dim ()[Y_AXIS];
+ if (!pl->is_title () && h > page_height)
+ {
+ breaks = ly_snoc (gh_int2scm (number), breaks);
+ page_number++;
+ page_height = text_height + (page_number == page_count) * last;
+ h = 0;
+ }
+ if (ly_cdr (s) == SCM_EOL)
+ breaks = ly_snoc (gh_int2scm (pl->number_), breaks);
+ }
+
+ return scm_vector (breaks);
}
-void
-Score_lines::gc_mark ()
+LY_DEFINE (ly_ragged_page_breaks, "ly:ragged-page-breaks",
+ 5, 0, 0, (SCM lines, SCM book, SCM text, SCM first, SCM last),
+ "Return a vector with line numbers of page breaks.")
{
- scm_gc_mark (lines_);
- scm_gc_mark (header_);
+ SCM_ASSERT_TYPE (scm_pair_p (lines), lines, SCM_ARG1, __FUNCTION__, "list");
+ SCM_ASSERT_TYPE (gh_number_p (book), book, SCM_ARG2, __FUNCTION__, "real");
+ SCM_ASSERT_TYPE (gh_number_p (text), text, SCM_ARG2, __FUNCTION__, "real");
+ SCM_ASSERT_TYPE (gh_number_p (first), first, SCM_ARG2, __FUNCTION__, "real");
+ SCM_ASSERT_TYPE (gh_number_p (last), last, SCM_ARG2, __FUNCTION__, "real");
+
+ return c_ragged_page_breaks (lines,
+ gh_scm2double (book), gh_scm2double (text),
+ gh_scm2double (first), gh_scm2double (last));
}
-
#include "text-item.hh"
#include "lookup.hh"
#include "font-interface.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
" non-adjacent numbers.\n"
"\n"
,
- "between-cols when bounded-by-me "
+ "between-cols between-system-string when bounded-by-me "
"shortest-playing-duration shortest-starter-duration");
void
Paper_column::Paper_column (SCM l)
: Item (l) // guh.?
{
- system_ = 0;
+ system_=0;
rank_ = -1;
}
bool
Paper_column::is_used (Grob*me)
{
- return ly_c_pair_p (me->get_property ("elements")) || Item::is_breakable (me)
- || ly_c_pair_p (me->get_property ("bounded-by-me"))
+ return gh_pair_p (me->get_property ("elements")) || Item::is_breakable (me)
+ || gh_pair_p (me->get_property ("bounded-by-me"))
;
}
SCM c = me->get_property ("bounded-by-me");
SCM *ptrptr = &c;
- while (ly_c_pair_p (*ptrptr))
+ while (gh_pair_p (*ptrptr))
{
- Grob * g = unsmob_grob (ly_car (*ptrptr));
+ Grob * g = unsmob_grob (gh_car (*ptrptr));
- if (!g || !g->is_live ())
+ if (!g || !g->live ())
{
- *ptrptr = ly_cdr (*ptrptr);
+ *ptrptr = gh_cdr (*ptrptr);
}
else
{
--- /dev/null
+/*
+ paper-def.cc -- implement Paper_def
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+
+#include <math.h>
+
+#include "virtual-font-metric.hh"
+#include "all-font-metrics.hh"
+#include "string.hh"
+#include "misc.hh"
+#include "paper-def.hh"
+#include "warn.hh"
+#include "scaled-font-metric.hh"
+#include "main.hh"
+#include "scm-hash.hh"
+#include "input-file-results.hh" // urg? header_global
+#include "paper-outputter.hh"
+#include "ly-module.hh"
+
+/*
+ This is an almost empty thing. The only substantial thing this class
+ handles is scaling up and down to real-world dimensions (internally
+ dimensions are against global staff-space.)
+ */
+
+Paper_def::Paper_def ()
+{
+}
+
+Paper_def::~Paper_def ()
+{
+}
+
+Paper_def::Paper_def (Paper_def const&src)
+ : Music_output_def (src)
+{
+}
+
+Real
+Paper_def::get_realvar (SCM s) const
+{
+ SCM val = lookup_variable (s);
+ SCM scale = lookup_variable (ly_symbol2scm ("outputscale"));
+
+ Real sc = gh_scm2double (scale);
+ return gh_scm2double (val) / sc;
+}
+
+/*
+ FIXME. This is broken until we have a generic way of
+ putting lists inside the \paper block.
+ */
+Interval
+Paper_def::line_dimensions_int (int n) const
+{
+ Real lw = get_realvar (ly_symbol2scm ("linewidth"));
+ Real ind = n? 0.0:get_realvar (ly_symbol2scm ("indent"));
+
+ return Interval (ind, lw);
+}
+
+
+
+
+Paper_outputter*
+Paper_def::get_paper_outputter (String outname) const
+{
+ progress_indication (_f ("paper output to `%s'...",
+ outname == "-" ? String ("<stdout>") : outname));
+ progress_indication("\n");
+
+ global_input_file->target_strings_.push (outname);
+ Paper_outputter * po = new Paper_outputter (outname);
+ Path p = split_path (outname);
+ p.ext = "";
+ po->basename_ = p.to_string ();
+ return po;
+}
+
+
+/*
+ Todo: use symbols and hashtable idx?
+*/
+Font_metric *
+Paper_def::find_font (SCM fn, Real m)
+{
+ SCM key = gh_cons (fn, gh_double2scm (m));
+ SCM met = scm_assoc (key, scaled_fonts_);
+
+ if (gh_pair_p (met))
+ return unsmob_metrics (ly_cdr (met));
+
+ /*
+ Hmm. We're chaining font - metrics. Should consider wether to merge
+ virtual-font and scaled_font.
+ */
+ Font_metric* f=0;
+ if (gh_list_p (fn))
+ {
+ f = new Virtual_font_metric (fn, m, this); // TODO: GC protection.
+
+ scaled_fonts_ = scm_acons (key, f->self_scm (), scaled_fonts_);
+ scm_gc_unprotect_object (f->self_scm ());
+ }
+ else
+ {
+ SCM scale_var = ly_module_lookup (scope_, ly_symbol2scm ("outputscale"));
+
+ m /= gh_scm2double (scm_variable_ref (scale_var));
+
+ f = all_fonts_global->find_font (ly_scm2string (fn));
+ SCM val = Scaled_font_metric::make_scaled_font_metric (f, m);
+ scaled_fonts_ = scm_acons (key, val, scaled_fonts_);
+ scm_gc_unprotect_object (val);
+
+ f = unsmob_metrics (val);
+ }
+
+ return f;
+}
+
+
+/*
+ Return alist to translate internally used fonts back to real-world
+ coordinates. */
+SCM
+Paper_def::font_descriptions ()const
+{
+ SCM l = SCM_EOL;
+ for (SCM s = scaled_fonts_; gh_pair_p (s); s = ly_cdr (s))
+ {
+ SCM desc = ly_caar (s);
+ if (!gh_string_p (gh_car (desc)))
+ continue ;
+
+ SCM mdesc = unsmob_metrics (ly_cdar (s))->description_;
+
+ l = gh_cons (gh_cons (mdesc, desc), l);
+ }
+ return l;
+}
+
+Paper_def*
+unsmob_paper (SCM x)
+{
+ return dynamic_cast<Paper_def*> (unsmob_music_output_def (x));
+}
+
+
+LY_DEFINE (ly_paper_def_p, "ly:paper-def?",
+ 1, 0,0, (SCM def),
+ "Is @var{def} a paper definition?")
+{
+ Paper_def *op = dynamic_cast<Paper_def*> (unsmob_music_output_def (def));
+
+ bool pap = op;
+ return gh_bool2scm (pap);
+}
--- /dev/null
+/*
+ paper-line.cc -- implement Paper_line
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 2004 Jan Nieuwenhuizen <janneke@gnu.org>
+*/
+
+#include "paper-line.hh"
+#include "ly-smobs.icc"
+#include "string.hh" // to_string
+
+#define TITLE_PENALTY -1
+
+Paper_line::Paper_line (Offset o, SCM stencils, bool is_title)
+{
+ dim_ = o;
+ stencils_ = stencils;
+ is_title_ = is_title;
+ smobify_self ();
+}
+
+Paper_line::~Paper_line ()
+{
+}
+
+IMPLEMENT_SMOBS (Paper_line);
+IMPLEMENT_TYPE_P (Paper_line, "ly:paper-line?");
+IMPLEMENT_DEFAULT_EQUAL_P (Paper_line);
+
+SCM
+Paper_line::mark_smob (SCM s)
+{
+ Paper_line *line = (Paper_line*) ly_cdr (s);
+ return line->stencils_;
+}
+
+int
+Paper_line::print_smob (SCM s, SCM port, scm_print_state*)
+{
+ scm_puts ("#<Paper_line ", port);
+ Paper_line *line = (Paper_line*) ly_cdr (s);
+ scm_puts (to_string (line->number_).to_str0 (), port);
+ if (line->is_title ())
+ scm_puts (" t", port);
+ scm_puts (" >", port);
+ return 1;
+}
+
+Offset
+Paper_line::dim () const
+{
+ return dim_;
+}
+
+bool
+Paper_line::is_title () const
+{
+ return is_title_;
+}
+
+SCM
+Paper_line::stencils () const
+{
+ return stencils_;
+}
+
+LY_DEFINE (ly_paper_line_height, "ly:paper-line-height",
+ 1, 0, 0, (SCM line),
+ "Return the height of @var{line}.")
+{
+ Paper_line *pl = unsmob_paper_line (line);
+ SCM_ASSERT_TYPE (pl, line, SCM_ARG1, __FUNCTION__, "paper-line");
+ return gh_double2scm (pl->dim ()[Y_AXIS]);
+}
+
+LY_DEFINE (ly_paper_line_number, "ly:paper-line-number",
+ 1, 0, 0, (SCM line),
+ "Return the number of @var{line}.")
+{
+ Paper_line *pl = unsmob_paper_line (line);
+ SCM_ASSERT_TYPE (pl, line, SCM_ARG1, __FUNCTION__, "paper-line");
+ return gh_int2scm (pl->number_);
+}
+
+LY_DEFINE (ly_paper_line_break_score, "ly:paper-line-break-score",
+ 1, 0, 0, (SCM line),
+ "Return the score for breaking after @var{line}.")
+{
+ Paper_line *pl = unsmob_paper_line (line);
+ SCM_ASSERT_TYPE (pl, line, SCM_ARG1, __FUNCTION__, "paper-line");
+ return gh_int2scm (int (pl->is_title ()) * TITLE_PENALTY);
+}
source file of the GNU LilyPond music typesetter
(c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
- Jan Nieuwenhuizen <janneke@gnu.org>
+ Jan Nieuwenhuizen <janneke@gnu.org>
*/
-#include <math.h>
#include <time.h>
+#include <math.h>
-#include "array.hh"
#include "dimensions.hh"
-#include "file-name.hh"
-#include "font-metric.hh"
-#include "input-smob.hh"
-#include "lily-guile.hh"
-#include "lily-version.hh"
-#include "ly-module.hh"
-#include "main.hh"
-#include "output-def.hh"
-#include "paper-book.hh"
+#include "virtual-methods.hh"
#include "paper-outputter.hh"
-#include "paper-system.hh"
-#include "scm-hash.hh"
#include "stencil.hh"
+#include "array.hh"
#include "string-convert.hh"
#include "warn.hh"
-
-#include "ly-smobs.icc"
+#include "font-metric.hh"
+#include "main.hh"
+#include "scm-hash.hh"
+#include "lily-version.hh"
+#include "paper-def.hh"
+#include "input-file-results.hh"
+#include "ly-module.hh"
+#include "paper-book.hh"
+#include "paper-line.hh"
+#include "input-smob.hh" // output_expr
-Paper_outputter::Paper_outputter (String filename, String format)
+Paper_outputter::Paper_outputter (String name)
{
- file_ = SCM_EOL;
- output_module_ = SCM_EOL;
- smobify_self ();
+ if (safe_global_b)
+ scm_define (ly_symbol2scm ("safe-mode?"), SCM_BOOL_T);
- filename_ = filename;
- String module_name = "scm output-" + format;
- output_module_ = scm_c_resolve_module (module_name.to_str0 ());
+ file_ = scm_open_file (scm_makfrom0str (name.to_str0 ()),
+ scm_makfrom0str ("w"));
+
+ if (output_format_global == PAGE_LAYOUT)
+ {
+ output_func_ = SCM_EOL;
+ String name = "scm output-" + output_format_global;
+ if (safe_global_b)
+ {
+ /* In safe mode, start from a GUILE safe-module and import
+ all symbols from the output module. */
+ scm_c_use_module ("ice-9 safe");
+ SCM msm = scm_primitive_eval (ly_symbol2scm ("make-safe-module"));
+ output_module_ = scm_call_0 (msm);
+ ly_import_module (output_module_,
+ scm_c_resolve_module (name.to_str0 ()));
+ }
+ else
+ output_module_ = scm_c_resolve_module (name.to_str0 ());
+
+ /* FIXME: output-lib should be module, that can be imported. */
+#define IMPORT_LESS 1 // only import the list of IMPORTS
+#if IMPORT_LESS
+ scm_c_use_module ("lily");
+ scm_c_use_module ("ice-9 regex");
+ scm_c_use_module ("srfi srfi-13");
+#endif
+ char const *imports[] = {
+ "lilypond-version", /* from lily */
+ "ly:output-def-scope",
+ "ly:gulp-file",
+ "ly:number->string",
+ "ly:ragged-page-breaks",
+ "ly:optimal-page-breaks",
+
+ "ly:number-pair->string", /* output-lib.scm */
+ "ly:numbers->string",
+ "ly:inexact->string",
+
+ "assoc-get",
+#if IMPORT_LESS
+ "string-index", /* from srfi srfi-13 */
+ "string-join",
+ "regexp-substitute/global", /* from (ice9 regex) */
+#endif
+ 0,
+ };
+
+ for (int i = 0; imports[i]; i++)
+ {
+ SCM s = ly_symbol2scm (imports[i]);
+ scm_module_define (output_module_, s, scm_primitive_eval (s));
+ }
+#ifndef IMPORT_LESS // rather crude, esp for safe-mode let's not
+ SCM m = scm_set_current_module (output_module_);
+ /* not present in current module*/
+ scm_c_use_module ("ice-9 regex");
+ scm_c_use_module ("srfi srfi-13");
+ /* Need only a few of these, see above
+ scm_c_use_module ("lily"); */
+ scm_set_current_module (m);
+#endif
+ }
+ else
+ {
+ output_func_
+ = scm_call_1 (ly_scheme_function ("find-dumper"),
+ scm_makfrom0str (output_format_global.to_str0 ()));
+ output_module_ = SCM_EOL;
+ }
}
Paper_outputter::~Paper_outputter ()
{
+ scm_close_port (file_);
+ file_ = SCM_EOL;
}
-
-IMPLEMENT_SMOBS (Paper_outputter);
-IMPLEMENT_DEFAULT_EQUAL_P (Paper_outputter);
-
-SCM
-Paper_outputter::mark_smob (SCM x)
+void
+Paper_outputter::output_scheme (SCM scm)
{
- Paper_outputter *p = (Paper_outputter*) SCM_CELL_WORD_1(x);
- scm_gc_mark (p->output_module_);
- return p->file_;
+ if (output_format_global == PAGE_LAYOUT)
+ scm_display (scm_eval (scm, output_module_), file_);
+ else
+ gh_call2 (output_func_, scm, file_);
}
-int
-Paper_outputter::print_smob (SCM x, SCM p, scm_print_state*)
+void
+Paper_outputter::output_metadata (Paper_def *paper, SCM scopes)
{
- (void) x;
- scm_puts ("#<Paper_outputter>", p);
- return 1;
+ SCM fields = SCM_EOL;
+ for (int i = dump_header_fieldnames_global.size (); i--; )
+ fields
+ = gh_cons (ly_symbol2scm (dump_header_fieldnames_global[i].to_str0 ()),
+ fields);
+ output_scheme (scm_list_n (ly_symbol2scm ("output-scopes"),
+ paper->self_scm (),
+ ly_quote_scm (scopes),
+ ly_quote_scm (fields),
+ scm_makfrom0str (basename_.to_str0 ()),
+ SCM_UNDEFINED));
}
-SCM
-Paper_outputter::file ()
+void
+Paper_outputter::output_header (Paper_def *paper, SCM scopes, int page_count)
{
- if (file_ == SCM_EOL)
- file_ = scm_open_file (scm_makfrom0str (filename_.to_str0 ()),
- scm_makfrom0str ("w"));
- return file_;
-}
+ String creator = gnu_lilypond_version_string ();
+ creator += " (http://lilypond.org)";
+ time_t t (time (0));
+ String time_stamp = ctime (&t);
+ time_stamp = time_stamp.left_string (time_stamp.length () - 1)
+ + " " + *tzname;
+ output_scheme (scm_list_4 (ly_symbol2scm ("header"),
+ scm_makfrom0str (creator.to_str0 ()),
+ scm_makfrom0str (time_stamp.to_str0 ()),
+ scm_int2num (page_count)));
-SCM
-Paper_outputter::dump_string (SCM scm)
-{
- return scm_display (scm, file ());
-}
+ output_metadata (paper, scopes);
+ output_music_output_def (paper);
-SCM
-Paper_outputter::scheme_to_string (SCM scm)
-{
- return scm_eval (scm, output_module_);
+ output_scheme (scm_list_1 (ly_symbol2scm ("header-end")));
+ output_scheme (scm_list_2 (ly_symbol2scm ("define-fonts"),
+ ly_quote_scm (paper->font_descriptions ())));
}
void
-Paper_outputter::output_scheme (SCM scm)
+Paper_outputter::output_line (SCM line, Offset *origin, bool is_last)
{
- dump_string (scheme_to_string (scm));
-}
+ Paper_line *pl = unsmob_paper_line (line);
+ Offset dim = pl->dim ();
+ if (dim[Y_AXIS] > 50 CM)
+ {
+ programming_error ("Improbable system height.");
+ dim[Y_AXIS] = 50 CM;
+ }
-void
-paper_outputter_dump (void *po, SCM x)
-{
- Paper_outputter *me = (Paper_outputter*) po;
- me->output_scheme (x);
-}
+ if (output_format_global != PAGE_LAYOUT)
+ output_scheme (scm_list_3 (ly_symbol2scm ("start-system"),
+ gh_double2scm (dim[X_AXIS]),
+ gh_double2scm (dim[Y_AXIS])));
+ else
+ {
+ output_scheme (scm_list_3 (ly_symbol2scm ("new-start-system"),
+ ly_quote_scm (ly_offset2scm (*origin)),
+ ly_quote_scm (ly_offset2scm (dim))));
+ (*origin)[Y_AXIS] += dim[Y_AXIS];
+ }
-void
-Paper_outputter::output_stencil (Stencil stil)
-{
- interpret_stencil_expression (stil.expr (), paper_outputter_dump,
- (void*) this, Offset (0,0));
-}
+ SCM between = SCM_EOL;
+ for (SCM s = pl->stencils (); gh_pair_p (s); s = ly_cdr (s))
+ {
+ Stencil *stil = unsmob_stencil (ly_car (s));
+ if (stil)
+ output_expr (stil->get_expr (), Offset (0,0));
+ /* Only if !PAGE_LAYOUT */
+ else if (ly_caar (s) == ly_symbol2scm ("between-system-string"))
+ between = ly_cdar (s);
+ }
-Paper_outputter *
-get_paper_outputter (String outname, String f)
-{
- progress_indication (_f ("paper output to `%s'...",
- outname == "-" ? String ("<stdout>") : outname));
- return new Paper_outputter (outname, f);
+ if (is_last)
+ output_scheme (scm_list_1 (ly_symbol2scm ("stop-last-system")));
+ else
+ {
+ output_scheme (scm_list_1 (ly_symbol2scm ("stop-system")));
+ if (output_format_global != PAGE_LAYOUT && between != SCM_EOL)
+ output_scheme (between);
+ }
}
-/* FIXME: why is output_* wrapper called dump? */
-LY_DEFINE (ly_outputter_dump_stencil, "ly:outputter-dump-stencil",
- 2, 0, 0, (SCM outputter, SCM stencil),
- "Dump stencil @var{expr} onto @var{outputter}.")
+void
+Paper_outputter::output_music_output_def (Music_output_def* odef)
{
- Paper_outputter *po = unsmob_outputter (outputter);
- Stencil *st = unsmob_stencil (stencil);
- SCM_ASSERT_TYPE (po, outputter, SCM_ARG1, __FUNCTION__, "Paper_outputter");
- SCM_ASSERT_TYPE (st, stencil, SCM_ARG1, __FUNCTION__, "Paper_outputter");
- po->output_stencil (*st);
- return SCM_UNSPECIFIED;
+ output_scheme (scm_list_n (ly_symbol2scm ("output-paper-def"),
+ odef->self_scm (), SCM_UNDEFINED));
}
-LY_DEFINE (ly_outputter_dump_string, "ly:outputter-dump-string",
- 2, 0, 0, (SCM outputter, SCM str),
- "Dump @var{str} onto @var{outputter}.")
+/* TODO: replaceme/rewriteme, see output-ps.scm: output-stencil */
+void
+Paper_outputter::output_expr (SCM expr, Offset o)
{
- Paper_outputter *po = unsmob_outputter (outputter);
- SCM_ASSERT_TYPE (po, outputter, SCM_ARG1, __FUNCTION__, "Paper_outputter");
- SCM_ASSERT_TYPE (ly_c_string_p (str), str, SCM_ARG1, __FUNCTION__, "Paper_outputter");
+ while (1)
+ {
+ if (!gh_pair_p (expr))
+ return;
- return po->dump_string (str);
+ SCM head =ly_car (expr);
+ if (unsmob_input (head))
+ {
+ Input * ip = unsmob_input (head);
+
+ output_scheme (scm_list_n (ly_symbol2scm ("define-origin"),
+ scm_makfrom0str (ip->file_string ().to_str0 ()),
+ gh_int2scm (ip->line_number ()),
+ gh_int2scm (ip->column_number ()),
+ SCM_UNDEFINED));
+ expr = ly_cadr (expr);
+ }
+ else if (head == ly_symbol2scm ("no-origin"))
+ {
+ output_scheme (scm_list_n (head, SCM_UNDEFINED));
+ expr = ly_cadr (expr);
+ }
+ else if (head == ly_symbol2scm ("translate-stencil"))
+ {
+ o += ly_scm2offset (ly_cadr (expr));
+ expr = ly_caddr (expr);
+ }
+ else if (head == ly_symbol2scm ("combine-stencil"))
+ {
+ output_expr (ly_cadr (expr), o);
+ expr = ly_caddr (expr);
+ }
+ else
+ {
+ output_scheme (scm_list_n (ly_symbol2scm ("placebox"),
+ gh_double2scm (o[X_AXIS]),
+ gh_double2scm (o[Y_AXIS]),
+ expr,
+ SCM_UNDEFINED));
+ return;
+ }
+ }
}
+
(c) 1996--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
-#include "all-font-metrics.hh"
-#include "font-metric.hh"
-#include "gourlay-breaking.hh"
-#include "ly-module.hh"
+#include "score.hh"
#include "main.hh"
-#include "misc.hh"
-#include "output-def.hh"
-#include "paper-book.hh"
+#include "warn.hh"
+#include "font-metric.hh"
+#include "spanner.hh"
+#include "paper-def.hh"
+#include "system.hh"
#include "paper-column.hh"
#include "paper-score.hh"
+#include "paper-column.hh"
#include "scm-hash.hh"
-#include "score.hh"
-#include "spanner.hh"
+#include "gourlay-breaking.hh"
+//#include "paper-outputter.hh"
+#include "input-file-results.hh"
+#include "misc.hh"
+#include "all-font-metrics.hh"
+
#include "stencil.hh"
-#include "system.hh"
-#include "warn.hh"
+#include "paper-book.hh"
+#include "ly-module.hh"
Paper_score::Paper_score ()
{
if (!system_)
system_ = system;
- systems_ = scm_cons (system->self_scm (), systems_);
+ systems_ = gh_cons (system->self_scm (), systems_);
system->pscore_ = this;
scm_gc_unprotect_object (system->self_scm ());
Array<Column_x_positions>
Paper_score::calc_breaking ()
{
- Break_algorithm *algorithm = 0;
+ Break_algorithm *algorithm=0;
Array<Column_x_positions> sol;
algorithm = new Gourlay_breaking ;
Array<Column_x_positions> breaking = calc_breaking ();
system_->break_into_pieces (breaking);
SCM lines = system_->get_lines ();
-#if 0
- /* gourlay:do_solve also prints newline. */
progress_indication ("\n");
-#endif
-
+
/* Only keep result stencils in lines_, *title_; delete all grobs. */
systems_ = SCM_EOL;
+++ /dev/null
-/*
- paper-system.cc -- implement Paper_system
-
- source file of the GNU LilyPond music typesetter
-
- (c) 2004 Jan Nieuwenhuizen <janneke@gnu.org>
-*/
-
-#include "paper-system.hh"
-#include "stencil.hh"
-#include "string.hh"
-#include "virtual-methods.hh"
-
-#include "ly-smobs.icc"
-
-IMPLEMENT_SMOBS (Paper_system);
-IMPLEMENT_TYPE_P (Paper_system, "ly:paper-system?");
-IMPLEMENT_DEFAULT_EQUAL_P (Paper_system);
-
-
-
-Paper_system::Paper_system (Stencil s, bool is_title)
-{
- is_title_ = is_title;
- number_ = 0;
- penalty_ = 0;
- smobify_self ();
- stencil_ = s;
-}
-
-Paper_system::~Paper_system ()
-{
-}
-
-SCM
-Paper_system::mark_smob (SCM smob)
-{
- Paper_system *line = (Paper_system*) ly_cdr (smob);
- return line-> stencil_.expr ();
-}
-
-int
-Paper_system::print_smob (SCM smob, SCM port, scm_print_state*)
-{
- Paper_system *p = (Paper_system*) ly_cdr (smob);
- scm_puts ("#<", port);
- scm_puts (classname (p), port);
- scm_puts (" ", port);
- scm_puts (to_string (p->number_).to_str0 (), port);
- scm_puts ("p ", port);
- scm_puts (to_string (p->penalty_).to_str0 (), port);
- if (p->is_title ())
- scm_puts (" t", port);
- scm_puts (" >", port);
- return 1;
-}
-
-bool
-Paper_system::is_title () const
-{
- return is_title_;
-}
-
-Real
-Paper_system::penalty () const
-{
- return penalty_;
-}
-
-Offset
-Paper_system::dim () const
-{
- return Offset (stencil_.extent (X_AXIS).length (),
- stencil_.extent (Y_AXIS).length ());
-}
-
-Stencil
-Paper_system::to_stencil () const
-{
- return stencil_;
-}
-
-LY_DEFINE (ly_paper_line_height, "ly:paper-system-extent",
- 2, 0, 0, (SCM line, SCM axis),
- "Return the extent of @var{line}.")
-{
- Paper_system *pl = unsmob_paper_line (line);
- SCM_ASSERT_TYPE (pl, line, SCM_ARG1, __FUNCTION__, "paper-system");
- SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG2, __FUNCTION__, "axis");
- Axis ax = (Axis)ly_scm2int (axis);
- return scm_make_real (pl->dim ()[ax]);
-}
-
-
-
-LY_DEFINE (ly_paper_line_title_p, "ly:paper-system-title?",
- 1, 0, 0, (SCM line),
- "Is @var{line} a title line?")
-{
- Paper_system *pl = unsmob_paper_line (line);
- SCM_ASSERT_TYPE (pl, line, SCM_ARG1, __FUNCTION__, "paper-system");
- return SCM_BOOL (pl->is_title ());
-}
-
-LY_DEFINE (ly_paper_line_number, "ly:paper-system-number",
- 1, 0, 0, (SCM line),
- "Return the number of @var{line}.")
-{
- Paper_system *pl = unsmob_paper_line (line);
- SCM_ASSERT_TYPE (pl, line, SCM_ARG1, __FUNCTION__, "paper-system");
- return scm_int2num (pl->number_);
-}
-
-LY_DEFINE (ly_paper_line_break_score, "ly:paper-system-break-penalty",
- 1, 0, 0, (SCM line),
- "Return the score for page break after @var{line}.")
-{
- Paper_system *pl = unsmob_paper_line (line);
- SCM_ASSERT_TYPE (pl, line, SCM_ARG1, __FUNCTION__, "paper-system");
- return scm_int2num (int (pl->penalty ()));
-}
-
-LY_DEFINE (ly_paper_line_stencil, "ly:paper-system-stencil",
- 1, 0, 0, (SCM line),
- "Return the height of @var{line}.")
-{
- Paper_system *pl = unsmob_paper_line (line);
- SCM_ASSERT_TYPE (pl, line, SCM_ARG1, __FUNCTION__, "paper-system");
- return pl->to_stencil ().smobbed_copy ();
-}
-
Thanks to Gary Houston <ghouston@freewire.co.uk> */
SCM
-internal_ly_parse_scm (Parse_start * ps)
+internal_ly_parse_scm (Parse_start * ps, bool safe)
{
- Source_file *sf =ps->start_location_.source_file_;
+ Source_file* sf =ps->start_location_.source_file_;
SCM port = sf->get_port ();
- int off = ps->start_location_.defined_str0_ - sf->to_str0 ();
+ int off = ps->start_location_.defined_str0_ - sf->to_str0();
scm_seek (port, scm_long2num (off), scm_long2num (SEEK_SET));
SCM from = scm_ftell (port);
SCM form;
SCM answer = SCM_UNSPECIFIED;
- /* Read expression from port. */
+ /* Read expression from port */
if (!SCM_EOF_OBJECT_P (form = scm_read (port)))
{
- SCM function = ly_scheme_function ("make-safe-lilypond-module");
- if (ps->safe_)
- answer = scm_eval (form, function);
+ if (safe)
+ {
+ static SCM safe_module;
+ if (!safe_module)
+ {
+ safe_module = scm_primitive_eval (ly_symbol2scm ("safe-module"));
+ if (output_format_global == PAGE_LAYOUT)
+ ly_import_module (safe_module, scm_c_resolve_module ("lily"));
+ }
+ answer = scm_eval (form, safe_module);
+ }
else
answer = scm_primitive_eval (form);
}
Shouldn't scm_read () do this for us? */
scm_fill_input (port);
SCM to = scm_ftell (port);
- ps->nchars = ly_scm2int (to) - ly_scm2int (from);
+ ps->nchars = gh_scm2int (to) - gh_scm2int (from);
/* Don't close the port here; if we re-enter this function via a
continuation, then the next time we enter it, we'll get an error.
catch_protected_parse_body (void *p)
{
Parse_start *ps = (Parse_start*) p;
-
- return internal_ly_parse_scm (ps);
+ return internal_ly_parse_scm (ps, false);
+}
+
+SCM
+safe_catch_protected_parse_body (void *p)
+{
+ Parse_start *ps = (Parse_start*) p;
+ return internal_ly_parse_scm (ps, true);
}
SCM
-parse_handler (void *data, SCM tag, SCM args)
+parse_handler (void * data, SCM tag, SCM args)
{
- Parse_start* ps = (Parse_start *) data;
- (void) tag;
+ Parse_start* ps = (Parse_start*) data;
+ (void) tag; // prevent warning
ps->start_location_.error (_("GUILE signaled an error for the expression beginning here"));
if (scm_ilength (args) > 2)
- scm_display_error_message (ly_cadr (args), ly_caddr (args), scm_current_error_port ());
+ scm_display_error_message (gh_cadr (args), gh_caddr (args), scm_current_error_port ());
/*
The following is a kludge; we should probably search for
#endif
SCM
-protected_ly_parse_scm (Parse_start *ps)
+protected_ly_parse_scm (Parse_start *ps, bool safe)
{
return scm_internal_catch (ly_symbol2scm (READ_ERROR),
- &catch_protected_parse_body,
+ (safe ? &safe_catch_protected_parse_body
+ : catch_protected_parse_body),
(void*) ps,
&parse_handler, (void*) ps);
}
bool parse_protect_global = true;
-/* Try parsing. Upon failure return SCM_UNDEFINED.
- FIXME: shouldn't we return SCM_UNSCPECIFIED -- jcn */
+/* Try parsing. Upon failure return SCM_UNDEFINED. */
SCM
-ly_parse_scm (char const *s, int *n, Input i, bool safe)
+ly_parse_scm (char const* s, int *n, Input i, bool safe)
{
- Parse_start ps;
+ Parse_start ps ;
ps.str = s;
ps.start_location_ = i;
- ps.safe_ = safe;
-
- SCM ans = parse_protect_global ? protected_ly_parse_scm (&ps)
- : internal_ly_parse_scm (&ps);
+
+ SCM ans = parse_protect_global ? protected_ly_parse_scm (&ps, safe)
+ : internal_ly_parse_scm (&ps, safe);
*n = ps.nchars;
return ans;
#include <stdio.h>
-#include "book.hh"
-
+#include "scm-option.hh"
#include "context-def.hh"
-#include "dimensions.hh"
-#include "event.hh"
-#include "file-path.hh"
-#include "input-smob.hh"
-#include "input.hh"
#include "lily-guile.hh"
-#include "lilypond-input-version.hh"
-#include "ly-module.hh"
-#include "main.hh"
#include "misc.hh"
-#include "music-list.hh"
-#include "music-sequence.hh"
#include "my-lily-lexer.hh"
+#include "paper-def.hh"
+#include "midi-def.hh"
+#include "main.hh"
+#include "file-path.hh"
+#include "warn.hh"
+#include "dimensions.hh"
#include "my-lily-parser.hh"
-#include "paper-book.hh"
-#include "output-def.hh"
-#include "scm-hash.hh"
-#include "scm-option.hh"
#include "score.hh"
+#include "input-file-results.hh"
+#include "input.hh"
+#include "lilypond-input-version.hh"
+#include "scm-hash.hh"
+#include "ly-module.hh"
+#include "music-sequence.hh"
+#include "input-smob.hh"
+#include "event.hh"
#include "text-item.hh"
-#include "warn.hh"
+#include "music-list.hh"
+#include "paper-book.hh"
#define MY_MAKE_MUSIC(x) make_music_by_name (ly_symbol2scm (x))
#define YYERROR_VERBOSE 1
+My_lily_parser* my_lily_parser;
#define YYPARSE_PARAM my_lily_parser
#define YYLEX_PARAM my_lily_parser
#define THIS\
tag_music (Music *m, SCM tag, Input ip)
{
SCM tags = m->get_property ("tags");
- if (ly_c_symbol_p (tag))
+ if (gh_symbol_p (tag))
tags = scm_cons (tag, tags);
- else if (ly_c_list_p (tag))
- tags = ly_append2 (tag, tags);
+ else if (gh_list_p (tag))
+ tags = gh_append2 (tag, tags);
else
ip.warning (_ ("Tag must be symbol or list of symbols."));
m->set_property ("tags", tags);
}
+
+
bool
is_regular_identifier (SCM id)
{
}
SCM
-make_simple_markup (SCM encoding, SCM a)
+make_simple_markup (SCM a)
{
SCM simple = ly_scheme_function ("simple-markup");
- if (ly_c_symbol_p (encoding))
- return scm_list_3 (ly_scheme_function ("encoded-simple-markup"),
- encoding, a);
+
return scm_list_2 (simple, a);
}
+
bool
-is_duration (int t)
+is_is_duration (int t)
{
return t && t == 1 << intlog2 (t);
}
void
set_music_properties (Music *p, SCM a)
{
- for (SCM k = a; ly_c_pair_p (k); k = ly_cdr (k))
- p->internal_set_property (ly_caar (k), ly_cdar (k));
+ for (SCM k = a; gh_pair_p (k); k = ly_cdr (k))
+ {
+ p->internal_set_property (ly_caar (k), ly_cdar (k));
+ }
}
SCM
bool
ly_input_procedure_p (SCM x)
{
- return ly_c_procedure_p (x)
- || (ly_c_pair_p (x) && ly_c_procedure_p (ly_car (x)));
+ return gh_procedure_p (x)
+ || (gh_pair_p (x) && gh_procedure_p (gh_car (x)));
}
Music*
return p;
}
-Music*
-make_music_relative (Pitch start, Music *music)
-{
- Music *relative = MY_MAKE_MUSIC ("RelativeOctaveMusic");
- relative->set_property ("element", music->self_scm ());
-
- Pitch last = music->to_relative_octave (start);
- if (lily_1_8_relative)
- music->set_property ("last-pitch", last.smobbed_copy ());
- return relative;
-}
-
-Music*
-make_lyric_combine_music (SCM name, Music *music)
-{
- Music *combine = MY_MAKE_MUSIC ("NewLyricCombineMusic");
- combine->set_property ("element", music->self_scm ());
- combine->set_property ("associated-context", name);
- return combine;
-}
-
%}
/* We use SCMs to do strings, because it saves us the trouble of
deleting them. Let's hope that a stack overflow doesnt trigger a move
of the parse stack onto the heap. */
-%left NEWLYRICS
%union {
- Book *book;
- Output_def *outputdef;
- SCM scm;
String *string;
- Music *music;
- Score *score;
- int i;
+ Music *music;
+ Score *score;
+ Music_output_def *outputdef;
+ SCM scm;
+ int i;
}
%{
int
yylex (YYSTYPE *s, void *v)
{
- My_lily_parser *pars = (My_lily_parser*) v;
+ My_lily_parser *pars = (My_lily_parser*) v;
My_lily_lexer *lex = pars->lexer_;
lex->lexval = (void*) s;
%}
-%expect 3
+%expect 4
/*
- Three shift/reduce problems:
+ Four shift/reduce problems:
+
+1. foo = bar.
+
+ "bar" -> String -> Lyric -> Music -> music-assignment
+
+ "bar" -> String -> string-assignment
+
+
+Similar problem for
2. \markup identifier.
\repeat { \repeat } \alternative
)
+
+--hwn
+
*/
%pure_parser
+
%token ACCEPTS
+%token ADDLYRICS
%token ADDQUOTE
-%token LYRICSTO
+%token NEWADDLYRICS
%token ALIAS
%token ALTERNATIVE
+%token APPLY
+%token APPLYCONTEXT
+%token APPLYOUTPUT
+%token AUTOCHANGE
%token BAR
-%token BOOK
-%token BOOKPAPER
+%token BREATHE
%token CHANGE
%token CHORDMODIFIERS
%token CHORDS
-%token DOUBLE_ANGLE_OPEN
-%token DOUBLE_ANGLE_CLOSE
+%token LESSLESS
+%token MOREMORE
%token CLEF
%token COMMANDSPANREQUEST
%token CONSISTS
%token EXTENDER
%token FIGURES FIGURE_OPEN FIGURE_CLOSE
%token FIGURE_BRACKET_CLOSE FIGURE_BRACKET_OPEN
+%token GRACE
+%token ACCIACCATURA
+%token APPOGGIATURA
%token GROBDESCRIPTIONS
%token HEADER
%token HYPHEN
%token INVALID
%token KEY
%token LYRICS
-%token LYRICS_STRING
%token MARK
%token MIDI
%token MULTI_MEASURE_REST
%token ONCE
%token OVERRIDE SET REVERT
%token PAPER
+%token PARTCOMBINE
%token PARTIAL
%token QUOTE
%token RELATIVE
%token SCM_T
%token SCORE
%token SEQUENTIAL
-%token NEWLYRICS
%token SIMULTANEOUS
%token SKIP
%token SPANREQUEST
%token TYPE
%token UNSET
%token WITH
-%token MARKUP
/* escaped */
-/* FIXME: this sucks. The user will get to see these names:
- syntax error, unexpected E_CHAR:
- \
- %%
- */
-
%token E_CHAR E_EXCLAMATION E_SMALLER E_BIGGER E_OPEN E_CLOSE
%token E_LEFTSQUARE E_RIGHTSQUARE E_TILDE
%token E_BACKSLASH
+%token <i> E_UNSIGNED
%token CHORD_BASS CHORD_COLON CHORD_MINUS CHORD_CARET CHORD_SLASH
%token FIGURE_SPACE
+%type <i> exclamations questions dots optional_rest
+%type <i> bass_mod
+%type <scm> grace_head
+%type <scm> oct_check
+%type <scm> context_mod_list
+%type <scm> lyric_element
+%type <scm> bass_number br_bass_figure bass_figure figure_list figure_spec
%token <i> DIGIT
-%token <i> UNSIGNED
-%token <i> E_UNSIGNED
-%token <id> IDENTIFIER
+%token <scm> NOTENAME_PITCH
+%token <scm> TONICNAME_PITCH
%token <scm> CHORDMODIFIER_PITCH
-%token <scm> DRUM_PITCH
%token <scm> DURATION_IDENTIFIER
+%token <scm> FRACTION
+%token <id> IDENTIFIER
+%token DRUMS
+%token <scm> DRUM_PITCH
+%token <scm> CHORD_MODIFIER
+%token <scm> SCORE_IDENTIFIER
+%token <scm> MUSIC_OUTPUT_DEF_IDENTIFIER
+%token <scm> NUMBER_IDENTIFIER
%token <scm> EVENT_IDENTIFIER
%token <scm> MUSIC_IDENTIFIER CONTEXT_DEF_IDENTIFIER
-%token <scm> NOTENAME_PITCH
-%token <scm> NUMBER_IDENTIFIER
-%token <scm> OUTPUT_DEF_IDENTIFIER
+%token <scm> STRING_IDENTIFIER SCM_IDENTIFIER
%token <scm> RESTNAME
-%token <scm> SCM_T
-%token <scm> SCORE_IDENTIFIER
%token <scm> STRING
-%token <scm> STRING_IDENTIFIER SCM_IDENTIFIER
-%token <scm> TONICNAME_PITCH
-%token <scm> CHORD_MODIFIER
-%token <scm> FRACTION
+%token <scm> SCM_T
+%token <i> UNSIGNED
%token <scm> REAL
-%token <scm> MARKUP_HEAD_EMPTY
+
+%token MARKUP
%token <scm> MARKUP_HEAD_MARKUP0
+%token <scm> MARKUP_HEAD_EMPTY
%token <scm> MARKUP_HEAD_MARKUP0_MARKUP1
%token <scm> MARKUP_HEAD_SCM0
%token <scm> MARKUP_HEAD_SCM0_MARKUP1
%token <scm> MARKUP_HEAD_SCM0_SCM1
-%token <scm> MARKUP_HEAD_SCM0_SCM1_MARKUP2
%token <scm> MARKUP_HEAD_SCM0_SCM1_SCM2
-%token <scm> MARKUP_IDENTIFIER MARKUP_HEAD_LIST0
-%token <scm> MUSIC_FUNCTION
-%token <scm> MUSIC_FUNCTION_MUSIC
-%token <scm> MUSIC_FUNCTION_MUSIC_MUSIC
-%token <scm> MUSIC_FUNCTION_SCM
-%token <scm> MUSIC_FUNCTION_SCM_MUSIC
-%token <scm> MUSIC_FUNCTION_SCM_MUSIC_MUSIC
-%token <scm> MUSIC_FUNCTION_SCM_SCM_MUSIC
-%token DRUMS
-
+%token <scm> MARKUP_HEAD_SCM0_SCM1_MARKUP2
+%token <scm> MARKUP_IDENTIFIER MARKUP_HEAD_LIST0
+%type <scm> markup markup_line markup_list markup_list_body full_markup
-%type <book> book_block book_body
-%type <i> bare_int bare_unsigned
-%type <i> exclamations questions dots optional_rest
-%type <i> script_dir
+%type <outputdef> output_def
+%type <scm> lilypond_header lilypond_header_body
+%type <music> open_event close_event
%type <i> sub_quotes sup_quotes
+%type <music> simple_element event_chord command_element Simple_music Composite_music
+%type <music> Repeated_music
+%type <scm> Alternative_music
%type <i> tremolo_type
-%type <i> bass_mod
+%type <i> bare_int bare_unsigned
+%type <i> script_dir
+%type <scm> identifier_init
-%type <music> Composite_music Simple_music Prefix_composite_music Generic_prefix_music
-%type <music> Grouped_music_list
+%type <music> note_chord_element chord_body chord_body_element
+%type <scm> chord_body_elements
+%type <scm> steno_duration optional_notemode_duration multiplied_duration
+
+%type <scm> post_events
+%type <music> gen_text_def direction_less_event direction_reqd_event
+%type <scm> steno_pitch pitch absolute_pitch pitch_also_in_chords
+%type <scm> steno_tonic_pitch
+%type <scm> duration_length fraction
+
+%type <scm> new_chord step_number chord_items chord_item chord_separator step_numbers
+
+%type <scm> embedded_scm scalar
%type <music> Music Sequential_music Simultaneous_music
-%type <music> Repeated_music
-%type <music> command_req
-%type <music> gen_text_def direction_less_event direction_reqd_event
+%type <music> relative_music re_rhythmed_music
%type <music> music_property_def context_change
-%type <music> note_chord_element chord_body chord_body_element
-%type <music> open_event close_event
+%type <scm> context_prop_spec
+%type <scm> Music_list
+%type <scm> property_operation context_mod context_def_mod optional_context_mod
+%type <outputdef> music_output_def_body music_output_def_head
%type <music> post_event tagged_post_event
-%type <music> relative_music re_rhythmed_music
-%type <music> simple_element event_chord command_element
-%type <music> string_number_event
-%type <music> toplevel_music
-%type <music> tempo_event
-
-%type <outputdef> output_def_body output_def_head
-%type <outputdef> output_def book_paper_block
+%type <music> command_req
+%type <music> string_number_event
+%type <scm> string bare_number number_expression number_term number_factor
+%type <score> score_block score_body
-%type <scm> Music_list
-%type <scm> chord_body_elements
-%type <scm> chord_item chord_items chord_separator new_chord
%type <scm> context_def_spec_block context_def_spec_body
-%type <scm> context_mod context_def_mod optional_context_mod
-%type <scm> context_prop_spec
-%type <scm> duration_length fraction
-%type <scm> embedded_scm scalar
-%type <scm> identifier_init
-%type <scm> lilypond_header lilypond_header_body
-%type <scm> new_lyrics
-%type <scm> post_events
-%type <scm> property_operation
+%type <music> tempo_event
%type <scm> script_abbreviation
-%type <scm> simple_string
-%type <scm> steno_pitch pitch absolute_pitch pitch_also_in_chords
-%type <scm> steno_tonic_pitch
-%type <scm> step_number step_numbers
-%type <scm> string bare_number number_expression number_term number_factor
-%type <scm> bass_number br_bass_figure bass_figure figure_list figure_spec
-%type <scm> context_mod_list
-%type <scm> octave_check
-%type <scm> steno_duration optional_notemode_duration multiplied_duration
-%type <scm> Generic_prefix_music_scm
-%type <scm> lyric_element
-%type <scm> Alternative_music
-%type <scm> markup markup_line markup_list markup_list_body full_markup
-%type <score> score_block score_body
%left '-' '+'
%%
lilypond: /* empty */
- | lilypond toplevel_expression {
- }
- | lilypond assignment {
- }
+ | lilypond toplevel_expression {}
+ | lilypond assignment { }
| lilypond error {
THIS->error_level_ = 1;
}
toplevel_expression:
lilypond_header {
- THIS->lexer_->set_identifier (ly_symbol2scm ("$globalheader"), $1);
+ THIS->input_file_->header_ = $1;
}
| add_quote {
-
- }
- | book_block {
- Book *book = $1;
- SCM proc = THIS->lexer_->lookup_identifier ("toplevel-book-handler");
- scm_call_2 (proc, THIS->self_scm (), book->self_scm ());
- scm_gc_unprotect_object (book->self_scm ());
}
| score_block {
- Score *score = $1;
-
- SCM proc = THIS->lexer_->lookup_identifier ("toplevel-score-handler");
- scm_call_2 (proc, THIS->self_scm (), score->self_scm ());
- scm_gc_unprotect_object (score->self_scm ());
- }
- | toplevel_music {
- Music *music = $1;
- SCM proc = THIS->lexer_->lookup_identifier ("toplevel-music-handler");
- scm_call_2 (proc, THIS->self_scm (), music->self_scm ());
- scm_gc_unprotect_object (music->self_scm ());
+ Score *sc = $1;
+
+ SCM head = ly_module_p (sc->header_) ? sc->header_ : THIS->input_file_->header_.to_SCM ();
+
+ Path p = split_path (THIS->output_basename_);
+ int *c = &THIS->input_file_->score_count_;
+ if (*c)
+ {
+ p.base += "-" + to_string (*c);
+ }
+
+ (*c)++;
+ SCM outname = scm_makfrom0str (p.to_string ().to_str0());
+
+ for (int i = 0; i < sc->defs_.size (); i++)
+ default_rendering (sc->music_, sc->defs_[i]->self_scm (), head, outname);
+
+ if (sc->defs_.is_empty ())
+ {
+ Music_output_def *id = unsmob_music_output_def
+ (THIS->lexer_->lookup_identifier ("$defaultpaper"));
+ id = id ? id->clone () : new Paper_def;
+ default_rendering (sc->music_, id->self_scm (), head,
+ outname);
+ scm_gc_unprotect_object (id->self_scm ());
+ }
+ scm_gc_unprotect_object (sc->self_scm ());
}
| output_def {
SCM id = SCM_EOL;
- Output_def * od = $1;
-
- if ($1->c_variable ("is-paper") == SCM_BOOL_T)
- id = ly_symbol2scm ("$defaultpaper");
- else if ($1->c_variable ("is-midi") == SCM_BOOL_T)
- id = ly_symbol2scm ("$defaultmidi");
- else if ($1->c_variable ("is-bookpaper") == SCM_BOOL_T)
- id = ly_symbol2scm ("$defaultbookpaper");
-
- THIS->lexer_->set_identifier (id, od->self_scm ());
- scm_gc_unprotect_object (od->self_scm ());
+ if (dynamic_cast<Paper_def*> ($1))
+ id = scm_makfrom0str ("$defaultpaper");
+ else if (dynamic_cast<Midi_def*> ($1))
+ id = scm_makfrom0str ("$defaultmidi");
+ THIS->lexer_->set_identifier (id, $1->self_scm ());
+ scm_gc_unprotect_object ($1->self_scm ());
}
;
-toplevel_music:
- Composite_music {
- }
- ;
embedded_scm:
SCM_T
;
+
+
lilypond_header_body:
{
- $$ = ly_make_anonymous_module (safe_global_b);
+ $$ = ly_make_anonymous_module ();
THIS->lexer_->add_scope ($$);
}
| lilypond_header_body assignment {
$$ = Context_def::make_scm ();
unsmob_context_def ($$)->set_spot (THIS->here_input ());
}
- | CONTEXT_DEF_IDENTIFIER {
+ | CONTEXT_DEF_IDENTIFIER {
$$ = $1;
unsmob_context_def ($$)->set_spot (THIS->here_input ());
}
| context_def_spec_body GROBDESCRIPTIONS embedded_scm {
Context_def*td = unsmob_context_def ($$);
- for (SCM p = $3; ly_c_pair_p (p); p = ly_cdr (p)) {
- SCM tag = ly_caar (p);
+ for (SCM p = $3; gh_pair_p (p); p = ly_cdr (p)) {
+ SCM tag = gh_caar (p);
/* TODO: should make new tag "grob-definition" ? */
td->add_context_mod (scm_list_3 (ly_symbol2scm ("assign"),
- tag, scm_cons (ly_cdar (p), SCM_EOL)));
+ tag, gh_cons (ly_cdar (p), SCM_EOL)));
}
}
| context_def_spec_body context_mod {
}
;
-
-
-book_block:
- BOOK {
- THIS->push_spot ();
- }
- /*cont*/ '{' book_body '}' {
- THIS->pop_spot ();
- $$ = $4;
- }
- ;
-
-/* FIXME:
- * Use 'handlers' like for toplevel-* stuff?
- * grok \paper and \midi? */
-book_body:
- {
- $$ = new Book;
- $$->set_spot (THIS->here_input ());
- $$->bookpaper_ = dynamic_cast<Output_def*> (unsmob_output_def (THIS->lexer_->lookup_identifier ("$defaultbookpaper"))->clone ());
- scm_gc_unprotect_object ($$->bookpaper_->self_scm ());
- $$->header_ = THIS->lexer_->lookup_identifier ("$globalheader");
- }
- | book_body book_paper_block {
- $$->bookpaper_ = $2;
- scm_gc_unprotect_object ($2->self_scm ());
- }
- | book_body score_block {
- Score *score = $2;
- $$->scores_.push (score);
- scm_gc_unprotect_object (score->self_scm ());
- }
- | book_body Composite_music {
- Music *music = $2;
- Score *score
- = unsmob_score (ly_music_scorify (music->self_scm ()));
- $$->scores_.push (score);
- scm_gc_unprotect_object (music->self_scm ());
- }
- | book_body lilypond_header {
- $$->header_ = $2;
- }
- | book_body error {
-
- }
- ;
-
+/*
+ SCORE
+*/
score_block:
SCORE {
THIS->push_spot ();
/*cont*/ '{' score_body '}' {
THIS->pop_spot ();
$$ = $4;
+
}
;
score_body:
- /**/ {
+ Music {
$$ = new Score;
$$->set_spot (THIS->here_input ());
- }
- | SCORE_IDENTIFIER {
- $$ = new Score ( *unsmob_score ($1));
- $$->set_spot (THIS->here_input ());
- }
- | score_body Music {
- SCM m = $2->self_scm ();
+ SCM m = $1->self_scm ();
scm_gc_unprotect_object (m);
-
+
/*
guh.
*/
SCM check_funcs = ly_scheme_function ("toplevel-music-functions");
- for (; ly_c_pair_p (check_funcs); check_funcs = ly_cdr (check_funcs))
- m = scm_call_1 (ly_car (check_funcs), m);
- if (unsmob_music ($$->music_))
- {
- THIS->parser_error (_("Already have music in score"));
- unsmob_music ($$->music_)->origin ()->error (_("This is the previous music"));
- }
+ for (; gh_pair_p (check_funcs); check_funcs = gh_cdr (check_funcs))
+ m = gh_call1 (gh_car (check_funcs), m);
$$->music_ = m;
+
+ }
+ | SCORE_IDENTIFIER {
+ $$ = new Score ( *unsmob_score ($1));
+ $$->set_spot (THIS->here_input ());
}
| score_body lilypond_header {
$$->header_ = $2;
/*
- OUTPUT DEF
+ MIDI
*/
-
-book_paper_block:
- output_def {
+output_def:
+ music_output_def_body '}' {
$$ = $1;
- if ($$->lookup_variable (ly_symbol2scm ("is-bookpaper")) != SCM_BOOL_T)
- {
- THIS->parser_error (_("Need \\bookpaper for bookpaper block."));
- $$ = get_bookpaper (THIS);
- }
+ THIS-> lexer_-> remove_scope ();
}
;
+music_output_def_head:
+ MIDI {
+ Music_output_def *id = unsmob_music_output_def (THIS->lexer_->lookup_identifier ("$defaultmidi"));
-output_def:
- output_def_body '}' {
- $$ = $1;
- if ($1->parent_)
- THIS->lexer_->remove_scope ();
- THIS->lexer_->remove_scope ();
- THIS->lexer_->pop_state ();
- }
- ;
+ Midi_def *p = 0;
+ if (id)
+ p = dynamic_cast<Midi_def*> (id->clone ());
+ else
+ p = new Midi_def;
-output_def_head:
- BOOKPAPER {
- $$ = get_bookpaper (THIS);
- $$->input_origin_ = THIS->here_input ();
- THIS->lexer_->add_scope ($$->scope_);
- }
- | MIDI {
- Output_def *p = get_midi (THIS);
$$ = p;
THIS->lexer_->add_scope (p->scope_);
}
| PAPER {
- Output_def* p = get_paper (THIS);
-
- if (p->parent_)
- THIS->lexer_->add_scope (p->parent_->scope_);
+ Music_output_def *id = unsmob_music_output_def (THIS->lexer_->lookup_identifier ("$defaultpaper"));
+ Paper_def *p = 0;
+ if (id)
+ p = dynamic_cast<Paper_def*> (id->clone ());
+ else
+ p = new Paper_def;
THIS->lexer_->add_scope (p->scope_);
$$ = p;
;
-output_def_body:
- output_def_head '{' {
+music_output_def_body:
+ music_output_def_head '{' {
$$ = $1;
- $$->input_origin_.set_spot (THIS->here_input ());
- THIS->lexer_->push_initial_state ();
+ $$->input_origin_. set_spot (THIS->here_input ());
+
}
- | output_def_head '{' OUTPUT_DEF_IDENTIFIER {
+ | music_output_def_head '{' MUSIC_OUTPUT_DEF_IDENTIFIER {
scm_gc_unprotect_object ($1->self_scm ());
- Output_def *o = unsmob_output_def ($3);
+ Music_output_def *o = unsmob_music_output_def ($3);
o->input_origin_.set_spot (THIS->here_input ());
$$ = o;
THIS->lexer_->remove_scope ();
THIS->lexer_->add_scope (o->scope_);
- THIS->lexer_->push_initial_state ();
}
- | output_def_body assignment {
+ | music_output_def_body assignment {
}
- | output_def_body context_def_spec_block {
- assign_context_def ($$, $2);
+ | music_output_def_body context_def_spec_block {
+ $$->assign_context_def ($2);
}
- | output_def_body tempo_event {
+ | music_output_def_body tempo_event {
/*
junk this ? there already is tempo stuff in
music.
*/
- int m = ly_scm2int ($2->get_property ("metronome-count"));
+ int m = gh_scm2int ( $2->get_property ("metronome-count"));
Duration *d = unsmob_duration ($2->get_property ("tempo-unit"));
- set_tempo ($$, d->get_length (), m);
+ Midi_def *md = dynamic_cast<Midi_def*> ($$);
+ if (md)
+ md->set_tempo (d->get_length (), m);
scm_gc_unprotect_object ($2->self_scm ());
}
- | output_def_body error {
+ | music_output_def_body error {
}
;
TEMPO steno_duration '=' bare_unsigned {
$$ = MY_MAKE_MUSIC ("MetronomeChangeEvent");
$$->set_property ("tempo-unit", $2);
- $$->set_property ("metronome-count", scm_int2num ( $4));
+ $$->set_property ("metronome-count", gh_int2scm ( $4));
}
;
SCM s = $$;
SCM c = scm_cons ($2->self_scm (), SCM_EOL);
scm_gc_unprotect_object ($2->self_scm ()); /* UGH */
- if (ly_c_pair_p (ly_cdr (s)))
- scm_set_cdr_x (ly_cdr (s), c); /* append */
+ if (gh_pair_p (ly_cdr (s)))
+ gh_set_cdr_x (ly_cdr (s), c); /* append */
else
- scm_set_car_x (s, c); /* set first cons */
- scm_set_cdr_x (s, c); /* remember last cell */
- }
- | Music_list embedded_scm {
+ gh_set_car_x (s, c); /* set first cons */
+ gh_set_cdr_x (s, c); /* remember last cell */
}
| Music_list error {
}
}
;
-
Repeated_music:
- REPEAT simple_string bare_unsigned Music Alternative_music
+ REPEAT string bare_unsigned Music Alternative_music
{
Music *beg = $4;
int times = $3;
- SCM alts = ly_c_pair_p ($5) ? ly_car ($5) : SCM_EOL;
+ SCM alts = gh_pair_p ($5) ? gh_car ($5) : SCM_EOL;
if (times < scm_ilength (alts)) {
- unsmob_music (ly_car (alts))
+ unsmob_music (gh_car (alts))
->origin ()->warning (
_ ("More alternatives than repeats. Junking excess alternatives."));
alts = ly_truncate_list (times, alts);
r-> set_property ("element", beg->self_scm ());
scm_gc_unprotect_object (beg->self_scm ());
}
- r->set_property ("repeat-count", scm_int2num (times >? 1));
+ r->set_property ("repeat-count", gh_int2scm (times >? 1));
r-> set_property ("elements",alts);
- if (ly_c_equal_p ($2, scm_makfrom0str ("tremolo"))) {
+ if (gh_equal_p ($2, scm_makfrom0str ("tremolo"))) {
/*
TODO: move this code to Scheme.
*/
shift -= 1;
r->compress (Moment (Rational (1, list_len)));
}
- scm_call_3 (func, r->self_scm (), scm_int2num (shift),scm_int2num (dots));
+ gh_call3 (func, r->self_scm (), gh_int2scm (shift),gh_int2scm (dots));
}
r->set_spot (*$4->origin ());
Simple_music:
event_chord { $$ = $1; }
+ | APPLYOUTPUT embedded_scm {
+ if (!ly_input_procedure_p ($2))
+ THIS->parser_error (_ ("\\applycontext takes function argument"));
+ $$ = MY_MAKE_MUSIC ("ApplyOutputEvent");
+ $$->set_property ("procedure", $2);
+ $$->set_spot (THIS->here_input ());
+ }
+ | APPLYCONTEXT embedded_scm {
+ if (!ly_input_procedure_p ($2))
+ THIS->parser_error (_ ("\\applycontext takes function argument"));
+ $$ = MY_MAKE_MUSIC ("ApplyContext");
+ $$->set_property ("procedure", $2);
+ $$->set_spot (THIS->here_input ());
+ }
| MUSIC_IDENTIFIER {
$$ = unsmob_music ($1);
}
optional_context_mod:
/**/ { $$ = SCM_EOL; }
- | WITH { THIS->lexer_->push_initial_state (); }
- '{' context_mod_list '}'
- {
- THIS->lexer_->pop_state ();
- $$ = $4;
- }
+ | WITH '{' context_mod_list '}' { $$ = $3; }
+ ;
+
+grace_head:
+ GRACE { $$ = scm_makfrom0str ("Grace"); }
+ | ACCIACCATURA { $$ = scm_makfrom0str ("Acciaccatura"); }
+ | APPOGGIATURA { $$ = scm_makfrom0str ("Appoggiatura"); }
;
context_mod_list:
/* */ { $$ = SCM_EOL; }
| context_mod_list context_mod {
- $$ = scm_cons ($2, $1);
+ $$ = gh_cons ($2, $1);
}
;
-
Composite_music:
- Prefix_composite_music { $$ = $1; }
- | Grouped_music_list { $$ = $1; }
- ;
-
-Grouped_music_list:
- Simultaneous_music { $$ = $1; }
- | Sequential_music { $$ = $1; }
- ;
-
-Generic_prefix_music_scm:
- MUSIC_FUNCTION {
- $$ = scm_list_2 ($1, make_input (THIS->here_input ()));
- }
- | MUSIC_FUNCTION_SCM {
- THIS->push_spot ();
- } embedded_scm {
- $$ = scm_list_3 ($1, make_input (THIS->pop_spot ()), $3);
+ AUTOCHANGE Music {
+ SCM proc = ly_scheme_function ("make-autochange-music");
+
+ SCM res = scm_call_1 (proc, $2->self_scm ());
+ scm_gc_unprotect_object ($2->self_scm ());
+ $$ = unsmob_music (res);
+ scm_gc_protect_object (res);
+ $$->set_spot (THIS->here_input ());
}
- | MUSIC_FUNCTION_MUSIC {
- THIS->push_spot ();
- } Music {
- $$ = scm_list_3 ($1, make_input (THIS->pop_spot ()), $3->self_scm ());
+ | PARTCOMBINE Music Music {
+ SCM proc = ly_scheme_function ("make-part-combine-music");
+
+ SCM res = scm_call_1 (proc, gh_list ($2->self_scm (),
+ $3->self_scm (), SCM_UNDEFINED));
scm_gc_unprotect_object ($3->self_scm ());
+ scm_gc_unprotect_object ($2->self_scm ());
+ $$ = unsmob_music (res);
+ scm_gc_protect_object (res);
+ $$->set_spot (THIS->here_input ());
}
- | MUSIC_FUNCTION_SCM_MUSIC {
- THIS->push_spot ();
- } embedded_scm Music {
- $$ = scm_list_4 ($1, make_input (THIS->pop_spot ()), $3, $4->self_scm ());
- scm_gc_unprotect_object ($4->self_scm ());
- }
- | MUSIC_FUNCTION_MUSIC_MUSIC {
- THIS->push_spot ();
- } Music Music {
- $$ = scm_list_4 ($1, make_input (THIS->pop_spot ()), $3->self_scm (), $4->self_scm ());
- scm_gc_unprotect_object ($3->self_scm ());
- scm_gc_unprotect_object ($4->self_scm ());
- }
- | MUSIC_FUNCTION_SCM_MUSIC_MUSIC {
- THIS->push_spot ();
- } embedded_scm Music Music {
- $$ = scm_list_5 ($1, make_input (THIS->pop_spot ()),
- $3, $4->self_scm (), $5->self_scm ());
- scm_gc_unprotect_object ($5->self_scm ());
- scm_gc_unprotect_object ($4->self_scm ());
- }
- ;
-
-Generic_prefix_music:
- Generic_prefix_music_scm {
- SCM func = ly_car ($1);
- Input *loc = unsmob_input (ly_cadr ($1));
- SCM args = ly_cddr ($1);
- SCM sig = scm_object_property (func, ly_symbol2scm ("music-function-signature"));
- int k = 0;
- bool ok = true;
- for (SCM s = sig, t = args;
- ok && ly_c_pair_p (s) && ly_c_pair_p (t);
- s = ly_cdr (s), t = ly_cdr (t)) {
- k++;
- if (scm_call_1 (ly_car (s), ly_car (t)) != SCM_BOOL_T)
- {
- loc->error (_f ("Argument %d failed typecheck", k));
- THIS->error_level_ = 1;
- ok = false;
- }
+ | grace_head Music {
+#if 1
+ /*
+ The other version is for easier debugging of
+ Sequential_music_iterator in combination with grace notes.
+ */
+
+/*
+
+TODO: should distinguish between both grace types in the
+basic music objects too, since the meaning is different.
+
+*/
+
+ String start_str = "start" + ly_scm2string ($1) + "Music";
+ String stop_str = "stop" + ly_scm2string ($1) + "Music";
+
+ SCM start = THIS->lexer_->lookup_identifier (start_str);
+ SCM stop = THIS->lexer_->lookup_identifier (stop_str);
+
+ Music *startm = unsmob_music (start);
+ Music *stopm = unsmob_music (stop);
+
+ SCM ms = SCM_EOL;
+ if (stopm) {
+ stopm = stopm->clone ();
+ ms = scm_cons (stopm->self_scm (), ms);
+ scm_gc_unprotect_object (stopm->self_scm ());
+ }
+ ms = scm_cons ($2->self_scm (), ms);
+ scm_gc_unprotect_object ($2->self_scm ());
+ if (startm) {
+ startm = startm->clone ();
+ ms = scm_cons (startm->self_scm (), ms);
+ scm_gc_unprotect_object (startm->self_scm ());
}
- SCM m = SCM_EOL;
- if (ok)
- m = scm_apply_0 (func, ly_cdr ($1));
- if (unsmob_music (m))
- {
- $$ = unsmob_music (m);
- scm_gc_protect_object (m);
- }
- else
- {
- if (ok)
- loc->error (_ ("Music head function should return Music object."));
- $$ = MY_MAKE_MUSIC ("Music");
- }
- $$->set_spot (*loc);
- }
- ;
+ Music* seq = MY_MAKE_MUSIC ("SequentialMusic");
+ seq->set_property ("elements", ms);
-Prefix_composite_music:
- Generic_prefix_music {
- $$ = $1;
+
+ $$ = MY_MAKE_MUSIC ("GraceMusic");
+ $$->set_property ("element", seq->self_scm ());
+ scm_gc_unprotect_object (seq->self_scm ());
+#else
+ $$ = MY_MAKE_MUSIC ("GraceMusic");
+ $$->set_property ("element", $2->self_scm ());
+ scm_gc_unprotect_object ($2->self_scm ());
+#endif
}
- | CONTEXT simple_string '=' simple_string optional_context_mod Music {
+ | CONTEXT string '=' string optional_context_mod Music {
$$ = context_spec_music ($2, $4, $6, $5);
}
- | CONTEXT simple_string optional_context_mod Music {
+ | CONTEXT STRING optional_context_mod Music {
$$ = context_spec_music ($2, SCM_UNDEFINED, $4, $3);
}
- | NEWCONTEXT simple_string optional_context_mod Music {
- $$ = context_spec_music ($2, get_next_unique_context (), $4,
- $3);
+ | NEWCONTEXT string optional_context_mod Music {
+ $$ = context_spec_music ($2, get_next_unique_context (),
+ $4, $3);
}
| TIMES {
fraction Music
{
- int n = ly_scm2int (ly_car ($3)); int d = ly_scm2int (ly_cdr ($3));
+ int n = gh_scm2int (ly_car ($3)); int d = gh_scm2int (ly_cdr ($3));
Music *mp = $4;
$$= MY_MAKE_MUSIC ("TimeScaledMusic");
$$->set_property ("element", mp->self_scm ());
scm_gc_unprotect_object (mp->self_scm ());
- $$->set_property ("numerator", scm_int2num (n));
- $$->set_property ("denominator", scm_int2num (d));
+ $$->set_property ("numerator", gh_int2scm (n));
+ $$->set_property ("denominator", gh_int2scm (d));
$$->compress (Moment (Rational (n,d)));
}
| Repeated_music { $$ = $1; }
+ | Simultaneous_music { $$ = $1; }
+ | Sequential_music { $$ = $1; }
| TRANSPOSE pitch_also_in_chords pitch_also_in_chords Music {
$$ = MY_MAKE_MUSIC ("TransposedMusic");
Music *p = $4;
$$->set_property ("element", p->self_scm ());
scm_gc_unprotect_object (p->self_scm ());
}
+ | APPLY embedded_scm Music {
+ if (!ly_input_procedure_p ($2))
+ {
+ THIS->parser_error (_ ("\\apply takes function argument"));
+ $$ = $3;
+ }
+ else
+ {
+ SCM ret = gh_call1 ($2, $3->self_scm ());
+ Music *m = unsmob_music (ret);
+ if (!m) {
+ THIS->parser_error ("\\apply must return a Music");
+ m = MY_MAKE_MUSIC ("Music");
+ }
+ $$ = m;
+ }
+ }
| NOTES
{
SCM nn = THIS->lexer_->lookup_identifier ("pitchnames");
SCM nn = THIS->lexer_->lookup_identifier ("drumPitchNames");
THIS->lexer_->push_note_state (alist_to_hashq (nn));
}
- /* FIXME: This used to be: */
Music
-/* Grouped_music_list */
{ $$ = $3;
THIS->lexer_->pop_state ();
}
| FIGURES
{ THIS->lexer_->push_figuredbass_state (); }
- /* FIXME: This used to be:
Music
- but that breaks web build
- */
- Grouped_music_list
{
Music *chm = MY_MAKE_MUSIC ("UntransposableMusic");
chm->set_property ("element", $3->self_scm ());
nn = THIS->lexer_->lookup_identifier ("pitchnames");
THIS->lexer_->push_chord_state (alist_to_hashq (nn));
- }
- /* FIXME:
- Music
-*/
- Grouped_music_list
- {
+ } Music {
Music *chm = MY_MAKE_MUSIC ("UnrelativableMusic");
chm->set_property ("element", $3->self_scm ());
scm_gc_unprotect_object ($3->self_scm ());
}
| LYRICS
{ THIS->lexer_->push_lyric_state (); }
- /* FIXME:
Music
-*/
- Grouped_music_list
{
$$ = $3;
THIS->lexer_->pop_state ();
relative_music:
RELATIVE absolute_pitch Music {
- Music *m = $3;
- Pitch start = *unsmob_pitch ($2);
- $$ = make_music_relative (start, m);
- scm_gc_unprotect_object (m->self_scm ());
- }
- | RELATIVE Composite_music {
- Music *m = $2;
+ Music *p = $3;
+ Pitch pit = *unsmob_pitch ($2);
+ $$ = MY_MAKE_MUSIC ("RelativeOctaveMusic");
- Pitch middle_c (0, 0, 0);
- $$ = make_music_relative (middle_c, m);
- scm_gc_unprotect_object (m->self_scm ());
- }
- ;
+ $$->set_property ("element", p->self_scm ());
+ scm_gc_unprotect_object (p->self_scm ());
-new_lyrics:
- NEWLYRICS { THIS->lexer_->push_lyric_state (); }
- /*cont */
- Grouped_music_list {
- /* Can also use Music at the expensive of two S/Rs similar to
- \repeat \alternative */
- THIS->lexer_->pop_state ();
-#if 0
- Music *music = MY_MAKE_MUSIC ("SimultaneousMusic");
- music->set_property ("elements", scm_list_1 ($3->self_scm ()));
- $$ = music;
-#else
- $$ = scm_cons ($3->self_scm (), SCM_EOL);
-#endif
- }
- | new_lyrics NEWLYRICS { THIS->lexer_->push_lyric_state (); }
- Grouped_music_list {
- THIS->lexer_->pop_state ();
- $$ = scm_cons ($4->self_scm (), $1);
+
+ Pitch retpitch = p->to_relative_octave (pit);
+ if (lily_1_8_relative)
+ $$->set_property ("last-pitch", retpitch.smobbed_copy ());
}
;
re_rhythmed_music:
- Grouped_music_list new_lyrics {
-
- /* FIXME: should find out uniqueXXX name from music */
- SCM name = $1->get_property ("context-id");
- //if (name == SCM_EOL)
- if (!ly_c_string_p (name))
- name = scm_makfrom0str ("");
-
- SCM context = scm_makfrom0str ("Lyrics");
- Music *all = MY_MAKE_MUSIC ("SimultaneousMusic");
-
- SCM lst = SCM_EOL;
- for (SCM s = $2; ly_c_pair_p (s); s = ly_cdr (s))
- {
- Music *music = unsmob_music (ly_car (s));
- Music *com = make_lyric_combine_music (name, music);
- Music *csm = context_spec_music (context,
- get_next_unique_context (), com, SCM_EOL);
- lst = scm_cons (csm->self_scm (), lst);
- }
- /* FIXME: only first lyric music is accepted,
- the rest is junked */
- all->set_property ("elements", scm_cons ($1->self_scm (),
- lst));
- $$ = all;
- scm_gc_unprotect_object ($1->self_scm ());
+ ADDLYRICS Music Music {
+ Music *l = MY_MAKE_MUSIC ("LyricCombineMusic");
+ l->set_property ("elements", gh_list ($2->self_scm (), $3->self_scm (), SCM_UNDEFINED));
+ scm_gc_unprotect_object ($3->self_scm ());
+ scm_gc_unprotect_object ($2->self_scm ());
+ $$ = l;
}
- | LYRICSTO string Music {
- Music *music = $3;
- SCM name = $2;
- $$ = make_lyric_combine_music (name, music);
- scm_gc_unprotect_object (music->self_scm ());
+ | NEWADDLYRICS string Music {
+ Music *l = MY_MAKE_MUSIC ("NewLyricCombineMusic");
+ l->set_property ("element", $3->self_scm ());
+ scm_gc_unprotect_object ($3->self_scm ());
+ $$ = l;
+ l->set_property ("associated-context", $2);
}
;
;
property_operation:
- STRING '=' scalar {
+ STRING '=' scalar {
$$ = scm_list_3 (ly_symbol2scm ("assign"),
scm_string_to_symbol ($1), $3);
}
- | UNSET simple_string {
+ | UNSET STRING {
$$ = scm_list_2 (ly_symbol2scm ("unset"),
scm_string_to_symbol ($2));
}
- | OVERRIDE simple_string embedded_scm '=' embedded_scm {
+ | OVERRIDE STRING embedded_scm '=' embedded_scm {
$$ = scm_list_4 (ly_symbol2scm ("push"),
scm_string_to_symbol ($2), $3, $5);
}
- | REVERT simple_string embedded_scm {
+ | REVERT STRING embedded_scm {
$$ = scm_list_3 (ly_symbol2scm ("pop"),
scm_string_to_symbol ($2), $3);
}
;
context_prop_spec:
- simple_string {
- $$ = scm_list_2 (ly_symbol2scm ("Bottom"),
- scm_string_to_symbol ($1));
+ STRING {
+ $$ = scm_list_2 (ly_symbol2scm ("Bottom"), scm_string_to_symbol ($1));
}
- | simple_string '.' simple_string {
- $$ = scm_list_2 (scm_string_to_symbol ($1),
- scm_string_to_symbol ($3));
+ | STRING '.' STRING {
+ $$ = scm_list_2 (scm_string_to_symbol ($1), scm_string_to_symbol ($3));
}
;
OVERRIDE context_prop_spec embedded_scm '=' scalar {
$$ = property_op_to_music (scm_list_4 (
ly_symbol2scm ("poppush"),
- ly_cadr ($2),
+ gh_cadr ($2),
$3, $5));
- $$= context_spec_music (ly_car ($2), SCM_UNDEFINED, $$, SCM_EOL);
+ $$= context_spec_music (gh_car ($2), SCM_UNDEFINED, $$, SCM_EOL);
}
| REVERT context_prop_spec embedded_scm {
$$ = property_op_to_music (scm_list_3 (
ly_symbol2scm ("pop"),
- ly_cadr ($2),
+ gh_cadr ($2),
$3));
- $$= context_spec_music (ly_car ($2), SCM_UNDEFINED, $$, SCM_EOL);
+ $$= context_spec_music (gh_car ($2), SCM_UNDEFINED, $$, SCM_EOL);
}
| SET context_prop_spec '=' scalar {
$$ = property_op_to_music (scm_list_3 (
ly_symbol2scm ("assign"),
- ly_cadr ($2),
+ gh_cadr ($2),
$4));
- $$= context_spec_music (ly_car ($2), SCM_UNDEFINED, $$, SCM_EOL);
+ $$= context_spec_music (gh_car ($2), SCM_UNDEFINED, $$, SCM_EOL);
}
| UNSET context_prop_spec {
$$ = property_op_to_music (scm_list_2 (
ly_symbol2scm ("unset"),
- ly_cadr ($2)));
- $$= context_spec_music (ly_car ($2), SCM_UNDEFINED, $$, SCM_EOL);
+ gh_cadr ($2)));
+ $$= context_spec_music (gh_car ($2), SCM_UNDEFINED, $$, SCM_EOL);
}
| ONCE music_property_def {
SCM e = $2->get_property ("element");
;
-string:
- STRING {
- $$ = $1;
- }
- | STRING_IDENTIFIER {
- $$ = $1;
- }
- | string '+' string {
- $$ = scm_string_append (scm_list_2 ($1, $3));
- }
- ;
-
-simple_string: STRING {
- }
- | LYRICS_STRING {
- }
- ;
-scalar: string {
- }
- | LYRICS_STRING {
- }
- | bare_int {
- $$ = scm_int2num ($1);
- }
- | embedded_scm {
- }
- | full_markup {
- }
- | DIGIT {
- $$ = scm_int2num ($1);
- }
+scalar:
+ string { $$ = $1; }
+ | bare_int { $$ = gh_int2scm ($1); }
+ | embedded_scm { $$ = $1; }
+ | full_markup { $$ = $1; }
+ | DIGIT { $$ = gh_int2scm ($1); }
;
/*
-FIXME: remove or fix this comment. What is `This'?
-
This is a trick:
Adding pre_events to the simple_element
pre_events simple_element post_events {
SCM elts = $2-> get_property ("elements");
- elts = ly_append2 (elts, scm_reverse_x ($3, SCM_EOL));
+ elts = gh_append2 (elts, scm_reverse_x ($3, SCM_EOL));
$2->set_property ("elements", elts);
$$ = $2;
SCM es = $1->get_property ("elements");
SCM postevs = scm_reverse_x ($3, SCM_EOL);
- for (SCM s = es; ly_c_pair_p (s); s = ly_cdr (s))
- unsmob_music (ly_car (s))->set_property ("duration", dur);
- es = ly_append2 (es, postevs);
+ for (SCM s = es; gh_pair_p (s); s = gh_cdr (s))
+ unsmob_music (gh_car (s))->set_property ("duration", dur);
+ es = gh_append2 (es, postevs);
$1-> set_property ("elements", es);
$$ = $1;
chord_close: '>'
;
-simul_open: DOUBLE_ANGLE_OPEN
+simul_open: LESSLESS
;
-simul_close: DOUBLE_ANGLE_CLOSE
+simul_close: MOREMORE
;
chord_body:
chord_body_elements:
/* empty */ { $$ = SCM_EOL; }
| chord_body_elements chord_body_element {
- $$ = scm_cons ($2->self_scm (), $1);
+ $$ = gh_cons ($2->self_scm (), $1);
scm_gc_unprotect_object ($2->self_scm ());
}
;
if ($2 % 2 || $3 % 2)
n->set_property ("force-accidental", SCM_BOOL_T);
- if (ly_c_pair_p ($4)) {
+ if (gh_pair_p ($4)) {
SCM arts = scm_reverse_x ($4, SCM_EOL);
n->set_property ("articulations", arts);
}
n->set_property ("drum-type", $1);
n->set_spot (THIS->here_input ());
- if (ly_c_pair_p ($2)) {
+ if (gh_pair_p ($2)) {
SCM arts = scm_reverse_x ($2, SCM_EOL);
n->set_property ("articulations", arts);
}
evs = scm_hash_ref (tab, key, SCM_BOOL_F);
}
Music *quote = 0;
- if (ly_c_vector_p (evs))
+ if (gh_vector_p (evs))
{
quote = MY_MAKE_MUSIC ("QuoteMusic");
quote->set_property ("duration", $3);
}
| OCTAVE { THIS->push_spot (); }
pitch {
- Music *m = MY_MAKE_MUSIC ("RelativeOctaveCheck");
- $$ = m;
+ Music *l = MY_MAKE_MUSIC ("RelativeOctaveCheck");
+ $$ = l;
$$->set_spot (THIS->pop_spot ());
$$->set_property ("pitch", $3);
}
| E_LEFTSQUARE {
- Music *m = MY_MAKE_MUSIC ("LigatureEvent");
- m->set_property ("span-direction", scm_int2num (START));
- m->set_spot (THIS->here_input ());
+ Music *l = MY_MAKE_MUSIC ("LigatureEvent");
+ l->set_property ("span-direction", gh_int2scm (START));
+ l->set_spot (THIS->here_input ());
$$ = MY_MAKE_MUSIC ("EventChord");
- $$->set_property ("elements", scm_cons (m->self_scm (), SCM_EOL));
- scm_gc_unprotect_object (m->self_scm ());
+ $$->set_property ("elements", scm_cons (l->self_scm (), SCM_EOL));
+ scm_gc_unprotect_object (l->self_scm ());
$$->set_spot (THIS->here_input ());
}
| E_RIGHTSQUARE {
- Music *m = MY_MAKE_MUSIC ("LigatureEvent");
- m->set_property ("span-direction", scm_int2num (STOP));
- m->set_spot (THIS->here_input ());
+ Music *l = MY_MAKE_MUSIC ("LigatureEvent");
+ l->set_property ("span-direction", gh_int2scm (STOP));
+ l->set_spot (THIS->here_input ());
$$ = MY_MAKE_MUSIC ("EventChord");
- $$->set_property ("elements", scm_cons (m->self_scm (), SCM_EOL));
+ $$->set_property ("elements", scm_cons (l->self_scm (), SCM_EOL));
$$->set_spot (THIS->here_input ());
- scm_gc_unprotect_object (m->self_scm ());
+ scm_gc_unprotect_object (l->self_scm ());
}
| E_BACKSLASH {
$$ = MY_MAKE_MUSIC ("VoiceSeparator");
$$->set_spot (THIS->here_input ());
}
| '|' {
- SCM pipe =THIS->lexer_->lookup_identifier ("pipeSymbol");
-
- if (Music * m = unsmob_music (pipe))
- $$ = m->clone ();
- else
- $$ = MY_MAKE_MUSIC ("BarCheck");
+ $$ = MY_MAKE_MUSIC ("BarCheck");
$$->set_spot (THIS->here_input ());
}
| TRANSPOSITION pitch {
| TIME_T fraction {
SCM proc= ly_scheme_function ("make-time-signature-set");
- SCM result = scm_apply_2 (proc, ly_car ($2), ly_cdr ($2), SCM_EOL);
+ SCM result = scm_apply_2 (proc, gh_car ($2), gh_cdr ($2), SCM_EOL);
scm_gc_protect_object (result);
$$ = unsmob_music (result);
}
;
command_req:
- E_TILDE {
+ BREATHE {
+ $$ = MY_MAKE_MUSIC ("BreathingSignEvent");
+ }
+ | E_TILDE {
$$ = MY_MAKE_MUSIC ("PesOrFlexaEvent");
}
| MARK DEFAULT {
}
| post_events post_event {
$2->set_spot (THIS->here_input ());
- $$ = scm_cons ($2->self_scm (), $$);
+ $$ = gh_cons ($2->self_scm (), $$);
scm_gc_unprotect_object ($2->self_scm ());
}
| post_events tagged_post_event {
}
| script_dir direction_reqd_event {
if ($1)
- $2->set_property ("direction", scm_int2num ($1));
+ $2->set_property ("direction", gh_int2scm ($1));
$$ = $2;
}
| script_dir direction_less_event {
if ($1)
- $2->set_property ("direction", scm_int2num ($1));
+ $2->set_property ("direction", gh_int2scm ($1));
$$ = $2;
}
| string_number_event
string_number_event:
E_UNSIGNED {
Music *s = MY_MAKE_MUSIC ("StringNumberEvent");
- s->set_property ("string-number", scm_int2num ($1));
+ s->set_property ("string-number", gh_int2scm ($1));
s->set_spot (THIS->here_input ());
$$ = s;
}
*/
Music *m = MY_MAKE_MUSIC ("BeamEvent");
m->set_spot (THIS->here_input ());
- m->set_property ("span-direction", scm_int2num (START));
+ m->set_property ("span-direction", gh_int2scm (START));
$$ = m;
}
| ']' {
Music *m = MY_MAKE_MUSIC ("BeamEvent");
m->set_spot (THIS->here_input ());
- m->set_property ("span-direction", scm_int2num (STOP));
+ m->set_property ("span-direction", gh_int2scm (STOP));
$$ = m;
}
| '~' {
| close_event {
$$ = $1;
dynamic_cast<Music *> ($$)->set_property ("span-direction",
- scm_int2num (START));
+ gh_int2scm (START));
}
| open_event {
$$ = $1;
dynamic_cast<Music *> ($$)->set_property ("span-direction",
- scm_int2num (STOP));
+ gh_int2scm (STOP));
}
| EVENT_IDENTIFIER {
$$ = unsmob_music ($1);
| tremolo_type {
Music *a = MY_MAKE_MUSIC ("TremoloEvent");
a->set_spot (THIS->here_input ());
- a->set_property ("tremolo-type", scm_int2num ($1));
+ a->set_property ("tremolo-type", gh_int2scm ($1));
$$ = a;
}
;
| script_abbreviation {
SCM s = THIS->lexer_->lookup_identifier ("dash" + ly_scm2string ($1));
Music *a = MY_MAKE_MUSIC ("ArticulationEvent");
- if (ly_c_string_p (s))
+ if (gh_string_p (s))
a->set_property ("articulation-type", s);
else THIS->parser_error (_ ("Expecting string as script definition"));
$$ = a;
}
;
-octave_check:
+oct_check:
/**/ { $$ = SCM_EOL; }
- | '=' { $$ = scm_int2num (0); }
- | '=' sub_quotes { $$ = scm_int2num ($2); }
- | '=' sup_quotes { $$ = scm_int2num ($2); }
+ | '=' { $$ = gh_int2scm (0); }
+ | '=' sub_quotes { $$ = gh_int2scm ($2); }
+ | '=' sup_quotes { $$ = gh_int2scm ($2); }
;
sup_quotes:
| E_CLOSE {
Music *s= MY_MAKE_MUSIC ("PhrasingSlurEvent");
$$ = s;
- s->set_property ("span-type",
- scm_makfrom0str ("phrasing-slur"));
+ s->set_property ("span-type", scm_makfrom0str ( "phrasing-slur"));
s->set_spot (THIS->here_input ());
}
;
}
| string {
Music *t = MY_MAKE_MUSIC ("TextScriptEvent");
- t->set_property ("text",
- make_simple_markup (THIS->lexer_->encoding (), $1));
+ t->set_property ("text", make_simple_markup ($1));
t->set_spot (THIS->here_input ());
$$ = t;
}
| DIGIT {
Music *t = MY_MAKE_MUSIC ("FingerEvent");
- t->set_property ("digit", scm_int2num ($1));
+ t->set_property ("digit", gh_int2scm ($1));
t->set_spot (THIS->here_input ());
$$ = t;
}
steno_duration:
bare_unsigned dots {
int len = 0;
- if (!is_duration ($1))
+ if (!is_is_duration ($1))
THIS->parser_error (_f ("not a duration: %d", $1));
else
len = intlog2 ($1);
}
;
+
+
+
multiplied_duration:
steno_duration {
$$ = $1;
$$ = unsmob_duration ($$)->compressed ( $3) .smobbed_copy ();
}
| multiplied_duration '*' FRACTION {
- Rational m (ly_scm2int (ly_car ($3)), ly_scm2int (ly_cdr ($3)));
+ Rational m (gh_scm2int (ly_car ($3)), gh_scm2int (ly_cdr ($3)));
$$ = unsmob_duration ($$)->compressed (m).smobbed_copy ();
}
fraction:
FRACTION { $$ = $1; }
| UNSIGNED '/' UNSIGNED {
- $$ = scm_cons (scm_int2num ($1), scm_int2num ($3));
+ $$ = scm_cons (gh_int2scm ($1), gh_int2scm ($3));
}
;
}
;
+
tremolo_type:
':' {
$$ = 0;
}
| ':' bare_unsigned {
- if (!is_duration ($2))
+ if (!is_is_duration ($2))
THIS->parser_error (_f ("not a duration: %d", $2));
$$ = $2;
}
;
+
+
+/*****************************************************************
+ BASS FIGURES
+*****************************************************************/
bass_number:
DIGIT {
- $$ = scm_number_to_string (scm_int2num ($1), scm_int2num (10));
- $$ = scm_list_2 (ly_scheme_function ("number-markup"),
- $$);
+ $$ = scm_number_to_string (gh_int2scm ($1), gh_int2scm (10));
}
| UNSIGNED {
- $$ = scm_number_to_string (scm_int2num ($1), scm_int2num (10));
- $$ = scm_list_2 (ly_scheme_function ("number-markup"),
- $$);
+ $$ = scm_number_to_string (gh_int2scm ($1), gh_int2scm (10));
}
| STRING { $$ = $1; }
;
Music *m = unsmob_music ($1);
if ($2) {
SCM salter = m->get_property ("alteration");
- int alter = ly_c_number_p (salter) ? ly_scm2int (salter) : 0;
+ int alter = gh_number_p (salter) ? gh_scm2int (salter) : 0;
m->set_property ("alteration",
- scm_int2num (alter + $2));
+ gh_int2scm (alter + $2));
} else {
- m->set_property ("alteration", scm_int2num (0));
+ m->set_property ("alteration", gh_int2scm (0));
}
}
;
;
simple_element:
- pitch exclamations questions octave_check optional_notemode_duration optional_rest {
+ pitch exclamations questions oct_check optional_notemode_duration optional_rest {
Input i = THIS->pop_spot ();
if (!THIS->lexer_->is_note_state ())
n->set_property ("pitch", $1);
n->set_property ("duration", $5);
- if (ly_c_number_p ($4))
+ if (gh_number_p ($4))
{
- int q = ly_scm2int ($4);
- n->set_property ("absolute-octave", scm_int2num (q-1));
+ int q = gh_scm2int ($4);
+ n->set_property ("absolute-octave", gh_int2scm (q-1));
}
if ($3 % 2)
Music *m = unsmob_music ($1);
Input i = THIS->pop_spot ();
m->set_spot (i);
- for (SCM s = m->get_property ("elements"); ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = m->get_property ("elements"); gh_pair_p (s); s = ly_cdr (s))
{
unsmob_music (ly_car (s))->set_property ("duration", $2);
}
;
lyric_element:
- /* FIXME: lyric flavoured markup would be better */
- full_markup {
- }
- | LYRICS_STRING {
- }
+ full_markup { $$ = $1; }
+ | STRING { $$ = $1; }
;
new_chord:
}
| steno_tonic_pitch optional_notemode_duration chord_separator chord_items {
SCM its = scm_reverse_x ($4, SCM_EOL);
- $$ = make_chord ($1, $2, scm_cons ($3, its));
+ $$ = make_chord ($1, $2, gh_cons ($3, its));
}
;
$$ = SCM_EOL;
}
| chord_items chord_item {
- $$ = scm_cons ($2, $$);
+ $$ = gh_cons ($2, $$);
}
;
;
step_numbers:
- step_number { $$ = scm_cons ($1, SCM_EOL); }
+ step_number { $$ = gh_cons ($1, SCM_EOL); }
| step_numbers '.' step_number {
- $$ = scm_cons ($3, $$);
+ $$ = gh_cons ($3, $$);
}
;
bare_number:
UNSIGNED {
- $$ = scm_int2num ($1);
+ $$ = gh_int2scm ($1);
}
| REAL {
$$ = $1;
$$ = $1;
}
| REAL NUMBER_IDENTIFIER {
- $$ = scm_make_real (ly_scm2double ($1) *ly_scm2double ($2));
+ $$ = gh_double2scm (gh_scm2double ($1) *gh_scm2double ($2));
}
| UNSIGNED NUMBER_IDENTIFIER {
- $$ = scm_make_real ($1 *ly_scm2double ($2));
+ $$ = gh_double2scm ($1 *gh_scm2double ($2));
}
;
bare_number {
if (scm_integer_p ($1) == SCM_BOOL_T)
{
- int k = ly_scm2int ($1);
+ int k = gh_scm2int ($1);
$$ = k;
} else
{
}
;
+
+string:
+ STRING {
+ $$ = $1;
+ }
+ | STRING_IDENTIFIER {
+ $$ = $1;
+ }
+ | string '+' string {
+ $$ = scm_string_append (scm_list_2 ($1, $3));
+ }
+ ;
+
+
exclamations:
{ $$ = 0; }
| exclamations '!' { $$ ++; }
*/
markup:
STRING {
- $$ = make_simple_markup (THIS->lexer_->encoding (), $1);
+ $$ = make_simple_markup ($1);
}
| MARKUP_HEAD_EMPTY {
$$ = scm_list_1 ($1);
| STRING_IDENTIFIER {
$$ = $1;
}
- | SCORE {
- SCM nn = THIS->lexer_->lookup_identifier ("pitchnames");
- THIS->lexer_->push_note_state (alist_to_hashq (nn));
- } '{' score_body '}' {
- Score * sc = $4;
- $$ = scm_list_2 (ly_scheme_function ("score-markup"), sc->self_scm ());
- scm_gc_unprotect_object (sc->self_scm ());
- THIS->lexer_->pop_state ();
- }
;
markup_list:
markup_list_body:
/**/ { $$ = SCM_EOL; }
| markup_list_body markup {
- $$ = scm_cons ($2, $1);
+ $$ = gh_cons ($2, $1);
}
;
#endif
}
+extern My_lily_parser *current_parser;
+
void
My_lily_parser::do_yyparse ()
{
+ current_parser = this;;
yyparse ((void*)this);
}
int
My_lily_lexer::try_special_identifiers (SCM *destination, SCM sid)
{
- if (ly_c_string_p (sid)) {
+ if (gh_string_p (sid)) {
*destination = sid;
return STRING_IDENTIFIER;
- } else if (ly_c_number_p (sid)) {
+ } else if (gh_number_p (sid)) {
*destination = sid;
return NUMBER_IDENTIFIER;
} else if (unsmob_context_def (sid)) {
*destination = unsmob_context_def (sid)->clone_scm ();
return CONTEXT_DEF_IDENTIFIER;
} else if (unsmob_score (sid)) {
- Score *score = new Score (*unsmob_score (sid));
- *destination = score->self_scm ();
+ Score *sc = new Score (*unsmob_score (sid));
+ *destination = sc->self_scm ();
return SCORE_IDENTIFIER;
} else if (Music *mus = unsmob_music (sid)) {
mus = mus->clone ();
} else if (unsmob_duration (sid)) {
*destination = unsmob_duration (sid)->smobbed_copy ();
return DURATION_IDENTIFIER;
- } else if (unsmob_output_def (sid)) {
- Output_def *p = unsmob_output_def (sid);
+ } else if (unsmob_music_output_def (sid)) {
+ Music_output_def *p = unsmob_music_output_def (sid);
p = p->clone ();
*destination = p->self_scm ();
- return OUTPUT_DEF_IDENTIFIER;
+ return MUSIC_OUTPUT_DEF_IDENTIFIER;
} else if (Text_item::markup_p (sid)) {
*destination = sid;
return MARKUP_IDENTIFIER;
property_op_to_music (SCM op)
{
Music *m = 0;
- SCM tag = ly_car (op);
- SCM symbol = ly_cadr (op);
- SCM args = ly_cddr (op);
+ SCM tag = gh_car (op);
+ SCM symbol = gh_cadr (op);
+ SCM args = gh_cddr (op);
SCM grob_val = SCM_UNDEFINED;
SCM grob_sym = SCM_UNDEFINED;
SCM val = SCM_UNDEFINED;
if (tag == ly_symbol2scm ("assign"))
{
m = MY_MAKE_MUSIC ("PropertySet");
- val = ly_car (args);
+ val = gh_car (args);
}
else if (tag == ly_symbol2scm ("unset"))
m = MY_MAKE_MUSIC ("PropertyUnset");
|| tag == ly_symbol2scm ("push"))
{
m = MY_MAKE_MUSIC ("OverrideProperty");
- grob_sym = ly_car (args);
- grob_val = ly_cadr (args);
+ grob_sym = gh_car (args);
+ grob_val = gh_cadr (args);
}
else if (tag == ly_symbol2scm ("pop")) {
m = MY_MAKE_MUSIC ("RevertProperty");
- grob_sym = ly_car (args);
+ grob_sym = gh_car (args);
}
m->set_property ("symbol", symbol);
bool itc = internal_type_checking_global_b;
/* UGH.
*/
- bool autobeam = ly_c_equal_p (symbol, ly_symbol2scm ("autoBeamSettings"));
+ bool autobeam = gh_equal_p (symbol, ly_symbol2scm ("autoBeamSettings"));
if (autobeam)
internal_type_checking_global_b = false;
m->set_property ("grob-property", grob_sym);
internal_type_checking_global_b = itc;
}
- if (tag == ly_symbol2scm ("poppush"))
+ if (op == ly_symbol2scm ("poppush"))
m->set_property ("pop-first", SCM_BOOL_T);
scm_gc_unprotect_object (m->self_scm ());
csm->set_property ("context-type",
- ly_c_symbol_p (type) ? type : scm_string_to_symbol (type));
+ gh_symbol_p (type) ? type : scm_string_to_symbol (type));
csm->set_property ("property-operations", ops);
- if (ly_c_string_p (id))
+ if (gh_string_p (id))
csm->set_property ("context-id", id);
return csm;
}
+
SCM
get_next_unique_context ()
{
static int new_context_count;
+
char s[1024];
- snprintf (s, 1024, "uniqueContext%d", new_context_count++);
+ snprintf (s, 1024, "uniqueContext%d", new_context_count ++);
+
return scm_makfrom0str (s);
}
if (Text_item::markup_p (text))
{
- text_ = make_item ("CombineTextScript", event_->self_scm () );
+ text_ = make_item ("CombineTextScript");
text_->set_property ("text", text);
+ announce_grob (text_, event_->self_scm ());
}
}
}
void
Part_combine_engraver::stop_translation_timestep ()
{
+ if (text_)
+ {
+ typeset_grob (text_);
text_ = 0;
+ }
event_ = 0;
}
one_.set_translator (one);
set_translator (one);
- first_iter_ = unsmob_iterator (get_iterator (unsmob_music (ly_car (lst))));
+ first_iter_ = unsmob_iterator (get_iterator (unsmob_music (gh_car (lst))));
Context *two = tr->find_create_context (ly_symbol2scm ("Voice"),
"two", props);
two_.set_translator (two);
set_translator (two);
- second_iter_ = unsmob_iterator (get_iterator (unsmob_music (ly_cadr (lst))));
+ second_iter_ = unsmob_iterator (get_iterator (unsmob_music (gh_cadr (lst))));
set_translator (tr);
{
SCM sym = ly_symbol2scm (*p);
execute_pushpop_property (one, sym,
- ly_symbol2scm ("direction"), scm_int2num (1));
+ ly_symbol2scm ("direction"), gh_int2scm (1));
execute_pushpop_property (two, sym,
- ly_symbol2scm ("direction"), scm_int2num (-1));
+ ly_symbol2scm ("direction"), gh_int2scm (-1));
}
}
Moment now = get_outlet ()->now_mom ();
Moment *splitm = 0;
- for (; ly_c_pair_p (split_list_); split_list_ = ly_cdr (split_list_))
+ for (; gh_pair_p (split_list_); split_list_ = gh_cdr (split_list_))
{
- splitm = unsmob_moment (ly_caar (split_list_));
+ splitm = unsmob_moment (gh_caar (split_list_));
if (splitm && *splitm + start_moment_ > now)
break ;
- SCM tag = ly_cdar (split_list_);
+ SCM tag = gh_cdar (split_list_);
if (tag == ly_symbol2scm ("chords"))
chords_together ();
solo1 ();
else if (tag == ly_symbol2scm ("solo2"))
solo2 ();
- else if (ly_c_symbol_p (tag))
+ else if (gh_symbol_p (tag))
{
String s = "Unknown split directive: "
- + (ly_c_symbol_p (tag) ? ly_symbol2string (tag) : String ("not a symbol"));
+ + (gh_symbol_p (tag) ? ly_symbol2string (tag) : String ("not a symbol"));
programming_error (s);
}
}
Global_context *global = get_global_context ();
- for (int i = 0; i < count; i++)
+ for (int i = 0; i < count; i++)
{
global->add_moment_to_process (next_moment_ + Moment (i) * body_length_);
-
+
/*
bars between % too.
- */
+ */
if (repeat_sign_type_ == DOUBLE_MEASURE)
global->add_moment_to_process (next_moment_ + meas_len + Moment (i) * body_length_);
-
}
-
return true;
}
{
finished_perc_ = perc_;
typeset_perc ();
- perc_ = make_spanner ("PercentRepeat", repeat_->self_scm ());
+ perc_ = make_spanner ("PercentRepeat");
SCM col =get_property ("currentCommandColumn");
perc_->set_bound (LEFT, unsmob_grob (col));
+ announce_grob (perc_, repeat_->self_scm ());
}
else if (repeat_sign_type_ == DOUBLE_MEASURE)
{
- double_percent_ = make_item ("DoublePercentRepeat", repeat_->self_scm ());
+ double_percent_ = make_item ("DoublePercentRepeat");
+ announce_grob (double_percent_, repeat_->self_scm ());
+
/*
forbid breaks on a % line. Should forbid all breaks, really.
*/
{
SCM col =get_property ("currentCommandColumn");
finished_perc_->set_bound (RIGHT, unsmob_grob (col));
+ typeset_grob (finished_perc_);
finished_perc_ = 0;
}
- double_percent_ = 0;
+ if (double_percent_)
+ {
+ typeset_grob (double_percent_);
+ double_percent_ = 0;
+ }
}
*/
#include <time.h>
-
-#include "audio-column.hh"
-#include "audio-item.hh"
-#include "audio-staff.hh"
-#include "file-name.hh"
-#include "lily-version.hh"
+#include "warn.hh"
+#include "string.hh"
+#include "string-convert.hh"
#include "main.hh"
+#include "midi-def.hh"
#include "midi-item.hh"
#include "midi-stream.hh"
+#include "audio-column.hh"
+#include "audio-item.hh"
+#include "audio-staff.hh"
#include "performance.hh"
#include "score.hh"
-#include "string-convert.hh"
-#include "string.hh"
-#include "warn.hh"
+#include "input-file-results.hh"
+#include "file-path.hh"
+#include "lily-version.hh"
#include "killing-cons.tcc"
MIDI players tend to ignore instrument settings on
channel 10, the percussion channel by default.
*/
- if (channel % 16 == 9)
+ if (channel == 9)
channel++;
*/
if (s->channel_ < 0)
{
- s->channel_ = channel % 16;
+ s->channel_ = channel <? 15;
if (channel > 15)
- warning ("MIDI channel wrapped around. Remapping modulo 16.");
+ warning ("MIDI channel wrapped around. Mapping to channel 15.");
}
s->output (midi_stream, channel++);
{
audio_staffs_.push (s);
}
+ else if (Audio_column *c = dynamic_cast<Audio_column*> (p))
+ {
+ c->performance_ = this;
+ }
audio_elem_p_list_ = new Killing_cons<Audio_element> (p, audio_elem_p_list_);
}
out = "lelie.midi";
/* Maybe a bit crude, but we had this before */
- File_name file_name (out);
- file_name.ext_ = "midi";
- out = file_name.to_string ();
+ Path p = split_path (out);
+ p.ext = "midi";
+ out = p.to_string ();
Midi_stream midi_stream (out);
progress_indication (_f ("MIDI output to `%s'...", out));
+ global_input_file->target_strings_.push (out);
+
output (midi_stream);
progress_indication ("\n");
return SCM_UNDEFINED;
{
announce_infos_.push (info);
Translator *t
- = context ()->get_parent_context ()->implementation ();
+ = unsmob_translator (daddy_context_->daddy_context_->implementation_);
if (Performer_group_performer * eg = dynamic_cast<Performer_group_performer*> (t))
eg->announce_element (info);
{
Audio_element_info info = announce_infos_[j];
- for (SCM p = get_simple_trans_list (); ly_c_pair_p (p); p = ly_cdr (p))
+ for (SCM p = get_simple_trans_list (); gh_pair_p (p); p = ly_cdr (p))
{
Translator * t = unsmob_translator (ly_car (p));
Performer * eng = dynamic_cast<Performer*> (t);
void
performer_each (SCM list, Performer_method method)
{
- for (SCM p = list; ly_c_pair_p (p); p = ly_cdr (p))
+ for (SCM p = list; gh_pair_p (p); p = ly_cdr (p))
{
Performer * e = dynamic_cast<Performer*>(unsmob_translator (ly_car (p)));
if (e)
{
// push a new phrasing_slur onto stack.
// (use temp. array to wait for all phrasing_slur STOPs)
- Grob* phrasing_slur = make_spanner ("PhrasingSlur", phrasing_slur_ev->self_scm ());
+ Grob* phrasing_slur = make_spanner ("PhrasingSlur");
Slur::set_interface (phrasing_slur); // can't remove.
if (Direction updown = to_dir (phrasing_slur_ev->get_property ("direction")))
{
- phrasing_slur->set_property ("direction", scm_int2num (updown));
+ phrasing_slur->set_property ("direction", gh_int2scm (updown));
}
start_phrasing_slurs.push (phrasing_slur);
eventses_.push (phrasing_slur_ev);
+ announce_grob (phrasing_slur, phrasing_slur_ev->self_scm ());
}
}
for (int i=0; i < start_phrasing_slurs.size (); i++)
void
Phrasing_slur_engraver::stop_translation_timestep ()
{
+ for (int i = 0; i < end_phrasing_slurs_.size (); i++)
+ {
+ typeset_grob (end_phrasing_slurs_[i]);
+ }
end_phrasing_slurs_.clear ();
}
for (Pedal_info*p = info_list_; p->name_; p ++)
{
String nm = p->name_ + String ("Event");
- if (ly_c_equal_p (m->get_property ("name") ,
- scm_str2symbol(nm.to_str0())))
+ if (gh_equal_p (m->get_property ("name") ,
+ gh_symbol2scm (nm.to_str0())))
{
Direction d = to_dir (m->get_property ("span-direction"));
p->event_drul_[d] = m;
if (!p->line_spanner_)
{
String name = String (p->name_) + "PedalLineSpanner";
- Music * rq = (p->event_drul_[START] ? p->event_drul_[START] : p->event_drul_[STOP]);
- p->line_spanner_ = make_spanner (name.to_str0 (), rq->self_scm ());
+ p->line_spanner_ = make_spanner (name.to_str0 ());
+ Music * rq = (p->event_drul_[START] ? p->event_drul_[START] : p->event_drul_[STOP]);
+ announce_grob (p->line_spanner_, rq->self_scm ());
}
/* Choose the appropriate grobs to add to the line spanner
}
}
- if (ly_c_string_p (s))
+ if (gh_string_p (s))
{
String propname = String (p->name_) + "Pedal";
- p->item_ = make_item (propname.to_str0 (), (p->event_drul_[START]
- ? p->event_drul_[START]
- : p->event_drul_[STOP])->self_scm ());
-
+ p->item_ = make_item (propname.to_str0 ());
p->item_->set_property ("text", s);
Axis_group_interface::add_element (p->line_spanner_, p->item_);
+
+ announce_grob (p->item_,
+ (p->event_drul_[START]
+ ? p->event_drul_[START]
+ : p->event_drul_[STOP])->self_scm ());
}
-
+
if (!mixed)
{
p->event_drul_[START] = 0;
if (!p->event_drul_[START])
{
SCM flare = p->bracket_->get_property ("bracket-flare");
- p->bracket_->set_property ("bracket-flare", scm_cons (ly_car (flare),
- scm_make_real (0)));
+ p->bracket_->set_property ("bracket-flare", scm_cons (gh_car (flare),
+ gh_double2scm (0)));
}
p->finished_bracket_ = p->bracket_;
p->start_ev_ = p->event_drul_[START];
p->current_bracket_ev_ = p->event_drul_[START];
- p->bracket_ = make_spanner ("PianoPedalBracket", p->event_drul_[START]->self_scm ());
+ p->bracket_ = make_spanner ("PianoPedalBracket");
/*
Set properties so that the stencil-creating function will
if (!p->finished_bracket_)
{
SCM flare = p->bracket_->get_property ("bracket-flare");
- p->bracket_->set_property ("bracket-flare", scm_cons (scm_make_real (0),ly_cdr (flare)));
+ p->bracket_->set_property ("bracket-flare", scm_cons (gh_double2scm (0),gh_cdr (flare)));
}
*/
Axis_group_interface::add_element (p->line_spanner_, p->bracket_);
+ announce_grob (p->bracket_, p->event_drul_[START]->self_scm ());
if (!p->event_drul_[STOP])
{
suicide?
*/
if (p->line_spanner_
- && !p->line_spanner_->is_live ())
+ && !p->line_spanner_->live ())
p->line_spanner_ = 0;
if (p->bracket_
- && !p->bracket_->is_live ())
+ && !p->bracket_->live ())
p->bracket_ = 0;
if (p->bracket_)
Handle suicide.
*/
if (p->finished_line_spanner_
- && !p->finished_line_spanner_->is_live ())
+ && !p->finished_line_spanner_->live ())
p->finished_line_spanner_ = 0;
if (p->finished_bracket_
- && !p->finished_bracket_->is_live ())
+ && !p->finished_bracket_->live ())
p->finished_bracket_ = 0;
if (p->item_)
{
+ typeset_grob (p->item_);
p->item_ = 0;
}
p->finished_bracket_->set_bound (RIGHT, unsmob_grob (get_property ("currentMusicalColumn")));
}
- p->finished_bracket_ = 0;
+ typeset_grob (p->finished_bracket_);
+
+ p->finished_bracket_ =0;
}
if (p->finished_line_spanner_)
p->finished_line_spanner_->set_bound (RIGHT, ci);
p->finished_line_spanner_->set_bound (LEFT, ci);
}
-
+ typeset_grob (p->finished_line_spanner_);
p->finished_line_spanner_ = 0;
}
}
for (Pedal_info*p = info_alist_; p->name_; p ++)
{
String nm = p->name_ + String ("Event");
- if (ly_c_equal_p (r->get_property ("name") ,
- scm_str2symbol (nm.to_str0())))
+ if (gh_equal_p (r->get_property ("name") ,
+ scm_makfrom0str (nm.to_str0())))
{
Direction d = to_dir (r->get_property ("span-direction"));
p->req_l_drul_[d] = r;
Pitch_squash_engraver::acknowledge_grob (Grob_info i)
{
SCM newpos = get_property ("squashedPosition");
- if (ly_c_number_p (newpos)
+ if (gh_number_p (newpos)
&& Note_head::has_interface (i.grob_))
{
i.grob_->set_property ("staff-position", newpos);
normalise ();
}
-/* FIXME: why is octave == 0 and default not middleC ? */
Pitch::Pitch ()
{
notename_ = 0;
}
/* Should add optional args. */
-LY_DEFINE (ly_make_pitch, "ly:make-pitch",
+LY_DEFINE (make_pitch, "ly:make-pitch",
3, 0, 0, (SCM octave, SCM note, SCM alter),
"@var{octave} is specified by an integer, "
"zero for the octave containing middle C. "
SCM_ASSERT_TYPE (scm_integer_p (note)== SCM_BOOL_T, note, SCM_ARG2, __FUNCTION__, "integer");
SCM_ASSERT_TYPE (scm_integer_p (alter)== SCM_BOOL_T, alter, SCM_ARG3, __FUNCTION__, "integer");
- Pitch p (ly_scm2int (octave), ly_scm2int (note), ly_scm2int (alter));
+ Pitch p (gh_scm2int (octave), gh_scm2int (note), gh_scm2int (alter));
return p.smobbed_copy ();
}
-LY_DEFINE (ly_pitch_steps, "ly:pitch-steps", 1, 0, 0,
+LY_DEFINE (pitch_steps, "ly:pitch-steps", 1, 0, 0,
(SCM p),
"Number of steps counted from middle C of the pitch @var{p}.")
{
Pitch *pp = unsmob_pitch (p);
SCM_ASSERT_TYPE (pp, p, SCM_ARG1, __FUNCTION__, "Pitch");
- return scm_int2num (pp->steps ());
+ return gh_int2scm (pp->steps ());
}
-LY_DEFINE (ly_pitch_octave, "ly:pitch-octave",
+LY_DEFINE (pitch_octave, "ly:pitch-octave",
1, 0, 0, (SCM pp),
"Extract the octave from pitch @var{p}.")
{
Pitch *p = unsmob_pitch (pp);
SCM_ASSERT_TYPE (p, pp, SCM_ARG1, __FUNCTION__, "Pitch");
int q = p->get_octave ();
- return scm_int2num (q);
+ return gh_int2scm (q);
}
-LY_DEFINE (ly_pitch_alteration, "ly:pitch-alteration",
+LY_DEFINE (pitch_alteration, "ly:pitch-alteration",
1, 0, 0, (SCM pp),
"Extract the alteration from pitch @var{p}.")
{
SCM_ASSERT_TYPE (p, pp, SCM_ARG1, __FUNCTION__, "Pitch");
int q = p->get_alteration ();
- return scm_int2num (q);
+ return gh_int2scm (q);
}
LY_DEFINE (pitch_notename, "ly:pitch-notename",
Pitch *p = unsmob_pitch (pp);
SCM_ASSERT_TYPE (p, pp, SCM_ARG1, __FUNCTION__, "Pitch");
int q = p->get_notename ();
- return scm_int2num (q);
+ return gh_int2scm (q);
}
-LY_DEFINE (ly_pitch_quartertones, "ly:pitch-quartertones",
+LY_DEFINE (ly_pitch_quartertones, "ly:pitch-quartertones",
1, 0, 0, (SCM pp),
"Calculate the number of quarter tones of @var{p} from middle C.")
{
Pitch *p = unsmob_pitch (pp);
SCM_ASSERT_TYPE (p, pp, SCM_ARG1, __FUNCTION__, "Pitch");
int q = p->quartertone_pitch ();
- return scm_int2num (q);
+ return gh_int2scm (q);
}
-LY_DEFINE (ly_pitch_semitones, "ly:pitch-semitones",
+LY_DEFINE (ly_pitch_semitones, "ly:pitch-semitones",
1, 0, 0, (SCM pp),
"calculate the number of semitones of @var{p} from middle C.")
{
Pitch *p = unsmob_pitch (pp);
SCM_ASSERT_TYPE (p, pp, SCM_ARG1, __FUNCTION__, "Pitch");
int q = p->semitone_pitch ();
- return scm_int2num (q);
+ return gh_int2scm (q);
}
-LY_DEFINE (ly_pitch_less_p, "ly:pitch<?",
+LY_DEFINE (pitch_less, "ly:pitch<?",
2, 0, 0, (SCM p1, SCM p2),
"Is @var{p1} lexicographically smaller than @var{p2}?")
{
return interval (*r, *p).smobbed_copy ();
}
+
int
-Pitch::get_octave () const
+Pitch::get_octave ()const
{
return octave_;
}
Property_iterator::process (Moment m)
{
SCM sym = get_music ()->get_property ("symbol");
- if (ly_c_symbol_p (sym))
+ if (gh_symbol_p (sym))
{
SCM val = get_music ()->get_property ("value");
bool ok= true;
{
if (!list_p)
{
- list_p = scm_c_eval_string ("list?");
+ list_p = gh_eval_str ("list?");
}
Protected_scm::Protected_scm (SCM s)
{
- object_ = SCM_NIMP (s) ? scm_gc_protect_object (s): s;
+ object_ = SCM_NIMP (s) ? scm_gc_protect_object (s): s;
}
Protected_scm::Protected_scm (Protected_scm const &s)
{
- object_ = (SCM_NIMP (s.object_) ? scm_gc_protect_object (s.object_)
- : s.object_);
-}
-
-Protected_scm::~Protected_scm ()
-{
- if (SCM_NIMP (object_))
- scm_gc_unprotect_object (object_);
+ object_ = SCM_NIMP (s.object_) ? scm_gc_protect_object (s.object_) : s.object_;
}
Protected_scm &
if (SCM_NIMP (object_))
scm_gc_unprotect_object (object_);
- object_ = SCM_NIMP (s) ? scm_gc_protect_object (s) : s;
+ object_ = SCM_NIMP (s) ? scm_gc_protect_object (s): s;
return *this;
}
return operator= (s.object_);
}
+
+Protected_scm::~Protected_scm ()
+{
+ if (SCM_NIMP (object_))
+ {
+ scm_gc_unprotect_object (object_);
+ }
+}
+
Protected_scm::operator SCM () const
{
return object_;
{
int cmp = (lo + hi) / 2;
- SCM when = ly_caar (SCM_VECTOR_REF (vec, cmp));
+ SCM when = gh_caar (SCM_VECTOR_REF (vec, cmp));
bool result = (*is_less) (key, when);
if (result)
hi = cmp;
start_moment_ = now;
event_vector_ = get_music ()->get_property ("quoted-events");
- if (ly_c_vector_p (event_vector_))
+ if (gh_vector_p (event_vector_))
{
event_idx_ = binsearch_scm_vector (event_vector_, now.smobbed_copy (), &moment_less);
end_idx_ = binsearch_scm_vector (event_vector_, stop.smobbed_copy (), &moment_less);
Quote_iterator::pending_moment () const
{
SCM entry = SCM_VECTOR_REF (event_vector_, event_idx_);
- return *unsmob_moment (ly_caar (entry)) - start_moment_;
+ return *unsmob_moment (gh_caar (entry)) - start_moment_;
}
{
entry = SCM_VECTOR_REF (event_vector_, event_idx_);
- Moment em = *unsmob_moment (ly_caar (entry));
+ Moment em = *unsmob_moment (gh_caar (entry));
if (em > m)
return ;
event_idx_++;
}
- if (ly_c_pair_p (entry))
+ if (gh_pair_p (entry))
{
- Pitch * quote_pitch = unsmob_pitch (ly_cdar (entry));
+ Pitch * quote_pitch = unsmob_pitch (gh_cdar (entry));
Pitch * me_pitch = unsmob_pitch (get_outlet ()->get_property ("instrumentTransposition"));
- for (SCM s = ly_cdr (entry); ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = gh_cdr (entry); gh_pair_p (s); s = gh_cdr (s))
{
- SCM ev_acc = ly_car (s);
+ SCM ev_acc = gh_car (s);
- Music * mus = unsmob_music (ly_car (ev_acc));
+ Music * mus = unsmob_music (gh_car (ev_acc));
if (mus)
{
if (quote_pitch || me_pitch)
SCM copy = ly_deep_mus_copy (mus->self_scm ());
mus = unsmob_music (copy);
- transposed_musics_ = scm_cons (copy, transposed_musics_);
+ transposed_musics_ = gh_cons (copy, transposed_musics_);
mus->transpose (diff);
}
void
Recording_group_engraver::start ()
{
- if (!ly_c_pair_p (accumulator_))
- accumulator_ = scm_cons (SCM_EOL, SCM_EOL);
- if (!ly_c_pair_p (ly_car (accumulator_)))
+ if (!gh_pair_p (accumulator_))
+ accumulator_ = gh_cons (SCM_EOL, SCM_EOL);
+ if (!gh_pair_p (gh_car (accumulator_)))
{
/*
Need to store transposition for every moment; transposition changes during pieces.
*/
- scm_set_car_x (accumulator_, scm_cons (scm_cons (now_mom ().smobbed_copy (),
+ scm_set_car_x (accumulator_, gh_cons (gh_cons (now_mom ().smobbed_copy (),
get_property ("instrumentTransposition")),
SCM_EOL));
}
Recording_group_engraver::stop_translation_timestep ()
{
Engraver_group_engraver::stop_translation_timestep ();
- scm_set_cdr_x (accumulator_, scm_cons (ly_car (accumulator_), ly_cdr (accumulator_)));
+ scm_set_cdr_x (accumulator_, gh_cons (gh_car (accumulator_), gh_cdr (accumulator_)));
scm_set_car_x (accumulator_, SCM_EOL);
}
Engraver_group_engraver::finalize ();
SCM proc = get_property ("recordEventSequence");
- if (ly_c_procedure_p (proc))
- scm_call_2 (proc, context ()->self_scm (), ly_cdr (accumulator_));
+ if (gh_procedure_p (proc))
+ scm_call_2 (proc, daddy_context_->self_scm (), gh_cdr (accumulator_));
accumulator_ = SCM_EOL;
}
{
bool retval = Translator_group::try_music (m);
- SCM seq = ly_cdar (accumulator_);
- seq = scm_cons (scm_cons (m->self_scm (), ly_bool2scm (retval)),
+ SCM seq = gh_cdar (accumulator_);
+ seq = gh_cons (gh_cons (m->self_scm (), gh_bool2scm (retval)),
seq);
- scm_set_cdr_x (ly_car (accumulator_), seq);
+ scm_set_cdr_x (gh_car (accumulator_), seq);
return retval;
}
if (lily_1_8_relative)
{
lily_1_8_compatibility_used = true;
- /* last-pitch should be junked some time, when
- we ditch 1.8 compat too.
+ /*
+ ugh: last-pitch should be junked.
- When you do, B should start where A left off.
+ Change this for lilypond 2.0. When you do,
+ then B should start where A left off.
- \relative { A \relative { ...} B } */
- Pitch *ptr = unsmob_pitch (get_property ("last-pitch"));
- return (ptr) ? *ptr : p;
+ \relative { A \relative { ...} B }
+
+ */
+ return * unsmob_pitch (get_property ("last-pitch"));
}
else
return p;
void
Repeat_acknowledge_engraver::initialize ()
{
- context ()->set_property ("repeatCommands", SCM_EOL);
+ daddy_context_->set_property ("repeatCommands", SCM_EOL);
}
void
Repeat_acknowledge_engraver::start_translation_timestep ()
{
- Context * tr = context ()->where_defined (ly_symbol2scm ("repeatCommands"));
+ Context * tr = daddy_context_->where_defined (ly_symbol2scm ("repeatCommands"));
if (!tr)
- tr = context ();
+ tr = daddy_context_;
tr->set_property ("repeatCommands", SCM_EOL);
}
bool start = false;
bool end = false;
bool volta_found = false;
- while (ly_c_pair_p (cs))
+ while (gh_pair_p (cs))
{
SCM command = ly_car (cs);
if (command == ly_symbol2scm ("start-repeat"))
start = true;
else if (command == ly_symbol2scm ("end-repeat"))
end = true;
- else if (ly_c_pair_p (command) && ly_car (command) == ly_symbol2scm ("volta"))
+ else if (gh_pair_p (command) && ly_car (command) == ly_symbol2scm ("volta"))
volta_found = true;
cs = ly_cdr (cs);
}
*/
SCM wb = get_property ("whichBar");
SCM db = get_property ("defaultBarType");
- if (!ly_c_string_p (wb) || ly_c_equal_p (db, wb))
+ if (!gh_string_p (wb) || gh_equal_p (db, wb))
{
- if (s != "" || (volta_found && !ly_c_string_p (wb)))
+ if (s != "" || (volta_found && !gh_string_p (wb)))
{
- context ()->set_property ("whichBar", scm_makfrom0str (s.to_str0 ()));
+ daddy_context_->set_property ("whichBar", scm_makfrom0str (s.to_str0 ()));
}
}
}
{
lily_1_8_compatibility_used = true;
- for (SCM s = alternatives (); ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = alternatives (); gh_pair_p (s); s = ly_cdr (s))
unsmob_music (ly_car (s))->to_relative_octave (p);
}
int done =0;
SCM p = alternatives ();
- while (ly_c_pair_p (p) && done < repeat_count ())
+ while (gh_pair_p (p) && done < repeat_count ())
{
m = m + unsmob_music (ly_car (p))->get_length ();
done ++;
Moment m;
SCM p = alternatives ();
- while (ly_c_pair_p (p))
+ while (gh_pair_p (p))
{
m = m + unsmob_music (ly_car (p))->get_length ();
p = ly_cdr (p);
int
Repeated_music::repeat_count () const
{
- return ly_scm2int (get_property ("repeat-count"));
+ return gh_scm2int (get_property ("repeat-count"));
}
&& rest_count_ < 2))
return;
- rest_collision_ = make_item ("RestCollision", SCM_EOL);
+ rest_collision_ = make_item ("RestCollision");
-
+ announce_grob (rest_collision_, SCM_EOL);
for (int i=0; i < note_columns_.size (); i++)
Rest_collision::add_column (rest_collision_,note_columns_[i]);
}
void
Rest_collision_engraver::stop_translation_timestep ()
{
- rest_collision_ = 0;
+ if (rest_collision_)
+ {
+ typeset_grob (rest_collision_);
+ rest_collision_ = 0;
+ }
note_columns_.clear ();
rest_count_ = 0;
}
#include "note-column.hh"
#include "stem.hh"
#include "rhythmic-head.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "rest.hh"
#include "group-interface.hh"
#include "staff-symbol-referencer.hh"
Rest_collision::force_shift_callback (SCM element_smob, SCM axis)
{
Grob *them = unsmob_grob (element_smob);
- Axis a = (Axis) ly_scm2int (axis);
+ Axis a = (Axis) gh_scm2int (axis);
assert (a == Y_AXIS);
Grob * rc = unsmob_grob (them->get_property ("rest-collision"));
do_shift (rc);
}
- return scm_make_real (0.0);
+ return gh_double2scm (0.0);
}
if (!s)
return SCM_BOOL_F;
else
- return scm_cons (s->get_property ("duration-log"),
- scm_int2num (Rhythmic_head::dot_count (s)));
+ return gh_cons (s->get_property ("duration-log"),
+ gh_int2scm (Rhythmic_head::dot_count (s)));
}
/*
Link_array<Grob> rests;
Link_array<Grob> notes;
- for (SCM s = elts; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = elts; gh_pair_p (s); s = ly_cdr (s))
{
Grob * e = unsmob_grob (ly_car (s));
if (unsmob_grob (e->get_property ("rest")))
ordered_rests[d].sort (Note_column::shift_compare);
} while (flip (&d) != LEFT);
- do {
- if (ordered_rests[d].size () < 1)
- {
- if (ordered_rests[-d].size() > 1)
- ordered_rests[-d][0]->warning (_("Too many colliding rests."));
-
- return SCM_UNSPECIFIED;
- }
- } while (flip (&d) != LEFT);
+ if (ordered_rests[UP].size () < 1
+ || ordered_rests[DOWN].size () < 1)
+ return SCM_UNSPECIFIED;
Grob *common = common_refpoint_of_array (ordered_rests[DOWN], me, Y_AXIS);
common = common_refpoint_of_array (ordered_rests[UP], common, Y_AXIS);
ADD_INTERFACE (Rest_collision,"rest-collision-interface",
- "Move around ordinary rests (not multi-measure-rests) to avoid "
- "conflicts.",
- "minimum-distance positioning-done elements");
+ "Move around ordinary rests (not multi-measure-rests) to avoid "
+"conflicts.",
+ "minimum-distance positioning-done elements");
void
Rest_engraver::stop_translation_timestep ()
{
- rest_ =0;
- dot_ =0;
+ if (rest_)
+ {
+ typeset_grob (rest_);
+ rest_ =0;
+ }
+ if (dot_)
+ {
+ typeset_grob (dot_);
+ dot_ =0;
+ }
}
void
{
if (rest_req_ && !rest_)
{
- rest_ = make_item ("Rest", rest_req_->self_scm ());
+ rest_ = make_item ("Rest");
int durlog = unsmob_duration (rest_req_->get_property ("duration"))-> duration_log ();
rest_->set_property ("duration-log",
- scm_int2num (durlog));
+ gh_int2scm (durlog));
int dots =unsmob_duration (rest_req_->get_property ("duration"))->dot_count ();
if (dots)
{
- dot_ = make_item ("Dots", SCM_EOL);
+ dot_ = make_item ("Dots");
Rhythmic_head::set_dots (rest_, dot_);
dot_->set_parent (rest_, Y_AXIS);
- dot_->set_property ("dot-count", scm_int2num (dots));
-
+ dot_->set_property ("dot-count", gh_int2scm (dots));
+ announce_grob (dot_, SCM_EOL);
}
Pitch *p = unsmob_pitch (rest_req_->get_property ("pitch"));
{
int pos= p->steps ();
SCM c0 = get_property ("middleCPosition");
- if (ly_c_number_p (c0))
- pos += ly_scm2int (c0);
+ if (gh_number_p (c0))
+ pos += gh_scm2int (c0);
- rest_->set_property ("staff-position", scm_int2num (pos));
+ rest_->set_property ("staff-position", gh_int2scm (pos));
}
+ announce_grob (rest_, rest_req_->self_scm ());
}
}
*/
#include "stencil.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "font-interface.hh"
#include "rest.hh"
#include "dots.hh"
Rest::after_line_breaking (SCM smob)
{
Grob *me = unsmob_grob (smob);
- int bt = ly_scm2int (me->get_property ("duration-log"));
+ int bt = gh_scm2int (me->get_property ("duration-log"));
int lc = Staff_symbol_referencer::line_count (me);
Real ss = Staff_symbol_referencer::staff_space (me);
if (lc % 2)
if (d && bt > 4) // UGH.
{
d->set_property ("staff-position",
- scm_int2num ((bt == 7) ? 4 : 3));
+ gh_int2scm ((bt == 7) ? 4 : 3));
}
if (d && bt >= -1 && bt <= 1) // UGH again.
{
d->set_property ("staff-position",
- scm_int2num ((bt == 0) ? -1 : 1));
+ gh_int2scm ((bt == 0) ? -1 : 1));
}
return SCM_UNSPECIFIED;
}
Grob* me = unsmob_grob (smob);
SCM balltype_scm = me->get_property ("duration-log");
- if (!ly_c_number_p (balltype_scm))
+ if (!gh_number_p (balltype_scm))
return Stencil ().smobbed_copy ();
- int balltype = ly_scm2int (balltype_scm);
+ int balltype = gh_scm2int (balltype_scm);
String style;
SCM style_scm = me->get_property ("style");
- if (ly_c_symbol_p (style_scm))
+ if (gh_symbol_p (style_scm))
style = ly_scm2string (scm_symbol_to_string (style_scm));
Font_metric *fm = Font_interface::get_default_font (me);
SCM
Rest::extent_callback (SCM smob, SCM ax)
{
- Axis a = (Axis) ly_scm2int (ax);
+ Axis a = (Axis) gh_scm2int (ax);
SCM m = brew_internal_stencil (smob);
return ly_interval2scm (unsmob_stencil (m)->extent (a));
}
Rest::polyphonic_offset_callback (SCM smob, SCM)
{
Grob* me = unsmob_grob (smob);
- if (ly_c_number_p (me->get_property ("staff-position")))
- return scm_make_real (0);
+ if (gh_number_p (me->get_property ("staff-position")))
+ return gh_double2scm (0);
Direction d = get_grob_direction (me);
Real off = 2* d ;
if (off)
off *= Staff_symbol_referencer::staff_space (me);
- return scm_make_real (off);
+ return gh_double2scm (off);
}
ADD_INTERFACE (Rest,"rest-interface",
"A rest symbol.",
- "style direction minimum-distance");
+ "style minimum-distance");
{
if (!note_column_)
{
- note_column_ = make_item ("NoteColumn",rheads_[0]->self_scm ());
+ note_column_ = make_item ("NoteColumn");
+ announce_grob (note_column_, rheads_[0]->self_scm ());
- spacing_ = make_item ("NoteSpacing", SCM_EOL);
- spacing_->set_property ("left-items", scm_cons (note_column_->self_scm (), SCM_EOL));
+ spacing_ = make_item ("NoteSpacing");
+ spacing_->set_property ("left-items", gh_cons (note_column_->self_scm (), SCM_EOL));
-
+ announce_grob (spacing_, SCM_EOL);
if (last_spacing_)
{
void
Rhythmic_column_engraver::stop_translation_timestep ()
{
+ if (note_column_)
+ {
+ typeset_grob (note_column_);
note_column_ =0;
+ }
if (spacing_)
{
+ typeset_grob (spacing_);
last_spacing_ = spacing_;
spacing_ =0;
}
Rhythmic_head::dot_count (Grob*me)
{
return get_dots (me)
- ? ly_scm2int (get_dots (me)->get_property ("dot-count")) : 0;
+ ? gh_scm2int (get_dots (me)->get_property ("dot-count")) : 0;
}
void
Rhythmic_head::duration_log (Grob*me)
{
SCM s = me->get_property ("duration-log");
- return ly_c_number_p (s) ? ly_scm2int (s) : 0;
+ return gh_number_p (s) ? gh_scm2int (s) : 0;
}
ADD_INTERFACE (Rhythmic_head,"rhythmic-head-interface",
--- /dev/null
+/*
+ scaled-font-metric.cc -- declare Scaled_font_metric
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1999--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#include "scaled-font-metric.hh"
+#include "string.hh"
+#include "stencil.hh"
+
+
+Scaled_font_metric::Scaled_font_metric (Font_metric* m, Real magn)
+{
+ magnification_ = magn;
+ SCM desc = m->description_;
+
+ Real total_mag = magn * gh_scm2double (ly_cdr (desc));
+ assert (total_mag);
+
+ description_ = gh_cons (ly_car (desc), gh_double2scm (total_mag));
+ orig_ = m;
+}
+
+SCM
+Scaled_font_metric::make_scaled_font_metric (Font_metric*m, Real s)
+{
+ Scaled_font_metric *sfm = new Scaled_font_metric (m,s);
+ return sfm->self_scm ();
+}
+
+Stencil
+Scaled_font_metric::find_by_name (String s) const
+{
+ Stencil m = orig_->find_by_name (s);
+ Box b = m.extent_box ();
+ b.scale (magnification_);
+ Stencil q (b,fontify_atom ((Font_metric*) this, m.get_expr ()));
+
+ return q ;
+}
+
+Box
+Scaled_font_metric::get_indexed_char (int i) const
+{
+ Box b = orig_->get_indexed_char (i);
+ b.scale (magnification_);
+ return b;
+}
+
+Box
+Scaled_font_metric::get_ascii_char (int i) const
+{
+ Box b = orig_->get_ascii_char (i);
+ b.scale (magnification_);
+ return b;
+}
+
+Box
+Scaled_font_metric::text_dimension (String t) const
+{
+ Box b (orig_->text_dimension (t));
+
+ b.scale (magnification_);
+ return b;
+}
+
+int
+Scaled_font_metric::count () const
+{
+ return orig_->count ();
+}
+
+Offset
+Scaled_font_metric::get_indexed_wxwy (int k) const
+{
+ Offset o = orig_->get_indexed_wxwy (k);
+ return o * magnification_;
+}
+
+int
+Scaled_font_metric::name_to_index (String s)const
+{
+ return orig_->name_to_index (s);
+}
{
int k = 0;
for (int i = SCM_VECTOR_LENGTH (src); i--;)
- for (SCM s = scm_vector_ref (src, SCM_MAKINUM (i)); ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = scm_vector_ref (src, SCM_MAKINUM (i)); ly_pair_p (s); s = ly_cdr (s))
{
scm_hashq_set_x (dest, ly_caar (s), ly_cdar (s));
k++;
{
hash_tab_ = SCM_EOL;
smobify_self ();
- hash_tab_ = scm_make_vector (scm_int2num (119), SCM_EOL);
+ hash_tab_ = scm_make_vector (gh_int2scm (119), SCM_EOL);
elt_count_ = 0;
}
elt_count_ = 0;
smobify_self ();
- hash_tab_ = scm_make_vector (scm_int2num (src.elt_count_ >? 11 ), SCM_EOL);
+ hash_tab_ = scm_make_vector (gh_int2scm (src.elt_count_ >? 11 ), SCM_EOL);
elt_count_ = copy_scm_hashes (hash_tab_, src.hash_tab_);
}
if (&src == this)
return;
- hash_tab_ = scm_make_vector (scm_int2num (src.elt_count_ >? 11), SCM_EOL);
+ hash_tab_ = scm_make_vector (gh_int2scm (src.elt_count_ >? 11), SCM_EOL);
elt_count_ = copy_scm_hashes (hash_tab_, src.hash_tab_);
}
Scheme_hash_table::try_retrieve (SCM k, SCM *v)
{
SCM handle = scm_hashq_get_handle (hash_tab_, k);
- if (ly_c_pair_p (handle))
+ if (ly_pair_p (handle))
{
*v = ly_cdr (handle);
return true;
bool
Scheme_hash_table::contains (SCM k) const
{
- return ly_c_pair_p (scm_hashq_get_handle (hash_tab_, k));
+ return ly_pair_p (scm_hashq_get_handle (hash_tab_, k));
}
void
Scheme_hash_table::set (SCM k, SCM v)
{
- assert (ly_c_symbol_p (k));
+ assert (gh_symbol_p (k));
SCM handle = scm_hashq_create_handle_x (hash_tab_, k, SCM_UNDEFINED);
if (ly_cdr (handle) == SCM_UNDEFINED)
{
elt_count_++;
}
- scm_set_cdr_x (handle, v);
+ gh_set_cdr_x (handle, v);
/*
resize if getting too large.
*/
if (elt_count_ > 2 * SCM_VECTOR_LENGTH (hash_tab_))
{
- SCM nh = scm_make_vector (scm_int2num (3* elt_count_+1), SCM_EOL);
+ SCM nh = scm_make_vector (gh_int2scm (3* elt_count_+1), SCM_EOL);
elt_count_ = copy_scm_hashes (nh, hash_tab_);
hash_tab_ = nh;
}
{
SCM l = SCM_EOL;
for (int i = SCM_VECTOR_LENGTH (hash_tab_); i--;)
- for (SCM s = scm_vector_ref (hash_tab_, scm_int2num (i)); ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = scm_vector_ref (hash_tab_, gh_int2scm (i)); ly_pair_p (s); s = ly_cdr (s))
{
l = scm_acons (ly_caar (s), ly_cdar (s), l);
}
-/*
+/*
scm-option.cc -- implement option setting from Scheme
-
+
source file of the GNU LilyPond music typesetter
-
+
(c) 2001--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
+
*/
#include <stdio.h>
preferably, also dont use TESTING_LEVEL_GLOBAL, since it defeats
another purpose of this very versatile interface, which is to
support multiple debug/testing options concurrently.
-
+
*/
*/
bool internal_type_checking_global_b;
-
-/*
- What is this function for ?
- */
LY_DEFINE (ly_option_usage, "ly:option-usage", 0, 0, 0, (SCM),
- "Print ly:set-option usage")
-{
+ "Print ly-set-option usage")
+{
printf ( _("lilypond -e EXPR means:").to_str0 ());
puts ("");
printf (_ (" Evalute the Scheme EXPR before parsing any .ly files.").to_str0 ());
puts ("");
printf (_ (" Multiple -e options may be given, they will be evaluated sequentially.").to_str0 ());
puts ("");
- printf (_(" The function ly:set-option allows for access to some internal variables.").to_str0 ());
+ printf (_(" The function ly-set-option allows for access to some internal variables.").to_str0 ());
puts ("\n");
printf (_ ("Usage: lilypond-bin -e \"(ly-set-option SYMBOL VAL)\"").to_str0 ());
puts ("\n");
- printf (_ ("Use help as SYMBOL to get online help.").to_str0 ());
-
+ printf (_ ("Where SYMBOL VAL pair is any of:").to_str0 ());
+ puts ("");
+ printf ( " help ANY-SYMBOL\n"
+ " internal-type-checking BOOLEAN\n"
+ " midi-debug BOOLEAN\n"
+ " parse-protect BOOLEAN\n"
+ " testing-level INTEGER\n");
+
exit (0);
return SCM_UNSPECIFIED;
}
don't timestamp the output
@item -t,--test
-Switch on any experimental features. Not for general public use.
-
-*/
-
-
+Switch on any experimental features. Not for general public use. */
LY_DEFINE (ly_set_option, "ly:set-option", 1, 1, 0, (SCM var, SCM val),
"Set a global option value. Supported options include\n"
"\n"
val = SCM_BOOL_T;
if (var == ly_symbol2scm ("help"))
- /* lilypond -e "(ly-set-option 'help #t)" */
- ly_option_usage (SCM_EOL);
+ {
+ /* lilypond -e "(ly-set-option 'help #t)" */
+ ly_option_usage (SCM_EOL);
+ }
else if (var == ly_symbol2scm ("midi-debug"))
- midi_debug_global_b = to_boolean (val);
+ {
+ midi_debug_global_b = to_boolean (val);
+ }
else if (var == ly_symbol2scm ("testing-level"))
- testing_level_global = ly_scm2int (val);
+ {
+ testing_level_global = gh_scm2int (val);
+ }
else if (var == ly_symbol2scm ("parse-protect" ))
- parse_protect_global = to_boolean (val);
+ {
+ parse_protect_global = to_boolean (val);
+ }
else if (var == ly_symbol2scm ("internal-type-checking"))
- internal_type_checking_global_b = to_boolean (val);
+ {
+ internal_type_checking_global_b = to_boolean (val);
+ }
else if (var == ly_symbol2scm ("old-relative"))
{
lily_1_8_relative = true;
- /* Needs to be reset for each file that uses this option. */
- lily_1_8_compatibility_used = false;
+ lily_1_8_compatibility_used = false;
}
else if (var == ly_symbol2scm ("new-relative"))
- lily_1_8_relative = false;
+ {
+ lily_1_8_relative = false;
+ }
else if (var == ly_symbol2scm ("debug-beam"))
{
extern bool debug_beam_quanting_flag;
debug_beam_quanting_flag = true;
}
else
- warning (_f ("No such internal option: %s", ly_scm2string (var)));
+ {
+ warning (_("Unknown internal option!"));
+ }
return SCM_UNSPECIFIED;
}
+
LY_DEFINE (ly_get_option, "ly:get-option", 1, 0, 0, (SCM var),
"Get a global option setting. Supported options include\n"
"@table @code\n"
"@end table\n"
"\n")
{
- SCM o = SCM_UNSPECIFIED;
-
- if (var == ly_symbol2scm ("safe")) // heavily used; put in front.
- o = ly_bool2scm (safe_global_b);
- else if (var == ly_symbol2scm ("old-relative-used"))
- o = ly_bool2scm (lily_1_8_compatibility_used);
- else if (var == ly_symbol2scm ("old-relative"))
- o = ly_bool2scm (lily_1_8_relative);
- else if (var == ly_symbol2scm ("verbose"))
- o = ly_bool2scm (verbose_global_b);
+ if (var == ly_symbol2scm ("old-relative-used"))
+ {
+ return gh_bool2scm (lily_1_8_compatibility_used);
+ }
+ if (var == ly_symbol2scm ("old-relative"))
+ {
+ return gh_bool2scm (lily_1_8_relative);
+ }
+ if (var == ly_symbol2scm ("verbose"))
+ {
+ return gh_bool2scm (verbose_global_b);
+ }
else
- warning (_f ("No such internal option: %s", ly_scm2string (var)));
- return o;
+ {
+ warning (_("Unknown internal option!"));
+ }
+
+ return SCM_UNSPECIFIED;
}
void
Score_context::prepare (Moment w)
{
- Translator* t = implementation ();
+ Translator* t = unsmob_translator (implementation_);
Score_translator * s = dynamic_cast<Score_translator *> (t);
s->prepare (w);
void
Score_context::finish ()
{
- Translator* t = implementation ();
+ Translator* t = unsmob_translator (implementation_);
Score_translator * s = dynamic_cast<Score_translator *> (t);
s->finish ();
void
Score_context::one_time_step ()
{
- Translator* t = implementation ();
+ Translator* t = unsmob_translator (implementation_);
Score_translator * s = dynamic_cast<Score_translator *> (t);
s->one_time_step ();
}
Music_output*
Score_context::get_output ()
{
- Translator *t = implementation ();
+ Translator *t = unsmob_translator (implementation_);
Score_translator *s = dynamic_cast<Score_translator *> (t);
return s->get_output ();
}
#include "score-engraver.hh"
#include "paper-score.hh"
#include "paper-column.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "axis-group-interface.hh"
#include "context-def.hh"
#include "staff-spacing.hh"
if (!command_column_)
{
SCM nmp
- = updated_grob_properties (context (),
+ = updated_grob_properties (daddy_context_,
ly_symbol2scm ("NonMusicalPaperColumn"));
- SCM pc = updated_grob_properties (context (),
+ SCM pc = updated_grob_properties (daddy_context_,
ly_symbol2scm ("PaperColumn"));
set_columns (new Paper_column (nmp), new Paper_column (pc));
command_column_->set_property ("when", w);
musical_column_->set_property ("when", w);
- recurse_over_translators (context (), &Translator::start_translation_timestep, DOWN);
+ recurse_over_translators (daddy_context_, &Translator::start_translation_timestep, DOWN);
}
void
if ((breaks_%8))
progress_indication ("[" + to_string (breaks_) + "]");
- recurse_over_translators (context (), &Translator::finalize, UP);
+ recurse_over_translators (daddy_context_, &Translator::finalize, UP);
}
/*
pscore_ = new Paper_score;
- pscore_->paper_ = dynamic_cast<Output_def*> (get_output_def ());
+ pscore_->paper_ = dynamic_cast<Paper_def*> (get_output_def ());
- SCM props = updated_grob_properties (context (), ly_symbol2scm ("System"));
+ SCM props = updated_grob_properties (daddy_context_, ly_symbol2scm ("System"));
pscore_->typeset_line (new System (props));
{
if (!to_boolean (get_property ("skipTypesetting")))
{
- recurse_over_translators (context (), &Engraver::process_music, UP);
- recurse_over_translators (context (), &Engraver::do_announces, UP);
+ recurse_over_translators (daddy_context_, &Engraver::process_music, UP);
+ recurse_over_translators (daddy_context_, &Engraver::do_announces, UP);
}
- recurse_over_translators (context (), &Translator::stop_translation_timestep, UP);
+ recurse_over_translators (daddy_context_, &Translator::stop_translation_timestep, UP);
}
void
{
announce_infos_.push (info);
pscore_->system_->typeset_grob (info.grob_);
- elems_.push (info.grob_);
}
+void
+Score_engraver::typeset_grob (Grob *elem)
+{
+ if (!elem)
+ programming_error ("Score_engraver: empty elt\n");
+ else
+ elems_.push (elem);
+}
void
Score_engraver::typeset_all ()
for (int i =0; i < elems_.size (); i++)
{
Grob * elem = elems_[i];
-
- if (dynamic_cast<Item*> (elem))
+ if (Spanner *s = dynamic_cast <Spanner *> (elem))
+ {
+ /*
+ do something sensible if spanner not
+ spanned on 2 items.
+ */
+ Direction d = LEFT;
+ do {
+ if (!s->get_bound (d))
+ {
+ Grob * cc
+ = unsmob_grob (get_property ("currentCommandColumn"));
+ s->set_bound (d, cc);
+ /* don't warn for empty/suicided spanners,
+ it makes real warningsinvisible.
+ maybe should be junked earlier? */
+ if (elem->live ())
+ elem->warning (_f ("unbound spanner `%s'", s->name ().to_str0 ()));
+ }
+ }
+ while (flip (&d) != LEFT);
+
+ if (dynamic_cast<Item*> (s->get_parent (Y_AXIS)))
+ programming_error ("Spanner Y-parent is an item.");
+ }
+ else
{
- if (!elem->get_parent (X_AXIS)
- && elem != command_column_
- && elem != musical_column_
- )
+ if (!elem->get_parent (X_AXIS))
{
bool br = to_boolean (elem->get_property ("breakable"));
Axis_group_interface::add_element (br ? command_column_ : musical_column_, elem);
musical_column_ = new_musical;
if (new_command)
{
- context ()->set_property ("currentCommandColumn", new_command->self_scm ());
+ daddy_context_->set_property ("currentCommandColumn", new_command->self_scm ());
}
if (new_musical)
{
- context ()->set_property ("currentMusicalColumn", new_musical->self_scm ());
+ daddy_context_->set_property ("currentMusicalColumn", new_musical->self_scm ());
}
}
}
bool
-Score_engraver::try_music (Music *m)
+Score_engraver::try_music (Music*r)
{
- if (Engraver_group_engraver::try_music (m))
- return true;
+ bool gotcha = Engraver_group_engraver::try_music (r);
- if (m->is_mus_type ("break-event"))
+ if (!gotcha && r->is_mus_type ("break-event"))
{
- SCM pen = command_column_->get_property ("penalty");
- Real total_penalty = ly_c_number_p (pen) ? ly_scm2double (pen) : 0.0;
-
- SCM mpen = m->get_property ("penalty");
- if (ly_c_number_p (mpen))
- total_penalty += ly_scm2double (mpen);
-
- command_column_->set_property ("penalty", scm_make_real (total_penalty));
+ gotcha = true;
- /* ugh. arbitrary, hardcoded */
- if (total_penalty > 10000.0)
+ SCM pen = command_column_->get_property ("penalty");
+ Real total_penalty = gh_number_p (pen)
+ ? gh_scm2double (pen)
+ : 0.0;
+
+ SCM rpen = r->get_property ("penalty");
+ if (gh_number_p (rpen))
+ total_penalty += gh_scm2double (rpen);
+
+ if (total_penalty > 10000.0) // ugh. arbitrary.
forbid_breaks ();
- SCM page_pen = command_column_->get_property ("page-penalty");
- Real total_pp = ly_c_number_p (page_pen) ? ly_scm2double (page_pen) : 0.0;
- SCM mpage_pen = m->get_property ("page-penalty");
- if (ly_c_number_p (mpage_pen))
- total_pp += ly_scm2double (mpage_pen);
-
- command_column_->set_property ("page-penalty", scm_make_real (total_pp));
- return true;
+ command_column_->set_property ("penalty",
+ gh_double2scm (total_penalty));
}
- return false;
+ return gotcha;
}
void
*/
#include "score-performer.hh"
+#include "midi-def.hh"
#include "audio-column.hh"
#include "audio-item.hh"
#include "performance.hh"
#include "string-convert.hh"
#include "warn.hh"
#include "context-def.hh"
-#include "output-def.hh"
{
audio_column_ = new Audio_column (m);
play_element (audio_column_);
- recurse_over_translators (context (), &Translator::start_translation_timestep, UP);
+ recurse_over_translators (daddy_context_, &Translator::start_translation_timestep, UP);
}
void
Score_performer::finish ()
{
- recurse_over_translators (context (), &Translator::finalize, UP);
+ recurse_over_translators (daddy_context_, &Translator::finalize, UP);
}
void
Score_performer::one_time_step ()
{
- recurse_over_translators (context (), &Performer::process_music, UP);
- recurse_over_translators (context (), &Performer::do_announces, UP);
- recurse_over_translators (context (), &Translator::stop_translation_timestep, UP);
+ recurse_over_translators (daddy_context_, &Performer::process_music, UP);
+ recurse_over_translators (daddy_context_, &Performer::do_announces, UP);
+ recurse_over_translators (daddy_context_, &Translator::stop_translation_timestep, UP);
}
int
Score_performer::get_tempo () const
{
- return ::get_tempo (performance_->midi_, Moment (Rational (1, 4)));
+ return performance_->midi_->get_tempo (Moment (Rational (1, 4)));
}
Score_performer::initialize ()
{
performance_ = new Performance;
- performance_->midi_ = get_output_def ();
+ performance_->midi_ = dynamic_cast<Midi_def*> (get_output_def ());
Translator_group::initialize ();
}
#include <stdio.h>
-#include "book.hh"
-
-#include "cpu-timer.hh"
-#include "global-context.hh"
-#include "ly-module.hh"
#include "ly-smobs.icc"
-#include "main.hh"
-#include "music-iterator.hh"
-#include "output-def.hh"
+
+#include "score.hh"
+#include "warn.hh"
+#include "music-output-def.hh"
#include "music-output.hh"
+#include "music-iterator.hh"
#include "music.hh"
+#include "global-context.hh"
+#include "scm-hash.hh"
+#include "cpu-timer.hh"
+#include "main.hh"
+#include "paper-def.hh"
+#include "ly-module.hh"
#include "paper-book.hh"
-#include "output-def.hh"
#include "paper-score.hh"
-#include "scm-hash.hh"
-#include "score.hh"
-#include "warn.hh"
+#include "input-file-results.hh"
+
+/*
+ TODO: junkme.
+ */
Score::Score ()
: Input ()
{
header_ = SCM_EOL;
music_ = SCM_EOL;
+
smobify_self ();
}
Score::~Score ()
{
+
}
+
+
+
IMPLEMENT_SMOBS (Score);
IMPLEMENT_DEFAULT_EQUAL_P (Score);
-IMPLEMENT_TYPE_P (Score, "ly:score?");
+
SCM
Score::mark_smob (SCM s)
{
- Score *sc = (Score*) SCM_CELL_WORD_1 (s);
+ Score * sc = (Score*) SCM_CELL_WORD_1 (s);
+
if (sc->header_)
scm_gc_mark (sc->header_);
for (int i = sc->defs_.size (); i--;)
scm_gc_mark (sc->defs_[i]->self_scm ());
+
return sc->music_;
}
return 1;
}
+
+
+/*
+ store point & click locations.
+ Global to save some time. (Sue us!)
+ */
+
Score::Score (Score const &s)
: Input (s)
{
music_ = SCM_EOL;
-
- /* FIXME: SCM_EOL? */
header_ = 0;
-
smobify_self ();
- Music *m =unsmob_music (s.music_);
- music_ = m ? m->clone ()->self_scm () : SCM_EOL;
+ Music * m =unsmob_music (s.music_);
+ music_ = m?m->clone ()->self_scm () : SCM_EOL;
scm_gc_unprotect_object (music_);
for (int i = 0; i < s.defs_.size (); i++)
defs_.push (s.defs_[i]->clone ());
- header_ = ly_make_anonymous_module (false);
- if (ly_c_module_p (s.header_))
+ header_ = ly_make_anonymous_module ();
+ if (ly_module_p (s.header_))
ly_import_module (header_, s.header_);
}
LY_DEFINE (ly_run_translator, "ly:run-translator",
- 2, 0, 0, (SCM mus, SCM output_def),
+ 2, 0, 0, (SCM mus, SCM output_def),
"Process @var{mus} according to @var{output_def}. "
"An interpretation context is set up, "
"and @var{mus} is interpreted with it. "
"The context is returned in its final state.")
{
- Output_def *odef = unsmob_output_def (output_def);
+ Music_output_def *odef = unsmob_music_output_def (output_def);
Music *music = unsmob_music (mus);
- if (!music)
- return SCM_BOOL_F;
-
SCM_ASSERT_TYPE (music, mus, SCM_ARG1, __FUNCTION__, "Music");
SCM_ASSERT_TYPE (odef, output_def, SCM_ARG2, __FUNCTION__, "Output definition");
Cpu_timer timer;
- Global_context *trans = new Global_context (odef, music->get_length ());
+ Global_context * trans = new Global_context (odef,
+ music->get_length ()
+ );
if (!trans)
{
iter->construct_children ();
- if (!iter->ok ())
+ if (! iter->ok ())
{
warning (_ ("Need music in a score"));
- /* todo: should throw exception. */
- return SCM_BOOL_F;
+ return SCM_BOOL_F; // todo: should throw exception.
}
trans->run_iterator_on_me (iter);
if (verbose_global_b)
progress_indication (_f ("elapsed time: %.2f seconds", timer.read ()));
+
return scm_gc_unprotect_object (trans->self_scm ());
}
{
Global_context *g = dynamic_cast<Global_context*> (unsmob_context (context));
SCM_ASSERT_TYPE (g, context, SCM_ARG1, __FUNCTION__, "Global context");
- SCM_ASSERT_TYPE (ly_c_string_p (outname), outname, SCM_ARG2, __FUNCTION__, "output filename");
+ SCM_ASSERT_TYPE (gh_string_p (outname), outname, SCM_ARG2, __FUNCTION__, "output filename");
Music_output *output = g->get_output ();
progress_indication ("\n");
- /* ugh, midi still wants outname */
+ // ugh, midi still wants outname
return output->process (ly_scm2string (outname));
}
void
-default_rendering (SCM music, SCM outdef,
- SCM book_outputdef,
- SCM header, SCM outname)
+default_rendering (SCM music, SCM outdef, SCM header, SCM outname)
{
- SCM scaled_def = outdef;
- SCM scaled_bookdef = book_outputdef;
-
- Output_def *bpd = unsmob_output_def (book_outputdef);
+ SCM context = ly_run_translator (music, outdef);
- /* ugh. */
- if (bpd->c_variable ("is-bookpaper") == SCM_BOOL_T)
- {
- Real scale = ly_scm2double (bpd->c_variable ("outputscale"));
-
- Output_def *def = scale_output_def (unsmob_output_def (outdef), scale);
- scaled_def = def->self_scm ();
-
- scaled_bookdef = scale_output_def (bpd, scale)->self_scm ();
- unsmob_output_def (scaled_def)->parent_
- = unsmob_output_def (scaled_bookdef);
-
- scm_gc_unprotect_object (scaled_bookdef);
- scm_gc_unprotect_object (scaled_def);
- }
-
- SCM context = ly_run_translator (music, scaled_def);
if (Global_context *g = dynamic_cast<Global_context*>
(unsmob_context (context)))
{
Music_output *output = g->get_output ();
if (systems != SCM_UNDEFINED)
{
- /* ugh, this is strange, Paper_book without a Book object. */
- Paper_book *paper_book = new Paper_book ();
- paper_book->header_ = header;
- paper_book->bookpaper_ = unsmob_output_def (scaled_bookdef);
-
- Score_lines sc;
- sc.lines_ = systems;
- sc.header_ = header;
-
- paper_book->score_lines_.push (sc);
-
- paper_book->classic_output (ly_scm2string (outname));
- scm_gc_unprotect_object (paper_book->self_scm ());
+ Paper_score *ps = dynamic_cast<Paper_score*> (output);
+
+ paper_book->papers_.push (ps->paper_);
+ paper_book->scores_.push (systems);
+ paper_book->global_headers_.push (global_input_file->header_);
+ paper_book->headers_.push (header);
+ if (output_format_global != PAGE_LAYOUT)
+ paper_book->classic_output (ly_scm2string (outname));
}
delete output;
}
-
- scm_remember_upto_here_1 (scaled_def);
- scm_remember_upto_here_1 (scaled_bookdef);
-}
-
-/*
-Format score, return systems. OUTNAME is still passed to create a midi
-file.
-
-PAPERBOOK should be scaled already.
-
-*/
-SCM
-Score::book_rendering (String outname,
- Output_def *paperbook,
- Output_def *default_def)
-{
- SCM scaled_bookdef = SCM_EOL;
- Real scale = 1.0;
-
- if (paperbook && paperbook->c_variable ("is-bookpaper") == SCM_BOOL_T)
- scale = ly_scm2double (paperbook->c_variable ("outputscale"));
-
- SCM out = scm_makfrom0str (outname.to_str0 ());
- SCM systems = SCM_EOL;
- int outdef_count = defs_.size ();
- for (int i = 0; !i || i < outdef_count; i++)
- {
- Output_def *def = outdef_count ? defs_[i] : default_def;
- SCM scaled= SCM_EOL;
- if (def->c_variable ("is-paper") == SCM_BOOL_T)
- {
- def = scale_output_def (def, scale);
- def->parent_ = paperbook;
- scaled = def->self_scm ();
- scm_gc_unprotect_object (scaled);
- }
-
- /* TODO: fix or junk --no-paper. */
- SCM context = ly_run_translator (music_, def->self_scm ());
- if (dynamic_cast<Global_context*> (unsmob_context (context)))
- {
- SCM s = ly_format_output (context, out);
- if (s != SCM_UNDEFINED)
- systems = s;
- }
-
- scm_remember_upto_here_1 (scaled);
- }
-
- scm_remember_upto_here_1 (scaled_bookdef);
- return systems;
-}
-
-LY_DEFINE (ly_score_bookify, "ly:score-bookify",
- 2, 0, 0,
- (SCM score_smob, SCM header),
- "Return @var{score_smob} encapsulated in a Book object. Set "
- "@var{header} as book level header.")
-{
- SCM_ASSERT_TYPE (unsmob_score (score_smob), score_smob,
- SCM_ARG1, __FUNCTION__, "score_smob");
-
- Score *score = unsmob_score (score_smob);
- Book *book = new Book;
- book->scores_.push (score);
- book->header_ = header;
- scm_gc_unprotect_object (book->self_scm ());
- return book->self_scm ();
-}
-
-
-LY_DEFINE (ly_score_embedded_format, "ly:score-embedded-format",
- 2, 0, 0, (SCM score, SCM paper),
- "Run @var{score} through @var{paper}, an output definition, "
- "scaled to correct outputscale already, "
- "return a list of paper-lines.")
-{
- Score * sc = unsmob_score (score);
- Output_def *od = unsmob_output_def (paper);
-
- SCM_ASSERT_TYPE (sc, score, SCM_ARG1, __FUNCTION__, "Score");
- SCM_ASSERT_TYPE (od, paper, SCM_ARG2, __FUNCTION__, "Output_def");
-
- SCM lines = SCM_EOL;
- Output_def * score_def = 0;
-
- /* UGR, FIXME, these are default \paper blocks once again. They
- suck. */
- for (int i = 0; !score_def && i < sc->defs_.size (); i++)
- if (sc->defs_[i]->c_variable ("is-paper") == SCM_BOOL_T)
- score_def = sc->defs_[i];
-
- if (!score_def)
- return lines;
-
- score_def = score_def->clone ();
- SCM prot = score_def->self_scm ();
- scm_gc_unprotect_object (prot);
-
- /* TODO: SCORE_DEF should be scaled according to OD->parent_ or OD
- itself. */
- score_def->parent_ = od;
-
- SCM context = ly_run_translator (sc->music_, score_def->self_scm ());
- lines = ly_format_output (context, scm_makfrom0str ("<embedded>"));
-
- scm_remember_upto_here_1 (prot);
- return lines;
}
void
Script_column_engraver::stop_translation_timestep ()
{
- scol_ =0;
+ if (scol_)
+ {
+ typeset_grob (scol_);
+ scol_ =0;
+ }
scripts_.clear ();
}
{
if (!scol_ && scripts_.size () > 1)
{
- scol_ = make_item ("ScriptColumn", SCM_EOL);
-
+ scol_ = make_item ("ScriptColumn");
+ announce_grob (scol_, SCM_EOL);
}
if (scol_)
Script_column::add_staff_sided (Grob *me, Item *i)
{
SCM p = i->get_property ("script-priority");
- if (!ly_c_number_p (p))
+ if (!gh_number_p (p))
return;
Pointer_group_interface::add_grob (me, ly_symbol2scm ("scripts"),i);
me->add_dependency (i);
}
-LY_DEFINE (ly_grob_script_priority_less, "ly:grob-script-priority-less",
+LY_DEFINE (grob_script_priority_less, "ly:grob-script-priority-less",
2, 0, 0, (SCM a, SCM b),
"Compare two grobs by script priority. For internal use.")
{
SCM p1 = i1->get_property ("script-priority");
SCM p2 = i2->get_property ("script-priority");
- return ly_scm2int (p1) < ly_scm2int (p2) ? SCM_BOOL_T : SCM_BOOL_F;
+ return gh_scm2int (p1) < gh_scm2int (p2) ? SCM_BOOL_T : SCM_BOOL_F;
}
MAKE_SCHEME_CALLBACK (Script_column, before_line_breaking, 1);
Drul_array<SCM> scripts (SCM_EOL, SCM_EOL);
Link_array<Grob> staff_sided;
- for (SCM s = me->get_property ("scripts"); ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = me->get_property ("scripts"); gh_pair_p (s); s = gh_cdr (s))
{
- Grob *sc = unsmob_grob (ly_car (s));
+ Grob *sc = unsmob_grob (gh_car (s));
- /*
- Don't want to consider scripts horizontally next to notes.
- */
if (!sc->has_offset_callback (Side_position_interface::aligned_side_proc,
X_AXIS))
staff_sided.push (sc);
{
programming_error ( "No direction for script?");
d = DOWN;
- g->set_property ("direction", scm_int2num (d));
+ g->set_property ("direction", gh_int2scm (d));
}
scripts[d] = scm_cons (g->self_scm (), scripts[d]);
do
{
SCM ss = scm_reverse_x (scripts[d], SCM_EOL);
- ss = scm_stable_sort_x (ss, ly_grob_script_priority_less_proc);
+ ss = scm_stable_sort_x (ss, grob_script_priority_less_proc);
Grob * last = 0;
- for (SCM s = ss; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = ss; gh_pair_p (s); s = gh_cdr (s))
{
- Grob *g = unsmob_grob (ly_car (s));
+ Grob *g = unsmob_grob (gh_car (s));
if (last)
Side_position_interface::add_support (g,last);
This is necessary for part-combining.
*/
for (int j = 0; j < scripts_.size (); j++)
- if (ly_c_equal_p (scripts_[j]. event_->get_property ("articulation-type"),
+ if (gh_equal_p (scripts_[j]. event_->get_property ("articulation-type"),
r->get_property ("articulation-type")
))
return true;
if (g->internal_get_property (sym) == SCM_EOL)
{
SCM entry = scm_assoc (sym,alist);
- if (ly_c_pair_p (entry))
+ if (gh_pair_p (entry))
{
- g->internal_set_property (sym, ly_cdr (entry));
+ g->internal_set_property (sym, gh_cdr (entry));
}
}
}
return ;
}
- art = ly_cdr (art);
+ art = gh_cdr (art);
*descr = art;
int prio =0;
SCM sprio = scm_assoc (ly_symbol2scm ("script-priority"), art);
- if (ly_c_pair_p (sprio))
- prio = ly_scm2int (ly_cdr (sprio));
+ if (gh_pair_p (sprio))
+ prio = gh_scm2int (gh_cdr (sprio));
/*
prio += index;
Side_position_interface::set_axis (p, Y_AXIS);
- p->set_property ("script-priority", scm_int2num (prio));
+ p->set_property ("script-priority", gh_int2scm (prio));
}
void
{
Music* l=scripts_[i].event_;
- Grob * p = make_item ("Script", l->self_scm ());
+ Grob * p = make_item ("Script");
- make_script_from_event (p, &scripts_[i].description_, context (),
+ make_script_from_event (p, &scripts_[i].description_, daddy_context_,
l->get_property ("articulation-type"),
i);
SCM force_dir = l->get_property ("direction");
if (is_direction (force_dir) && to_dir (force_dir))
p->set_property ("direction", force_dir);
+
+ if (p)
+ announce_grob (p, l->self_scm ());
}
}
Grob * sc = scripts_[i].script_;
SCM follow = scm_assoc (ly_symbol2scm ("follow-into-staff"), scripts_[i].description_);
- if (ly_c_pair_p (follow) && to_boolean (ly_cdr (follow)))
+ if (gh_pair_p (follow) && to_boolean (gh_cdr (follow)))
{
sc->add_offset_callback (Side_position_interface::quantised_position_proc, Y_AXIS);
sc->set_property ("staff-padding", SCM_EOL);
}
+ typeset_grob (sc);
}
scripts_.clear ();
}
#include "script.hh"
#include "font-interface.hh"
#include "side-position-interface.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "item.hh"
#include "stencil.hh"
#include "lookup.hh"
Script_interface::get_stencil (Grob * me, Direction d)
{
SCM s = me->get_property ("script-stencil");
- assert (ly_c_pair_p (s));
+ assert (gh_pair_p (s));
SCM key = ly_car (s);
if (key == ly_symbol2scm ("feta"))
{
SCM name_entry = ly_cdr (s);
- SCM str = (ly_c_pair_p (name_entry)) ? index_get_cell (name_entry, d) : name_entry;
+ SCM str = (gh_pair_p (name_entry)) ? index_get_cell (name_entry, d) : name_entry;
return Font_interface::get_default_font (me)->find_by_name ("scripts-" +
ly_scm2string (str));
}
-/*
- self-alignment-interface.cc
-
- source file of the GNU LilyPond music typesetter
-
- (c) 2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
#include "self-alignment-interface.hh"
#include "warn.hh"
-/* Position centered on parent. */
-MAKE_SCHEME_CALLBACK (Self_alignment_interface, centered_on_parent, 2);
+/*
+ Position centered on parent.
+ */
+MAKE_SCHEME_CALLBACK (Self_alignment_interface,centered_on_parent,2);
SCM
Self_alignment_interface::centered_on_parent (SCM element_smob, SCM axis)
{
Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) ly_scm2int (axis);
+ Axis a = (Axis) gh_scm2int (axis);
Grob *him = me->get_parent (a);
- Interval he = him->extent (him, a);
+ Interval he = him->extent (him,a);
- return scm_make_real (he.is_empty () ? 0.0 : he.center ());
+ return gh_double2scm (he.is_empty () ? 0.0 : he.center ());
}
-MAKE_SCHEME_CALLBACK (Self_alignment_interface, aligned_on_parent, 2);
+MAKE_SCHEME_CALLBACK (Self_alignment_interface,aligned_on_parent,2);
SCM
Self_alignment_interface::aligned_on_parent (SCM element_smob, SCM axis)
{
Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) ly_scm2int (axis);
+ Axis a = (Axis) gh_scm2int (axis);
Grob *him = me->get_parent (a);
- Interval he = him->extent (him, a);
+ Interval he = him->extent (him,a);
- SCM sym= (a == X_AXIS) ? ly_symbol2scm ("self-alignment-X")
- : ly_symbol2scm ("self-alignment-Y");
+ SCM sym= (a == X_AXIS) ? ly_symbol2scm ("self-alignment-X"): ly_symbol2scm ("self-alignment-Y");
SCM align_prop (me->internal_get_property (sym));
- if (!ly_c_number_p (align_prop))
- return scm_int2num (0);
+ if (!gh_number_p (align_prop))
+ return gh_int2scm (0);
Real x = 0.0;
- Real align = ly_scm2double (align_prop);
+
+ Real align = gh_scm2double (align_prop);
- Interval ext (me->extent (me, a));
+ Interval ext (me->extent (me,a));
if (ext.is_empty ())
- programming_error ("I'm empty. Can't align on self");
+ {
+ programming_error ("I'm empty. Can't align on self");
+
+ }
else
x -= ext.linear_combination (align) ;
if (!he.is_empty ())
- x += he.linear_combination (align);
+ {
+ x += he.linear_combination (align);
+ }
- return scm_make_real (x);
+ return gh_double2scm (x);
}
-/* Position centered on parent. */
-MAKE_SCHEME_CALLBACK (Self_alignment_interface, centered_on_other_axis_parent, 2);
+/*
+ Position centered on parent.
+ */
+MAKE_SCHEME_CALLBACK (Self_alignment_interface,centered_on_other_axis_parent,2);
SCM
-Self_alignment_interface::centered_on_other_axis_parent (SCM element_smob,
+Self_alignment_interface::centered_on_other_axis_parent (SCM element_smob,
SCM axis)
{
Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) ly_scm2int (axis);
+ Axis a = (Axis) gh_scm2int (axis);
Grob *him = me->get_parent (other_axis (a));
- Interval he = him->extent (him, a);
+ Interval he = him->extent (him,a);
- return scm_make_real (he.is_empty () ? 0.0 : he.center ());
+ return gh_double2scm (he.is_empty () ? 0.0 : he.center ());
}
-/** callback that centers the element on itself
- Requires that self-alignment-{X, Y} be set. */
-MAKE_SCHEME_CALLBACK (Self_alignment_interface, aligned_on_self, 2);
+
+
+
+/**
+ callback that centers the element on itself
+
+ Requires that self-alignment-{X,Y} be set.
+ */
+MAKE_SCHEME_CALLBACK (Self_alignment_interface,aligned_on_self,2);
SCM
Self_alignment_interface::aligned_on_self (SCM element_smob, SCM axis)
{
Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) ly_scm2int (axis);
+ Axis a = (Axis) gh_scm2int (axis);
- SCM sym= (a == X_AXIS) ? ly_symbol2scm ("self-alignment-X")
- : ly_symbol2scm ("self-alignment-Y");
+ SCM sym= (a == X_AXIS) ? ly_symbol2scm ("self-alignment-X"): ly_symbol2scm ("self-alignment-Y");
SCM align (me->internal_get_property (sym));
- if (ly_c_number_p (align))
+ if (gh_number_p (align))
{
- Interval ext (me->extent (me, a));
+ Interval ext (me->extent (me,a));
+
if (ext.is_empty ())
- programming_error ("I'm empty. Can't align on self");
+ {
+ programming_error ("I'm empty. Can't align on self");
+ return gh_double2scm (0.0);
+ }
else
- return scm_make_real (- ext.linear_combination (ly_scm2double (align)));
+ {
+ return gh_double2scm (- ext.linear_combination (gh_scm2double (align)));
+ }
}
- return scm_make_real (0.0);
+ return gh_double2scm (0.0);
}
" extent of the parent \n"
"@item Self_alignment_interface::centered_on_other_axis_parent\n"
" For X-axis, center on the Y-parent, and vice versa.\n "
- "@end table\n",
+ "@end table\n"
+ ,
"self-alignment-X self-alignment-Y");
#include "separating-group-spanner.hh"
#include "separation-item.hh"
#include "paper-column.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "dimensions.hh"
#include "group-interface.hh"
return;
- for (; ly_c_pair_p (next); next = ly_cdr (next))
+ for (; gh_pair_p (next); next = ly_cdr (next))
{
Item *l = dynamic_cast<Item*> (unsmob_grob (ly_car ( next)));
Item *lb = l->find_prebroken_piece (RIGHT);
*/
Real padding = robust_scm2double (me->get_property ("padding"), 0.1);
- for (SCM s = me->get_property ("elements"); ly_c_pair_p (s) && ly_c_pair_p (ly_cdr (s)); s = ly_cdr (s))
+ for (SCM s = me->get_property ("elements"); gh_pair_p (s) && gh_pair_p (ly_cdr (s)); s = ly_cdr (s))
{
/*
Order of elements is reversed!
#include "separating-group-spanner.hh"
#include "separation-item.hh"
#include "paper-column.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "engraver.hh"
#include "axis-group-interface.hh"
#include "note-spacing.hh"
if (!sep_span_)
{
- sep_span_ = make_spanner ("SeparatingGroupSpanner", SCM_EOL);
+ sep_span_ = make_spanner ("SeparatingGroupSpanner");
-
+ announce_grob (sep_span_, SCM_EOL);
sep_span_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn")));
}
}
Grob *column = unsmob_grob (ccol);
sep_span_->set_bound (RIGHT, unsmob_grob (ccol));
+ typeset_grob (sep_span_);
sep_span_ =0;
for (int i= 0 ; i < last_spacings_.note_spacings_.size (); i++)
if (!p_ref_)
{
- p_ref_ = make_item ("SeparationItem", SCM_EOL);
+ p_ref_ = make_item ("SeparationItem");
if (ib)
{
p_ref_->set_property ("breakable", SCM_BOOL_T);
- context ()->set_property ("breakableSeparationItem", p_ref_->self_scm ());
+ daddy_context_->set_property ("breakableSeparationItem", p_ref_->self_scm ());
}
-
+ announce_grob (p_ref_, SCM_EOL);
if (to_boolean (get_property ("createSpacing"))
&& p_ref_ == break_item_)
{
- Item *it = make_item ("StaffSpacing", SCM_EOL);
+ Item *it = make_item ("StaffSpacing");
current_spacings_.staff_spacing_ = it;
- it->set_property ("left-items", scm_cons (break_item_->self_scm (), SCM_EOL));
-
+ it->set_property ("left-items", gh_cons (break_item_->self_scm (), SCM_EOL));
+ announce_grob (it, SCM_EOL);
if (int i = last_spacings_.note_spacings_.size ())
{
else if (last_spacings_.staff_spacing_)
{
last_spacings_.staff_spacing_->set_property ("right-items",
- scm_cons (break_item_->self_scm (), SCM_EOL));
+ gh_cons (break_item_->self_scm (), SCM_EOL));
}
}
}
Separating_line_group_engraver::start_translation_timestep ()
{
if (break_item_)
- context ()->unset_property (ly_symbol2scm ("breakableSeparationItem"));
+ daddy_context_->unset_property (ly_symbol2scm ("breakableSeparationItem"));
break_item_ =0;
}
if (break_item_)
{
Separating_group_spanner::add_spacing_unit (sep_span_, break_item_);
+ typeset_grob (break_item_);
}
if (Item * sp = current_spacings_.staff_spacing_)
Pointer_group_interface::add_grob (sp, ly_symbol2scm ("right-items"),
musical_item_);
+ typeset_grob (sp);
}
if (musical_item_)
{
Separating_group_spanner::add_spacing_unit (sep_span_, musical_item_);
+ typeset_grob (musical_item_);
}
musical_item_ =0;
Paper_column * pc = item->get_column ();
- for (SCM s = me->get_property ("conditional-elements"); ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = me->get_property ("conditional-elements"); gh_pair_p (s); s = ly_cdr (s))
{
SCM elt = ly_car (s);
if (!unsmob_grob (elt))
Paper_column * pc = item->get_column ();
Interval w;
- for (SCM s = me->get_property ("elements"); ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = me->get_property ("elements"); gh_pair_p (s); s = ly_cdr (s))
{
SCM elt = ly_car (s);
if (!unsmob_grob (elt))
last_ext->set_empty ();
Grob *last_grob = 0;
for (SCM s = separation_item->get_property ("elements");
- ly_c_pair_p (s); s = ly_cdr (s))
+ gh_pair_p (s); s = gh_cdr (s))
{
- Grob * break_item = unsmob_grob (ly_car (s));
+ Grob * break_item = unsmob_grob (gh_car (s));
- if (!ly_c_symbol_p (break_item->get_property ("break-align-symbol")))
+ if (!gh_symbol_p (break_item->get_property ("break-align-symbol")))
continue;
Interval ext = break_item->extent (col, X_AXIS);
Invariant for the data structure.
- if (ly_c_pair_p (cursor_))
+ if (gh_pair_p (cursor_))
iter_->music_ == unsmob_music (ly_car (cursor_))
else
iter_ == 0;
Grace_fixup *head = 0;
Grace_fixup **tail = &head;
- for (; ly_c_pair_p (cursor); cursor = ly_cdr (cursor))
+ for (; gh_pair_p (cursor); cursor = ly_cdr (cursor))
{
Music *mus = unsmob_music (ly_car (cursor));
Moment s = mus->start_mom ();
cursor_ = get_music_list ();
iter_ = 0;
- if (ly_c_pair_p (cursor_))
+ if (gh_pair_p (cursor_))
{
Music *m = unsmob_music (ly_car (cursor_));
iter_ = unsmob_iterator (get_iterator (m));
cursor_ = ly_cdr (cursor_);
iter_->quit ();
- if (ly_c_pair_p (cursor_))
+ if (gh_pair_p (cursor_))
iter_ = unsmob_iterator (get_iterator (unsmob_music (ly_car (cursor_))));
else
iter_ = 0;
Side_position_interface::aligned_on_support_extents (SCM element_smob, SCM axis)
{
Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) ly_scm2int (axis);
+ Axis a = (Axis) gh_scm2int (axis);
return general_side_position (me, a, true);
}
Grob * st = Staff_symbol_referencer::get_staff_symbol (me);
bool include_staff = (st
&& a == Y_AXIS
- && ly_c_number_p (me->get_property ("staff-padding")));
+ && gh_number_p (me->get_property ("staff-padding")));
Interval dim;
if (include_staff)
- return scm_make_real (total_off);
+ return gh_double2scm (total_off);
}
/*
Side_position_interface::aligned_on_support_refpoints (SCM smob, SCM axis)
{
Grob *me = unsmob_grob (smob);
- Axis a = (Axis) ly_scm2int (axis);
+ Axis a = (Axis) gh_scm2int (axis);
return general_side_position (me, a, false);
}
rp += d;
}
- return scm_make_real ((rp - p) * Staff_symbol_referencer::staff_space (me) / 2.0);
+ return gh_double2scm ((rp - p) * Staff_symbol_referencer::staff_space (me) / 2.0);
}
- return scm_make_real (0.0);
+ return gh_double2scm (0.0);
}
/*
Side_position_interface::aligned_side (SCM element_smob, SCM axis)
{
Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) ly_scm2int (axis);
+ Axis a = (Axis) gh_scm2int (axis);
Direction d = Side_position_interface::get_direction (me);
- Real o = ly_scm2double (aligned_on_support_extents (element_smob,axis));
+ Real o = gh_scm2double (aligned_on_support_extents (element_smob,axis));
Interval iv = me->extent (me, a);
*/
Grob * st = Staff_symbol_referencer::get_staff_symbol (me);
if (st && a == Y_AXIS
- && ly_c_number_p (me->get_property ("staff-padding")))
+ && gh_number_p (me->get_property ("staff-padding")))
{
Real padding=
Staff_symbol_referencer::staff_space (me)
- * ly_scm2double (me->get_property ("staff-padding"));
+ * gh_scm2double (me->get_property ("staff-padding"));
Grob *common = me->common_refpoint (st, Y_AXIS);
o += (d* (diff >? 0));
}
- return scm_make_real (o);
+ return gh_double2scm (o);
}
if (me->has_offset_callback (Side_position_interface::aligned_side_proc, X_AXIS)
|| me->has_offset_callback (Side_position_interface::aligned_side_proc , X_AXIS))
return X_AXIS;
+
return Y_AXIS;
}
+
+
ADD_INTERFACE (Side_position_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 "
Link_array<Grob> cols (icols);
for (int i = cols.size (); i--;)
- if (ly_c_pair_p (cols[i]->get_property ("between-cols")))
+ if (gh_pair_p (cols[i]->get_property ("between-cols")))
{
loose_cols_.push (cols[i]);
cols.del (i);
Spring_smob *spring = 0;
for (SCM s = cols[i]->get_property ("ideal-distances");
- !spring && ly_c_pair_p (s);
+ !spring && gh_pair_p (s);
s = ly_cdr (s))
{
Spring_smob *sp = unsmob_spring (ly_car (s));
for (int i=0; i < cols.size () - 1; i++)
{
for (SCM s = Spaceable_grob::get_minimum_distances (cols[i]);
- ly_c_pair_p (s); s = ly_cdr (s))
+ gh_pair_p (s); s = ly_cdr (s))
{
Grob * other = unsmob_grob (ly_caar (s));
int oi = cols.find_index (other);
if (oi >= 0)
{
- add_rod (i, oi, ly_scm2double (ly_cdar (s)));
+ add_rod (i, oi, gh_scm2double (ly_cdar (s)));
}
}
}
for (int i = sz; i--; )
{
SCM p = positions->cols_[i]->get_property ( "penalty");
- if (ly_c_number_p (p))
+ if (gh_number_p (p))
{
- if (ly_scm2double (p) < -9999)
+ if (gh_scm2double (p) < -9999)
break_satisfy = break_satisfy && (i == 0 || i == sz -1);
- if (ly_scm2double (p) > 9999)
+ if (gh_scm2double (p) > 9999)
break_satisfy = break_satisfy && !(i == 0 || i == sz -1);
}
void
Simultaneous_music_iterator::derived_substitute (Context *f,Context *t)
{
- for (SCM s = children_list_; ly_c_pair_p (s); s = ly_cdr (s))
- unsmob_iterator (ly_car (s))-> substitute_outlet (f,t);
+ for (SCM s = children_list_; gh_pair_p (s); s = gh_cdr (s))
+ unsmob_iterator (gh_car (s))-> substitute_outlet (f,t);
}
void
children_list_ = SCM_EOL;
SCM * tail = &children_list_;
- for (; ly_c_pair_p (i); i = ly_cdr (i), j++)
+ for (; gh_pair_p (i); i = ly_cdr (i), j++)
{
Music *mus = unsmob_music (ly_car (i));
/* if create_separate_contexts_ is set, create a new context with the
number number as name */
- SCM name = ly_symbol2scm (get_outlet ()->context_name ().to_str0 ());
+ SCM name = unsmob_context_def (get_outlet ()->definition_)->get_context_name ();
Context * t = (j && create_separate_contexts_)
? get_outlet ()->find_create_context (name, to_string (j), SCM_EOL)
: get_outlet ();
Simultaneous_music_iterator::process (Moment until)
{
SCM *proc = &children_list_;
- while (ly_c_pair_p (*proc))
+ while (gh_pair_p (*proc))
{
- Music_iterator * i = unsmob_iterator (ly_car (*proc));
+ Music_iterator * i = unsmob_iterator (gh_car (*proc));
if (i->run_always ()
|| i->pending_moment () == until)
{
if (!i->ok ())
{
i->quit ();
- *proc = ly_cdr (*proc);
+ *proc = gh_cdr (*proc);
}
else
{
Moment next;
next.set_infinite (1);
- for (SCM s = children_list_; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = children_list_; gh_pair_p (s); s = gh_cdr (s))
{
- Music_iterator * it = unsmob_iterator (ly_car (s));
+ Music_iterator * it = unsmob_iterator (gh_car (s));
next = next <? it->pending_moment ();
}
Simultaneous_music_iterator::ok () const
{
bool run_always_ok = false;
- for (SCM s = children_list_; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = children_list_; gh_pair_p (s); s = gh_cdr (s))
{
- Music_iterator * it = unsmob_iterator (ly_car (s));
+ Music_iterator * it = unsmob_iterator (gh_car (s));
if (!it->run_always ())
return true;
else
bool
Simultaneous_music_iterator::run_always () const
{
- for (SCM s = children_list_; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = children_list_; gh_pair_p (s); s = gh_cdr (s))
{
- Music_iterator * it = unsmob_iterator (ly_car (s));
+ Music_iterator * it = unsmob_iterator (gh_car (s));
if (it->run_always ())
return true;
}
Simultaneous_music_iterator::try_music_in_children (Music *m) const
{
Music_iterator * b=0;
- for (SCM s = children_list_; !b && ly_c_pair_p (s); s = ly_cdr (s))
- b =unsmob_iterator (ly_car (s))->try_music (m);
+ for (SCM s = children_list_; !b && gh_pair_p (s); s = gh_cdr (s))
+ b =unsmob_iterator (gh_car (s))->try_music (m);
return b;
}
void
Simultaneous_music_iterator::do_quit ()
{
- for (SCM s = children_list_; ly_c_pair_p (s); s = ly_cdr (s))
- unsmob_iterator (ly_car (s))->quit ();
+ for (SCM s = children_list_; gh_pair_p (s); s = gh_cdr (s))
+ unsmob_iterator (gh_car (s))->quit ();
}
IMPLEMENT_CTOR_CALLBACK (Simultaneous_music_iterator);
{
if (repeat_ && now_mom () == next_moment_)
{
- beat_slash_ = make_item ("RepeatSlash", repeat_->self_scm ());
+ beat_slash_ = make_item ("RepeatSlash");
+ announce_grob (beat_slash_, repeat_->self_scm ());
next_moment_ = next_moment_ + body_length_;
get_global_context ()->add_moment_to_process (next_moment_);
void
Slash_repeat_engraver::stop_translation_timestep ()
{
- beat_slash_ = 0;
+ if (beat_slash_)
+ {
+ typeset_grob (beat_slash_);
+ beat_slash_ = 0;
+ }
}
*/
#include "warn.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "slur-bezier-bow.hh"
Slur_bezier_bow::Slur_bezier_bow (Array<Offset> encompass, Direction dir,
if (fit_factor () > 1.0)
blow_fit ();
- Real pct_c0 = ly_scm2double (ly_cdr (scm_assoc (ly_symbol2scm ("bezier-pct-c0"), bezier_props)));
- Real pct_c3 = ly_scm2double (ly_cdr (scm_assoc (ly_symbol2scm ("bezier-pct-c3"), bezier_props)));
- Real pct_in_max = ly_scm2double (ly_cdr (scm_assoc (ly_symbol2scm ("bezier-pct-in-max"), bezier_props)));
- Real pct_out_max = ly_scm2double (ly_cdr (scm_assoc (ly_symbol2scm ("bezier-pct-out-max"), bezier_props)));
- Real steps = ly_scm2double (ly_cdr (scm_assoc (ly_symbol2scm ("bezier-area-steps"),bezier_props)));
+ Real pct_c0 = gh_scm2double (ly_cdr (scm_assoc (ly_symbol2scm ("bezier-pct-c0"), bezier_props)));
+ Real pct_c3 = gh_scm2double (ly_cdr (scm_assoc (ly_symbol2scm ("bezier-pct-c3"), bezier_props)));
+ Real pct_in_max = gh_scm2double (ly_cdr (scm_assoc (ly_symbol2scm ("bezier-pct-in-max"), bezier_props)));
+ Real pct_out_max = gh_scm2double (ly_cdr (scm_assoc (ly_symbol2scm ("bezier-pct-out-max"), bezier_props)));
+ Real steps = gh_scm2double (ly_cdr (scm_assoc (ly_symbol2scm ("bezier-area-steps"),bezier_props)));
for (int i=0; i < steps; i++)
{
void
Slur_engraver::set_melisma (bool m)
{
- context ()->set_property ("slurMelismaBusy", m ? SCM_BOOL_T :SCM_BOOL_F);
+ daddy_context_->set_property ("slurMelismaBusy", m ? SCM_BOOL_T :SCM_BOOL_F);
}
void
{
// push a new slur onto stack.
// (use temp. array to wait for all slur STOPs)
- Grob* slur = make_spanner ("Slur", slur_ev->self_scm ());
+ Grob* slur = make_spanner ("Slur");
Slur::set_interface (slur); // cannot remove yet!
if (Direction updown = to_dir (slur_ev->get_property ("direction")))
{
- slur->set_property ("direction", scm_int2num (updown));
+ slur->set_property ("direction", gh_int2scm (updown));
}
start_slurs.push (slur);
events_.push (slur_ev);
+ announce_grob (slur, slur_ev->self_scm ());
}
}
void
Slur_engraver::stop_translation_timestep ()
{
+ for (int i = 0; i < end_slurs_.size (); i++)
+ {
+ typeset_grob (end_slurs_[i]);
+ }
end_slurs_.clear ();
new_slur_evs_.clear ();
}
bool slur_;
};
-Slur_performer::Slur_performer ()
-{
- slur_ = false;
- start_ev_ = 0;
- now_stop_ev_ = 0;
-}
-
-
void
Slur_performer::process_music ()
{
void
Slur_performer::set_melisma (bool ml)
{
- context ()->set_property ("slurMelismaBusy", ml ? SCM_BOOL_T :SCM_BOOL_F);
+ daddy_context_->set_property ("slurMelismaBusy", ml ? SCM_BOOL_T :SCM_BOOL_F);
}
void
ENTER_DESCRIPTION (Slur_performer,"","",
"slur-event","","","");
+Slur_performer::Slur_performer ()
+{
+ slur_ = false;
+}
#include "group-interface.hh"
#include "slur.hh"
#include "lookup.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "note-column.hh"
#include "stem.hh"
#include "paper-column.hh"
Real f = default_height / length;
SCM up = me->get_property ("de-uglify-parameters");
- Real c1 = ly_scm2double (ly_car (up));
- Real c2 = ly_scm2double (ly_cadr (up));
- Real c3 = ly_scm2double (ly_caddr (up));
+ Real c1 = gh_scm2double (ly_car (up));
+ Real c2 = gh_scm2double (ly_cadr (up));
+ Real c3 = gh_scm2double (ly_caddr (up));
if (h > c1 * f)
{
return SCM_UNSPECIFIED;
}
set_extremities (me);
- if (!ly_c_pair_p (me->get_property ("control-points")))
+ if (!gh_pair_p (me->get_property ("control-points")))
set_control_points (me);
return SCM_UNSPECIFIED;
}
Avoid too steep slurs.
*/
SCM s = me->get_property ("slope-limit");
- if (ly_c_number_p (s))
+ if (gh_number_p (s))
{
Array<Offset> encompass = get_encompass_offsets (me);
Drul_array<Offset> attachment;
Real slope = slope = abs (dy / dx);
- Real limit = ly_scm2double (s);
+ Real limit = gh_scm2double (s);
if (slope > limit)
{
Real staff_space = Staff_symbol_referencer::staff_space ((Grob*)me);
- Direction dir = (Direction)ly_scm2int (me->get_property ("direction"));
+ Direction dir = (Direction)gh_scm2int (me->get_property ("direction"));
Direction d = (Direction) (- dir * (sign (dy)));
SCM a = me->get_property ("attachment-offset");
Drul_array<Offset> o;
o[d][Y_AXIS] *= get_grob_direction (me);
me->set_property ("attachment-offset",
- scm_cons (ly_offset2scm (o[LEFT]),
+ gh_cons (ly_offset2scm (o[LEFT]),
ly_offset2scm (o[RIGHT])));
}
}
SCM att = me->get_property ("attachment");
/*
*/
- if (!ly_c_pair_p (att))
+ if (!gh_pair_p (att))
{
programming_error ("attachment is not a cons?!");
- att = scm_cons (SCM_EOL, SCM_EOL);
+ att = gh_cons (SCM_EOL, SCM_EOL);
me->set_property ("attachment", att);
}
do
{
- if (!ly_c_symbol_p (index_get_cell (att, dir)))
+ if (!gh_symbol_p (index_get_cell (att, dir)))
{
SCM p = me->get_property ("extremity-function");
SCM res = ly_symbol2scm ("head");
- if (ly_c_procedure_p (p))
- res = scm_call_2 (p, me->self_scm (), scm_int2num (dir));
+ if (gh_procedure_p (p))
+ res = gh_call2 (p, me->self_scm (), gh_int2scm (dir));
- if (ly_c_symbol_p (res))
+ if (gh_symbol_p (res))
index_set_cell (att, dir, res);
}
}
{
SCM cols = me->get_property ("note-columns");
- if (!ly_c_pair_p (cols))
+ if (!gh_pair_p (cols))
{
programming_error ("No note-columns in slur?");
me->suicide ();
Grob **common)
{
SCM s = me->get_property ("attachment");
- if (!ly_c_pair_p (s) || !ly_c_symbol_p (index_get_cell (s, dir)))
+ if (!gh_pair_p (s) || !gh_symbol_p (index_get_cell (s, dir)))
{
s = set_extremities (me);
}
int stemdir = stem ? Stem::get_direction (stem) : 1;
SCM l = scm_assoc
(scm_list_n (a,
- scm_int2num (stemdir * dir),
- scm_int2num (slurdir * dir),
+ gh_int2scm (stemdir * dir),
+ gh_int2scm (slurdir * dir),
SCM_UNDEFINED), alist);
if (l != SCM_BOOL_F)
SCM
Slur::height (SCM smob, SCM ax)
{
- Axis a = (Axis)ly_scm2int (ax);
+ Axis a = (Axis)gh_scm2int (ax);
Grob * me = unsmob_grob (smob);
assert (a == Y_AXIS);
TODO: replace dashed with generic property.
*/
SCM d = me->get_property ("dashed");
- if (ly_c_number_p (d))
+ if (gh_number_p (d))
a = Lookup::dashed_slur (one, thick, thick * robust_scm2double (d, 0));
else
a = Lookup::slur (one, get_grob_direction (me) * base_thick * ss / 10.0,
SCM r_0_scm = me->get_property ("ratio");
Real r_0 = robust_scm2double (r_0_scm, 1);
- Real h_inf = staff_space * ly_scm2double (h_inf_scm);
+ Real h_inf = staff_space * gh_scm2double (h_inf_scm);
Slur_bezier_bow bb (get_encompass_offsets (me),
get_grob_direction (me),
SCM ssb = me->get_property ("beautiful");
Real sb = 0;
- if (ly_c_number_p (ssb))
- sb = ly_scm2double (ssb);
+ if (gh_number_p (ssb))
+ sb = gh_scm2double (ssb);
bb.minimise_enclosed_area (sb, details);
SCM sbf = scm_assq (ly_symbol2scm ("force-blowfit"), details);
Real bff = 1.0;
- if (ly_c_pair_p (sbf) && ly_c_number_p (ly_cdr (sbf)))
- bff = ly_scm2double (ly_cdr (sbf));
+ if (gh_pair_p (sbf) && gh_number_p (ly_cdr (sbf)))
+ bff = gh_scm2double (ly_cdr (sbf));
bb.curve_.control_[1][Y_AXIS] *= bff;
bb.curve_.control_[2][Y_AXIS] *= bff;
SCM controls = SCM_EOL;
for (int i= 4; i--;)
{
- controls = scm_cons (ly_offset2scm (b.control_[i]), controls);
+ controls = gh_cons (ly_offset2scm (b.control_[i]), controls);
/*
BRRR WHURG.
All these null control-points, where do they all come from?
int i = 0;
SCM attach = me->get_property ("attachment");
- if (!ly_c_pair_p (attach))
+ if (!gh_pair_p (attach))
attach = set_extremities (me);
if (!get_grob_direction (me)
- || ! ly_c_symbol_p (index_get_cell (attach, LEFT))
- || ! ly_c_symbol_p (index_get_cell (attach, RIGHT)))
+ || ! gh_symbol_p (index_get_cell (attach, LEFT))
+ || ! gh_symbol_p (index_get_cell (attach, RIGHT)))
set_extremities (me);
- if (!ly_c_pair_p (me->get_property ("control-points")))
+ if (!gh_pair_p (me->get_property ("control-points")))
set_control_points (me);
// set_control_points may suicide
contents_str0_ = chs.remove_array ();
}
-char*
-gulp_file (String filename, int *filesize)
+
+
+char *
+gulp_file (String fn, int* len)
{
- /* "b" must ensure to open literally, avoiding text (CR/LF)
- conversions. */
- FILE *f = fopen (filename.to_str0 (), "rb");
+ /*
+ let's hope that "b" opens anything binary, and does not apply
+ CR/LF translation
+ */
+ FILE * f = fopen (fn.to_str0 (), "rb");
+
if (!f)
{
- warning (_f ("can't open file: `%s'", filename.to_str0 ()));
+ warning (_f ("can't open file: `%s'", fn.to_str0 ()));
return 0;
}
- fseek (f, 0, SEEK_END);
- *filesize = ftell (f);
+ int ret = fseek (f, 0, SEEK_END);
+
+ *len = ftell (f);
rewind (f);
+ char * str = new char[*len+1];
+ str[*len] = 0;
+ ret = fread (str, sizeof (char), *len, f);
- char *str = new char[*filesize + 1];
- str[*filesize] = 0;
+ if (ret!=*len)
+ warning (_f ("Huh? Got %d, expected %d characters", ret, *len));
- int bytes_read = fread (str, sizeof (char), *filesize, f);
- if (bytes_read != *filesize)
- warning (_f ("Huh? Got %d, expected %d characters", bytes_read,
- *filesize));
fclose (f);
+
return str;
}
+/*
+ Unused.
+ */
Source_file::Source_file (String filename, String data)
{
name_ = filename;
void
Source_file::init_port ()
{
- SCM str = scm_makfrom0str (contents_str0_);
- str_port_ = scm_mkstrport (SCM_INUM0, str, SCM_OPN | SCM_RDNG, __FUNCTION__);
- scm_set_port_filename_x (str_port_, scm_makfrom0str (name_.get_str0 ()));
+ SCM str =scm_makfrom0str (contents_str0_);
+
+ str_port_ = scm_mkstrport (SCM_INUM0, str, SCM_OPN | SCM_RDNG,
+ __FUNCTION__);
+ scm_set_port_filename_x (str_port_,
+ scm_makfrom0str (name_.get_str0()));
}
int
Sources::Sources ()
{
sourcefile_list_ = 0;
- path_= 0;
+ path_C_= 0;
is_binary_ = false;
}
void
Sources::set_path (File_path *f)
{
- path_ = f;
+ path_C_ = f;
}
/**
Source_file*
Sources::get_file (String &file_string) //UGH
{
- if ((file_string != "-") && path_)
+ if ((file_string != "-") && path_C_)
{
- String file_string_o = path_->find (file_string);
+ String file_string_o = path_C_->find (file_string);
if ((file_string_o == "") && (file_string != ""))
return 0;
file_string = file_string_o;
SCM mins = get_minimum_distances (me);
- SCM newdist = scm_make_real (d);
- for (SCM s = mins; ly_c_pair_p (s); s = ly_cdr (s))
+ SCM newdist = gh_double2scm (d);
+ for (SCM s = mins; gh_pair_p (s); s = ly_cdr (s))
{
SCM dist = ly_car (s);
if (ly_car (dist) == p->self_scm ())
{
- scm_set_cdr_x (dist, scm_max (ly_cdr (dist),
+ gh_set_cdr_x (dist, scm_max (ly_cdr (dist),
newdist));
return ;
}
}
- mins = scm_cons (scm_cons (p->self_scm (), newdist), mins);
+ mins = gh_cons (gh_cons (p->self_scm (), newdist), mins);
me->set_property ("minimum-distances", mins);
}
#ifndef NDEBUG
SCM mins = me->get_property ("ideal-distances");
- for (SCM s = mins; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = mins; gh_pair_p (s); s = ly_cdr (s))
{
Spring_smob * sp = unsmob_spring(ly_car (s));
if (sp->other_ == p)
{
if (!spacing_)
{
- spacing_ = make_spanner ("SpacingSpanner", SCM_EOL);
+ spacing_ = make_spanner ("SpacingSpanner");
spacing_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn")));
-
+ announce_grob (spacing_, SCM_EOL);
}
}
Grob * p = unsmob_grob (get_property ("currentCommandColumn"));
spacing_->set_bound (RIGHT, p);
+ typeset_grob (spacing_);
spacing_ =0;
}
}
#include "main.hh"
#include "system.hh"
#include "warn.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "paper-score.hh"
#include "paper-column.hh"
#include "item.hh"
such a borderline case.)
*/
- if (!ly_c_pair_p (lns) || !ly_c_pair_p (rns))
+ if (!gh_pair_p (lns) || !gh_pair_p (rns))
return false;
- Item * l_neighbor = dynamic_cast<Item*> (unsmob_grob (ly_car (lns)));
- Item * r_neighbor = dynamic_cast<Item*> (unsmob_grob (ly_car (rns)));
+ Item * l_neighbor = dynamic_cast<Item*> (unsmob_grob (gh_car (lns)));
+ Item * r_neighbor = dynamic_cast<Item*> (unsmob_grob (gh_car (rns)));
if (!l_neighbor || !r_neighbor)
return false;
in any case, we don't want to move bar lines.
*/
- for (SCM e = c->get_property ("elements"); ly_c_pair_p (e); e = ly_cdr (e))
+ for (SCM e = c->get_property ("elements"); gh_pair_p (e); e = gh_cdr (e))
{
- Grob * g = unsmob_grob (ly_car (e));
+ Grob * g = unsmob_grob (gh_car (e));
if (g && Break_align_interface::has_interface (g))
{
- for (SCM s = g->get_property ("elements"); ly_c_pair_p (s);
- s = ly_cdr (s))
+ for (SCM s = g->get_property ("elements"); gh_pair_p (s);
+ s = gh_cdr (s))
{
- Grob *h = unsmob_grob (ly_car (s));
+ Grob *h = unsmob_grob (gh_car (s));
/*
ugh. -- fix staff-bar name?
if (loose_column (cols->elem (i-1), c, cols->elem (i+1)))
{
SCM lns = c->get_property ("left-neighbors");
- lns = ly_c_pair_p (lns) ? ly_car (lns) : SCM_BOOL_F;
+ lns = gh_pair_p (lns) ? gh_car (lns) : SCM_BOOL_F;
SCM rns = c->get_property ("right-neighbors");
- rns = ly_c_pair_p (rns) ? ly_car (rns) : SCM_BOOL_F;
+ rns = gh_pair_p (rns) ? gh_car (rns) : SCM_BOOL_F;
/*
Either object can be non existent, if the score ends
prematurely.
*/
- rns = ly_car (unsmob_grob (rns)->get_property ("right-items"));
- c->set_property ("between-cols", scm_cons (lns,
+ rns = gh_car (unsmob_grob (rns)->get_property ("right-items"));
+ c->set_property ("between-cols", gh_cons (lns,
rns));
/*
Item *rc = dynamic_cast<Item*> (d == LEFT ? c : next_door[RIGHT]);
for (SCM s = lc->get_property ("spacing-wishes");
- ly_c_pair_p (s); s = ly_cdr (s))
+ gh_pair_p (s); s = gh_cdr (s))
{
- Grob *sp = unsmob_grob (ly_car (s));
+ Grob *sp = unsmob_grob (gh_car (s));
if (Note_spacing::left_column (sp) != lc
|| Note_spacing::right_column (sp) != rc)
continue;
SCM wishes= cols[i]->get_property ("spacing-wishes");
- for (SCM s =wishes; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s =wishes; gh_pair_p (s); s = gh_cdr (s))
{
- Item * wish = dynamic_cast<Item*> (unsmob_grob (ly_car (s)));
+ Item * wish = dynamic_cast<Item*> (unsmob_grob (gh_car (s)));
Item * lc = wish->get_column ();
Grob * right = Note_spacing::right_column (wish);
right_neighbors =SCM_EOL;
min_rank = right_rank;
- right_neighbors = scm_cons (wish->self_scm (), right_neighbors);
+ right_neighbors = gh_cons (wish->self_scm (), right_neighbors);
}
/*
*/
int maxrank = 0;
SCM left_neighs = rc->get_property ("left-neighbors");
- if (ly_c_pair_p (left_neighs)
- && unsmob_grob (ly_car (left_neighs)))
+ if (gh_pair_p (left_neighs)
+ && unsmob_grob (gh_car (left_neighs)))
{
- Item * it = dynamic_cast<Item*> (unsmob_grob (ly_car (left_neighs)));
+ Item * it = dynamic_cast<Item*> (unsmob_grob (gh_car (left_neighs)));
maxrank = Paper_column::get_rank (it->get_column ());
}
if (left_rank > maxrank)
left_neighs = SCM_EOL;
- left_neighs = scm_cons (wish->self_scm (), left_neighs);
+ left_neighs = gh_cons (wish->self_scm (), left_neighs);
rc->set_property ("left-neighbors", right_neighbors);
}
}
- if (ly_c_pair_p (right_neighbors))
+ if (gh_pair_p (right_neighbors))
{
cols[i]->set_property ("right-neighbors", right_neighbors);
}
sloppy with typnig left/right-neighbors should take list, but paper-column found instead.
*/
SCM ln = cols[i] ->get_property ("left-neighbors");
- if (!ly_c_pair_p (ln) && i )
+ if (!gh_pair_p (ln) && i )
{
- cols[i]->set_property ("left-neighbors", scm_cons (cols[i-1]->self_scm (), SCM_EOL));
+ cols[i]->set_property ("left-neighbors", gh_cons (cols[i-1]->self_scm (), SCM_EOL));
}
SCM rn = cols[i] ->get_property ("right-neighbors");
- if (!ly_c_pair_p (rn) && i < cols.size () - 1)
+ if (!gh_pair_p (rn) && i < cols.size () - 1)
{
- cols[i]->set_property ("right-neighbors", scm_cons (cols[i + 1]->self_scm (), SCM_EOL));
+ cols[i]->set_property ("right-neighbors", gh_cons (cols[i + 1]->self_scm (), SCM_EOL));
}
}
}
{
Grob *me = unsmob_grob (smob);
- /*
- can't use get_system() ? --hwn.
- */
Link_array<Grob> all (me->pscore_->system_->columns ());
set_explicit_neighbor_columns (all);
happens after the current note (this is set in the grob
property SPACING-SEQUENCE.
*/
- for (SCM s = seq; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = seq; gh_pair_p (s); s = ly_cdr (s))
{
- Grob * wish = unsmob_grob (ly_car (s));
+ Grob * wish = unsmob_grob (gh_car (s));
Item *wish_rcol = Note_spacing::right_column (wish);
if (Note_spacing::left_column (wish) != lc
*/
compound_fixed_note_space = compound_fixed_note_space <? compound_note_space;
- bool packed = to_boolean (me->get_paper ()->c_variable ("packed"));
+ bool packed = to_boolean (me->get_paper ()->get_scmvar ("packed"));
Real strength, distance;
/*
if (dt == Moment (0,0))
{
for (SCM s = l->get_property ("spacing-wishes");
- ly_c_pair_p (s); s = ly_cdr (s))
+ gh_pair_p (s); s = gh_cdr (s))
{
- Item * spacing_grob = dynamic_cast<Item*> (unsmob_grob (ly_car (s)));
+ Item * spacing_grob = dynamic_cast<Item*> (unsmob_grob (gh_car (s)));
if (!spacing_grob || !Staff_spacing::has_interface (spacing_grob))
continue;
if (!span_arpeggio_ && arpeggios_.size () > 1
&& to_boolean (get_property ("connectArpeggios")))
{
- span_arpeggio_ = make_item ("Arpeggio", SCM_EOL);
-
+ span_arpeggio_ = make_item ("Arpeggio");
+ announce_grob (span_arpeggio_, SCM_EOL);
}
}
for (int i=0; i < arpeggios_.size (); i ++)
{
for (SCM s = arpeggios_[i]->get_property ("stems");
- ly_c_pair_p (s); s = ly_cdr (s))
+ gh_pair_p (s); s = ly_cdr (s))
Group_interface::add_thing (span_arpeggio_, ly_symbol2scm ("stems"), ly_car (s));
for (SCM s = arpeggios_[i]->get_property ("side-support-elements");
- ly_c_pair_p (s); s = ly_cdr (s))
+ gh_pair_p (s); s = ly_cdr (s))
Group_interface::add_thing (span_arpeggio_, ly_symbol2scm ("side-support-elements"), ly_car (s));
/*
arpeggios_[i]->set_property ("print-function", SCM_EOL);
}
+ typeset_grob (span_arpeggio_);
span_arpeggio_ = 0;
}
arpeggios_.clear ();
if (bars_.size () >= 2 && !spanbar_)
{
- spanbar_ = make_item ("SpanBar", SCM_EOL);
+ spanbar_ = make_item ("SpanBar");
spanbar_->set_parent (bars_[0], X_AXIS);
-
+ announce_grob (spanbar_, SCM_EOL);
}
}
}
SCM vissym =ly_symbol2scm ("break-visibility");
SCM vis = bars_[0]->internal_get_property (vissym);
- if (ly_c_equal_p (spanbar_->internal_get_property (vissym), vis))
+ if (gh_equal_p (spanbar_->internal_get_property (vissym), vis))
spanbar_->internal_set_property (vissym, vis);
-
+ typeset_grob (spanbar_);
spanbar_ =0;
}
bars_.set_size (0);
#include "span-bar.hh"
#include "font-interface.hh"
#include "dimensions.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "stencil.hh"
#include "warn.hh"
#include "axis-group-interface.hh"
/* compute common refpoint of elements */
Grob *refp = me;
- for (SCM elts = first_elt; ly_c_pair_p (elts); elts = ly_cdr (elts))
+ for (SCM elts = first_elt; gh_pair_p (elts); elts = ly_cdr (elts))
{
SCM smobbed_staff_bar = ly_car (elts);
Grob *staff_bar = unsmob_grob (smobbed_staff_bar);
/* glyph may not be a string, when ME is killed by Hara Kiri in
between. */
- if (!ly_c_string_p (glyph))
+ if (!gh_string_p (glyph))
return SCM_EOL;
String glyph_string = ly_scm2string (glyph);
Stencil span_bar_mol;
Interval prev_extent;
- for (SCM elts = first_elt; ly_c_pair_p (elts); elts = ly_cdr (elts))
+ for (SCM elts = first_elt; gh_pair_p (elts); elts = ly_cdr (elts))
{
SCM smobbed_staff_bar = ly_car (elts);
Grob *staff_bar = unsmob_grob (smobbed_staff_bar);
Span_bar::width_callback (SCM element_smob, SCM scm_axis)
{
Grob *se = unsmob_grob (element_smob);
- Axis a = (Axis) ly_scm2int (scm_axis);
+ Axis a = (Axis) gh_scm2int (scm_axis);
assert (a == X_AXIS);
String gl = ly_scm2string (se->get_property ("glyph"));
SCM
Span_bar::before_line_breaking (SCM smob)
{
- Grob * g = unsmob_grob (smob);
- evaluate_empty (g);
- evaluate_glyph (g);
+ evaluate_empty (unsmob_grob (smob));
+ evaluate_glyph (unsmob_grob (smob));
/* No need to call Bar_line::before_line_breaking (), because the info
in ELEMENTS already has been procced by
Span_bar::center_on_spanned_callback (SCM element_smob, SCM axis)
{
Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) ly_scm2int (axis);
+ Axis a = (Axis) gh_scm2int (axis);
assert (a == Y_AXIS);
Interval i (get_spanned_interval (me));
if (i.is_empty ())
{
me->suicide ();
- return scm_make_real (0.0);
+ return gh_double2scm (0.0);
}
- return scm_make_real (i.center ());
+ return gh_double2scm (i.center ());
}
void
/* TODO: filter all hara-kiried out of ELEMENS list, and then
optionally do suicide. Call this cleanage function from
center_on_spanned_callback () as well. */
- if (!ly_c_pair_p (me->get_property ("elements")))
+ if (!gh_pair_p (me->get_property ("elements")))
{
me->suicide ();
}
{
SCM gl = me->get_property ("glyph");
- if (ly_c_string_p (gl))
+ if (gh_string_p (gl))
return ;
for (SCM s = me->get_property ("elements");
- !ly_c_string_p (gl) && ly_c_pair_p (s); s = ly_cdr (s))
+ !gh_string_p (gl) && gh_pair_p (s); s = gh_cdr (s))
{
- gl = unsmob_grob (ly_car (s))
+ gl = unsmob_grob (gh_car (s))
->get_property ("glyph");
}
- if (!ly_c_string_p (gl))
+ if (!gh_string_p (gl))
{
me->suicide ();
return;
Span_bar::get_spanned_interval (Grob*me)
{
return ly_scm2interval (Axis_group_interface::group_extent_callback
- (me->self_scm (), scm_int2num (Y_AXIS)));
+ (me->self_scm (), gh_int2scm (Y_AXIS)));
}
{
/* This happens if the bars are hara-kiried from under us. */
me->suicide ();
- return scm_make_real (-1);
+ return gh_double2scm (-1);
}
- return scm_make_real (iv.length ());
+ return gh_double2scm (iv.length ());
}
int
Spring_smob::print_smob (SCM s, SCM p, scm_print_state *)
{
- scm_puts ("#<Spring smob>", p);
+ Spring_smob *ss = unsmob_spring (s);
+ scm_puts (_f ("#<spring smob d= %f>", ss->distance_).to_str0 (), p);
return 1;
}
if (Staff_symbol::has_interface (gi.grob_))
{
SCM staffs = get_property ("stavesFound");
- staffs = scm_cons (gi.grob_->self_scm (), staffs);
+ staffs = gh_cons (gi.grob_->self_scm (), staffs);
- context ()->set_property ("stavesFound", staffs);
+ daddy_context_->set_property ("stavesFound", staffs);
}
}
audio_staff_ = new Audio_staff;
announce_element (Audio_element_info (audio_staff_, 0));
- name_ = new Audio_text (Audio_text::TRACK_NAME, context ()->id_string ());
+ name_ = new Audio_text (Audio_text::TRACK_NAME, daddy_context_->id_string_);
announce_element (Audio_element_info (name_, 0));
tempo_ = new Audio_tempo (get_tempo ());
{
SCM proc = ly_scheme_function ("percussion?");
- SCM drums = scm_call_1 (proc, ly_symbol2scm (instrument_string_.to_str0 ()));
+ SCM drums = gh_call1 (proc, ly_symbol2scm (instrument_string_.to_str0 ()));
audio_staff_->channel_ = (drums == SCM_BOOL_T ? 9 : -1 );
if (name_)
{
// mustn't ask Score for instrument: it will return piano!
SCM minstr = get_property ("midiInstrument");
- if (!ly_c_string_p (minstr)
+ if (!gh_string_p (minstr)
|| ly_scm2string (minstr) == instrument_string_)
return "";
{
SCM glyph = bar_grob->get_property ("glyph");
- String glyph_string = ly_c_string_p (glyph) ? ly_scm2string (glyph) : "";
+ String glyph_string = gh_string_p (glyph) ? ly_scm2string (glyph) : "";
if (glyph_string.left_string (1) == "|" || glyph_string.left_string (1) == ".")
{
SCM sz = Bar_line::get_staff_bar_size (bar_grob->self_scm ());
Real max_corr =0.0;
for (SCM s = me->get_property ("right-items");
- ly_c_pair_p (s); s = ly_cdr (s))
+ gh_pair_p (s); s = gh_cdr (s))
{
- Grob * g = unsmob_grob (ly_car (s));
+ Grob * g = unsmob_grob (gh_car (s));
max_corr = max_corr >? next_note_correction (me, g, bar_size);
for (SCM t = g->get_property ("elements");
- ly_c_pair_p (t); t = ly_cdr (t))
- max_corr = max_corr >? next_note_correction (me, unsmob_grob (ly_car (t)), bar_size);
+ gh_pair_p (t); t = gh_cdr (t))
+ max_corr = max_corr >? next_note_correction (me, unsmob_grob (gh_car (t)), bar_size);
}
Item * me_item = dynamic_cast<Item*> (me);
for (SCM s = me->get_property ("left-items");
- ly_c_pair_p (s); s = ly_cdr (s))
+ gh_pair_p (s); s = gh_cdr (s))
{
- Grob * cand = unsmob_grob (ly_car (s));
+ Grob * cand = unsmob_grob (gh_car (s));
if (cand && Separation_item::has_interface (cand))
separation_item = cand ;
}
if (me_item->break_status_dir () == CENTER)
{
SCM nndef = scm_sloppy_assq (ly_symbol2scm ("next-note"), alist);
- if (ly_c_pair_p (nndef))
+ if (gh_pair_p (nndef))
space_def = nndef;
}
- if (!ly_c_pair_p (space_def))
+ if (!gh_pair_p (space_def))
{
programming_error ("Unknown prefatory spacing. ");
return;
}
- space_def = ly_cdr (space_def);
- Real distance = ly_scm2double (ly_cdr (space_def));
- SCM type = ly_car (space_def) ;
+ space_def = gh_cdr (space_def);
+ Real distance = gh_scm2double (gh_cdr (space_def));
+ SCM type = gh_car (space_def) ;
*fixed = last_ext[RIGHT];
if (type == ly_symbol2scm ("fixed-space"))
#include "score.hh"
#include "paper-column.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "side-position-interface.hh"
#include "engraver.hh"
#include "moment.hh"
{
if (!span_)
{
- span_ = make_spanner ("StaffSymbol", SCM_EOL);
+ span_ = make_spanner ("StaffSymbol");
span_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn")));
-
+ announce_grob (span_, SCM_EOL);
}
}
if (span_)
{
span_->set_bound (RIGHT,unsmob_grob (get_property ("currentCommandColumn")));
+ typeset_grob (span_);
}
span_ =0;
}
Staff_symbol_engraver::acknowledge_grob (Grob_info s)
{
s.grob_->set_property ("staff-symbol", span_->self_scm ());
+
+ // remove this. probly not necessary?
+ s.grob_->add_dependency (span_); // UGH. UGH. UGH
}
{
int k = scm_ilength (get_property ("stringTunings"));
if (k>=0)
- span_->set_property ("line-count", scm_int2num (k));
+ span_->set_property ("line-count", gh_int2scm (k));
}
}
#include "staff-symbol-referencer.hh"
#include "staff-symbol.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "libc-extension.hh"
Grob *st = get_staff_symbol (me);
if (st)
return Staff_symbol::get_line_thickness (st);
- return me->get_paper ()->get_dimension (ly_symbol2scm ("linethickness"));
+ return me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness"));
}
Real
Real pos = Staff_symbol_referencer::get_position (g);
if (fabs (rint (pos) -pos) < 1e-6) // ugh.
- return scm_int2num ((int) my_round (pos));
+ return gh_int2scm ((int) my_round (pos));
else
- return scm_make_real (pos);
+ return gh_double2scm (pos);
}
SCM pos = me->get_property ("staff-position");
Real off = 0.0;
- if (ly_c_number_p (pos))
+ if (gh_number_p (pos))
{
Real space = Staff_symbol_referencer::staff_space (me);
- off = ly_scm2double (pos) * space / 2.0;
- me->set_property ("staff-position", scm_int2num (0));
+ off = gh_scm2double (pos) * space / 2.0;
+ me->set_property ("staff-position", gh_int2scm (0));
}
- return scm_make_real (off);
+ return gh_double2scm (off);
}
/* This sets the position relative to the center of the staff symbol.
-The function is hairy, because it can be called in two situations:
+The function is hairy, because it can be callled in two situations:
1. There is no staff yet; we must set staff-position
if (st && me->common_refpoint (st, Y_AXIS))
{
Real oldpos = get_position (me);
- me->set_property ("staff-position", scm_make_real (p - oldpos));
+ me->set_property ("staff-position", gh_double2scm (p - oldpos));
}
else
- me->set_property ("staff-position", scm_make_real (p));
+ me->set_property ("staff-position", gh_double2scm (p));
- me->add_offset_callback (Staff_symbol_referencer::callback_proc, Y_AXIS);
+ if (!me->has_offset_callback (Staff_symbol_referencer::callback_proc,
+ Y_AXIS))
+ me->add_offset_callback (Staff_symbol_referencer::callback_proc, Y_AXIS);
}
/* Half of the height, in staff space, i.e. 2.0 for a normal staff. */
#include "lookup.hh"
#include "dimensions.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "stencil.hh"
#include "warn.hh"
#include "item.hh"
do
{
SCM width_scm = me->get_property ("width");
- if (d == RIGHT && ly_c_number_p (width_scm))
+ if (d == RIGHT && gh_number_p (width_scm))
{
/*
don't multiply by Staff_symbol_referencer::staff_space (me),
since that would make aligning staff symbols of different sizes to
one right margin hell.
*/
- span_points[RIGHT] = ly_scm2double (width_scm);
+ span_points[RIGHT] = gh_scm2double (width_scm);
}
else
{
while (flip (&d) !=LEFT);
- Real t = me->get_paper ()->get_dimension (ly_symbol2scm ("linethickness"));
+ Real t = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness"));
t *= robust_scm2double (me->get_property ("thickness"), 1.0);
int l = Staff_symbol::line_count (me);
Staff_symbol::line_count (Grob*me)
{
SCM c = me->get_property ("line-count");
- if (ly_c_number_p (c))
- return ly_scm2int (c);
+ if (gh_number_p (c))
+ return gh_scm2int (c);
else
return 0;
}
Real
Staff_symbol::get_line_thickness (Grob* me)
{
- Real lt = me->get_paper ()->get_dimension (ly_symbol2scm ("linethickness"));
+ Real lt = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness"));
return robust_scm2double (me->get_property ("thickness"), 1.0) * lt;
}
{
SCM stanza = get_property ("stanza");
- if (ly_c_string_p (stanza) && stanza != last_stanza_)
+ if (gh_string_p (stanza) && stanza != last_stanza_)
{
last_stanza_ = stanza;
- text_ = make_item ("StanzaNumber", SCM_EOL);
+ text_ = make_item ("StanzaNumber");
text_->set_property ("text", stanza);
-
+ announce_grob (text_, SCM_EOL);
}
}
void
Stanza_number_engraver::stop_translation_timestep ()
{
- text_ = 0;
+ if (text_)
+ {
+ typeset_grob (text_);
+ text_ = 0;
+ }
}
if (!stem_)
{
- /*
- We announce the cause of the head as cause of the stem.
- The stem needs a rhythmic structure to fit it into a beam. */
- stem_ = make_item ("Stem",i.music_cause ()->self_scm ());
+ stem_ = make_item ("Stem");
- stem_->set_property ("duration-log", scm_int2num (duration_log));
+ stem_->set_property ("duration-log", gh_int2scm (duration_log));
if (tremolo_ev_)
{
the first and last (quarter) note bothe get one tremolo flag.
*/
- int requested_type = ly_scm2int (tremolo_ev_->get_property ("tremolo-type"));
+ int requested_type = gh_scm2int (tremolo_ev_->get_property ("tremolo-type"));
SCM f = get_property ("tremoloFlags");
if (!requested_type)
- if (ly_c_number_p (f))
- requested_type = ly_scm2int (f);
+ if (gh_number_p (f))
+ requested_type = gh_scm2int (f);
else
requested_type = 8;
else
- context ()->set_property ("tremoloFlags", scm_int2num (requested_type));
+ daddy_context_->set_property ("tremoloFlags", gh_int2scm (requested_type));
int tremolo_flags = intlog2 (requested_type) - 2
- (duration_log > 2 ? duration_log - 2 : 0);
if (tremolo_flags)
{
- tremolo_ = make_item ("StemTremolo", tremolo_ev_->self_scm ());
+ tremolo_ = make_item ("StemTremolo");
+ announce_grob (tremolo_, tremolo_ev_->self_scm ());
/*
The number of tremolo flags is the number of flags of
itself.
*/
tremolo_->set_property ("flag-count",
- scm_int2num (tremolo_flags));
+ gh_int2scm (tremolo_flags));
tremolo_->set_parent (stem_, X_AXIS);
stem_->set_property ("tremolo-flag", tremolo_->self_scm ());
tremolo_->set_property ("stem",
}
}
+ /*
+ We announce the cause of the head as cause of the stem.
+ The stem needs a rhythmic structure to fit it into a beam. */
+ announce_grob (stem_, i.music_cause ()->self_scm ());
}
if (Stem::duration_log (stem_) != duration_log)
void
Stem_engraver::stop_translation_timestep ()
{
- tremolo_ = 0;
+ if (tremolo_)
+ {
+ typeset_grob (tremolo_);
+ tremolo_ = 0;
+ }
if (stem_)
{
toDO: junk these properties.
*/
SCM prop = get_property ("stemLeftBeamCount");
- if (ly_c_number_p (prop))
+ if (gh_number_p (prop))
{
- Stem::set_beaming (stem_,ly_scm2int (prop),LEFT);
- context ()->unset_property (ly_symbol2scm ("stemLeftBeamCount"));
+ Stem::set_beaming (stem_,gh_scm2int (prop),LEFT);
+ daddy_context_->unset_property (ly_symbol2scm ("stemLeftBeamCount"));
}
prop = get_property ("stemRightBeamCount");
- if (ly_c_number_p (prop))
+ if (gh_number_p (prop))
{
- Stem::set_beaming (stem_,ly_scm2int (prop), RIGHT);
- context ()->unset_property (ly_symbol2scm ("stemRightBeamCount"));
+ Stem::set_beaming (stem_,gh_scm2int (prop), RIGHT);
+ daddy_context_->unset_property (ly_symbol2scm ("stemRightBeamCount"));
}
-
+ typeset_grob (stem_);
stem_ = 0;
}
*/
+#include "stem-tremolo.hh"
+#include "warn.hh"
#include "beam.hh"
-#include "directional-element-interface.hh"
-#include "item.hh"
+#include "paper-def.hh"
#include "lookup.hh"
-#include "output-def.hh"
-#include "staff-symbol-referencer.hh"
-#include "stem-tremolo.hh"
#include "stem.hh"
-#include "warn.hh"
-
-/* TODO: lengthen stem if necessary */
+#include "item.hh"
+#include "staff-symbol-referencer.hh"
+#include "directional-element-interface.hh"
-MAKE_SCHEME_CALLBACK (Stem_tremolo, dim_callback, 2);
+/*
+ TODO:
+ lengthen stem if necessary
+ */
+MAKE_SCHEME_CALLBACK (Stem_tremolo,dim_callback,2);
-/* todo: init with cons. */
+/*
+ todo: init with cons.
+ */
SCM
Stem_tremolo::dim_callback (SCM e, SCM)
{
- Grob *se = unsmob_grob (e);
+ Grob * se = unsmob_grob (e);
Real space = Staff_symbol_referencer::staff_space (se);
return ly_interval2scm (Interval (-space, space));
}
-/* ugh ? --from Slur */
+/*
+ ugh ? --from Slur
+ */
MAKE_SCHEME_CALLBACK (Stem_tremolo, height, 2);
SCM
Stem_tremolo::height (SCM smob, SCM ax)
{
- Axis a = (Axis)ly_scm2int (ax);
- Grob *me = unsmob_grob (smob);
+ Axis a = (Axis)gh_scm2int (ax);
+ Grob * me = unsmob_grob (smob);
assert (a == Y_AXIS);
SCM mol = me->get_uncached_stencil ();
return ly_interval2scm (Interval ());
}
+
Stencil
Stem_tremolo::raw_stencil (Grob *me)
{
Real dy = 0;
SCM s = beam->get_property ("positions");
if (is_number_pair (s))
- dy = -ly_scm2double (ly_car (s)) +ly_scm2double (ly_cdr (s));
+ {
+ dy = -gh_scm2double (gh_car (s)) +gh_scm2double (gh_cdr (s));
+ }
Real dx = Beam::last_visible_stem (beam)->relative_coordinate (0, X_AXIS)
- Beam::first_visible_stem (beam)->relative_coordinate (0, X_AXIS);
Real ss = Staff_symbol_referencer::staff_space (me);
Real thick = robust_scm2double (me->get_property ("beam-thickness"),1);
Real width = robust_scm2double (me->get_property ("beam-width"),1);
- Real blot = me->get_paper ()->get_dimension (ly_symbol2scm ("blotdiameter"));
+ Real blot = me->get_paper ()->get_realvar (ly_symbol2scm ("blotdiameter"));
width *= ss;
thick *= ss;
Stencil a (Lookup::beam (dydx, width, thick, blot));
- a.translate (Offset (-width * 0.5, width * 0.5 * dydx));
+ a.translate (Offset (-width/2, width / 2 * dydx));
int tremolo_flags = 0;
SCM s = me->get_property ("flag-count");
- if (ly_c_number_p (s))
- tremolo_flags = ly_scm2int (s);
+ if (gh_number_p (s))
+ tremolo_flags = gh_scm2int (s);
if (!tremolo_flags)
{
return Stencil ();
}
- /* Who the fuck is 0.81 ? --hwn. */
+ /*
+ Who the fuck is 0.81 ?
+
+ --hwn.
+ */
Real beam_translation = beam ? Beam::get_beam_translation (beam) : 0.81;
Stencil mol;
return mol;
}
+
MAKE_SCHEME_CALLBACK (Stem_tremolo,print,1);
SCM
Stem_tremolo::print (SCM grob)
Grob *beam = Stem::get_beam (stem);
Direction stemdir = Stem::get_direction (stem);
- if (stemdir == 0)
- stemdir = UP;
-
Real beam_translation
- = (beam && beam->is_live ())
+ = (beam && beam->live ())
? Beam::get_beam_translation (beam)
: 0.81;
Real ss = Staff_symbol_referencer::staff_space (me);
// ugh, rather calc from Stem_tremolo_req
- int beam_count = beam ? (Stem::beam_multiplicity (stem).length () + 1) : 0;
+ int beam_count = (beam) ? (Stem::beam_multiplicity (stem).length () + 1): 0;
+
Real beamthickness = 0.0;
SCM sbt = (beam) ? beam->get_property ("thickness") : SCM_EOL ;
- if (ly_c_number_p (sbt))
- beamthickness = ly_scm2double (sbt) * ss;
+ if (gh_number_p (sbt))
+ {
+ beamthickness = gh_scm2double (sbt) * ss;
+ }
Real end_y
- = Stem::stem_end_position (stem) * ss / 2
+ = Stem::stem_end_position (stem) *ss/2
- stemdir * (beam_count * beamthickness
+ ((beam_count -1) >? 0) * beam_translation);
- /* FIXME: the 0.33 ss is to compensate for the size of the note head. */
- Real chord_start_y = Stem::chord_start_y (stem) + 0.33 * ss * stemdir;
+ /*
+ the 0.33 ss is to compensate for the size of the note head
+ */
+ Real chord_start_y = Stem::chord_start_y (stem) +
+ 0.33 * ss * stemdir;
Real padding = beam_translation;
- /* if there is a flag, just above/below the notehead.
- if there is not enough space, center on remaining space,
- else one beamspace away from stem end. */
+ /*
+ if there is a flag, just above/below the notehead.
+ if there is not enough space, center on remaining space,
+ else one beamspace away from stem end.
+ */
if (!beam && Stem::duration_log (stem) >= 3)
{
mol.align_to (Y_AXIS, -stemdir);
- mol.translate_axis (chord_start_y + 0.5 * stemdir, Y_AXIS);
+ mol.translate_axis (chord_start_y + .5 * stemdir, Y_AXIS);
+ }
+ else if (stemdir * (end_y - chord_start_y) - 2*padding - mol_ext.length () < 0.0)
+ {
+ mol.translate_axis (0.5 * (end_y + chord_start_y) - mol_ext.center (),Y_AXIS);
}
- else if (stemdir * (end_y - chord_start_y) - 2 * padding - mol_ext.length ()
- < 0.0)
- mol.translate_axis (0.5 * (end_y + chord_start_y) - mol_ext.center (),
- Y_AXIS);
else
- mol.translate_axis (end_y - stemdir * beam_translation -mol_ext [stemdir],
- Y_AXIS);
-
+ {
+ mol.translate_axis (end_y - stemdir * beam_translation
+ -mol_ext [stemdir]
+ , Y_AXIS);
+ }
+
return mol.smobbed_copy ();
}
#include "note-head.hh"
#include "stem.hh"
#include "warn.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "rhythmic-head.hh"
#include "font-interface.hh"
#include "stencil.hh"
#include "stem-tremolo.hh"
void
-Stem::set_beaming (Grob *me, int beam_count, Direction d)
+Stem::set_beaming (Grob*me, int beam_count, Direction d)
{
SCM pair = me->get_property ("beaming");
-
- if (!ly_c_pair_p (pair))
+
+ if (!gh_pair_p (pair))
{
- pair = scm_cons (SCM_EOL, SCM_EOL);
+ pair = gh_cons (SCM_EOL, SCM_EOL);
me->set_property ("beaming", pair);
}
- SCM lst = index_get_cell (pair, d);
- for (int i = 0; i < beam_count; i++)
- lst = scm_cons (scm_int2num (i), lst);
- index_set_cell (pair, d, lst);
+ SCM l = index_get_cell (pair, d);
+ for (int i = 0; i< beam_count; i++)
+ {
+ l = gh_cons (gh_int2scm (i), l);
+ }
+ index_set_cell (pair, d, l);
}
+
Interval
-Stem::head_positions (Grob *me)
+Stem::head_positions (Grob*me)
{
- if (head_count (me))
+ if (!head_count (me))
{
- Drul_array<Grob*> e (extremal_heads (me));
- return Interval (Staff_symbol_referencer::get_position (e[DOWN]),
- Staff_symbol_referencer::get_position (e[UP]));
+ Interval iv;
+ return iv;
}
- return Interval ();
+
+ Drul_array<Grob*> e (extremal_heads (me));
+
+ return Interval (Staff_symbol_referencer::get_position (e[DOWN]),
+ Staff_symbol_referencer::get_position (e[UP]));
}
+
Real
-Stem::chord_start_y (Grob *me)
+Stem::chord_start_y (Grob*me)
{
- Interval hp = head_positions (me);
- if (!hp.is_empty ())
- return hp[get_direction (me)] * Staff_symbol_referencer::staff_space (me)
- * 0.5;
- return 0;
+ return head_positions (me)[get_direction (me)]
+ * Staff_symbol_referencer::staff_space (me)/2.0;
}
Real
-Stem::stem_end_position (Grob *me)
+Stem::stem_end_position (Grob*me)
{
- SCM p = me->get_property ("stem-end-position");
+ SCM p =me->get_property ("stem-end-position");
Real pos;
- if (!ly_c_number_p (p))
+ if (!gh_number_p (p))
{
pos = get_default_stem_end_position (me);
- me->set_property ("stem-end-position", scm_make_real (pos));
+ me->set_property ("stem-end-position", gh_double2scm (pos));
}
else
- pos = ly_scm2double (p);
+ pos = gh_scm2double (p);
return pos;
}
Direction
-Stem::get_direction (Grob *me)
+Stem::get_direction (Grob*me)
{
Direction d = get_grob_direction (me);
if (!d)
{
- d = get_default_dir (me);
- // urg, AAARGH!
- set_grob_direction (me, d);
+ d = get_default_dir (me);
+ // urg, AAARGH!
+ set_grob_direction (me, d);
}
- return d;
+ return d ;
}
+
void
-Stem::set_stemend (Grob *me, Real se)
+Stem::set_stemend (Grob*me, Real se)
{
// todo: margins
- Direction d = get_direction (me);
-
+ Direction d= get_direction (me);
+
if (d && d * head_positions (me)[get_direction (me)] >= se*d)
me->warning (_ ("Weird stem size; check for narrow beams"));
- me->set_property ("stem-end-position", scm_make_real (se));
+ me->set_property ("stem-end-position", gh_double2scm (se));
}
-/* Note head that determines hshift for upstems
- WARNING: triggers direction */
-Grob *
-Stem::support_head (Grob *me)
+
+/*
+ Note head that determines hshift for upstems
+
+ WARNING: triggers direction
+*/
+Grob*
+Stem::support_head (Grob*me)
{
if (head_count (me) == 1)
- /* UGH. */
- return unsmob_grob (ly_car (me->get_property ("note-heads")));
- return first_head (me);
+ {
+ /*
+ UGH.
+ */
+
+ return unsmob_grob (ly_car (me->get_property ("note-heads")));
+ }
+ else
+ return first_head (me);
}
+
int
-Stem::head_count (Grob *me)
+Stem::head_count (Grob*me)
{
- return Pointer_group_interface::count (me, "note-heads");
+ return Pointer_group_interface::count (me, "note-heads");
}
-/* The note head which forms one end of the stem.
- WARNING: triggers direction */
-Grob *
-Stem::first_head (Grob *me)
+/*
+ The note head which forms one end of the stem.
+
+ WARNING: triggers direction
+*/
+Grob*
+Stem::first_head (Grob*me)
{
Direction d = get_direction (me);
- if (d)
- return extremal_heads (me)[-d];
- return 0;
+ if (!d)
+ return 0;
+ return extremal_heads (me)[-d];
}
-/* The note head opposite to the first head. */
-Grob *
-Stem::last_head (Grob *me)
+/*
+ The note head opposite to the first head.
+ */
+Grob*
+Stem::last_head (Grob*me)
{
Direction d = get_direction (me);
- if (d)
- return extremal_heads (me)[d];
- return 0;
+ if (!d)
+ return 0;
+ return extremal_heads (me)[d];
}
-/* START is part where stem reaches `last' head. */
+/*
+ START is part where stem reaches `last' head.
+ */
Drul_array<Grob*>
-Stem::extremal_heads (Grob *me)
+Stem::extremal_heads (Grob*me)
{
const int inf = 1000000;
Drul_array<int> extpos;
extpos[DOWN] = inf;
- extpos[UP] = -inf;
-
+ extpos[UP] = -inf;
+
Drul_array<Grob *> exthead;
exthead[LEFT] = exthead[RIGHT] =0;
-
- for (SCM s = me->get_property ("note-heads"); ly_c_pair_p (s);
- s = ly_cdr (s))
+
+ for (SCM s = me->get_property ("note-heads"); gh_pair_p (s); s = ly_cdr (s))
{
- Grob *n = unsmob_grob (ly_car (s));
+ Grob * n = unsmob_grob (ly_car (s));
+
+
int p = Staff_symbol_referencer::get_rounded_position (n);
Direction d = LEFT;
- do
+ do {
+ if (d* p > d* extpos[d])
{
- if (d * p > d * extpos[d])
- {
- exthead[d] = n;
- extpos[d] = p;
- }
- } while (flip (&d) != DOWN);
+ exthead[d] = n;
+ extpos[d] = p;
+ }
+ } while (flip (&d) != DOWN);
}
+
return exthead;
}
static int
icmp (int const &a, int const &b)
{
- return a - b;
+ return a-b;
}
-/* The positions, in ascending order. */
+/*
+ The positions, in ascending order.
+ */
Array<int>
Stem::note_head_positions (Grob *me)
{
Array<int> ps ;
- for (SCM s = me->get_property ("note-heads"); ly_c_pair_p (s);
- s = ly_cdr (s))
+ for (SCM s = me->get_property ("note-heads"); gh_pair_p (s); s = ly_cdr (s))
{
- Grob *n = unsmob_grob (ly_car (s));
+ Grob * n = unsmob_grob (ly_car (s));
int p = Staff_symbol_referencer::get_rounded_position (n);
ps.push (p);
}
-
+
ps.sort (icmp);
- return ps;
+ return ps;
}
+
void
-Stem::add_head (Grob *me, Grob *n)
+Stem::add_head (Grob*me, Grob *n)
{
n->set_property ("stem", me->self_scm ());
n->add_dependency (me);
- /* TODO: why not store Rest pointers? */
+ /*
+ TODO: why not store Rest pointers?
+ */
if (Note_head::has_interface (n))
- Pointer_group_interface::add_grob (me, ly_symbol2scm ("note-heads"), n);
+ {
+ Pointer_group_interface::add_grob (me, ly_symbol2scm ("note-heads"), n);
+ }
}
bool
-Stem::is_invisible (Grob *me)
+Stem::is_invisible (Grob*me)
{
- return !(head_count (me)
- && ly_scm2int (me->get_property ("duration-log")) >= 1);
+ return ! (head_count (me)
+ && gh_scm2int (me->get_property ("duration-log")) >= 1);
}
Direction
-Stem::get_default_dir (Grob *me)
+Stem::get_default_dir (Grob*me)
{
int staff_center = 0;
Interval hp = head_positions (me);
if (hp.is_empty ())
- return CENTER;
-
+ {
+ return CENTER;
+ }
+
int udistance = (int) (UP * hp[UP] - staff_center);
- int ddistance = (int) (DOWN * hp[DOWN] - staff_center);
-
+ int ddistance = (int) (DOWN* hp[DOWN] - staff_center);
+
if (sign (ddistance - udistance))
- return Direction (sign (ddistance - udistance));
+ return Direction (sign (ddistance -udistance));
return to_dir (me->get_property ("neutral-direction"));
}
Real
-Stem::get_default_stem_end_position (Grob *me)
+Stem::get_default_stem_end_position (Grob*me)
{
- Real ss = Staff_symbol_referencer::staff_space (me);
+ Real ss = Staff_symbol_referencer::staff_space (me);
+
int durlog = duration_log (me);
+
SCM s;
Array<Real> a;
- /* WARNING: IN HALF SPACES */
- Real length = 7;
+
+ Real length = 7; // WARNING: IN HALF SPACES
SCM scm_len = me->get_property ("length");
- if (ly_c_number_p (scm_len))
- length = ly_scm2double (scm_len);
+ if (gh_number_p (scm_len))
+ {
+ length = gh_scm2double (scm_len);
+ }
else
{
s = me->get_property ("lengths");
- if (ly_c_pair_p (s))
- length = 2 * ly_scm2double (robust_list_ref (durlog - 2, s));
+ if (gh_pair_p (s))
+ {
+ length = 2* gh_scm2double (robust_list_ref (durlog -2, s));
+ }
}
/* URGURGURG
- 'set-default-stemlen' sets direction too. */
+ 'set-default-stemlen' sets direction too
+ */
Direction dir = get_direction (me);
if (!dir)
{
set_grob_direction (me, dir);
}
- /* Stems in unnatural (forced) direction should be shortened,
- according to [Roush & Gourlay] */
- Interval hp = head_positions (me);
+ /* stems in unnatural (forced) direction should be shortened,
+ according to [Roush & Gourlay] */
+ Interval hp = head_positions (me);
if (dir && dir * hp[dir] >= 0)
{
SCM sshorten = me->get_property ("stem-shorten");
- SCM scm_shorten = ly_c_pair_p (sshorten) ?
+ SCM scm_shorten = gh_pair_p (sshorten) ?
robust_list_ref ((duration_log (me) - 2) >? 0, sshorten): SCM_EOL;
Real shorten = 2* robust_scm2double (scm_shorten,0);
-
+
+
/* On boundary: shorten only half */
if (abs (head_positions (me)[dir]) <= 1)
shorten *= 0.5;
-
+
length -= shorten;
}
- /* Tremolo stuff. */
- Grob *t_flag = unsmob_grob (me->get_property ("tremolo-flag"));
- if (t_flag && !unsmob_grob (me->get_property ("beam")))
+ /*
+ Tremolo stuff:
+ */
+ Grob * trem = unsmob_grob (me->get_property ("tremolo-flag"));
+ if (trem && !unsmob_grob (me->get_property ("beam")))
{
- /* Crude hack: add extra space if tremolo flag is there.
+ /*
+ Crude hack: add extra space if tremolo flag is there.
We can't do this for the beam, since we get into a loop
- (Stem_tremolo::raw_stencil () looks at the beam.) --hwn */
-
- Real minlen = 1.0
- + 2 * Stem_tremolo::raw_stencil (t_flag).extent (Y_AXIS).length ()
- / ss;
-
+ (Stem_tremolo::raw_stencil () looks at the beam.)
+
+ --hwn
+ */
+
+ Real minlen =
+ 1.0 + 2 * Stem_tremolo::raw_stencil (trem).extent (Y_AXIS).length () / ss;
+
if (durlog >= 3)
{
- Interval flag_ext = flag (me).extent (Y_AXIS);
+ Interval flag_ext = flag (me).extent (Y_AXIS) ;
if (!flag_ext.is_empty ())
- minlen += 2 * flag_ext.length () / ss;
+ minlen += 2 * flag_ext.length () / ss ;
- /* The clash is smaller for down stems (since the tremolo is
- angled up.) */
+ /*
+ The clash is smaller for down stems (since the tremolo is
+ angled up.)
+ */
if (dir == DOWN)
minlen -= 1.0;
}
+
length = length >? (minlen + 1.0);
}
+
+ Real st = dir ? hp[dir] + dir * length : 0.0;
- Real st = dir ? hp[dir] + dir * length : 0;
-
- /* TODO: change name to extend-stems to staff/center/'() */
+ /*
+ TODO: change name to extend-stems to staff/center/'()
+ */
bool no_extend_b = to_boolean (me->get_property ("no-stem-extend"));
- if (!no_extend_b && dir * st < 0)
+ if (!no_extend_b && dir * st < 0) // junkme?
st = 0.0;
- /* Make a little room if we have a upflag and there is a dot.
- previous approach was to lengthen the stem. This is not
- good typesetting practice. */
+ /*
+ Make a little room if we have a upflag and there is a dot.
+ previous approach was to lengthen the stem. This is not
+ good typesetting practice.
+
+ */
if (!get_beam (me) && dir == UP
&& durlog > 2)
{
if (dots)
{
Real dp = Staff_symbol_referencer::get_position (dots);
- Real flagy = flag (me).extent (Y_AXIS)[-dir] * 2 / ss;
+ Real flagy = flag (me).extent (Y_AXIS)[-dir] * 2
+ / ss;
- /* Very gory: add myself to the X-support of the parent,
- which should be a dot-column. */
+ /*
+ Very gory: add myself to the X-support of the parent,
+ which should be a dot-column.
+ */
if (dir * (st + flagy - dp) < 0.5)
{
Grob *par = dots->get_parent (X_AXIS);
{
Side_position_interface::add_support (par, me);
- /* TODO: apply some better logic here. The flag is
- curved inwards, so this will typically be too
- much. */
+ /*
+ TODO: apply some better logic here. The flag is
+ curved inwards, so this will typically be too
+ much.
+ */
}
}
}
}
+
+
return st;
}
-/* The log of the duration (Number of hooks on the flag minus two) */
+
+
+/*
+
+ the log of the duration (Number of hooks on the flag minus two)
+ */
int
-Stem::duration_log (Grob *me)
+Stem::duration_log (Grob*me)
{
SCM s = me->get_property ("duration-log");
- return (ly_c_number_p (s)) ? ly_scm2int (s) : 2;
+ return (gh_number_p (s)) ? gh_scm2int (s) : 2;
}
void
-Stem::position_noteheads (Grob *me)
+Stem::position_noteheads (Grob*me)
{
if (!head_count (me))
return;
-
+
Link_array<Grob> heads =
- Pointer_group_interface__extract_grobs (me, (Grob*) 0, "note-heads");
+ Pointer_group_interface__extract_grobs (me, (Grob*)0, "note-heads");
heads.sort (compare_position);
Direction dir =get_direction (me);
-
+
if (dir < 0)
heads.reverse ();
- Real thick = thickness (me);
+ Real thick = thickness (me);
+
Grob *hed = support_head (me);
Real w = Note_head::head_extent (hed,X_AXIS)[dir];
- for (int i = 0; i < heads.size (); i++)
- heads[i]->translate_axis (w - Note_head::head_extent (heads[i],
- X_AXIS)[dir],
- X_AXIS);
-
- bool parity = true;
+ for (int i=0; i < heads.size (); i++)
+ {
+ heads[i]->translate_axis (w - Note_head::head_extent (heads[i],X_AXIS)[dir],
+ X_AXIS);
+ }
+
+ bool parity= true;
Real lastpos = Real (Staff_symbol_referencer::get_position (heads[0]));
- for (int i = 1; i < heads.size (); i ++)
+ for (int i=1; i < heads.size (); i ++)
{
Real p = Staff_symbol_referencer::get_position (heads[i]);
Real dy =fabs (lastpos- p);
{
if (parity)
{
- Real ell = Note_head::head_extent (heads[i], X_AXIS).length ();
+ Real l = Note_head::head_extent (heads[i], X_AXIS).length ();
Direction d = get_direction (me);
/*
- Reversed head should be shifted ell-thickness, but this
- looks too crowded, so we only shift ell-0.5*thickness.
+ Reversed head should be shifted l-thickness, but this
+ looks too crowded, so we only shift l-0.5*thickness.
This leads to assymetry: Normal heads overlap the
stem 100% whereas reversed heads only overlaps the
stem 50%
+
*/
- Real reverse_overlap = 0.5;
- heads[i]->translate_axis ((ell - thick * reverse_overlap) * d,
- X_AXIS);
+ Real reverse_overlap =0.5;
+ heads[i]->translate_axis ((l-thick*reverse_overlap) * d, X_AXIS);
if (is_invisible (me))
- heads[i]->translate_axis (-thick * (2 - reverse_overlap) * d,
- X_AXIS);
+ heads[i]->translate_axis (-thick*(2 - reverse_overlap) * d , X_AXIS);
+
/* TODO:
-
+
For some cases we should kern some more: when the
- distance between the next or prev note is too large, we'd
+ distance between the next or prev note is too large, we'd
get large white gaps, eg.
-
+
|
X|
|X <- kern this.
|
X
-
+
*/
}
parity = !parity;
}
else
parity = true;
-
+
lastpos = int (p);
}
}
SCM
Stem::before_line_breaking (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob*me = unsmob_grob (smob);
+
/*
Do the calculations for visible stems, but also for invisible stems
position_noteheads (me);
}
else
- me->set_property ("print-function", SCM_EOL);
+ {
+ me->set_property ("print-function", SCM_EOL);
+ }
return SCM_UNSPECIFIED;
}
SCM
Stem::height (SCM smob, SCM ax)
{
- Axis a = (Axis)ly_scm2int (ax);
- Grob *me = unsmob_grob (smob);
+ Axis a = (Axis)gh_scm2int (ax);
+ Grob * me = unsmob_grob (smob);
assert (a == Y_AXIS);
SCM mol = me->get_uncached_stencil ();
if (Grob *b =get_beam (me))
{
Direction d = get_direction (me);
- iv[d] += d * Beam::get_thickness (b) * 0.5 ;
+ iv[d] += d * Beam::get_thickness (b) /2.0 ;
}
return ly_interval2scm (iv);
Stencil
-Stem::flag (Grob *me)
+Stem::flag (Grob*me)
{
/* TODO: maybe property stroke-style should take different values,
e.g. "" (i.e. no stroke), "single" and "double" (currently, it's
'() or "grace"). */
String flag_style;
-
- SCM flag_style_scm = me->get_property ("flag-style");
- if (ly_c_symbol_p (flag_style_scm))
- flag_style = ly_symbol2string (flag_style_scm);
+ SCM flag_style_scm = me->get_property ("flag-style");
+ if (gh_symbol_p (flag_style_scm))
+ {
+ flag_style = ly_symbol2string (flag_style_scm);
+ }
+
if (flag_style == "no-flag")
- return Stencil ();
+ {
+ return Stencil ();
+ }
bool adjust = true;
/*
perhaps the detection whether this correction is needed should
happen in a different place to avoid the recursion.
-
+
--hwn.
*/
int p = Staff_symbol_referencer::get_rounded_position (me);
- staffline_offs = Staff_symbol_referencer::on_staffline (me, p)
- ? "1" : "0";
+ staffline_offs = Staff_symbol_referencer::on_staffline (me, p) ?
+ "1" : "0";
}
else
{
}
char dir = (get_direction (me) == UP) ? 'u' : 'd';
- String font_char = flag_style
- + to_string (dir) + staffline_offs + to_string (duration_log (me));
+ String font_char =
+ flag_style + to_string (dir) + staffline_offs + to_string (duration_log (me));
Font_metric *fm = Font_interface::get_default_font (me);
Stencil flag = fm->find_by_name ("flags-" + font_char);
if (flag.is_empty ())
- me->warning (_f ("flag `%s' not found", font_char));
+ {
+ me->warning (_f ("flag `%s' not found", font_char));
+ }
SCM stroke_style_scm = me->get_property ("stroke-style");
- if (ly_c_string_p (stroke_style_scm))
+ if (gh_string_p (stroke_style_scm))
{
String stroke_style = ly_scm2string (stroke_style_scm);
if (!stroke_style.is_empty ())
String font_char = to_string (dir) + stroke_style;
Stencil stroke = fm->find_by_name ("flags-" + font_char);
if (stroke.is_empty ())
- me->warning (_f ("flag stroke `%s' not found", font_char));
+ {
+ me->warning (_f ("flag stroke `%s' not found", font_char));
+ }
else
- flag.add_stencil (stroke);
+ {
+ flag.add_stencil (stroke);
+ }
}
}
SCM
Stem::dim_callback (SCM e, SCM ax)
{
- Axis a = (Axis) ly_scm2int (ax);
+ Axis a = (Axis) gh_scm2int (ax);
assert (a == X_AXIS);
Grob *me = unsmob_grob (e);
Interval r (0, 0);
if (unsmob_grob (me->get_property ("beam")) || abs (duration_log (me)) <= 2)
; // TODO!
else
- r = flag (me).extent (X_AXIS)
- + thickness (me)/2;
+ {
+ r = flag (me).extent (X_AXIS)
+ + thickness (me)/2;
+ }
return ly_interval2scm (r);
}
-
+
Real
-Stem::thickness (Grob *me)
+Stem::thickness (Grob* me)
{
- return ly_scm2double (me->get_property ("thickness"))
+ return gh_scm2double (me->get_property ("thickness"))
* Staff_symbol_referencer::line_thickness (me);
}
-MAKE_SCHEME_CALLBACK (Stem, print, 1);
+MAKE_SCHEME_CALLBACK (Stem,print,1);
+
SCM
-Stem::print (SCM smob)
+Stem::print (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob*me = unsmob_grob (smob);
Stencil mol;
Direction d = get_direction (me);
+
+ /*
+ TODO: make the stem start a direction ?
- /* TODO: make the stem start a direction ?
- This is required to avoid stems passing in tablature chords. */
- Grob *lh = to_boolean (me->get_property ("avoid-note-head"))
+ This is required to avoid stems passing in tablature chords...
+ */
+ Grob *lh = to_boolean (me->get_property ("avoid-note-head"))
? last_head (me) : lh = first_head (me);
if (!lh)
if (is_invisible (me))
return SCM_EOL;
-
+
Real y1 = Staff_symbol_referencer::get_position (lh);
Real y2 = stem_end_position (me);
-
+
Interval stem_y (y1 <? y2,y2 >? y1);
+
// dy?
Real dy = Staff_symbol_referencer::staff_space (me) * 0.5;
stem_y[Direction (-d)] += d * y_attach/dy;
}
-
+
// URG
Real stem_width = thickness (me);
- Real blot =
- me->get_paper ()->get_dimension (ly_symbol2scm ("blotdiameter"));
-
+ Real blot =
+ me->get_paper ()->get_realvar (ly_symbol2scm ("blotdiameter"));
+
Box b = Box (Interval (-stem_width/2, stem_width/2),
Interval (stem_y[DOWN]*dy, stem_y[UP]*dy));
/*
move the stem to right of the notehead if it is up.
*/
-MAKE_SCHEME_CALLBACK (Stem, off_callback, 2);
+MAKE_SCHEME_CALLBACK (Stem,off_callback,2);
SCM
Stem::off_callback (SCM element_smob, SCM)
{
Grob *me = unsmob_grob (element_smob);
- Real r = 0.0;
- if (head_count (me))
- if (Grob *f = first_head (me))
- {
- Interval head_wid = Note_head::head_extent (f, X_AXIS);
- Real attach = 0.0;
-
- if (is_invisible (me))
+ Real r=0;
+
+ if (head_count (me) == 0)
+ {
+ return gh_double2scm (0.0);
+ }
+
+ if (Grob * f = first_head (me))
+ {
+ Interval head_wid = Note_head::head_extent (f, X_AXIS);
+
+ Real attach =0.0;
+
+ if (is_invisible (me))
+ {
attach = 0.0;
- else
+ }
+ else
attach = Note_head::stem_attachment_coordinate (f, X_AXIS);
-
- Direction d = get_direction (me);
- Real real_attach = head_wid.linear_combination (d * attach);
- r = real_attach;
-
- /* If not centered: correct for stem thickness. */
- if (attach)
- {
- Real rule_thick = thickness (me);
- r += - d * rule_thick * 0.5;
- }
- }
- return scm_make_real (r);
+
+ Direction d = get_direction (me);
+
+ Real real_attach = head_wid.linear_combination (d * attach);
+
+ r = real_attach;
+
+ /*
+ If not centered: correct for stem thickness.
+ */
+ if (attach)
+ {
+ Real rule_thick
+ = thickness (me);
+
+ r += - d * rule_thick * 0.5;
+ }
+ }
+ return gh_double2scm (r);
}
-Grob *
-Stem::get_beam (Grob *me)
+
+Grob*
+Stem::get_beam (Grob*me)
{
- SCM b = me->get_property ("beam");
+ SCM b= me->get_property ("beam");
return unsmob_grob (b);
}
{
/* Return cached info if available */
SCM scm_info = me->get_property ("stem-info");
- if (!ly_c_pair_p (scm_info))
+ if (!gh_pair_p (scm_info))
{
calc_stem_info (me);
scm_info = me->get_property ("stem-info");
}
-
+
Stem_info si;
- si.dir_ = get_grob_direction (me);
- si.ideal_y_ = ly_scm2double (ly_car (scm_info));
- si.shortest_y_ = ly_scm2double (ly_cadr (scm_info));
+ si.dir_ = get_grob_direction (me);
+ si.ideal_y_ = gh_scm2double (gh_car (scm_info));
+ si.shortest_y_ = gh_scm2double (gh_cadr (scm_info));
return si;
}
-/* TODO: add extra space for tremolos! */
+/*
+ TODO: add extra space for tremolos!
+ */
void
Stem::calc_stem_info (Grob *me)
{
programming_error ("No stem dir set?");
my_dir = UP;
}
-
+
Real staff_space = Staff_symbol_referencer::staff_space (me);
Grob *beam = get_beam (me);
Real beam_translation = Beam::get_beam_translation (beam);
/* Simple standard stem length */
SCM lengths = me->get_property ("beamed-lengths");
Real ideal_length =
- ly_scm2double (robust_list_ref (beam_count - 1,lengths))
+ gh_scm2double (robust_list_ref (beam_count - 1,lengths))
* staff_space
/* stem only extends to center of beam */
- 0.5 * beam_thickness;
-
+
/* Condition: sane minimum free stem length (chord to beams) */
lengths = me->get_property ("beamed-minimum-free-lengths");
Real ideal_minimum_free =
- ly_scm2double (robust_list_ref (beam_count - 1, lengths))
+ gh_scm2double (robust_list_ref (beam_count - 1, lengths))
* staff_space;
-
+
/* UGH
It seems that also for ideal minimum length, we must use
the maximum beam count (for this direction):
-
+
\score{ \notes\relative c''{ [a8 a32] }}
-
+
must be horizontal. */
Real height_of_my_beams = beam_thickness
+ (beam_count - 1) * beam_translation;
ideal_length = ideal_length >? ideal_minimum_length;
+
/* Convert to Y position, calculate for dir == UP */
Real note_start =
/* staff positions */
/* Conditions for Y position */
/* Lowest beam of (UP) beam must never be lower than second staffline
-
+
Reference?
-
+
Although this (additional) rule is probably correct,
I expect that highest beam (UP) should also never be lower
than middle staffline, just as normal stems.
Reference?
Obviously not for grace beams.
-
+
Also, not for knees. Seems to be a good thing. */
bool no_extend_b = to_boolean (me->get_property ("no-stem-extend"));
bool is_knee = to_boolean (beam->get_property ("knee"));
ideal_y -= robust_scm2double (beam->get_property ("shorten"), 0);
Real minimum_free =
- ly_scm2double (robust_list_ref
+ gh_scm2double (robust_list_ref
(beam_count - 1,
me->get_property
("beamed-extreme-minimum-free-lengths")))
/* stem only extends to center of beam */
- 0.5 * beam_thickness;
- ideal_y *= my_dir;
Real minimum_y = note_start + minimum_length;
- Real shortest_y = minimum_y * my_dir;
-
+
+
+ ideal_y *= my_dir;
+ Real shortest_y = minimum_y * my_dir;
+
me->set_property ("stem-info",
- scm_list_2 (scm_make_real (ideal_y),
- scm_make_real (shortest_y)));
+ scm_list_n (gh_double2scm (ideal_y),
+ gh_double2scm (shortest_y),
+ SCM_UNDEFINED));
}
Slice
Stem::beam_multiplicity (Grob *stem)
{
SCM beaming= stem->get_property ("beaming");
- Slice le = int_list_to_slice (ly_car (beaming));
- Slice ri = int_list_to_slice (ly_cdr (beaming));
- le.unite (ri);
- return le;
+ Slice l = int_list_to_slice (gh_car (beaming));
+ Slice r = int_list_to_slice (gh_cdr (beaming));
+ l.unite (r);
+
+ return l;
}
-/* FIXME: Too many properties */
-ADD_INTERFACE (Stem, "stem-interface",
- "The stem represent the graphical stem. "
- "In addition, it internally connects note heads, beams and"
- "tremolos. "
- "Rests and whole notes have invisible stems.",
+/*
+ these are too many props.
+ */
+ADD_INTERFACE (Stem,"stem-interface",
+ "The stem represent the graphical stem. "
+ " In addition, it internally connects note heads, beams, tremolos. Rests "
+ " and whole notes have invisible stems."
+
+,
+
"tremolo-flag french-beaming "
"avoid-note-head thickness "
"stem-info beamed-lengths beamed-minimum-free-lengths "
"note-heads direction length flag-style "
"no-stem-extend stroke-style");
+
+
/****************************************************************/
Stem_info::Stem_info ()
{
- ideal_y_ = shortest_y_ = 0;
+ ideal_y_ = shortest_y_ =0;
dir_ = CENTER;
}
TODO: naming add/combine.
*/
/*
- UGH. Junk all mutators.
+ UMGH. junkme!
+
*/
LY_DEFINE (ly_stencil_set_extent_x, "ly:stencil-set-extent!",
3, 0, 0, (SCM stil, SCM axis, SCM np),
"number pair");
Interval iv = ly_scm2interval (np);
- s->dim_[Axis (ly_scm2int (axis))] = iv;
+ s->dim_[Axis (gh_scm2int (axis))] = iv;
- return SCM_UNSPECIFIED;
+ return SCM_UNDEFINED;
}
LY_DEFINE (ly_translate_stencil_axis, "ly:stencil-translate-axis",
{
Stencil *s = unsmob_stencil (stil);
SCM_ASSERT_TYPE (s, stil, SCM_ARG1, __FUNCTION__, "stencil");
- SCM_ASSERT_TYPE (ly_c_number_p (amount), amount, SCM_ARG2, __FUNCTION__, "number pair");
+ SCM_ASSERT_TYPE (gh_number_p (amount), amount, SCM_ARG2, __FUNCTION__, "number pair");
SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG3, __FUNCTION__, "axis");
SCM new_s = s->smobbed_copy ();
Stencil *q = unsmob_stencil (new_s);
- q->translate_axis (ly_scm2double (amount), Axis (ly_scm2int (axis)));
+ q->translate_axis (gh_scm2double (amount), Axis (gh_scm2int (axis)));
return new_s;
}
return new_s;
}
-LY_DEFINE (ly_stencil_expr, "ly:stencil-expr",
+LY_DEFINE (ly_stencil_get_expr, "ly:stencil-get-expr",
1, 0, 0, (SCM stil),
"Return the expression of @var{stil}.")
{
Stencil *s = unsmob_stencil (stil);
SCM_ASSERT_TYPE (s, stil, SCM_ARG1, __FUNCTION__, "stencil");
- return s->expr ();
+ return s->get_expr ();
}
LY_DEFINE (ly_stencil_get_extent, "ly:stencil-extent",
SCM_ASSERT_TYPE (s, stil, SCM_ARG1, __FUNCTION__, "stencil");
SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG2, __FUNCTION__, "axis");
- return ly_interval2scm (s->extent (Axis (ly_scm2int (axis))));
+ return ly_interval2scm (s->extent (Axis (gh_scm2int (axis))));
}
LY_DEFINE (ly_stencil_moved_to_edge, "ly:stencil-moved-to-edge",
Real p = 0.0;
if (padding != SCM_UNDEFINED)
{
- SCM_ASSERT_TYPE (ly_c_number_p (padding), padding, SCM_ARG5, __FUNCTION__, "number");
- p = ly_scm2double (padding);
+ SCM_ASSERT_TYPE (gh_number_p (padding), padding, SCM_ARG5, __FUNCTION__, "number");
+ p = gh_scm2double (padding);
}
Real m = 0.0;
if (minimum != SCM_UNDEFINED)
{
- SCM_ASSERT_TYPE (ly_c_number_p (minimum), minimum, SCM_ARG6, __FUNCTION__, "number");
- m = ly_scm2double (minimum);
+ SCM_ASSERT_TYPE (gh_number_p (minimum), minimum, SCM_ARG6, __FUNCTION__, "number");
+ m = gh_scm2double (minimum);
}
if (s1)
first_stencil = *s1;
if (s2)
- return first_stencil.moved_to_edge (Axis (ly_scm2int (axis)),
- Direction (ly_scm2int (direction)),
+ return first_stencil.moved_to_edge (Axis (gh_scm2int (axis)),
+ Direction (gh_scm2int (direction)),
*s2, p, m).smobbed_copy ();
else
return Stencil().smobbed_copy ();
}
-
+
LY_DEFINE (ly_stencil_combine_at_edge, "ly:stencil-combine-at-edge",
4, 2, 0, (SCM first, SCM axis, SCM direction,
SCM second,
"@var{direction} can be -1 (left or down) or 1 (right or up). "
"The stencils are juxtaposed with @var{padding} as extra space. "
"If this puts the reference points closer than @var{minimum}, "
- "they are moved by the latter amount."
- "@var{first} and @var{second} may also be '() or #f.")
+ "they are moved by the latter amount.")
{
Stencil *s1 = unsmob_stencil (first);
Stencil *s2 = unsmob_stencil (second);
Stencil result;
- SCM_ASSERT_TYPE (s1 || first == SCM_BOOL_F || first == SCM_EOL,
- first, SCM_ARG1, __FUNCTION__, "Stencil, #f or ()");
- SCM_ASSERT_TYPE (s2 || second == SCM_BOOL_F || second == SCM_EOL,
- second, SCM_ARG4, __FUNCTION__, "Stencil, #f or ()");
- SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG2, __FUNCTION__, "axis");
- SCM_ASSERT_TYPE (is_direction (direction), direction, SCM_ARG3, __FUNCTION__, "dir");
+ SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG3, __FUNCTION__, "axis");
+ SCM_ASSERT_TYPE (is_direction (direction), direction, SCM_ARG4, __FUNCTION__, "dir");
Real p = 0.0;
if (padding != SCM_UNDEFINED)
{
- SCM_ASSERT_TYPE (ly_c_number_p (padding), padding, SCM_ARG5, __FUNCTION__, "number");
- p = ly_scm2double (padding);
+ SCM_ASSERT_TYPE (gh_number_p (padding), padding, SCM_ARG5, __FUNCTION__, "number");
+ p = gh_scm2double (padding);
}
Real m = 0.0;
if (minimum != SCM_UNDEFINED)
{
- SCM_ASSERT_TYPE (ly_c_number_p (minimum), minimum, SCM_ARG6, __FUNCTION__, "number");
- m = ly_scm2double (minimum);
+ SCM_ASSERT_TYPE (gh_number_p (minimum), minimum, SCM_ARG6, __FUNCTION__, "number");
+ m = gh_scm2double (minimum);
}
if (s1)
result = *s1;
-
if (s2)
- result.add_at_edge (Axis (ly_scm2int (axis)),
- Direction (ly_scm2int (direction)), *s2, p, m);
+ result.add_at_edge (Axis (gh_scm2int (axis)),
+ Direction (gh_scm2int (direction)), *s2, p, m);
return result.smobbed_copy ();
}
while (!SCM_NULLP (args))
{
- Stencil *s = unsmob_stencil (ly_car (args));
+ Stencil *s = unsmob_stencil (gh_car (args));
if (!s)
- SCM_ASSERT_TYPE (s, ly_car (args), SCM_ARGn, __FUNCTION__, "Stencil");
+ SCM_ASSERT_TYPE (s, gh_car (args), SCM_ARGn, __FUNCTION__, "Stencil");
result.add_stencil (*s);
- args = ly_cdr (args);
+ args = gh_cdr (args);
}
return result.smobbed_copy ();
return s.smobbed_copy ();
}
+SCM
+fontify_atom (Font_metric const *met, SCM f)
+{
+ if (f == SCM_EOL)
+ return f;
+ else
+ return scm_list_n (ly_symbol2scm ("fontify"),
+ ly_quote_scm (met->description_), f, SCM_UNDEFINED);
+}
+
+LY_DEFINE (ly_fontify_atom,"ly:fontify-atom",
+ 2, 0, 0, (SCM met, SCM f),
+ "Add a font selection command for the font metric @var{met} "
+ "to @var{f}.")
+{
+ SCM_ASSERT_TYPE (unsmob_metrics (met), met, SCM_ARG1, __FUNCTION__, "font metric");
+
+ return fontify_atom (unsmob_metrics (met), f);
+}
-LY_DEFINE (ly_stencil_align_to_x, "ly:stencil-align-to!",
+LY_DEFINE (ly_align_to_x, "ly:stencil-align-to!",
3, 0, 0, (SCM stil, SCM axis, SCM dir),
"Align @var{stil} using its own extents. "
"@var{dir} is a number -1, 1 are left and right respectively. "
{
SCM_ASSERT_TYPE (unsmob_stencil (stil), stil, SCM_ARG1, __FUNCTION__, "stencil");
SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG2, __FUNCTION__, "axis");
- SCM_ASSERT_TYPE (ly_c_number_p (dir), dir, SCM_ARG3, __FUNCTION__, "number");
+ SCM_ASSERT_TYPE (gh_number_p (dir), dir, SCM_ARG3, __FUNCTION__, "number");
- unsmob_stencil (stil)->align_to ((Axis)ly_scm2int (axis),
- ly_scm2double (dir));
- return stil;
+ unsmob_stencil (stil)->align_to ((Axis)gh_scm2int (axis),
+ gh_scm2double (dir));
+ return SCM_UNDEFINED;
}
#include <math.h>
#include <libc-extension.hh> // isinf
-#include "input-smob.hh"
#include "font-metric.hh"
#include "dimensions.hh"
#include "interval.hh"
#include "ly-smobs.icc"
-Stencil::Stencil ()
-{
- expr_ = SCM_EOL;
- set_empty (true);
-}
-
-Stencil::Stencil (Box b, SCM func)
-{
- expr_ = func;
- dim_ = b;
-}
-
-int
-Stencil::print_smob (SCM, SCM port, scm_print_state *)
-{
- scm_puts ("#<Stencil ", port);
- scm_puts (" >", port);
- return 1;
-}
-SCM
-Stencil::mark_smob (SCM smob)
+Offset
+Stencil::origin () const
{
- Stencil *s = (Stencil*) ly_cdr (smob);
- return s->expr_;
+ return origin_;
}
-IMPLEMENT_SIMPLE_SMOBS (Stencil);
-IMPLEMENT_TYPE_P (Stencil, "ly:stencil?");
-IMPLEMENT_DEFAULT_EQUAL_P (Stencil);
-
Interval
Stencil::extent (Axis a) const
{
return dim_[a];
}
-/* Hmm... maybe this is not such a good idea ; stuff can be empty,
- while expr_ == '() */
-bool
-Stencil::is_empty () const
-{
- return expr_ == SCM_EOL;
-}
-
-SCM
-Stencil::expr () const
+Stencil::Stencil (Box b, SCM func)
{
- return expr_;
+ expr_ = func;
+ dim_ = b;
}
-Box
-Stencil::extent_box () const
-{
- return dim_;
-}
-Offset
-Stencil::origin () const
+Stencil::Stencil ()
{
- return origin_;
+ expr_ = SCM_EOL;
+ set_empty (true);
}
void
void
Stencil::add_stencil (Stencil const &s)
{
- expr_ = scm_list_3 (ly_symbol2scm ("combine-stencil"), s.expr_, expr_);
+ expr_ = scm_list_n (ly_symbol2scm ("combine-stencil"),
+ s.expr_, expr_, SCM_UNDEFINED);
dim_.unite (s.dim_);
}
-
-
void
Stencil::set_empty (bool e)
{
Stencil::align_to (Axis a, Real x)
{
if (is_empty ())
- return;
+ return ;
Interval i (extent (a));
translate_axis (-i.linear_combination (x), a);
}
-/* FIXME: unintuitive naming, you would expect *this to be moved.
- Kept (keeping?) API for compat with add_at_edge ().
-
- What is PADDING, what is MINIMUM, exactly? */
+/*
+ TODO: unintuitive naming, you would expect *this to be moved. Kept
+ API for compat with add_at_edge ().
+*/
Stencil
-Stencil::moved_to_edge (Axis a, Direction d, Stencil const &s,
- Real padding, Real minimum) const
+Stencil::moved_to_edge (Axis a, Direction d, Stencil const &s, Real padding,
+ Real minimum) const
{
- Interval my_extent = dim_[a];
+ Real my_extent= is_empty () ? 0.0 : dim_[a][d];
Interval i (s.extent (a));
Real his_extent;
if (i.is_empty ())
{
- programming_error ("Stencil::moved_to_edge: adding empty stencil.");
+ programming_error ("Stencil::move_to_edge: adding empty stencil.");
his_extent = 0.0;
}
else
his_extent = i[-d];
- Real offset = (my_extent.is_empty () ? 0.0 : my_extent[d] - his_extent)
- + d * padding;
+ Real offset = (my_extent - his_extent) + d * padding;
Stencil toadd (s);
toadd.translate_axis (offset,a);
- if (minimum > 0 && d * (-origin ()[a] + toadd.origin ()[a]) < minimum)
+ if (minimum > 0
+ && d *(- origin ()[a] + toadd.origin ()[a]) < minimum)
toadd.translate_axis ( -toadd.origin ()[a]
- + origin ()[a] + d * minimum, a);
-
+ + origin ()[a] + d* minimum, a);
+
return toadd;
}
/* See scheme Function. */
void
Stencil::add_at_edge (Axis a, Direction d, Stencil const &s, Real padding,
- Real minimum)
+ Real minimum)
{
- add_stencil (moved_to_edge (a, d, s, padding, minimum));
-}
-
-
-/****************************************************************/
-
-
-void
-interpret_stencil_expression (SCM expr,
- void (*func) (void*, SCM),
- void *func_arg,
- Offset o)
-{
- while (1)
- {
- if (!ly_c_pair_p (expr))
- return;
-
- SCM head =ly_car (expr);
- if (unsmob_input (head))
- {
- Input *ip = unsmob_input (head);
- (*func) (func_arg,
- scm_list_4 (ly_symbol2scm ("define-origin"),
- scm_makfrom0str (ip->file_string ()
- .to_str0 ()),
- scm_int2num (ip->line_number ()),
- scm_int2num (ip->column_number ())));
- expr = ly_cadr (expr);
- }
- else if (head == ly_symbol2scm ("no-origin"))
- {
- (*func) (func_arg, scm_list_1 (head));
- expr = ly_cadr (expr);
- }
- else if (head == ly_symbol2scm ("translate-stencil"))
- {
- o += ly_scm2offset (ly_cadr (expr));
- expr = ly_caddr (expr);
- }
- else if (head == ly_symbol2scm ("combine-stencil"))
- {
- for (SCM x = ly_cdr (expr); ly_c_pair_p (x); x = ly_cdr (x))
- interpret_stencil_expression (ly_car (x), func, func_arg, o);
- return;
- }
- else
- {
- (*func) (func_arg,
- scm_list_4 (ly_symbol2scm ("placebox"),
- scm_make_real (o[X_AXIS]),
- scm_make_real (o[Y_AXIS]),
- expr));
- return;
- }
- }
+ add_stencil (moved_to_edge (a,d,s,padding, minimum));
}
-
-struct Font_list
-{
- SCM fonts_;
-};
-
-static void
-find_font_function (void *fs, SCM x)
+/* Hmm... maybe this is not such a good idea ; stuff can be empty,
+ while expr_ == '() */
+bool
+Stencil::is_empty () const
{
- Font_list *me = (Font_list*) fs;
-
- if (ly_car (x) == ly_symbol2scm ("placebox"))
- {
- SCM args = ly_cdr (x);
- SCM what = ly_caddr (args);
-
- if (ly_c_pair_p (what))
- {
- SCM head = ly_car (what);
- if (ly_symbol2scm ("text") == head)
- me->fonts_ = scm_cons (ly_cadr (what), me->fonts_);
- else if (head == ly_symbol2scm ("char"))
- me->fonts_ = scm_cons (ly_cadr (what), me->fonts_);
- }
- }
+ return expr_ == SCM_EOL;
}
SCM
-find_expression_fonts (SCM expr)
+Stencil::get_expr () const
{
- Font_list fl;
-
- fl.fonts_ = SCM_EOL;
-
- interpret_stencil_expression (expr, &find_font_function,
- (void*) &fl, Offset (0,0));
-
- return fl.fonts_;
+ return expr_;
}
-
-LY_DEFINE (ly_stencil_fonts, "ly:stencil-fonts",
- 1, 0, 0, (SCM s),
- " Analyse @var{s}, and return a list of fonts used in @var{s}.")
+Box
+Stencil::extent_box () const
{
- Stencil *stil = unsmob_stencil (s);
- SCM_ASSERT_TYPE (stil, s, SCM_ARG1, __FUNCTION__, "Stencil");
- return find_expression_fonts (stil->expr ());
+ return dim_;
}
-struct Stencil_interpret_arguments
-{
- SCM func;
- SCM arg1;
-};
-
-void stencil_interpret_in_scm (void *p, SCM expr)
+int
+Stencil::print_smob (SCM , SCM port, scm_print_state *)
{
- Stencil_interpret_arguments *ap = (Stencil_interpret_arguments*) p;
- scm_call_2 (ap->func, ap->arg1, expr);
+ scm_puts ("#<Stencil ", port);
+ scm_puts (" >", port);
+ return 1;
}
-
-
-LY_DEFINE (ly_interpret_stencil_expression, "ly:interpret-stencil-expression",
- 4, 0, 0, (SCM expr, SCM func, SCM arg1, SCM offset),
- "Parse EXPR, feed bits to FUNC with first arg ARG1")
+SCM
+Stencil::mark_smob (SCM s)
{
- SCM_ASSERT_TYPE (ly_c_procedure_p(func), func, SCM_ARG1, __FUNCTION__,
- "procedure");
-
- Stencil_interpret_arguments a;
- a.func = func;
- a.arg1 = arg1;
- Offset o = ly_scm2offset (offset);
-
- interpret_stencil_expression (expr, stencil_interpret_in_scm, (void*) &a, o);
-
- return SCM_UNSPECIFIED;
+ Stencil *r = (Stencil *) ly_cdr (s);
+ return r->expr_;
}
+
+IMPLEMENT_SIMPLE_SMOBS (Stencil);
+IMPLEMENT_TYPE_P (Stencil, "ly:stencil?");
+IMPLEMENT_DEFAULT_EQUAL_P (Stencil);
Stencil mol;
SCM glyph = e->get_property ("text");
- if (!ly_c_string_p (glyph))
+ if (!gh_string_p (glyph))
return mol.smobbed_copy ();
String text = ly_scm2string (glyph);
#include "staff-symbol.hh"
#include "group-interface.hh"
#include "paper-column.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "spanner.hh"
class System_start_delimiter_engraver : public Engraver
/*
UGH UGH
*/
- if (ly_c_string_p (gl) && ly_c_equal_p (gl, scm_makfrom0str ("brace"))
- && ly_c_string_p (my_gl) && ly_c_equal_p (my_gl, scm_makfrom0str ("bracket")))
+ if (gh_string_p (gl) && gh_equal_p (gl, scm_makfrom0str ("brace"))
+ && gh_string_p (my_gl) && gh_equal_p (my_gl, scm_makfrom0str ("bracket")))
inf.grob_->translate_axis (-0.8, X_AXIS); // ugh
- else if (ly_c_string_p (gl) && ly_c_equal_p (gl, scm_makfrom0str ("bracket"))
- && ly_c_string_p (my_gl) && ly_c_equal_p (my_gl, scm_makfrom0str ("bracket")))
+ else if (gh_string_p (gl) && gh_equal_p (gl, scm_makfrom0str ("bracket"))
+ && gh_string_p (my_gl) && gh_equal_p (my_gl, scm_makfrom0str ("bracket")))
{
inf.grob_->translate_axis ( -0.8, X_AXIS); // ugh
inf.grob_->set_property ("arch-height",
- scm_make_real (ly_scm2double (inf.grob_->get_property
+ gh_double2scm (gh_scm2double (inf.grob_->get_property
("arch-height"))+0.5));
}
}
if (!delim_)
{
SCM delim_name =get_property ("systemStartDelimiter");
- delim_ = make_spanner_from_properties (this, delim_name, SCM_EOL);
+ delim_ = make_spanner_from_properties (daddy_context_, delim_name);
delim_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn")));
-
+ announce_grob (delim_, SCM_EOL);
}
}
void
if (delim_)
{
delim_->set_bound (RIGHT, unsmob_grob (get_property ("currentCommandColumn")));
-
+ typeset_grob (delim_);
}
}
#include "axis-group-interface.hh"
#include "system-start-delimiter.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "stencil.hh"
#include "font-interface.hh"
#include "all-font-metrics.hh"
Stencil
System_start_delimiter::staff_bracket (Grob*me,Real height)
{
- Real arc_height = ly_scm2double (me->get_property ("arch-height")) ;
+ Real arc_height = gh_scm2double (me->get_property ("arch-height")) ;
SCM at = scm_list_n (ly_symbol2scm ("bracket"),
me->get_property ("arch-angle"),
me->get_property ("arch-width"),
- scm_make_real (arc_height),
- scm_make_real (height),
+ gh_double2scm (arc_height),
+ gh_double2scm (height),
me->get_property ("arch-thick"),
me->get_property ("thickness"),
SCM_UNDEFINED);
Stencil
System_start_delimiter::simple_bar (Grob*me,Real h)
{
- Real lt =me->get_paper ()->get_dimension (ly_symbol2scm ("linethickness")) ;
+ Real lt =me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness")) ;
Real w = lt * robust_scm2double (me->get_property ("thickness"), 1);
return Lookup::round_filled_box (Box (Interval (0,w), Interval (-h/2, h/2)),
lt);
{
Grob * me = unsmob_grob (smob);
SCM gl = me->get_property ("glyph");
- if (ly_c_equal_p (gl,scm_makfrom0str ("bar-line")))
+ if (gh_equal_p (gl,scm_makfrom0str ("bar-line")))
{
int count = 0;
*/
SCM elts = me->get_property ("elements");
Grob *common = common_refpoint_of_list (elts, me, Y_AXIS);
- for (SCM s = elts; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = elts; gh_pair_p (s); s = gh_cdr (s))
{
- Interval v = unsmob_grob (ly_car (s))->extent (common, Y_AXIS);
+ Interval v = unsmob_grob (gh_car (s))->extent (common, Y_AXIS);
if (!v.is_empty ())
count ++;
Grob * me = unsmob_grob (smob);
SCM s = me->get_property ("glyph");
- if (!ly_c_string_p (s))
+ if (!gh_string_p (s))
return SCM_EOL;
SCM gsym = scm_string_to_symbol (s) ;
Real staff_space = Staff_symbol_referencer::staff_space (me);
Interval ext = ly_scm2interval (Axis_group_interface::group_extent_callback
- (me->self_scm (), scm_int2num (Y_AXIS)));
+ (me->self_scm (), gh_int2scm (Y_AXIS)));
Real l = ext.length () / staff_space;
if (ext.is_empty ()
name. This is better than using find_font directly,
esp. because that triggers mktextfm for non-existent
fonts. */
- SCM fam = scm_cons (ly_symbol2scm ("font-encoding"), ly_symbol2scm ("fetaBraces"));
+ SCM fam = gh_cons (ly_symbol2scm ("font-encoding"), ly_symbol2scm ("braces"));
SCM alist = scm_list_n (fam, SCM_UNDEFINED);
fm = select_font (me->get_paper (), scm_list_n (alist, SCM_UNDEFINED));
lo = cmp;
}
while (hi - lo > 1);
+
+ Stencil m (fm->get_indexed_char_stencil (lo)); // ugh. ascii?
+ b=m.extent_box ();
+ b[X_AXIS] = Interval (0,0);
- /* FIXME: ascii? */
- Stencil stil (fm->get_indexed_char_stencil (lo));
- b = stil.extent_box ();
- b[X_AXIS] = Interval (0, 0);
-
- return Stencil (b, stil.expr ());
+ return Stencil (b, m.get_expr ());
}
(c) 1996--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
-#include <math.h>
-
#include "axis-group-interface.hh"
#include "warn.hh"
#include "system.hh"
#include "main.hh"
#include "paper-column.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "paper-outputter.hh"
#include "paper-score.hh"
#include "string.hh"
#include "spacing-interface.hh"
#include "staff-symbol-referencer.hh"
#include "paper-book.hh"
-#include "paper-system.hh"
+#include "paper-line.hh"
System::System (SCM s)
: Spanner (s)
int
System::spanner_count () const
{
- int k = 0;
- for (SCM s = get_property ("all-elements"); ly_c_pair_p (s); s = ly_cdr (s))
- if (dynamic_cast<Spanner*> (unsmob_grob (ly_car (s))))
- k++;
+ int k =0;
+ for (SCM s = get_property ("all-elements");
+ gh_pair_p (s); s = ly_cdr (s))
+ {
+ if (dynamic_cast<Spanner*> (unsmob_grob (gh_car (s))))
+ k++;
+ }
+
return k;
}
+
+
+int
+scm_default_compare (const void * a, const void *b)
+{
+ SCM pa = *(SCM *)a;
+ SCM pb = *(SCM *)b;
+
+ if (pa < pb)
+ return -1;
+ else if (pa > pb)
+ return 1;
+ else
+ return 0;
+}
+
+/*
+ modify L in place: sort it
+*/
+SCM
+uniquify_list (SCM l)
+{
+ int len = scm_ilength (l);
+ SCM * arr = new SCM[len];
+ int k = 0;
+ for (SCM s = l; SCM_NNULLP (s); s = SCM_CDR (s))
+ arr[k++] = SCM_CAR (s);
+
+ assert (k == len);
+ qsort (arr, len, sizeof (SCM), &scm_default_compare);
+
+ k = 0;
+ SCM *tail = &l;
+
+ for (int i = 0; i < len ; i++)
+ {
+ if (i && arr[i] == arr[i-1])
+ continue;
+
+ SCM_SETCAR (*tail, arr[i]);
+ tail = SCM_CDRLOC(*tail);
+ }
+
+ *tail = SCM_EOL;
+ delete[] arr;
+
+ return l;
+}
void
System::typeset_grob (Grob * elem)
{
if (elem->pscore_)
programming_error ("Adding element twice.");
- else
- {
- elem->pscore_ = pscore_;
- Pointer_group_interface::add_grob (this, ly_symbol2scm ("all-elements"), elem);
- scm_gc_unprotect_object (elem->self_scm ());
- }
+
+ elem->pscore_ = pscore_;
+ Pointer_group_interface::add_grob (this, ly_symbol2scm ("all-elements"), elem);
+ scm_gc_unprotect_object (elem->self_scm ());
}
// todo: use map.
static void
fixup_refpoints (SCM s)
{
- for (; ly_c_pair_p (s); s = ly_cdr (s))
+ for (; gh_pair_p (s); s = ly_cdr (s))
{
Grob::fixup_refpoint (ly_car (s));
}
SCM
System::get_lines ()
{
- for (SCM s = get_property ("all-elements"); ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = get_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s))
{
Grob *g = unsmob_grob (ly_car (s));
if (g->internal_has_interface (ly_symbol2scm ("only-prebreak-interface")))
}
g->suicide ();
}
- else if (g->is_live ())
+ else if (g->live ())
g->do_break_processing ();
}
{
Grob *se = broken_intos_[i];
SCM all = se->get_property ("all-elements");
- for (SCM s = all; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = all; gh_pair_p (s); s = ly_cdr (s))
fixup_refpoint (ly_car (s));
count += scm_ilength (all);
}
*/
fixup_refpoints (get_property ("all-elements"));
- for (SCM s = get_property ("all-elements"); ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = get_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s))
unsmob_grob (ly_car (s))->handle_broken_dependencies ();
handle_broken_dependencies ();
/* Because the this->get_property (all-elements) contains items in 3
versions, handle_broken_dependencies () will leave duplicated
items in all-elements. Strictly speaking this is harmless, but
- it leads to duplicated symbols in the output. ly_list_qsort_uniq_x ()
+ it leads to duplicated symbols in the output. uniquify_list ()
makes sure that no duplicates are in the list. */
for (int i = 0; i < line_count; i++)
{
SCM all = broken_intos_[i]->get_property ("all-elements");
- all = ly_list_qsort_uniq_x(all);
+ all = uniquify_list (all);
}
#endif
progress_indication (_f ("Element count %d.", count + element_count ()));
int line_count = broken_intos_.size ();
- SCM lines = scm_c_make_vector (line_count, SCM_EOL);
+ SCM lines = scm_c_make_vector (line_count, SCM_UNDEFINED);
- for (int i = 0; i < line_count; i++)
+ for (int i = 0; i < line_count; i++)
{
if (verbose_global_b)
progress_indication ("[");
if (verbose_global_b)
progress_indication (to_string (i) + "]");
}
- return lines;
+ return lines;
}
-/* Find the loose columns in POSNS, and drape them around the columns
- specified in BETWEEN-COLS. */
-static void
+
+
+
+/*
+ Find the loose columns in POSNS, and drape them around the columns
+ specified in BETWEEN-COLS. */
+void
set_loose_columns (System* which, Column_x_positions const *posns)
{
- int loose_col_count = posns->loose_cols_.size ();
- for (int i = 0; i < loose_col_count; i++)
+ for (int i = 0; i < posns->loose_cols_.size (); i++)
{
int divide_over = 1;
Item *loose = dynamic_cast<Item*> (posns->loose_cols_[i]);
if (col->system_)
continue;
- Item *left = 0;
- Item *right = 0;
- while (1)
+ Item * left = 0;
+ Item * right = 0;
+ do
{
SCM between = loose->get_property ("between-cols");
- if (!ly_c_pair_p (between))
+ if (!gh_pair_p (between))
break;
- Item *le = dynamic_cast<Item*> (unsmob_grob (ly_car (between)));
- Item *re = dynamic_cast<Item*> (unsmob_grob (ly_cdr (between)));
- if (!(le && re))
- break;
+ Item * l=dynamic_cast<Item*> (unsmob_grob (ly_car (between)));
+ Item * r=dynamic_cast<Item*> (unsmob_grob (ly_cdr (between)));
+
+ if (!(l && r))
+ break ;
- if (!left && le)
+ if (!left && l)
{
- left = le->get_column ();
+ left = l->get_column ();
if (!left->get_system ())
left = left->find_prebroken_piece (RIGHT);
}
- divide_over++;
- loose = right = re->get_column ();
+ divide_over ++;
+ loose = right = r->get_column ();
}
+ while (1);
if (!right->get_system ())
right = right->find_prebroken_piece (LEFT);
- /* Divide the remaining space of the column over the left and
- right side. At the moment, FIXME */
- Grob *common = right->common_refpoint (left, X_AXIS);
+ /*
+ We divide the remaining space of the column over the left and
+ right side. At the moment, we
+
+ */
+ Grob * common = right->common_refpoint (left, X_AXIS);
Real rx = right->extent (common, X_AXIS)[LEFT];
Real lx = left->extent (common, X_AXIS)[RIGHT];
Real total_dx = rx - lx;
Interval cval =col->extent (col, X_AXIS);
- /* Put it in the middle. This is not an ideal solution -- the
- break alignment code inserts a fixed space before the clef
- (about 1 SS), while the space following the clef is flexible.
- In tight situations, the clef will almost be on top of the
- following note. */
- Real dx = rx - lx - cval.length ();
+ /*
+
+ We put it in the middle. This is not an ideal solution -- the
+ break alignment code inserts a fixed space before the clef
+ (about 1 SS), while the space following the clef is
+ flexible. In tight situations, the clef will almost be on top
+ of the following note.
+
+ */
+ Real dx = rx-lx - cval.length ();
if (total_dx < 2* cval.length ())
{
- /* TODO: this is discontinuous. I'm too tired to
- invent a sliding mechanism. Duh. */
+ /*
+ todo: this is discontinuous. I'm too tired to
+ invent a sliding mechanism. Duh.
+
+ TODO.
+ */
dx *= 0.25;
}
else
dx *= 0.5;
col->system_ = which;
- col->translate_axis (-col->relative_coordinate (common, X_AXIS), X_AXIS);
+ col->translate_axis (- col->relative_coordinate (common, X_AXIS), X_AXIS);
col->translate_axis (lx + dx - cval[LEFT], X_AXIS);
}
}
void
System::break_into_pieces (Array<Column_x_positions> const &breaking)
{
- for (int i = 0; i < breaking.size (); i++)
+ for (int i=0; i < breaking.size (); i++)
{
System *system = dynamic_cast <System*> (clone ());
system->rank_ = i;
system->set_bound (LEFT,c[0]);
system->set_bound (RIGHT,c.top ());
- for (int j = 0; j < c.size (); j++)
+ for (int j=0; j < c.size (); j++)
{
- c[j]->translate_axis (breaking[i].config_[j], X_AXIS);
+ c[j]->translate_axis (breaking[i].config_[j],X_AXIS);
dynamic_cast<Paper_column*> (c[j])->system_ = system;
}
set_loose_columns (system, &breaking[i]);
{
Grob *me = this;
SCM cs = me->get_property ("columns");
- Grob *prev = ly_c_pair_p (cs) ? unsmob_grob (ly_car (cs)) : 0;
+ Grob * prev = gh_pair_p (cs) ? unsmob_grob (ly_car (cs)) : 0;
p->rank_ = prev ? Paper_column::get_rank (prev) + 1 : 0;
- me->set_property ("columns", scm_cons (p->self_scm (), cs));
+ me->set_property ("columns", gh_cons (p->self_scm (), cs));
Axis_group_interface::add_element (me, p);
}
void
System::pre_processing ()
{
- for (SCM s = get_property ("all-elements"); ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = get_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s))
unsmob_grob (ly_car (s))->discretionary_processing ();
if (verbose_global_b)
- progress_indication (_f ("Grob count %d", element_count ()));
+ progress_indication (_f ("Grob count %d", element_count ()));
+
- for (SCM s = get_property ("all-elements"); ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = get_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s))
unsmob_grob (ly_car (s))->handle_prebroken_dependencies ();
fixup_refpoints (get_property ("all-elements"));
- for (SCM s = get_property ("all-elements"); ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = get_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s))
{
- Grob *sc = unsmob_grob (ly_car (s));
+ Grob* sc = unsmob_grob (ly_car (s));
sc->calculate_dependencies (PRECALCED, PRECALCING, ly_symbol2scm ("before-line-breaking-callback"));
}
- progress_indication ("\n");
- progress_indication (_ ("Calculating line breaks..."));
- progress_indication (" ");
- for (SCM s = get_property ("all-elements"); ly_c_pair_p (s); s = ly_cdr (s))
+ progress_indication ("\n" + _ ("Calculating line breaks...") + " ");
+ for (SCM s = get_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s))
{
- Grob *e = unsmob_grob (ly_car (s));
+ Grob * e = unsmob_grob (ly_car (s));
SCM proc = e->get_property ("spacing-procedure");
- if (ly_c_procedure_p (proc))
- scm_call_1 (proc, e->self_scm ());
+ if (gh_procedure_p (proc))
+ gh_call1 (proc, e->self_scm ());
}
}
void
System::post_processing ()
{
- for (SCM s = get_property ("all-elements"); ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = get_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s))
{
Grob *g = unsmob_grob (ly_car (s));
g->calculate_dependencies (POSTCALCED, POSTCALCING,
This might seem inefficient, but Stencils are cached per grob
anyway. */
SCM all = get_property ("all-elements");
- all = ly_list_qsort_uniq_x (all);
+ all = uniquify_list (all);
this->get_stencil ();
- for (SCM s = all; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = all; gh_pair_p (s); s = ly_cdr (s))
{
Grob *g = unsmob_grob (ly_car (s));
g->get_stencil ();
if (Stencil *me = get_stencil ())
stencils = scm_cons (me->smobbed_copy (), stencils);
- /* Output stencils in three layers: 0, 1, 2. Default layer: 1.
+ /* Output stencils in three layers: 0, 1, 2. The default layer is
+ 1.
- Start with layer 3, since scm_cons prepends to list. */
+ Start with layer 3, since scm_cons prepends to list.
+
+ */
SCM all = get_property ("all-elements");
-
- SCM exprs = SCM_EOL;
- SCM *tail = &exprs;
-
+
for (int i = LAYER_COUNT; i--;)
- for (SCM s = all; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = all; gh_pair_p (s); s = ly_cdr (s))
{
Grob *g = unsmob_grob (ly_car (s));
Stencil *stil = g->get_stencil ();
Offset (0, 0))
* Staff_symbol_referencer::staff_space (g);
- /* Must copy the stencil, for we cannot change the stencil
- cached in G. */
-
- Stencil st = *stil;
- st.translate (o + extra);
- *tail = scm_cons (st.expr (), SCM_EOL);
- tail = SCM_CDRLOC(*tail);
-
+ /*
+ must copy the stencil, for we cannot change the stencil
+ cached in G.
+ */
+ SCM my_stencil = stil->smobbed_copy ();
+ unsmob_stencil (my_stencil)->translate (o + extra);
+ stencils = scm_cons (my_stencil, stencils);
}
-
+ if (output_format_global != PAGE_LAYOUT)
+ {
+ SCM lastcol = ly_car (get_property ("columns"));
+ Grob *g = unsmob_grob (lastcol);
+
+ SCM between = ly_symbol2scm ("between-system-string");
+ SCM inter = g->internal_get_property (between);
+ if (gh_string_p (inter))
+ stencils = scm_cons (scm_cons (between, inter), stencils);
+ }
Interval x (extent (this, X_AXIS));
Interval y (extent (this, Y_AXIS));
- Stencil sys_stencil (Box (x,y),
- scm_cons (ly_symbol2scm ("combine-stencil"),
- exprs));
-
- Paper_system *pl = new Paper_system (sys_stencil, false);
+ Paper_line *pl = new Paper_line (Offset (x.length (), y.length ()),
+ stencils);
- Item * break_point =this->get_bound(LEFT);
- pl->penalty_ =
- robust_scm2double (break_point->get_property ("page-penalty"), 0.0);
-
- return scm_gc_unprotect_object (pl->self_scm ());
+ scm_gc_unprotect_object (pl->self_scm ());
+ return pl->self_scm ();
}
Link_array<Item>
-System::broken_col_range (Item const *left, Item const *right) const
+System::broken_col_range (Item const*l, Item const*r) const
{
Link_array<Item> ret;
- left = left->get_column ();
- right = right->get_column ();
+ l = l->get_column ();
+ r = r->get_column ();
SCM s = get_property ("columns");
- while (ly_c_pair_p (s) && ly_car (s) != right->self_scm ())
+ while (gh_pair_p (s) && ly_car (s) != r->self_scm ())
s = ly_cdr (s);
- if (ly_c_pair_p (s))
+ if (gh_pair_p (s))
s = ly_cdr (s);
- while (ly_c_pair_p (s) && ly_car (s) != left->self_scm ())
+ while (gh_pair_p (s) && ly_car (s) != l->self_scm ())
{
Paper_column*c = dynamic_cast<Paper_column*> (unsmob_grob (ly_car (s)));
if (Item::is_breakable (c) && !c->system_)
return ret;
}
-/** Return all columns, but filter out any unused columns , since they might
- disrupt the spacing problem. */
+/**
+ Return all columns, but filter out any unused columns , since they might
+ disrupt the spacing problem.
+ */
Link_array<Grob>
-System::columns () const
+System::columns ()const
{
Link_array<Grob> acs
= Pointer_group_interface__extract_grobs (this, (Grob*) 0, "columns");
- bool found = false;
- for (int i = acs.size (); i--;)
+ bool bfound = false;
+ for (int i= acs.size (); i -- ;)
{
bool brb = Item::is_breakable (acs[i]);
- found = found || brb;
+ bfound = bfound || brb;
/*
the last column should be breakable. Weed out any columns that
seem empty. We need to retain breakable columns, in case
someone forced a breakpoint.
*/
- if (!found || !Paper_column::is_used (acs[i]))
+ if (!bfound || !Paper_column::is_used (acs[i]))
acs.del (i);
}
return acs;
ADD_INTERFACE (System,"system-interface",
"This is the toplevel object: each object in a score "
"ultimately has a System object as its X and Y parent. ",
- "all-elements columns")
+ "between-system-string all-elements columns")
#include <stdio.h>
#include "rhythmic-head.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "event.hh"
#include "dots.hh"
#include "dot-column.hh"
for (int i=0; i < note_events_.size (); i++)
{
SCM stringTunings = get_property ("stringTunings");
- int number_of_strings = ((int) ly_length (stringTunings));
+ int number_of_strings = ((int) gh_length (stringTunings));
bool high_string_one = to_boolean (get_property ("highStringOne"));
+ Item * note = make_item ("TabNoteHead");
Music * event = note_events_[i];
- Item * note = make_item ("TabNoteHead", event->self_scm ());
Music * tabstring_event=0;
for (SCM s =event->get_property ("articulations");
- !tabstring_event && ly_c_pair_p (s); s = ly_cdr (s))
+ !tabstring_event && gh_pair_p (s); s = gh_cdr (s))
{
- Music * art = unsmob_music (ly_car (s));
+ Music * art = unsmob_music (gh_car (s));
if (art->is_mus_type ("string-number-event"))
tabstring_event = art;
bool string_found;
if (tabstring_event)
{
- tab_string = ly_scm2int (tabstring_event->get_property ("string-number"));
+ tab_string = gh_scm2int (tabstring_event->get_property ("string-number"));
string_found = true;
}
else
Duration dur = *unsmob_duration (event->get_property ("duration"));
note->set_property ("duration-log",
- scm_int2num (dur.duration_log ()));
+ gh_int2scm (dur.duration_log ()));
if (dur.dot_count ())
{
- Item * d = make_item ("Dots", event->self_scm ());
+ Item * d = make_item ("Dots");
Rhythmic_head::set_dots (note, d);
if (dur.dot_count ()
- != ly_scm2int (d->get_property ("dot-count")))
- d->set_property ("dot-count", scm_int2num (dur.dot_count ()));
+ != gh_scm2int (d->get_property ("dot-count")))
+ d->set_property ("dot-count", gh_int2scm (dur.dot_count ()));
d->set_parent (note, Y_AXIS);
-
+ announce_grob (d, SCM_EOL);
dots_.push (d);
}
SCM scm_pitch = event->get_property ("pitch");
SCM proc = get_property ("tablatureFormat");
SCM min_fret_scm = get_property ("minimumFret");
- int min_fret = ly_c_number_p (min_fret_scm) ? ly_scm2int (min_fret_scm) : 0;
+ int min_fret = gh_number_p (min_fret_scm) ? gh_scm2int (min_fret_scm) : 0;
while (!string_found)
{
int fret = unsmob_pitch (scm_pitch)->semitone_pitch ()
- - ly_scm2int (scm_list_ref (stringTunings,scm_int2num (tab_string-1)));
+ - gh_scm2int (gh_list_ref (stringTunings,gh_int2scm (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_int2num (tab_string), stringTunings, scm_pitch);
+ SCM text = gh_call3 (proc, gh_int2scm (tab_string), stringTunings, scm_pitch);
int pos = 2 * tab_string - number_of_strings - 1; // No tab-note between the string !!!
if (to_boolean (get_property ("stringOneTopmost")))
note->set_property ("text", text);
- note->set_property ("staff-position", scm_int2num (pos));
+ note->set_property ("staff-position", gh_int2scm (pos));
+ announce_grob (note, event->self_scm ());
notes_.push (note);
}
}
void
Tab_note_heads_engraver::stop_translation_timestep ()
{
+ for (int i=0; i < notes_.size (); i++)
+ {
+ typeset_grob (notes_[i]);
+ }
+
notes_.clear ();
+ for (int i=0; i < dots_.size (); i++)
+ {
+ typeset_grob (dots_[i]);
+ }
+
dots_.clear ();
note_events_.clear ();
tabstring_events_.clear ();
SCM met = tempo_req_->get_property ("metronome-count");
Duration *d = unsmob_duration (tempo_req_->get_property ("tempo-unit"));
- Rational r = (d->get_length () / Moment (Rational (1, 4)) * Moment (ly_scm2int (met))).main_part_;
+ Rational r = (d->get_length () / Moment (Rational (1, 4)) * Moment (gh_scm2int (met))).main_part_;
audio_ = new Audio_tempo (int (r));
Music * r = evs_[i];
// URG: Text vs TextScript
- Item *text = make_item ("TextScript", r->self_scm ());
+ Item *text = make_item ("TextScript");
Axis ax = Y_AXIS;
// Hmm
int priority = 200;
SCM s = text->get_property ("script-priority");
- if (ly_c_number_p (s))
- priority = ly_scm2int (s);
+ if (gh_number_p (s))
+ priority = gh_scm2int (s);
/* see script-engraver.cc */
priority += i;
- text->set_property ("script-priority", scm_int2num (priority));
+ text->set_property ("script-priority", gh_int2scm (priority));
Direction dir = to_dir (r->get_property ("direction"));
if (dir)
SCM mark = r->get_property ("text");
text->set_property ("text", mark);
+ announce_grob (text, r->self_scm ());
texts_.push (text);
}
}
void
Text_engraver::stop_translation_timestep ()
{
+ for (int i=0; i < texts_.size (); i++)
+ {
+ Item *ti = texts_[i];
+ typeset_grob (ti);
+ }
texts_.clear ();
evs_.clear ();
}
#include "text-item.hh"
#include "font-interface.hh"
#include "virtual-font-metric.hh"
-#include "output-def.hh"
-#include "scaled-font-metric.hh"
+#include "paper-def.hh"
-MAKE_SCHEME_CALLBACK (Text_item, interpret_string, 4)
+MAKE_SCHEME_CALLBACK (Text_item, interpret_markup, 3)
SCM
-Text_item::interpret_string (SCM paper, SCM props, SCM encoding, SCM markup)
+Text_item::interpret_markup (SCM paper, SCM props, SCM markup)
{
- Output_def *pap = unsmob_output_def (paper);
-
- SCM_ASSERT_TYPE(pap, paper, SCM_ARG1, __FUNCTION__, "Paper definition");
- SCM_ASSERT_TYPE(ly_c_string_p (markup), markup, SCM_ARG3, __FUNCTION__, "string");
- SCM_ASSERT_TYPE(encoding == SCM_EOL
- || ly_c_symbol_p (encoding), encoding, SCM_ARG2, __FUNCTION__, "symbol");
-
- String str = ly_scm2string (markup);
- Font_metric *fm = select_encoded_font (pap, props, encoding);
-
- SCM lst = SCM_EOL;
- Box b;
- if (Modified_font_metric* mf = dynamic_cast<Modified_font_metric*> (fm))
- {
- lst = scm_list_3 (ly_symbol2scm ("text"),
- mf->self_scm (),
- markup);
-
- b = mf->text_dimension (str);
- }
- else
+ if (gh_string_p (markup))
{
- /* ARGH. */
- programming_error ("Must have Modified_font_metric for text.");
- }
+ String str = ly_scm2string (markup);
- return Stencil (b, lst).smobbed_copy ();
-}
-
+ Paper_def *pap = unsmob_paper (paper);
+ Font_metric *fm = select_font (pap, props);
+ SCM lst = scm_list_n (ly_symbol2scm ("text"), markup, SCM_UNDEFINED);
+
+ if (dynamic_cast<Virtual_font_metric*> (fm))
+ /* ARGH. */
+ programming_error ("Can't use virtual font for text.");
+ else
+ lst = fontify_atom (fm, lst);
-MAKE_SCHEME_CALLBACK (Text_item, interpret_markup, 3)
-SCM
-Text_item::interpret_markup (SCM paper, SCM props, SCM markup)
-{
- if (ly_c_string_p (markup))
- return interpret_string (paper, props, SCM_EOL, markup);
- else if (ly_c_pair_p (markup))
+ Box b = fm->text_dimension (str);
+ return Stencil (b, lst).smobbed_copy ();
+ }
+ else if (gh_pair_p (markup))
{
- SCM func = ly_car (markup);
- SCM args = ly_cdr (markup);
+ SCM func = gh_car (markup);
+ SCM args = gh_cdr (markup);
if (!markup_p (markup))
programming_error ("Markup head has no markup signature.");
SCM
Text_item::print (SCM grob)
{
- Grob *me = unsmob_grob (grob);
+ Grob * me = unsmob_grob (grob);
SCM t = me->get_property ("text");
SCM chain = Font_interface::text_font_alist_chain (me);
Text_item::markup_p (SCM x)
{
return
- ly_c_string_p (x) ||
- (ly_c_pair_p (x)
- && SCM_BOOL_F != scm_object_property (ly_car (x), ly_symbol2scm ("markup-signature")));
+ gh_string_p (x) ||
+ (gh_pair_p (x)
+ && SCM_BOOL_F != scm_object_property (gh_car (x), ly_symbol2scm ("markup-signature")));
}
ADD_INTERFACE (Text_item,"text-interface",
else
{
current_req_ = req_drul_[START];
- span_ = make_spanner ("TextSpanner", req_drul_[START]->self_scm ());
+ span_ = make_spanner ("TextSpanner");
Side_position_interface::set_axis (span_, Y_AXIS);
+ announce_grob (span_, req_drul_[START]->self_scm ());
req_drul_[START] = 0;
}
}
Grob* e = unsmob_grob (get_property ("currentMusicalColumn"));
finished_->set_bound (RIGHT, e);
}
+ typeset_grob (finished_);
finished_ = 0;
}
}
#include "spanner.hh"
#include "font-interface.hh"
#include "dimensions.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "warn.hh"
#include "paper-column.hh"
#include "staff-symbol-referencer.hh"
/* Ugh, must be same as Hairpin::print. */
Grob *common = spanner->get_bound (LEFT)->common_refpoint (spanner->get_bound (RIGHT), X_AXIS);
- Output_def * paper = me->get_paper ();
+ Paper_def * paper = me->get_paper ();
SCM flare = me->get_property ("bracket-flare");
SCM shorten = me->get_property ("shorten-pair");
span_points[d] = b->extent (common, X_AXIS).linear_combination (d * encl);
if (is_number_pair (shorten))
- span_points -= d * ly_scm2double (index_get_cell (shorten, d));
+ span_points -= d * gh_scm2double (index_get_cell (shorten, d));
}
if (is_number_pair (flare))
- span_points -= d * ly_scm2double (index_get_cell (flare, d));
+ span_points -= d * gh_scm2double (index_get_cell (flare, d));
}
while (flip (&d) != LEFT);
SCM properties = Font_interface::text_font_alist_chain (me);
SCM edge_text = me->get_property ("edge-text");
Drul_array<Stencil> edge;
- if (ly_c_pair_p (edge_text))
+ if (gh_pair_p (edge_text))
{
Direction d = LEFT;
do
Real dx = 0.0;
if (is_number_pair (flare))
- dx = ly_scm2double (index_get_cell (flare, d)) * d;
+ dx = gh_scm2double (index_get_cell (flare, d)) * d;
Real dy = - dir * edge_height[d] ;
if (dy)
for (int i = info_.first_charcode; i <= info_.last_charcode; i++)
{
Tex_font_char_metric tfm_char = read_char_metric (i);
- if (tfm_char.exists_)
+ if (tfm_char.exists_b_)
ascii_to_metric_idx_[tfm_char.code_] = char_metrics_.size ();
char_metrics_.push (tfm_char);
}
/* Read the character. */
tfm_char = read_char ();
- if (tfm_char.exists_)
+ if (tfm_char.exists_b_)
tfm_char.code_ = code;
return tfm_char;
the first and last character codes given in the header. We've
already assumed that's true (or we couldn't be positioned at a
`char_info_word'). */
- tfm_char.exists_ = width_index != 0;
+ tfm_char.exists_b_ = width_index != 0;
if (tag == 1)
{
source file of the GNU LilyPond music typesetter
(c) 1999--2004 Jan Nieuwenhuizen <janneke@gnu.org>
+
some code shamelessly copied from GNU fontutils-0.6/tfm/tfm_input.c
*/
#include "warn.hh"
#include "dimensions.hh"
-static Tex_font_char_metric dummy_static_char_metric;
-
-Tex_font_char_metric::Tex_font_char_metric ()
-{
- exists_ = false;
- code_ = 0;;
- width_ = 0;
- height_ = 0;
- depth_ = 0;
- italic_correction_ = 0;
- width_fix_ = 0;
- height_fix_ = 0;
- depth_fix_ = 0;
- italic_correction_fix_ = 0;
-}
-
Box
Tex_font_char_metric::dimensions () const
{
- if (!exists_)
+ if (!exists_b_)
{
Box b;
b.set_empty ();
(d >? height_)*point_constant));
}
-Tex_font_metric::Tex_font_metric ()
+Tex_font_char_metric::Tex_font_char_metric ()
{
- encoding_table_ = SCM_EOL;
+ exists_b_ = false;
+ code_ = 0;;
+ width_ = 0;
+ height_ = 0;
+ depth_ = 0;
+ italic_correction_ = 0;
+ width_fix_ = 0;
+ height_fix_ = 0;
+ depth_fix_ = 0;
+ italic_correction_fix_ = 0;
}
+#define APPEND_CHAR_METRIC_ELT(k) outstr += ::to_string (#k) + " " + ::to_string (k ## _) + "; "
+String
+Tex_font_char_metric::to_string () const
+{
+ String outstr ;
+
+ APPEND_CHAR_METRIC_ELT (exists_b);
+ APPEND_CHAR_METRIC_ELT (code);
+ APPEND_CHAR_METRIC_ELT (width);
+ APPEND_CHAR_METRIC_ELT (height);
+ APPEND_CHAR_METRIC_ELT (depth);
+ APPEND_CHAR_METRIC_ELT (italic_correction);
+
+ return outstr + "\n";
+}
-void
-Tex_font_metric::derived_mark () const
+Tex_font_metric::Tex_font_metric ()
{
- scm_gc_mark (encoding_table_);
}
+
+static Tex_font_char_metric dummy_static_char_metric;
+
Tex_font_char_metric const *
Tex_font_metric::find_ascii (int ascii, bool warn) const
{
- if (ascii >= 0 && ascii < ascii_to_metric_idx_.size ()
- && ascii_to_metric_idx_[ascii] >= 0)
+ if (ascii >= 0 && ascii < ascii_to_metric_idx_.size () && ascii_to_metric_idx_[ascii] >= 0)
return & char_metrics_[ascii_to_metric_idx_ [ascii]];
else if (warn)
- warning (_f ("can't find ascii character: %d", ascii));
+ {
+ warning (_f ("can't find ascii character: %d", ascii));
+ }
return &dummy_static_char_metric;
}
-/* UGH: glyphs need not be consecutive in TFM. */
+
+/*
+ UGH: glyphs need not be consecutive in TFM.
+ */
int
Tex_font_metric::count () const
{
for (int i = ascii_to_metric_idx_.size (); i--;)
- if (ascii_to_metric_idx_[i] != -1)
- return i + 1;
+ {
+ if (ascii_to_metric_idx_[i] != -1)
+ return i + 1;
+ }
return 0;
}
Box
Tex_font_metric::get_ascii_char (int a) const
{
- Box b = find_ascii (a)->dimensions ();
+ Box b = find_ascii (a)->dimensions () ;
return b;
}
-SCM
-Tex_font_metric::make_tfm (String filename)
+String
+Tex_font_metric::to_string () const
{
- Tex_font_metric *tfm = new Tex_font_metric;
- Tex_font_metric_reader reader (filename);
-
- tfm->info_ = reader.info_;
- tfm->header_ = reader.header_;
- tfm->char_metrics_ = reader.char_metrics_;
- tfm->ascii_to_metric_idx_ = reader.ascii_to_metric_idx_;
-
+ String outstr;
+ for (int i=0; i < char_metrics_.size (); i++)
+ outstr += char_metrics_[i].to_string ();
- tfm->encoding_table_ =
- scm_call_1 (ly_scheme_function ("get-coding-table"),
- scm_makfrom0str (tfm->coding_scheme ().to_str0 ()));
-
- return tfm->self_scm ();
+ return outstr;
}
-Real
-Tex_font_metric::design_size () const
-{
- return info_.design_size;
-}
-
-String
-Tex_font_metric::coding_scheme () const
-{
- String scm = info_.coding_scheme;
- for(int i = 0; i < scm.length (); i++)
- if (scm[i] == ' ')
- scm[i] = '-';
- return scm;
-}
-int
-Tex_font_metric::name_to_index (String s) const
+SCM
+Tex_font_metric::make_tfm (String fn)
{
- SCM sym = ly_symbol2scm (s.to_str0 ());
+ Tex_font_metric * tfm = new Tex_font_metric;
+ Tex_font_metric_reader reader (fn);
- SCM idx = scm_hash_ref (encoding_table_, sym, SCM_BOOL_F);
- if (ly_c_char_p (idx))
- {
- return (unsigned char) ly_scm2char (idx);
- }
- else
- return -1;
+ tfm->info_ = reader.info_;
+ tfm->header_ = reader.header_;
+ tfm->char_metrics_ = reader.char_metrics_;
+ tfm->ascii_to_metric_idx_ = reader.ascii_to_metric_idx_;
+
+ return tfm->self_scm ();
}
if (ties.size () == 1)
{
Grob * t = ties[0];
- if (t->is_live ()
+ if (t->live ()
&& !get_grob_direction (t))
set_grob_direction (t,Tie::get_default_dir (t));
return ;
Tie_engraver::process_music ()
{
if (event_)
- context ()->set_property ("tieMelismaBusy", SCM_BOOL_T);
+ daddy_context_->set_property ("tieMelismaBusy", SCM_BOOL_T);
}
void
maybe should check positions too.
*/
if (right_mus && left_mus
- && ly_c_equal_p (right_mus->get_property ("pitch"),
+ && gh_equal_p (right_mus->get_property ("pitch"),
left_mus->get_property ("pitch")))
{
- Grob * p = make_spanner ("Tie", last_event_->self_scm ());
+ Grob * p = make_spanner ("Tie");
Tie::set_interface (p); // cannot remove yet!
Tie::set_head (p, LEFT, th);
Tie::set_head (p, RIGHT, h);
ties_.push (p);
+ announce_grob (p, last_event_->self_scm ());
}
}
if (ties_.size () && ! tie_column_)
{
- tie_column_ = make_spanner ("TieColumn", SCM_EOL);
-
+ tie_column_ = make_spanner ("TieColumn");
+ announce_grob (tie_column_, SCM_EOL);
}
if (tie_column_)
void
Tie_engraver::start_translation_timestep ()
{
- context ()->set_property ("tieMelismaBusy",
- ly_bool2scm (heads_to_tie_.size ()));
+ daddy_context_->set_property ("tieMelismaBusy",
+ gh_bool2scm (heads_to_tie_.size ()));
}
ties_.clear ();
last_event_ = 0;
- tie_column_ =0;
+ if (tie_column_)
+ {
+ typeset_grob (tie_column_);
+ tie_column_ =0;
+ }
}
if (event_)
index_set_cell (her->get_property ("head-pair"), LEFT, new_head_drul[LEFT]->self_scm ());
index_set_cell (her->get_property ("head-pair"), RIGHT, new_head_drul[RIGHT]->self_scm ());
+ typeset_grob (her);
}
TRANSLATOR_DECLARATIONS (Tie_performer);
};
+
+
Tie_performer::Tie_performer ()
{
event_ = 0;
ties_created_ = false;
}
+
bool
Tie_performer::try_music (Music *mus)
{
Tie_performer::process_music ()
{
if (event_)
- context ()->set_property ("tieMelismaBusy", SCM_BOOL_T);
+ daddy_context_->set_property ("tieMelismaBusy", SCM_BOOL_T);
}
void
Music * left_mus = heads_to_tie_[i].event_;
if (right_mus && left_mus
- && ly_c_equal_p (right_mus->get_property ("pitch"),
- left_mus->get_property ("pitch")))
+ && gh_equal_p (right_mus->get_property ("pitch"),
+ left_mus->get_property ("pitch")))
{
an->tie_to (th);
ties_created_ = true;
void
Tie_performer::start_translation_timestep ()
{
- context ()->set_property ("tieMelismaBusy",
- ly_bool2scm (heads_to_tie_.size ()));
+ daddy_context_->set_property ("tieMelismaBusy",
+ gh_bool2scm (heads_to_tie_.size ()));
}
#include "spanner.hh"
#include "lookup.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "tie.hh"
#include "rhythmic-head.hh"
#include "bezier.hh"
void
Tie::set_interface (Grob*me)
{
- me->set_property ("head-pair", scm_cons (SCM_EOL, SCM_EOL));
+ me->set_property ("head-pair", gh_cons (SCM_EOL, SCM_EOL));
}
{
SCM c = me->get_property ("head-pair");
- if (ly_c_pair_p (c))
+ if (gh_pair_p (c))
return unsmob_grob (index_get_cell (c, d));
else
return 0;
SCM lim // groetjes aan de chirurgendochter.
= scm_assq (ly_symbol2scm ("height-limit"),details);
- Real h_inf = ly_scm2double (ly_cdr (lim)) * staff_space;
- Real r_0 = ly_scm2double (ly_cdr (scm_assq (ly_symbol2scm ("ratio"),details)));
+ Real h_inf = gh_scm2double (ly_cdr (lim)) * staff_space;
+ Real r_0 = gh_scm2double (ly_cdr (scm_assq (ly_symbol2scm ("ratio"),details)));
Bezier b = slur_shape (width, h_inf, r_0);
*/
Real ypos = Tie::get_position (me) * staff_space/2
- + dir * ly_scm2double (me->get_property ("y-offset"));;
+ + dir * gh_scm2double (me->get_property ("y-offset"));;
/*
Make sure we don't start on a dots
Real diff = ry - y;
Real newy = y;
- Real clear = staff_space * ly_scm2double (me->get_property ("staffline-clearance"));
+ Real clear = staff_space * gh_scm2double (me->get_property ("staffline-clearance"));
if (fabs (y) <=
Staff_symbol_referencer::staff_radius (me) * staff_space + clear
SCM controls = SCM_EOL;
for (int i= 4; i--;)
- controls = scm_cons (ly_offset2scm (b.control_[i]), controls);
+ controls = gh_cons (ly_offset2scm (b.control_[i]), controls);
return controls;
}
Grob*me = unsmob_grob (smob);
SCM cp = me->get_property ("control-points");
- if (!ly_c_pair_p (cp)) // list is more accurate
+ if (!gh_pair_p (cp)) // list is more accurate
{
cp = get_control_points (smob);
me->set_property ("control-points", cp);
}
- if (!ly_c_pair_p (cp))
+ if (!gh_pair_p (cp))
return Stencil ().smobbed_copy ();
Real thick
*/
class Time_signature_engraver : public Engraver
{
- Item *time_signature_;
+ Item * time_signature_;
SCM last_time_fraction_;
protected:
Time_signature_engraver::Time_signature_engraver ()
{
- time_signature_ = 0;
+ time_signature_ =0;
last_time_fraction_ = SCM_BOOL_F;
}
/*
not rigorously safe, since the value might get GC'd and
reallocated in the same spot */
- SCM fr = get_property ("timeSignatureFraction");
+ SCM fr= get_property ("timeSignatureFraction");
if (!time_signature_
&& last_time_fraction_ != fr
- && ly_c_pair_p (fr))
+ && gh_pair_p (fr))
{
- int den = ly_scm2int (ly_cdr (fr));
+ int den = gh_scm2int (gh_cdr (fr));
if (den != (1 << intlog2 (den)))
{
/*
*/
warning (_f ("Found strange time signature %d/%d.",
den,
- ly_scm2int (ly_car (fr))
+ gh_scm2int (gh_car (fr))
));
}
last_time_fraction_ = fr;
- time_signature_ = make_item ("TimeSignature",SCM_EOL);
+ time_signature_ = make_item ("TimeSignature");
time_signature_->set_property ("fraction",fr);
+
+ if (time_signature_)
+ announce_grob (time_signature_, SCM_EOL);
}
}
void
Time_signature_engraver::stop_translation_timestep ()
{
- time_signature_ = 0;
+ if (time_signature_)
+ {
+ typeset_grob (time_signature_);
+ time_signature_ =0;
+ }
}
Time_signature_performer::create_audio_elements ()
{
SCM fr = get_property ("timeSignatureFraction");
- if (ly_c_pair_p (fr) && !ly_c_equal_p (fr, prev_fraction_))
+ if (gh_pair_p (fr) && !gh_equal_p (fr, prev_fraction_))
{
prev_fraction_ = fr;
- int b = ly_scm2int (ly_car (fr));
- int o = ly_scm2int (ly_cdr (fr));
+ int b = gh_scm2int (ly_car (fr));
+ int o = gh_scm2int (ly_cdr (fr));
audio_ = new Audio_time_signature (b,o);
Audio_element_info info (audio_, 0);
#include "stencil.hh"
#include "text-item.hh"
#include "time-signature.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "font-interface.hh"
#include "warn.hh"
#include "staff-symbol-referencer.hh"
SCM frac = me->get_property ("fraction");
int n = 4;
int d = 4;
- if (ly_c_pair_p (frac))
+ if (gh_pair_p (frac))
{
- n = ly_scm2int (ly_car (frac));
- d = ly_scm2int (ly_cdr (frac));
+ n = gh_scm2int (ly_car (frac));
+ d = gh_scm2int (ly_cdr (frac));
}
Stencil m;
- if (ly_c_symbol_p (st))
+ if (gh_symbol_p (st))
{
String style (ly_scm2string (scm_symbol_to_string (st)));
if (style[0]=='1')
}
String char_name = style + to_string (n) + "/" + to_string (d);
- me->set_property ("font-encoding", ly_symbol2scm ("fetaMusic"));
+ me->set_property ("font-encoding", ly_symbol2scm ("music"));
Stencil out = Font_interface::get_default_font (me)
->find_by_name ("timesig-" + char_name);
if (!out.is_empty ())
Time_signature::numbered_time_signature (Grob*me,int num, int den)
{
SCM chain = me->get_property_alist_chain (Font_interface::text_font_alist_chain (me));
- chain = scm_cons (scm_list_1 (scm_cons (ly_symbol2scm ("font-encoding"),
- ly_symbol2scm ("fetaNumber"))),
+ chain = scm_cons (scm_list_1 (gh_cons (ly_symbol2scm ("font-encoding"),
+ ly_symbol2scm ("number"))),
chain);
SCM sn = Text_item::interpret_markup (me->get_paper ()->self_scm (), chain,
- scm_makfrom0str (to_string (num).to_str0 ()));
+ scm_makfrom0str (to_string (num).to_str0 ()));
SCM sd = Text_item::interpret_markup (me->get_paper ()->self_scm (), chain,
- scm_makfrom0str (to_string (den).to_str0 ()));
+ scm_makfrom0str (to_string (den).to_str0 ()));
Stencil n = *unsmob_stencil (sn);
Stencil d = *unsmob_stencil (sd);
Moment now = now_mom ();
/* Set the first bar of the score? */
- if (!ly_c_string_p (which))
+ if (!gh_string_p (which))
which = (now.main_part_ || now.main_part_ == last_moment_.main_part_)
? SCM_EOL : scm_makfrom0str ("|");
- context ()->set_property ("whichBar", which);
+ daddy_context_->set_property ("whichBar", which);
}
SCM which = get_property ("whichBar");
/* Set the first bar of the score? */
- if (!ly_c_string_p (which))
+ if (!gh_string_p (which))
which = SCM_EOL;
Moment mp = measure_position ();
->set_property ("measure-length", mlen.smobbed_copy ());
}
- if (!ly_c_string_p (which) && to_boolean (automatic_bars))
+ if (!gh_string_p (which) && to_boolean (automatic_bars))
{
SCM always = get_property ("barAlways");
}
}
- context ()->set_property ("whichBar", which);
+ daddy_context_->set_property ("whichBar", which);
}
void
Timing_engraver::stop_translation_timestep ()
{
Timing_translator::stop_translation_timestep ();
- context ()->set_property ("whichBar", SCM_EOL);
+ daddy_context_->set_property ("whichBar", SCM_EOL);
last_moment_ = now_mom ();
}
/*
move this to engraver-init.ly?
*/
- context ()->add_alias (ly_symbol2scm ("Timing"));
- context ()->set_property ("timing" , SCM_BOOL_T);
- context ()->set_property ("currentBarNumber" , scm_int2num (1));
+ daddy_context_->add_alias (ly_symbol2scm ("Timing"));
+ daddy_context_->set_property ("timing" , SCM_BOOL_T);
+ daddy_context_->set_property ("currentBarNumber" , gh_int2scm (1));
- context ()->set_property ("timeSignatureFraction",
- scm_cons (scm_int2num (4), scm_int2num (4)));
+ daddy_context_->set_property ("timeSignatureFraction",
+ gh_cons (gh_int2scm (4), gh_int2scm (4)));
/*
Do not init measurePosition; this should be done from global
context.
*/
- context ()->set_property ("measureLength", Moment (Rational (1)).smobbed_copy ());
- context ()->set_property ("beatLength", Moment (Rational (1,4)).smobbed_copy ());
+ daddy_context_->set_property ("measureLength", Moment (Rational (1)).smobbed_copy ());
+ daddy_context_->set_property ("beatLength", Moment (Rational (1,4)).smobbed_copy ());
}
Rational
else
{
measposp = now;
- context ()->set_property ("measurePosition",
+ daddy_context_->set_property ("measurePosition",
measposp.smobbed_copy ());
}
SCM barn = get_property ("currentBarNumber");
int b = 0;
- if (ly_c_number_p (barn))
+ if (gh_number_p (barn))
{
- b = ly_scm2int (barn);
+ b = gh_scm2int (barn);
}
SCM cad = get_property ("timing");
b ++;
}
- context ()->set_property ("currentBarNumber", scm_int2num (b));
- context ()->set_property ("measurePosition", measposp.smobbed_copy ());
+ daddy_context_->set_property ("currentBarNumber", gh_int2scm (b));
+ daddy_context_->set_property ("measurePosition", measposp.smobbed_copy ());
}
ENTER_DESCRIPTION (Timing_translator,
{
SCM l = global_translator_dict ? global_translator_dict->to_alist () : SCM_EOL;
- for (SCM s =l; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s =l; gh_pair_p (s); s = gh_cdr (s))
{
- scm_set_car_x (s, ly_cdar (s));
+ gh_set_car_x (s, gh_cdar (s));
}
return l;
(c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
-#include "output-def.hh"
+#include "music-output-def.hh"
#include "translator-group.hh"
#include "translator.hh"
#include "warn.hh"
Translator_group*
Translator_group::get_daddy_translator () const
{
- return context ()->get_parent_context ()->implementation ();
+ Translator *t
+ = unsmob_translator (daddy_context_->daddy_context_->implementation_);
+ return dynamic_cast<Translator_group*> (t);
}
void
translator_each (SCM list, Translator_method method)
{
- for (SCM p = list; ly_c_pair_p (p); p = ly_cdr (p))
+ for (SCM p = list; gh_pair_p (p); p = ly_cdr (p))
(unsmob_translator (ly_car (p))->*method) ();
}
void
Translator_group::initialize ()
{
- SCM tab = scm_make_vector (scm_int2num (19), SCM_BOOL_F);
- context ()->set_property ("acceptHashTable", tab);
+ SCM tab = scm_make_vector (gh_int2scm (19), SCM_BOOL_F);
+ daddy_context_->set_property ("acceptHashTable", tab);
}
{
SCM ack_ifs = scm_assoc (ly_symbol2scm ("events-accepted"),
tr->translator_description ());
- ack_ifs = ly_cdr (ack_ifs);
- for (SCM s = ifaces; ly_c_pair_p (s); s = ly_cdr (s))
+ ack_ifs = gh_cdr (ack_ifs);
+ for (SCM s = ifaces; ly_pair_p (s); s = ly_cdr (s))
if (scm_c_memq (ly_car (s), ack_ifs) != SCM_BOOL_F)
return true;
return false;
find_accept_translators (SCM gravlist, SCM ifaces)
{
SCM l = SCM_EOL;
- for (SCM s = gravlist; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = gravlist; ly_pair_p (s); s = ly_cdr (s))
{
Translator* tr = unsmob_translator (ly_car (s));
if (translator_accepts_any_of (tr, ifaces))
SCM name = scm_sloppy_assq (ly_symbol2scm ("name"),
m->get_property_alist (false));
- if (!ly_c_pair_p (name))
+ if (!gh_pair_p (name))
return false;
- name = ly_cdr (name);
+ name = gh_cdr (name);
SCM accept_list = scm_hashq_ref (tab, name, SCM_UNDEFINED);
if (accept_list == SCM_BOOL_F)
{
scm_hashq_set_x (tab, name, accept_list);
}
- for (SCM p = accept_list; ly_c_pair_p (p); p = ly_cdr (p))
+ for (SCM p = accept_list; gh_pair_p (p); p = ly_cdr (p))
{
Translator * t = unsmob_translator (ly_car (p));
if (t && t->try_music (m))
return false;
}
+SCM
+names_to_translators (SCM namelist, Context*tg)
+{
+ SCM l = SCM_EOL;
+ for (SCM s = namelist; gh_pair_p (s) ; s = ly_cdr (s))
+ {
+ Translator * t = get_translator (ly_car (s));
+ if (!t)
+ warning (_f ("can't find: `%s'", s));
+ else
+ {
+ Translator * tr = t->clone ();
+ SCM str = tr->self_scm ();
+ l = gh_cons (str, l);
+
+ tr->daddy_context_ = tg;
+ scm_gc_unprotect_object (str);
+ }
+ }
+ return l;
+}
+
SCM
Translator_group::get_simple_trans_list ()
recurse_over_translators (Context * c, Translator_method ptr, Direction dir)
{
Translator_group * tg
- = dynamic_cast<Translator_group*> (c->implementation ());
+ = dynamic_cast<Translator_group*> (unsmob_translator (c->implementation_));
/*
(tg->*ptr) ();
}
- for (SCM s = c->children_contexts () ; ly_c_pair_p (s);
- s =ly_cdr (s))
+ for (SCM s = c->context_list_ ; gh_pair_p (s);
+ s =gh_cdr (s))
{
- recurse_over_translators (unsmob_context (ly_car (s)), ptr, dir);
+ recurse_over_translators (unsmob_context (gh_car (s)), ptr, dir);
}
if (dir == UP)
#include "warn.hh"
#include "item.hh"
#include "spanner.hh"
-#include "engraver.hh"
/*
Grob descriptions (ie. alists with layout properties) are
execute_pushpop_property (Context * trg,
SCM prop, SCM eltprop, SCM val)
{
- if (ly_c_symbol_p (prop) && ly_c_symbol_p (eltprop))
+ if (gh_symbol_p (prop) && gh_symbol_p (eltprop))
{
if (val != SCM_UNDEFINED)
{
if (where != trg)
{
SCM base = updated_grob_properties (trg, prop);
- prev = scm_cons (base, base);
+ prev = gh_cons (base, base);
trg->internal_set_property (prop, prev);
}
else
prev = trg->internal_get_property (prop);
- if (!ly_c_pair_p (prev))
+ if (!gh_pair_p (prev))
{
programming_error ("Grob definition should be cons.");
return ;
}
- SCM prev_alist = ly_car (prev);
+ SCM prev_alist = gh_car (prev);
- if (ly_c_pair_p (prev_alist) || prev_alist == SCM_EOL)
+ if (gh_pair_p (prev_alist) || prev_alist == SCM_EOL)
{
bool ok = type_check_assignment (eltprop, val, ly_symbol2scm ("backend-type?"));
tack onto alist:
*/
if (ok)
- scm_set_car_x (prev, scm_acons (eltprop, val, prev_alist));
+ gh_set_car_x (prev, scm_acons (eltprop, val, prev_alist));
}
else
{
else if (trg->where_defined (prop) == trg)
{
SCM prev = trg->internal_get_property (prop);
- SCM prev_alist = ly_car (prev);
- SCM daddy = ly_cdr (prev);
+ SCM prev_alist = gh_car (prev);
+ SCM daddy = gh_cdr (prev);
SCM new_alist = SCM_EOL;
SCM *tail = &new_alist;
while (prev_alist != daddy)
{
- if (ly_c_equal_p (ly_caar (prev_alist), eltprop))
+ if (gh_equal_p (gh_caar (prev_alist), eltprop))
{
- prev_alist = ly_cdr (prev_alist);
+ prev_alist = gh_cdr (prev_alist);
break ;
}
- *tail = scm_cons (ly_car (prev_alist), SCM_EOL);
+ *tail = gh_cons (gh_car (prev_alist), SCM_EOL);
tail = SCM_CDRLOC (*tail);
- prev_alist = ly_cdr (prev_alist);
+ prev_alist = gh_cdr (prev_alist);
}
if (new_alist == SCM_EOL && prev_alist == daddy)
else
{
*tail = prev_alist;
- trg->internal_set_property (prop, scm_cons (new_alist, daddy));
+ trg->internal_set_property (prop, gh_cons (new_alist, daddy));
}
}
}
apply_property_operations (Context *tg, SCM pre_init_ops)
{
SCM correct_order = scm_reverse (pre_init_ops);
- for (SCM s = correct_order; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = correct_order; gh_pair_p (s); s = ly_cdr (s))
{
SCM entry = ly_car (s);
SCM type = ly_car (entry);
if (type == ly_symbol2scm ("push") || type == ly_symbol2scm ("poppush"))
{
SCM val = ly_cddr (entry);
- val = ly_c_pair_p (val) ? ly_car (val) : SCM_UNDEFINED;
+ val = gh_pair_p (val) ? ly_car (val) : SCM_UNDEFINED;
execute_pushpop_property (tg, ly_car (entry), ly_cadr (entry), val);
}
SCM
updated_grob_properties (Context * tg, SCM sym)
{
- assert (ly_c_symbol_p (sym));
+ assert (gh_symbol_p (sym));
tg = tg->where_defined (sym);
if (!tg)
return SCM_EOL;
SCM daddy_props
- = (tg->get_parent_context ())
- ? updated_grob_properties (tg->get_parent_context (), sym)
+ = (tg->daddy_context_)
+ ? updated_grob_properties (tg->daddy_context_, sym)
: SCM_EOL;
SCM props = tg->internal_get_property (sym);
- if (!ly_c_pair_p (props))
+ if (!gh_pair_p (props))
{
programming_error ("grob props not a pair?");
return SCM_EOL;
}
- SCM based_on = ly_cdr (props);
+ SCM based_on = gh_cdr (props);
if (based_on == daddy_props)
{
- return ly_car (props);
+ return gh_car (props);
}
else
{
SCM copy = daddy_props;
SCM * tail = ©
- SCM p = ly_car (props);
+ SCM p = gh_car (props);
while (p != based_on)
{
- *tail = scm_cons (ly_car (p), daddy_props);
+ *tail = gh_cons (gh_car (p), daddy_props);
tail = SCM_CDRLOC (*tail);
p = SCM_CDR (p);
}
}
Item*
-make_item_from_properties (Translator *tr, SCM x, SCM cause)
+make_item_from_properties (Context * tg, SCM x)
{
- Context *tg = tr->context ();
-
SCM props = updated_grob_properties (tg, x);
- Item *it= new Item (props);
-
- dynamic_cast<Engraver*>(tr)->announce_grob (it, cause);
-
- return it;
+ return new Item (props);
}
Spanner*
-make_spanner_from_properties (Translator *tr, SCM x, SCM cause)
+make_spanner_from_properties (Context *tg, SCM x)
{
- Context *tg = tr->context ();
-
SCM props = updated_grob_properties (tg, x);
- Spanner *it= new Spanner (props);
-
- dynamic_cast<Engraver*>(tr)->announce_grob (it, cause);
-
- return it;
+ return new Spanner (props);
}
+
return daddy_context_->now_mom ();
}
-Output_def *
+Music_output_def *
Translator::get_output_def () const
{
return daddy_context_->get_output_def ();
Translator_group*
Translator::get_daddy_translator () const
{
- return daddy_context_->implementation ();
+ Translator *t
+ = unsmob_translator (daddy_context_->implementation_);
+ return dynamic_cast<Translator_group*> (t);
}
#include "warn.hh"
#include "font-interface.hh"
#include "stencil.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "text-item.hh"
#include "tuplet-bracket.hh"
#include "stem.hh"
SCM lp = me->get_property ("left-position");
SCM rp = me->get_property ("right-position");
- if (!ly_c_number_p (rp) || !ly_c_number_p (lp))
+ if (!gh_number_p (rp) || !gh_number_p (lp))
after_line_breaking (smob);
}
Fixme: the type of this prop is sucky.
*/
SCM bracket = me->get_property ("bracket-visibility");
- if (ly_c_boolean_p (bracket))
+ if (gh_boolean_p (bracket))
{
- bracket_visibility = ly_scm2bool (bracket);
+ bracket_visibility = gh_scm2bool (bracket);
}
else if (bracket == ly_symbol2scm ("if-no-beam"))
bracket_visibility = !par_beam;
SCM numb = me->get_property ("number-visibility");
- if (ly_c_boolean_p (numb))
+ if (gh_boolean_p (numb))
{
- number_visibility = ly_scm2bool (numb);
+ number_visibility = gh_scm2bool (numb);
}
else if (numb == ly_symbol2scm ("if-no-beam"))
number_visibility = !par_beam;
SCM number = me->get_property ("text");
- Output_def *pap = me->get_paper ();
+ Paper_def *pap = me->get_paper ();
Stencil num;
- if (ly_c_string_p (number) && number_visibility)
+ if (gh_string_p (number) && number_visibility)
{
SCM properties = Font_interface::text_font_alist_chain (me);
SCM snum = Text_item::interpret_markup (pap->self_scm (), properties, number);
do {
flare[d] = height[d] = shorten[d] = 0.0;
if (is_number_pair (fl))
- flare[d] += ss * ly_scm2double (index_get_cell (fl, d));
+ flare[d] += ss * gh_scm2double (index_get_cell (fl, d));
if (is_number_pair (eh))
- height[d] += - dir * ss *ly_scm2double (index_get_cell (eh, d));
+ height[d] += - dir * ss *gh_scm2double (index_get_cell (eh, d));
if (is_number_pair (sp))
- shorten[d] += ss *ly_scm2double (index_get_cell (sp, d));
+ shorten[d] += ss *gh_scm2double (index_get_cell (sp, d));
}
while (flip (&d) != LEFT);
}
// padding
- *offset += ly_scm2double (me->get_property ("padding")) *dir;
+ *offset += gh_scm2double (me->get_property ("padding")) *dir;
/*
if (b)
me->add_dependency (b);
}
- return SCM_UNSPECIFIED;
+ return SCM_UNDEFINED;
}
MAKE_SCHEME_CALLBACK (Tuplet_bracket,after_line_breaking,1);
{
SCM ps = par_beam->get_property ("positions");
- Real lp = ly_scm2double (ly_car (ps));
- Real rp = ly_scm2double (ly_cdr (ps));
+ Real lp = gh_scm2double (gh_car (ps));
+ Real rp = gh_scm2double (gh_cdr (ps));
/*
duh. magic.
*/
- offset = lp + dir * (0.5 + ly_scm2double (me->get_property ("padding")));
+ offset = lp + dir * (0.5 + gh_scm2double (me->get_property ("padding")));
dy = rp- lp;
}
SCM lp = me->get_property ("left-position");
SCM rp = me->get_property ("right-position");
- if (ly_c_number_p (lp) && !ly_c_number_p (rp))
+ if (gh_number_p (lp) && !gh_number_p (rp))
{
- rp = scm_make_real (ly_scm2double (lp) + dy);
+ rp = gh_double2scm (gh_scm2double (lp) + dy);
}
- else if (ly_c_number_p (rp) && !ly_c_number_p (lp))
+ else if (gh_number_p (rp) && !gh_number_p (lp))
{
- lp = scm_make_real (ly_scm2double (rp) - dy);
+ lp = gh_double2scm (gh_scm2double (rp) - dy);
}
- else if (!ly_c_number_p (rp) && !ly_c_number_p (lp))
+ else if (!gh_number_p (rp) && !gh_number_p (lp))
{
- lp = scm_make_real (offset);
- rp = scm_make_real (offset +dy);
+ lp = gh_double2scm (offset);
+ rp = gh_double2scm (offset +dy);
}
me->set_property ("left-position", lp);
Tuplet_bracket::get_default_dir (Grob*me)
{
Drul_array<int> dirs (0,0);
- for (SCM s = me->get_property ("note-columns"); ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = me->get_property ("note-columns"); gh_pair_p (s); s = ly_cdr (s))
{
Grob * nc = unsmob_grob (ly_car (s));
Direction d = Note_column::dir (nc);
/// The spanners. Array order is synced with time_scaled_musics_
Link_array<Spanner> started_spanners_;
+ virtual void finalize ();
virtual void acknowledge_grob (Grob_info);
virtual bool try_music (Music*r);
virtual void start_translation_timestep ();
if (i < started_spanners_.size () && started_spanners_[i])
continue;
- Spanner* glep = make_spanner ("TupletBracket", time_scaled_musics_ [i]->self_scm ());
+ Spanner* glep = make_spanner ("TupletBracket");
if (i >= started_spanners_.size ())
started_spanners_.push (glep);
SCM proc = get_property ("tupletNumberFormatFunction");
- if (ly_c_procedure_p (proc))
+ if (gh_procedure_p (proc))
{
- SCM t = scm_apply_0 (proc, scm_list_n (time_scaled_musics_[i]->self_scm (), SCM_UNDEFINED));
+ SCM t = gh_apply (proc, scm_list_n (time_scaled_musics_[i]->self_scm (), SCM_UNDEFINED));
glep->set_property ("text", t);
}
+ announce_grob (glep, time_scaled_musics_ [i]->self_scm ());
}
}
{
if (Note_column::has_interface (i.grob_))
{
- for (int j =0; j < started_spanners_.size (); j++)
+ for (int j =0; j <started_spanners_.size (); j++)
if (started_spanners_[j])
Tuplet_bracket::add_column (started_spanners_[j], dynamic_cast<Item*> (i.grob_));
}
if (!sp->get_bound (RIGHT))
sp->set_bound (RIGHT, sp->get_bound (LEFT));
+ typeset_grob (sp);
+
started_spanners_[i] =0;
}
}
}
-Tuplet_engraver::Tuplet_engraver ()
+void
+Tuplet_engraver::finalize ()
{
+ for (int i=0; i < started_spanners_.size (); i++)
+ {
+ if (started_spanners_[i])
+ typeset_grob (started_spanners_[i]);
+ }
}
+
+
+Tuplet_engraver::Tuplet_engraver (){}
+
ENTER_DESCRIPTION (Tuplet_engraver,
/* descr */ "Catch Time_scaled_music and generate appropriate bracket ",
/* creats*/ "TupletBracket",
SCM body = get_music ()->get_property ("element");
SCM alts = get_music ()->get_property ("elements");
int alt_count = scm_ilength (alts);
- int rep_count = ly_scm2int (get_music ()->get_property ("repeat-count"));
+ int rep_count = gh_scm2int (get_music ()->get_property ("repeat-count"));
for (int i = 0; i < rep_count; i++)
{
if (unsmob_music (body))
- *tail = scm_cons (body, SCM_EOL) ;
+ *tail = gh_cons (body, SCM_EOL) ;
tail = SCM_CDRLOC (*tail);
if (alt_count)
{
- *tail = scm_cons (ly_car (alts), SCM_EOL);
+ *tail = gh_cons (gh_car (alts), SCM_EOL);
tail = SCM_CDRLOC (*tail);
if (i >= rep_count - alt_count)
- alts = ly_cdr (alts);
+ alts = gh_cdr (alts);
}
}
SCM
Volta_repeat_iterator::get_music_list ()const
{
- return scm_cons (get_music ()->get_property ("element"),
+ return gh_cons (get_music ()->get_property ("element"),
get_music ()->get_property ("elements"));
}
SCM alts = get_music ()->get_property ("elements");
alt_count_ = scm_ilength (alts);
- rep_count_ = ly_scm2int (get_music ()->get_property ("repeat-count"));
+ rep_count_ = gh_scm2int (get_music ()->get_property ("repeat-count"));
done_count_ = 0;
}
Context * where = get_outlet ()->where_defined (reps);
if (where
- && current_reps == SCM_EOL || ly_c_pair_p (current_reps))
+ && current_reps == SCM_EOL || gh_pair_p (current_reps))
{
- current_reps = scm_cons (what, current_reps);
+ current_reps = gh_cons (what, current_reps);
where->internal_set_property (reps, current_reps);
}
}
#include "staff-symbol-referencer.hh"
#include "font-interface.hh"
#include "warn.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "paper-column.hh"
/*
Spanner *
Vaticana_ligature_engraver::create_ligature_spanner ()
{
- return make_spanner ("VaticanaLigature", SCM_EOL);
+ return make_spanner ("VaticanaLigature");
}
bool
dynamic_cast<Item*> (primitives[0].grob_)->get_column ();
Real join_thickness =
- thickness * column->get_paper ()->get_dimension (ly_symbol2scm ("linethickness"));
+ thickness * column->get_paper ()->get_realvar (ly_symbol2scm ("linethickness"));
/*
* Amount of extra space two put between some particular
{
Item *primitive = dynamic_cast<Item*> (primitives[i].grob_);
int prefix_set =
- ly_scm2int (primitive->get_property ("prefix-set"));
+ gh_scm2int (primitive->get_property ("prefix-set"));
int context_info =
- ly_scm2int (primitive->get_property ("context-info"));
+ gh_scm2int (primitive->get_property ("context-info"));
/*
* Get glyph_name, delta_pitch and context_info for this head.
SCM delta_pitch_scm = prev_primitive->get_property ("delta-pitch");
if (delta_pitch_scm != SCM_EOL)
{
- delta_pitch = ly_scm2int (delta_pitch_scm);
+ delta_pitch = gh_scm2int (delta_pitch_scm);
}
else
{
* Save the head's final x-offset.
*/
primitive->set_property ("x-offset",
- scm_make_real (x_offset));
+ gh_double2scm (x_offset));
/*
* If the head is the 2nd head of a pes or flexa (but not a
else
{
prev_primitive->set_property ("add-join",
- ly_bool2scm (true));
+ gh_bool2scm (true));
/*
* Create a small overlap of adjacent heads so that the join
check_for_prefix_loss (Item *primitive)
{
int prefix_set =
- ly_scm2int (primitive->get_property ("prefix-set"));
+ gh_scm2int (primitive->get_property ("prefix-set"));
if (prefix_set & ~PES_OR_FLEXA)
{
String prefs = Gregorian_ligature::prefixes_to_str (primitive);
SCM delta_pitch_scm = primitive->get_property ("delta-pitch");
if (delta_pitch_scm != SCM_EOL)
{
- delta_pitch = ly_scm2int (delta_pitch_scm);
+ delta_pitch = gh_scm2int (delta_pitch_scm);
}
else
{
/* retrieve & complete prefix_set and context_info */
int prefix_set =
- ly_scm2int (primitive->get_property ("prefix-set"));
+ gh_scm2int (primitive->get_property ("prefix-set"));
int context_info =
- ly_scm2int (primitive->get_property ("context-info"));
+ gh_scm2int (primitive->get_property ("context-info"));
if (is_stacked_head (prefix_set, context_info))
{
context_info |= STACKED_HEAD;
primitive->set_property ("context-info",
- scm_int2num (context_info));
+ gh_int2scm (context_info));
}
/*
if (prefix_set & VIRGA)
{
glyph_name = "vaticana_punctum";
- primitive->set_property ("add-stem", ly_bool2scm (true));
+ primitive->set_property ("add-stem", gh_bool2scm (true));
}
else if (prefix_set & QUILISMA)
glyph_name = "vaticana_quilisma";
* placed somewhere else.
*/
prev_primitive->set_property ("add-cauda",
- ly_bool2scm (false));
+ gh_bool2scm (false));
}
glyph_name = "vaticana_reverse_plica";
}
*/
if ((context_info & FLEXA_LEFT) && !(context_info & PES_UPPER))
if (!String::compare (glyph_name, "vaticana_punctum"))
- primitive->set_property ("add-cauda", ly_bool2scm (true));
+ primitive->set_property ("add-cauda", gh_bool2scm (true));
/*
* Execptional rule for porrectus:
check_for_prefix_loss (prev_primitive);
prev_glyph_name = "flexa";
prev_primitive->set_property ("flexa-height",
- scm_int2num (prev_delta_pitch));
+ gh_int2scm (prev_delta_pitch));
prev_primitive->set_property ("flexa-width",
- scm_make_real (flexa_width));
+ gh_double2scm (flexa_width));
bool add_cauda = !(prev_prefix_set && PES_OR_FLEXA);
prev_primitive->set_property ("add-cauda",
- ly_bool2scm (add_cauda));
+ gh_bool2scm (add_cauda));
check_for_prefix_loss (primitive);
glyph_name = "";
primitive->set_property ("flexa-width",
- scm_make_real (flexa_width));
+ gh_double2scm (flexa_width));
}
/*
* ligature grob's value for thickness to each ligature head (even
* if not all of them need to know).
*/
- primitive->set_property ("thickness", scm_make_real (thickness));
+ primitive->set_property ("thickness", gh_double2scm (thickness));
prev_primitive = primitive;
prev_prefix_set = prefix_set;
"setting `spacing-increment = %f': ptr=%ul",
ligature_width, paper_column));
paper_column->
- set_property ("forced-spacing", scm_make_real (ligature_width));
+ set_property ("forced-spacing", gh_double2scm (ligature_width));
#endif
}
#include "lookup.hh"
#include "staff-symbol-referencer.hh"
#include "note-head.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "bezier.hh"
#include "warn.hh"
Real line_thickness)
{
Real staff_space = Staff_symbol_referencer::staff_space (me);
- Stencil stencil;
+ Stencil stencil = Stencil ();
Real right_height = 0.6 * staff_space;
Real interval;
SCM flexa_height_scm = me->get_property ("flexa-height");
if (flexa_height_scm != SCM_EOL)
{
- interval = ly_scm2int (flexa_height_scm);
+ interval = gh_scm2int (flexa_height_scm);
}
else
{
Real thickness = robust_scm2double ( me->get_property ("thickness"), 1);
Real line_thickness =
- thickness * me->get_paper ()->get_dimension (ly_symbol2scm ("linethickness"));
+ thickness * me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness"));
Real blotdiameter =
- (me->get_paper ()->get_dimension (ly_symbol2scm ("blotdiameter")));
+ (me->get_paper ()->get_realvar (ly_symbol2scm ("blotdiameter")));
int pos = Staff_symbol_referencer::get_rounded_position (me);
SCM delta_pitch_scm = me->get_property ("delta-pitch");
int delta_pitch;
if (delta_pitch_scm != SCM_EOL)
- delta_pitch = ly_scm2int (delta_pitch_scm);
+ delta_pitch = gh_scm2int (delta_pitch_scm);
else
delta_pitch = 0;
{
if (!valign_)
{
- valign_ = make_spanner ("VerticalAlignment", SCM_EOL);
+ valign_ =make_spanner ("VerticalAlignment");
valign_->set_bound (LEFT,unsmob_grob (get_property ("currentCommandColumn")));
+ announce_grob (valign_ , SCM_EOL);
}
}
if (valign_)
{
valign_->set_bound (RIGHT,unsmob_grob (get_property ("currentCommandColumn")));
- valign_ = 0;
+ typeset_grob (valign_);
+ valign_ =0;
}
}
#include "virtual-font-metric.hh"
#include "all-font-metrics.hh"
#include "stencil.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
/*
passing DEF is ughish. Should move into paperdef?
*/
-Virtual_font_metric::Virtual_font_metric (SCM font_list)
+Virtual_font_metric::Virtual_font_metric (SCM name_list,
+ Real mag,Paper_def*def)
{
font_list_ = SCM_EOL;
SCM *tail = &font_list_;
-
- SCM mag = SCM_EOL;
- SCM name_list = SCM_EOL;
- SCM *name_tail = &name_list;
-
- for (SCM s = font_list; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = name_list; gh_pair_p (s); s = gh_cdr (s))
{
- if (Font_metric *fm = unsmob_metrics (ly_car (s)))
- {
- *tail = scm_cons (ly_car (s),SCM_EOL);
- tail = SCM_CDRLOC (*tail);
+ SCM nm = gh_car (s);
- if (!ly_c_number_p (mag))
- /* Ugh. */
- mag = ly_cdr (fm->description_);
-
- *name_tail = scm_cons (ly_car (fm->description_), SCM_EOL);
- name_tail = SCM_CDRLOC (*name_tail);
- }
+ Font_metric *fm = def->find_font (nm, mag);
+ *tail = scm_cons (fm->self_scm (),SCM_EOL);
+ tail = SCM_CDRLOC (*tail);
}
-
- description_ = scm_cons (name_list, mag);
-}
-
-Real
-Virtual_font_metric::design_size () const
-{
- return unsmob_metrics (ly_car (font_list_))-> design_size ();
}
void
Virtual_font_metric::count () const
{
int k = 0;
- for (SCM s = font_list_; ly_c_pair_p (s); s = ly_cdr (s))
- k += unsmob_metrics (ly_car (s))->count ();
+ for (SCM s = font_list_; gh_pair_p (s); s = gh_cdr (s))
+ {
+ k+= unsmob_metrics (gh_car (s))->count ();
+ }
+
return k;
}
Virtual_font_metric::find_by_name (String glyph) const
{
Stencil m;
- for (SCM s = font_list_; m.is_empty () && ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = font_list_; m.is_empty () && gh_pair_p (s); s = gh_cdr (s))
{
- m = unsmob_metrics (ly_car (s))->find_by_name (glyph);
+ m = unsmob_metrics (gh_car (s))->find_by_name (glyph);
}
return m;
}
+
+
Box
Virtual_font_metric::get_ascii_char (int) const
return Stencil ();
}
+
Offset
Virtual_font_metric::get_indexed_wxwy (int code) const
{
int total = 0;
- for (SCM s = font_list_; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = font_list_; gh_pair_p (s); s = gh_cdr (s))
{
- Font_metric *fm = unsmob_metrics (ly_car (s));
+ Font_metric* fm = unsmob_metrics (gh_car (s));
if (code < total + fm->count ())
- return fm->get_indexed_wxwy (code - total);
+ {
+ return fm->get_indexed_wxwy (code - total);
+ }
total += fm->count ();
}
+
+
return Offset (0,0);
}
Virtual_font_metric::get_indexed_char (int code) const
{
int total = 0;
- for (SCM s = font_list_; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = font_list_; gh_pair_p (s); s = gh_cdr (s))
{
- Font_metric *fm = unsmob_metrics (ly_car (s));
+ Font_metric* fm = unsmob_metrics (gh_car (s));
if (code < total + fm->count ())
- return fm->get_indexed_char (code - total);
+ {
+ return fm->get_indexed_char (code - total);
+ }
total += fm->count ();
}
+
+
return Box ();
}
+
int
Virtual_font_metric::name_to_index (String glyph) const
{
Stencil m;
int total = 0;
- for (SCM s = font_list_; m.is_empty () && ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = font_list_; m.is_empty () && gh_pair_p (s); s = gh_cdr (s))
{
- Font_metric *m =unsmob_metrics (ly_car (s));
+ Font_metric *m =unsmob_metrics (gh_car (s));
int k = m->name_to_index (glyph);
if (k >= 0)
return total + k;
total += m->count ();
}
+
return -1;
}
+
Stencil
Virtual_font_metric::get_indexed_char_stencil (int code) const
Stencil m ;
int total = 0;
- for (SCM s = font_list_; ly_c_pair_p (s); s = ly_cdr (s))
+ for (SCM s = font_list_; gh_pair_p (s); s = gh_cdr (s))
{
- Font_metric *fm = unsmob_metrics (ly_car (s));
+ Font_metric* fm = unsmob_metrics (gh_car (s));
if (code < total + fm->count ())
{
- /* Ugh. */
- m = fm->get_indexed_char_stencil (code - total);
+ m = fm->get_indexed_char_stencil (code - total); // ugh.
break;
}
total += fm->count ();
}
- return m;
-}
-
-SCM
-Virtual_font_metric::get_font_list () const
-{
- return font_list_;
-}
-
-LY_DEFINE (ly_make_virtual_font, "ly:make-virtual-font", 0, 0, 1,
- (SCM args),
- "Make a virtual font metric from @var{args}, "
- "a list of font objects.")
-{
- Virtual_font_metric *fm = new Virtual_font_metric (args);
- return scm_gc_unprotect_object (fm->self_scm ());
-}
-
-String
-Virtual_font_metric::coding_scheme () const
-{
- Font_metric *fm = unsmob_metrics (ly_car (font_list_));
- return fm->coding_scheme ();
+ return m;
}
+
#include "line-interface.hh"
#include "stencil.hh"
#include "paper-column.hh"
-#include "output-def.hh"
+#include "paper-def.hh"
#include "text-item.hh"
#include "volta-bracket.hh"
#include "group-interface.hh"
SCM glyph = endbar->get_property ("glyph");
String str;
- if (ly_c_string_p (glyph))
+ if (gh_string_p (glyph))
str = ly_scm2string (glyph);
else
return SCM_EOL;
(strcmp (cs,":|")!=0 && strcmp (cs,"|:")!=0 && strcmp (cs,"|.")!=0
&& strcmp (cs,":|:")!=0 && strcmp (cs,".|")!=0);
- Output_def * paper =me->get_paper ();
+ Paper_def * paper =me->get_paper ();
Real half_space = 0.5;
Item * bound = dynamic_cast<Spanner*> (me)->get_bound (LEFT);
volta engraver in score context or somesuch.
*/
- if (!ly_c_pair_p (staffs))
+ if (!gh_pair_p (staffs))
{
programming_error ("Huh? Volta engraver can't find staffs?");
return false;
bool end = false;
start_string_ = SCM_EOL;
- while (ly_c_pair_p (cs))
+ while (gh_pair_p (cs))
{
SCM c = ly_car (cs);
- if (ly_c_pair_p (c)
+ if (gh_pair_p (c)
&& ly_car (c) == ly_symbol2scm ("volta")
- && ly_c_pair_p (ly_cdr (c)))
+ && gh_pair_p (ly_cdr (c)))
{
if (ly_cadr (c) == SCM_BOOL_F)
end = true;
}
if (volta_span_ &&
- (ly_c_string_p (start_string_) || ly_c_pair_p (start_string_)))
+ (gh_string_p (start_string_) || gh_pair_p (start_string_)))
{
warning (_ ("Already have a volta spanner. Stopping that one prematurely."));
}
if (!volta_span_ &&
- (ly_c_string_p (start_string_) || ly_c_pair_p (start_string_)))
+ (gh_string_p (start_string_) || gh_pair_p (start_string_)))
{
started_mom_ = now_mom () ;
- volta_span_ = make_spanner ("VoltaBracket", SCM_EOL);
+ volta_span_ = make_spanner ("VoltaBracket");
-
+ announce_grob (volta_span_, SCM_EOL);
volta_span_->set_property ("text", start_string_);
}
}
void
Volta_engraver::finalize ()
{
+ if (volta_span_)
+ {
+ typeset_grob (volta_span_);
+ }
+ if (end_volta_span_)
+ {
+ typeset_grob (end_volta_span_);
+ }
}
volta_span_ = 0;
}
- end_volta_span_ =0;
+ if (end_volta_span_)
+ {
+ typeset_grob (end_volta_span_);
+ end_volta_span_ =0;
+ }
}
/*
--- /dev/null
+/*
+ warn.cc -- implement warning and error messages. Needs cleanup.
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+#include <stdio.h>
+
+#include "string.hh"
+#include "main.hh"
+
+void
+progress_indication (String s)
+{
+ fputs (s.to_str0 (), stderr);
+ fflush (stderr);
+}
+
-\version "2.2.0"
+\version "2.1.36"
% a3-init.ly
hsize = 296.9 \mm
-\version "2.2.0"
+\version "2.1.36"
% a4.ly
hsize = 210.0 \mm
-\version "2.2.0"
+\version "2.1.36"
% Symbols needed to print accordion music
%
% 2' = T
% Toplevel initialisation file.
-\version "2.2.0"
+\version "2.1.36"
\include "declarations-init.ly"
+++ /dev/null
-\version "2.3.2"
-
-\bookpaper {
- unit = #(ly:unit)
- mm = 1.0
- in = 25.4
- pt = #(/ in 72.27)
- cm = #(* 10 mm)
-
- inputencoding = #"TeX"
-
- %
- % 20pt staff, 5 pt = 1.75 mm
- %
-
- outputscale = #1.7573
-
- #(define-public score-title default-score-title)
- #(define-public user-title default-user-title)
- #(define-public book-title default-book-title)
-
- %
- % ugh. hard coded?
- %
-
- #(paper-set-staff-size (* 20.0 pt))
-
-
- papersize = "a4"
-
- #(define font-defaults
- '((font-encoding . fetaMusic)))
-
- #(define text-font-defaults
- '((font-encoding . latin1)
- (baseline-skip . 2)
- (word-space . 0.6)))
-
- #(define page-breaking ly:optimal-page-breaks)
- #(define page-music-height default-page-music-height )
- #(define page-make-stencil default-page-make-stencil )
-
- #(define make-header plain-header)
- #(define make-footer plain-footer)
-
-}
pitchnames = \pitchnamesCatalan
-\version "2.2.0"
-
-#(ly:parser-set-note-names parser pitchnames)
+\version "2.1.36"
% Toplevel initialisation file.
-\version "2.2.0"
+\version "2.1.36"
\include "declarations-init.ly"
-\version "2.2.0"
+\version "2.1.36"
chordmodifiers = #default-chord-modifier-list
-whiteTriangleMarkup = \markup { \override #'(font-encoding . TeX-math) "M" }
+whiteTriangleMarkup = #(make-override-markup
+ '(font-encoding . math) (make-simple-markup "M"))
-blackTriangleMarkup = \markup { \override #'(font-encoding . TeX-math) "N" }
+blackTriangleMarkup = #(make-override-markup
+ '(font-encoding . math) (make-simple-markup "N"))
ignatzekExceptionMusic = \notes{
<c e gis>1-\markup { "+" }
#(ly:set-option 'old-relative)
-\version "2.3.2"
+\version "2.1.36"
breve = #(ly:make-duration -1 0)
longa = #(ly:make-duration -2 0 )
maxima = #(ly:make-duration -3 0)
-\include "music-functions-init.ly"
\include "nederlands.ly" % dutch
\include "drumpitch-init.ly"
\include "chord-modifiers-init.ly"
working with lyric sections)
%}
-
-%% rather name \newline, \newpage ?
-break = #(make-event-chord (list (make-penalty-music -10001 0)))
-noBreak = #(make-event-chord (list (make-penalty-music 10001 0)))
-pageBreak = #(make-event-chord (list (make-penalty-music -10001 -10001)))
-pagebreak = \pageBreak % ugh.
-noPageBreak = #(make-event-chord (list (make-penalty-music 0 10001)))
-noPagebreak = \noPageBreak % ugh
+break =#(make-event-chord (list (make-penalty-music -10001)))
+noBreak = #(make-event-chord (list (make-penalty-music 10001)))
noBeam = #(make-music 'BeamForbidEvent)
-pipeSymbol = #(make-music 'BarCheck)
-
-foo = \notes { \pageBreak }
\include "scale-definitions-init.ly"
-
melisma = #(make-span-event 'ManualMelismaEvent START)
melismaEnd = #(make-span-event 'ManualMelismaEvent STOP)
% ugh
\include "midi-init.ly"
-\include "book-paper-defaults.ly"
+% Do units first; must be done before any units are specified.
\paper {
- mm = #(ly:output-def-lookup $defaultbookpaper 'mm)
- unit = #(ly:output-def-lookup $defaultbookpaper 'unit)
-
- in = #(* 25.4 mm)
+ unit = #(ly:unit)
+ mm = 1.0
+ in = 25.4
pt = #(/ in 72.27)
cm = #(* 10 mm)
+
+ raggedright = ##f
+ raggedlast = ##f
+ packed = ##f
+ #(define $is-paper #t)
+
+ #(define font-defaults
+ '((font-encoding . music))
+ )
+
+ #(define text-font-defaults
+ '((font-encoding . text)
+ (baseline-skip . 2)
+ (word-space . 0.6)
+ ))
+
+ #(define page-breaking ly:ragged-page-breaks)
+ %#(define page-breaking ly:optimal-page-breaks)
\include "engraver-init.ly"
}
-
#(set-default-paper-size "a4")
-
%{
-%% these would supercede defaults in \bookpaper.
-% let's comment this out for now.
+; note:
+; you can add fonts manually in the paper block by issuing
+#(set! fonts (append ...myfonts... fonts))
+
+for the format of myfonts, see font.scm
+
+%}
paperEleven = \paper {
#(paper-set-staff-size (* 11.0 pt))
\paper { \paperTwenty }
-%}
-
partCombineListener = \paper {
\context {
- \Voice
+ \VoiceContext
\consists Note_heads_engraver
\consists Rest_engraver
\type "Recording_group_engraver"
recordEventSequence = #notice-the-events-for-pc
}
- \context { \Score skipTypesetting = ##t }
+ \context { \ScoreContext skipTypesetting = ##t }
}
#(set-part-combine-listener partCombineListener)
\include "property-init.ly"
-%% reset default duration
-unusedEntry = \notes { c4 }
-%% must have size argument for GUILE 1.6 compat.
-#(define musicQuotes (make-hash-table 29))
-%%#(define-public toplevel-music-handler ly:parser-add-book-and-score)
-#(define toplevel-book-handler default-toplevel-book-handler)
-#(define toplevel-music-handler default-toplevel-music-handler)
-#(define toplevel-score-handler default-toplevel-score-handler)
+% reset default duration
+unusedEntry = \notes { c4 }
+
-#(define toplevel-score-handler default-toplevel-score-handler)
+% must have size argument for GUILE 1.6 compat.
+#(define musicQuotes (make-hash-table 29))
pitchnames = \pitchnamesDeutsch
-\version "2.2.0"
-
-#(ly:parser-set-note-names parser pitchnames)
+\version "2.1.36"
-\version "2.2.0"
+\version "2.1.36"
drumPitchNames =
#'((acousticbassdrum . acousticbassdrum)
-\version "2.2.0"
+\version "2.1.36"
%
% declare the standard dynamic identifiers.
pitchnames = \pitchnamesEnglish
-\version "2.2.0"
+\version "2.1.36"
-
-#(ly:parser-set-note-names parser pitchnames)
-\version "2.3.2"
+\version "2.1.36"
\context {
\name Global
\grobdescriptions #all-grob-descriptions
}
+%
+% setup for Request->Element conversion. Guru-only
+%
+
\context {
\type "Engraver_group_engraver"
\name Staff
verticalExtent = ##f
localKeySignature = #'()
createSpacing = ##t
-
% explicitly set instrument, so we don't get
% weird effects when doing instrument names for
% piano staves
}
\context {
- \Staff
+ \StaffContext
\type "Engraver_group_engraver"
\name DrumStaff
\alias Staff
\name InnerChoirStaff
\consists "System_start_delimiter_engraver"
systemStartDelimiter = #'SystemStartBracket
+ localKeySignature = #'()
\accepts "Staff"
\accepts "DrumStaff"
}
\context {
- \InnerChoirStaff
+ \InnerChoirStaffContext
\name ChoirStaff
\accepts "InnerChoirStaff"
}
\context {
- \Voice
+ \VoiceContext
\name DrumVoice
\alias Voice
}
\context{
- \GrandStaff
+ \GrandStaffContext
\name "PianoStaff"
\alias "GrandStaff"
\context {
\type "Engraver_group_engraver"
\name InnerStaffGroup
+ localKeySignature = #'()
\consists "Span_bar_engraver"
\consists "Span_arpeggio_engraver"
}
\context {
- \InnerStaffGroup
+ \InnerStaffGroupContext
\name StaffGroup
\description
RemoveEmptyStaffContext= \context {
- \Staff
+ \StaffContext
\remove "Axis_group_engraver"
\consistsend "Hara_kiri_engraver"
\override Beam #'auto-knee-gap = #'()
\context {
\type Score_engraver
\name Score
+ localKeySignature = #'()
\description "This is the top level notation context. No
other context can contain a @code{Score} context. This context
(Voice NoteHead font-size -3)
(Voice Dots font-size -3)
(Voice Stem beamed-lengths
- ,(map (lambda (x) (* 0.8 x)) '(3.3 3.3 4.0)))
+ ,(map (lambda (x) (* 0.8 x)) '(3.26)))
(Voice Stem beamed-minimum-free-lengths
,(map (lambda (x) (* 0.8 x)) '(2.5 2.0 1.5)))
(Voice Stem beamed-extreme-minimum-free-lengths
}
-EasyNotation = \context { % TODO: why \context override?
- \Score
+OrchestralScoreContext = \context {
+ \ScoreContext
+}
+
+EasyNotation = \context {
+ \ScoreContext
\override NoteHead #'print-function = #Note_head::brew_ez_stencil
\override NoteHead #'Y-extent-callback = #'()
\override NoteHead #'X-extent-callback = #'()
}
\context {
- \Voice
+ \VoiceContext
\name "TabVoice"
\consists "Tab_note_heads_engraver"
\remove "Note_heads_engraver"
}
\context {
- \Staff
+ \StaffContext
\alias "Staff"
\name "TabStaff"
\denies "Voice"
% but this does not work (is this a bug or intended behaviour?):
%
% If I try to do so, I get "error: unknown escaped string:
-% `\VaticanaStaff'" in params-init.ly. If I also move
+% `\VaticanaStaffContext'" in params-init.ly. If I also move
% "\context { \Vaticana*Context }" from params-init.ly to the end
% of gregorian-init.ly, then I get "error: parse error, unexpected
-% TRANSLATOR: \context { \VaticanaStaff }" in
+% TRANSLATOR: \context { \VaticanaStaffContext }" in
% gregorian-init.ly. --jr
\context {
- \Voice
+ \VoiceContext
\name "VaticanaVoice"
\alias "Voice"
\description "Same as @code{Voice} context, except that it is accommodated for tyepsetting Gregorian Chant in the notational style of Editio Vaticana."
}
\context {
- \Staff
+ \StaffContext
\name "VaticanaStaff"
\alias "Staff"
\denies "Voice"
}
\context {
- \Voice
+ \VoiceContext
\name "GregorianTranscriptionVoice"
\alias "Voice"
\override TextSpanner #'edge-text = #'("" . "")
}
\context {
- \Staff
+ \StaffContext
\name "GregorianTranscriptionStaff"
\alias "Staff"
\denies "Voice"
pitchnames = \pitchnamesEspanol
-\version "2.2.0"
-
-#(ly:parser-set-note-names parser pitchnames)
+\version "2.1.36"
-\version "2.2.0"
+\version "2.1.36"
%
% Running LilyPond on this file generates the documentation
-\version "2.2.0"
+\version "2.1.36"
%
% Running LilyPond on this file generates the short interface doc
-\version "2.3.1"
+\version "2.1.36"
startGraceMusic = \notes {
-\version "2.2.0"
+\version "2.1.36"
%%%%%%%%
%%%%%%%% shortcuts common for all styles of gregorian chant notation
% Toplevel initialisation file.
#(define-public point-and-click #f)
-#(define-public midi-debug #f)
+#(define-public midi-debug #f)
-\version "2.2.0"
+\version "2.1.36"
\include "declarations-init.ly"
%%
#(if (and (ly:get-option 'old-relative)
- (defined? 'input-file-name)
(not (ly:get-option 'old-relative-used)))
(ly:warn (string-append
"\n"
pitchnames = \pitchnamesItaliano
-\version "2.2.0"
-
-#(ly:parser-set-note-names parser pitchnames)
+\version "2.1.36"
-\version "2.2.0"
+\version "2.1.36"
% legal-init.ly
hsize = 8.5 \in
-\version "2.2.0"
+\version "2.1.36"
% letter-init.ly
hsize = 8.5 \in
-\version "2.2.0"
+\version "2.1.36"
\midi {
\tempo 4=60
\include "performer-init.ly"
+++ /dev/null
-\version "2.3.2"
-
-
-applymusic = #(def-music-function (location func music) (procedure? ly:music?)
- (func music))
-
-addlyrics = #(def-music-function (location music lyrics) (ly:music? ly:music?)
- (make-music 'LyricCombineMusic
- 'origin location
- 'elements (list music lyrics)))
-
-grace = #(def-grace-function startGraceMusic stopGraceMusic)
-acciaccatura = #(def-grace-function startAcciaccaturaMusic stopAcciaccaturaMusic)
-appoggiatura = #(def-grace-function startAppoggiaturaMusic stopAppoggiaturaMusic)
-
-partcombine = #(def-music-function (location part1 part2) (ly:music? ly:music?)
- (make-part-combine-music (list part1 part2)))
-
-autochange = #(def-music-function (location music) (ly:music?)
- (make-autochange-music music))
-
-applycontext = #(def-music-function (location proc) (procedure?)
- (make-music 'ApplyContext
- 'origin location
- 'procedure proc))
-
-applyoutput = #(def-music-function (location proc) (procedure?)
- (make-music 'ApplyOutputEvent
- 'origin location
- 'procedure proc))
-
-breathe = #(def-music-function (location) ()
- (make-music 'EventChord
- 'origin location
- 'elements (list (make-music 'BreathingSignEvent))))
-
-%% \mytag #'foo { ... } ==> OK
-%% c-\mytag #'foo ^4 ==> KO
-%{
-#(use-modules (srfi srfi-1))
-#(define-public (symbol-or-symbols? obj)
- "Return #t iif obj is a symbol or a symbol list."
- (or (symbol? obj)
- (and (list? obj)
- (null? (remove symbol? obj)))))
-
-mytag = #(def-music-function (location tagname music) (symbol-or-symbols? ly:music?)
- (set! (ly:music-property music 'tags)
- ((if (list? tagname) append cons) tagname (ly:music-property music 'tags)))
- music)
-%}
-
-%{
-
-TODO:
-
-remove these from the parser, and softcode here:
-
- * \tag
-
-with small syntax changes, we could also do
-
- * \bar
- * ?
-
-%}
-\version "2.2.0"
+\version "2.1.36"
%{
common dutch names for notes. es means flat, is means sharp
-
-notenames should only contain letters. No digits or punctuation.
-
%}
dutchPitchnames = #`(
pitchnames = \dutchPitchnames
-#(ly:parser-set-note-names parser pitchnames)
pitchnames =\pitchnamesNorsk
-\version "2.2.0"
-
-#(ly:parser-set-note-names parser pitchnames)
+\version "2.1.36"
-\version "2.2.0"
+\version "2.1.36"
-\version "2.3.2"
+\version "2.1.36"
% JUNKME
%part-paper-init.ly
\paper {
- \context { \OrchestralPartStaff }
- \context { \Score skipBars = ##t }
+ \context { \OrchestralPartStaffContext }
+ \context { \ScoreContext skipBars = ##t }
}
-\version "2.3.2"
+\version "2.1.36"
%
% setup for Request->Element conversion. Guru-only
\description "Hard coded entry point for LilyPond. Cannot be tuned."
}
\context {
- \Staff
+ \StaffContext
\name DrumStaff
midiInstrument = #"drums"
\accepts DrumVoice
\context {
- \Voice
+ \VoiceContext
\remove "Note_performer"
\consists "Drum_note_performer"
\name DrumVoice
\accepts DrumStaff
}
-\context { \Staff \name RhythmicStaff }
+\context { \StaffContext \name RhythmicStaff }
+++ /dev/null
-%{
-
- Common Portuguese names for notes. "b" means flat (bemol), "s" means
- sharp (sustenido). Adapted from espanol.ly and italian.ly.
-
- English: a b c d e f g
- Portuguese: la si do re mi fa sol
-
-%}
-
-% contributed by Pedro Kröger <<kroeger@pedrokroeger.net>>
-
-
-pitchnamesPortuguese = #`(
- (dobb . ,(ly:make-pitch -1 0 DOUBLE-FLAT))
- (dobtqt . ,(ly:make-pitch -1 0 THREE-Q-FLAT))
- (dob . ,(ly:make-pitch -1 0 FLAT))
- (dobqt . ,(ly:make-pitch -1 0 SEMI-FLAT))
- (do . ,(ly:make-pitch -1 0 NATURAL))
- (dosqt . ,(ly:make-pitch -1 0 SEMI-SHARP))
- (dos . ,(ly:make-pitch -1 0 SHARP))
- (dostqt . ,(ly:make-pitch -1 0 THREE-Q-SHARP))
- (doss . ,(ly:make-pitch -1 0 DOUBLE-SHARP))
-
- (rebb . ,(ly:make-pitch -1 1 DOUBLE-FLAT))
- (rebtqt . ,(ly:make-pitch -1 1 THREE-Q-FLAT))
- (reb . ,(ly:make-pitch -1 1 FLAT))
- (rebqt . ,(ly:make-pitch -1 1 SEMI-FLAT))
- (re . ,(ly:make-pitch -1 1 NATURAL))
- (resqt . ,(ly:make-pitch -1 1 SEMI-SHARP))
- (res . ,(ly:make-pitch -1 1 SHARP))
- (restqt . ,(ly:make-pitch -1 1 THREE-Q-SHARP))
- (ress . ,(ly:make-pitch -1 1 DOUBLE-SHARP))
-
- (mibb . ,(ly:make-pitch -1 2 DOUBLE-FLAT))
- (mibtqt . ,(ly:make-pitch -1 2 THREE-Q-FLAT))
- (mib . ,(ly:make-pitch -1 2 FLAT))
- (mibqt . ,(ly:make-pitch -1 2 SEMI-FLAT))
- (mi . ,(ly:make-pitch -1 2 NATURAL))
- (misqt . ,(ly:make-pitch -1 2 SEMI-SHARP))
- (mis . ,(ly:make-pitch -1 2 SHARP))
- (mistqt . ,(ly:make-pitch -1 2 THREE-Q-SHARP))
- (miss . ,(ly:make-pitch -1 2 DOUBLE-SHARP))
-
- (fabb . ,(ly:make-pitch -1 3 DOUBLE-FLAT))
- (fabtqt . ,(ly:make-pitch -1 3 THREE-Q-FLAT))
- (fab . ,(ly:make-pitch -1 3 FLAT))
- (fabqt . ,(ly:make-pitch -1 3 SEMI-FLAT))
- (fa . ,(ly:make-pitch -1 3 NATURAL))
- (fasqt . ,(ly:make-pitch -1 3 SEMI-SHARP))
- (fas . ,(ly:make-pitch -1 3 SHARP))
- (fastqt . ,(ly:make-pitch -1 3 THREE-Q-SHARP))
- (fass . ,(ly:make-pitch -1 3 DOUBLE-SHARP))
-
- (solbb . ,(ly:make-pitch -1 4 DOUBLE-FLAT))
- (solbtqt . ,(ly:make-pitch -1 4 THREE-Q-FLAT))
- (solb . ,(ly:make-pitch -1 4 FLAT))
- (solbqt . ,(ly:make-pitch -1 4 SEMI-FLAT))
- (sol . ,(ly:make-pitch -1 4 NATURAL))
- (solsqt . ,(ly:make-pitch -1 4 SEMI-SHARP))
- (sols . ,(ly:make-pitch -1 4 SHARP))
- (solstqt . ,(ly:make-pitch -1 4 THREE-Q-SHARP))
- (solss . ,(ly:make-pitch -1 4 DOUBLE-SHARP))
-
- (labb . ,(ly:make-pitch -1 5 DOUBLE-FLAT))
- (labtqt . ,(ly:make-pitch -1 5 THREE-Q-FLAT))
- (lab . ,(ly:make-pitch -1 5 FLAT))
- (labqt . ,(ly:make-pitch -1 5 SEMI-FLAT))
- (la . ,(ly:make-pitch -1 5 NATURAL))
- (lasqt . ,(ly:make-pitch -1 5 SEMI-SHARP))
- (las . ,(ly:make-pitch -1 5 SHARP))
- (lastqt . ,(ly:make-pitch -1 5 THREE-Q-SHARP))
- (lass . ,(ly:make-pitch -1 5 DOUBLE-SHARP))
-
- (sibb . ,(ly:make-pitch -1 6 DOUBLE-FLAT))
- (sibtqt . ,(ly:make-pitch -1 6 THREE-Q-FLAT))
- (sib . ,(ly:make-pitch -1 6 FLAT))
- (sibqt . ,(ly:make-pitch -1 6 SEMI-FLAT))
- (si . ,(ly:make-pitch -1 6 NATURAL))
- (sisqt . ,(ly:make-pitch -1 6 SEMI-SHARP))
- (sis . ,(ly:make-pitch -1 6 SHARP))
- (sistqt . ,(ly:make-pitch -1 6 THREE-Q-SHARP))
- (siss . ,(ly:make-pitch -1 6 DOUBLE-SHARP))
-
-)
-
-pitchnames = \pitchnamesPortuguese
-
-\version "2.2.0"
-
-#(ly:parser-set-note-names parser pitchnames)
% property-init.ly
-\version "2.2.0"
+\version "2.1.36"
stemUp = \override Stem #'direction = #1
stemDown = \override Stem #'direction = #-1
\set Timing.measurePosition = #(ly:make-moment 0 1)
}
+newpage = \notes
+{
+ \break
+ % urg, only works for TeX output
+ \context Score \applyoutput
+ #(outputproperty-compatibility (make-type-checker 'paper-column-interface)
+ 'between-system-string "\\newpage")
+}
+
% dynamic ly:dir? text script, articulation script ly:dir?
oneVoice = #(context-spec-music (make-voice-props-revert) 'Voice)
voiceOne = #(context-spec-music (make-voice-props-set 0) 'Voice)
-\version "2.2.0"
+\version "2.1.36"
major = #`(
-\version "2.2.0"
+\version "2.1.36"
dashHat= "marcato"
-\version "2.2.0"
+\version "2.1.36"
startGroup = #(make-span-event 'NoteGroupingEvent START)
stopGroup = #(make-span-event 'NoteGroupingEvent STOP)
pitchnames = \pitchnamesSuomi
-\version "2.2.0"
-
-#(ly:parser-set-note-names parser pitchnames)
+\version "2.1.36"
)
pitchnames = \pitchnamesSvenska
-\version "2.2.0"
-
-#(ly:parser-set-note-names parser pitchnames)
+\version "2.1.36"
-\version "2.2.0"
+\version "2.1.36"
% tabloid-init.ly
+++ /dev/null
-\version "2.2.0" %hier stond 2.1.36, mocht ik dat wel veranderen?
-
-%{
-
- Common Flemish names for notes. "b" means flat (bemol), "k" means sharp (kruis).
- Adapted from espanol.ly.
-
- English: a b c d e f g
- Flemish: la si do re mi fa sol
-
-%}
-
-% contributed by Hendrik Maryns <<hendrik.maryns@ugent.be>> 06/06/2004
-
-
-pitchnamesVlaams = #`(
- (dobb . ,(ly:make-pitch -1 0 DOUBLE-FLAT))
- (dob . ,(ly:make-pitch -1 0 FLAT))
- (do . ,(ly:make-pitch -1 0 NATURAL))
- (dok . ,(ly:make-pitch -1 0 SHARP))
- (dokk . ,(ly:make-pitch -1 0 DOUBLE-SHARP))
-
- (rebb . ,(ly:make-pitch -1 1 DOUBLE-FLAT))
- (reb . ,(ly:make-pitch -1 1 FLAT))
- (re . ,(ly:make-pitch -1 1 NATURAL))
- (rek . ,(ly:make-pitch -1 1 SHARP))
- (rekk . ,(ly:make-pitch -1 1 DOUBLE-SHARP))
-
- (mibb . ,(ly:make-pitch -1 2 DOUBLE-FLAT))
- (mib . ,(ly:make-pitch -1 2 FLAT))
- (mi . ,(ly:make-pitch -1 2 NATURAL))
- (mik . ,(ly:make-pitch -1 2 SHARP))
- (mikk . ,(ly:make-pitch -1 2 DOUBLE-SHARP))
-
- (fabb . ,(ly:make-pitch -1 3 DOUBLE-FLAT))
- (fab . ,(ly:make-pitch -1 3 FLAT))
- (fa . ,(ly:make-pitch -1 3 NATURAL))
- (fak . ,(ly:make-pitch -1 3 SHARP))
- (fakk . ,(ly:make-pitch -1 3 DOUBLE-SHARP))
-
- (solbb . ,(ly:make-pitch -1 4 DOUBLE-FLAT))
- (solb . ,(ly:make-pitch -1 4 FLAT))
- (sol . ,(ly:make-pitch -1 4 NATURAL))
- (solk . ,(ly:make-pitch -1 4 SHARP))
- (solkk . ,(ly:make-pitch -1 4 DOUBLE-SHARP))
-
- (labb . ,(ly:make-pitch -1 5 DOUBLE-FLAT))
- (lab . ,(ly:make-pitch -1 5 FLAT))
- (la . ,(ly:make-pitch -1 5 NATURAL))
- (lak . ,(ly:make-pitch -1 5 SHARP))
- (lakk . ,(ly:make-pitch -1 5 DOUBLE-SHARP))
-
- (sibb . ,(ly:make-pitch -1 6 DOUBLE-FLAT))
- (sib . ,(ly:make-pitch -1 6 FLAT))
- (si . ,(ly:make-pitch -1 6 NATURAL))
- (sik . ,(ly:make-pitch -1 6 SHARP))
- (sikk . ,(ly:make-pitch -1 6 DOUBLE-SHARP))
-)
-
-pitchnames = \pitchnamesVlaams
CONVERT_LY = $(script-dir)/convert-ly.py
LILYPOND = $(builddir)/lily/$(outconfbase)/lilypond
LILYPOND_BOOK = $(script-dir)/lilypond-book.py
-LILYPOND_BOOK_INCLUDES = -I $(pwd) -I $(outdir) -I$(input-dir) -I $(input-dir)/regression/ -I $(input-dir)/test/ -I $(input-dir)/tutorial/ -I $(builddir)/mf/$(outconfbase)/ -I $(builddir)/mf/out/
+LILYPOND_BOOK_INCLUDES = -I $(pwd) -I $(outdir) -I$(input-dir) -I $(input-dir)/tricks/ -I $(input-dir)/regression/ -I $(input-dir)/test/ -I $(input-dir)/tutorial/ -I $(builddir)/mf/$(outconfbase)/ -I $(builddir)/mf/out/
#texi-html for www only:
LILYPOND_BOOK_FORMAT=$(if $(subst out-www,,$(notdir $(outdir))),texi,texi-html)
Buildrequires: texinfo >= 4.6
Buildrequires: guile-devel >= 1.6.4-8
Requires: tetex tetex-latex libstdc++ python tetex-dvips tetex-latex
-Requires: guile >= 1.6.4-8 ec-fonts-mftraced >= 1.0.2
+Requires: guile >= 1.6.4-8
%description
LilyPond lets you create music notation. It produces
infodir="$RPM_BUILD_ROOT%{_infodir}" \
webdir="$RPM_BUILD_ROOT%{_prefix}/share/doc/lilypond/" web-install
-ln -sf ../../doc/lilypond/Documentation/user/out-www/*png $RPM_BUILD_ROOT%{_infodir}/lilypond/
-
# info
%if %{info}
rm -f $RPM_BUILD_ROOT/%{_infodir}/dir
EXTRA_DIST_FILES += $(TELY_FILES) $(LY_FILES) $(ITEXI_FILES) $(ITELY_FILES) $(LYINC_FILES)
-DVIPS_FLAGS= -u+ec-mftrace.map -u +lilypond.map -Ppdf
+DVIPS_FLAGS= -u +lilypond.map -Ppdf
$(PYTHON) $(ABC2LY) --strict -o $@ $<
$(outdir)/%.dvi: $(outdir)/%.ly
- $(PYTHON) $(LY2DVI) --output=$@ $<
+ $(PYTHON) $(LY2DVI) --output=$@ --dependencies $<
# don't junk intermediate .dvi files. They're easier to view than
# .ps or .png
.PRECIOUS: $(outdir)/%.dvi
$(outdir)/%.dvi: %.ly
- $(PYTHON) $(LY2DVI) --output=$@ $<
+ $(PYTHON) $(LY2DVI) --output=$@ --dependencies $<
$(outdir)/%.pdf: $(outdir)/%.dvi
ps2pdf -sPAPERSIZE=$(DVIPS_PAPERSIZE) $@.pdfps $@
$(outdir)-$(PAPERSIZE)/%.dvi: %.ly
- $(PYTHON) $(LY2DVI) --output=$@ --set=papersize=$(PAPERSIZE) $<
+ $(PYTHON) $(LY2DVI) --output=$@ --dependencies --set=papersize=$(PAPERSIZE) $<
AF_FILES = $(wildcard *.af)
-EXTRA_DIST_FILES += README feta.tex cmr.enc
+EXTRA_DIST_FILES += README feta.tex
# We don't use $(MF_FILES), because there's more .mf cruft here
FETA_MF_FILES = $(wildcard feta[0-9]*.mf)\
- $(wildcard feta-braces-[a-z].mf)\
+ $(wildcard feta-braces*[0-9].mf)\
$(wildcard feta-din*[0-9].mf)\
$(wildcard feta-nummer*[0-9].mf)\
$(wildcard parmesan[0-9]*.mf)
TEXTABLES = $(FETA_MF_FILES:%.mf=$(outdir)/%.tex)
AFM_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.afm) \
$(AF_FILES:%.af=$(outdir)/%.afm)
-ENC_FILES = $(TEXTABLES:.tex=.enc) $(outdir)/cmr.enc
-TFM_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.tfm) $(addprefix $(outdir)/,$(addsuffix .tfm,$(SAUTER_FONTS)))
+ENC_FILES = $(TEXTABLES:.tex=.enc)
+TFM_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.tfm)
FETA_LIST_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%list.ly)
ENCODING_FILE=$(findstring $(<:.mf=.enc), $(FETA_MF_FILES:.mf=.enc))
MFTRACE_FLAGS=$(if $(ENCODING_FILE),--encoding $(ENCODING_FILE),)
-bla:
- echo $(TFM_FILES)
+
# only for fonts which
#
#
# 2. are not included with teTeX
#
+SAUTER_FONTS = cmbxti8 ecbm14 ecrm12
-
-## use separate package sauter-fonts-mftraced.
-SAUTER_FONTS = ecb10
-
-#cmbxti8 ecbm14 ecrm12
MORE_SAUTER_FONTS = cmbx14 cmbx17 \
cmbxti12 cmbxti14 \
cmbxti6 cmbxti7 cmbxti8 \
INSTALLATION_DIR=$(local_lilypond_datadir)/fonts/source
INSTALLATION_FILES=$(MF_FILES) $(AF_FILES)
-INSTALLATION_OUT_SUFFIXES=1 2 3 4 5 6 7
+INSTALLATION_OUT_SUFFIXES=1 2 3 4 5 6
INSTALLATION_OUT_DIR1=$(local_lilypond_datadir)/tex
INSTALLATION_OUT_FILES1=$(TEXTABLES)
INSTALLATION_OUT_DIR6=$(local_lilypond_datadir)/dvips/
INSTALLATION_OUT_FILES6=$(outdir)/lilypond.map
-INSTALLATION_OUT_DIR7=$(local_lilypond_datadir)/ps/
-INSTALLATION_OUT_FILES7=$(ENC_FILES)
-
export MFINPUTS:=.:$(MFINPUTS)
default: pfa_warning $(ALL_GEN_FILES)
redhat-package=lilypond-$(TOPLEVEL_VERSION)-1.i386.rpm
$(outdir)/$(redhat-package):
- wget --passive-ftp -P $(outdir) http://lilypond.org/download/binaries/Fedora-1/$(redhat-package)
+ wget --passive-ftp -P $(outdir) http://lilypond.org/download/binaries/RedHat-9/$(redhat-package)
get-rpm-pfa: $(outdir)/$(redhat-package)
cd $(outdir) ; rm -rf usr/ # (root alert!)
$(outdir)/%.pfa: $(outdir)/%.bla
$(MFTRACE) -I $(outdir)/ --pfa --simplify --keep-trying $(notdir $(basename $@)) && mv $(notdir $@) $(outdir)/
-$(outdir)/%.enc: %.enc
- cp $< $@
+++ /dev/null
-% Thomas Esser, Dec 2002. public domain
-%
-% Encoding for:
-% cmb10 cmbx10 cmbx12 cmbx5 cmbx6 cmbx7 cmbx8 cmbx9 cmbxsl10
-% cmdunh10 cmr10 cmr12 cmr17cmr6 cmr7 cmr8 cmr9 cmsl10 cmsl12 cmsl8
-% cmsl9 cmss10cmss12 cmss17 cmss8 cmss9 cmssbx10 cmssdc10 cmssi10
-% cmssi12 cmssi17 cmssi8cmssi9 cmssq8 cmssqi8 cmvtt10
-%
-/TeXf7b6d320Encoding [
-/Gamma /Delta /Theta /Lambda /Xi /Pi /Sigma /Upsilon /Phi /Psi /Omega
-/ff /fi /fl /ffi /ffl /dotlessi /dotlessj /grave /acute /caron /breve
-/macron /ring /cedilla /germandbls /ae /oe /oslash /AE /OE /Oslash
-/suppress /exclam /quotedblright /numbersign /dollar /percent /ampersand
-/quoteright /parenleft /parenright /asterisk /plus /comma /hyphen
-/period /slash /zero /one /two /three /four /five /six /seven /eight
-/nine /colon /semicolon /exclamdown /equal /questiondown /question /at
-/A /B /C /D /E /F /G /H /I /J /K /L /M /N /O /P /Q /R /S /T /U /V /W /X
-/Y /Z /bracketleft /quotedblleft /bracketright /circumflex /dotaccent
-/quoteleft /a /b /c /d /e /f /g /h /i /j /k /l /m /n /o /p /q /r /s /t /u
-/v /w /x /y /z /endash /emdash /hungarumlaut /tilde /dieresis /suppress
-/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
-/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
-/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
-/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /space
-/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
-/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
-/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
-/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
-/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
-/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
-/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
-/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
-/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
-/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
-/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
-] def
+++ /dev/null
-% ecbx.mf
-%
-% (c) Copyright 1995, 1996, 1997 J"org Knappen
-% (c) Copyright 1990, 1992 Norbert Schwarz
-%
-% This file is part of ecfonts version 1.0
-%
-% Please read the files 00readme.txt, 00inst.txt, 00error.txt, and
-% copyrite.txt for further information
-%
-% You find some documentation in ecdoc.tex (needs LaTeX2e)
-%
-% Content:
-%
-% Parameter for
-%
-% European Computer Modern Bold Extend Roman
-
-%% modified: Han-Wen Nienhuys, change u# down to ecrm value.
-%
-%
-
-font_identifier:="ECB";
-font_size (gensize*pt#);
-basedef ( 5, 6, 7, 8, 9, 10, 12);
-gendef [1/36pt#]( u# )( 12.5, 14, 15.5, 17, 18.5, 20, 23.5);
-gendef [1/36pt#]( width_adj# )( 7, 7.8, 8.6, 9.4, 10.2, 11, 13);
-gendef [1/36pt#]( serif_fit# )( 0, 0, 0, 0, 0, 0, 0);
-gendef [1/36pt#]( cap_serif_fit# )( 3, 3.8, 4.6, 5.4, 6.2, 7, 8);
-gendef [1/36pt#]( letter_fit# )( 3, 2, 1, 0, 0, 0, 0);
-gendef [1/36pt#]( body_height# )( 135, 162, 189, 216, 243, 270, 324);
-gendef [1/36pt#]( asc_height# )( 125, 150, 175, 200, 225, 250, 300);
-gendef [1/36pt#]( cap_height# )( 123.5, 148.2, 172.9, 197.6, 222.3, 247, 296.4);
-gendef [1/36pt#]( fig_height# )( 116, 139.2, 162.4, 185.6, 208.8, 232, 278.4);
-gendef [1/36pt#]( x_height# )( 80, 96, 112, 128, 144, 160, 192);
-gendef [1/36pt#]( math_axis# )( 45, 54, 63, 72, 81, 90, 108);
-gendef [1/36pt#]( bar_height# )( 40, 49, 58, 67, 76, 85, 102);
-gendef [1/36pt#]( comma_depth# )( 35, 42, 49, 56, 63, 70, 84);
-gendef [1/36pt#]( desc_depth# )( 35, 42, 49, 56, 63, 70, 84);
-gendef [1/36pt#]( acc_height# )( 37.5, 45, 52.5, 60, 67.5, 75, 90);
-gendef [1/36pt#]( dot_height# )( 37.5, 45, 52.5, 60, 67.5, 75, 90);
-gendef [1/36pt#]( udot_height# )( 29.5, 35.5, 41.3, 47.2, 53.1, 59, 70.8);
-gendef [1/36pt#]( crisp# )( 0, 0, 0, 0, 0, 0, 0);
-gendef [1/36pt#]( tiny# )( 9, 10, 11, 12, 13, 13, 13);
-gendef [1/36pt#]( fine# )( 8, 9, 9, 10, 10, 10, 10);
-gendef [1/36pt#]( thin_join# )( 8, 9, 9, 10, 10, 10, 10.5);
-gendef [1/36pt#]( hair# )( 15, 15.4, 15.8, 16.2, 16.6, 17, 18.3);
-gendef [1/36pt#]( stem# )( 24, 28, 32, 35, 38, 41, 47);
-gendef [1/36pt#]( curve# )( 27, 31, 35, 39, 43, 46, 52);
-gendef [1/36pt#]( ess# )( 19, 25, 29, 32, 35, 38, 44);
-gendef [1/36pt#]( flare# )( 27, 31, 35, 39, 42, 45, 51);
-gendef [1/36pt#]( dot_size# )( 31, 36, 41, 46, 51, 56, 62);
-gendef [1/36pt#]( cap_hair# )( 17, 18, 18, 19, 19, 19, 20);
-gendef [1/36pt#]( cap_stem# )( 28, 33, 38, 43, 47, 51, 57);
-gendef [1/36pt#]( cap_curve# )( 31, 36, 41, 46, 51, 55, 61);
-gendef [1/36pt#]( cap_ess# )( 24, 31, 37, 43, 48, 53, 59);
-gendef [pt#]( rule_thickness#)( .43, .47, .51, .54, .57, .60, .66);
-gendef [1/36pt#]( dish# )( .7, .8, .9, 1, 1, 1, 1);
-gendef [1/36pt#]( bracket# )( 5, 6, 7, 8, 9, 10, 12);
-gendef [1/36pt#]( jut# )( 13, 15, 17, 19, 22, 25, 30);
-gendef [1/36pt#]( cap_jut# )( 19, 23, 27, 31, 35, 39, 46);
-gendef [1/36pt#]( beak_jut# )( 7, 7.8, 8.6, 9.4, 10.2, 11, 12.4);
-gendef [1/36pt#]( beak# )( 25, 36, 46, 55, 63, 70, 84);
-gendef [1/36pt#]( vair# )( 10, 11, 11.5, 12, 12.5, 13, 14.3);
-gendef [pt#]( notch_cut# )( 5, 6, 7, 8, 9, 10, 12);
-gendef [1/36pt#]( bar# )( 12, 13, 14, 15, 16, 17, 18.5);
-gendef [1/36pt#]( slab# )( 12, 13, 14, 15, 16, 17, 18.5);
-gendef [1/36pt#]( cap_bar# )( 12, 13, 14, 15, 16, 17, 18.5);
-gendef [1/36pt#]( cap_band# )( 12, 13, 14, 15, 16, 17, 18.5);
-gendef [pt#]( cap_notch_cut# )( 5, 6, 7, 8, 9, 10, 12);
-gendef [1/36pt#]( serif_drop# )( 1.5, 1.8, 2.1, 2.4, 2.7, 3, 3.6);
-gendef [1/36pt#]( stem_corr# )( 1.5, 1.6, 1.7, 1.8, 1.9, 2, 2);
-gendef [1/36pt#]( vair_corr# )( 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.5);
-gendef [1/36pt#]( apex_corr# )( 9, 5, 2, 0, 0, 0, 0);
-gendef [1/36pt#]( o# )( 3, 3, 3, 4, 4, 4, 5);
-gendef [1/36pt#]( apex_o# )( 3, 3, 3, 3, 3, 3, 4);
-slant:=0;
-gendef ( fudge )( 1, 1, 1, 1, 1, 1, 1);
-gendef ( math_spread )( 1.5, 1.3, 1.1, .9, .7, .5, .5);
-superness:=8/11;
-superpull:=1/8;
-beak_darkness:=.4;
-square_dots:=false;
-hefty:=false;
-serifs:=true;
-monospace:=false;
-variant_g:=false;
-low_asterisk:=false;
-math_fitting:=false;
-
-clear_extra_memory;
-
-generate exroman;
-
-endinput;
+++ /dev/null
-if unknown exbase: input exbase fi;
-gensize:=10;
-generate ecb;
message "******************************************************";
% font or database?
-def fet_beginfont(expr name,size,encod) =
+def fet_beginfont(expr name,size) =
font_identifier:=name&decimal size;
font_size size;
- font_coding_scheme encod;
- message "@{font@:GNU@:LilyPond@:"&name&"@:"&decimal size&"@:"&encod&"@}";
+ message "@{font@:GNU@:LilyPond@:"&name&"@:"&decimal size&"@}";
message "";
enddef;
-def fet_endfont =
- message "@{tnof@}";
+def fet_endfont(expr name) =
+ message "@{tnof@:"&name&"@}";
+ message "";
enddef;
% group or table?
input feta-autometric;
input feta-macros;
-staffsize# := 20 pt#; %% arbitrary.
+staffsize# := 20 pt#; %% arbitrary.
input feta-params;
+font_coding_scheme "feta braces";
-def abc_encode_int (expr i) =
- if i > 0:
- abc_encode_int(i div 26)&char(65 + i mod 26)
- else:
- "A"
- fi
-enddef ;
-
-% we must let the design increase for each
-% font to make sure that mftrace doesn't jack up the resolution too highly
-% for the longer braces.
-fet_beginfont("feta-braces-" &char(97 + font_count), (font_count + 1)* 15,
- "fetaBraces");
+% we set the designsize arbitrarily at 10
+% if the * 10 is left out, pktrace gets confused over the proper magnification,
+% and makes it too large.
+fet_beginfont("feta-braces", font_count * 10);
mode_setup;
code := -1;
+def abc_encode_int (expr i) =
+ if i > 0:
+ abc_encode_int(i div 26)&char(65 + i mod 26)
+ else:
+ "A"
+ fi
+enddef ;
+
def draw_brace (expr height_sharp, width_sharp, slt_sharp) =
save pendir, height, width, thin, thick, slt;
% message "l: "&decimal l;
% note: define_pixels (x) multiplies x by hppp,
% must never get bigger than infinity
- y := y + increment;
-
- if y > infinity/hppp:
- message "Resolution and/or magnification is too high";
- error please report: <bug-lilypond@gnu.org>;
- fi
+ y := min (y + increment, infinity/hppp - 1);
% x should be about one staff space, taking brace to have
% default height of 3 staffs, this yields height / 3 / 4 = 12
fet_endchar;
+
fet_endgroup("noteheads");
-% what is this doing here?
define_pixels(black_notehead_width);
-
-
-if 0 = 1:
-
-% free space: ascii a-i
-code:=106;
-
-%
-% testing unicode/gnome-canvas
-%
-savecode:=code;
-code:=96;
-%fet_beginchar("Whole notehead", "0", "wholehead")
-fet_beginchar("Ascii a", "a", "a")
- draw_outside_ellipse (1.80 - puff_up_factor / 3.0, 0, 0.707, 0);
- undraw_inside_ellipse (1.30, 125 - puff_up_factor *10,
- 0.68, 2 stafflinethickness#,
- (w /2, 0));
-% draw_staff_outline (-2, 2, 0.5);
-fet_endchar;
-
-code:=savecode;
-fi
+++ /dev/null
-%
-% feta-braces0.mf -- 256 smallest braces
-%
-% source file of the Feta (Font-En-Tja) music font
-%
-% (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-%
-
-font_count := 0;
-input feta-beugel;
-end.
+++ /dev/null
-%
-% feta-braces1.mf -- next 256 braces
-%
-% source file of the Feta (Font-En-Tja) music font
-%
-% (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-%
-
-font_count := 1;
-input feta-beugel;
-end.
+++ /dev/null
-%
-% feta-braces2.mf -- next 256 braces
-%
-% source file of the Feta (Font-En-Tja) music font
-%
-% (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-%
-
-font_count := 2;
-input feta-beugel;
-end.
+++ /dev/null
-%
-% feta-braces3.mf -- next 256 braces
-%
-% source file of the Feta (Font-En-Tja) music font
-%
-% (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-%
-
-font_count := 3;
-input feta-beugel;
-end.
+++ /dev/null
-%
-% feta-braces4.mf -- next 256 braces
-%
-% source file of the Feta (Font-En-Tja) music font
-%
-% (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-%
-
-font_count := 4;
-input feta-beugel;
-end.
-
-
+++ /dev/null
-%
-% feta-braces5.mf -- next 256 braces
-%
-% source file of the Feta (Font-En-Tja) music font
-%
-% (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-%
-
-font_count := 5;
-input feta-beugel;
-end.
+++ /dev/null
-%
-% feta-braces6.mf -- next 256 braces
-%
-% source file of the Feta (Font-En-Tja) music font
-%
-% (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-%
-
-font_count := 6;
-input feta-beugel;
-end.
+++ /dev/null
-%
-% feta-braces6.mf -- next 256 braces
-%
-% source file of the Feta (Font-En-Tja) music font
-%
-% (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-%
-
-font_count := 7;
-input feta-beugel;
-end.
+++ /dev/null
-%
-% feta-braces6.mf -- next 256 braces
-%
-% source file of the Feta (Font-En-Tja) music font
-%
-% (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-%
-
-font_count := 8;
-input feta-beugel;
-end.
--- /dev/null
+%
+% feta-braces0.mf -- 256 smallest braces
+%
+% source file of the Feta (Font-En-Tja) music font
+%
+% (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+%
+
+font_count := 0;
+input feta-beugel;
+end.
--- /dev/null
+%
+% feta-braces1.mf -- next 256 braces
+%
+% source file of the Feta (Font-En-Tja) music font
+%
+% (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+%
+
+font_count := 1;
+input feta-beugel;
+end.
--- /dev/null
+%
+% feta-braces2.mf -- next 256 braces
+%
+% source file of the Feta (Font-En-Tja) music font
+%
+% (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+%
+
+font_count := 2;
+input feta-beugel;
+end.
--- /dev/null
+%
+% feta-braces3.mf -- next 256 braces
+%
+% source file of the Feta (Font-En-Tja) music font
+%
+% (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+%
+
+font_count := 3;
+input feta-beugel;
+end.
--- /dev/null
+%
+% feta-braces4.mf -- next 256 braces
+%
+% source file of the Feta (Font-En-Tja) music font
+%
+% (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+%
+
+font_count := 4;
+input feta-beugel;
+end.
+
+
--- /dev/null
+%
+% feta-braces5.mf -- next 256 braces
+%
+% source file of the Feta (Font-En-Tja) music font
+%
+% (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+%
+
+font_count := 5;
+input feta-beugel;
+end.
--- /dev/null
+%
+% feta-braces6.mf -- next 256 braces
+%
+% source file of the Feta (Font-En-Tja) music font
+%
+% (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+%
+
+font_count := 6;
+input feta-beugel;
+end.
--- /dev/null
+%
+% feta-braces6.mf -- next 256 braces
+%
+% source file of the Feta (Font-En-Tja) music font
+%
+% (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+%
+
+font_count := 7;
+input feta-beugel;
+end.
--- /dev/null
+%
+% feta-braces6.mf -- next 256 braces
+%
+% source file of the Feta (Font-En-Tja) music font
+%
+% (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+%
+
+font_count := 8;
+input feta-beugel;
+end.
define_pixels (staffspace, linethickness, stafflinethickness, ex, descender, ascender);
-fet_beginfont("feta-din", design_size, "TeX text");
+fet_beginfont("feta-din", design_size);
input feta-din-code;
mode := smoke;
fi
-staffsize# := design_size * pt#;
-
mode_setup;
+%
input feta-macros;
input feta-params;
font_x_height staff_space#;
+font_coding_scheme "feta music";
-fet_beginfont("feta", design_size, "fetaMusic");
if test = 0:
input feta-eindelijk;
input feta-toevallig;
input feta-test-generic.mf;
fi
-
-fet_endfont;
-
fi;
draw_gclef(1.0);
fet_endchar;
-
fet_beginchar("G clef", "G_change", "ctrebleclef")
draw_gclef(0.8);
fet_endchar;
fet_endchar;
fet_endgroup("clefs");
-
-if 0 = 1:
-
-%
-% testing unicode/gnome-canvas
-%
-
-savecode:=code;
-code:=97;
-fet_beginchar("Ascii b", "b", "b")
-%%fet_beginchar("G clef", "G", "trebleclef")
- if test_staff = 1:
- draw_staff(-1,3, 0.0);
- fi;
- draw_gclef(1.0);
- %% charnamestr:="Ascii b";
-fet_endchar;
-
-code:=savecode;
-
-fi
% glyph.
%
+fet_begingroup("number")
+
define_pixels(height,thick,thick,thin,hair,flare);
define_pixels(foot_top,foot_width);
define_pixels(kuulleke);
code := 43; % , = 44
% urg
-fet_beginchar("Numeral comma", "comma", "comma")
+fet_beginchar("Numeral comma", ",", "comma")
set_char_box(0, dot_diam#, 3/2dot_diam#, dot_diam#);
pickup pencircle scaled dot_diam;
draw (dot_diam/2,dot_diam/2);
penlabels(1);
fet_endchar;
-fet_beginchar("Numeral dash", "hyphen", "hyphen")
+fet_beginchar("Numeral dash", "-", "dash")
set_char_box(0, height#/3, 0, height#);
pickup pencircle scaled thin;
lft x1 = -b;
draw z1 .. z2;
fet_endchar;
-fet_beginchar("Numeral dot", "period", "period")
+fet_beginchar("Numeral dot", ".", "dot")
set_char_box(0, dot_diam#, 0, dot_diam#);
pickup pencircle scaled dot_diam;
draw (dot_diam/2,dot_diam/2);
code := 47; % 0 = 48
-fet_beginchar("Numeral 0", "zero", "zero")
+fet_beginchar("Numeral 0", "0", "zero")
set_char_box(0, 11/15height# * widen, 0, height#);
message "w:"&decimal w;
message "h:"&decimal h;
..tension t..z4l..tension t..cycle;
fet_endchar;
-fet_beginchar("Numeral 1", "one", "one")
+fet_beginchar("Numeral 1", "1", "one")
% set_char_box(0, 19/30height#*widen, 0, height#);
set_char_box(0, 1/2foot_width#+3/2thick#+1/2hair#, 0, height#);
message "w:"&decimal w;
draw_foot(x1);
fet_endchar;
-fet_beginchar("Numeral 2", "two", "two")
+fet_beginchar("Numeral 2", "2", "two")
set_char_box(0, 22/30 height#*widen, 0, height#);
message "w:"&decimal w;
message "h:"&decimal h;
% TODO: should widen a bit. The right edge of the 3 bumps into next glyph in
% combinations
%
-fet_beginchar("Numeral 3", "three", "three")
+fet_beginchar("Numeral 3", "3", "three")
set_char_box(0, 2/3height#*widen, 0, height#);
message "w:"&decimal w;
message "h:"&decimal h;
-fet_beginchar("Numeral 4", "four", "four")
+fet_beginchar("Numeral 4", "4", "four")
set_char_box(0, 4/5height#*widen, 0, height#);
message "w:"&decimal w;
message "h:"&decimal h;
draw_foot(x5);
fet_endchar;
-fet_beginchar("Numeral 5", "five", "five")
+fet_beginchar("Numeral 5", "5", "five")
set_char_box(0, 27/40 height#*widen, 0, height#);
message "w:"&decimal w;
message "h:"&decimal h;
fet_endchar;
-fet_beginchar("Numeral 6", "six", "six")
+fet_beginchar("Numeral 6", "6", "six")
draw_six;
fet_endchar;
-fet_beginchar("Numeral 7", "seven", "seven")
+fet_beginchar("Numeral 7", "7", "seven")
set_char_box(0, 11/15height#*widen, 0, height#);
message "w:"&decimal w;
message "h:"&decimal h;
penlabels(1,2,3,4,5,6);
fet_endchar;
-fet_beginchar("Numeral 8", "eight", "eight")
+fet_beginchar("Numeral 8", "8", "eight")
set_char_box(0, 11/15height#*widen, 0, height#);
message "w:"&decimal w;
message "h:"&decimal h;
..z2l{dir(beta)}..cycle;
fet_endchar;
-fet_beginchar("Numeral 9", "nine", "nine")
+fet_beginchar("Numeral 9", "9", "nine")
draw_six;
% xy_mirror_char;
currentpicture := currentpicture scaled -1;
currentpicture := currentpicture shifted (w,h);
fet_endchar;
+fet_endgroup("number")
+
ligtable "3" : "3" kern 0.1 space#, "0" kern 0.1 space#;
ligtable "2" : "7" kern 0.15 space#;
%blot_diameter# = .4pt#;
-fet_beginfont("feta-nummer", design_size, "fetaNumber");
+fet_beginfont("feta-nummer", design_size);
mode_setup;
height#:=designsize;
font_x_height height#;
font_normal_space space#;
+font_coding_scheme "feta number";
%
% part of LilyPond's pretty-but-neat music font
input feta-autometric;
-design_size := 11;
+fet_beginfont("feta-test", 11);
+staffsize#:=11pt#;
test:=1;
% smoked cheese
input feta-generic;
+fet_endfont("feta");
+
end.
% part of LilyPond's pretty-but-neat music font
input feta-autometric;
-design_size := 13;
+fet_beginfont("feta-test", 13);
+staffsize#:=13pt#;
test:=1;
% smoked cheese
input feta-generic;
+fet_endfont("feta");
end.
% part of LilyPond's pretty-but-neat music font
input feta-autometric;
-design_size := 16;
+fet_beginfont("feta-test", 16);
+staffsize#:=16pt#;
test:=1;
% smoked cheese
input feta-generic;
+fet_endfont("feta");
end.
input feta-autometric;
-design_size := 20;
+fet_beginfont("feta-test", 20);
+staffsize#:=20pt#;
test:=1;
% smoked cheese
input feta-generic;
+fet_endfont("feta");
end.
input feta-autometric;
-design_size := 23;
+fet_beginfont("feta-test", 23);
+staffsize#:=23pt#;
test:=1;
% smoked cheese
input feta-generic;
+fet_endfont("feta");
end.
% part of LilyPond's pretty-but-neat music font
input feta-autometric;
-design_size := 26;
+fet_beginfont("feta-test", 26);
+staffsize#:=26pt#;
test:=1;
% smoked cheese
input feta-generic;
+fet_endfont("feta");
end.
input feta-autometric;
-
-design_size:= 11.22;
+fet_beginfont("feta", 11);
+staffsize#:=11.22pt#;
test:=0;
input feta-generic;
+fet_endfont("feta");
+
end.
% part of LilyPond's pretty-but-neat music font
input feta-autometric;
-
-design_size := 12.60;
-
+fet_beginfont("feta", 13);
+staffsize#:=12.60pt#;
test:=0;
input feta-generic;
+fet_endfont("feta");
+
end.
% part of LilyPond's pretty-but-neat music font
input feta-autometric;
-design_size := 14.14;
+fet_beginfont("feta", 14);
+staffsize#:=14.14pt#;
test:=0;
input feta-generic;
+fet_endfont("feta");
end.
% part of LilyPond's pretty-but-neat music font
input feta-autometric;
-design_size := 15.87;
+fet_beginfont("feta", 16);
+staffsize#:=15.87pt#;
test:=0;
input feta-generic;
+fet_endfont("feta");
+
end.
input feta-autometric;
% todo change file name
-design_size := 17.82;
+fet_beginfont("feta", 18);
+staffsize#:=17.82pt#;
test:=0;
input feta-generic;
+fet_endfont("feta");
end.
% feta20.mf
% part of LilyPond's pretty-but-neat music font
-design_size := 20;
+staffsize#:=20pt#;
input feta-autometric;
+fet_beginfont("feta", 20);
% use feta-test for debugging.
test := 0;
input feta-generic;
+fet_endfont("feta");
end.
input feta-autometric;
% todo change file name
-design_size := 22.45;
+fet_beginfont("feta", 22.5);
+staffsize#:=22.45pt#;
test:=0;
input feta-generic;
+fet_endfont("feta");
end.
% part of LilyPond's pretty-but-neat music font
input feta-autometric;
-design_size := 25.20;
+fet_beginfont("feta", 26);
+staffsize#:=25.20pt#;
test:=0;
input feta-generic;
+fet_endfont("feta");
end.
mode_setup;
%
-staffsize# := design_size * pt#;
input feta-macros;
input feta-params;
-
font_x_height staff_space#;
+font_coding_scheme "parmesan music";
-fet_beginfont("parmesan", design_size, "parmesanMusic")
if test = 0:
input parmesan-rests;
input parmesan-heads;
input parmesan-flags;
input parmesan-timesig;
input parmesan-scripts;
+
else:
fi
-fet_endfont;
-
% parmesan11.mf
% part of LilyPond's pretty-but-neat music font
-design_size := 11.22;
+staffsize#:=11.22pt#;
input feta-autometric;
+fet_beginfont("parmesan", 11);
test := 0;
input parmesan-generic;
+fet_endfont("parmesan");
+
end.
% parmesan13.mf
% part of LilyPond's pretty-but-neat music font
-design_size := 12.60;
+staffsize#:=12.60pt#;
input feta-autometric;
+fet_beginfont("parmesan", 13);
test := 0;
input parmesan-generic;
+fet_endfont("parmesan");
end.
% parmesan13.mf
% part of LilyPond's pretty-but-neat music font
-design_size := 14.14;
+staffsize#:=14.14pt#;
input feta-autometric;
+fet_beginfont("parmesan", 14);
test := 0;
input parmesan-generic;
+fet_endfont("parmesan");
end.
% parmesan16.mf
% part of LilyPond's pretty-but-neat music font
-design_size := 15.87;
+staffsize#:=15.87pt#;
input feta-autometric;
+fet_beginfont("parmesan", 16);
test := 0;
input parmesan-generic;
+fet_endfont("parmesan");
end.
% parmesan13.mf
% part of LilyPond's pretty-but-neat music font
-design_size := 17.82;
+staffsize#:=17.82pt#;
input feta-autometric;
+fet_beginfont("parmesan", 18);
test := 0;
input parmesan-generic;
+fet_endfont("parmesan");
end.
% parmesan20.mf
% part of LilyPond's pretty-but-neat music font
-design_size := 20;
+staffsize#:=20pt#;
input feta-autometric;
+fet_beginfont("parmesan", 20);
test := 0;
input parmesan-generic;
+fet_endfont("parmesan");
end.
% parmesan23.mf
% part of LilyPond's pretty-but-neat music font
-design_size := 22.45;
+staffsize#:=22.45pt#;
input feta-autometric;
+fet_beginfont("parmesan", 23);
test := 0;
input parmesan-generic;
+fet_endfont("parmesan");
end.
% parmesan26.mf
% part of LilyPond's pretty-but-neat music font
-design_size := 25.20;
+staffsize#:=25.20pt#;
input feta-autometric;
+fet_beginfont("parmesan", 26);
test := 0;
input parmesan-generic;
+fet_endfont("parmesan");
end.
# German Translation of lilypond.
# Copyright (C) 2003 Han-Wen Nienhuys, Jan Nieuwenhuizen
# This file is distributed under the same license as the lilypond package.
-# Erwin Dieterich <bamse@gmx.de>, 1999
-# Roland Stigge <stigge@antcom.de>, 2003, 2004
+# Roland Stigge <stigge@antcom.de>, 2003.
+# (ersetzt die Ãœbersetzung von 1999 von Erwin Dieterich <bamse@gmx.de>)
#
msgid ""
msgstr ""
-"Project-Id-Version: lilypond 2.2.0\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2004-03-31 16:22+0200\n"
-"PO-Revision-Date: 2004-04-03 10:45+0200\n"
+"Project-Id-Version: lilypond 1.7.26\n"
+"POT-Creation-Date: 2003-07-18 14:45+0200\n"
+"PO-Revision-Date: 2003-07-21 14:15+0200\n"
"Last-Translator: Roland Stigge <stigge@antcom.de>\n"
"Language-Team: German <de@li.org>\n"
"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
"Content-Transfer-Encoding: 8bit\n"
+#. this is where special info is often stored
+#. ###############################################################
+#. lilylib.py -- options and stuff
+#.
+#. source file of the GNU LilyPond music typesetter
+#.
+#. (c) 1998--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+#. Jan Nieuwenhuizen <janneke@gnu.org>
+#. ## subst:\(^\|[^._a-z]\)\(abspath\|identify\|warranty\|progress\|warning\|error\|exit\|getopt_args\|option_help_str\|options_help_str\|help\|setup_temp\|read_pipe\|system\|cleanup_temp\|strip_extension\|cp_to_dir\|mkdir_p\|init\) *(
+#. ## replace:\1ly.\2 (
+#. ## subst: \(help_summary\|keep_temp_dir_p\|option_definitions\|original_dir\|program_name\|pseudo_filter_p\|temp_dir\|verbose_p\)
+#. ###############################################################
+#. Users of python modules should include this snippet
+#. and customize variables below.
+#. We'll suffer this path init stuff as long as we don't install our
+#. python packages in <prefix>/lib/pythonx.y (and don't kludge around
+#. it as we do with teTeX on Red Hat Linux: set some environment var
+#. (PYTHONPATH) in profile)
+#. If set, LILYPONDPREFIX must take prevalence
+#. if datadir is not set, we're doing a build and LILYPONDPREFIX
+#. Customize these
+#. lilylib globals
#: lilylib.py:60
msgid "lilylib module"
msgstr "Modul lilylib"
-#: lilylib.py:63 lilypond-book.py:84 lilypond.py:127 midi2ly.py:100
-#: mup2ly.py:75 old-lilypond-book.py:129 main.cc:140
+#: lilylib.py:63 lilypond-book.py:131 lilypond.py:128 midi2ly.py:100
+#: mup2ly.py:75 main.cc:111
msgid "print this help"
-msgstr "diese Hilfe ausgeben"
+msgstr "diese Hilfe"
-#: lilylib.py:110 midi2ly.py:136 mup2ly.py:130
-#, python-format
+#. ###############################################################
+#. Handle bug in Python 1.6-2.1
+#.
+#. there are recursion limits for some patterns in Python 1.6 til 2.1.
+#. fix this by importing pre instead. Fix by Mats.
+#. Attempt to fix problems with limited stack size set by Python!
+#. Sets unlimited stack size. Note that the resource module only
+#. is available on UNIX.
+#: lilylib.py:114 midi2ly.py:136 mup2ly.py:130 main.cc:188 main.cc:200
+#, c-format, python-format
msgid "Copyright (c) %s by"
msgstr "Copyright (c) %s bei"
-#: lilylib.py:114 midi2ly.py:141 mup2ly.py:135
+#: lilylib.py:114
+msgid " 1998--2003"
+msgstr "1998--2003"
+
+#: lilylib.py:118
msgid "Distributed under terms of the GNU General Public License."
msgstr "Vertrieben unter den Bedingungen der GNU General Public License."
-#: lilylib.py:116 midi2ly.py:142 mup2ly.py:136
+#: lilylib.py:120
msgid "It comes with NO WARRANTY."
msgstr "Es wird OHNE GARANTIE ausgeliefert."
-#: lilylib.py:123 warn.cc:25
-#, c-format, python-format
-msgid "warning: %s"
-msgstr "Warnung: %s"
+#: lilylib.py:127 midi2ly.py:150 mup2ly.py:144 input.cc:88
+msgid "warning: "
+msgstr "Warnung: "
-#: lilylib.py:126 warn.cc:31
-#, c-format, python-format
-msgid "error: %s"
-msgstr "Fehler: %s"
+#. lots of midi files use plain text for lyric events
+#. FIXME: read from stdin when files[0] = '-'
+#: lilylib.py:130 midi2ly.py:165 midi2ly.py:1018 midi2ly.py:1083 mup2ly.py:147
+#: mup2ly.py:161 input.cc:93
+msgid "error: "
+msgstr "Fehler: "
-#: lilylib.py:130
+#: lilylib.py:134
#, python-format
msgid "Exiting (%d)..."
msgstr "Beende (%d)..."
-#: lilylib.py:190 midi2ly.py:223 mup2ly.py:219
+#: lilylib.py:194 midi2ly.py:224 mup2ly.py:220
#, python-format
msgid "Usage: %s [OPTIONS]... FILE"
-msgstr "Aufruf: %s [OPTIONEN]... DATEI"
+msgstr "Aufruf: %s [OPTIONS]... DATEI"
-#: lilylib.py:194 midi2ly.py:227 mup2ly.py:223 main.cc:205
-#, c-format
+#: lilylib.py:198 midi2ly.py:228 mup2ly.py:224 main.cc:166
msgid "Options:"
msgstr "Optionen:"
-#: lilylib.py:198 midi2ly.py:231 mup2ly.py:227 main.cc:209
+#: lilylib.py:202 midi2ly.py:232 mup2ly.py:228 main.cc:172
#, c-format, python-format
msgid "Report bugs to %s."
msgstr "Melden Sie Fehler an %s."
-#: lilylib.py:218
-#, python-format
-msgid "Binary %s has version %s, looking for version %s"
-msgstr "Binärdatei %s hat Version %s, bei Suche nach Version %s"
-
-#: lilylib.py:252
+#: lilylib.py:228
#, python-format
msgid "Opening pipe `%s'"
-msgstr "Öffne Pipe `%s'"
+msgstr "Öffne Pipe `%s'"
-#: lilylib.py:267 lilypond-book.py:767
+#. successful pipe close returns 'None'
+#: lilylib.py:240
#, python-format
msgid "`%s' failed (%d)"
msgstr "`%s' gescheitert (%d)"
-#: lilylib.py:272 lilylib.py:331 lilypond-book.py:768 lilypond.py:530
-#: old-lilypond-book.py:228
+#: lilylib.py:242 lilylib.py:289 lilypond-book.py:231 lilypond.py:512
msgid "The error log is as follows:"
msgstr "Das Fehlerprotokoll lautet wie folgt:"
-#: lilylib.py:303 midi2ly.py:259 mup2ly.py:255
+#: lilylib.py:262 midi2ly.py:260 mup2ly.py:256
#, python-format
msgid "Invoking `%s'"
msgstr "Rufe `%s' auf"
-#: lilylib.py:305
+#: lilylib.py:264
#, python-format
msgid "Running %s..."
msgstr "Starte %s..."
-#: lilylib.py:324
+#: lilylib.py:282
#, python-format
msgid "`%s' failed (%s)"
msgstr "`%s' gescheitert (%s)"
-#: lilylib.py:327 midi2ly.py:265 mup2ly.py:263
+#: lilylib.py:285 midi2ly.py:266 mup2ly.py:264
msgid "(ignored)"
msgstr "(ignoriert)"
-#: lilylib.py:345 midi2ly.py:275 mup2ly.py:273
+#: lilylib.py:299 midi2ly.py:276 mup2ly.py:274
#, python-format
msgid "Cleaning %s..."
-msgstr "Räume %s auf..."
+msgstr "Räume %s auf..."
-#: lilylib.py:509
+#. Duh. Python style portable: cp *.EXT OUTDIR
+#. system ('cp *.%s %s' % (ext, outdir), 1)
+#. Python < 1.5.2 compatibility
+#.
+#. On most platforms, this is equivalent to
+#. `normpath(join(os.getcwd()), PATH)'. *Added in Python version 1.5.2*
+#. tex needs lots of memory, more than it gets by default on Debian
+#. TODO: * prevent multiple addition.
+#. * clean TEXINPUTS, MFINPUTS, TFMFONTS,
+#. as these take prevalence over $TEXMF
+#. and thus may break tex run?
+#. $TEXMF is special, previous value is already taken care of
+#. # -sOutputFile does not work with bbox?
+#. # todo:
+#. # have better algorithm for deciding when to crop page,
+#. # and when to show full page
+#: lilylib.py:458
msgid "Removing output file"
-msgstr "Lösche Ausgabedatei"
+msgstr "Lösche Ausgabedatei"
-#: lilypond-book.py:69
-msgid ""
-"Process LilyPond snippets in hybrid HTML, LaTeX or texinfo document.\n"
-"Example usage:\n"
-"\n"
-" lilypond-book --filter=\"tr '[a-z]' '[A-Z]'\" BOOK\n"
-" lilypond-book --filter=\"convert-ly --no-version --from=2.0.0 -\" BOOK\n"
-" lilypond-book --process='lilypond-bin -I include' BOOK\n"
-"\n"
-msgstr ""
-"LilyPond-Auszüge in gemischtem HTML-, LaTeX- oder texinfo-Dokument verarbeiten.\n"
-"Beispiel-Aufrufe:\n"
-"\n"
-" lilypond-book --filter=\"tr '[a-z]' '[A-Z]'\" BUCH\n"
-" lilypond-book --filter=\"convert-ly --no-version --from=2.0.0 -\" BUCH\n"
-" lilypond-book --process='lilypond-bin -I include' BUCH\n"
-"\n"
+#. !@PYTHON@
+#. once upon a rainy monday afternoon.
+#.
+#. ...
+#.
+#. (not finished.)
+#. ABC standard v1.6: http://www.gre.ac.uk/~c.walshaw/abc2mtex/abc.txt
+#.
+#. Enhancements (Roy R. Rankin)
+#.
+#. Header section moved to top of lilypond file
+#. handle treble, treble-8, alto, and bass clef
+#. Handle voices (V: headers) with clef and part names, multiple voices
+#. Handle w: lyrics with multiple verses
+#. Handle key mode names for minor, major, phrygian, ionian, locrian, aeolian,
+#. mixolydian, lydian, dorian
+#. Handle part names from V: header
+#. Tuplets handling fixed up
+#. Lines starting with |: not discarded as header lines
+#. Multiple T: and C: header entries handled
+#. Accidental maintained until next bar check
+#. Silent rests supported
+#. articulations fermata, upbow, downbow, ltoe, accent, tenuto supported
+#. Chord strings([-^]"string") can contain a '#'
+#. Header fields enclosed by [] in notes string processed
+#. W: words output after tune as abc2ps does it (they failed before)
+#. Enhancements (Laura Conrad)
+#.
+#. Barring now preserved between ABC and lilypond
+#. the default placement for text in abc is above the staff.
+#. %%LY now supported.
+#. \breve and \longa supported.
+#. M:none doesn't crash lily.
+#. Limitations
+#.
+#. Multiple tunes in single file not supported
+#. Blank T: header lines should write score and open a new score
+#. Not all header fields supported
+#. ABC line breaks are ignored
+#. Block comments generate error and are ignored
+#. Postscript commands are ignored
+#. lyrics not resynchronized by line breaks (lyrics must fully match notes)
+#. %%LY slyrics can't be directly before a w: line.
+#. ???
+#. TODO:
+#.
+#. Convert to new chord styles.
+#.
+#. UNDEF -> None
+#.
+#. uGUHGUHGHGUGH
+#. UGH
+#. treble8 is used by abctab2ps; -8va is used by barfly,
+#. and by my patch to abc2ps. If there's ever a standard
+#. about this we'll support that.
+#. find keywork
+#. assume that Q takes the form "Q:1/4=120"
+#. There are other possibilities, but they are deprecated
+#. outf.write ("\t\t\\consists Staff_margin_engraver\n")
+#. pitch manipulation. Tuples are (name, alteration).
+#. 0 is (central) C. Alteration -1 is a flat, Alteration +1 is a sharp
+#. pitch in semitones.
+#. abc to lilypond key mode names
+#. semitone shifts for key mode names
+#. latex does not like naked #'s
+#. latex does not like naked "'s
+#. break lyrics to words and put "'s around words containing numbers and '"'s
+#. escape "
+#. _ causes probs inside ""
+#. _ to ' _ '
+#. split words with -
+#. unless \-
+#. ~ to space('_')
+#. * to to space
+#. latex does not like naked #'s
+#. put numbers and " and ( into quoted string
+#. insure space between lines
+#. title
+#. strip trailing blanks
+#. Meter
+#. KEY
+#. seperate clef info
+#. there may or may not be a space
+#. between the key letter and the mode
+#. ugh.
+#. ugh.
+#. Notes
+#. Origin
+#. Reference Number
+#. Area
+#. History
+#. Book
+#. Composer
+#. Default note length
+#. Voice
+#. Words
+#. vocals
+#. tempo
+#. we use in this order specified accidental, active accidental for bar,
+#. active accidental for key
+#. (num / den) / defaultlen < 1/base
+#. return (str, num,den,dots)
+#. ignore slide
+#. ignore roll
+#. s7m2 input doesnt care about spaces
+#.
+#. remember accidental for rest of bar
+#.
+#. get accidental set in this bar or UNDEF if not set
+#. WAT IS ABC EEN ONTZETTENDE PROGRAMMEERPOEP !
+#. failed; not a note!
+#. escape '#'s
+#.
+#. |] thin-thick double bar line
+#. || thin-thin double bar line
+#. [| thick-thin double bar line
+#. :| left repeat
+#. |: right repeat
+#. :: left-right repeat
+#. |1 volta 1
+#. |2 volta 2
+#. first try the longer one
+#. bracket escape
+#. the nobarlines option is necessary for an abc to lilypond translator for
+#. exactly the same reason abc2midi needs it: abc requires the user to enter
+#. the note that will be printed, and MIDI and lilypond expect entry of the
+#. pitch that will be played.
+#.
+#. In standard 19th century musical notation, the algorithm for translating
+#. between printed note and pitch involves using the barlines to determine
+#. the scope of the accidentals.
+#.
+#. Since ABC is frequently used for music in styles that do not use this
+#. convention, such as most music written before 1700, or ethnic music in
+#. non-western scales, it is necessary to be able to tell a translator that
+#. the barlines should not affect its interpretation of the pitch.
+#. write other kinds of appending if we ever need them.
+#. add comments to current voice
+#. Try nibbling characters off until the line doesn't change.
+#. dump_global (outf)
+#. !@PYTHON@
+#.
+#. convert-ly.py -- Update old LilyPond input files (fix name?)
+#.
+#. source file of the GNU LilyPond music typesetter
+#.
+#. (c) 1998--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+#. Jan Nieuwenhuizen <janneke@gnu.org>
+#. TODO
+#. use -f and -t for -s output
+#. NEWS
+#. 0.2
+#. - rewrite in python
+#. Did we ever have \mudela-version? I doubt it.
+#. lilypond_version_re_str = '\\\\version *\"(.*)\"'
+#. ###########################
+#. need new a namespace
+#. raise FatalConversionError()
+#. need new a namespace
+#. harmful to current .lys
+#. str = re.sub ('\\\\key([^;]+);', '\\\\accidentals \\1;', str)
+#. raise FatalConversionError()
+#. raise FatalConversionError()
+#. raise FatalConversionError()
+#. TODO: lots of other syntax change should be done here as well
+#. Ugh, but meaning of \stemup changed too
+#. maybe we should do \stemup -> \stemUp\slurUp\tieUp ?
+#. I don't know exactly when these happened...
+#. ugh, we loose context setting here...
+#. (lacks capitalisation slur -> Slur)
+#. # dynamic..
+#. TODO: add lots of these
+#. ugh
+#. old fix
+#. Make sure groups of more than one ; have space before
+#. them, so that non of them gets removed by next rule
+#. Only remove ; that are not after spaces, # or ;
+#. Otherwise we interfere with Scheme comments,
+#. which is badbadbad.
+#. 40 ?
+#. ###############################
+#. END OF CONVERSIONS
+#. ###############################
+#. !@PYTHON@
+#. info mostly taken from looking at files. See also
+#. http://lilypond.org/wiki/?EnigmaTransportFormat
+#. This supports
+#.
+#. * notes
+#. * rests
+#. * ties
+#. * slurs
+#. * lyrics
+#. * articulation
+#. * grace notes
+#. * tuplets
+#.
+#. todo:
+#. * slur/stem directions
+#. * voices (2nd half of frame?)
+#. * more intelligent lyrics
+#. * beams (better use autobeam?)
+#. * more robust: try entertainer.etf (freenote)
+#. * dynamics
+#. * empty measures (eg. twopt03.etf from freenote)
+#.
+#. uGUHGUHGHGUGH
+#. notename 0 == central C
+#. represent pitches as (notename, alteration), relative to C-major scale
+#. a fifth up
+#. should cache this.
+#. flag1 isn't all that interesting.
+#. 3: '>',
+#. 18: '\arpeggio' ,
+#. do grace notes.
+#. ugh.
+#. we don't attempt voltas since they fail easily.
+#. and g.repeat_bar == '|:' or g.repeat_bar == ':|:' or g.bracket:
+#. 4 layers.
+#. let's not do this: this really confuses when eE happens to be before a ^text.
+#. if last_tag and last_indices:
+#. etf_file_dict[last_tag][last_indices].append (l)
+#. # do it
+#. staff-spec
+#. should use \addlyrics ?
+#. !@PYTHON@
+#. vim: set noexpandtab:
+#. This is was the idea for handling of comments:
+#. Multiline comments, @ignore .. @end ignore is scanned for
+#. in read_doc_file, and the chunks are marked as 'ignore', so
+#. lilypond-book will not touch them any more. The content of the
+#. chunks are written to the output file. Also 'include' and 'input'
+#. regex has to check if they are commented out.
+#.
+#. Then it is scanned for 'lilypond', 'lilypond-file' and 'lilypond-block'.
+#. These three regex's has to check if they are on a commented line,
+#. % for latex, @c for texinfo.
+#.
+#. Then lines that are commented out with % (latex) and @c (Texinfo)
+#. are put into chunks marked 'ignore'. This cannot be done before
+#. searching for the lilypond-blocks because % is also the comment character
+#. for lilypond.
+#.
+#. The the rest of the rexeces are searched for. They don't have to test
+#. if they are on a commented out line.
+#. ###############################################################
+#. Users of python modules should include this snippet
+#. and customize variables below.
+#. We'll suffer this path init stuff as long as we don't install our
+#. python packages in <prefix>/lib/pythonx.y (and don't kludge around
+#. it as we do with teTeX on Red Hat Linux: set some environment var
+#. (PYTHONPATH) in profile)
+#. If set, LILYPONDPREFIX must take prevalence
+#. if datadir is not set, we're doing a build and LILYPONDPREFIX
+#. Customize these
+#. if __name__ == '__main__':
+#. lilylib globals
+#. temp_dir = os.path.join (original_dir, '%s.dir' % program_name)
+#. urg
+#. # FIXME
+#. # do -P or -p by default?
+#. #help_summary = _ ("Run LilyPond using LaTeX for titling")
+#: lilypond-book.py:120
+msgid "Process LilyPond snippets in hybrid html, LaTeX or texinfo document"
+msgstr "LilyPond-Teile in Mischdateien (HTML, LaTeX oder texinfo) verarbeiten"
-#. Bug in option parser: --output=foe is taken as an abbreviation
-#. for --output-format.
-#: lilypond-book.py:82 old-lilypond-book.py:123 main.cc:139
+#. another bug in option parser: --output=foe is taken as an abbreviation
+#. for --output-format
+#: lilypond-book.py:125 main.cc:110
msgid "EXT"
msgstr "ERW"
-#: lilypond-book.py:82 old-lilypond-book.py:123
+#: lilypond-book.py:125
msgid "use output format EXT (texi [default], texi-html, latex, html)"
msgstr "Ausgabeformat ERW (texi [Vorgabe], texi-html, latex, html) verwenden"
-#: lilypond-book.py:83
-msgid "FILTER"
-msgstr "FILTER"
-
-#: lilypond-book.py:83
-msgid "pipe snippets through FILTER [convert-ly -n -]"
-msgstr "Auszüge durch FILTER [convert-ly -n -] leiten (Pipe)"
+#: lilypond-book.py:126 lilypond-book.py:127 lilypond-book.py:129
+#: lilypond-book.py:130
+msgid "DIM"
+msgstr "GROE"
-#: lilypond-book.py:85 lilypond-book.py:87 lilypond.py:131
-#: old-lilypond-book.py:130 main.cc:142 main.cc:147
-msgid "DIR"
-msgstr "VERZ"
+#: lilypond-book.py:126
+msgid "default fontsize for music. DIM is assumed to be in points"
+msgstr "Schriftgrößenvorgabe für Musik. Einheit für GROE: Punkte"
-#: lilypond-book.py:85
-msgid "add DIR to include path"
-msgstr "VERZ zum Einfügepfad hinzufügen"
+#: lilypond-book.py:127
+msgid "deprecated, use --default-music-fontsize"
+msgstr "veraltet, verwenden Sie --default-music-fontsize"
-#: lilypond-book.py:86
-msgid "COMMAND"
-msgstr "BEFEHL"
+#: lilypond-book.py:128
+msgid "OPT"
+msgstr "OPT"
-#: lilypond-book.py:86
-msgid "process ly_files using COMMAND FILE..."
-msgstr "ly_files mit BEFEHL DATEI... verarbeiten"
+#: lilypond-book.py:128
+msgid "pass OPT quoted to the lilypond command line"
+msgstr "OPT \"zitiert\" an die LilyPond-Kommandozeile übergeben"
-#: lilypond-book.py:87
-msgid "write output to DIR"
-msgstr "Ausgabe in DATEI schreiben"
+#: lilypond-book.py:129
+msgid "force fontsize for all inline lilypond. DIM is assumed be to in points"
+msgstr "Schriftgröße für eingebettetes LilyPond erzwingen. Einheit für GROE: Punkte"
-#: lilypond-book.py:88 lilypond.py:149 midi2ly.py:105 mup2ly.py:78
-#: old-lilypond-book.py:140 main.cc:150
-msgid "be verbose"
-msgstr "wortreich sein"
+#: lilypond-book.py:130
+msgid "deprecated, use --force-music-fontsize"
+msgstr "veraltet, verwenden Sie --force-music-fontsize"
-#: lilypond-book.py:89 old-lilypond-book.py:141
-msgid "print version information"
-msgstr "Versionsinformation ausgeben"
+#: lilypond-book.py:132 lilypond.py:130 main.cc:113 main.cc:118
+msgid "DIR"
+msgstr "VERZ"
-#: lilypond-book.py:90 lilypond.py:151 midi2ly.py:107 mup2ly.py:80
-#: old-lilypond-book.py:142 main.cc:151
-msgid "show warranty and copyright"
-msgstr "Informationen zu Gewährleistung und Copyright anzeigen"
+#: lilypond-book.py:132
+msgid "include path"
+msgstr "Pfad einbeziehen"
-#: lilypond-book.py:373
-#, python-format
-msgid "deprecated ly-option used: %s"
-msgstr "veraltete ly-option verwendet: %s"
+#: lilypond-book.py:133
+msgid "write dependencies"
+msgstr "Schreib-Abhängigkeiten"
-#: lilypond-book.py:374
-#, python-format
-msgid "compatibility mode translation: %s"
-msgstr "Übersetzung im Kompatibilitätsmodus: %s"
+#: lilypond-book.py:134
+msgid "PREF"
+msgstr "PRÄF"
-#: lilypond-book.py:394
-#, python-format
-msgid "ignoring unknown ly option: %s"
-msgstr "unbekannte Option ignoriert: %s"
+#: lilypond-book.py:134
+msgid "prepend PREF before each -M dependency"
+msgstr "stelle PRÄF den -M Abhängigkeiten voran"
-#: lilypond-book.py:448
-#, python-format
-msgid "file not found: %s"
-msgstr "Datei `%s' nicht gefunden"
+#: lilypond-book.py:135
+msgid "don't run lilypond"
+msgstr "LilyPond nicht aufrufen"
-#: lilypond-book.py:750
-#, python-format
-msgid "Opening filter `%s'"
-msgstr "Öffne Filter `%s'"
+#: lilypond-book.py:136
+msgid "don't generate pictures"
+msgstr "keine Bilder generieren"
-#: lilypond-book.py:862
-#, python-format
-msgid "cannot determine format for: %s"
-msgstr "Kann Format nicht finden für: %s"
+#: lilypond-book.py:137
+msgid "strip all lilypond blocks from output"
+msgstr "alle LilyPond-Blöcke aus der Ausgabe entfernen"
-#: lilypond-book.py:903
-msgid "Output would overwrite input file; use --output."
-msgstr "Ausgabe würde Eingabedatei überschreiben; verwenden Sie --output."
+#: lilypond-book.py:138 lilypond-book.py:139 lilypond.py:135 lilypond.py:136
+#: midi2ly.py:102 main.cc:114 main.cc:117
+msgid "FILE"
+msgstr "DATEI"
-#: lilypond-book.py:910
-#, python-format
-msgid "Reading %s..."
-msgstr "%s lesen..."
+#: lilypond-book.py:138
+msgid "filename main output file"
+msgstr "Dateiname für Hauptausgabedatei"
-#: lilypond-book.py:924
-msgid "Dissecting..."
-msgstr "Zerlegen..."
+#: lilypond-book.py:139
+msgid "where to place generated files"
+msgstr "Ziel der generierten Dateien"
-#: lilypond-book.py:952
-msgid "Writing snippets..."
-msgstr "Schreibe Auszüge..."
+#: lilypond-book.py:140 lilypond.py:137
+msgid "RES"
+msgstr "AUFL"
-#: lilypond-book.py:957
-msgid "Processing..."
-msgstr "Verarbeiten..."
+#: lilypond-book.py:141 lilypond.py:138
+msgid "set the resolution of the preview to RES"
+msgstr "Auflösung der Vorschau auf AUFL setzen"
-#: lilypond-book.py:960
-msgid "All snippets are up to date..."
-msgstr "Alle Auszüge sind auf dem neuesten Stand..."
+#: lilypond-book.py:142 lilypond.py:148 midi2ly.py:105 mup2ly.py:78 main.cc:126
+msgid "be verbose"
+msgstr "wortreich"
-#: lilypond-book.py:963
-#, python-format
-msgid "Compiling %s..."
-msgstr "%s kompilieren..."
+#: lilypond-book.py:143
+msgid "print version information"
+msgstr "Versionsinformation ausgeben"
-#: lilypond-book.py:971
-#, python-format
-msgid "Processing include: %s"
-msgstr "Verarbeite Einfügung: %s"
+#: lilypond-book.py:144 lilypond.py:150 midi2ly.py:107 mup2ly.py:80 main.cc:127
+msgid "show warranty and copyright"
+msgstr "Gewährleistung und Copyright zeigen"
+
+#. format specific strings, ie. regex-es for input, and % strings for output
+#. global variables
+#. lilypond_binary = 'valgrind --suppressions=/home/hanwen/usr/src/guile-1.6.supp --num-callers=10 /home/hanwen/usr/src/lilypond/lily/out/lilypond'
+#. only use installed binary when we're installed too.
+#. only use installed binary when we're installed too.
+#. ###############################################################
+#. Dimension handling for LaTeX.
+#.
+#. Ugh. (La)TeX writes progress and error messages on stdout
+#. Redirect to stderr
+#: lilypond-book.py:230
+msgid "LaTeX failed."
+msgstr "LaTeX scheiterte."
-#: lilypond-book.py:987 lilypond.py:693 midi2ly.py:1017
-#: old-lilypond-book.py:1570
+#. URG see lilypond
+#. Convert numeric values, with or without specific dimension, to floats.
+#. Keep other strings
+#. ###############################################################
+#. How to output various structures.
+#. # maybe <hr> ?
+#. Verbatim text is always finished with \n. FIXME: For HTML,
+#. this newline should be removed.
+#. Verbatim text is always finished with \n. FIXME: For HTML,
+#. this newline should be removed.
+#. # Ugh we need to differentiate on origin:
+#. # lilypond-block origin wants an extra <p>, but
+#. # inline music doesn't.
+#. # possibly other center options?
+#. verbatim text is always finished with \n
+#. verbatim text is always finished with \n
+#. verbatim text is always finished with \n
+#. verbatim text is always finished with \n
+#. do some tweaking: @ is needed in some ps stuff.
+#.
+#. ugh, the <p> below breaks inline images...
+#. clumsy workaround for python 2.2 pre bug.
+#. ###############################################################
+#. Recognize special sequences in the input
+#. Warning: This uses extended regular expressions. Tread with care.
+#.
+#. legenda
+#.
+#. (?P<name>regex) -- assign result of REGEX to NAME
+#. *? -- match non-greedily.
+#. (?m) -- multiline regex: make ^ and $ match at each line
+#. (?s) -- make the dot match all characters including newline
+#. why do we have distinction between @mbinclude and @include?
+#. # we'd like to catch and reraise a more
+#. # detailed error, but alas, the exceptions
+#. # changed across the 1.5/2.1 boundary.
+#. ughUGH not original options
+#. First we want to scan the \documentclass line
+#. it should be the first non-comment line.
+#. The only thing we really need to know about the \documentclass line
+#. is if there are one or two columns to begin with.
+#. Then we add everything before \begin{document} to
+#. paperguru.m_document_preamble so that we can later write this header
+#. to a temporary file in find_latex_dims() to find textwidth.
+#. this is not bulletproof..., it checks the first 10 chunks
+#. newchunks.extend (func (m))
+#. python 1.5 compatible:
+#. we have to check for verbatim before doing include,
+#. because we don't want to include files that are mentioned
+#. inside a verbatim environment
+#. ugh fix input
+#. # Hmm, we should hash only lilypond source, and skip the
+#. # %options are ...
+#. # comment line
+#. # todo: include path, but strip
+#. # first part of the path.
+#. format == 'html'
+#. ugh rename
+#. Count sections/chapters.
+#. # TODO: do something like
+#. # this for texinfo/latex as well ?
+#. ugh
+#. fixme: be sys-independent.
+#.
+#. Ugh, fixing up dependencies for .tex generation
+#.
+#. Ugh. (La)TeX writes progress and error messages on stdout
+#. Redirect to stderr
+#. # There used to be code to write .tex dependencies, but
+#. # that is silly: lilypond-book has its own dependency scheme
+#. # to ensure that all lily-XXX.tex files are there
+#. # TODO: put file name in front of texidoc.
+#. #
+#. # what's this? Docme --hwn
+#. #
+#. #docme: why global?
+#. Do It.
+#. should chmod -w
+#: lilypond-book.py:1557 lilypond.py:673 midi2ly.py:1018
#, python-format
msgid "getopt says: `%s'"
msgstr "getopt sagt: `%s'"
+#. HACK
+#. status = os.system ('lilypond -w')
+#: lilypond-book.py:1630 lilypond.py:777
+msgid "no files specified on command line"
+msgstr "Keine Dateien auf der Kommandozeile angegeben"
+
+#.
+#. Petr, ik zou willen dat ik iets zinvoller deed,
+#. maar wat ik kan ik doen, het verandert toch niets?
+#. --hwn 20/aug/99
+#. !@PYTHON@
+#.
+#. lilypond.py -- Run LilyPond, add titles to bare score, generate printable
+#. document
+#. Invokes: lilypond, latex (or pdflatex), dvips, ps2pdf, gs
+#.
+#. source file of the GNU LilyPond music typesetter
+#.
+#. (c) 1998--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+#. Jan Nieuwenhuizen <janneke@gnu.org>
+#. This is the third incarnation of lilypond.
+#.
+#. Earlier incarnations of lilypond were written by
+#. Jeffrey B. Reed<daboys@austin.rr.com> (Python version)
+#. Jan Arne Fagertun <Jan.A.Fagertun@@energy.sintef.no> (Bourne shell script)
+#.
+#. Note: gettext work best if we use ' for docstrings and "
+#. for gettextable strings.
+#. --> DO NOT USE ''' for docstrings.
+#. ###############################################################
+#. Users of python modules should include this snippet
+#. and customize variables below.
+#. We'll suffer this path init stuff as long as we don't install our
+#. python packages in <prefix>/lib/pythonx.y (and don't kludge around
+#. it as we do with teTeX on Red Hat Linux: set some environment var
+#. (PYTHONPATH) in profile)
+#. If set, LILYPONDPREFIX must take prevalence
+#. if datadir is not set, we're doing a build and LILYPONDPREFIX
+#. Customize these
+#. if __name__ == '__main__':
+#. lilylib globals
#. # FIXME
#. # do -P or -p by default?
#. #help_summary = _ ("Run LilyPond using LaTeX for titling")
-#: lilypond.py:120
+#: lilypond.py:121
msgid "Run LilyPond, add titles, generate printable document."
-msgstr "LilyPond aufrufen, Titel hinzufügen, druckbares Dokument erzeugen."
+msgstr "LilyPond aufrufen, Titel hinzufügen, druckbares Dokument erzeugen."
-#: lilypond.py:126
+#: lilypond.py:127 main.cc:115
msgid "write Makefile dependencies for every input file"
-msgstr "Makefile-Abhängigkeiten für jede Eingabedatei schreiben"
+msgstr "Makefile-Abhängigkeiten für jede Eingabedatei schreiben"
-#: lilypond.py:128
+#: lilypond.py:129
msgid "print even more output"
msgstr "noch mehr Ausgabe erzeugen"
-#: lilypond.py:129 lilypond.py:136 midi2ly.py:102 old-lilypond-book.py:136
-#: old-lilypond-book.py:137 main.cc:143 main.cc:146
-msgid "FILE"
-msgstr "DATEI"
-
-#: lilypond.py:129
-msgid "find pfa fonts used in FILE"
-msgstr "PFA-Schriftarten, welche in DATEI verwendet werden, finden"
-
#: lilypond.py:130
-msgid "make HTML file with links to all output"
-msgstr "HTML-Datei mit Querverweisen in die gesamte Ausgabe erzeugen"
-
-#: lilypond.py:131
msgid "add DIR to LilyPond's search path"
-msgstr "VERZ zu LilyPond's Suchpfad hinzufügen"
+msgstr "VERZ zu LilyPond's Suchpfad hinzufügen"
-#: lilypond.py:133
+#: lilypond.py:132
#, python-format
msgid "keep all output, output to directory %s.dir"
msgstr "Alle Ausgaben aufbewahren, ins Verzeichnis %s.dir ausgeben"
-#: lilypond.py:134
+#: lilypond.py:133
msgid "don't run LilyPond"
msgstr "LilyPond nicht aufrufen"
-#: lilypond.py:135 main.cc:145
+#: lilypond.py:134 main.cc:116
msgid "produce MIDI output only"
msgstr "nur MIDI-Ausgabe erzeugen"
-#: lilypond.py:136 midi2ly.py:102 mup2ly.py:76 main.cc:146
-msgid "write output to FILE"
-msgstr "Ausgabe in DATEI schreiben"
-
-#: lilypond.py:137 old-lilypond-book.py:138
-msgid "RES"
-msgstr "AUFL"
-
-#: lilypond.py:138 old-lilypond-book.py:139
-msgid "set the resolution of the preview to RES"
-msgstr "Auflösung der Vorschau auf AUFL setzen"
+#: lilypond.py:136
+msgid "find pfa fonts used in FILE"
+msgstr "PFA-Schriftarten, welche in DATEI verwendet werden, finden"
#: lilypond.py:139
-msgid "do not generate PDF output"
-msgstr "keine PDF-Ausgabe erzeugen"
+msgid "generate PostScript output"
+msgstr "PostScript-Ausgabe erzeugen"
#: lilypond.py:140
-msgid "do not generate PostScript output"
-msgstr "keine PostScript-Ausgabe erzeugen"
+msgid "generate PNG page images"
+msgstr "PNG Dateien für Seiten erzeugen"
#: lilypond.py:141
-msgid "generate PDF output"
-msgstr "PDF-Ausgabe erzeugen"
+msgid "generate PS.GZ"
+msgstr "ps.gz-Ausgabe erzeugen"
#: lilypond.py:142
-msgid "generate PostScript output"
-msgstr "PostScript-Ausgabe erzeugen"
+msgid "generate PDF output"
+msgstr "PDF-Ausgabe erzeugen"
#: lilypond.py:143
-msgid "use pdflatex to generate PDF output"
+msgid "use pdflatex to generate a PDF output"
msgstr "pdflatex verwenden, um PDF-Ausgabe zu erzeugen"
-#: lilypond.py:144
-msgid "generate PNG page images"
-msgstr "PNG-Dateien für Seiten erzeugen"
-
+#. FIXME: preview, picture; to indicate creation of a PNG?
#: lilypond.py:145
msgid "make a picture of the first system"
msgstr "ein Bild des ersten Systems erzeugen"
#: lilypond.py:146
-msgid "generate PS.GZ"
-msgstr "ps.gz-Ausgabe erzeugen"
+msgid "make HTML file with links to all output"
+msgstr "HTML-Datei mit Querverweisen in die gesamte Ausgabe erzeugen"
#: lilypond.py:147
-msgid "run in safe-mode"
-msgstr "im sicheren Modus laufen"
-
-#: lilypond.py:148
msgid "KEY=VAL"
msgstr "KEY=VAL"
-#: lilypond.py:148
+#: lilypond.py:147
msgid "change global setting KEY to VAL"
msgstr "globale Einstellung von KEY auf VAL setzen"
-#: lilypond.py:150 midi2ly.py:106 mup2ly.py:79 main.cc:149
+#: lilypond.py:149 midi2ly.py:106 mup2ly.py:79 main.cc:125
msgid "print version number"
msgstr "Versionsnummer ausgeben"
-#: lilypond.py:234
+#. other globals
+#. Pdftex support
+#. # yuk.
+#. lilypond_binary = 'valgrind --suppressions=%(home)s/usr/src/guile-1.6.supp --num-callers=10 %(home)s/usr/src/lilypond/lily/out/lilypond '% { 'home' : '/home/hanwen' }
+#. only use installed binary when we're installed too.
+#. init to empty; values here take precedence over values in the file
+#. # TODO: change name.
+#. for geometry v3
+#. Output formats that lilypond should create
+#. what a name.
+#. ly.warning (_ ("invalid value: %s") % `val`)
+#. ly.warning (_ ("invalid value: %s") % `val`)
+#: lilypond.py:232
#, python-format
msgid "no such setting: `%s'"
msgstr "keine solche Einstellung: `%s'"
-#: lilypond.py:284
+#. 2 == user interrupt.
+#: lilypond.py:274
#, python-format
msgid "LilyPond crashed (signal %d)."
-msgstr "LilyPond abgestürzt (Signal %d)."
+msgstr "LilyPond abgestürzt (Signal %d)."
-#: lilypond.py:285
+#: lilypond.py:275
msgid "Please submit a bug report to bug-lilypond@gnu.org"
msgstr "Bitte senden Sie einen Fehlerbericht an bug-lilypond@gnu.org"
-#: lilypond.py:291
+#: lilypond.py:281
#, python-format
msgid "LilyPond failed on input file %s (exit status %d)"
-msgstr "LilyPond scheiterte an der Eingabedatei %s (Rückgabewert %d)."
+msgstr "LilyPond scheiterte an der Eingabedatei %s (Rückgabewert %d)."
-#: lilypond.py:294
+#: lilypond.py:284
#, python-format
msgid "LilyPond failed on an input file (exit status %d)"
-msgstr "LilyPond scheiterte an der Eingabedatei (Rückgabewert %d)."
+msgstr "LilyPond scheiterte an der Eingabedatei (Rückgabewert %d)."
-#: lilypond.py:295
+#: lilypond.py:285
msgid "Continuing..."
msgstr "Setze fort..."
-#: lilypond.py:306
+#. urg
+#: lilypond.py:296
#, python-format
msgid "Analyzing %s..."
msgstr "Analysiere %s..."
-#: lilypond.py:364
+#. search only the first 10k
+#: lilypond.py:354
#, python-format
msgid "no LilyPond output found for `%s'"
-msgstr "keine LilyPond-Ausgabe für `%s' gefunden"
+msgstr "keine LilyPond-Ausgabe für `%s' gefunden"
-#: lilypond.py:431
+#. The final \n seems important here. It ensures that the footers and taglines end up on the right page.
+#. TODO: should set textheight (enlarge) depending on papersize.
+#: lilypond.py:397
#, python-format
msgid "invalid value: `%s'"
-msgstr "ungültiger Wert: `%s'"
+msgstr "ungültiger Wert: `%s'"
-#: lilypond.py:529
+#. set sane geometry width (a4-width) for linewidth = -1.
+#. who the hell is 597 ?
+#. Ugh. (La)TeX writes progress and error messages on stdout
+#. Redirect to stderr
+#: lilypond.py:511
msgid "LaTeX failed on the output file."
msgstr "LaTeX scheiterte an der Ausgabedatei"
-#: lilypond.py:586
+#. make a preview by rendering only the 1st line
+#. of each score
+#: lilypond.py:568
msgid ""
"Trying create PDF, but no PFA fonts found.\n"
"Using bitmap fonts instead. This will look bad."
msgstr ""
"Versuche PDF zu erzeugen, finde jedoch keine PFA-Schriftarten.\n"
-"Verwende stattdessen Bitmap-Schriftarten. Das wird übel aussehen."
+"Verwende stattdessen Bitmap-Schriftarten. Das wird übel aussehen."
+#. ugh. Different targets?
+#. Added as functionality to lilypond, because lilypond may well need to do this
+#. in future too.
#. no ps header?
-#: lilypond.py:635
+#: lilypond.py:615
#, python-format
msgid "not a PostScript file: `%s'"
msgstr "Keine PostScript-Datei: `%s'"
-#: lilypond.py:680
+#. todo
+#: lilypond.py:660
#, python-format
msgid "Writing HTML menu `%s'"
-msgstr "Schreibe HTML-Menü `%s'..."
-
-#: lilypond.py:800
+msgstr "Schreibe HTML-Menü `%s'..."
+
+#. signal programming error
+#. Don't convert input files to abspath, rather prepend '.' to include
+#. path.
+#. As a neat trick, add directory part of first input file
+#. to include path. That way you can do without the clumsy -I in:
+#. lilypond -I foe/bar/baz foo/bar/baz/baz.ly
+#: lilypond.py:769
msgid "pseudo filter"
msgstr "Pseudo-Filter"
-#: lilypond.py:803
+#: lilypond.py:772
msgid "pseudo filter only for single input file"
-msgstr "Pseudo-Filter nur für einzelne Eingabedatei"
-
-#: lilypond.py:808 old-lilypond-book.py:1643
-msgid "no files specified on command line"
-msgstr "Keine Dateien auf der Kommandozeile angegeben"
+msgstr "Pseudo-Filter nur für einzelne Eingabedatei"
-#: lilypond.py:840
+#. Ugh, maybe make a setup () function
+#. hmmm. Wish I'd 've written comments when I wrote this.
+#. now it looks complicated.
+#: lilypond.py:806
#, python-format
msgid "filename should not contain spaces: `%s'"
msgstr "Dateiname sollte keine Leerzeichen enthalten: `%s'"
-#: lilypond.py:880
+#. to be sure, add tmpdir *in front* of inclusion path.
+#. os.environ['TEXINPUTS'] = tmpdir + ':' + os.environ['TEXINPUTS']
+#. We catch all exceptions, because we need to do stuff at exit:
+#. * copy any successfully generated stuff from tempdir and
+#. notify user of that
+#. * cleanout tempdir
+#. ## ARGH. This also catches python programming errors.
+#. ## this should only catch lilypond nonzero exit status
+#. ## --hwn
+#. TODO: friendly message about LilyPond setup/failing?
+#.
+#: lilypond.py:845
msgid "Running LilyPond failed. Rerun with --verbose for a trace."
-msgstr "LilyPond-Aufruf gescheitert. Versuchen Sie es erneut mit --verbose für ein Protokoll (Trace)."
-
-#: lilypond.py:921
+msgstr "LilyPond-Aufruf gescheitert. Versuchen Sie es erneut mit --verbose für ein Protokoll."
+
+#. Our LilyPond pseudo filter always outputs to 'lelie'
+#. have subsequent stages and use 'lelie' output.
+#. unless: add --tex, or --latex?
+#. TODO: friendly message about TeX/LaTeX setup,
+#. trying to run tex/latex by hand
+#: lilypond.py:886
msgid "Failed to make PS file. Rerun with --verbose for a trace."
-msgstr "Erzeugung der PS-Datei gescheitert. Versuchen Sie es erneut mit --verbose für ein Protokoll."
+msgstr "Erzeugung der PS-Datei gescheitert. Versuchen Sie es erneut mit --verbose für ein Protokoll."
-#: lilypond.py:951
-msgid "Running LaTeX failed. Rerun with --verbose for a trace."
-msgstr "LaTeX-Aufruf gescheitert. Versuchen Sie es erneut mit --verbose für ein Protokoll."
+#. unless: add --tex, or --latex?
+#. TODO: friendly message about TeX/LaTeX setup,
+#. trying to run tex/latex by hand
+#: lilypond.py:916
+msgid "Running LaTeX falied. Rerun with --verbose for a trace."
+msgstr "LaTeX-Aufruf gescheitert. Versuchen Sie es erneut mit --verbose für ein Protokoll."
-#: lilypond.py:963 input-file-results.cc:74
+#. add DEP to targets?
+#: lilypond.py:926 input-file-results.cc:68
#, c-format, python-format
msgid "dependencies output to `%s'..."
-msgstr "Abhängigkeiten-Ausgabe nach `%s'..."
+msgstr "Abhängigkeiten-Ausgabe nach `%s'..."
-#: lilypond.py:974
+#: lilypond.py:937
#, python-format
msgid "%s output to <stdout>..."
msgstr "Ausgabe von %s nach <stdout>..."
-#: lilypond.py:979 includable-lexer.cc:57 input-file-results.cc:217
-#: input-file-results.cc:224 lily-guile.cc:86
+#: lilypond.py:942 lilypond.py:968 includable-lexer.cc:57
+#: input-file-results.cc:191 input-file-results.cc:197 lily-guile.cc:86
#, c-format, python-format
msgid "can't find file: `%s'"
msgstr "Kann Datei nicht finden: `%s'"
-#: lilypond.py:1002
+#. Hmm, if this were a function, we could call it the except: clauses
+#: lilypond.py:965
#, python-format
msgid "%s output to %s..."
msgstr "Ausgabe von %s nach %s..."
-#: lilypond.py:1005
-#, python-format
-msgid "can't find file: `%s.%s'"
-msgstr "Kann Datei nicht finden: `%s.%s'"
-
+#. !@PYTHON@
+#.
+#. midi2ly.py -- LilyPond midi import script
+#.
+#. source file of the GNU LilyPond music typesetter
+#.
+#. (c) 1998--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+#. Jan Nieuwenhuizen <janneke@gnu.org>
+#. ###############################################################
+#. Users of python modules should include this snippet.
+#.
+#. This soon to be removed for: import lilypond.lilylib as ly
+#. ###############################################################
+#. ###############################################################
+#. ############### CONSTANTS
+#. ###############################################################
#. temp_dir = os.path.join (original_dir, '%s.dir' % program_name)
#. original_dir = os.getcwd ()
#. keep_temp_dir_p = 0
#: midi2ly.py:97
msgid "print absolute pitches"
-msgstr "Absolute Tonhöhen ausgeben"
+msgstr "Absolute Tonhöhen ausgeben"
#: midi2ly.py:98 midi2ly.py:103
msgid "DUR"
#: midi2ly.py:98
msgid "quantise note durations on DUR"
-msgstr "Notenlängen auf DAUER quantisieren"
+msgstr "Notenlängen auf DAUER quantisieren"
#: midi2ly.py:99
msgid "print explicit durations"
-msgstr "Explizite Notenlängen ausgeben"
+msgstr "Explizite Notenlängen ausgeben"
#: midi2ly.py:101
msgid "ALT[:MINOR]"
#: midi2ly.py:103
msgid "quantise note starts on DUR"
-msgstr "Notenanfänge auf DAUER quantisieren"
+msgstr "Notenanfänge auf DAUER quantisieren"
#: midi2ly.py:104
msgid "DUR*NUM/DEN"
-msgstr "DAUER*ZÄHLER/NENNER"
+msgstr "DAUER*ZÄHLER/NENNER"
# tuplet = Wertaufteilung nach: Peter Giger: Die Kunst des Rhythmus, Seite 25
#: midi2ly.py:104
msgid "allow tuplet durations DUR*NUM/DEN"
-msgstr "Wertaufteilungsdauern DAUER*ZÄHLER/NENNER erlauben"
+msgstr "Wertaufteilungsdauern DAUER*ZÄHLER/NENNER erlauben"
#: midi2ly.py:108
msgid "treat every text as a lyric"
msgstr "Jeden Text als Liedtext behandeln"
-#: midi2ly.py:149 mup2ly.py:143 input.cc:88
-msgid "warning: "
-msgstr "Warnung: "
+#: midi2ly.py:136 mup2ly.py:130
+msgid " 2001--2003"
+msgstr " 2001--2003"
-#: midi2ly.py:164 midi2ly.py:1017 midi2ly.py:1082 mup2ly.py:146 mup2ly.py:160
-#: input.cc:93
-msgid "error: "
-msgstr "Fehler: "
+#: midi2ly.py:141 mup2ly.py:135
+msgid ""
+"\n"
+"Distributed under terms of the GNU General Public License. It comes with\n"
+"NO WARRANTY."
+msgstr ""
+"\n"
+"Vertrieben unter den Bedingungen der GNU General Public License\n"
+"und ohne GEWÄHRLEISTUNG."
-#: midi2ly.py:165 mup2ly.py:161
+#: midi2ly.py:166 mup2ly.py:162
msgid "Exiting ... "
msgstr "Beenden ... "
-#: midi2ly.py:263 mup2ly.py:260
+#: midi2ly.py:264 mup2ly.py:261
#, python-format
msgid "command exited with value %d"
-msgstr "Kommando mit Rückgabewert %d beendet"
-
-#: midi2ly.py:1001
+msgstr "Kommando mit Rückgabewert %d beendet"
+
+#. ###############################################################
+#. END Library
+#. ###############################################################
+#. hmm
+#. major scale: do-do
+#. minor scale: la-la (= + 5) '''
+#. By tradition, all scales now consist of a sequence
+#. of 7 notes each with a distinct name, from amongst
+#. a b c d e f g. But, minor scales have a wide
+#. second interval at the top - the 'leading note' is
+#. sharped. (Why? it just works that way! Anything
+#. else doesn't sound as good and isn't as flexible at
+#. saying things. In medieval times, scales only had 6
+#. notes to avoid this problem - the hexachords.)
+#. So, the d minor scale is d e f g a b-flat c-sharp d
+#. - using d-flat for the leading note would skip the
+#. name c and duplicate the name d. Why isn't c-sharp
+#. put in the key signature? Tradition. (It's also
+#. supposedly based on the Pythagorean theory of the
+#. cycle of fifths, but that really only applies to
+#. major scales...) Anyway, g minor is g a b-flat c d
+#. e-flat f-sharp g, and all the other flat minor keys
+#. end up with a natural leading note. And there you
+#. have it.
+#. John Sankey <bf250@freenet.carleton.ca>
+#.
+#. Let's also do a-minor: a b c d e f gis a
+#.
+#. --jcn
+#. as -> gis
+#. des -> cis
+#. ges -> fis
+#. g -> fisis
+#. d -> cisis
+#. a -> gisis
+#. b -> ces
+#. e -> fes
+#. f -> eis
+#. c -> bis
+#. # FIXME: compile fix --jcn
+#. TODO: move space
+#. fis cis gis dis ais eis bis
+#. bes es as des ges ces fes
+#. urg, we should be sure that we're in a lyrics staff
+#. all include ALL_NOTES_OFF
+#. ugh, must set key while parsing
+#. because Note init uses key
+#. Better do Note.calc () at dump time?
+#. last_lyric.clocks = t - last_time
+#. hmm
+#. urg, this will barf at meter changes
+#. urg LilyPond doesn't start at c4, but
+#. remembers from previous tracks!
+#. reference_note = Note (clocks_per_4, 4*12, 0)
+#. must be in \notes mode for parsing \skip
+#: midi2ly.py:1002
#, python-format
msgid "%s output to `%s'..."
msgstr "%s nach `%s' ausgeben..."
-#: midi2ly.py:1032
+#: midi2ly.py:1033
msgid "Example:"
msgstr "Beispiel:"
-#: midi2ly.py:1082
+#: midi2ly.py:1083
msgid "no files specified on command line."
msgstr "Keine Dateien auf der Kommandozeile angegeben."
+#. !@PYTHON@
+#. mup2ly.py -- mup input converter
+#.
+#. source file of the GNU LilyPond music typesetter
+#.
+#. (c) 2001
+#. if set, LILYPONDPREFIX must take prevalence
+#. if datadir is not set, we're doing a build and LILYPONDPREFIX
#: mup2ly.py:70
msgid "Convert mup to LilyPond source."
msgstr "mup nach LilyPond-Quelltext konvertieren."
msgid "define macro NAME [optional expansion EXP]"
msgstr "Makro NAME [optionale Erweiterung EXP] definieren"
+#: mup2ly.py:76 main.cc:117
+msgid "write output to FILE"
+msgstr "Ausgabe in DATEI schreiben"
+
#: mup2ly.py:77
msgid "only pre-process"
msgstr "nur vorverarbeiten"
-#: mup2ly.py:1075
+#. Duh. Python style portable: cp *.EXT OUTDIR
+#. system ('cp *.%s %s' % (ext, outdir), 1)
+#. Python < 1.5.2 compatibility
+#.
+#. On most platforms, this is equivalent to
+#. `normpath(join(os.getcwd()), PATH)'. *Added in Python version 1.5.2*
+#. if set, LILYPONDPREFIX must take prevalence
+#. if datadir is not set, we're doing a build and LILYPONDPREFIX
+#. ###############################################################
+#. END Library
+#.
+#. PMX cut and paste
+#.
+#. if not self.entries:
+#. #return '\n'
+#. #ugh ugh
+#. return '\n%s = {}\n\n' % self.idstring ()
+#. ugh
+#. def set_clef (self, letter):
+#. clstr = clef_table[letter]
+#. self.voices[0].add_nonchord (Clef (clstr))
+#. urg
+#. maybe use import copy?
+#. for i in self.pitches:
+#. ch.pitches.append (i)
+#. for i in self.scripts:
+#. ch.scripts.append (i)
+#. http://www.arkkra.com/doc/uguide/contexts.html
+#. #self.current_staffs = []
+#. duh
+#. FIXME: 1?
+#. FIXME: does key play any role in this?
+#. ch = self.current_voices[0].last_chord ()
+#. ch.basic_duration = self.current_voices[0].last_chord ().basic_duration
+#. ugh
+#. ch = self.current_voices[0].last_chord ()
+#. `;' is not a separator, chords end with ';'
+#. mup resets default duration and pitch each bar
+#. ugh: these (and lots more) should also be parsed in
+#. context staff. we should have a class Staff_properties
+#. and parse/set all those.
+#. shortcut: set to official mup maximum (duh)
+#. self.set_staffs (40)
+#: mup2ly.py:1076
#, python-format
msgid "no such context: %s"
msgstr "kein solcher Kontext: %s"
-#: mup2ly.py:1299
+#. hmm
+#. dig this: mup allows ifdefs inside macro bodies
+#. don't do nested multi-line defines
+#. duh: mup is strictly line-based, except for `define',
+#. which is `@' terminated and may span several lines
+#. don't define new macros in unactive areas
+#. To support nested multi-line define's
+#. process_function and macro_name, macro_body
+#. should become lists (stacks)
+#. The mup manual is undetermined on this
+#. and I haven't seen examples doing it.
+#.
+#. don't do nested multi-line define's
+#. writes to stdout for help2man
+#. don't call
+#. identify ()
+#. sys.stdout.flush ()
+#. handy emacs testing
+#. if not files:
+#. files = ['template.mup']
+#: mup2ly.py:1300
#, python-format
msgid "Processing `%s'..."
msgstr "Verarbeite `%s'..."
-#: mup2ly.py:1318
+#: mup2ly.py:1319
#, python-format
msgid "Writing `%s'..."
msgstr "Schreibe `%s'..."
-#. # FIXME
-#. # do -P or -p by default?
-#. #help_summary = _ ("Run LilyPond using LaTeX for titling")
-#: old-lilypond-book.py:118
-msgid "Process LilyPond snippets in hybrid HTML, LaTeX or texinfo document"
-msgstr "LilyPond-Teile in Mischdatei (HTML, LaTeX oder texinfo) verarbeiten"
-
-#: old-lilypond-book.py:124 old-lilypond-book.py:125 old-lilypond-book.py:127
-#: old-lilypond-book.py:128
-msgid "DIM"
-msgstr "GROE"
-
-#: old-lilypond-book.py:124
-msgid "default fontsize for music. DIM is assumed to be in points"
-msgstr "Schriftgrößenvorgabe für Musik. Einheit für GROE: Punkte"
-
-#: old-lilypond-book.py:125
-msgid "deprecated, use --default-music-fontsize"
-msgstr "veraltet, verwenden Sie --default-music-fontsize"
-
-#: old-lilypond-book.py:126
-msgid "OPT"
-msgstr "OPT"
-
-#: old-lilypond-book.py:126
-msgid "pass OPT quoted to the lilypond command line"
-msgstr "OPT \"zitiert\" an die LilyPond-Kommandozeile übergeben"
-
-#: old-lilypond-book.py:127
-msgid "force fontsize for all inline lilypond. DIM is assumed to be in points"
-msgstr "Schriftgröße für eingebettetes LilyPond erzwingen. Einheit für GROE: Punkte"
-
-#: old-lilypond-book.py:128
-msgid "deprecated, use --force-music-fontsize"
-msgstr "veraltet, verwenden Sie --force-music-fontsize"
-
-#: old-lilypond-book.py:130
-msgid "include path"
-msgstr "Pfad einbeziehen"
-
-#: old-lilypond-book.py:131
-msgid "write dependencies"
-msgstr "Schreib-Abhängigkeiten"
-
-#: old-lilypond-book.py:132
-msgid "PREF"
-msgstr "PRÄF"
-
-#: old-lilypond-book.py:132
-msgid "prepend PREF before each -M dependency"
-msgstr "stelle PRÄF den -M Abhängigkeiten voran"
-
-#: old-lilypond-book.py:133
-msgid "don't run lilypond"
-msgstr "LilyPond nicht aufrufen"
-
-#: old-lilypond-book.py:134
-msgid "don't generate pictures"
-msgstr "keine Bilder generieren"
-
-#: old-lilypond-book.py:135
-msgid "strip all lilypond blocks from output"
-msgstr "alle LilyPond-Blöcke aus der Ausgabe entfernen"
-
-#: old-lilypond-book.py:136
-msgid "filename main output file"
-msgstr "Dateiname für Hauptausgabedatei"
-
-#: old-lilypond-book.py:137
-msgid "where to place generated files"
-msgstr "Ziel der generierten Dateien"
-
-#: old-lilypond-book.py:227
-msgid "LaTeX failed."
-msgstr "LaTeX scheiterte."
-
#: getopt-long.cc:146
#, c-format
msgid "option `%s' requires an argument"
-msgstr "Option `%s' benötigt ein Argument"
+msgstr "Option `%s' benötigt ein Argument"
#: getopt-long.cc:150
#, c-format
#: getopt-long.cc:161
#, c-format
msgid "invalid argument `%s' to option `%s'"
-msgstr "ungültiges Argument `%s' für Option `%s'"
+msgstr "ungültiges Argument `%s' für Option `%s'"
-#: warn.cc:44
+#: warn.cc:25
#, c-format
-msgid "programming error: %s"
-msgstr "Programmierfehler: %s"
+msgid "warning: %s\n"
+msgstr "Warnung: %s\n"
-#: warn.cc:45
-msgid "Continuing; crossing fingers"
-msgstr "Das Programm wird trotz aufgetretenem Fehler fortgesetzt."
+#: warn.cc:31
+#, c-format
+msgid "error: %s\n"
+msgstr "Fehler: %s\n"
-#: accidental.cc:219 key-signature-interface.cc:139
+#: warn.cc:44
+#, c-format
+msgid "programming error: %s (Continuing; cross thumbs)\n"
+msgstr "Programmierfehler: %s (setze fort; kreuze die Finger)\n"
+
+#: accidental.cc:202 key-signature-interface.cc:137
#, c-format
msgid "accidental `%s' not found"
msgstr "Vorzeichen `%s' nicht gefunden"
-#: accidental-engraver.cc:167
+#: accidental-engraver.cc:171 new-accidental-engraver.cc:238
#, c-format
msgid "Accidental typesetting list must begin with context-name: %s"
msgstr "Vorzeichensatzliste muss mit Kontextnamen beginnen: %s"
-#: accidental-engraver.cc:194
+#: accidental-engraver.cc:196 new-accidental-engraver.cc:263
+#, c-format
+msgid "unknown accidental typesetting: %s. Ignored"
+msgstr "Unbekanntes Vorzeichen: %s. Ignoriert"
+
+#: accidental-engraver.cc:212 new-accidental-engraver.cc:279
+#, c-format
+msgid "Symbol is not a parent context: %s. Ignored"
+msgstr "Symbol ist kein Elternkontext: %s. Ignoriert"
+
+#: accidental-engraver.cc:215 new-accidental-engraver.cc:282
#, c-format
-msgid "ignoring unknown accidental: %s"
-msgstr "unbekannte Option ignoriert: %s"
+msgid "Accidental typesetting must be pair or context-name: %s"
+msgstr "Vorzeichensatz paarweise oder mit Kontextname erwartet: %s"
-#: accidental-engraver.cc:211
+#: afm.cc:66
#, c-format
-msgid "Accidental rule must be pair or context-name; Found %s"
-msgstr "Vorzeichensatz paarweise oder mit Kontextname erwartet; %s gefunden"
+msgid "can't find character number: %d"
+msgstr "Kann Zeichennummer nicht finden: %d"
-#: afm.cc:145
+#: afm.cc:81
+#, c-format
+msgid "can't find character called: `%s'"
+msgstr "Kann Zeichen nicht finden: `%s'"
+
+#: afm.cc:142
#, c-format
msgid "Error parsing AFM file: `%s'"
msgstr "Fehler beim Analysieren der AFM-Datei: `%s'"
-#: all-font-metrics.cc:100
+#: all-font-metrics.cc:95
#, c-format
msgid "checksum mismatch for font file: `%s'"
-msgstr "Prüfsummenfehler für Schriftartdatei: `%s'"
+msgstr "Prüfsummenfehler für Schriftartdatei: `%s'"
-#: all-font-metrics.cc:102
+#: all-font-metrics.cc:97
#, c-format
msgid "does not match: `%s'"
msgstr "Passt nicht: `%s'"
-#: all-font-metrics.cc:107
-msgid "Rebuild all .afm files, and remove all .pk and .tfm files."
-msgstr "Bauen Sie alle .afm-Dateien neu, und löschen Sie alle .pk- und .tfm-Dateien."
-
-#: all-font-metrics.cc:109
-msgid "Rerun with -V to show font paths."
-msgstr "Starten Sie erneut mit -V um Suchpfade für Schriftarten anzuzeigen"
+#: all-font-metrics.cc:102
+msgid " Rebuild all .afm files, and remove all .pk and .tfm files. Rerun with -V to show font paths."
+msgstr " Bauen Sie alle .afm-Dateien neu, und löschen Sie alle .pk- und .tfm-Dateien. Starten sie erneut mit -V um die Schriftartverzeichnisse zu zeigen."
-#: all-font-metrics.cc:111
-msgid "A script for removing font-files is delivered with the source-code:"
-msgstr "Ein Skript zum Entfernen von Schriftartdateien wird mit dem Quellcode ausgeliefert:"
+#: all-font-metrics.cc:103
+msgid ""
+"A script for removing font-files is delivered with the source-code,\n"
+"in buildscripts/clean-fonts.sh"
+msgstr ""
+"Mit buildscripts/clean-fonts.sh wird beim Quellcode ein Skript mitgeliefert,\n"
+"womit Schriftartdateien gelöscht werden können"
-#: all-font-metrics.cc:192
+#: all-font-metrics.cc:169
#, c-format
msgid "can't find font: `%s'"
msgstr "Kann Schriftart nicht finden: `%s'"
-#: all-font-metrics.cc:193
+#: all-font-metrics.cc:170
msgid "Loading default font"
msgstr "Lade Standardschriftart"
-#: all-font-metrics.cc:208
+#: all-font-metrics.cc:185
#, c-format
msgid "can't find default font: `%s'"
msgstr "Kann Standardschriftart nicht finden: `%s'"
-#: all-font-metrics.cc:209 includable-lexer.cc:59 input-file-results.cc:218
+#: all-font-metrics.cc:186 includable-lexer.cc:59 input-file-results.cc:192
#, c-format
msgid "(search path: `%s')"
msgstr "(Suchpfad: `%s')"
-#: all-font-metrics.cc:210
+#: all-font-metrics.cc:187
msgid "Giving up"
msgstr "Gebe auf"
-#: auto-change-iterator.cc:62 change-iterator.cc:61
+#: auto-change-iterator.cc:43 change-iterator.cc:60
+#: part-combine-music-iterator.cc:120
msgid "Can't switch translators, I'm there already"
-msgstr "Kann Übersetzer nicht ändern, ist bereits geschehen"
+msgstr "Kann Übersetzer nicht ändern, ist bereits geschehen"
-#: bar-check-iterator.cc:68
+#: bar-check-iterator.cc:51
#, c-format
msgid "barcheck failed at: %s"
-msgstr "Taktüberprüfung gescheitert bei: %s"
+msgstr "Taktüberprüfung gescheitert bei: `%s'"
-#: beam.cc:151
+#: beam.cc:146
msgid "beam has less than two visible stems"
-msgstr "Balken hat weniger als zwei sichtbare Notenhälse"
+msgstr "Balken hat weniger als zwei sichtbare Notenhälse"
-#: beam.cc:156
-msgid "removing beam with less than two stems"
-msgstr "Balken mit weniger als zwei Notenhälsen wird entfernt"
+#: beam.cc:151
+msgid "Beam has less than two stems. Removing beam."
+msgstr "Balken hat weniger als zwei Notenhälse. Entferne Notenhals."
-#: beam.cc:1040
-msgid "no viable initial configuration found: may not find good beam slope"
-msgstr "Keine funktionsfähige Anfangskonfiguration gefunden: Es kann evtl. keine optimale Balkenneigung gefunden werden"
+#: beam.cc:976
+msgid "Not sure that we can find a nice beam slope (no viable initial configuration found)."
+msgstr "Kann wahrscheinlich keine optimale Balkenneigung ermitteln (keine funktionsfähige Anfangskonfiguration gefunden)"
-#: beam-engraver.cc:139
+#: beam-engraver.cc:176
msgid "already have a beam"
msgstr "habe bereits einen Balken"
-#: beam-engraver.cc:212
+#: beam-engraver.cc:259
msgid "unterminated beam"
msgstr "unbegrenzter Balken"
-#: beam-engraver.cc:245 chord-tremolo-engraver.cc:179
+#: beam-engraver.cc:292 chord-tremolo-engraver.cc:197
msgid "stem must have Rhythmic structure"
msgstr "Notenhals muss rhythmische Struktur aufweisen"
-#: beam-engraver.cc:259
+#: beam-engraver.cc:306
msgid "stem doesn't fit in beam"
msgstr "Notenhals passt nicht zum Balken"
-#: beam-engraver.cc:260
+#: beam-engraver.cc:307
msgid "beam was started here"
msgstr "Balken wurde hier begonnen"
-#: break-align-interface.cc:214
+#: break-align-interface.cc:173
#, c-format
msgid "No spacing entry from %s to `%s'"
msgstr "Kein Leerraumeintrag von %s nach `%s'"
#: change-iterator.cc:22
#, c-format
msgid "can't change `%s' to `%s'"
-msgstr "kann nicht `%s' nach `%s' ändern"
+msgstr "kann nicht `%s' nach `%s' ändern"
#.
#. We could change the current translator's id, but that would make
#.
#. last->translator_id_string_ = get_change ()->change_to_id_string_;
#.
-#: change-iterator.cc:87
+#: change-iterator.cc:79
msgid "I'm one myself"
msgstr "Ich bin selbst einer"
-#: change-iterator.cc:90
+#: change-iterator.cc:82
msgid "none of these in my family"
msgstr "keiner davon befindet sich in meiner Familie"
-#: chord-tremolo-engraver.cc:100
+#: chord-tremolo-engraver.cc:98
#, c-format
msgid "Chord tremolo with %d elements. Must have two elements."
-msgstr "Akkordtremolo mit %d Elementen. Benötigt zwei Elemente."
+msgstr "Akkordtremolo mit %d Elementen. Benötigt zwei Elemente."
-#: chord-tremolo-engraver.cc:141
+#: chord-tremolo-engraver.cc:157
msgid "unterminated chord tremolo"
msgstr "unbegrenztes Akkord-Tremolo"
-#: chord-tremolo-iterator.cc:64
+#: chord-tremolo-iterator.cc:69
msgid "no one to print a tremolos"
-msgstr "niemand vorhanden für Tremoloausgabe"
+msgstr "niemand vorhanden für Tremoloausgabe"
#: clef.cc:64
#, c-format
msgid "clef `%s' not found"
-msgstr "Schlüssel `%s' nicht gefunden"
+msgstr "Schlüssel `%s' not found"
-#: cluster.cc:123
+#: cluster.cc:131
#, c-format
msgid "unknown cluster style `%s'"
msgstr "unbekannter Gruppierungsstil: `%s'"
msgid "Coherent_ligature_engraver: setting `spacing-increment = 0.01': ptr=%ul"
msgstr "Coherent_ligature_engraver: setze `spacing-increment = 0.01': ptr=%ul"
-#: context.cc:180
-#, c-format
-msgid "Cannot find or create `%s' called `%s'"
-msgstr "kann `%s' (`%s' genannt) weder finden noch erzeugen"
-
-#: context.cc:217
-#, c-format
-msgid "can't find or create: `%s'"
-msgstr "Kann `%s' weder finden noch erzeugen"
-
-#: context-def.cc:115
-#, c-format
-msgid "Program has no such type: `%s'"
-msgstr "Das Programm hat keinen solchen Typen: `%s'"
-
-#: custos.cc:85
+#: custos.cc:92
#, c-format
msgid "custos `%s' not found"
msgstr "custos `%s' nicht gefunden"
msgid "NaN"
msgstr "NaN"
-#: dynamic-engraver.cc:183 span-dynamic-performer.cc:86
+#: dynamic-engraver.cc:204 span-dynamic-performer.cc:82
msgid "can't find start of (de)crescendo"
msgstr "kann den Anfang des (De-) Crescendos nicht finden"
-#: dynamic-engraver.cc:193
-msgid "already have a decrescendo"
-msgstr "habe bereits ein Decrescendo"
-
-#: dynamic-engraver.cc:195
+#: dynamic-engraver.cc:216
msgid "already have a crescendo"
msgstr "habe bereits ein Crescendo"
-#: dynamic-engraver.cc:198
+#: dynamic-engraver.cc:217
+msgid "already have a decrescendo"
+msgstr "habe bereits ein Decrescendo"
+
+#: dynamic-engraver.cc:220
msgid "Cresc started here"
msgstr "Crescendo begann hier"
-#: dynamic-engraver.cc:305
+#: dynamic-engraver.cc:323
msgid "unterminated (de)crescendo"
msgstr "unbegrenztes (De-) Crescendo"
#: event.cc:49
#, c-format
msgid "Transposition by %s makes alteration larger than two"
-msgstr "Transponieren um %s erzeugt Vorzeichen größer zwei"
+msgstr "Transponieren um %s erzeugt Vorzeichen größer zwei"
-#: event.cc:72
-#, c-format
-msgid "octave check failed; expected %s, found: %s"
-msgstr "Oktavenüberprüfung gescheitert; %s erwartet, %s gefunden"
-
-#: event-chord-iterator.cc:56 output-property-music-iterator.cc:29
+#: event-chord-iterator.cc:76 output-property-music-iterator.cc:27
#, c-format
msgid "Junking event: `%s'"
msgstr "Ignoriere Anforderung: `%s'"
-#: extender-engraver.cc:143 extender-engraver.cc:153
+#: extender-engraver.cc:94
msgid "unterminated extender"
msgstr "unbegrenzte Erweiterung"
-#: folded-repeat-iterator.cc:65
+#: extender-engraver.cc:106
+msgid "Nothing to connect extender to on the left. Ignoring extender event."
+msgstr "Nichts vorhanden, um die Erweiterung nach links zu verbinden. Ignoriere Erweiterungsanforderung."
+
+#: folded-repeat-iterator.cc:88
msgid "no one to print a repeat brace"
msgstr "niemand zur Erzeugung einer Wiederholung"
-#: glissando-engraver.cc:102
+#: font-interface.cc:239
+msgid "couldn't find any font satisfying "
+msgstr "konnte keine passende Schriftart finden für "
+
+#: glissando-engraver.cc:100
msgid "Unterminated glissando."
msgstr "unbegrenztes Glissando."
-#: global-context.cc:151
-#, c-format
-msgid "can't find `%s' context"
-msgstr "kann Kontext `%s' nicht finden"
-
-#: gourlay-breaking.cc:195
+#: gourlay-breaking.cc:188
#, c-format
msgid "Optimal demerits: %f"
msgstr "Optimale Bewertung: %f"
-#: gourlay-breaking.cc:200
+#: gourlay-breaking.cc:193
msgid "No feasible line breaking found"
-msgstr "Keine praktikablen Zeilenumbrüche gefunden"
+msgstr "Keine praktikablen Zeilenumbrüche gefunden"
#: gregorian-ligature-engraver.cc:59
#, c-format
#: gregorian-ligature-engraver.cc:64
#, c-format
msgid "implied \\%s added"
-msgstr "implizites \\%s hinzugefügt"
+msgstr "implizites \\%s hinzugefügt"
+
+#.
+#. Todo: do something sensible. The grob-pq-engraver is not water
+#. tight, and stuff like tupletSpannerDuration confuses it.
+#.
+#: grob-pq-engraver.cc:130
+#, c-format
+msgid ""
+"Skipped something?\n"
+"Grob %s ended before I expected it to end."
+msgstr ""
+"Etwas übersehen?\n"
+"Grob %s endet bevor dies erwartet wurde."
#: hairpin.cc:98
msgid "decrescendo too small"
msgid "crescendo too small"
msgstr "Crescendo zu kurz"
-#: horizontal-bracket-engraver.cc:57
+#: horizontal-bracket-engraver.cc:64
msgid "Don't have that many brackets."
msgstr "Habe nicht so viele Klammern."
-#: horizontal-bracket-engraver.cc:66
+#: horizontal-bracket-engraver.cc:73
msgid "Conflicting note group events."
msgstr "Notengruppen im Konflikt gefunden."
-#: hyphen-engraver.cc:96
-msgid "removing unterminated hyphen"
-msgstr "unbegrenzter Bindestrich wird entfernt"
-
-#: hyphen-engraver.cc:110
-msgid "unterminated hyphen; removing"
-msgstr "unbegrenzter Bindestrich; entfernt"
+#: hyphen-engraver.cc:87
+msgid "unterminated hyphen"
+msgstr "unbegrenzter Bindestrich"
-#: includable-lexer.cc:50
-msgid "include files are not allowed"
-msgstr "eingefügte Dateien sind nicht erlaubt"
+#: hyphen-engraver.cc:99
+msgid "Nothing to connect hyphen to on the left. Ignoring hyphen event."
+msgstr "Nichts vorhanden, um den Bindestrich nach links zu verbinden. Ignoriere Bindestrichanforderung."
#: input.cc:99
msgid "non fatal error: "
msgstr "nicht-schwerwiegender Fehler: "
-#: input.cc:107 source-file.cc:147 source-file.cc:240
+#: input.cc:107 source-file.cc:146 source-file.cc:239
msgid "position unknown"
msgstr "Position unbekannt"
-#: input-file-results.cc:78 source-file.cc:55
+#: input-file-results.cc:72 source-file.cc:54 streams.cc:38
#, c-format
msgid "can't open file: `%s'"
-msgstr "Kann Datei nicht öffnen: `%s'"
+msgstr "Kann Datei nicht öffnen: `%s'"
-#: input-file-results.cc:142
+#: input-file-results.cc:132
+msgid "Score contains errors; will not process it"
+msgstr "Noten enthalten Fehler; keine weitere Verarbeitung"
+
+#: input-file-results.cc:172
#, c-format
-msgid "Now processing `%s'"
-msgstr "`%s' wird jetzt verarbeitet"
+msgid "Now processing: `%s'"
+msgstr "Bearbeite: `%s'"
-#: key-performer.cc:90
+#: key-performer.cc:96
msgid "FIXME: key change merge"
-msgstr "FIXME: Mischen der Tonartänderungen"
+msgstr "FIXME: Mischen der Tonartänderungen"
-#: kpath.cc:75
+#: kpath.cc:76
#, c-format
-msgid "kpathsea can not find TFM file: `%s'"
-msgstr "kpathsea konnte TFM-Datei `%s' nicht finden"
+msgid "Kpathsea couldn't find TFM file `%s'"
+msgstr "Kpathsea konnte TFM-Datei `%s' nicht finden"
-#: ligature-engraver.cc:152
+#: ligature-engraver.cc:159
msgid "can't find start of ligature"
msgstr "kann den Anfang der Bindung nicht finden"
-#: ligature-engraver.cc:158
+#: ligature-engraver.cc:165
msgid "no right bound"
msgstr "keine rechte Begrenzung"
-#: ligature-engraver.cc:184
+#: ligature-engraver.cc:191
msgid "already have a ligature"
msgstr "habe bereits eine Bindung"
-#: ligature-engraver.cc:200
+#: ligature-engraver.cc:207
msgid "no left bound"
msgstr "keine linke Begrenzung"
-#: ligature-engraver.cc:255
+#: ligature-engraver.cc:258
msgid "unterminated ligature"
msgstr "unbegrenzte Bindung"
-#: ligature-engraver.cc:279
-msgid "ignoring rest: ligature may not contain rest"
-msgstr "Pause wird ignoriert: Bindung darf keine Pause enthalten"
+#: ligature-engraver.cc:282
+msgid "ligature may not contain rest; ignoring rest"
+msgstr "Bindung darf keine Pause enthalten; ignoriere Pause"
-#: ligature-engraver.cc:280
+#: ligature-engraver.cc:283
msgid "ligature was started here"
msgstr "Bindung wurde hier begonnen"
msgid "(load path: `%s')"
msgstr "(lade Pfad: `%s')"
-#: lily-guile.cc:584
+#: lily-guile.cc:576
#, c-format
msgid "Can't find property type-check for `%s' (%s)."
-msgstr "Kann keine Eigenschafts-Typprüfung für `%s' (%s) finden."
+msgstr "Kann keine Eigenschafts-Typprüfung für `%s' (%s) finden."
-#: lily-guile.cc:587
+#: lily-guile.cc:579
msgid "Perhaps you made a typing error?"
-msgstr "Ist Ihnen vielleicht ein Tippfehler unterlaufen?"
+msgstr "Ist Ihnen vielleicht einen Tippfehler unterlaufen?"
-#: lily-guile.cc:593
+#: lily-guile.cc:585
msgid "Doing assignment anyway."
-msgstr "Führe Zuweisung trotzdem durch."
+msgstr "Führe Zuweisung trotzdem durch."
-#: lily-guile.cc:607
+#: lily-guile.cc:599
#, c-format
msgid "Type check for `%s' failed; value `%s' must be of type `%s'"
-msgstr "Typprüfung für `%s' gescheitert; Wert `%s' muss vom Typ `%s' sein"
+msgstr "Typprüfung für `%s' gescheitert; Wert `%s' muss vom Typ `%s' sein"
-#: lookup.cc:169
+#: lookup.cc:173
msgid "round filled box horizontal extent smaller than blot; decreasing blot"
msgstr "Breite des abgerundeten Kastens kleiner als Kreisdurchmesser; verkleinere Kreis"
-#: lookup.cc:174
+#: lookup.cc:178
msgid "round filled box vertical extent smaller than blot; decreasing blot"
-msgstr "Höhe des abgerundeten Kastens kleiner als Kreisdurchmesser; verkleinere Kreis"
+msgstr "Höhe des abgerundeten Kastens kleiner als Kreisdurchmesser; verkleinere Kreis"
-#: main.cc:100
-msgid ""
-"This program is free software. It is covered by the GNU General Public\n"
-"License and you are welcome to change it and/or distribute copies of it\n"
-"under certain conditions. Invoke as `lilypond-bin --warranty' for more\n"
-"information.\n"
-msgstr ""
-"Dieses Programm ist Freie Software. Sie wird von der GNU General Public License\n"
-"geschützt, und Sie können sie gerne ändern und/oder Kopien unter den\n"
-"gleichen Bedingungen weitergeben. Rufen Sie `lilypond-bin --warranty' für weitere\n"
-"Informationen auf.\n"
+#: lyric-phrasing-engraver.cc:311
+msgid "lyrics found without any matching notehead"
+msgstr "Liedtext ohne passenden Notenkopf gefunden"
-#: main.cc:106
-msgid ""
-" This program is free software; you can redistribute it and/or\n"
-"modify it under the terms of the GNU General Public License version 2\n"
-"as published by the Free Software Foundation.\n"
-"\n"
-" This program is distributed in the hope that it will be useful,\n"
-"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
-"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n"
-"General Public License for more details.\n"
-"\n"
-" You should have received a copy (refer to the file COPYING) of the\n"
-"GNU General Public License along with this program; if not, write to\n"
-"the Free Software Foundation, Inc., 59 Temple Place - Suite 330,\n"
-"Boston, MA 02111-1307, USA.\n"
-msgstr ""
-" Dieses Programm ist Freie Software; Sie können es unter den\n"
-"Bedingungen der GNU General Public License Version 2, wie von der\n"
-"Free Software Foundation veröffentlicht, weitergeben und/oder modifizieren.\n"
-"\n"
-" Dieses Programm wird in der Hoffnung, dass es nützlich sein wird,\n"
-"herausgegeben. Es wird jedoch KEINE GARANTIE übernommen. Selbst die\n"
-"implizite Garantie der MARKTGÄNGIGKEIT oder TAUGLICHKEIT FÜR EINEN\n"
-"BESTIMMTEN ZWECK kann nicht gewährleistet werden. Siehe GNU General Public\n"
-"License für weitere Details.\n"
-"\n"
-" Sie sollten eine Kopie (siehe Datei COPYING) der GNU General Public\n"
-"License zusammen mit diesem Programm erhalten haben. Falls nicht, schreiben\n"
-"Sie bitte an die Free Software Foundation, Inc., 59 Temple Place - Suite 330,\n"
-"Boston, MA 02111-1307, USA.\n"
+#: lyric-phrasing-engraver.cc:317
+msgid "Huh? Melismatic note found to have associated lyrics."
+msgstr "Hä? Melismatische Note ohne assoziierten Liedtext gefunden."
-#: main.cc:135
+#: main.cc:106
msgid "EXPR"
msgstr "AUSD"
-#: main.cc:136
+#: main.cc:107
msgid "set options, use -e '(ly-option-usage)' for help"
-msgstr "Optionen setzen, benutzen Sie -e '(ly-option-usage)' für Hilfe"
+msgstr "Optionen setzen, benutzen Sie -e '(ly-option-usage)' für Hilfe"
-#: main.cc:139
+#: main.cc:110
msgid "use output format EXT"
msgstr "Ausgabeformat EXT benutzen"
-#: main.cc:141
+#: main.cc:112
msgid "FIELD"
msgstr "FELD"
-#: main.cc:141
+#: main.cc:112
msgid "write header field to BASENAME.FIELD"
msgstr "Header-Feld in BASISNAME.FELD schreiben"
-#: main.cc:142
+#: main.cc:113
msgid "add DIR to search path"
-msgstr "VERZ zum Suchpfad hinzufügen"
+msgstr "VERZ zum Suchpfad hinzufügen"
-#: main.cc:143
+#: main.cc:114
msgid "use FILE as init file"
-msgstr "DATEI als Anfangsdatei verwenden"
+msgstr "benutze DATEI als Anfangsdatei"
-#: main.cc:144
-msgid "write Makefile dependencies"
-msgstr "Makefile-Abhängigkeiten schreiben"
-
-#: main.cc:147
+#: main.cc:118
msgid "prepend DIR to dependencies"
-msgstr "stelle VERZ den Abhängigkeiten voran"
+msgstr "stelle VERZ den Abhängigkeiten voran"
-#: main.cc:148
-msgid "run in safe mode"
-msgstr "im sicheren Modus laufen lassen"
+#.
+#. should audit again.
+#.
+#: main.cc:123
+msgid "inhibit file output naming and exporting"
+msgstr "verhindere Dateiausgabe-Benennung und -Export"
-#: main.cc:171
+#. No version number or newline here. It confuses help2man.
+#: main.cc:155
#, c-format
+msgid "Usage: %s [OPTIONS]... FILE..."
+msgstr "Aufruf: %s [OPTIONS]... DATEI..."
+
+#: main.cc:157
+msgid "Typeset music and or play MIDI from FILE."
+msgstr "Musiksatz und/oder MIDI-Aufführung aus DATEI."
+
+#: main.cc:160
msgid ""
-"Copyright (c) %s by\n"
-"%s and others."
+"LilyPond is a music typesetter. It produces beautiful sheet music\n"
+"using a high level description file as input. LilyPond is part of \n"
+"the GNU Project.\n"
msgstr ""
-"Copyright (c) %s bei\n"
-"%s und anderen."
+"LilyPond ist ein Musiksatzprogramm. Es erzeugt ansprechende Notenblätter\n"
+"mit Hilfe einer Hochsprachen-Beschreibungsdatei als Eingabe. LilyPond\n"
+"ist ein Teil des GNU-Projektes.\n"
-#. No version number or newline here. It confuses help2man.
-#: main.cc:197
+#: main.cc:182
#, c-format
-msgid "Usage: %s [OPTIONS]... FILE..."
-msgstr "Aufruf: %s [OPTIONEN]... DATEI..."
+msgid ""
+"This is free software. It is covered by the GNU General Public License,\n"
+"and you are welcome to change it and/or distribute copies of it under\n"
+"certain conditions. Invoke as `%s --warranty' for more information.\n"
+msgstr ""
+"Dies ist freie Software. Sie wird von der GNU General Public License\n"
+"geschützt, und Sie können sie gerne ändern und/oder Kopien unter den\n"
+"gleichen Bedingungen weitergeben. Rufen Sie `%s --warranty' für weitere\n"
+"Informationen auf.\n"
-#: main.cc:199
-#, c-format
-msgid "Typeset music and/or produce MIDI from FILE."
-msgstr "Musiksatz und/oder MIDI aus DATEI erzeugen."
+#: main.cc:198
+msgid "GNU LilyPond -- The music typesetter"
+msgstr "GNU LilyPond -- Das Musiksatzprogramm"
-#: main.cc:201
-#, c-format
-msgid "LilyPond produces beautiful music notation."
-msgstr "LilyPond erzeugt ansprechende Musiknotation."
+#: main.cc:206
+msgid ""
+" This program is free software; you can redistribute it and/or\n"
+"modify it under the terms of the GNU General Public License version 2\n"
+"as published by the Free Software Foundation.\n"
+"\n"
+" This program is distributed in the hope that it will be useful,\n"
+"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
+"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n"
+"General Public License for more details.\n"
+"\n"
+" You should have received a copy (refer to the file COPYING) of the\n"
+"GNU General Public License along with this program; if not, write to\n"
+"the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,\n"
+"USA.\n"
+msgstr ""
+" Dieses Programm ist Freie Software; Sie können es unter den\n"
+"Bedingungen der GNU General Public License Version 2, wie von der\n"
+"Free Software Foundation veröffentlicht, weitergeben und/oder modifizieren.\n"
+"\n"
+" Dieses Programm wird in der Hoffnung, dass es nützlich sein wird,\n"
+"herausgegeben. Es wird jedoch KEINE GARANTIE übernommen. Selbst die\n"
+"implizite Garantie der MARKTGÄNGIGKEIT oder TAUGLICHKEIT FÜR EINEN\n"
+"BESTIMMTEN ZWECK kann nicht gewährleistet werden. Siehe GNU General Public\n"
+"License für weitere Details.\n"
+"\n"
+" Sie sollten eine Kopie (siehe Datei COPYING) der GNU General Public\n"
+"License zusammen mit diesem Programm erhalten haben. Falls nicht, schreiben\n"
+"Sie bitte an die Free Software Foundation, Inc., 59 Temple Place - Suite 330,\n"
+"Boston, MA 02111-1307, USA.\n"
-#: main.cc:203
+#: mensural-ligature.cc:153
#, c-format
-msgid "For more information, see %s"
-msgstr "Für weitere Informationen, siehe %s"
+msgid "Mensural_ligature:thickness undefined on flexa %d; assuming 1.4"
+msgstr "Mensural_ligature: Dicke undefiniert bei flexa %d; nehme 1.4 an"
-#: main.cc:369
+#: mensural-ligature.cc:169
#, c-format
-msgid "This option is for developers only."
-msgstr "Diese Option existiert nur für Entwickler."
+msgid "Mensural_ligature:delta-pitch undefined on flexa %d; assuming 0"
+msgstr "Mensural_ligature: delta-pitch undefiniert bei flexa %d; nehme 0 an"
-#: main.cc:370
+#: mensural-ligature.cc:182
#, c-format
-msgid "Read the sources for more information."
-msgstr "Lesen Sie die Quellen für weitere Informationen."
+msgid "Mensural_ligature:flexa-width undefined on flexa %d; assuming 2.0"
+msgstr "Mensural_ligature: flexa-width undefiniert bei flexa %d; nehme 2.0 an"
-#: mensural-ligature.cc:183
+#: mensural-ligature.cc:215
msgid "Mensural_ligature:unexpected case fall-through"
msgstr "Mensural_ligature: Unbehandelter case-Zweig"
-#: mensural-ligature.cc:193
+#: mensural-ligature.cc:225
msgid "Mensural_ligature: (join_left == 0)"
msgstr "Mensural_ligature: (join_left == 0)"
-#: mensural-ligature-engraver.cc:248 mensural-ligature-engraver.cc:383
+#: mensural-ligature-engraver.cc:248 mensural-ligature-engraver.cc:397
msgid "unexpected case fall-through"
msgstr "unbehandelter case-Zweig"
#: mensural-ligature-engraver.cc:259
msgid "ligature with less than 2 heads -> skipping"
-msgstr "Bindung mit weniger als 2 Notenköpfen -> überspringen"
+msgstr "Bindung mit weniger als 2 Notenköpfen -> überspringen"
#: mensural-ligature-engraver.cc:279
msgid "can not determine pitch of ligature primitive -> skipping"
-msgstr "kann Tonhöhe der Bindung nicht ermitteln -> überspringen"
+msgstr "kann Tonhöhe der Bindung nicht ermitteln -> überspringen"
#: mensural-ligature-engraver.cc:302
msgid "prime interval within ligature -> skipping"
-msgstr "Halbtonsprung unter Bindung -> überspringen"
+msgstr "Halbtonsprung unter Bindung -> überspringen"
#: mensural-ligature-engraver.cc:312
msgid "mensural ligature: duration none of L, B, S -> skipping"
-msgstr "Mensural_ligature: Dauer weder L, B noch S -> überspringen"
+msgstr "Mensural_ligature: Dauer weder L, B noch S -> überspringen"
-#: midi-item.cc:153
+#: midi-item.cc:148
#, c-format
-msgid "no such MIDI instrument: `%s'"
-msgstr "kein solches MIDI-Instrument: `%s'"
+msgid "no such instrument: `%s'"
+msgstr "kein solches Instrument: `%s'"
-#: midi-item.cc:257
-msgid "silly pitch"
-msgstr "sinnlose Tonhöhe"
+#: midi-item.cc:238
+msgid "silly duration"
+msgstr "sinnlose Dauer"
-#: midi-item.cc:273
-#, c-format
-msgid "Experimental: temporarily fine tuning (of %d cents) a channel."
-msgstr "Experimentell: temporäre Feinabstimmung (von %d Hundertsteln) des Kanals."
+#: midi-item.cc:251
+msgid "silly pitch"
+msgstr "sinnlose Tonhöhe"
-#: midi-stream.cc:40
+#: music-output-def.cc:111
#, c-format
-msgid "could not write file: `%s'"
-msgstr "Datei konnte nicht geschrieben werden: %s"
+msgid "can't find `%s' context"
+msgstr "kann Kontext `%s' nicht finden"
-#: my-lily-lexer.cc:185
+#: my-lily-lexer.cc:169
#, c-format
msgid "Identifier name is a keyword: `%s'"
-msgstr "Bezeichnername ist ein Schlüsselwort: `%s'"
+msgstr "Bezeichnername ist ein Schlüsselwort: `%s'"
-#: my-lily-lexer.cc:207
+#: my-lily-lexer.cc:191
#, c-format
msgid "error at EOF: %s"
msgstr "Fehler am Dateiende (EOF): %s"
-#: my-lily-parser.cc:45
+#: my-lily-parser.cc:44
msgid "Parsing..."
msgstr "Analysiere..."
-#: my-lily-parser.cc:57
+#: my-lily-parser.cc:54
msgid "Braces don't match"
msgstr "Klammern passen nicht zueinander"
#.
#. music for the softenon children?
#.
-#: new-fingering-engraver.cc:155
+#: new-fingering-engraver.cc:143
msgid "music for the martians."
-msgstr "Musik für Marsmenschen."
-
-#: new-fingering-engraver.cc:235
-msgid "Fingerings are also not down?! Putting them down anyway."
-msgstr "Fingersatz ist auch nicht unten?! Er wird trotzdem hinuntergesetzt."
+msgstr "Musik für Marsmenschen."
-#: new-lyric-combine-music-iterator.cc:172
-#, c-format
-msgid "cannot find Voice: %s"
-msgstr "Stimme kann nicht gefunden werden: %s"
+#: new-tie-engraver.cc:166 tie-engraver.cc:217
+msgid "lonely tie"
+msgstr "einsamer Bindebogen"
-#: note-collision.cc:384
+#: note-collision.cc:340
msgid "Too many clashing notecolumns. Ignoring them."
-msgstr "Zu viele kollidierende Notenspalten. Diese werden ignoriert."
+msgstr "Zu viele kollidierende Notenspalten. Ignoriere diese."
-#: note-head.cc:139
+#: note-head.cc:127
#, c-format
msgid "note head `%s' not found"
msgstr "Notenkopf `%s' nicht gefunden"
-#: paper-def.cc:73
+#: paper-def.cc:96
#, c-format
msgid "paper output to `%s'..."
msgstr "Papierausgabe in `%s'..."
-#: paper-score.cc:72
+#: paper-score.cc:78
#, c-format
msgid "Element count %d (spanners %d) "
msgstr "Elementanzahl: %d (Klammern: %d)"
-#: paper-score.cc:76
+#: paper-score.cc:83
msgid "Preprocessing graphical objects..."
msgstr "Vorverarbeitung der grafischen Elemente..."
-#: parse-scm.cc:81
-msgid "GUILE signaled an error for the expression beginning here"
-msgstr "GUILE signalisierte einen Fehler für den hier beginnenden Ausdruck"
+#: paper-score.cc:116
+msgid "Outputting Score, defined at: "
+msgstr "Notenausgabe, definiert bei: "
+
+#: parse-scm.cc:79
+msgid "GUILE signaled an error for the expression begining here"
+msgstr "GUILE signalisierte einen Fehler für den hier beginnenden Ausdruck"
+
+#.
+#. We could change the current translator's id, but that would make
+#. errors hard to catch
+#.
+#. last->translator_id_string_ = get_change ()->change_to_id_string_;
+#.
+#: part-combine-music-iterator.cc:139
+#, c-format
+msgid "I'm one myself: `%s'"
+msgstr "Ich bin selbst einer: '%s'"
+
+#: part-combine-music-iterator.cc:142
+#, c-format
+msgid "none of these in my family: `%s'"
+msgstr "Keiner davon befindet sich in meiner Familie: `%s'"
-#: percent-repeat-engraver.cc:110
+#: percent-repeat-engraver.cc:109
msgid "Don't know how to handle a percent repeat of this length."
-msgstr "Kenne kein Verfahren, eine Prozent-Wiederholung dieser Länge zu behandeln"
+msgstr "Kenne kein Verfahren, eine Prozent-Wiederholung dieser Länge zu behandeln"
-#: percent-repeat-engraver.cc:164
+#: percent-repeat-engraver.cc:163
msgid "unterminated percent repeat"
msgstr "unbegrenzte Prozentwiederholung"
-#: percent-repeat-iterator.cc:53
+#: percent-repeat-iterator.cc:65
msgid "no one to print a percent"
msgstr "nichts bekannt, ein Prozent auszugeben"
msgid "Track ... "
msgstr "Spur ... "
-#: performance.cc:94
+#: performance.cc:83
msgid "Creator: "
msgstr "Erzeuger: "
-#: performance.cc:114
+#: performance.cc:103
msgid "at "
-msgstr "bei "
+msgstr ", "
-#: performance.cc:172
+#: performance.cc:114
+#, c-format
+msgid "from musical definition: %s"
+msgstr "von der musikalischen Vorgabe: %s"
+
+#: performance.cc:169
#, c-format
msgid "MIDI output to `%s'..."
msgstr "MIDI-Ausgabe nach `%s'..."
-#: phrasing-slur-engraver.cc:105
+#: phrasing-slur-engraver.cc:123
msgid "unterminated phrasing slur"
msgstr "nicht beendeter Phrasierungsbogen"
-#: phrasing-slur-engraver.cc:123
+#: phrasing-slur-engraver.cc:141
msgid "can't find start of phrasing slur"
msgstr "kann Anfang des Phrasierungsbogens nicht finden"
-#: piano-pedal-engraver.cc:238
-msgid "Need 3 strings for piano pedals. No pedal made. "
-msgstr "3 Striche für Piano-Pedal benötigt. Kein Pedal erzeugt. "
-
-#: piano-pedal-engraver.cc:253 piano-pedal-engraver.cc:268
-#: piano-pedal-performer.cc:82
+#: piano-pedal-engraver.cc:235 piano-pedal-engraver.cc:250
+#: piano-pedal-engraver.cc:305 piano-pedal-performer.cc:82
#, c-format
msgid "can't find start of piano pedal: `%s'"
-msgstr "kann keinen Anfang für Pedal finden: `%s'"
+msgstr "kann keinen Anfang für Pedal finden: `%s'"
-#: piano-pedal-engraver.cc:321
-#, c-format
-msgid "can't find start of piano pedal bracket: `%s'"
-msgstr "kann keinen Anfang für Piano-Pedal finden: `%s'"
+#: piano-pedal-engraver.cc:410
+msgid "unterminated pedal bracket"
+msgstr "unbegrenzte Pedalklammer"
-#: property-iterator.cc:94
+#: property-iterator.cc:97
#, c-format
msgid "Not a grob name, `%s'."
-msgstr "Kein Name für grafische Objekte (grob): `%s'."
+msgstr "Kein Name für grafische Objekte (grob): `%s'."
-#: quote-iterator.cc:181
+#: rest.cc:139
#, c-format
-msgid "In quotation: junking event %s"
-msgstr "Event %s in Zitat verworfen"
-
-#: relative-octave-check.cc:25
-msgid "Failed octave check, got: "
-msgstr "Oktavprüfung gescheitert, Rückgabe: "
-
-#: rest.cc:137
-#, c-format
-msgid "rest `%s' not found"
-msgstr "Pause `%s' nicht gefunden"
-
-#: rest-collision.cc:145
-msgid "rest direction not set. Cannot resolve collision."
-msgstr "Pausenrichtung nicht gesetzt. Kollision kann nicht aufgelöst werden."
+msgid "rest `%s' not found, "
+msgstr "Pause `%s' nicht gefunden, "
-#: rest-collision.cc:193
+#: rest-collision.cc:199
msgid "too many colliding rests"
msgstr "zu viele kollidierende Pausen"
-#: scm-option.cc:52
-#, c-format
+#: scm-option.cc:45
msgid "lilypond -e EXPR means:"
msgstr "lilypond -e AUSD bedeutet:"
-#: scm-option.cc:54
-#, c-format
+#: scm-option.cc:47
msgid " Evalute the Scheme EXPR before parsing any .ly files."
-msgstr " Das Schema AUSD vor der Analyse aller .ly-Dateien auswerten"
+msgstr " Werte das Schema AUSD vor der Analyse aller .ly-Dateien aus"
-#: scm-option.cc:56
-#, c-format
+#: scm-option.cc:49
msgid " Multiple -e options may be given, they will be evaluated sequentially."
-msgstr " Mehrere -e Optionen dürfen angegeben werden, sie werden sequentiell ausgewertet"
+msgstr " Mehrere -e Optionen dürfen angegeben werden, sie werden sequentiell ausgewertet"
-#: scm-option.cc:58
-#, c-format
+#: scm-option.cc:51
msgid " The function ly-set-option allows for access to some internal variables."
-msgstr " Die Funktion ly-set-option erlaubt Zugriff auf interne Variablen."
+msgstr " Die Funktion ly-set-option erlaubt Zugriff auf interne Variablen"
-#: scm-option.cc:60
-#, c-format
-msgid "Usage: lilypond-bin -e \"(ly-set-option SYMBOL VAL)\""
-msgstr "Aufruf: lilypond-bin -e \"(ly-set-option SYMBOL WERT)\""
+#: scm-option.cc:53
+msgid "Usage: lilypond -e \"(ly-set-option SYMBOL VAL)\""
+msgstr "Aufruf: lilypond -e \"(ly-set-option SYMBOL WERT)\""
-#: scm-option.cc:62
-#, c-format
+#: scm-option.cc:55
msgid "Where SYMBOL VAL pair is any of:"
-msgstr "Wobei das (SYMBOL,WERT)-Paar folgendermaßen definiert ist:"
+msgstr "Wobei das (SYMBOL,WERT)-Paar folgendermaßen definiert ist:"
-#: scm-option.cc:143 scm-option.cc:176
+#: scm-option.cc:128
msgid "Unknown internal option!"
msgstr "Unbekannte interne Option!"
-#: score.cc:125
-msgid "Interpreting music... "
-msgstr "Interpretation der Musik..."
+#: score.cc:85
+msgid "Interpreting music..."
+msgstr "Interpretiere Musik..."
-#: score.cc:135
+#: score.cc:97
msgid "Need music in a score"
-msgstr "Benötige Musik in der Partitur"
+msgstr "Benötige Musik in der Partitur"
-#: score.cc:145
+#. should we? hampers debugging.
+#: score.cc:111
+msgid "Errors found/*, not processing score*/"
+msgstr "Fehler gefunden/*, verarbeite die Noten nicht*/"
+
+#: score.cc:118
#, c-format
msgid "elapsed time: %.2f seconds"
msgstr "verstrichene Zeit: %.2f Sekunden"
-#: score-engraver.cc:103
+#: score-engraver.cc:99
#, c-format
msgid "can't find `%s'"
msgstr "kann `%s' nicht finden"
-#: score-engraver.cc:104
+#: score-engraver.cc:100
msgid "Fonts have not been installed properly. Aborting"
-msgstr "Schriftarten wurden nicht ordnungsgemäß installiert. Abbruch"
+msgstr "Schriftarten wurden nicht ordnungsgemäß installiert. Abbruch"
-#: score-engraver.cc:189
+#: score-engraver.cc:205
#, c-format
msgid "unbound spanner `%s'"
msgstr "ungebundene Klammer `%s'"
-#: script-engraver.cc:96
-msgid "Don't know how to interpret articulation:"
-msgstr "Unbekannte Artikulation:"
-
-#: script-engraver.cc:97
-msgid "Scheme encoding: "
-msgstr "Schemakodierung: "
+#: script-engraver.cc:90
+#, c-format
+msgid "Don't know how to interpret articulation `%s'"
+msgstr "Unbekannte Artikulation: `%s'"
#. this shouldn't happen, but let's continue anyway.
-#: separation-item.cc:53 separation-item.cc:97
+#: separation-item.cc:53 separation-item.cc:101
msgid "Separation_item: I've been drinking too much"
msgstr "Separation_item: Habe zu viel getrunken"
msgid "No spring between column %d and next one"
msgstr "Kein (dynamischer) Abstand zwischen Spalte %d und Nachfolger"
-#: slur-engraver.cc:121
+#: slur-engraver.cc:141
msgid "unterminated slur"
msgstr "unbegrenzter Bogen"
#. How to shut up this warning, when Voice_devnull_engraver has
#. eaten start event?
-#: slur-engraver.cc:139
+#: slur-engraver.cc:159
msgid "can't find start of slur"
msgstr "kann den Anfang des Bogens nicht finden"
-#: source-file.cc:68
+#: source-file.cc:67
#, c-format
msgid "Huh? Got %d, expected %d characters"
-msgstr "Hä? %d Zeichen erhalten, %d erwartet"
+msgstr "Hä? %d Zeichen erhalten, %d erwartet"
-#: spacing-spanner.cc:385
+#: spacing-spanner.cc:379
#, c-format
-msgid "Global shortest duration is %s"
-msgstr "Kleinste globale Zeiteinheit ist %s"
+msgid "Global shortest duration is %s\n"
+msgstr "Kleinste globale Zeiteinheit ist %s\n"
#: spring-smob.cc:32
#, c-format
msgid "#<spring smob d= %f>"
msgstr "#<spring smob d= %f>"
-#: stem.cc:119
+#: staff-symbol.cc:61
+msgid "staff symbol: indentation yields beyond end of line"
+msgstr "Staff_symbol: Einrückung reicht über das Zeilenende hinaus"
+
+#: stem.cc:118
msgid "Weird stem size; check for narrow beams"
-msgstr "Eigenartige Notenhalslänge; überprüfen Sie auf enge Balken"
+msgstr "Eigenartige Notenhalslänge; überprüfen Sie auf enge Balken"
-#: stem.cc:648
+#: stem.cc:611
#, c-format
msgid "flag `%s' not found"
-msgstr "Fähnchen `%s' nicht gefunden"
+msgstr "Fähnchen `%s' nicht gefunden"
-#: stem.cc:661
+#: stem.cc:624
#, c-format
msgid "flag stroke `%s' not found"
-msgstr "Fähnchenstrich `%s' nicht gefunden"
+msgstr "Fähnchenstrich `%s' nicht gefunden"
-#: stem-engraver.cc:97
+#: stem-engraver.cc:96
msgid "tremolo duration is too long"
msgstr "Tremolodauer ist zu lang"
-#: stem-engraver.cc:128
+#: stem-engraver.cc:124
#, c-format
msgid "Adding note head to incompatible stem (type = %d)"
-msgstr "Füge Notenkopf zu inkompatiblem Hals (Typ = %d) hinzu"
+msgstr "Füge Notenkopf zu inkompatiblem Hals (Typ = %d) hinzu"
-#: stem-engraver.cc:129
+#: stem-engraver.cc:125
msgid "Don't you want polyphonic voices instead?"
msgstr "Wollen Sie nicht stattdessen Mehrstimmigkeit?"
-#: system.cc:181
+#: streams.cc:34
+#, c-format
+msgid "can't create directory: `%s'"
+msgstr "Kann Verzeichnis nicht erstellen: `%s'"
+
+#: streams.cc:48
+msgid "Error syncing file (disk full?)"
+msgstr "Fehler bei Dateisynchronisation (Platte voll?)"
+
+#: system.cc:125
#, c-format
msgid "Element count %d."
msgstr "Elementanzahl: %d."
-#: system.cc:335
+#: system.cc:372
#, c-format
-msgid "Grob count %d"
-msgstr "Anzahl der grafischen Objekte (grob): %d"
+msgid "Grob count %d "
+msgstr "Anzahl der grafischen Objekte (grob): %d "
-#: system.cc:349
+#: system.cc:386
msgid "Calculating line breaks..."
-msgstr "Berechne Zeilenumbrüche..."
+msgstr "Berechne Zeilenumbrüche..."
-#: text-spanner-engraver.cc:65
+#: text-spanner-engraver.cc:81
msgid "can't find start of text spanner"
msgstr "kann den Anfang der Textklammer nicht finden"
-#: text-spanner-engraver.cc:79
+#: text-spanner-engraver.cc:95
msgid "already have a text spanner"
msgstr "habe bereits eine Textklammer"
-#: text-spanner-engraver.cc:143
+#: text-spanner-engraver.cc:164
msgid "unterminated text spanner"
msgstr "unbegrenzte Textklammer"
msgid "%s: TFM file has %u parameters, which is more than the %u I can handle"
msgstr "%s: TFM-Datei hat %u Parameter - mehr als die Maximalzahl %u"
-#: tie-engraver.cc:164
-msgid "lonely tie"
-msgstr "einsamer Bindebogen"
+#: tie-performer.cc:159
+msgid "No ties were created!"
+msgstr "Es wurden keine Bindebögen erzeugt!"
-#: time-scaled-music-iterator.cc:24
+#: time-scaled-music-iterator.cc:25
msgid "no one to print a tuplet start bracket"
-msgstr "nichts für die Ausgabe einer öffnenden Wertaufteilungsklammer vorhanden"
+msgstr "niemand für die Ausgabe einer öffnenden Wertaufteilungsklammer vorhanden"
#. If there is no such symbol, we default to the numbered style.
#. (Here really with a warning!)
-#: time-signature.cc:95
+#: time-signature.cc:87
#, c-format
msgid "time signature symbol `%s' not found; reverting to numbered style"
-msgstr "Taktart `%s' nicht gefunden; Rückkehr zum nummerierten Stil"
+msgstr "Taktart `%s' nicht gefunden; kehre zum nummerierten Stil zurück"
#.
#. Todo: should make typecheck?
#: translator-ctors.cc:53
#, c-format
msgid "unknown translator: `%s'"
-msgstr "unbekannter Ãœbersetzer: `%s'"
+msgstr "unbekannter Ãœbersetzer: `%s'"
-#: translator-group.cc:108
+#: translator-def.cc:105
+msgid "Program has no such type"
+msgstr "Das Programm hat keinen solchen Typen"
+
+#: translator-def.cc:111
+#, c-format
+msgid "Already contains: `%s'"
+msgstr "Bereits enthalten: `%s'"
+
+#: translator-def.cc:112
+#, c-format
+msgid "Not adding translator: `%s'"
+msgstr "Füge Übersetzer `%s' nicht hinzu"
+
+#: translator-def.cc:229
#, c-format
msgid "can't find: `%s'"
msgstr "kann `%s' nicht finden"
-#: tuplet-bracket.cc:448
-msgid "Killing tuplet bracket across linebreak."
-msgstr "Wertaufteilungsklammer über Zeilenumbruch hinweg."
+#: translator-group.cc:158
+#, c-format
+msgid "can't find or create `%s' called `%s'"
+msgstr "kann `%s' (`%s' genannt) weder finden noch erzeugen"
+
+#: translator-group.cc:230
+#, c-format
+msgid "can't find or create: `%s'"
+msgstr "Kann `%s' weder finden noch erzeugen"
-#: vaticana-ligature.cc:92
+#: vaticana-ligature.cc:49
msgid "ascending vaticana style flexa"
msgstr "aufsteigender Vaticana-Stil flexa"
-#: vaticana-ligature.cc:181
-msgid "Vaticana_ligature: zero join (delta_pitch == 0)"
-msgstr "Vaticana_ligature: nichts zusammengefügt (delta_pitch == 0)"
+#: vaticana-ligature.cc:219
+msgid "Vaticana_ligature:thickness undefined; assuming 1.4"
+msgstr "Vaticana_ligature: Dicke undefiniert; nehme 1.4 an"
-#: vaticana-ligature-engraver.cc:342
-#, c-format
-msgid "ignored prefix (es) `%s' of this head according to restrictions of the selected ligature style"
-msgstr "Vorzeichen (es) `%s' dieses Kopfes gemäß den Einschränkungen des ausgewählten Bindungs-Stils ignoriert"
+#: vaticana-ligature.cc:233
+msgid "Vaticana_ligature:x-offset undefined; assuming 0.0"
+msgstr "Vaticana_ligature: x-offset undefiniert; nehme 0.0 an"
+
+#: vaticana-ligature.cc:258
+msgid "Vaticana_ligature: (delta_pitch == 0)"
+msgstr "Vaticana_ligature: (delta_pitch == 0)"
+
+#: vaticana-ligature.cc:271
+msgid "Vaticana_ligature:delta-pitch -> ignoring join"
+msgstr "Vaticana_ligature:delta-pitch -> ignoriere Kombination"
-#: vaticana-ligature-engraver.cc:572
+#: vaticana-ligature-engraver.cc:477
#, c-format
msgid "Vaticana_ligature_engraver: setting `spacing-increment = %f': ptr=%ul"
msgstr "Vaticana_ligature_engraver: setze `spacing-increment = %f': ptr=%ul"
-#: volta-engraver.cc:140
+#: volta-engraver.cc:112
msgid "No volta spanner to end"
msgstr "Kein Wiederholungskasten zu beenden"
-#: volta-engraver.cc:151
+#: volta-engraver.cc:123
msgid "Already have a volta spanner. Stopping that one prematurely."
-msgstr "Habe bereits einen Wiederholungskasten. Beende diesen frühzeitig."
+msgstr "Habe bereits einen Wiederholungskasten. Beende diesen frühzeitig."
-#: volta-engraver.cc:155
+#: volta-engraver.cc:127
msgid "Also have a stopped spanner. Giving up."
msgstr "Habe auch einen beendeten Kasten. Gebe auf."
-#: parser.yy:114
-msgid "Tag must be symbol or list of symbols."
-msgstr "Markierung muss Symbol oder Liste von Symbolen sein."
-
-#: parser.yy:513
+#: parser.yy:480
msgid "Identifier should have alphabetic characters only"
msgstr "Ein Bezeichner sollte nur aus alphabetischen Zeichen bestehen"
-#: parser.yy:776
+#: parser.yy:779
msgid "More alternatives than repeats. Junking excess alternatives."
-msgstr "Mehr Alternativen als Wiederholungen. Verwerfe überschüssige Alternativen."
-
-#: parser.yy:857 parser.yy:864
-msgid "\\applycontext takes function argument"
-msgstr "\\applycontext benötigt Funktionsargument"
+msgstr "Mehr Alternativen als Wiederholungen. Verwerfe überschüssige Alternativen."
-#: parser.yy:1014
-msgid "\\apply takes function argument"
-msgstr "\\apply benötigt Funktionsargument"
+#: parser.yy:861 parser.yy:868
+msgid "\applycontext takes function argument"
+msgstr "\applycontext benötigt Funktionsargument"
-#: parser.yy:1377
-msgid "Can't find music"
-msgstr "Musik kann nicht gefunden werden"
+#: parser.yy:877
+msgid "Second argument must be a symbol"
+msgstr "Das zweite Argument muss ein Symbol sein"
-#: parser.yy:1495
-msgid "Second argument must be pitch list."
-msgstr "Das zweite Argument muss eine Tonhöhenliste sein."
+#: parser.yy:882
+msgid "First argument must be a procedure taking one argument"
+msgstr "Das erste Argument muss eine Prozedur sein, welche ein Argument erwartet"
-#: parser.yy:1532 parser.yy:1537 parser.yy:2070
-msgid "Have to be in Lyric mode for lyrics"
-msgstr "Muss in Liedtextmodus sein um Liedtext setzen zu können"
+#: parser.yy:1009
+msgid "\apply takes function argument"
+msgstr "\apply benötigt Funktionsargument"
-#: parser.yy:1622
+#: parser.yy:1501
msgid "Expecting string as script definition"
msgstr "Erwarte String als Skriptdefinition"
-#: parser.yy:1829 parser.yy:1884
+#: parser.yy:1598
+msgid "Expecting musical-pitch value"
+msgstr "Erwarte musikalischen Tonhöhenwert"
+
+#: parser.yy:1609
+msgid "Must have duration object"
+msgstr "Brauche Dauer-Objekt"
+
+#: parser.yy:1618 parser.yy:1626
+msgid "Have to be in Lyric mode for lyrics"
+msgstr "Muss in Liedtextmodus sein um Liedtext setzen zu können"
+
+#: parser.yy:1798 parser.yy:1853
#, c-format
msgid "not a duration: %d"
-msgstr "keine gültige Dauer: %d"
+msgstr "keine gültige Dauer: %d"
-#: parser.yy:1980
+#: parser.yy:1949
msgid "Have to be in Note mode for notes"
-msgstr "Muss im Notenmodus sein, um Noten setzen zu können"
+msgstr "Muss im Notenmodus sein um Noten setzen zu können"
-#: parser.yy:2085
+#: parser.yy:2032
msgid "Have to be in Chord mode for chords"
-msgstr "Muss im Akkordmodus sein, um Akkorde setzen zu können"
+msgstr "Muss im Akkordmodus sein um Akkorde setzen zu können"
-#: parser.yy:2232
+#: parser.yy:2171
msgid "need integer number arg"
-msgstr "benötige ein Ganzzahlargument"
+msgstr "benötige ein Ganzzahlargument"
-#: parser.yy:2383
+#: parser.yy:2316
msgid "Suspect duration found following this beam"
-msgstr "Fehlerverdächtige Dauer nach diesem Balken gefunden"
+msgstr "Fehlerverdächtige Dauer nach diesem Balken gefunden"
-#: lexer.ll:184
-#, c-format
-msgid "input renamed to: `%s'"
-msgstr "Eingabe umbenannt in `%s'"
-
-#: lexer.ll:210
+#: lexer.ll:186
msgid "EOF found inside a comment"
msgstr "EOF innerhalb eines Kommentares gefunden"
-#: lexer.ll:225
-msgid "\\maininput not allowed outside init files"
-msgstr "\\maininput ist außerhalb von Init-Dateien nicht erlaubt"
+#: lexer.ll:200
+msgid "\\maininput disallowed outside init files"
+msgstr "\\maininput ist außerhalb von Init-Dateien nicht erlaubt"
-#: lexer.ll:249
+#: lexer.ll:224
#, c-format
msgid "wrong or undefined identifier: `%s'"
-msgstr "falscher oder ungültiger Bezeichner: `%s'"
+msgstr "falscher oder ungültiger Bezeichner: `%s'"
#. backup rule
-#: lexer.ll:258
+#: lexer.ll:233
msgid "Missing end quote"
-msgstr "Fehlendes schließendes Anführungszeichen"
+msgstr "Fehlendes schließendes Anführungszeichen"
+
+#. backup rule
+#: lexer.ll:255 lexer.ll:259
+msgid "white expected"
+msgstr "weiß erwartet"
+
+#: lexer.ll:268
+msgid "Can't evaluate Scheme in safe mode"
+msgstr "Kann Schema nicht im Sicherheitsmodus auswerten"
-#: lexer.ll:400
+#: lexer.ll:397 lexer.ll:487
msgid "Brace found at end of lyric. Did you forget a space?"
msgstr "Klammer am Ende von Liedtext gefunden. Haben Sie ein Leerzeichen vergessen?"
-#: lexer.ll:501
-msgid "Brace found at end of markup. Did you forget a space?"
-msgstr "Klammer am Ende des Auszugs gefunden. Haben Sie ein Leerzeichen vergessen?"
-
-#: lexer.ll:584
+#: lexer.ll:574
#, c-format
msgid "invalid character: `%c'"
-msgstr "Ungültiges Zeichen: `%c'"
+msgstr "Ungültiges Zeichen: `%c'"
-#: lexer.ll:656 lexer.ll:657
+#: lexer.ll:651
#, c-format
msgid "unknown escaped string: `\\%s'"
-msgstr "Ungültige Fluchtsequenz: `\\%s'"
+msgstr "Ungültige Fluchtsequenz: `\\%s'"
-#: lexer.ll:754 lexer.ll:755
+#: lexer.ll:742
#, c-format
msgid "Incorrect lilypond version: %s (%s, %s)"
msgstr "Falsche lilypond Version: %s (%s, %s)"
-#: lexer.ll:755 lexer.ll:756
+#: lexer.ll:743
msgid "Consider updating the input with the convert-ly script"
-msgstr "Erwägen Sie die Aktualisierung der Eingabe mit dem Skript convert-ly"
-
-#~ msgid " 1998--2003"
-#~ msgstr "1998--2003"
-
-#~ msgid "write ouput to FILE"
-#~ msgstr "Ausgabe in DATEI schreiben"
-
-#~ msgid " 2001--2003"
-#~ msgstr " 2001--2003"
-
-#~ msgid ""
-#~ "\n"
-#~ "Distributed under terms of the GNU General Public License. It comes with\n"
-#~ "NO WARRANTY."
-#~ msgstr ""
-#~ "\n"
-#~ "Vertrieben unter den Bedingungen der GNU General Public License\n"
-#~ "und ohne GEWÄHRLEISTUNG."
-
-#~ msgid "unknown accidental typesetting: %s. Ignored"
-#~ msgstr "Unbekanntes Vorzeichen: %s. Ignoriert"
-
-#~ msgid "Symbol is not a parent context: %s. Ignored"
-#~ msgstr "Symbol ist kein Elternkontext: %s. Ignoriert"
-
-#~ msgid "can't find character number: %d"
-#~ msgstr "Zeichennummer kann nicht gefunden werden: %d"
-
-#~ msgid "can't find character called: `%s'"
-#~ msgstr "Zeichen kann nicht gefunden werden: `%s'"
-
-#~ msgid "Beam has less than two stems. Removing beam."
-#~ msgstr "Balken hat weniger als zwei Notenhälse. Notenhals wird entfernt."
-
-#~ msgid "Not sure that we can find a nice beam slope (no viable initial configuration found)."
-#~ msgstr "Es kann wahrscheinlich keine optimale Balkenneigung ermittelt werden (keine funktionsfähige Anfangskonfiguration gefunden)"
-
-#~ msgid "Nothing to connect extender to on the left. Ignoring extender event."
-#~ msgstr "Nichts vorhanden, um die Erweiterung nach links zu verbinden. Erweiterungsanforderung wird ignoriert."
-
-#~ msgid "couldn't find any font satisfying "
-#~ msgstr "konnte keine passende Schriftart finden für "
-
-#~ msgid ""
-#~ "Skipped something?\n"
-#~ "Grob %s ended before I expected it to end."
-#~ msgstr ""
-#~ "Etwas übersehen?\n"
-#~ "Grob %s endet, bevor dies erwartet wurde."
-
-#~ msgid "Nothing to connect hyphen to on the left. Ignoring hyphen event."
-#~ msgstr "Nichts vorhanden, um den Bindestrich nach links zu verbinden. Bindestrichanforderung wird ignoriert."
-
-#~ msgid "Score contains errors; will not process it"
-#~ msgstr "Noten enthalten Fehler; keine weitere Verarbeitung"
-
-#~ msgid "lyrics found without any matching notehead"
-#~ msgstr "Liedtext ohne passenden Notenkopf gefunden"
-
-#~ msgid "Huh? Melismatic note found to have associated lyrics."
-#~ msgstr "Hä? Melismatische Note ohne assoziierten Liedtext gefunden."
-
-#~ msgid "inhibit file output naming and exporting"
-#~ msgstr "Dateiausgabe-Benennung und -Export wird verhindert"
-
-#~ msgid ""
-#~ "LilyPond is a music typesetter. It produces beautiful sheet music\n"
-#~ "using a high level description file as input. LilyPond is part of \n"
-#~ "the GNU Project.\n"
-#~ msgstr ""
-#~ "LilyPond ist ein Musiksatzprogramm. Es erzeugt ansprechende Notenblätter\n"
-#~ "mit Hilfe einer Hochsprachen-Beschreibungsdatei als Eingabe. LilyPond\n"
-#~ "ist ein Teil des GNU-Projektes.\n"
-
-#~ msgid "GNU LilyPond -- The music typesetter"
-#~ msgstr "GNU LilyPond -- Das Musiksatzprogramm"
-
-#~ msgid "Mensural_ligature:thickness undefined on flexa %d; assuming 1.4"
-#~ msgstr "Mensural_ligature: Dicke undefiniert bei flexa %d; nehme 1.4 an"
-
-#~ msgid "Mensural_ligature:delta-pitch undefined on flexa %d; assuming 0"
-#~ msgstr "Mensural_ligature: delta-pitch undefiniert bei flexa %d; nehme 0 an"
-
-#~ msgid "Mensural_ligature:flexa-width undefined on flexa %d; assuming 2.0"
-#~ msgstr "Mensural_ligature: flexa-width undefiniert bei flexa %d; nehme 2.0 an"
-
-#~ msgid "silly duration"
-#~ msgstr "sinnlose Dauer"
-
-#~ msgid "Outputting Score, defined at: "
-#~ msgstr "Notenausgabe, definiert bei: "
-
-#~ msgid "I'm one myself: `%s'"
-#~ msgstr "Ich bin selbst einer: '%s'"
-
-#~ msgid "none of these in my family: `%s'"
-#~ msgstr "Keiner davon befindet sich in meiner Familie: `%s'"
-
-#~ msgid "from musical definition: %s"
-#~ msgstr "von der musikalischen Vorgabe: %s"
-
-#~ msgid "unterminated pedal bracket"
-#~ msgstr "unbegrenzte Pedalklammer"
-
-#~ msgid "Errors found/*, not processing score*/"
-#~ msgstr "Fehler gefunden/*, die Noten werden nicht verarbeitet*/"
-
-#~ msgid "staff symbol: indentation yields beyond end of line"
-#~ msgstr "Staff_symbol: Einrückung reicht über das Zeilenende hinaus"
-
-#~ msgid "Error syncing file (disk full?)"
-#~ msgstr "Datei konnte nicht synchronisiert (geschrieben) werden. (Platte voll?)"
-
-#~ msgid "No ties were created!"
-#~ msgstr "Es wurden keine Bindebögen erzeugt!"
-
-#~ msgid "Already contains: `%s'"
-#~ msgstr "Bereits enthalten: `%s'"
-
-#~ msgid "Not adding translator: `%s'"
-#~ msgstr "Füge Übersetzer `%s' nicht hinzu"
-
-#~ msgid "Vaticana_ligature:thickness undefined; assuming 1.4"
-#~ msgstr "Vaticana_ligature: Dicke undefiniert; 1.4 wird angenommen"
-
-#~ msgid "Vaticana_ligature:x-offset undefined; assuming 0.0"
-#~ msgstr "Vaticana_ligature: x-offset undefiniert; 0.0 wird angenommen"
-
-#~ msgid "Vaticana_ligature:delta-pitch -> ignoring join"
-#~ msgstr "Vaticana_ligature:delta-pitch -> Kombination wird ignoriert"
-
-#~ msgid "First argument must be a procedure taking one argument"
-#~ msgstr "Das erste Argument muss eine Prozedur sein, welche ein Argument erwartet"
-
-#~ msgid "Expecting musical-pitch value"
-#~ msgstr "Erwarte musikalischen Tonhöhenwert"
-
-#~ msgid "Must have duration object"
-#~ msgstr "Brauche Dauer-Objekt"
-
-#~ msgid "white expected"
-#~ msgstr "weiß erwartet"
-
-#~ msgid "Can't evaluate Scheme in safe mode"
-#~ msgstr "Kann Schema nicht im Sicherheitsmodus auswerten"
+msgstr "Erwägen Sie die Aktualisierung der Eingabe mit dem Skript convert-ly"
#~ msgid "Run LilyPond using LaTeX for titling"
#~ msgstr "LilyPond zum Kacheln mit LaTeX aufrufen"
#~ msgid "Fetch and rebuild from latest source package"
-#~ msgstr "Holen Sie das neueste Quelltextpaket und bauen Sie neu"
+#~ msgstr "Hole neuestes Quelltextpaket und baue neu"
#~ msgid "unpack and build in DIR [%s]"
#~ msgstr "Auspacken und bauen in VERZ [%s]"
#~ msgid "execute COMMAND, subtitute:"
-#~ msgstr "KOMMANDO ausführen, ersetzen:"
+#~ msgstr "KOMMANDO ausführen, ersetzen:"
#~ msgid "%b: build root"
#~ msgstr "%b: Arbeitsverzeichnis"
#~ msgstr "Bei Misserfolg EMAIL[,EMAIL] benachrichtgen"
#~ msgid "remove previous build"
-#~ msgstr "Vorheriges Kompilat löschen"
+#~ msgstr "Vorheriges Kompilat löschen"
#~ msgid "fetch and build URL [%s]"
-#~ msgstr "URL [%s] holen und bauen"
+#~ msgstr "Hole und baue URL [%s]"
+
+#~ msgid "Listing `%s'..."
+#~ msgstr "Liste `%s' auf..."
#~ msgid "latest is: %s"
#~ msgstr "Neuestes ist: %s"
+#~ msgid "relax, %s is up to date"
+#~ msgstr "Seien Sie unbesorgt, %s ist auf dem neuesten Stand"
+
#~ msgid "Fetching `%s'..."
-#~ msgstr "`%s' wird geholt..."
+#~ msgstr "Hole `%s'..."
#~ msgid "Building `%s'..."
-#~ msgstr "`%s' wird gebaut..."
+#~ msgstr "Baue `%s'..."
#~ msgid "invalid subtraction: not part of chord: %s"
-#~ msgstr "ungültige Subtraktion: nicht Teil des Akkordes: %s"
+#~ msgstr "ungültige Subtraktion: nicht Teil des Akkordes: %s"
#~ msgid "invalid inversion pitch: not part of chord: %s"
-#~ msgstr "ungültige Umkehrungstonhöhe: nicht Teil des Akkordes: %s"
+#~ msgstr "ungültige Umkehrungstonhöhe: nicht Teil des Akkordes: %s"
#~ msgid "This was the other key definition."
#~ msgstr "Das war die andere Tonartdefinition"
#~ msgstr ", bei "
#~ msgid "Pitch arguments out of range"
-#~ msgstr "Tonhöhenargumente außerhalb des Wertebereiches"
+#~ msgstr "Tonhöhenargumente außerhalb des Wertebereiches"
#~ msgid "(left_head == 0)"
#~ msgstr "(left_head == 0)"
#~ msgstr "undefinierter right_head"
#~ msgid "junking lonely porrectus"
-#~ msgstr "einsames Porrectus wird ignoriert"
+#~ msgstr "ignoriere einsamen Porrectus"
#~ msgid "porrectus style undefined; using mensural"
-#~ msgstr "Porrectus-Stil undefiniert; Mensuralnotation wird verwendet"
+#~ msgstr "Porrectus-Stil undefiniert; verwende Mensuralnotation"
#~ msgid "stack size cur %d, max %d\n"
-#~ msgstr "Kellergröße: %d, maximal %d\n"
+#~ msgstr "Kellergröße: %d, maximal %d\n"
#~ msgid "Putting slur over rest."
-#~ msgstr "Platziere Bogen über der Pause."
+#~ msgstr "Platziere Bogen über der Pause."
#~ msgid "Slur over rest?"
-#~ msgstr "Bogen über der Pause?"
+#~ msgstr "Bogen über der Pause?"
#~ msgid "Text_spanner too small"
#~ msgstr "Textklammer zu klein"
#~ msgid "Can't specify direction for this request"
-#~ msgstr "Es kann keine Richtung für diese Anforderung angegeben werden"
-
-#~ msgid ""
-#~ "\n"
-#~ "Renamed input to `%s'\n"
-#~ msgstr ""
-#~ "\n"
-#~ "Eingabe `%s' umbenannt\n"
+#~ msgstr "Kann keine Richtung für diese Anforderung angeben"
#
msgid ""
msgstr ""
-"Project-Id-Version: lilypond 2.3.1\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2004-04-15 23:37+0300\n"
+"Project-Id-Version: lilypond 1.7.27\n"
+"POT-Creation-Date: 2003-07-23 0:40+0300\n"
"PO-Revision-Date: 2003-07-23 13:37+0300\n"
"Last-Translator: Heikki Junes <hjunes@cc.hut.fi>\n"
"Language-Team: Finnish <fi@li.org>\n"
"Content-Type: text/plain; charset=ISO-8859-1\n"
"Content-Transfer-Encoding: 8bit\n"
+#. this is where special info is often stored
+#. ###############################################################
+#. lilylib.py -- options and stuff
+#.
+#. source file of the GNU LilyPond music typesetter
+#.
+#. (c) 1998--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+#. Jan Nieuwenhuizen <janneke@gnu.org>
+#. ## subst:\(^\|[^._a-z]\)\(abspath\|identify\|warranty\|progress\|warning\|error\|exit\|getopt_args\|option_help_str\|options_help_str\|help\|setup_temp\|read_pipe\|system\|cleanup_temp\|strip_extension\|cp_to_dir\|mkdir_p\|init\) *(
+#. ## replace:\1ly.\2 (
+#. ## subst: \(help_summary\|keep_temp_dir_p\|option_definitions\|original_dir\|program_name\|pseudo_filter_p\|temp_dir\|verbose_p\)
+#. ###############################################################
+#. Users of python modules should include this snippet
+#. and customize variables below.
+#. We'll suffer this path init stuff as long as we don't install our
+#. python packages in <prefix>/lib/pythonx.y (and don't kludge around
+#. it as we do with teTeX on Red Hat Linux: set some environment var
+#. (PYTHONPATH) in profile)
+#. If set, LILYPONDPREFIX must take prevalence
+#. if datadir is not set, we're doing a build and LILYPONDPREFIX
+#. Customize these
+#. lilylib globals
#: lilylib.py:60
msgid "lilylib module"
msgstr "lilylib moduuli"
-#: lilylib.py:63 lilypond-book.py:84 lilypond.py:108 midi2ly.py:100
-#: mup2ly.py:75 main.cc:127
+#: lilylib.py:63 lilypond-book.py:131 lilypond.py:128 midi2ly.py:100
+#: mup2ly.py:75 main.cc:111
msgid "print this help"
-msgstr "näytä tämä opaste"
+msgstr "näytä tämä opastus"
-#: lilylib.py:110 midi2ly.py:136 mup2ly.py:130
-#, python-format
+#. ###############################################################
+#. Handle bug in Python 1.6-2.1
+#.
+#. there are recursion limits for some patterns in Python 1.6 til 2.1.
+#. fix this by importing pre instead. Fix by Mats.
+#. Attempt to fix problems with limited stack size set by Python!
+#. Sets unlimited stack size. Note that the resource module only
+#. is available on UNIX.
+#: lilylib.py:114 midi2ly.py:136 mup2ly.py:130 main.cc:188 main.cc:200
+#, c-format, python-format
msgid "Copyright (c) %s by"
msgstr "Copyright (c) %s by"
-#: lilylib.py:114 midi2ly.py:141 mup2ly.py:135
+#: lilylib.py:114
+msgid " 1998--2003"
+msgstr "1998--2003"
+
+#: lilylib.py:118
msgid "Distributed under terms of the GNU General Public License."
msgstr "Levitettävissä ehdoilla GNU General Public License."
-#: lilylib.py:116 midi2ly.py:142 mup2ly.py:136
+#: lilylib.py:120
msgid "It comes with NO WARRANTY."
msgstr "Se toimitetaan ILMAN TAKUUTA."
-#: lilylib.py:123 warn.cc:25
-msgid "warning: %s"
-msgstr "varoitus: %s"
+#: lilylib.py:127 midi2ly.py:150 mup2ly.py:144 input.cc:88
+msgid "warning: "
+msgstr "varoitus: "
-#: lilylib.py:126 warn.cc:31
-msgid "error: %s"
-msgstr "virhe: %s"
+#. lots of midi files use plain text for lyric events
+#. FIXME: read from stdin when files[0] = '-'
+#: lilylib.py:130 midi2ly.py:165 midi2ly.py:1018 midi2ly.py:1083 mup2ly.py:147
+#: mup2ly.py:161 input.cc:93
+msgid "error: "
+msgstr "virhe: "
-#: lilylib.py:130
+#: lilylib.py:134
#, python-format
msgid "Exiting (%d)..."
msgstr "Lopetetaan (%d)..."
-#: lilylib.py:190 midi2ly.py:223 mup2ly.py:219
+#: lilylib.py:194 midi2ly.py:224 mup2ly.py:220
#, python-format
msgid "Usage: %s [OPTIONS]... FILE"
msgstr "Käyttö: %s [OPTIOT]... TIEDOSTO"
-#: lilylib.py:194 midi2ly.py:227 mup2ly.py:223 main.cc:190
-#, c-format
+#: lilylib.py:198 midi2ly.py:228 mup2ly.py:224 main.cc:166
msgid "Options:"
msgstr "Optiot:"
-#: lilylib.py:198 midi2ly.py:231 mup2ly.py:227 main.cc:194
+#: lilylib.py:202 midi2ly.py:232 mup2ly.py:228 main.cc:172
#, c-format, python-format
msgid "Report bugs to %s."
msgstr "Raportoi virheet osoitteeseen %s."
-#: lilylib.py:218
-#, python-format
-msgid "Binary %s has version %s, looking for version %s"
-msgstr "Binääritiedosto %s on versiota %s, etsitään versiota %s"
-
-#: lilylib.py:252
+#: lilylib.py:228
#, python-format
msgid "Opening pipe `%s'"
msgstr "Avataan putki `%s'"
-#: lilylib.py:267 lilypond-book.py:767
+#. successful pipe close returns 'None'
+#: lilylib.py:240
#, python-format
msgid "`%s' failed (%d)"
msgstr "`%s' epäonnistui (%d)"
-#: lilylib.py:272 lilylib.py:331 lilypond-book.py:768 lilypond.py:463
+#: lilylib.py:242 lilylib.py:289 lilypond-book.py:231 lilypond.py:512
msgid "The error log is as follows:"
msgstr "Virheloki on seuraava:"
-#: lilylib.py:303 midi2ly.py:259 mup2ly.py:255
+#: lilylib.py:262 midi2ly.py:260 mup2ly.py:256
#, python-format
msgid "Invoking `%s'"
msgstr "Kutsutaan `%s'"
-#: lilylib.py:305
+#: lilylib.py:264
#, python-format
msgid "Running %s..."
msgstr "Ajetaan %s..."
-#: lilylib.py:324
+#: lilylib.py:282
#, python-format
msgid "`%s' failed (%s)"
msgstr "`%s' epäonnistui (%s)"
-#: lilylib.py:327 midi2ly.py:265 mup2ly.py:263
+#: lilylib.py:285 midi2ly.py:266 mup2ly.py:264
msgid "(ignored)"
msgstr "(sivuutetaan)"
-#: lilylib.py:345 midi2ly.py:275 mup2ly.py:273
+#: lilylib.py:299 midi2ly.py:276 mup2ly.py:274
#, python-format
msgid "Cleaning %s..."
msgstr "Siivotaan pois %s..."
-#: lilylib.py:509
+#. Duh. Python style portable: cp *.EXT OUTDIR
+#. system ('cp *.%s %s' % (ext, outdir), 1)
+#. Python < 1.5.2 compatibility
+#.
+#. On most platforms, this is equivalent to
+#. `normpath(join(os.getcwd()), PATH)'. *Added in Python version 1.5.2*
+#. tex needs lots of memory, more than it gets by default on Debian
+#. TODO: * prevent multiple addition.
+#. * clean TEXINPUTS, MFINPUTS, TFMFONTS,
+#. as these take prevalence over $TEXMF
+#. and thus may break tex run?
+#. $TEXMF is special, previous value is already taken care of
+#. # -sOutputFile does not work with bbox?
+#. # todo:
+#. # have better algorithm for deciding when to crop page,
+#. # and when to show full page
+#: lilylib.py:458
msgid "Removing output file"
msgstr "Poistetaan tulostustiedosto"
-#: lilypond-book.py:69
-msgid ""
-"Process LilyPond snippets in hybrid HTML, LaTeX or texinfo document.\n"
-"Example usage:\n"
-"\n"
-" lilypond-book --filter=\"tr '[a-z]' '[A-Z]'\" BOOK\n"
-" lilypond-book --filter=\"convert-ly --no-version --from=2.0.0 -\" BOOK\n"
-" lilypond-book --process='lilypond-bin -I include' BOOK\n"
-"\n"
-msgstr ""
-"Prosessoi HTML, LaTeX, tai texinfo -documenttiin sisällytetyt LilyPond palaset.\n"
-"Example usage:\n"
-"\n"
-" lilypond-book --filter=\"tr '[a-z]' '[A-Z]'\" BOOK\n"
-" lilypond-book --filter=\"convert-ly --no-version --from=2.0.0 -\" BOOK\n"
-" lilypond-book --process='lilypond-bin -I include' BOOK\n"
-"\n"
+#. !@PYTHON@
+#. once upon a rainy monday afternoon.
+#.
+#. ...
+#.
+#. (not finished.)
+#. ABC standard v1.6: http://www.gre.ac.uk/~c.walshaw/abc2mtex/abc.txt
+#.
+#. Enhancements (Roy R. Rankin)
+#.
+#. Header section moved to top of lilypond file
+#. handle treble, treble-8, alto, and bass clef
+#. Handle voices (V: headers) with clef and part names, multiple voices
+#. Handle w: lyrics with multiple verses
+#. Handle key mode names for minor, major, phrygian, ionian, locrian, aeolian,
+#. mixolydian, lydian, dorian
+#. Handle part names from V: header
+#. Tuplets handling fixed up
+#. Lines starting with |: not discarded as header lines
+#. Multiple T: and C: header entries handled
+#. Accidental maintained until next bar check
+#. Silent rests supported
+#. articulations fermata, upbow, downbow, ltoe, accent, tenuto supported
+#. Chord strings([-^]"string") can contain a '#'
+#. Header fields enclosed by [] in notes string processed
+#. W: words output after tune as abc2ps does it (they failed before)
+#. Enhancements (Laura Conrad)
+#.
+#. Barring now preserved between ABC and lilypond
+#. the default placement for text in abc is above the staff.
+#. %%LY now supported.
+#. \breve and \longa supported.
+#. M:none doesn't crash lily.
+#. Limitations
+#.
+#. Multiple tunes in single file not supported
+#. Blank T: header lines should write score and open a new score
+#. Not all header fields supported
+#. ABC line breaks are ignored
+#. Block comments generate error and are ignored
+#. Postscript commands are ignored
+#. lyrics not resynchronized by line breaks (lyrics must fully match notes)
+#. %%LY slyrics can't be directly before a w: line.
+#. ???
+#. TODO:
+#.
+#. Convert to new chord styles.
+#.
+#. UNDEF -> None
+#.
+#. uGUHGUHGHGUGH
+#. UGH
+#. treble8 is used by abctab2ps; -8va is used by barfly,
+#. and by my patch to abc2ps. If there's ever a standard
+#. about this we'll support that.
+#. find keywork
+#. assume that Q takes the form "Q:1/4=120"
+#. There are other possibilities, but they are deprecated
+#. outf.write ("\t\t\\consists Staff_margin_engraver\n")
+#. pitch manipulation. Tuples are (name, alteration).
+#. 0 is (central) C. Alteration -1 is a flat, Alteration +1 is a sharp
+#. pitch in semitones.
+#. abc to lilypond key mode names
+#. semitone shifts for key mode names
+#. latex does not like naked #'s
+#. latex does not like naked "'s
+#. break lyrics to words and put "'s around words containing numbers and '"'s
+#. escape "
+#. _ causes probs inside ""
+#. _ to ' _ '
+#. split words with -
+#. unless \-
+#. ~ to space('_')
+#. * to to space
+#. latex does not like naked #'s
+#. put numbers and " and ( into quoted string
+#. insure space between lines
+#. title
+#. strip trailing blanks
+#. Meter
+#. KEY
+#. seperate clef info
+#. there may or may not be a space
+#. between the key letter and the mode
+#. ugh.
+#. ugh.
+#. Notes
+#. Origin
+#. Reference Number
+#. Area
+#. History
+#. Book
+#. Composer
+#. Default note length
+#. Voice
+#. Words
+#. vocals
+#. tempo
+#. we use in this order specified accidental, active accidental for bar,
+#. active accidental for key
+#. (num / den) / defaultlen < 1/base
+#. return (str, num,den,dots)
+#. ignore slide
+#. ignore roll
+#. s7m2 input doesnt care about spaces
+#.
+#. remember accidental for rest of bar
+#.
+#. get accidental set in this bar or UNDEF if not set
+#. WAT IS ABC EEN ONTZETTENDE PROGRAMMEERPOEP !
+#. failed; not a note!
+#. escape '#'s
+#.
+#. |] thin-thick double bar line
+#. || thin-thin double bar line
+#. [| thick-thin double bar line
+#. :| left repeat
+#. |: right repeat
+#. :: left-right repeat
+#. |1 volta 1
+#. |2 volta 2
+#. first try the longer one
+#. bracket escape
+#. the nobarlines option is necessary for an abc to lilypond translator for
+#. exactly the same reason abc2midi needs it: abc requires the user to enter
+#. the note that will be printed, and MIDI and lilypond expect entry of the
+#. pitch that will be played.
+#.
+#. In standard 19th century musical notation, the algorithm for translating
+#. between printed note and pitch involves using the barlines to determine
+#. the scope of the accidentals.
+#.
+#. Since ABC is frequently used for music in styles that do not use this
+#. convention, such as most music written before 1700, or ethnic music in
+#. non-western scales, it is necessary to be able to tell a translator that
+#. the barlines should not affect its interpretation of the pitch.
+#. write other kinds of appending if we ever need them.
+#. add comments to current voice
+#. Try nibbling characters off until the line doesn't change.
+#. dump_global (outf)
+#. !@PYTHON@
+#.
+#. convert-ly.py -- Update old LilyPond input files (fix name?)
+#.
+#. source file of the GNU LilyPond music typesetter
+#.
+#. (c) 1998--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+#. Jan Nieuwenhuizen <janneke@gnu.org>
+#. TODO
+#. use -f and -t for -s output
+#. NEWS
+#. 0.2
+#. - rewrite in python
+#. Did we ever have \mudela-version? I doubt it.
+#. lilypond_version_re_str = '\\\\version *\"(.*)\"'
+#. ###########################
+#. need new a namespace
+#. raise FatalConversionError()
+#. need new a namespace
+#. harmful to current .lys
+#. str = re.sub ('\\\\key([^;]+);', '\\\\accidentals \\1;', str)
+#. raise FatalConversionError()
+#. raise FatalConversionError()
+#. raise FatalConversionError()
+#. TODO: lots of other syntax change should be done here as well
+#. Ugh, but meaning of \stemup changed too
+#. maybe we should do \stemup -> \stemUp\slurUp\tieUp ?
+#. I don't know exactly when these happened...
+#. ugh, we loose context setting here...
+#. (lacks capitalisation slur -> Slur)
+#. # dynamic..
+#. TODO: add lots of these
+#. ugh
+#. old fix
+#. Make sure groups of more than one ; have space before
+#. them, so that non of them gets removed by next rule
+#. Only remove ; that are not after spaces, # or ;
+#. Otherwise we interfere with Scheme comments,
+#. which is badbadbad.
+#. 40 ?
+#. ###############################
+#. END OF CONVERSIONS
+#. ###############################
+#. !@PYTHON@
+#. info mostly taken from looking at files. See also
+#. http://lilypond.org/wiki/?EnigmaTransportFormat
+#. This supports
+#.
+#. * notes
+#. * rests
+#. * ties
+#. * slurs
+#. * lyrics
+#. * articulation
+#. * grace notes
+#. * tuplets
+#.
+#. todo:
+#. * slur/stem directions
+#. * voices (2nd half of frame?)
+#. * more intelligent lyrics
+#. * beams (better use autobeam?)
+#. * more robust: try entertainer.etf (freenote)
+#. * dynamics
+#. * empty measures (eg. twopt03.etf from freenote)
+#.
+#. uGUHGUHGHGUGH
+#. notename 0 == central C
+#. represent pitches as (notename, alteration), relative to C-major scale
+#. a fifth up
+#. should cache this.
+#. flag1 isn't all that interesting.
+#. 3: '>',
+#. 18: '\arpeggio' ,
+#. do grace notes.
+#. ugh.
+#. we don't attempt voltas since they fail easily.
+#. and g.repeat_bar == '|:' or g.repeat_bar == ':|:' or g.bracket:
+#. 4 layers.
+#. let's not do this: this really confuses when eE happens to be before a ^text.
+#. if last_tag and last_indices:
+#. etf_file_dict[last_tag][last_indices].append (l)
+#. # do it
+#. staff-spec
+#. should use \addlyrics ?
+#. !@PYTHON@
+#. vim: set noexpandtab:
+#. This is was the idea for handling of comments:
+#. Multiline comments, @ignore .. @end ignore is scanned for
+#. in read_doc_file, and the chunks are marked as 'ignore', so
+#. lilypond-book will not touch them any more. The content of the
+#. chunks are written to the output file. Also 'include' and 'input'
+#. regex has to check if they are commented out.
+#.
+#. Then it is scanned for 'lilypond', 'lilypond-file' and 'lilypond-block'.
+#. These three regex's has to check if they are on a commented line,
+#. % for latex, @c for texinfo.
+#.
+#. Then lines that are commented out with % (latex) and @c (Texinfo)
+#. are put into chunks marked 'ignore'. This cannot be done before
+#. searching for the lilypond-blocks because % is also the comment character
+#. for lilypond.
+#.
+#. The the rest of the rexeces are searched for. They don't have to test
+#. if they are on a commented out line.
+#. ###############################################################
+#. Users of python modules should include this snippet
+#. and customize variables below.
+#. We'll suffer this path init stuff as long as we don't install our
+#. python packages in <prefix>/lib/pythonx.y (and don't kludge around
+#. it as we do with teTeX on Red Hat Linux: set some environment var
+#. (PYTHONPATH) in profile)
+#. If set, LILYPONDPREFIX must take prevalence
+#. if datadir is not set, we're doing a build and LILYPONDPREFIX
+#. Customize these
+#. if __name__ == '__main__':
+#. lilylib globals
+#. temp_dir = os.path.join (original_dir, '%s.dir' % program_name)
+#. urg
+#. # FIXME
+#. # do -P or -p by default?
+#. #help_summary = _ ("Run LilyPond using LaTeX for titling")
+#: lilypond-book.py:120
+msgid "Process LilyPond snippets in hybrid html, LaTeX or texinfo document"
+msgstr "Prossoi LilyPond-osioita sekarakenteisessa html, LaTeX tai texinfo -dokumentissa"
-#. Bug in option parser: --output=foe is taken as an abbreviation
-#. for --output-format.
-#: lilypond-book.py:82 main.cc:126
+#. another bug in option parser: --output=foe is taken as an abbreviation
+#. for --output-format
+#: lilypond-book.py:125 main.cc:110
msgid "EXT"
msgstr "EXT"
-#: lilypond-book.py:82
+#: lilypond-book.py:125
msgid "use output format EXT (texi [default], texi-html, latex, html)"
-msgstr ""
-"tulostusmuotona käytetään formaattia EXT (texi [oletus], texi-html, latex, "
-"html)"
+msgstr "tulostusmuotona käytetään formaattia EXT (texi [oletus], texi-html, latex, html)"
-#: lilypond-book.py:83
-msgid "FILTER"
-msgstr "FILTER"
+#: lilypond-book.py:126 lilypond-book.py:127 lilypond-book.py:129
+#: lilypond-book.py:130
+msgid "DIM"
+msgstr "DIM"
-#: lilypond-book.py:83
-msgid "pipe snippets through FILTER [convert-ly -n -]"
-msgstr "putkita palaset kohteen FILTER läpi [convert-ly -n -]"
+#: lilypond-book.py:126
+msgid "default fontsize for music. DIM is assumed to be in points"
+msgstr "oletusfonttikoko musiikille. DIM ilmoitetaan pisteinä"
-#: lilypond-book.py:85 lilypond-book.py:87 lilypond.py:112 main.cc:129
-msgid "DIR"
-msgstr "HAKEMISTO"
-
-#: lilypond-book.py:85
-msgid "add DIR to include path"
-msgstr "lisää HAKEMISTO hakupolkuun"
+#: lilypond-book.py:127
+msgid "deprecated, use --default-music-fontsize"
+msgstr "vanhentunut, käytä --default-music-fontsize"
-#: lilypond-book.py:86
-msgid "COMMAND"
-msgstr "KOMENTO"
+#: lilypond-book.py:128
+msgid "OPT"
+msgstr "OPT"
-#: lilypond-book.py:86
-msgid "process ly_files using COMMAND FILE..."
-msgstr "prosessoi ly_tiedostot käyttäen komentoa COMMAND FILE..."
+#: lilypond-book.py:128
+msgid "pass OPT quoted to the lilypond command line"
+msgstr "syötä OPT lainausmerkeissä lilypond-komentoriville"
-#: lilypond-book.py:87
-msgid "write output to DIR"
-msgstr "tulosta polkuun HAKEMISTO"
+#: lilypond-book.py:129
+msgid "force fontsize for all inline lilypond. DIM is assumed be to in points"
+msgstr "pakota fonttikoko kullekin LilyPond-osiolle. DIM oletetaan olevan pisteinä"
-#: lilypond-book.py:88 lilypond.py:130 midi2ly.py:105 mup2ly.py:78 main.cc:135
-msgid "be verbose"
-msgstr "tulosta runsaasti käsittelytietoa"
+#: lilypond-book.py:130
+msgid "deprecated, use --force-music-fontsize"
+msgstr "vanhentunut, käytä --force-music-fontsize"
-#: lilypond-book.py:89
-msgid "print version information"
-msgstr "tulosta versioinformaatio"
+#: lilypond-book.py:132 lilypond.py:130 main.cc:113 main.cc:118
+msgid "DIR"
+msgstr "DIR"
-#: lilypond-book.py:90 lilypond.py:132 midi2ly.py:107 mup2ly.py:80 main.cc:136
-msgid "show warranty and copyright"
-msgstr "näytä takuu ja copyright"
+#: lilypond-book.py:132
+msgid "include path"
+msgstr "sisällytä polku"
-#: lilypond-book.py:373
-#, python-format
-msgid "deprecated ly-option used: %s"
-msgstr "vanhentunut ly-optio käytössä: %s"
+#: lilypond-book.py:133
+msgid "write dependencies"
+msgstr "kirjoita riippuvuudet"
-#: lilypond-book.py:374
-#, python-format
-msgid "compatibility mode translation: %s"
-msgstr "yhteensopivuusmuodon käännös: %s"
+#: lilypond-book.py:134
+msgid "PREF"
+msgstr "PREF"
-#: lilypond-book.py:394
-#, python-format
-msgid "ignoring unknown ly option: %s"
-msgstr "sivuutetaan tuntematon ly -optio: %s"
+#: lilypond-book.py:134
+msgid "prepend PREF before each -M dependency"
+msgstr "laita PREF kunkin -M riippuvuuden eteen"
-#: lilypond-book.py:448
-msgid "file not found: %s"
-msgstr "tiedostoa %s ei löydy"
+#: lilypond-book.py:135
+msgid "don't run lilypond"
+msgstr "jätä suorittamatta lilypond"
-#: lilypond-book.py:750
-msgid "Opening filter `%s'"
-msgstr "Avataan filtteri `%s'"
+#: lilypond-book.py:136
+msgid "don't generate pictures"
+msgstr "jätä tuottamatta kuvat"
-#: lilypond-book.py:862
-msgid "cannot determine format for: %s"
-msgstr "ei löytynyt oletusfonttia: %s"
+#: lilypond-book.py:137
+msgid "strip all lilypond blocks from output"
+msgstr "riisu kaikki lilypond -osiot tulostuksesta"
-#: lilypond-book.py:903
-msgid "Output would overwrite input file; use --output."
-msgstr "Tuloste kirjautuisi syötetiedoston päälle; käytä --output."
+#: lilypond-book.py:138 lilypond-book.py:139 lilypond.py:135 lilypond.py:136
+#: midi2ly.py:102 main.cc:114 main.cc:117
+msgid "FILE"
+msgstr "TIEDOSTO"
-#: lilypond-book.py:910
-msgid "Reading %s..."
-msgstr "Luetaan %s..."
+#: lilypond-book.py:138
+msgid "filename main output file"
+msgstr "tiedostonimi päätulostustiedostolle"
-#: lilypond-book.py:924
-msgid "Dissecting..."
-msgstr "Analysoidaan..."
+#: lilypond-book.py:139
+msgid "where to place generated files"
+msgstr "tuotettujen tiedostojen sijoituspaikka"
-#: lilypond-book.py:952
-msgid "Writing snippets..."
-msgstr "Kirjoitetaan palasia..."
+#: lilypond-book.py:140 lilypond.py:137
+msgid "RES"
+msgstr "RES"
-#: lilypond-book.py:957
-msgid "Processing..."
-msgstr "Prosessoidaan..."
+#: lilypond-book.py:141 lilypond.py:138
+msgid "set the resolution of the preview to RES"
+msgstr "aseta esikatselulle tarkkuus RES"
-#: lilypond-book.py:960
-msgid "All snippets are up to date..."
-msgstr "Kaikki palaset on päivitetty"
+#: lilypond-book.py:142 lilypond.py:148 midi2ly.py:105 mup2ly.py:78 main.cc:126
+msgid "be verbose"
+msgstr "ole runsassanainen"
-#: lilypond-book.py:963
-msgid "Compiling %s..."
-msgstr "Kootaan %s..."
+#: lilypond-book.py:143
+msgid "print version information"
+msgstr "tulosta versioinformaatio"
-#: lilypond-book.py:971
-msgid "Processing include: %s"
-msgstr "Prosessoidaan sisällytetävä: %s"
+#: lilypond-book.py:144 lilypond.py:150 midi2ly.py:107 mup2ly.py:80 main.cc:127
+msgid "show warranty and copyright"
+msgstr "näytä takuu ja copyright"
-#: lilypond-book.py:987 lilypond.py:612 midi2ly.py:1017
+#. format specific strings, ie. regex-es for input, and % strings for output
+#. global variables
+#. lilypond_binary = 'valgrind --suppressions=/home/hanwen/usr/src/guile-1.6.supp --num-callers=10 /home/hanwen/usr/src/lilypond/lily/out/lilypond'
+#. only use installed binary when we're installed too.
+#. only use installed binary when we're installed too.
+#. ###############################################################
+#. Dimension handling for LaTeX.
+#.
+#. Ugh. (La)TeX writes progress and error messages on stdout
+#. Redirect to stderr
+#: lilypond-book.py:230
+msgid "LaTeX failed."
+msgstr "LaTeX epäonnistui."
+
+#. URG see lilypond
+#. Convert numeric values, with or without specific dimension, to floats.
+#. Keep other strings
+#. ###############################################################
+#. How to output various structures.
+#. # maybe <hr> ?
+#. Verbatim text is always finished with \n. FIXME: For HTML,
+#. this newline should be removed.
+#. Verbatim text is always finished with \n. FIXME: For HTML,
+#. this newline should be removed.
+#. # Ugh we need to differentiate on origin:
+#. # lilypond-block origin wants an extra <p>, but
+#. # inline music doesn't.
+#. # possibly other center options?
+#. verbatim text is always finished with \n
+#. verbatim text is always finished with \n
+#. verbatim text is always finished with \n
+#. verbatim text is always finished with \n
+#. do some tweaking: @ is needed in some ps stuff.
+#.
+#. ugh, the <p> below breaks inline images...
+#. clumsy workaround for python 2.2 pre bug.
+#. ###############################################################
+#. Recognize special sequences in the input
+#. Warning: This uses extended regular expressions. Tread with care.
+#.
+#. legenda
+#.
+#. (?P<name>regex) -- assign result of REGEX to NAME
+#. *? -- match non-greedily.
+#. (?m) -- multiline regex: make ^ and $ match at each line
+#. (?s) -- make the dot match all characters including newline
+#. why do we have distinction between @mbinclude and @include?
+#. # we'd like to catch and reraise a more
+#. # detailed error, but alas, the exceptions
+#. # changed across the 1.5/2.1 boundary.
+#. ughUGH not original options
+#. First we want to scan the \documentclass line
+#. it should be the first non-comment line.
+#. The only thing we really need to know about the \documentclass line
+#. is if there are one or two columns to begin with.
+#. Then we add everything before \begin{document} to
+#. paperguru.m_document_preamble so that we can later write this header
+#. to a temporary file in find_latex_dims() to find textwidth.
+#. this is not bulletproof..., it checks the first 10 chunks
+#. newchunks.extend (func (m))
+#. python 1.5 compatible:
+#. we have to check for verbatim before doing include,
+#. because we don't want to include files that are mentioned
+#. inside a verbatim environment
+#. ugh fix input
+#. # Hmm, we should hash only lilypond source, and skip the
+#. # %options are ...
+#. # comment line
+#. # todo: include path, but strip
+#. # first part of the path.
+#. format == 'html'
+#. ugh rename
+#. Count sections/chapters.
+#. # TODO: do something like
+#. # this for texinfo/latex as well ?
+#. ugh
+#. fixme: be sys-independent.
+#.
+#. Ugh, fixing up dependencies for .tex generation
+#.
+#. Ugh. (La)TeX writes progress and error messages on stdout
+#. Redirect to stderr
+#. # There used to be code to write .tex dependencies, but
+#. # that is silly: lilypond-book has its own dependency scheme
+#. # to ensure that all lily-XXX.tex files are there
+#. # TODO: put file name in front of texidoc.
+#. #
+#. # what's this? Docme --hwn
+#. #
+#. #docme: why global?
+#. Do It.
+#. should chmod -w
+#: lilypond-book.py:1557 lilypond.py:673 midi2ly.py:1018
#, python-format
msgid "getopt says: `%s'"
msgstr "getopt sanoo: `%s'"
+#. HACK
+#. status = os.system ('lilypond -w')
+#: lilypond-book.py:1630 lilypond.py:777
+msgid "no files specified on command line"
+msgstr "tiedostoja ei määritelty komentorivillä"
+
+#.
+#. Petr, ik zou willen dat ik iets zinvoller deed,
+#. maar wat ik kan ik doen, het verandert toch niets?
+#. --hwn 20/aug/99
+#. !@PYTHON@
+#.
+#. lilypond.py -- Run LilyPond, add titles to bare score, generate printable
+#. document
+#. Invokes: lilypond, latex (or pdflatex), dvips, ps2pdf, gs
+#.
+#. source file of the GNU LilyPond music typesetter
+#.
+#. (c) 1998--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+#. Jan Nieuwenhuizen <janneke@gnu.org>
+#. This is the third incarnation of lilypond.
+#.
+#. Earlier incarnations of lilypond were written by
+#. Jeffrey B. Reed<daboys@austin.rr.com> (Python version)
+#. Jan Arne Fagertun <Jan.A.Fagertun@@energy.sintef.no> (Bourne shell script)
+#.
+#. Note: gettext work best if we use ' for docstrings and "
+#. for gettextable strings.
+#. --> DO NOT USE ''' for docstrings.
+#. ###############################################################
+#. Users of python modules should include this snippet
+#. and customize variables below.
+#. We'll suffer this path init stuff as long as we don't install our
+#. python packages in <prefix>/lib/pythonx.y (and don't kludge around
+#. it as we do with teTeX on Red Hat Linux: set some environment var
+#. (PYTHONPATH) in profile)
+#. If set, LILYPONDPREFIX must take prevalence
+#. if datadir is not set, we're doing a build and LILYPONDPREFIX
+#. Customize these
+#. if __name__ == '__main__':
+#. lilylib globals
#. # FIXME
#. # do -P or -p by default?
#. #help_summary = _ ("Run LilyPond using LaTeX for titling")
-#: lilypond.py:103
-msgid "Run LilyPond, generate printable document."
-msgstr "Aja LilyPond, tuota tulostettava dokumentti."
+#: lilypond.py:121
+msgid "Run LilyPond, add titles, generate printable document."
+msgstr "Aja LilyPond, lisää otsikot, tuota tulostettava dokumentti."
-#: lilypond.py:109
+#: lilypond.py:127 main.cc:115
+msgid "write Makefile dependencies for every input file"
+msgstr "kirjoita Makefile -riippuvuudet kullekin tulostustiedostolle"
+
+#: lilypond.py:129
msgid "print even more output"
msgstr "kirjoita vieläpä enemmän tulostetta"
-#: lilypond.py:110 lilypond.py:117 midi2ly.py:102 main.cc:130 main.cc:132
-msgid "FILE"
-msgstr "TIEDOSTO"
-
-#: lilypond.py:110
-msgid "find pfa fonts used in FILE"
-msgstr "etsi pfa fontit joita käytettiin tiedostossa TIEDOSTO"
-
-#: lilypond.py:111
-msgid "make HTML file with links to all output"
-msgstr "tee HTML -tiedosto johon on linkitetty kaikki tulosteet"
-
-#: lilypond.py:112
+#: lilypond.py:130
msgid "add DIR to LilyPond's search path"
-msgstr "lisää HAKEMISTO LilyPondin hakupolkuun"
+msgstr "lisää DIR LilyPondin hakupolkuun"
-#: lilypond.py:114
+#: lilypond.py:132
#, python-format
msgid "keep all output, output to directory %s.dir"
msgstr "säilytä kaikki tulosteet, kirjoita hakemistoon %s.dir"
-#: lilypond.py:115
+#: lilypond.py:133
msgid "don't run LilyPond"
msgstr "jätä ajamatta LilyPond"
-#: lilypond.py:116 main.cc:131
+#: lilypond.py:134 main.cc:116
msgid "produce MIDI output only"
msgstr "tuota vain MIDI -tuloste"
-#: lilypond.py:117 midi2ly.py:102 mup2ly.py:76 main.cc:132
+#: lilypond.py:135 midi2ly.py:102
msgid "write output to FILE"
msgstr "tulosta tiedostoon TIEDOSTO"
-#: lilypond.py:118
-msgid "RES"
-msgstr "RES"
+#: lilypond.py:136
+msgid "find pfa fonts used in FILE"
+msgstr "etsi pfa fontit joita käytettiin tiedostossa TIEDOSTO"
-#: lilypond.py:119
-msgid "set the resolution of the preview to RES"
-msgstr "aseta esikatselulle tarkkuus RES"
+#: lilypond.py:139
+msgid "generate PostScript output"
+msgstr "tuota PostScript -tuloste"
-#: lilypond.py:120
-msgid "do not generate PDF output"
-msgstr "älä tuota PDF -tulostetta"
+#: lilypond.py:140
+msgid "generate PNG page images"
+msgstr "tuota PNG -kuvat sivuista"
-#: lilypond.py:121
-msgid "do not generate PostScript output"
-msgstr "älä tuota PostScript -tulostetta"
+#: lilypond.py:141
+msgid "generate PS.GZ"
+msgstr "tuota PS.GZ"
-#: lilypond.py:122
+#: lilypond.py:142
msgid "generate PDF output"
msgstr "tuota PDF -tuloste"
-#: lilypond.py:123
-msgid "generate PostScript output"
-msgstr "tuota PostScript -tuloste"
-
# käytä pdflatex:ia tuottaaksesi PDF -tulosteen
-#: lilypond.py:124
-msgid "use pdflatex to generate PDF output"
+#: lilypond.py:143
+msgid "use pdflatex to generate a PDF output"
msgstr "käytä pdflatex:ia tuottaaksesi PDF -tulosteen"
-#: lilypond.py:125
-msgid "generate PNG page images"
-msgstr "tuota PNG -kuvat sivuista"
-
-#: lilypond.py:126
+#. FIXME: preview, picture; to indicate creation of a PNG?
+#: lilypond.py:145
msgid "make a picture of the first system"
msgstr "tee kuva ensimmäisestä kokonaisuudesta"
-#: lilypond.py:127
-msgid "generate PS.GZ"
-msgstr "tuota PS.GZ"
-
-#: lilypond.py:128
-msgid "run in safe-mode"
-msgstr "aja turvamoodissa"
+#: lilypond.py:146
+msgid "make HTML file with links to all output"
+msgstr "tee HTML -tiedosto johon on linkitetty kaikki tulosteet"
-#: lilypond.py:129
+#: lilypond.py:147
msgid "KEY=VAL"
msgstr "KEY=VAL"
-#: lilypond.py:129
+#: lilypond.py:147
msgid "change global setting KEY to VAL"
msgstr "vaihda globaali asetus KEY arvoksi VAL"
-#: lilypond.py:131 midi2ly.py:106 mup2ly.py:79 main.cc:134
+#: lilypond.py:149 midi2ly.py:106 mup2ly.py:79 main.cc:125
msgid "print version number"
msgstr "tulosta versionumero"
-#: lilypond.py:201
+#. other globals
+#. Pdftex support
+#. # yuk.
+#. lilypond_binary = 'valgrind --suppressions=%(home)s/usr/src/guile-1.6.supp --num-callers=10 %(home)s/usr/src/lilypond/lily/out/lilypond '% { 'home' : '/home/hanwen' }
+#. only use installed binary when we're installed too.
+#. init to empty; values here take precedence over values in the file
+#. # TODO: change name.
+#. for geometry v3
+#. Output formats that lilypond should create
+#. what a name.
+#. ly.warning (_ ("invalid value: %s") % `val`)
+#. ly.warning (_ ("invalid value: %s") % `val`)
+#: lilypond.py:232
#, python-format
msgid "no such setting: `%s'"
msgstr "asetusta ei löydy: `%s'"
-#: lilypond.py:245
+#. 2 == user interrupt.
+#: lilypond.py:274
#, python-format
msgid "LilyPond crashed (signal %d)."
msgstr "LilyPond kaatui (signaali %d)."
-#: lilypond.py:246
+#: lilypond.py:275
msgid "Please submit a bug report to bug-lilypond@gnu.org"
msgstr "Ole hyvä ja lähetä virheraportti osoitteeseen bug-lilypond@gnu.org"
-#: lilypond.py:252
+#: lilypond.py:281
#, python-format
msgid "LilyPond failed on input file %s (exit status %d)"
msgstr "LilyPond epäonnistui syöttötiedoston %s kohdalla (lopetustila %d)."
-#: lilypond.py:255
+#: lilypond.py:284
#, python-format
msgid "LilyPond failed on an input file (exit status %d)"
msgstr "LilyPond epäonnistui syöttötiedoston kohdalla (lopetustila %d)."
-#: lilypond.py:256
+#: lilypond.py:285
msgid "Continuing..."
msgstr "Jatketaan..."
-#: lilypond.py:267
+#. urg
+#: lilypond.py:296
#, python-format
msgid "Analyzing %s..."
msgstr "Analysoidaan %s..."
-#: lilypond.py:321
+#. search only the first 10k
+#: lilypond.py:354
#, python-format
msgid "no LilyPond output found for `%s'"
msgstr "`%s' jäi ilman LilyPond -tulostetta"
-#: lilypond.py:462
+#. The final \n seems important here. It ensures that the footers and taglines end up on the right page.
+#. TODO: should set textheight (enlarge) depending on papersize.
+#: lilypond.py:397
+#, python-format
+msgid "invalid value: `%s'"
+msgstr "epäkelpo arvo: `%s'"
+
+#. set sane geometry width (a4-width) for linewidth = -1.
+#. who the hell is 597 ?
+#. Ugh. (La)TeX writes progress and error messages on stdout
+#. Redirect to stderr
+#: lilypond.py:511
msgid "LaTeX failed on the output file."
msgstr "LaTeX epäonnistui tulostustiedossa."
-#: lilypond.py:507
+#. make a preview by rendering only the 1st line
+#. of each score
+#: lilypond.py:568
msgid ""
"Trying create PDF, but no PFA fonts found.\n"
"Using bitmap fonts instead. This will look bad."
"Yritetään tuottaa PDF, mutta PFA fontteja ei löytynyt.\n"
"Käytetään bittikarttafonttejan niiden sijasta. Tulos ei näytä hyvältä."
+#. ugh. Different targets?
+#. Added as functionality to lilypond, because lilypond may well need to do this
+#. in future too.
#. no ps header?
-#: lilypond.py:554
+#: lilypond.py:615
#, python-format
msgid "not a PostScript file: `%s'"
msgstr "ei ole PostScript-tiedosto: `%s'"
-#: lilypond.py:599
+#. todo
+#: lilypond.py:660
#, python-format
msgid "Writing HTML menu `%s'"
msgstr "Kirjoitetan HTML-valikko `%s'..."
-#: lilypond.py:717
+#. signal programming error
+#. Don't convert input files to abspath, rather prepend '.' to include
+#. path.
+#. As a neat trick, add directory part of first input file
+#. to include path. That way you can do without the clumsy -I in:
+#. lilypond -I foe/bar/baz foo/bar/baz/baz.ly
+#: lilypond.py:769
msgid "pseudo filter"
msgstr "valefiltteri"
-#: lilypond.py:720
+#: lilypond.py:772
msgid "pseudo filter only for single input file"
msgstr "valefiltteroi ain yksi tulostetiedosto"
-#: lilypond.py:725
-msgid "no files specified on command line"
-msgstr "tiedostoja ei määritelty komentorivillä"
-
-#: lilypond.py:757
+#. Ugh, maybe make a setup () function
+#. hmmm. Wish I'd 've written comments when I wrote this.
+#. now it looks complicated.
+#: lilypond.py:806
#, python-format
msgid "filename should not contain spaces: `%s'"
msgstr "tiedostoniemessä ei saa olla välilyöntejä: `%s'"
-#: lilypond.py:797
+#. to be sure, add tmpdir *in front* of inclusion path.
+#. os.environ['TEXINPUTS'] = tmpdir + ':' + os.environ['TEXINPUTS']
+#. We catch all exceptions, because we need to do stuff at exit:
+#. * copy any successfully generated stuff from tempdir and
+#. notify user of that
+#. * cleanout tempdir
+#. ## ARGH. This also catches python programming errors.
+#. ## this should only catch lilypond nonzero exit status
+#. ## --hwn
+#. TODO: friendly message about LilyPond setup/failing?
+#.
+#: lilypond.py:845
msgid "Running LilyPond failed. Rerun with --verbose for a trace."
-msgstr ""
-"LilyPond -ajo epäonnistui. Aja uudelleen lisäten --verbose jäljitystä varten."
-
-#: lilypond.py:838
+msgstr "LilyPond -ajo epäonnistui. Aja uudelleen lisäten --verbose jäljitystä varten."
+
+#. Our LilyPond pseudo filter always outputs to 'lelie'
+#. have subsequent stages and use 'lelie' output.
+#. unless: add --tex, or --latex?
+#. TODO: friendly message about TeX/LaTeX setup,
+#. trying to run tex/latex by hand
+#: lilypond.py:886
msgid "Failed to make PS file. Rerun with --verbose for a trace."
-msgstr ""
-"PS -tiedoston tuotto epäonnistui. Aja uudelleen lisäten --verbose "
-"jäljitystä varten."
+msgstr "Epäonnistui PS -tiedoston tuottamisessa. Aja uudelleen lisäten --verbose jäljitystä varten."
-#: lilypond.py:868
-msgid "Running LaTeX failed. Rerun with --verbose for a trace."
-msgstr ""
-"LaTeX -ajo epäonnistui. Aja uudelleen lisäten --verbose jäljitystä varten."
+#. unless: add --tex, or --latex?
+#. TODO: friendly message about TeX/LaTeX setup,
+#. trying to run tex/latex by hand
+#: lilypond.py:916
+msgid "Running LaTeX falied. Rerun with --verbose for a trace."
+msgstr "LaTeX -ajo epäonnistui. Aja uudelleen lisäten --verbose jäljitystä varten."
-#: lilypond.py:882
+#. add DEP to targets?
+#: lilypond.py:926 input-file-results.cc:68
+#, c-format, python-format
+msgid "dependencies output to `%s'..."
+msgstr "riippuvuuksien tulosteet paikkaan `%s'"
+
+#: lilypond.py:937
#, python-format
msgid "%s output to <stdout>..."
msgstr "%s -tuloste paikkaan <stdout>..."
-#: lilypond.py:887 includable-lexer.cc:57 kpath.cc:134 lily-guile.cc:86
-#: my-lily-parser.cc:235
+#: lilypond.py:942 lilypond.py:968 includable-lexer.cc:57
+#: input-file-results.cc:191 input-file-results.cc:197 lily-guile.cc:86
#, c-format, python-format
msgid "can't find file: `%s'"
msgstr "tiedostoa ei löydy: `%s'"
-#: lilypond.py:910
+#. Hmm, if this were a function, we could call it the except: clauses
+#: lilypond.py:965
#, python-format
msgid "%s output to %s..."
msgstr "%s -tuloste paikkaan %s..."
-#: lilypond.py:913
-msgid "can't find file: `%s.%s'"
-msgstr "tiedostoa ei löydy: `%s'"
-
+#. !@PYTHON@
+#.
+#. midi2ly.py -- LilyPond midi import script
+#.
+#. source file of the GNU LilyPond music typesetter
+#.
+#. (c) 1998--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+#. Jan Nieuwenhuizen <janneke@gnu.org>
+#. ###############################################################
+#. Users of python modules should include this snippet.
+#.
+#. This soon to be removed for: import lilypond.lilylib as ly
+#. ###############################################################
+#. ###############################################################
+#. ############### CONSTANTS
+#. ###############################################################
#. temp_dir = os.path.join (original_dir, '%s.dir' % program_name)
#. original_dir = os.getcwd ()
#. keep_temp_dir_p = 0
msgid "treat every text as a lyric"
msgstr "käsittele kaikki tekstit lyriikkana"
-#: midi2ly.py:149 mup2ly.py:143 input.cc:88
-msgid "warning: "
-msgstr "varoitus: "
+#: midi2ly.py:136 mup2ly.py:130
+msgid " 2001--2003"
+msgstr " 2001--2003"
-#: midi2ly.py:164 midi2ly.py:1017 midi2ly.py:1082 mup2ly.py:146 mup2ly.py:160
-#: input.cc:93
-msgid "error: "
-msgstr "virhe: "
+#: midi2ly.py:141 mup2ly.py:135
+msgid ""
+"\n"
+"Distributed under terms of the GNU General Public License. It comes with\n"
+"NO WARRANTY."
+msgstr ""
+"\n"
+"Levitetään ehdolla GNU General Public License\n"
+"ja ilman TAKUUTA."
-#: midi2ly.py:165 mup2ly.py:161
+#: midi2ly.py:166 mup2ly.py:162
msgid "Exiting ... "
msgstr "Lopettaa ... "
-#: midi2ly.py:263 mup2ly.py:260
+#: midi2ly.py:264 mup2ly.py:261
#, python-format
msgid "command exited with value %d"
msgstr "komento lopetettiin tilassa %d"
-#: midi2ly.py:1001
+#. ###############################################################
+#. END Library
+#. ###############################################################
+#. hmm
+#. major scale: do-do
+#. minor scale: la-la (= + 5) '''
+#. By tradition, all scales now consist of a sequence
+#. of 7 notes each with a distinct name, from amongst
+#. a b c d e f g. But, minor scales have a wide
+#. second interval at the top - the 'leading note' is
+#. sharped. (Why? it just works that way! Anything
+#. else doesn't sound as good and isn't as flexible at
+#. saying things. In medieval times, scales only had 6
+#. notes to avoid this problem - the hexachords.)
+#. So, the d minor scale is d e f g a b-flat c-sharp d
+#. - using d-flat for the leading note would skip the
+#. name c and duplicate the name d. Why isn't c-sharp
+#. put in the key signature? Tradition. (It's also
+#. supposedly based on the Pythagorean theory of the
+#. cycle of fifths, but that really only applies to
+#. major scales...) Anyway, g minor is g a b-flat c d
+#. e-flat f-sharp g, and all the other flat minor keys
+#. end up with a natural leading note. And there you
+#. have it.
+#. John Sankey <bf250@freenet.carleton.ca>
+#.
+#. Let's also do a-minor: a b c d e f gis a
+#.
+#. --jcn
+#. as -> gis
+#. des -> cis
+#. ges -> fis
+#. g -> fisis
+#. d -> cisis
+#. a -> gisis
+#. b -> ces
+#. e -> fes
+#. f -> eis
+#. c -> bis
+#. # FIXME: compile fix --jcn
+#. TODO: move space
+#. fis cis gis dis ais eis bis
+#. bes es as des ges ces fes
+#. urg, we should be sure that we're in a lyrics staff
+#. all include ALL_NOTES_OFF
+#. ugh, must set key while parsing
+#. because Note init uses key
+#. Better do Note.calc () at dump time?
+#. last_lyric.clocks = t - last_time
+#. hmm
+#. urg, this will barf at meter changes
+#. urg LilyPond doesn't start at c4, but
+#. remembers from previous tracks!
+#. reference_note = Note (clocks_per_4, 4*12, 0)
+#. must be in \notes mode for parsing \skip
+#: midi2ly.py:1002
#, python-format
msgid "%s output to `%s'..."
msgstr "%s -tuloste paikkaan `%s'..."
-#: midi2ly.py:1032
+#: midi2ly.py:1033
msgid "Example:"
msgstr "Esimerkki:"
-#: midi2ly.py:1082
+#: midi2ly.py:1083
msgid "no files specified on command line."
msgstr "tiedostoja ei annettu komentorivillä."
+#. !@PYTHON@
+#. mup2ly.py -- mup input converter
+#.
+#. source file of the GNU LilyPond music typesetter
+#.
+#. (c) 2001
+#. if set, LILYPONDPREFIX must take prevalence
+#. if datadir is not set, we're doing a build and LILYPONDPREFIX
#: mup2ly.py:70
msgid "Convert mup to LilyPond source."
msgstr "Muunna mup LilyPond-muotoon."
msgid "only pre-process"
msgstr "vain esiprosessointi"
-#: mup2ly.py:1075
+#. Duh. Python style portable: cp *.EXT OUTDIR
+#. system ('cp *.%s %s' % (ext, outdir), 1)
+#. Python < 1.5.2 compatibility
+#.
+#. On most platforms, this is equivalent to
+#. `normpath(join(os.getcwd()), PATH)'. *Added in Python version 1.5.2*
+#. if set, LILYPONDPREFIX must take prevalence
+#. if datadir is not set, we're doing a build and LILYPONDPREFIX
+#. ###############################################################
+#. END Library
+#.
+#. PMX cut and paste
+#.
+#. if not self.entries:
+#. #return '\n'
+#. #ugh ugh
+#. return '\n%s = {}\n\n' % self.idstring ()
+#. ugh
+#. def set_clef (self, letter):
+#. clstr = clef_table[letter]
+#. self.voices[0].add_nonchord (Clef (clstr))
+#. urg
+#. maybe use import copy?
+#. for i in self.pitches:
+#. ch.pitches.append (i)
+#. for i in self.scripts:
+#. ch.scripts.append (i)
+#. http://www.arkkra.com/doc/uguide/contexts.html
+#. #self.current_staffs = []
+#. duh
+#. FIXME: 1?
+#. FIXME: does key play any role in this?
+#. ch = self.current_voices[0].last_chord ()
+#. ch.basic_duration = self.current_voices[0].last_chord ().basic_duration
+#. ugh
+#. ch = self.current_voices[0].last_chord ()
+#. `;' is not a separator, chords end with ';'
+#. mup resets default duration and pitch each bar
+#. ugh: these (and lots more) should also be parsed in
+#. context staff. we should have a class Staff_properties
+#. and parse/set all those.
+#. shortcut: set to official mup maximum (duh)
+#. self.set_staffs (40)
+#: mup2ly.py:1076
#, python-format
msgid "no such context: %s"
msgstr "kontekstia ei ole: %s"
-#: mup2ly.py:1299
+#. hmm
+#. dig this: mup allows ifdefs inside macro bodies
+#. don't do nested multi-line defines
+#. duh: mup is strictly line-based, except for `define',
+#. which is `@' terminated and may span several lines
+#. don't define new macros in unactive areas
+#. To support nested multi-line define's
+#. process_function and macro_name, macro_body
+#. should become lists (stacks)
+#. The mup manual is undetermined on this
+#. and I haven't seen examples doing it.
+#.
+#. don't do nested multi-line define's
+#. writes to stdout for help2man
+#. don't call
+#. identify ()
+#. sys.stdout.flush ()
+#. handy emacs testing
+#. if not files:
+#. files = ['template.mup']
+#: mup2ly.py:1300
#, python-format
msgid "Processing `%s'..."
msgstr "Prosessoidaan `%s'..."
-#: mup2ly.py:1318
+#: mup2ly.py:1319
#, python-format
msgid "Writing `%s'..."
msgstr "Kirjoitetaan `%s'..."
msgid "invalid argument `%s' to option `%s'"
msgstr "epäkelpo argumentti `%s' optiolle `%s'"
+#: warn.cc:25
+#, c-format
+msgid "warning: %s\n"
+msgstr "varoitus: %s\n"
+
+#: warn.cc:31
+#, c-format
+msgid "error: %s\n"
+msgstr "virhe: %s\n"
+
#: warn.cc:44
-msgid "programming error: %s"
-msgstr "ohjelmointivirhe: %s"
+#, c-format
+msgid "programming error: %s (Continuing; cross thumbs)\n"
+msgstr "ohjelmointivirhe: %s (jatketaan; risti kädet)\n"
-#: warn.cc:45
-msgid "Continuing; crossing fingers"
-msgstr "Jatketaan; ristitään kädet"
+#: accidental.cc:202 key-signature-interface.cc:137
+#, c-format
+msgid "accidental `%s' not found"
+msgstr "korotusmerkkiä `%s' ei löydy"
-#: accidental-engraver.cc:167
+#: accidental-engraver.cc:171 new-accidental-engraver.cc:238
#, c-format
msgid "Accidental typesetting list must begin with context-name: %s"
msgstr "Korotusmerkkien ladontalista täytyy alkaa konteksti-nimellä: %s"
-#: accidental-engraver.cc:194
+#: accidental-engraver.cc:196 new-accidental-engraver.cc:263
#, c-format
-msgid "ignoring unknown accidental: %s"
-msgstr "sivutetaan tuntematan etumerkki: %s"
+msgid "unknown accidental typesetting: %s. Ignored"
+msgstr "tuntematan kortusmerkkien ladonta: %s. Sivuutetaan"
-#: accidental-engraver.cc:211
-msgid "Accidental rule must be pair or context-name; Found %s"
+#: accidental-engraver.cc:212 new-accidental-engraver.cc:279
+#, c-format
+msgid "Symbol is not a parent context: %s. Ignored"
+msgstr "Symboli ei ole yläkonteksti: %s. Sivuutetaan"
+
+#: accidental-engraver.cc:215 new-accidental-engraver.cc:282
+#, c-format
+msgid "Accidental typesetting must be pair or context-name: %s"
msgstr "Korotusmerkkien ladonta täytyy olla pari tai konteksti-nimi: %s"
-#: accidental.cc:219 key-signature-interface.cc:139
+#: afm.cc:66
#, c-format
-msgid "accidental `%s' not found"
-msgstr "korotusmerkkiä `%s' ei löydy"
+msgid "can't find character number: %d"
+msgstr "ei löytynyt merkkiä: %d"
+
+#: afm.cc:81
+#, c-format
+msgid "can't find character called: `%s'"
+msgstr "ei löytynyt merkkiä nimeltä: `%s'"
-#: afm.cc:144
+#: afm.cc:142
#, c-format
msgid "Error parsing AFM file: `%s'"
msgstr "Virhe jäsennettäessä AFM-tiedostoa: `%s'"
-#. FIXME: broken sentence
#: all-font-metrics.cc:95
#, c-format
msgid "checksum mismatch for font file: `%s'"
msgid "does not match: `%s'"
msgstr "ei täsmää: `%s'"
-#: all-font-metrics.cc:103
-msgid "Rebuild all .afm files, and remove all .pk and .tfm files."
-msgstr ""
-"Uudista kaikki .afm -tiedosto, ja poista kaikki .pk ja .tfm -tiedostot."
-
-#: all-font-metrics.cc:105
-msgid "Rerun with -V to show font paths."
-msgstr "Aja uudelleen lisäten -V nähdäksesi fonttipolut."
+#: all-font-metrics.cc:102
+msgid " Rebuild all .afm files, and remove all .pk and .tfm files. Rerun with -V to show font paths."
+msgstr " Uudista kaikki .afm -tiedosto, ja poista kaikki .pk ja .tfm -tiedostot. Aja uudelleen lisäten -V nähdäksesi fonttipolut."
-#: all-font-metrics.cc:107
-msgid "A script for removing font-files is delivered with the source-code:"
+#: all-font-metrics.cc:103
+msgid ""
+"A script for removing font-files is delivered with the source-code,\n"
+"in buildscripts/clean-fonts.sh"
msgstr ""
-"Skripti fonttitiedostojen poistamista varten toimitetaan lähdekoodin "
-"mukana:"
+"Skripti fonttitiedostojen poistamista varten toimitetaan lähde-koodin mukaan,\n"
+"tiedostossa buildscripts/clean-fonts.sh"
-#: all-font-metrics.cc:184
+#: all-font-metrics.cc:169
#, c-format
msgid "can't find font: `%s'"
msgstr "ei löytynyt fonttia: `%s'"
-#: all-font-metrics.cc:185
+#: all-font-metrics.cc:170
msgid "Loading default font"
msgstr "Ladataan oletusfontti"
-#: all-font-metrics.cc:200
+#: all-font-metrics.cc:185
#, c-format
msgid "can't find default font: `%s'"
msgstr "ei löytynyt oletusfonttia: `%s'"
-#: all-font-metrics.cc:201 includable-lexer.cc:59 my-lily-parser.cc:229
+#: all-font-metrics.cc:186 includable-lexer.cc:59 input-file-results.cc:192
#, c-format
msgid "(search path: `%s')"
msgstr "(hakupolku: `%s')"
-#: all-font-metrics.cc:202
+#: all-font-metrics.cc:187
msgid "Giving up"
msgstr "Luovutetaan"
-#: auto-change-iterator.cc:62 change-iterator.cc:61
+#: auto-change-iterator.cc:43 change-iterator.cc:60
+#: part-combine-music-iterator.cc:120
msgid "Can't switch translators, I'm there already"
-msgstr "Ei voitu muuttaa kääntäjää, sellainen on jo valittuna"
+msgstr "Ei voitu muuttaa kääntää, on jo valittuna"
-#: bar-check-iterator.cc:68
+#: bar-check-iterator.cc:51
#, c-format
msgid "barcheck failed at: %s"
msgstr "tahtiviivan tarkistus epäonnistui kohdassa: %s"
-#: beam-engraver.cc:139
+#: beam.cc:146
+msgid "beam has less than two visible stems"
+msgstr "palkissa on vähemmän kuin kaksi pystyviivaa"
+
+#: beam.cc:151
+msgid "Beam has less than two stems. Removing beam."
+msgstr "Palkissa on vähemmän kuin kaksi pystyviivaa. Poistetaan palkki."
+
+#: beam.cc:976
+msgid "Not sure that we can find a nice beam slope (no viable initial configuration found)."
+msgstr "Ei ole varma löydetäänko sopivaa palkin kaltevuutta (ei löytynyt toimivaa alkuasetusta)"
+
+#: beam-engraver.cc:176
msgid "already have a beam"
msgstr "palkki löytyi jo"
-#: beam-engraver.cc:212
+#: beam-engraver.cc:259
msgid "unterminated beam"
msgstr "päättymätön palkki"
-#: beam-engraver.cc:245 chord-tremolo-engraver.cc:179
+#: beam-engraver.cc:292 chord-tremolo-engraver.cc:197
msgid "stem must have Rhythmic structure"
msgstr "varrella on oltava Rhytmic -rakenne"
-#: beam-engraver.cc:259
+#: beam-engraver.cc:306
msgid "stem doesn't fit in beam"
msgstr "varsi ei sovi palkkiin"
-#: beam-engraver.cc:260
+#: beam-engraver.cc:307
msgid "beam was started here"
msgstr "palkki aloitettiin täältä"
-#: beam.cc:151
-msgid "beam has less than two visible stems"
-msgstr "palkissa on vähemmän kuin kaksi näkyvää pystyviivaa"
-
-#: beam.cc:156
-msgid "removing beam with less than two stems"
-msgstr "poistetaan palkki jolla olisi vähemmän kuin kaksi pystyviivaa"
-
-#: beam.cc:1040
-msgid "no viable initial configuration found: may not find good beam slope"
-msgstr "toimivaa alkuasettelua ei löytynyt: hyvää palkkikaltevuuta ei löytyne"
-
-#: break-align-interface.cc:214
+#: break-align-interface.cc:173
#, c-format
msgid "No spacing entry from %s to `%s'"
msgstr "Ei välistyksen syöttöä paikasta %s paikkaan `%s'"
#. We could change the current translator's id, but that would make
#. errors hard to catch
#.
-#. last->translator_id_string () = get_change ()->change_to_id_string ();
+#. last->translator_id_string_ = get_change ()->change_to_id_string_;
#.
-#: change-iterator.cc:93
+#: change-iterator.cc:79
msgid "I'm one myself"
msgstr "Olen yksinäni"
-#: change-iterator.cc:96
+#: change-iterator.cc:82
msgid "none of these in my family"
msgstr "ei yksikään näistä perheessäni"
-#: chord-tremolo-engraver.cc:100
+#: chord-tremolo-engraver.cc:98
#, c-format
msgid "Chord tremolo with %d elements. Must have two elements."
msgstr "Sointutremolo %d:lla elementillä. Täytyy olla kaksi elementtiä."
-#: chord-tremolo-engraver.cc:141
+#: chord-tremolo-engraver.cc:157
msgid "unterminated chord tremolo"
msgstr "päättymätön sointutremolo"
-#: chord-tremolo-iterator.cc:64
+#: chord-tremolo-iterator.cc:69
msgid "no one to print a tremolos"
-msgstr "tremoloa ei voitu tulostaa"
+msgstr "ei ketään joka voisi tulostaan tremolon"
#: clef.cc:64
#, c-format
msgid "clef `%s' not found"
msgstr "avainta `%s' ei löydy"
-#: cluster.cc:123
+#: cluster.cc:131
#, c-format
msgid "unknown cluster style `%s'"
msgstr "tuntematon klusterityyli: `%s'"
#: coherent-ligature-engraver.cc:139
#, c-format
msgid "Coherent_ligature_engraver: setting `spacing-increment = 0.01': ptr=%ul"
-msgstr ""
-"Coherent_ligature_engraver: asetetaan `spacing-increment = 0.01': ptr=%ul"
-
-#: context-def.cc:115
-msgid "Program has no such type: `%s'"
-msgstr "Ohjelmalla ei ole sellaista tyyppiä: `%s'"
+msgstr "Coherent_ligature_engraver: asetetaan `spacing-increment = 0.01': ptr=%ul"
-#: context-def.cc:316
-#, c-format
-msgid "can't find: `%s'"
-msgstr "ei löytynyt `%s'"
-
-#: context.cc:164
-msgid "Cannot find or create `%s' called `%s'"
-msgstr "ei löydetty tai ei luotu `%s' nimeltä `%s'"
-
-#: context.cc:201
-#, c-format
-msgid "can't find or create: `%s'"
-msgstr "ei löydetty tai ei luotu: `%s'"
-
-#: custos.cc:85
+#: custos.cc:92
#, c-format
msgid "custos `%s' not found"
msgstr "custos `%s' ei löytynyt"
msgid "NaN"
msgstr "NaN"
-#: dynamic-engraver.cc:183 span-dynamic-performer.cc:86
+#: dynamic-engraver.cc:204 span-dynamic-performer.cc:82
msgid "can't find start of (de)crescendo"
msgstr "ei löytynyt alkua (de)crescendolle"
-#: dynamic-engraver.cc:193
-msgid "already have a decrescendo"
-msgstr "decresendo jo käytössä"
-
-#: dynamic-engraver.cc:195
+#: dynamic-engraver.cc:216
msgid "already have a crescendo"
msgstr "crescendo jo käytössä"
-#: dynamic-engraver.cc:198
+#: dynamic-engraver.cc:217
+msgid "already have a decrescendo"
+msgstr "decresendo jo käytössä"
+
+#: dynamic-engraver.cc:220
msgid "Cresc started here"
msgstr "Cresc aloitettiin tästä"
-#: dynamic-engraver.cc:305
+#: dynamic-engraver.cc:323
msgid "unterminated (de)crescendo"
msgstr "päätymätön (de)crescendo"
-#: event-chord-iterator.cc:56 output-property-music-iterator.cc:29
-#, c-format
-msgid "Junking event: `%s'"
-msgstr "Hylätään tapahtuma: `%s'"
-
#: event.cc:49
#, c-format
msgid "Transposition by %s makes alteration larger than two"
msgstr "Transponointi %s tekee muutokset suuremmaksi kuin kaksi"
-#: event.cc:72
+#: event-chord-iterator.cc:76 output-property-music-iterator.cc:27
#, c-format
-msgid "octave check failed; expected %s, found: %s"
-msgstr "oktaavitarkistus epäonnistua; oletetttin %s, löydettiin: %s"
+msgid "Junking event: `%s'"
+msgstr "Hylätään tapahtuma: `%s'"
-#: extender-engraver.cc:143 extender-engraver.cc:153
+#: extender-engraver.cc:94
msgid "unterminated extender"
msgstr "päättymätön pidennys"
-#: folded-repeat-iterator.cc:65
+#: extender-engraver.cc:106
+msgid "Nothing to connect extender to on the left. Ignoring extender event."
+msgstr "Pidennystä ei voitu liittää vasemmalle. Hylätään pidennystapahtuma.\""
+
+#: folded-repeat-iterator.cc:88
msgid "no one to print a repeat brace"
msgstr "kukaan ei voinut tulostaa toistoa"
-#: glissando-engraver.cc:102
+#: font-interface.cc:239
+msgid "couldn't find any font satisfying "
+msgstr "mikään fontti ei tuottanut toivottua tulosta"
+
+#: glissando-engraver.cc:100
msgid "Unterminated glissando."
msgstr "Päättymätön glissando."
-#: global-context.cc:151
-#, c-format
-msgid "can't find `%s' context"
-msgstr "ei löytynyt kontekstia `%s'"
-
-#: gourlay-breaking.cc:195
+#: gourlay-breaking.cc:188
#, c-format
msgid "Optimal demerits: %f"
msgstr "Optimaalinen heikennys: %f"
-#: gourlay-breaking.cc:200
+#: gourlay-breaking.cc:193
msgid "No feasible line breaking found"
msgstr "Ei löytynyt sopivaa viivan katkaisukohtaa"
msgid "implied \\%s added"
msgstr "lisättiin vihjattu \\%s"
-#: grob-interface.cc:73
-msgid "Unknown interface `%s'"
-msgstr "tuntematon klusterityyli: `%s'"
-
-#: grob-interface.cc:84
+#.
+#. Todo: do something sensible. The grob-pq-engraver is not water
+#. tight, and stuff like tupletSpannerDuration confuses it.
+#.
+#: grob-pq-engraver.cc:130
#, c-format
-msgid "Grob `%s' has no interface for property `%s'"
-msgstr "Ladokkeella `%s' ei ole rajapintaa ominaisuudella `%s'"
+msgid ""
+"Skipped something?\n"
+"Grob %s ended before I expected it to end."
+msgstr ""
+"Jotain ohitettiin?\n"
+"Piirto %s loppui ennen kuin sen oletettiin loppuvan."
#: hairpin.cc:98
msgid "decrescendo too small"
msgid "crescendo too small"
msgstr "liian lyhyt crescendo"
-#: horizontal-bracket-engraver.cc:57
+#: horizontal-bracket-engraver.cc:64
msgid "Don't have that many brackets."
msgstr "Ei ole käytössä niin monia sulkeita."
-#: horizontal-bracket-engraver.cc:66
+#: horizontal-bracket-engraver.cc:73
msgid "Conflicting note group events."
msgstr "Ristiriitainen nuottiryhmä -tapaus."
-#: hyphen-engraver.cc:96
-msgid "removing unterminated hyphen"
-msgstr "päättymätön tavuviiva"
-
-#: hyphen-engraver.cc:110
-msgid "unterminated hyphen; removing"
+#: hyphen-engraver.cc:87
+msgid "unterminated hyphen"
msgstr "päättymätön tavuviiva"
-#: includable-lexer.cc:50
-msgid "include files are not allowed"
-msgstr "sisällytettävät tiedostot eivät ole sallittuja"
+#: hyphen-engraver.cc:99
+msgid "Nothing to connect hyphen to on the left. Ignoring hyphen event."
+msgstr "Mitään ei voitu liittää tavuviivan vasemmalle puolelle. Sivutetaan tavutus."
#: input.cc:99
msgid "non fatal error: "
msgstr "ei-keskeyttävä virhe:"
-#: input.cc:107 source-file.cc:141 source-file.cc:234
+#: input.cc:107 source-file.cc:146 source-file.cc:239
msgid "position unknown"
msgstr "sijainti tuntematon:"
-#: key-performer.cc:90
+#: input-file-results.cc:72 source-file.cc:54 streams.cc:38
+#, c-format
+msgid "can't open file: `%s'"
+msgstr "tiedostoa ei voitu avata: `%s'"
+
+#: input-file-results.cc:132
+msgid "Score contains errors; will not process it"
+msgstr "Viivastossa on virheitä; sitä ei prosessoida"
+
+#: input-file-results.cc:172
+#, c-format
+msgid "Now processing: `%s'"
+msgstr "Prosessoidaan: `%s'"
+
+#: key-performer.cc:96
msgid "FIXME: key change merge"
msgstr "KORJATTAVA: sävellajin vaihdon sulautuma"
-#: kpath.cc:83
-msgid "kpathsea can not find TFM file: `%s'"
-msgstr "Kpathsea ei löytänyt TFM-tiedostoa `%s'"
-
-#: kpath.cc:129
-msgid "kpathsea can not find file: `%s'"
+#: kpath.cc:76
+#, c-format
+msgid "Kpathsea couldn't find TFM file `%s'"
msgstr "Kpathsea ei löytänyt TFM-tiedostoa `%s'"
-#: ligature-engraver.cc:152
+#: ligature-engraver.cc:159
msgid "can't find start of ligature"
msgstr "ei löytynyt alkua ligature:lle"
-#: ligature-engraver.cc:158
+#: ligature-engraver.cc:165
msgid "no right bound"
msgstr "ei oikeata reunaa"
-#: ligature-engraver.cc:184
+#: ligature-engraver.cc:191
msgid "already have a ligature"
msgstr "ligature löytyi jo"
-#: ligature-engraver.cc:200
+#: ligature-engraver.cc:207
msgid "no left bound"
msgstr "ei vasenta reunaa"
-#: ligature-engraver.cc:255
+#: ligature-engraver.cc:258
msgid "unterminated ligature"
msgstr "päättymätön ligature"
-#: ligature-engraver.cc:279
-msgid "ignoring rest: ligature may not contain rest"
+#: ligature-engraver.cc:282
+msgid "ligature may not contain rest; ignoring rest"
msgstr "ligature ei voi sisältää taukoa; sivuutetaan tauko"
-#: ligature-engraver.cc:280
+#: ligature-engraver.cc:283
msgid "ligature was started here"
msgstr "ligature alkoi tästä"
msgid "(load path: `%s')"
msgstr "(hakupolku: `%s')"
-#: lily-guile.cc:549
+#: lily-guile.cc:576
#, c-format
msgid "Can't find property type-check for `%s' (%s)."
msgstr "Ei löytynyt tyyppitarkistusta ominaisuudelle `%s' (%s)."
-#: lily-guile.cc:552
+#: lily-guile.cc:579
msgid "Perhaps you made a typing error?"
-msgstr "Olet tainnut tehdä näppäilyvirheen?"
+msgstr "Tekinet näppäilyvirheen?"
-#: lily-guile.cc:558
+#: lily-guile.cc:585
msgid "Doing assignment anyway."
msgstr "Tehdään tehtävä joka tapauksessa."
-#: lily-guile.cc:572
+#: lily-guile.cc:599
#, c-format
msgid "Type check for `%s' failed; value `%s' must be of type `%s'"
msgstr "Tyypin `%s' tarkistus epäonnistui; arvon `%s' on oltava tyyppiä `%s'"
-#: lookup.cc:169
+#: lookup.cc:173
msgid "round filled box horizontal extent smaller than blot; decreasing blot"
-msgstr ""
-"pyöristetyn, täytetyn laatikon horisontaali laajuus on pilkkua pienempi; "
-"pienennetään pilkkua"
+msgstr "pyöristetyn, täytetyn laatikon horisontaali laajuus on pilkkua pienempi; pienennetään pilkkua"
-#: lookup.cc:174
+#: lookup.cc:178
msgid "round filled box vertical extent smaller than blot; decreasing blot"
-msgstr ""
-"pyöristetyn, täytetyn laatikon vertikaali laajuus on pilkkua pienempi; "
-"pienennetään pilkku"
+msgstr "pyöristetyn, täytetyn laatikon vertikaali laajuus on pilkkua pienempi; pienennetään pilkku"
-#: main.cc:87
-msgid ""
-"This program is free software. It is covered by the GNU General Public\n"
-"License and you are welcome to change it and/or distribute copies of it\n"
-"under certain conditions. Invoke as `lilypond-bin --warranty' for more\n"
-"information.\n"
-msgstr ""
-"Tämä on ilmaisohjelmisto. Siihen sovelletaan GNU General Public License,\n"
-"ja olet tervetullut muuttamaan ohjelmaa ja/tai levittämään siitä kopioita\n"
-"tietyillä ehdoilla. Suorita `%s --warranty' saadaksesi lisäinformaatiota.\n"
+#: lyric-phrasing-engraver.cc:311
+msgid "lyrics found without any matching notehead"
+msgstr "lyriikkaa löytyi ilman vastaavaa nuotinpäätä"
-#: main.cc:93
-msgid ""
-" This program is free software; you can redistribute it and/or\n"
-"modify it under the terms of the GNU General Public License version 2\n"
-"as published by the Free Software Foundation.\n"
-"\n"
-" This program is distributed in the hope that it will be useful,\n"
-"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
-"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n"
-"General Public License for more details.\n"
-"\n"
-" You should have received a copy (refer to the file COPYING) of the\n"
-"GNU General Public License along with this program; if not, write to\n"
-"the Free Software Foundation, Inc., 59 Temple Place - Suite 330,\n"
-"Boston, MA 02111-1307, USA.\n"
-msgstr ""
-" Tämä ohjelma on vapaata lähdekoodia; voit levittää sitä ja/tai\n"
-"muokata sitä lisenssin GNU General Public License versio 2 ehdoilla, \n"
-"kuten Free Software Foundation on sen julkaissut.\n"
-"\n"
-" Ohjelmaa levitetään siinä toivossa että se on hyödyllinen, mutta\n"
-"ILMAN MITÄÄN TAKUUTA; ilman että edes annettaisiin ymmärtää takeista\n"
-"KAUPAKSIKÄYVYYDESTÄ tai SOPIVUUDESTA TIETTYYN TARKOITUKSEEN. Lisätietoja\n"
-"voit katsoa lisenssistä GNU General Public Licence.\n"
-"\n"
-" Saat kopion (katso tiedosto COPYING) lisenssistä GNU General Public\n"
-"License ohjelman mukana; jos et saanut; kirjoita osoitteeseen\n"
-"Free Software Foundation, Inc., 59 Temple Place - Suite 330,\n"
-"Boston, MA 02111-1307, USA.\n"
+#: lyric-phrasing-engraver.cc:317
+msgid "Huh? Melismatic note found to have associated lyrics."
+msgstr "Täh? Melismoitu nuotti ilman siihen liittyvään lyriikkaa."
-#: main.cc:122
+#: main.cc:106
msgid "EXPR"
msgstr "EXPR"
-#: main.cc:123
+#: main.cc:107
msgid "set options, use -e '(ly-option-usage)' for help"
-msgstr "aseta optiot, käytä -e '(ly-option-usage)' saadaksesi opasteen"
+msgstr "aseta optiot, käytä -e '(ly-option-usage)' saadaksesi opastusta"
-#: main.cc:126
+#: main.cc:110
msgid "use output format EXT"
msgstr "käytä tulostemuotoa EXT"
-#: main.cc:128
+#: main.cc:112
msgid "FIELD"
msgstr "KENTTÄ"
-#: main.cc:128
+#: main.cc:112
msgid "write header field to BASENAME.FIELD"
msgstr "kirjoita otsakekenttä paikkaan PERUSNIMI.KENTTÄ"
-#: main.cc:129
+#: main.cc:113
msgid "add DIR to search path"
-msgstr "lisää HAKEMISTO hakupolkuun"
+msgstr "lisää DIR hakupolkuun"
-#: main.cc:130
+#: main.cc:114
msgid "use FILE as init file"
msgstr "käytetään TIEDOSTO alustustiedostona"
-#: main.cc:133
-msgid "run in safe mode"
-msgstr "aja turvamoodissa"
+#: main.cc:118
+msgid "prepend DIR to dependencies"
+msgstr "lisää DIR riippuvuuksien alkuun"
-#: main.cc:156
-msgid ""
-"Copyright (c) %s by\n"
-"%s and others."
-msgstr "Copyright (c) %s by"
+#.
+#. should audit again.
+#.
+#: main.cc:123
+msgid "inhibit file output naming and exporting"
+msgstr "estä tiedostotulosteen nimeäminen ja siirtotiedostoon kirjoittaminen"
-#. No version number or newline here. It confuses help2man.
-#: main.cc:182
+#. No version number or newline here. It confuses help2man.
+#: main.cc:155
#, c-format
msgid "Usage: %s [OPTIONS]... FILE..."
msgstr "Käyttö: %s [OPTIOT]... TIEDOSTO..."
-#: main.cc:184
-msgid "Typeset music and/or produce MIDI from FILE."
+#: main.cc:157
+msgid "Typeset music and or play MIDI from FILE."
msgstr "Lado musiikki ja tai soita MIDI tiedostosta TIEDOSTO."
-#: main.cc:186
+#: main.cc:160
+msgid ""
+"LilyPond is a music typesetter. It produces beautiful sheet music\n"
+"using a high level description file as input. LilyPond is part of \n"
+"the GNU Project.\n"
+msgstr ""
+"LilyPond on musiikin ladontaohjelma. Se tuottaa kaunista nuottikuvaa\n"
+"käyttäen korkean tason kuvauskieltä syötteenä. LilyPond on osa\n"
+"GNU Projektia.\n"
+
+#: main.cc:182
#, c-format
-msgid "LilyPond produces beautiful music notation."
-msgstr "LilyPond tuottaa kaunista notaatiota musiikille."
+msgid ""
+"This is free software. It is covered by the GNU General Public License,\n"
+"and you are welcome to change it and/or distribute copies of it under\n"
+"certain conditions. Invoke as `%s --warranty' for more information.\n"
+msgstr ""
+"Tämä on ilmaisohjelmisto. Siihen sovelletaan GNU General Public License,\n"
+"ja olet tervetullut muuttamaan sitä ja/tai levittämään siitä kopioita\n"
+"tietyillä ehdoilla. Suorita `%s --warranty' saadaksesi lisäinformaatiota.\n"
+
+#: main.cc:198
+msgid "GNU LilyPond -- The music typesetter"
+msgstr "GNU LilyPond -- Musiikin ladontaohjelma"
+
+#: main.cc:206
+msgid ""
+" This program is free software; you can redistribute it and/or\n"
+"modify it under the terms of the GNU General Public License version 2\n"
+"as published by the Free Software Foundation.\n"
+"\n"
+" This program is distributed in the hope that it will be useful,\n"
+"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
+"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n"
+"General Public License for more details.\n"
+"\n"
+" You should have received a copy (refer to the file COPYING) of the\n"
+"GNU General Public License along with this program; if not, write to\n"
+"the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,\n"
+"USA.\n"
+msgstr ""
+" Tämä ohjelma on vapaata lähdekoodia; voit levittää sitä ja/tai\n"
+"muokata sitä lisenssin GNU General Public License versio 2 ehdoilla, \n"
+"kuten Free Software Foundation on sen julkaissut.\n"
+"\n"
+" Ohjelmaa levitetään siinä toivossa että se on hyödyllinen, mutta\n"
+"ILMAN MITÄÄN TAKUUTA; ilman että edes annettaisiin ymmärtää takeista\n"
+"KAUPAKSIKÄYVYYDESTÄ tai SOPIVUUDESTA TIETTYYN TARKOITUKSEEN. Lisätietoja\n"
+"voit katsoa lisenssistä GNU General Public Licence.\n"
+"\n"
+" Saat kopion (katso tiedosto COPYING) lisenssistä GNU General Public\n"
+"License ohjelman mukana; jos et saanut; kirjoita osoitteeseen\n"
+"Free Software Foundation, Inc., 59 Temple Place - Suite 330,\n"
+"Boston, MA 02111-1307, USA.\n"
-#: main.cc:188
+#: mensural-ligature.cc:153
#, c-format
-msgid "For more information, see %s"
-msgstr "Lisätietoja varten, katso %s"
+msgid "Mensural_ligature:thickness undefined on flexa %d; assuming 1.4"
+msgstr "Mensural_ligature: paksuus määrittämättä kohdassa flexa %d; oletetaan 1.4"
-#: main.cc:348
+#: mensural-ligature.cc:169
#, c-format
-msgid "This option is for developers only."
-msgstr "Tämä optio on vain kehittäjille."
+msgid "Mensural_ligature:delta-pitch undefined on flexa %d; assuming 0"
+msgstr "Mensural_ligature: delta-pitch määrittämättä kohdassa flexa %d; oletetaan 0"
-#: main.cc:349
+#: mensural-ligature.cc:182
#, c-format
-msgid "Read the sources for more information."
-msgstr "Lue lähdekoodia saadaksesi lisäinformaatiota."
+msgid "Mensural_ligature:flexa-width undefined on flexa %d; assuming 2.0"
+msgstr "Mensural_ligature: flexa-width määrittämättä kohdassa flexa %d; oletetaan 2.0\""
+
+#: mensural-ligature.cc:215
+msgid "Mensural_ligature:unexpected case fall-through"
+msgstr "Mensural_ligature: odottamaton tapauksen raukeaminen"
+
+#: mensural-ligature.cc:225
+msgid "Mensural_ligature: (join_left == 0)"
+msgstr "Mensural_ligature: (join_left == 0)"
-#: mensural-ligature-engraver.cc:248 mensural-ligature-engraver.cc:383
+#: mensural-ligature-engraver.cc:248 mensural-ligature-engraver.cc:397
msgid "unexpected case fall-through"
msgstr "odottamaton tapauksen raukeaminen"
msgid "mensural ligature: duration none of L, B, S -> skipping"
msgstr "mensuraaliligatuuri: kesto ei ollut L, B tai S -> ohitetaan"
-#: mensural-ligature.cc:183
-msgid "Mensural_ligature:unexpected case fall-through"
-msgstr "Mensural_ligature: odottamaton tapauksen raukeaminen"
-
-#: mensural-ligature.cc:193
-msgid "Mensural_ligature: (join_left == 0)"
-msgstr "Mensural_ligature: (join_left == 0)"
-
-#: midi-item.cc:153
-msgid "no such MIDI instrument: `%s'"
+#: midi-item.cc:148
+#, c-format
+msgid "no such instrument: `%s'"
msgstr "ei löytynyt instrumenttia: `%s'"
-#: midi-item.cc:257
+#: midi-item.cc:238
+msgid "silly duration"
+msgstr "sekava kesto"
+
+#: midi-item.cc:251
msgid "silly pitch"
msgstr "sekava äänenkorkeus"
-#: midi-item.cc:273
+#: music-output-def.cc:111
#, c-format
-msgid "Experimental: temporarily fine tuning (of %d cents) a channel."
-msgstr "Kokeellinen: viritetään väliaisesti (%d senttiä) kanavaa."
-
-#: midi-stream.cc:40
-msgid "could not write file: `%s'"
-msgstr "tiedostoa ei voitu avata: `%s'"
+msgid "can't find `%s' context"
+msgstr "ei löytynyt kontekstia `%s'"
-#: my-lily-lexer.cc:185
+#: my-lily-lexer.cc:169
#, c-format
msgid "Identifier name is a keyword: `%s'"
msgstr "Tunnistenimi on avainsana: `%s'"
-#: my-lily-lexer.cc:205
+#: my-lily-lexer.cc:191
#, c-format
msgid "error at EOF: %s"
msgstr "virhe tiedoston lopussa (EOF): %s"
-#: my-lily-parser.cc:57
+#: my-lily-parser.cc:44
msgid "Parsing..."
msgstr "Jäsennetään..."
-#: my-lily-parser.cc:69
+#: my-lily-parser.cc:54
msgid "Braces don't match"
msgstr "Aaltosulkumerkit eivät täsmää"
-#: my-lily-parser.cc:228
-msgid "can't find init file: `%s'"
-msgstr "tiedostoa ei löydy: `%s'"
-
-#: my-lily-parser.cc:243
-msgid "Now processing `%s'"
-msgstr "Prosessoidaan: `%s'"
-
#.
#. music for the softenon children?
#.
-#: new-fingering-engraver.cc:155
+#: new-fingering-engraver.cc:143
msgid "music for the martians."
msgstr "musiikkia marsilaisille"
-#: new-fingering-engraver.cc:235
-msgid "Fingerings are also not down?! Putting them down anyway."
-msgstr "Sormitukset eivät myöskään ole alhaalla?! Laitetaan ne kuitnekin alas."
-
-#: new-lyric-combine-music-iterator.cc:172
-msgid "cannot find Voice: %s"
-msgstr "tiedostoa ei löydy: `%s'"
+#: new-tie-engraver.cc:166 tie-engraver.cc:217
+msgid "lonely tie"
+msgstr "yksinäinen sidos"
-#: note-collision.cc:384
+#: note-collision.cc:340
msgid "Too many clashing notecolumns. Ignoring them."
msgstr "Liian monta törmäävää nuottisaraketta. Sivuutetaan ne."
-#: note-head.cc:139
+#: note-head.cc:127
#, c-format
msgid "note head `%s' not found"
msgstr "nuottipäätä `%s' ei löytynyt"
-#: paper-def.cc:79
+#: paper-def.cc:96
#, c-format
msgid "paper output to `%s'..."
msgstr "paperituloste paikkaan `%s'..."
-#: paper-score.cc:71
+#: paper-score.cc:78
#, c-format
msgid "Element count %d (spanners %d) "
msgstr "Elementtien määrä: %d (ladokkeita: %d)"
-#: paper-score.cc:75
+#: paper-score.cc:83
msgid "Preprocessing graphical objects..."
msgstr "Esiprosessoidaan graafisia kohteita..."
-#. prevent warning
-#: parse-scm.cc:81
-msgid "GUILE signaled an error for the expression beginning here"
+#: paper-score.cc:116
+msgid "Outputting Score, defined at: "
+msgstr "Tulostetaan viivasto, määrittelypaikasta: "
+
+#: parse-scm.cc:79
+msgid "GUILE signaled an error for the expression begining here"
msgstr "GUILE aitoi virheen lausekkeelle, joka alkoi täältä"
-#: percent-repeat-engraver.cc:110
+#.
+#. We could change the current translator's id, but that would make
+#. errors hard to catch
+#.
+#. last->translator_id_string_ = get_change ()->change_to_id_string_;
+#.
+#: part-combine-music-iterator.cc:139
+#, c-format
+msgid "I'm one myself: `%s'"
+msgstr "Olen yksikseni: '%s'"
+
+#: part-combine-music-iterator.cc:142
+#, c-format
+msgid "none of these in my family: `%s'"
+msgstr "yksikään näistä ei ole perheestäni: `%s'"
+
+#: percent-repeat-engraver.cc:109
msgid "Don't know how to handle a percent repeat of this length."
msgstr "Ei tiedetä kuinka kohdella tämän mittaista prosenttitoistoa."
-#: percent-repeat-engraver.cc:164
+#: percent-repeat-engraver.cc:163
msgid "unterminated percent repeat"
msgstr "päättymätön prosenttitoisto"
-#: percent-repeat-iterator.cc:53
+#: percent-repeat-iterator.cc:65
msgid "no one to print a percent"
msgstr "kukaan ei voinut tulostaa prosenttia"
-#: performance.cc:50
+#: performance.cc:51
msgid "Track ... "
msgstr "Jälki ... "
-#: performance.cc:93
+#: performance.cc:83
msgid "Creator: "
msgstr "Tekijä: "
-#: performance.cc:113
+#: performance.cc:103
msgid "at "
msgstr "kohdassa "
-#: performance.cc:171
+#: performance.cc:114
+#, c-format
+msgid "from musical definition: %s"
+msgstr "musiikkimäärityksestä: %s"
+
+#: performance.cc:169
#, c-format
msgid "MIDI output to `%s'..."
msgstr "MIDI-tuloste paikkaan `%s'..."
-#: phrasing-slur-engraver.cc:105
+#: phrasing-slur-engraver.cc:123
msgid "unterminated phrasing slur"
msgstr "päättymätön fraasikaari"
-#: phrasing-slur-engraver.cc:123
+#: phrasing-slur-engraver.cc:141
msgid "can't find start of phrasing slur"
msgstr "ei voitu löytää alkua fraasikaarelle"
-#: piano-pedal-engraver.cc:238
-msgid "Need 3 strings for piano pedals. No pedal made. "
-msgstr "Tarvitaan 3 merkkijonoa pianopedaalille. Pedaalitusta ei tehty."
-
-#: piano-pedal-engraver.cc:253 piano-pedal-engraver.cc:268
-#: piano-pedal-performer.cc:82
+#: piano-pedal-engraver.cc:235 piano-pedal-engraver.cc:250
+#: piano-pedal-engraver.cc:305 piano-pedal-performer.cc:82
#, c-format
msgid "can't find start of piano pedal: `%s'"
msgstr "ei voitu löytää alkua pianopedaalille: `%s'"
-#: piano-pedal-engraver.cc:321
-msgid "can't find start of piano pedal bracket: `%s'"
-msgstr "ei voitu löytää alkua pianopedaalille: `%s'"
+#: piano-pedal-engraver.cc:410
+msgid "unterminated pedal bracket"
+msgstr "päättymätön pedaalisulkumerkki"
-#: property-iterator.cc:94
+#: property-iterator.cc:97
#, c-format
msgid "Not a grob name, `%s'."
msgstr "Ei ollut nimi graafiselle objektille (grob): `%s'."
-#: quote-iterator.cc:181
-msgid "In quotation: junking event %s"
-msgstr "Hylätään tapahtuma: `%s'"
-
-#: relative-octave-check.cc:25
-msgid "Failed octave check, got: "
-msgstr "Oktaavitarkistus epäonnistui, saatiin:"
-
-#: rest-collision.cc:145
-msgid "rest direction not set. Cannot resolve collision."
-msgstr "tauon suuntaa ei asetettu. Ei voitu selvittää törmäystä."
+#: rest.cc:139
+#, c-format
+msgid "rest `%s' not found, "
+msgstr "taukoa `%s' ei löytynyt, "
-#: rest-collision.cc:193
+#: rest-collision.cc:199
msgid "too many colliding rests"
msgstr "liian monta törmäävää taukoa"
-#: rest.cc:137
-msgid "rest `%s' not found"
-msgstr "taukoa `%s' ei löytynyt, "
-
-#: scm-option.cc:52
-#, c-format
+#: scm-option.cc:45
msgid "lilypond -e EXPR means:"
msgstr "lilypond -e EXPR tarkoittaa:"
-#: scm-option.cc:54
-#, c-format
+#: scm-option.cc:47
msgid " Evalute the Scheme EXPR before parsing any .ly files."
-msgstr ""
-" Evaluoidaan Scheme EXPR ennen kuin jäsennetään yhtäkään .ly -tiedostoista."
+msgstr " Evaluoidaan skeema EXPR ennen kuin jäsennetään yhtäkään .ly -tiedostoista."
-#: scm-option.cc:56
-#, c-format
-msgid ""
-" Multiple -e options may be given, they will be evaluated sequentially."
+#: scm-option.cc:49
+msgid " Multiple -e options may be given, they will be evaluated sequentially."
msgstr " Useita -e optioita voidaan antaa, ne evaluoidaan peräkkäisinä"
-#: scm-option.cc:58
-#, c-format
-msgid ""
-" The function ly-set-option allows for access to some internal variables."
+#: scm-option.cc:51
+msgid " The function ly-set-option allows for access to some internal variables."
msgstr " Funktio ly-set-option sallii pääsyn joihinkin sisäisiin muuttujiin"
-#: scm-option.cc:60
-msgid "Usage: lilypond-bin -e \"(ly-set-option SYMBOL VAL)\""
+#: scm-option.cc:53
+msgid "Usage: lilypond -e \"(ly-set-option SYMBOL VAL)\""
msgstr "Käyttö: lilypond -e \"(ly-set-option SYMBOLI ARVO)\""
-#: scm-option.cc:62
-#, c-format
+#: scm-option.cc:55
msgid "Where SYMBOL VAL pair is any of:"
msgstr "Missä (SYMBOLI,ARVO)-pari on jokin näistä:"
-#: scm-option.cc:143 scm-option.cc:176
+#: scm-option.cc:128
msgid "Unknown internal option!"
msgstr "Tuntematon sisäinen optio!"
-#: score-engraver.cc:103
+#: score.cc:85
+msgid "Interpreting music..."
+msgstr "Tulkitaan musiikkia..."
+
+#: score.cc:97
+msgid "Need music in a score"
+msgstr "Laita musiikkia viivastolle"
+
+#. should we? hampers debugging.
+#: score.cc:111
+msgid "Errors found/*, not processing score*/"
+msgstr "Virheitä löytyi/*, ei prosessoida viivastoa*/"
+
+#: score.cc:118
+#, c-format
+msgid "elapsed time: %.2f seconds"
+msgstr "kulunut aika: %.2f sekuntia"
+
+#: score-engraver.cc:99
#, c-format
msgid "can't find `%s'"
msgstr "`%s' jäi löytymättä"
-#: score-engraver.cc:104
+#: score-engraver.cc:100
msgid "Fonts have not been installed properly. Aborting"
msgstr "Fontteja ei oltu asennettu kunnolla. Keskeytetään"
-#: score-engraver.cc:189
+#: score-engraver.cc:205
#, c-format
msgid "unbound spanner `%s'"
msgstr "sitomaton ladoke `%s'"
-#: score.cc:119
-msgid "Interpreting music... "
-msgstr "Tulkitaan musiikkia..."
-
-#: score.cc:129
-msgid "Need music in a score"
-msgstr "Laita musiikkia viivastolle"
-
-#: score.cc:139
+#: script-engraver.cc:90
#, c-format
-msgid "elapsed time: %.2f seconds"
-msgstr "kulunut aika: %.2f sekuntia"
-
-#: script-engraver.cc:96
-msgid "Don't know how to interpret articulation:"
+msgid "Don't know how to interpret articulation `%s'"
msgstr "Ei tiedetä kuinka tulkita artikulaatio: `%s'"
-#: script-engraver.cc:97
-msgid "Scheme encoding: "
-msgstr "Scheme koodaus: "
-
#. this shouldn't happen, but let's continue anyway.
-#: separation-item.cc:53 separation-item.cc:97
+#: separation-item.cc:53 separation-item.cc:101
msgid "Separation_item: I've been drinking too much"
msgstr "Separation_item: Olen juonut liikaa"
msgid "No spring between column %d and next one"
msgstr "Ei jousta sarakkeen %d ja sitä seuraavan välillä"
-#: slur-engraver.cc:121
+#: slur-engraver.cc:141
msgid "unterminated slur"
msgstr "päättymätön kaari"
#. How to shut up this warning, when Voice_devnull_engraver has
#. eaten start event?
-#: slur-engraver.cc:139
+#: slur-engraver.cc:159
msgid "can't find start of slur"
msgstr "ei löytynyt alkua kaarelle"
-#: source-file.cc:50
-#, c-format
-msgid "can't open file: `%s'"
-msgstr "tiedostoa ei voitu avata: `%s'"
-
-#: source-file.cc:63
+#: source-file.cc:67
#, c-format
msgid "Huh? Got %d, expected %d characters"
msgstr "Täh? Saatiin %d merkkiä, oletetun %d asemesta"
-#: spacing-spanner.cc:385
-msgid "Global shortest duration is %s"
-msgstr "Globaali lyhin kesto on %s"
-
-#: stem-engraver.cc:97
-msgid "tremolo duration is too long"
-msgstr "tremolon kesto on liian pitkä"
+#: spacing-spanner.cc:379
+#, c-format
+msgid "Global shortest duration is %s\n"
+msgstr "Globaali lyhin kesto on %s\n"
-#: stem-engraver.cc:128
+#: spring-smob.cc:32
#, c-format
-msgid "Adding note head to incompatible stem (type = %d)"
-msgstr "Lisätään nuottipää sopimattomaan varteen (tyyppi = %d)"
+msgid "#<spring smob d= %f>"
+msgstr "#<spring smob d= %f>"
-#: stem-engraver.cc:129
-msgid "Don't you want polyphonic voices instead?"
-msgstr "Etkö haluaisi polyfonisia äänisiä sen sijaan?"
+#: staff-symbol.cc:61
+msgid "staff symbol: indentation yields beyond end of line"
+msgstr "viivastosymboli: sisennys vie rivin lopun taakse"
-#: stem.cc:119
+#: stem.cc:118
msgid "Weird stem size; check for narrow beams"
msgstr "Outo varren koko; koeta lyhyempiä palkkeja"
-#: stem.cc:648
+#: stem.cc:611
#, c-format
msgid "flag `%s' not found"
msgstr "lippua `%s' ei löydetty"
-#: stem.cc:661
+#: stem.cc:624
#, c-format
msgid "flag stroke `%s' not found"
msgstr "lipun piirtoa `%s' ei löytynyt"
-#: system.cc:131
+#: stem-engraver.cc:96
+msgid "tremolo duration is too long"
+msgstr "tremolon kesto on liian pitkä"
+
+#: stem-engraver.cc:124
+#, c-format
+msgid "Adding note head to incompatible stem (type = %d)"
+msgstr "Lisätään nuottipää sopimattomaan varteen (tyyppi = %d)"
+
+#: stem-engraver.cc:125
+msgid "Don't you want polyphonic voices instead?"
+msgstr "Etkö haluaisi polyfonisia äänisiä sen sijaan?"
+
+#: streams.cc:34
+#, c-format
+msgid "can't create directory: `%s'"
+msgstr "ei voitu tehdä hakemistoa: `%s'"
+
+#: streams.cc:48
+msgid "Error syncing file (disk full?)"
+msgstr "Virhe synkronisoitaessa tiedostoa (onko levy täysi?)"
+
+#: system.cc:125
#, c-format
msgid "Element count %d."
msgstr "Elementtien määrä: %d."
-#: system.cc:272
-msgid "Grob count %d"
+#: system.cc:372
+#, c-format
+msgid "Grob count %d "
msgstr "Graafisien objektien (grob) määrä: %d "
-#: system.cc:286
+#: system.cc:386
msgid "Calculating line breaks..."
msgstr "Lasketaan rivinvaihtoja..."
-#: text-spanner-engraver.cc:65
+#: text-spanner-engraver.cc:81
msgid "can't find start of text spanner"
msgstr "ei löydetty alkua tekstiladokkeelle"
-#: text-spanner-engraver.cc:79
+#: text-spanner-engraver.cc:95
msgid "already have a text spanner"
msgstr "tekstiladoke löytyi jo"
-#: text-spanner-engraver.cc:143
+#: text-spanner-engraver.cc:164
msgid "unterminated text spanner"
msgstr "päättymätön tekstiladoke"
+#: tfm.cc:83
+#, c-format
+msgid "can't find ascii character: %d"
+msgstr "ei löydetty ASCII-merkkiä: %d"
+
#. Not using ngettext's plural feature here, as this message is
#. more of a programming error.
#: tfm-reader.cc:108
#: tfm-reader.cc:142
#, c-format
msgid "%s: TFM file has %u parameters, which is more than the %u I can handle"
-msgstr ""
-"%s: TFM-tiedostossa on %u parametria, mikä on enemmän kuin maksimimäärä %u"
+msgstr "%s: TFM-tiedostossa on %u parametria, mikä on enemmän kuin maksimimäärä %u"
-#: tfm.cc:73
-#, c-format
-msgid "can't find ascii character: %d"
-msgstr "ei löydetty ASCII-merkkiä: %d"
+#: tie-performer.cc:159
+msgid "No ties were created!"
+msgstr "Sidoksia ei tehty!"
-#: tie-engraver.cc:164
-msgid "lonely tie"
-msgstr "yksinäinen sidos"
-
-#: time-scaled-music-iterator.cc:24
+#: time-scaled-music-iterator.cc:25
msgid "no one to print a tuplet start bracket"
msgstr "ketään ei löytynyt tulostamaan tupletin alkusulkua"
+#. If there is no such symbol, we default to the numbered style.
+#. (Here really with a warning!)
+#: time-signature.cc:87
+#, c-format
+msgid "time signature symbol `%s' not found; reverting to numbered style"
+msgstr "aikamerkintäsymbolia `%s' ei löytynyt; vaihdetaan numeroituun tyyliin"
+
#.
#. Todo: should make typecheck?
#.
msgid "Found strange time signature %d/%d."
msgstr "Löydettiin outo aikamerkintä: %d/%d."
-#. If there is no such symbol, we default to the numbered style.
-#. (Here really with a warning!)
-#: time-signature.cc:95
-#, c-format
-msgid "time signature symbol `%s' not found; reverting to numbered style"
-msgstr "aikamerkintäsymbolia `%s' ei löytynyt; vaihdetaan numeroituun tyyliin"
-
#: translator-ctors.cc:53
#, c-format
msgid "unknown translator: `%s'"
msgstr "tuntematon tulkitsija: `%s'"
-#: tuplet-bracket.cc:448
-msgid "Killing tuplet bracket across linebreak."
-msgstr "Hävitetään rivinvaihdon yli olevat tuplettisulut."
+#: translator-def.cc:105
+msgid "Program has no such type"
+msgstr "Ohjelmalla ei ole sellaista tyyppiä"
-#: vaticana-ligature-engraver.cc:342
+#: translator-def.cc:111
#, c-format
-msgid ""
-"ignored prefix (es) `%s' of this head according to restrictions of the "
-"selected ligature style"
-msgstr "sivuutetaan prefiksi (t) `%s' tälle nuottipäälle valitun "
-"ligatuurityylin mukaisesti"
+msgid "Already contains: `%s'"
+msgstr "Sisällytettiin jo: `%s'"
-#: vaticana-ligature-engraver.cc:572
+#: translator-def.cc:112
#, c-format
-msgid "Vaticana_ligature_engraver: setting `spacing-increment = %f': ptr=%ul"
-msgstr ""
-"Vaticana_ligature_engraver: asetetaan `spacing-increment = %f': ptr=%ul"
+msgid "Not adding translator: `%s'"
+msgstr "Ei lisätty tulkitsijaa: `%s'"
+
+#: translator-def.cc:229
+#, c-format
+msgid "can't find: `%s'"
+msgstr "ei löytynyt `%s'"
-#: vaticana-ligature.cc:92
+#: translator-group.cc:158
+#, c-format
+msgid "can't find or create `%s' called `%s'"
+msgstr "ei löydetty tai ei luotu `%s' nimeltä `%s'"
+
+#: translator-group.cc:230
+#, c-format
+msgid "can't find or create: `%s'"
+msgstr "ei löydetty tai ei luotu: `%s'"
+
+#: vaticana-ligature.cc:49
msgid "ascending vaticana style flexa"
msgstr "laskeva vaticana-tyylinen flexa"
-#: vaticana-ligature.cc:181
-msgid "Vaticana_ligature: zero join (delta_pitch == 0)"
+#: vaticana-ligature.cc:219
+msgid "Vaticana_ligature:thickness undefined; assuming 1.4"
+msgstr "Vaticana_ligature: määrittämätön paksuus; oletetaan 1.4"
+
+#: vaticana-ligature.cc:233
+msgid "Vaticana_ligature:x-offset undefined; assuming 0.0"
+msgstr "Vaticana_ligature: x-offset määrittämätön; oletetaan 0.0"
+
+#: vaticana-ligature.cc:258
+msgid "Vaticana_ligature: (delta_pitch == 0)"
msgstr "Vaticana_ligature: (delta_pitch == 0)"
-#: volta-engraver.cc:140
+#: vaticana-ligature.cc:271
+msgid "Vaticana_ligature:delta-pitch -> ignoring join"
+msgstr "Vaticana_ligature:delta-pitch -> sivuutetaan sidos"
+
+#: vaticana-ligature-engraver.cc:477
+#, c-format
+msgid "Vaticana_ligature_engraver: setting `spacing-increment = %f': ptr=%ul"
+msgstr "Vaticana_ligature_engraver: asetetaan `spacing-increment = %f': ptr=%ul"
+
+#: volta-engraver.cc:112
msgid "No volta spanner to end"
msgstr "Ei päätettävää volta-ladoketta"
-#: volta-engraver.cc:151
+#: volta-engraver.cc:123
msgid "Already have a volta spanner. Stopping that one prematurely."
msgstr "Löytyi ja volta-ladoke. Lopetetaan se ennenaikaisesti."
-#: volta-engraver.cc:155
+#: volta-engraver.cc:127
msgid "Also have a stopped spanner. Giving up."
msgstr "Löytyi myös lopetettu ladoke. Luovutetaan."
-#: parser.yy:79
-msgid "Tag must be symbol or list of symbols."
-msgstr "Merkinnän on oltava symboli tai lista symboleita."
-
-#: parser.yy:524 parser.yy:513
+#: parser.yy:480
msgid "Identifier should have alphabetic characters only"
msgstr "Tunnisteessa saa olla vain aakkosellisia merkkejä"
-#: parser.yy:806 parser.yy:776
+#: parser.yy:779
msgid "More alternatives than repeats. Junking excess alternatives."
-msgstr ""
-"Enemmän vaihtoehtoja kuin kertauksia. Heitetään pois liialliset vaihtoehdot."
+msgstr "Enemmän vaihtoehtoja kuin kertauksia. Heitetään pois liialliset vaihtoehdot."
-#: parser.yy:887 parser.yy:894 parser.yy:857 parser.yy:864
+#: parser.yy:861 parser.yy:868
msgid "\\applycontext takes function argument"
msgstr "\\applycontext vaati funktioargumentin"
-#: parser.yy:1044 parser.yy:1014
+#: parser.yy:877
+msgid "Second argument must be a symbol"
+msgstr "Toisen argumentin on oltava symboli"
+
+#: parser.yy:882
+msgid "First argument must be a procedure taking one argument"
+msgstr "Ensimmäisen argumentin on oltava aliohjelma, joka sa yhden argumentin"
+
+#: parser.yy:1009
msgid "\\apply takes function argument"
msgstr "\\apply vaatii funktioargumentin"
-#: parser.yy:1407 parser.yy:1377
-msgid "Can't find music"
-msgstr "Musiikkia ei löytynyt"
+#: parser.yy:1501
+msgid "Expecting string as script definition"
+msgstr "Oletetaan merkkijonon olevan skriptimäärittely"
+
+#: parser.yy:1598
+msgid "Expecting musical-pitch value"
+msgstr "Oletetaan musiikillinen nuottikorkeusarvo"
-#: parser.yy:1530 parser.yy:1500
-msgid "Second argument must be pitch list."
-msgstr "Toisen argumentin on oltava symboli"
+#: parser.yy:1609
+msgid "Must have duration object"
+msgstr "Täytyy olla kesto-objekti"
-#: parser.yy:1567 parser.yy:1572 parser.yy:2104 parser.yy:1537 parser.yy:1542
-#: parser.yy:2074
+#: parser.yy:1618 parser.yy:1626
msgid "Have to be in Lyric mode for lyrics"
msgstr "Täytyy olla Lyrics -moodissa lyriikkaa varten"
-#: parser.yy:1657 parser.yy:1627
-msgid "Expecting string as script definition"
-msgstr "Oletetaan merkkijonon olevan skriptimäärittely"
-
-#: parser.yy:1864 parser.yy:1918 parser.yy:1834 parser.yy:1888
+#: parser.yy:1798 parser.yy:1853
#, c-format
msgid "not a duration: %d"
msgstr "ei ole kesto: %d"
-#: parser.yy:2014 parser.yy:1984
+#: parser.yy:1949
msgid "Have to be in Note mode for notes"
msgstr "Täytyy olla Note -moodissa nuotteja varten"
-#: parser.yy:2119 parser.yy:2089
+#: parser.yy:2032
msgid "Have to be in Chord mode for chords"
msgstr "Täytyy olla Chord -moodissa sointuja varten"
-#: parser.yy:2266 parser.yy:2236
+#: parser.yy:2171
msgid "need integer number arg"
msgstr "tarvitaan kokonaislukuargumentti"
-#: parser.yy:2414 parser.yy:2387
+#: parser.yy:2316
msgid "Suspect duration found following this beam"
msgstr "Epäilty kesto löytyi palkin jälkeen"
-#: lexer.ll:189 lexer.ll:190
-msgid "input renamed to: `%s'"
-msgstr "ei voitu tehdä hakemistoa: `%s'"
-
-#: lexer.ll:197 lexer.ll:198
-msgid "No quoted string found after \\encoding"
-msgstr "Lainausmerkittyä tekstiä ei löytynyt kohteen \\encoding jälkeen"
-
-#: lexer.ll:201 lexer.ll:202
-msgid "No quoted string found after \\version"
-msgstr "Lainausmerkittyä tekstiä ei löytynyt kohteen \\version jälkeen"
-
-#: lexer.ll:205 lexer.ll:206
-msgid "No quoted string found after \\renameinput"
-msgstr "Lainausmerkittyä tekstiä ei löytynyt kohteen \\renameinput jälkeen"
-
-#: lexer.ll:218 lexer.ll:219
+#: lexer.ll:186
msgid "EOF found inside a comment"
msgstr "EOF löytyi kommentin sisältä"
-#: lexer.ll:233 lexer.ll:234
-msgid "\\maininput not allowed outside init files"
+#: lexer.ll:200
+msgid "\\maininput disallowed outside init files"
msgstr "\\maininput ei ole sallittu init-alustustiedoston ulkopuolella"
-#: lexer.ll:257 lexer.ll:258
+#: lexer.ll:224
#, c-format
msgid "wrong or undefined identifier: `%s'"
msgstr "väärä tai määrittämätön tunniste: `%s'"
#. backup rule
-#: lexer.ll:266 lexer.ll:267
+#: lexer.ll:233
msgid "Missing end quote"
msgstr "Puuttuva loppulainausmerkki"
-#: lexer.ll:408 lexer.ll:409
-msgid "Brace found at end of lyric. Did you forget a space?"
-msgstr "Sulkumerkki löytyi lyriikan lopussa. Unohditko välilyönnin?"
+#. backup rule
+#: lexer.ll:255 lexer.ll:259
+msgid "white expected"
+msgstr "oletettiin välilyönti"
+
+#: lexer.ll:268
+msgid "Can't evaluate Scheme in safe mode"
+msgstr "Scheme ei evaluoitunut turvamoodissa"
-#: lexer.ll:510 lexer.ll:511
-msgid "Brace found at end of markup. Did you forget a space?"
+#: lexer.ll:397 lexer.ll:487
+msgid "Brace found at end of lyric. Did you forget a space?"
msgstr "Sulkumerkki löytyi lyriikan lopussa. Unohditko välilyönnin?"
-#: lexer.ll:593 lexer.ll:594
+#: lexer.ll:574
#, c-format
msgid "invalid character: `%c'"
msgstr "epäkelpo merkki: `%c'"
-#: lexer.ll:665 lexer.ll:667
+#: lexer.ll:651
#, c-format
msgid "unknown escaped string: `\\%s'"
msgstr "tuntematon koodinvaihtomerkillinen merkkijono: `\\\\%s'"
-#: lexer.ll:763 lexer.ll:765
+#: lexer.ll:742
#, c-format
msgid "Incorrect lilypond version: %s (%s, %s)"
msgstr "Epäkelpo lilypond versio: %s (%s, %s)"
-#: lexer.ll:764 lexer.ll:766
+#: lexer.ll:743
msgid "Consider updating the input with the convert-ly script"
msgstr "Harkitse syötteen päivittämistä convert-ly scriptillä"
-#~ msgid " 1998--2003"
-#~ msgstr "1998--2003"
-
-#~ msgid "Process LilyPond snippets in hybrid html, LaTeX or texinfo document"
-#~ msgstr ""
-#~ "Prossoi LilyPond-osioita sekarakenteisessa html, LaTeX tai texinfo -"
-#~ "dokumentissa"
-
-#~ msgid "DIM"
-#~ msgstr "DIM"
-
-#~ msgid "default fontsize for music. DIM is assumed to be in points"
-#~ msgstr "oletusfonttikoko musiikille. DIM ilmoitetaan pisteinä"
-
-#~ msgid "deprecated, use --default-music-fontsize"
-#~ msgstr "vanhentunut, käytä --default-music-fontsize"
-
-#~ msgid "OPT"
-#~ msgstr "OPT"
-
-#~ msgid "pass OPT quoted to the lilypond command line"
-#~ msgstr "syötä OPT lainausmerkeissä lilypond-komentoriville"
-
-#~ msgid ""
-#~ "force fontsize for all inline lilypond. DIM is assumed be to in points"
-#~ msgstr ""
-#~ "pakota fonttikoko kullekin LilyPond-osiolle. DIM oletetaan olevan pisteinä"
-
-#~ msgid "deprecated, use --force-music-fontsize"
-#~ msgstr "vanhentunut, käytä --force-music-fontsize"
-
-#~ msgid "include path"
-#~ msgstr "sisällytä polku"
-
-#~ msgid "write dependencies"
-#~ msgstr "kirjoita riippuvuudet"
-
-#~ msgid "PREF"
-#~ msgstr "PREF"
-
-#~ msgid "prepend PREF before each -M dependency"
-#~ msgstr "laita PREF kunkin -M riippuvuuden eteen"
-
-#~ msgid "don't run lilypond"
-#~ msgstr "jätä suorittamatta lilypond"
-
-#~ msgid "don't generate pictures"
-#~ msgstr "jätä tuottamatta kuvat"
-
-#~ msgid "strip all lilypond blocks from output"
-#~ msgstr "riisu kaikki lilypond -osiot tulostuksesta"
-
-#~ msgid "filename main output file"
-#~ msgstr "tiedostonimi päätulostustiedostolle"
-
-#~ msgid "where to place generated files"
-#~ msgstr "tuotettujen tiedostojen sijoituspaikka"
-
-#~ msgid "LaTeX failed."
-#~ msgstr "LaTeX epäonnistui."
-
-#~ msgid "write Makefile dependencies for every input file"
-#~ msgstr "kirjoita Makefile -riippuvuudet kullekin tulostustiedostolle"
-
-#~ msgid "invalid value: `%s'"
-#~ msgstr "epäkelpo arvo: `%s'"
-
-#~ msgid "dependencies output to `%s'..."
-#~ msgstr "riippuvuuksien tulosteet paikkaan `%s'"
-
-#~ msgid " 2001--2003"
-#~ msgstr " 2001--2003"
-
-#~ msgid ""
-#~ "\n"
-#~ "Distributed under terms of the GNU General Public License. It comes with\n"
-#~ "NO WARRANTY."
-#~ msgstr ""
-#~ "\n"
-#~ "Levitetään ehdolla GNU General Public License\n"
-#~ "ja ilman TAKUUTA."
-
-#~ msgid "unknown accidental typesetting: %s. Ignored"
-#~ msgstr "tuntematan kortusmerkkien ladonta: %s. Sivuutetaan"
-
-#~ msgid "Symbol is not a parent context: %s. Ignored"
-#~ msgstr "Symboli ei ole yläkonteksti: %s. Sivuutetaan"
-
-#~ msgid "can't find character number: %d"
-#~ msgstr "ei löytynyt merkkiä: %d"
-
-#~ msgid "can't find character called: `%s'"
-#~ msgstr "ei löytynyt merkkiä nimeltä: `%s'"
-
-#~ msgid "Beam has less than two stems. Removing beam."
-#~ msgstr "Palkissa on vähemmän kuin kaksi pystyviivaa. Poistetaan palkki."
-
-#~ msgid ""
-#~ "Not sure that we can find a nice beam slope (no viable initial "
-#~ "configuration found)."
-#~ msgstr ""
-#~ "Ei ole varma löydetäänko sopivaa palkin kaltevuutta (ei löytynyt toimivaa "
-#~ "alkuasetusta)"
-
-#~ msgid ""
-#~ "Nothing to connect extender to on the left. Ignoring extender event."
-#~ msgstr ""
-#~ "Pidennystä ei voitu liittää vasemmalle. Hylätään pidennystapahtuma.\""
-
-#~ msgid "couldn't find any font satisfying "
-#~ msgstr "mikään fontti ei tuottanut toivottua tulosta"
-
-#~ msgid ""
-#~ "Skipped something?\n"
-#~ "Grob %s ended before I expected it to end."
-#~ msgstr ""
-#~ "Jotain ohitettiin?\n"
-#~ "Piirto %s loppui ennen kuin sen oletettiin loppuvan."
-
-#~ msgid "Nothing to connect hyphen to on the left. Ignoring hyphen event."
-#~ msgstr ""
-#~ "Mitään ei voitu liittää tavuviivan vasemmalle puolelle. Sivutetaan "
-#~ "tavutus."
-
-#~ msgid "Score contains errors; will not process it"
-#~ msgstr "Viivastossa on virheitä; sitä ei prosessoida"
-
-#~ msgid "lyrics found without any matching notehead"
-#~ msgstr "lyriikkaa löytyi ilman vastaavaa nuotinpäätä"
-
-#~ msgid "Huh? Melismatic note found to have associated lyrics."
-#~ msgstr "Täh? Melismoitu nuotti ilman siihen liittyvään lyriikkaa."
-
-#~ msgid "prepend DIR to dependencies"
-#~ msgstr "lisää HAKEMISTO riippuvuuksien alkuun"
-
-#~ msgid "inhibit file output naming and exporting"
-#~ msgstr ""
-#~ "estä tiedostotulosteen nimeäminen ja siirtotiedostoon kirjoittaminen"
-
-#~ msgid ""
-#~ "LilyPond is a music typesetter. It produces beautiful sheet music\n"
-#~ "using a high level description file as input. LilyPond is part of \n"
-#~ "the GNU Project.\n"
-#~ msgstr ""
-#~ "LilyPond on musiikin ladontaohjelma. Se tuottaa kaunista nuottikuvaa\n"
-#~ "käyttäen korkean tason kuvauskieltä syötteenä. LilyPond on osa\n"
-#~ "GNU Projektia.\n"
-
-#~ msgid "GNU LilyPond -- The music typesetter"
-#~ msgstr "GNU LilyPond -- Musiikin ladontaohjelma"
-
-#~ msgid "Mensural_ligature:thickness undefined on flexa %d; assuming 1.4"
-#~ msgstr ""
-#~ "Mensural_ligature: paksuus määrittämättä kohdassa flexa %d; oletetaan 1.4"
-
-#~ msgid "Mensural_ligature:delta-pitch undefined on flexa %d; assuming 0"
-#~ msgstr ""
-#~ "Mensural_ligature: delta-pitch määrittämättä kohdassa flexa %d; oletetaan "
-#~ "0"
-
-#~ msgid "Mensural_ligature:flexa-width undefined on flexa %d; assuming 2.0"
-#~ msgstr ""
-#~ "Mensural_ligature: flexa-width määrittämättä kohdassa flexa %d; oletetaan "
-#~ "2.0\""
-
-#~ msgid "silly duration"
-#~ msgstr "sekava kesto"
-
-#~ msgid "Outputting Score, defined at: "
-#~ msgstr "Tulostetaan viivasto, määrittelypaikasta: "
-
-#~ msgid "I'm one myself: `%s'"
-#~ msgstr "Olen yksikseni: '%s'"
-
-#~ msgid "none of these in my family: `%s'"
-#~ msgstr "yksikään näistä ei ole perheestäni: `%s'"
-
-#~ msgid "from musical definition: %s"
-#~ msgstr "musiikkimäärityksestä: %s"
-
-#~ msgid "unterminated pedal bracket"
-#~ msgstr "päättymätön pedaalisulkumerkki"
-
-#~ msgid "Errors found/*, not processing score*/"
-#~ msgstr "Virheitä löytyi/*, ei prosessoida viivastoa*/"
-
-#~ msgid "#<spring smob d= %f>"
-#~ msgstr "#<spring smob d= %f>"
-
-#~ msgid "staff symbol: indentation yields beyond end of line"
-#~ msgstr "viivastosymboli: sisennys vie rivin lopun taakse"
-
-#~ msgid "Error syncing file (disk full?)"
-#~ msgstr "Virhe synkronisoitaessa tiedostoa (onko levy täysi?)"
-
-#~ msgid "No ties were created!"
-#~ msgstr "Sidoksia ei tehty!"
-
-#~ msgid "Already contains: `%s'"
-#~ msgstr "Sisällytettiin jo: `%s'"
-
-#~ msgid "Not adding translator: `%s'"
-#~ msgstr "Ei lisätty tulkitsijaa: `%s'"
-
-#~ msgid "Vaticana_ligature:thickness undefined; assuming 1.4"
-#~ msgstr "Vaticana_ligature: määrittämätön paksuus; oletetaan 1.4"
-
-#~ msgid "Vaticana_ligature:x-offset undefined; assuming 0.0"
-#~ msgstr "Vaticana_ligature: x-offset määrittämätön; oletetaan 0.0"
-
-#~ msgid "Vaticana_ligature:delta-pitch -> ignoring join"
-#~ msgstr "Vaticana_ligature:delta-pitch -> sivuutetaan sidos"
-
-#~ msgid "First argument must be a procedure taking one argument"
-#~ msgstr ""
-#~ "Ensimmäisen argumentin on oltava aliohjelma, joka sa yhden argumentin"
-
-#~ msgid "Expecting musical-pitch value"
-#~ msgstr "Oletetaan musiikillinen nuottikorkeusarvo"
-
-#~ msgid "Must have duration object"
-#~ msgstr "Täytyy olla kesto-objekti"
-
-#~ msgid "white expected"
-#~ msgstr "oletettiin välilyönti"
-
-#~ msgid "Can't evaluate Scheme in safe mode"
-#~ msgstr "Scheme ei evaluoitunut turvamoodissa"
-
#~ msgid "Run LilyPond using LaTeX for titling"
#~ msgstr "Aja LilyPond käyttäen LaTeX:ia otsikoimiseen"
#~ msgstr "Hae ja käännä uudelleen viimeisestä lähdekoodipakkauksesta"
#~ msgid "unpack and build in DIR [%s]"
-#~ msgstr "pura paketti ja käännä hakemistiin HAKEMISTO [%s]"
+#~ msgstr "pura paketti ja käännä hakemistiin DIR [%s]"
#~ msgid "execute COMMAND, subtitute:"
#~ msgstr "suorita KOMENTO, korvaa:"
#~ msgid "fetch and build URL [%s]"
#~ msgstr "nouda ja laadi URL [%s]"
+#~ msgid "Listing `%s'..."
+#~ msgstr "Listataan `%s'..."
+
#~ msgid "latest is: %s"
#~ msgstr "viimeisin on: %s"
+#~ msgid "relax, %s is up to date"
+#~ msgstr "rentoudu, %s on päivitetty"
+
#~ msgid "Fetching `%s'..."
#~ msgstr "Noudetaan `%s'..."
# Messages français pour lilypond.
-# Copyright © 2004 Free Software Foundation, Inc.
+# Copyright © 2001 Free Software Foundation, Inc.
# Michel Robitaille <robitail@IRO.UMontreal.CA>, traducteur depuis/since 1996.
#
msgid ""
msgstr ""
-"Project-Id-Version: lilypond 2.2.0\n"
+"Project-Id-Version: lilypond 2.1.36\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2004-03-31 16:22+0200\n"
-"PO-Revision-Date: 2004-05-10 08:00-0500\n"
+"POT-Creation-Date: 2004-03-28 17:42+0200\n"
+"PO-Revision-Date: 2004-03-30 08:00-0500\n"
"Last-Translator: Michel Robitaille <robitail@IRO.UMontreal.CA>\n"
"Language-Team: French <traduc@traduc.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=ISO-8859-1\n"
"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+#. ###############################################################
+#. lilylib.py -- options and stuff
+#.
+#. source file of the GNU LilyPond music typesetter
+#.
+#. (c) 1998--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+#. Jan Nieuwenhuizen <janneke@gnu.org>
+#. ## subst:\(^\|[^._a-z]\)\(abspath\|identify\|warranty\|progress\|warning\|error\|exit\|getopt_args\|option_help_str\|options_help_str\|help\|setup_temp\|read_pipe\|system\|cleanup_temp\|strip_extension\|cp_to_dir\|mkdir_p\|init\) *(
+#. ## replace:\1ly.\2 (
+#. ## subst: \(help_summary\|keep_temp_dir_p\|option_definitions\|original_dir\|program_name\|pseudo_filter_p\|temp_dir\|verbose_p\)
+#. ###############################################################
+#. Users of python modules should include this snippet
+#. and customize variables below.
+#. We'll suffer this path init stuff as long as we don't install our
+#. python packages in <prefix>/lib/pythonx.y (and don't kludge around
+#. it as we do with teTeX on Red Hat Linux: set some environment var
+#. (PYTHONPATH) in profile)
+#. If set, LILYPONDPREFIX must take prevalence
+#. if datadir is not set, we're doing a build and LILYPONDPREFIX
+#. Customize these
+#. lilylib globals
#: lilylib.py:60
msgid "lilylib module"
msgstr "module lilylib"
-#: lilylib.py:63 lilypond-book.py:84 lilypond.py:127 midi2ly.py:100
+#: lilylib.py:63 lilypond-book.py:83 lilypond.py:127 midi2ly.py:100
#: mup2ly.py:75 old-lilypond-book.py:129 main.cc:140
msgid "print this help"
msgstr "afficher l'aide-mémoire"
+#. ###############################################################
+#. Handle bug in Python 1.6-2.1
+#.
+#. there are recursion limits for some patterns in Python 1.6 til 2.1.
+#. fix this by importing pre instead. Fix by Mats.
+#. Attempt to fix problems with limited stack size set by Python!
+#. Sets unlimited stack size. Note that the resource module only
+#. is available on UNIX.
#: lilylib.py:110 midi2ly.py:136 mup2ly.py:130
#, python-format
msgid "Copyright (c) %s by"
msgstr "Copyright (c) %s écrit par"
-#: lilylib.py:114 midi2ly.py:141 mup2ly.py:135
+#: lilylib.py:110
+msgid " 1998--2003"
+msgstr " 1998--2003"
+
+#: lilylib.py:114
msgid "Distributed under terms of the GNU General Public License."
msgstr "Distribué selon les termes de la GNU General Public License."
-#: lilylib.py:116 midi2ly.py:142 mup2ly.py:136
+#: lilylib.py:116
msgid "It comes with NO WARRANTY."
msgstr "Le logiciel est distribué SANS GARANTIE."
-#: lilylib.py:123 warn.cc:25
-#, c-format, python-format
-msgid "warning: %s"
-msgstr "AVERTISSEMENT: %s"
+#: lilylib.py:123 midi2ly.py:150 mup2ly.py:144 input.cc:88
+msgid "warning: "
+msgstr "AVERTISSEMENT: "
-#: lilylib.py:126 warn.cc:31
-#, c-format, python-format
-msgid "error: %s"
-msgstr "Erreur: %s"
+#. lots of midi files use plain text for lyric events
+#. FIXME: read from stdin when files[0] = '-'
+#: lilylib.py:126 midi2ly.py:165 midi2ly.py:1018 midi2ly.py:1083 mup2ly.py:147
+#: mup2ly.py:161 input.cc:93
+msgid "error: "
+msgstr "Erreur: "
#: lilylib.py:130
#, python-format
msgid "Exiting (%d)..."
msgstr "Fin d'exécution (%d)... "
-#: lilylib.py:190 midi2ly.py:223 mup2ly.py:219
+#: lilylib.py:190 midi2ly.py:224 mup2ly.py:220
#, python-format
msgid "Usage: %s [OPTIONS]... FILE"
msgstr "Usage: %s [OPTIONS]... FICHIER"
-#: lilylib.py:194 midi2ly.py:227 mup2ly.py:223 main.cc:205
-#, c-format
+#: lilylib.py:194 midi2ly.py:228 mup2ly.py:224 main.cc:205
msgid "Options:"
msgstr "Options:"
-#: lilylib.py:198 midi2ly.py:231 mup2ly.py:227 main.cc:209
+#: lilylib.py:198 midi2ly.py:232 mup2ly.py:228 main.cc:209
#, c-format, python-format
msgid "Report bugs to %s."
msgstr "Rapporter toutes anomalies à %s."
msgid "Binary %s has version %s, looking for version %s"
msgstr "Binaire %s de version %s, recherche de la version %s"
+#. deal with "((latex ) >& 1 ) .." too
#: lilylib.py:252
#, python-format
msgid "Opening pipe `%s'"
msgstr "Ouverture du pipe `%s'"
-#: lilylib.py:267 lilypond-book.py:767
+#. successful pipe close returns 'None'
+#: lilylib.py:267 lilypond-book.py:724
#, python-format
msgid "`%s' failed (%d)"
msgstr "`%s' échec (%d)"
-#: lilylib.py:272 lilylib.py:331 lilypond-book.py:768 lilypond.py:530
+#: lilylib.py:272 lilylib.py:331 lilypond-book.py:725 lilypond.py:530
#: old-lilypond-book.py:228
msgid "The error log is as follows:"
msgstr "Le journal d'erreurs est comme suit:"
-#: lilylib.py:303 midi2ly.py:259 mup2ly.py:255
+#. Ugh. code dup
+#: lilylib.py:303 midi2ly.py:260 mup2ly.py:256
#, python-format
msgid "Invoking `%s'"
msgstr "Invocation de « %s »"
msgid "`%s' failed (%s)"
msgstr "`%s' a échoué (%s)"
-#: lilylib.py:327 midi2ly.py:265 mup2ly.py:263
+#: lilylib.py:327 midi2ly.py:266 mup2ly.py:264
msgid "(ignored)"
msgstr "(ignoré)"
-#: lilylib.py:345 midi2ly.py:275 mup2ly.py:273
+#: lilylib.py:345 midi2ly.py:276 mup2ly.py:274
#, python-format
msgid "Cleaning %s..."
msgstr "Nettoyage de %s..."
-#: lilylib.py:509
+#. Duh. Python style portable: cp *.EXT OUTDIR
+#. system ('cp *.%s %s' % (ext, outdir), 1)
+#. Python < 1.5.2 compatibility
+#.
+#. On most platforms, this is equivalent to
+#. `normpath(join(os.getcwd()), PATH)'. *Added in Python version 1.5.2*
+#. tex needs lots of memory, more than it gets by default on Debian
+#. TODO: * prevent multiple addition.
+#. * clean TEXINPUTS, MFINPUTS, TFMFONTS,
+#. as these take prevalence over $TEXMF
+#. and thus may break tex run?
+#. $TEXMF is special, previous value is already taken care of
+#. # -sOutputFile does not work with bbox?
+#. # todo:
+#. # have better algorithm for deciding when to crop page,
+#. # and when to show full page
+#. need to have margin, otherwise edges of letters will
+#. be cropped off.
+#: lilylib.py:508
msgid "Removing output file"
msgstr "Destruction du fichier de sortie"
+#. !@PYTHON@
+#. once upon a rainy monday afternoon.
+#.
+#. ...
+#.
+#. (not finished.)
+#. ABC standard v1.6: http://www.gre.ac.uk/~c.walshaw/abc2mtex/abc.txt
+#.
+#. Enhancements (Roy R. Rankin)
+#.
+#. Header section moved to top of lilypond file
+#. handle treble, treble-8, alto, and bass clef
+#. Handle voices (V: headers) with clef and part names, multiple voices
+#. Handle w: lyrics with multiple verses
+#. Handle key mode names for minor, major, phrygian, ionian, locrian, aeolian,
+#. mixolydian, lydian, dorian
+#. Handle part names from V: header
+#. Tuplets handling fixed up
+#. Lines starting with |: not discarded as header lines
+#. Multiple T: and C: header entries handled
+#. Accidental maintained until next bar check
+#. Silent rests supported
+#. articulations fermata, upbow, downbow, ltoe, accent, tenuto supported
+#. Chord strings([-^]"string") can contain a '#'
+#. Header fields enclosed by [] in notes string processed
+#. W: words output after tune as abc2ps does it (they failed before)
+#. Enhancements (Laura Conrad)
+#.
+#. Barring now preserved between ABC and lilypond
+#. the default placement for text in abc is above the staff.
+#. %%LY now supported.
+#. \breve and \longa supported.
+#. M:none doesn't crash lily.
+#. Limitations
+#.
+#. Multiple tunes in single file not supported
+#. Blank T: header lines should write score and open a new score
+#. Not all header fields supported
+#. ABC line breaks are ignored
+#. Block comments generate error and are ignored
+#. Postscript commands are ignored
+#. lyrics not resynchronized by line breaks (lyrics must fully match notes)
+#. %%LY slyrics can't be directly before a w: line.
+#. ???
+#. TODO:
+#.
+#. Convert to new chord styles.
+#.
+#. UNDEF -> None
+#.
+#. uGUHGUHGHGUGH
+#. UGH
+#. treble8 is used by abctab2ps; -8va is used by barfly,
+#. and by my patch to abc2ps. If there's ever a standard
+#. about this we'll support that.
+#. find keywork
+#. assume that Q takes the form "Q:1/4=120"
+#. There are other possibilities, but they are deprecated
+#. outf.write ("\t\t\\consists Staff_margin_engraver\n")
+#. pitch manipulation. Tuples are (name, alteration).
+#. 0 is (central) C. Alteration -1 is a flat, Alteration +1 is a sharp
+#. pitch in semitones.
+#. abc to lilypond key mode names
+#. semitone shifts for key mode names
+#. latex does not like naked #'s
+#. latex does not like naked "'s
+#. break lyrics to words and put "'s around words containing numbers and '"'s
+#. escape "
+#. _ causes probs inside ""
+#. _ to ' _ '
+#. split words with -
+#. unless \-
+#. ~ to space('_')
+#. * to to space
+#. latex does not like naked #'s
+#. put numbers and " and ( into quoted string
+#. insure space between lines
+#. title
+#. strip trailing blanks
+#. Meter
+#. KEY
+#. seperate clef info
+#. there may or may not be a space
+#. between the key letter and the mode
+#. ugh.
+#. ugh.
+#. Notes
+#. Origin
+#. Reference Number
+#. Area
+#. History
+#. Book
+#. Composer
+#. Default note length
+#. Voice
+#. Words
+#. vocals
+#. tempo
+#. we use in this order specified accidental, active accidental for bar,
+#. active accidental for key
+#. (num / den) / defaultlen < 1/base
+#. return (str, num,den,dots)
+#. ignore slide
+#. ignore roll
+#. s7m2 input doesnt care about spaces
+#.
+#. remember accidental for rest of bar
+#.
+#. get accidental set in this bar or UNDEF if not set
+#. WAT IS ABC EEN ONTZETTENDE PROGRAMMEERPOEP !
+#. failed; not a note!
+#. escape '#'s
+#.
+#. |] thin-thick double bar line
+#. || thin-thin double bar line
+#. [| thick-thin double bar line
+#. :| left repeat
+#. |: right repeat
+#. :: left-right repeat
+#. |1 volta 1
+#. |2 volta 2
+#. first try the longer one
+#. bracket escape
+#. the nobarlines option is necessary for an abc to lilypond translator for
+#. exactly the same reason abc2midi needs it: abc requires the user to enter
+#. the note that will be printed, and MIDI and lilypond expect entry of the
+#. pitch that will be played.
+#.
+#. In standard 19th century musical notation, the algorithm for translating
+#. between printed note and pitch involves using the barlines to determine
+#. the scope of the accidentals.
+#.
+#. Since ABC is frequently used for music in styles that do not use this
+#. convention, such as most music written before 1700, or ethnic music in
+#. non-western scales, it is necessary to be able to tell a translator that
+#. the barlines should not affect its interpretation of the pitch.
+#. write other kinds of appending if we ever need them.
+#. add comments to current voice
+#. Try nibbling characters off until the line doesn't change.
+#. dump_global (outf)
+#. !@PYTHON@
+#.
+#. convert-ly.py -- Update old LilyPond input files (fix name?)
+#.
+#. source file of the GNU LilyPond music typesetter
+#.
+#. (c) 1998--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+#. Jan Nieuwenhuizen <janneke@gnu.org>
+#. TODO
+#. use -f and -t for -s output
+#. NEWS
+#. 0.2
+#. - rewrite in python
+#. Did we ever have \mudela-version? I doubt it.
+#. lilypond_version_re_str = '\\\\version *\"(.*)\"'
+#. ###########################
+#. need new a namespace
+#. raise FatalConversionError()
+#. need new a namespace
+#. harmful to current .lys
+#. str = re.sub ('\\\\key([^;]+);', '\\\\accidentals \\1;', str)
+#. raise FatalConversionError()
+#. raise FatalConversionError()
+#. raise FatalConversionError()
+#. TODO: lots of other syntax change should be done here as well
+#. Ugh, but meaning of \stemup changed too
+#. maybe we should do \stemup -> \stemUp\slurUp\tieUp ?
+#. I don't know exactly when these happened...
+#. ugh, we loose context setting here...
+#. (lacks capitalisation slur -> Slur)
+#. # dynamic..
+#. TODO: add lots of these
+#. ugh
+#. old fix
+#. Make sure groups of more than one ; have space before
+#. them, so that non of them gets removed by next rule
+#. Only remove ; that are not after spaces, # or ;
+#. Otherwise we interfere with Scheme comments,
+#. which is badbadbad.
+#. 40 ?
+#. # end of while <>
+#. add dash: -[, so that [<<a b>> c d] becomes
+#. <<a b>>-[ c d]
+#. and gets skipped by articulation_substitute
+#. this rule doesn't really work,
+#. too lazy to figure out why.
+#. str = re.sub (r'molecule', 'collage', str)
+#. molecule -> collage
+#. -1: remove .
+#. ###############################
+#. END OF CONVERSIONS
+#. ###############################
+#. !@PYTHON@
+#. info mostly taken from looking at files. See also
+#. http://lilypond.org/wiki/?EnigmaTransportFormat
+#. This supports
+#.
+#. * notes
+#. * rests
+#. * ties
+#. * slurs
+#. * lyrics
+#. * articulation
+#. * grace notes
+#. * tuplets
+#.
+#. todo:
+#. * slur/stem directions
+#. * voices (2nd half of frame?)
+#. * more intelligent lyrics
+#. * beams (better use autobeam?)
+#. * more robust: try entertainer.etf (freenote)
+#. * dynamics
+#. * empty measures (eg. twopt03.etf from freenote)
+#.
+#. uGUHGUHGHGUGH
+#. notename 0 == central C
+#. represent pitches as (notename, alteration), relative to C-major scale
+#. a fifth up
+#. minor scale
+#. should cache this.
+#. flag1 isn't all that interesting.
+#. 3: '>',
+#. 18: '\arpeggio' ,
+#. really only for 0, but we only know about 0 and 1
+#. do grace notes.
+#. ugh.
+#. we don't attempt voltas since they fail easily.
+#. and g.repeat_bar == '|:' or g.repeat_bar == ':|:' or g.bracket:
+#. 4 layers.
+#. let's not do this: this really confuses when eE happens to be before a ^text.
+#. if last_tag and last_indices:
+#. etf_file_dict[last_tag][last_indices].append (l)
+#. # do it
+#. staff-spec
+#. should use \addlyrics ?
+#. !@PYTHON@
+#. ###############################################################
+#. Users of python modules should include this snippet
+#. and customize variables below.
+#. We'll suffer this path init stuff as long as we don't install our
+#. python packages in <prefix>/lib/pythonx.y (and don't kludge around
+#. it as we do with teTeX on Red Hat Linux: set some environment var
+#. (PYTHONPATH) in profile)
+#. If set, LILYPONDPREFIX must take prevalence
+#. if datadir is not set, we're doing a build and LILYPONDPREFIX
+#. Customize these
+#. if __name__ == '__main__':
+#. lilylib globals
#: lilypond-book.py:69
msgid ""
-"Process LilyPond snippets in hybrid HTML, LaTeX or texinfo document.\n"
-"Example usage:\n"
+"Process LilyPond snippets in hybrid HTML, LaTeX or texinfo document. Example usage:\n"
"\n"
" lilypond-book --filter=\"tr '[a-z]' '[A-Z]'\" BOOK\n"
" lilypond-book --filter=\"convert-ly --no-version --from=2.0.0 -\" BOOK\n"
" lilypond-book --process='lilypond-bin -I include' BOOK\n"
"\n"
msgstr ""
-"Traiter les snippets LilyPond dans un document hybride HTML, LaTeX ou TexInfo.\n"
-"Exemples d'usage:\n"
+"Traiter les snippets LilyPond dans un document hybride HTML, LaTeX ou TexInfo. Exemple d'usage:\n"
"\n"
-" lilypond-book --filter=\"tr '[a-z]' '[A-Z]'\" LIVRE\n"
+" lilypond-book --filter=\"tr '[a-z]' '[A-Z]'\" LIBRE\n"
" lilypond-book --filter=\"convert-ly --no-version --from=2.0.0 -\" LIVRE\n"
" lilypond-book --process='lilypond-bin -I include' LIVRE\n"
"\n"
#. Bug in option parser: --output=foe is taken as an abbreviation
#. for --output-format.
-#: lilypond-book.py:82 old-lilypond-book.py:123 main.cc:139
+#: lilypond-book.py:81 old-lilypond-book.py:123 main.cc:139
msgid "EXT"
msgstr "EXT"
-#: lilypond-book.py:82 old-lilypond-book.py:123
+#: lilypond-book.py:81 old-lilypond-book.py:123
msgid "use output format EXT (texi [default], texi-html, latex, html)"
msgstr "utiliser le format de sortie EXT (texi (par défaut), texi-html, latex, html)"
-#: lilypond-book.py:83
+#: lilypond-book.py:82
msgid "FILTER"
msgstr "FILTRE"
-#: lilypond-book.py:83
+#: lilypond-book.py:82
msgid "pipe snippets through FILTER [convert-ly -n -]"
msgstr "ouvrir un pipe de snippets à travers le FILTRE [convert-ly -n -]"
-#: lilypond-book.py:85 lilypond-book.py:87 lilypond.py:131
+#: lilypond-book.py:84 lilypond-book.py:86 lilypond.py:131
#: old-lilypond-book.py:130 main.cc:142 main.cc:147
msgid "DIR"
msgstr "RÉP"
-#: lilypond-book.py:85
+#: lilypond-book.py:84
msgid "add DIR to include path"
msgstr "ajouter le RÉPERTOIRE à inclure au chemin de recherche"
-#: lilypond-book.py:86
+#: lilypond-book.py:85
msgid "COMMAND"
msgstr "COMMANDE"
-#: lilypond-book.py:86
+#: lilypond-book.py:85
msgid "process ly_files using COMMAND FILE..."
msgstr "traitre ly_files en utilisant la COMMANDE FICHIER..."
-#: lilypond-book.py:87
+#: lilypond-book.py:86
msgid "write output to DIR"
msgstr "produire la sortie dans le RÉPERTOIRE"
-#: lilypond-book.py:88 lilypond.py:149 midi2ly.py:105 mup2ly.py:78
+#: lilypond-book.py:87 lilypond.py:149 midi2ly.py:105 mup2ly.py:78
#: old-lilypond-book.py:140 main.cc:150
msgid "be verbose"
msgstr "passer en mode explicatif"
-#: lilypond-book.py:89 old-lilypond-book.py:141
+#: lilypond-book.py:88 old-lilypond-book.py:141
msgid "print version information"
msgstr "afficher les informations de version"
-#: lilypond-book.py:90 lilypond.py:151 midi2ly.py:107 mup2ly.py:80
+#: lilypond-book.py:89 lilypond.py:151 midi2ly.py:107 mup2ly.py:80
#: old-lilypond-book.py:142 main.cc:151
msgid "show warranty and copyright"
msgstr "afficher la notice de garantie et du droit d'auteur"
-#: lilypond-book.py:373
+#. only use installed binary when we're installed too.
+#. Recognize special sequences in the input
+#.
+#. (?P<name>regex) -- assign result of REGEX to NAME
+#. *? -- match non-greedily.
+#. (?m) -- multiline regex: make ^ and $ match at each line
+#. (?s) -- make the dot match all characters including newline
+#. don't do this: fucks up with @code{@{}
+#. 'verb': r'''(?P<code>@code{.*?})''',
+#. Hmm
+#. defaults
+#: lilypond-book.py:341
#, python-format
msgid "deprecated ly-option used: %s"
msgstr "option ly-option dépréciée: %s"
-#: lilypond-book.py:374
+#: lilypond-book.py:342
#, python-format
msgid "compatibility mode translation: %s"
msgstr "traduction en mode de compatibilité: %s"
-#: lilypond-book.py:394
+#: lilypond-book.py:362
#, python-format
msgid "ignoring unknown ly option: %s"
msgstr "option ly inconnue et ignorée: %s"
-#: lilypond-book.py:448
+#. URGS
+#. 1 = central C
+#. BARF
+#. use lilypond-bin for latex (.lytex) books,
+#. and lilypond --preview for html, texinfo books?
+#. Ugh. (La)TeX writes progress and error messages on stdout
+#. Redirect to stderr
+#. check if it really is EPS.
+#. Otherwise music glyphs disappear from 2nd and following pages.
+#. TODO: should run dvips -pp -E per page, then we get proper
+#. cropping as well.
+#. make non EPS.
+#: lilypond-book.py:416
#, python-format
-msgid "file not found: %s"
-msgstr "fichier non repéré: %s"
-
-#: lilypond-book.py:750
+msgid "file not found: %s\n"
+msgstr "fichier non repéré: %s\n"
+
+#. TODO: something smart with target formats
+#. (ps, png) and m/ctimes
+#. TODO
+#. URGUGHUGHUGUGHU
+#. URG, makeinfo implicitely prepends dot to ext
+#. specifying no extension is most robust
+#. self.output_print_filename (TEXINFO)
+#. need par after image
+#. # found = dict (map (lambda x: (x, None), types))
+#. # urg python2.1
+#. We want to search for multiple regexes, without searching
+#. the string multiple times for one regex.
+#. Hence, we use earlier results to limit the string portion
+#. where we search.
+#. Since every part of the string is traversed at most once for
+#. every type of snippet, this is linear.
+#. FIXME.
+#. Limiting the search space is a cute
+#. idea, but this *requires* to search
+#. for possible containing blocks
+#. first, at least long as we do not
+#. search for the start of blocks, but
+#. always/directly for the entire
+#. @block ... @end block.
+#: lilypond-book.py:707
#, python-format
msgid "Opening filter `%s'"
msgstr "Filtre d'ouverture `%s'"
-#: lilypond-book.py:862
+#. need anything else besides textwidth?
+#. TEXINFO: '.texinfo',
+#. ugh
+#. FIXME
+#: lilypond-book.py:819
#, python-format
msgid "cannot determine format for: %s"
msgstr "ne peut déterminer le format pour: %s"
-#: lilypond-book.py:903
+#. urg python interface to libkpathsea?
+#. only default to stdout when filtering
+#: lilypond-book.py:860
msgid "Output would overwrite input file; use --output."
msgstr "La sortie va écraser le fichier d'entrée; utiliser --output"
-#: lilypond-book.py:910
+#: lilypond-book.py:867
#, python-format
msgid "Reading %s..."
msgstr "Lecture en cours de %s..."
-#: lilypond-book.py:924
+#. FIXME: containing blocks must be first, see find_toplevel_snippets
+#. 'verb',
+#: lilypond-book.py:881
msgid "Dissecting..."
msgstr "Dissection en cours..."
-#: lilypond-book.py:952
+#. FIXME: @paper is usually not in chunk #0:
+#. \input texinfo @c -*-texinfo-*-
+#. bluntly search first K of source
+#. s = chunks[0].replacement_text ()
+#: lilypond-book.py:909
msgid "Writing snippets..."
msgstr "Écriture de snipplets..."
-#: lilypond-book.py:957
+#: lilypond-book.py:914
msgid "Processing..."
msgstr "Traitement..."
-#: lilypond-book.py:960
+#: lilypond-book.py:917
msgid "All snippets are up to date..."
msgstr "Tous les snipplets sont à jour..."
-#: lilypond-book.py:963
+#: lilypond-book.py:920
#, python-format
msgid "Compiling %s..."
msgstr "Compilation en cours %s..."
-#: lilypond-book.py:971
+#: lilypond-book.py:928
#, python-format
msgid "Processing include: %s"
msgstr "Traitement d'inclustion: %s"
-#: lilypond-book.py:987 lilypond.py:693 midi2ly.py:1017
+#. ###############################################################
+#. # MAIN
+#. ###############################################################
+#: lilypond-book.py:944 lilypond.py:693 midi2ly.py:1018
#: old-lilypond-book.py:1570
#, python-format
msgid "getopt says: `%s'"
msgstr "getopt() indique: « %s »"
+#. !@PYTHON@
+#.
+#. lilypond.py -- Run LilyPond, add titles to bare score, generate printable
+#. document
+#. Invokes: lilypond-bin, latex (or pdflatex), dvips, ps2pdf, gs
+#.
+#. source file of the GNU LilyPond music typesetter
+#.
+#. (c) 1998--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+#. Jan Nieuwenhuizen <janneke@gnu.org>
+#. This is the third incarnation of ly2dvi, now renamed lilypond.
+#.
+#. Earlier incarnations of lilypond were written by
+#. Jeffrey B. Reed<daboys@austin.rr.com> (Python version)
+#. Jan Arne Fagertun <Jan.A.Fagertun@@energy.sintef.no> (Bourne shell script)
+#.
+#. Note: gettext work best if we use ' for program/docstrings and "
+#. for gettextable strings.
+#. USE ''' for docstrings.
+#. ###############################################################
+#. Users of python modules should include this snippet
+#. and customize variables below.
+#. We'll suffer this path init stuff as long as we don't install our
+#. python packages in <prefix>/lib/pythonx.y (and don't kludge around
+#. it as we do with teTeX on Red Hat Linux: set some environment var
+#. (PYTHONPATH) in profile)
+#. If set, LILYPONDPREFIX must take prevalence
+#. if datadir is not set, we're doing a build and LILYPONDPREFIX
+#. Customize these
+#. if __name__ == '__main__':
+#. lilylib globals
#. # FIXME
#. # do -P or -p by default?
#. #help_summary = _ ("Run LilyPond using LaTeX for titling")
msgstr "générer une sortie en format PostScript"
#: lilypond.py:143
-msgid "use pdflatex to generate PDF output"
+msgid "use pdflatex to generate a PDF output"
msgstr "utiliser pdflatex pour générer la sortie en format PDF"
#: lilypond.py:144
msgid "print version number"
msgstr "afficher le numéro de version"
+#. other globals
+#. Pdftex support
+#. # yuk.
+#. lilypond_binary = 'valgrind --suppressions=%(home)s/usr/src/guile-1.6.supp --num-callers=10 %(home)s/usr/src/lilypond/lily/out/lilypond '% { 'home' : '/home/hanwen' }
+#. only use installed binary when we're installed too.
+#. init to empty; values here take precedence over values in the file
+#. # TODO: change name.
+#. for geometry v3
+#. Output formats that lilypond should create
+#. what a name.
+#. ly.warning (_ ("invalid value: %s") % `val`)
+#. ly.warning (_ ("invalid value: %s") % `val`)
#: lilypond.py:234
#, python-format
msgid "no such setting: `%s'"
msgstr "pas de telle configuration: « %s »"
+#. 2 == user interrupt.
#: lilypond.py:284
#, python-format
msgid "LilyPond crashed (signal %d)."
msgid "Continuing..."
msgstr "Poursuite..."
+#. urg
#: lilypond.py:306
#, python-format
msgid "Analyzing %s..."
msgstr "Analyse de %s..."
+#. search only the first 10k
#: lilypond.py:364
#, python-format
msgid "no LilyPond output found for `%s'"
msgstr "aucune sortie de Lilypond n'a été trouvée pour « %s »"
+#. The final \n seems important here. It ensures that the footers and taglines end up on the right page.
+#. TODO: should set textheight (enlarge) depending on papersize.
#: lilypond.py:431
#, python-format
msgid "invalid value: `%s'"
msgstr "valeur invalide: « %s »"
+#. set sane geometry width (a4-width) for linewidth = -1.
+#. who the hell is 597 ?
+#. Ugh. (La)TeX writes progress and error messages on stdout
+#. Redirect to stderr
#: lilypond.py:529
msgid "LaTeX failed on the output file."
msgstr "Échec de LaTex sur le fichier de sortie."
+#. make a preview by rendering only the 1st line
+#. of each score
#: lilypond.py:586
msgid ""
"Trying create PDF, but no PFA fonts found.\n"
"Tentative de création du PDF mais aucune fonte PFA repérée.\n"
"Utilisation des fontes bitmap à la place. L'apparence sera moins bonne."
+#. ugh. Different targets?
+#. Added as functionality to lilypond, because lilypond may well need to do this
+#. in future too.
#. no ps header?
#: lilypond.py:635
#, python-format
msgid "not a PostScript file: `%s'"
msgstr "n'est pas un fichier PostScript: « %s »"
+#. todo
#: lilypond.py:680
#, python-format
msgid "Writing HTML menu `%s'"
msgstr "Écriture du menu HTML « %s »"
+#. signal programming error
+#. Don't convert input files to abspath, rather prepend '.' to include
+#. path.
+#. As a neat trick, add directory part of first input file
+#. to include path. That way you can do without the clumsy -I in:
+#. lilypond -I foe/bar/baz foo/bar/baz/baz.ly
#: lilypond.py:800
msgid "pseudo filter"
msgstr "pseudo filtre"
msgid "pseudo filter only for single input file"
msgstr "pseudo filtre seulement pour le seul fichier d'entrée"
+#. HACK
+#. status = os.system ('lilypond -w')
#: lilypond.py:808 old-lilypond-book.py:1643
msgid "no files specified on command line"
msgstr "aucun fichier spéficié sur la ligne de commande"
+#. Ugh, maybe make a setup () function
+#. hmmm. Wish I'd 've written comments when I wrote this.
+#. now it looks complicated.
#: lilypond.py:840
#, python-format
msgid "filename should not contain spaces: `%s'"
msgstr "le nom de fichier ne peut contenir des espaces: « %s »"
+#. to be sure, add tmpdir *in front* of inclusion path.
+#. os.environ['TEXINPUTS'] = tmpdir + ':' + os.environ['TEXINPUTS']
+#. We catch all exceptions, because we need to do stuff at exit:
+#. * copy any successfully generated stuff from tempdir and
+#. notify user of that
+#. * cleanout tempdir
+#. ## ARGH. This also catches python programming errors.
+#. ## this should only catch lilypond nonzero exit status
+#. ## --hwn
+#. TODO: friendly message about LilyPond setup/failing?
+#.
#: lilypond.py:880
msgid "Running LilyPond failed. Rerun with --verbose for a trace."
msgstr "Échec d'exécution de LilyPond. Réxécuter avec --verbose pour obtenir une trace."
+#. Our LilyPond pseudo filter always outputs to 'lelie'
+#. have subsequent stages and use 'lelie' output.
+#. unless: add --tex, or --latex?
+#. TODO: friendly message about TeX/LaTeX setup,
+#. trying to run tex/latex by hand
#: lilypond.py:921
msgid "Failed to make PS file. Rerun with --verbose for a trace."
msgstr "Échec de génération du fichier PS. Réexécuter avec --verbose pour obtenir une trace."
+#. unless: add --tex, or --latex?
+#. TODO: friendly message about TeX/LaTeX setup,
+#. trying to run tex/latex by hand
#: lilypond.py:951
msgid "Running LaTeX failed. Rerun with --verbose for a trace."
msgstr "Échec de l'exécution de LaTeX. Ré-exécuter avec --verbose pour obtenir une trace."
+#. add DEP to targets?
#: lilypond.py:963 input-file-results.cc:74
#, c-format, python-format
msgid "dependencies output to `%s'..."
msgid "can't find file: `%s'"
msgstr "ne peut repérer le fichier: « %s »"
+#. Hmm, if this were a function, we could call it the except: clauses
#: lilypond.py:1002
#, python-format
msgid "%s output to %s..."
msgid "can't find file: `%s.%s'"
msgstr "ne peut repérer le fichier: « %s.%s »"
+#. !@PYTHON@
+#.
+#. midi2ly.py -- LilyPond midi import script
+#.
+#. source file of the GNU LilyPond music typesetter
+#.
+#. (c) 1998--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+#. Jan Nieuwenhuizen <janneke@gnu.org>
+#. ###############################################################
+#. Users of python modules should include this snippet.
+#.
+#. This soon to be removed for: import lilypond.lilylib as ly
+#. ###############################################################
+#. ###############################################################
+#. ############### CONSTANTS
+#. ###############################################################
#. temp_dir = os.path.join (original_dir, '%s.dir' % program_name)
#. original_dir = os.getcwd ()
#. keep_temp_dir_p = 0
msgid "treat every text as a lyric"
msgstr "traiter chaque texte comme des paroles"
-#: midi2ly.py:149 mup2ly.py:143 input.cc:88
-msgid "warning: "
-msgstr "AVERTISSEMENT: "
+#: midi2ly.py:136 mup2ly.py:130
+msgid " 2001--2004"
+msgstr " 2001--2004"
-#: midi2ly.py:164 midi2ly.py:1017 midi2ly.py:1082 mup2ly.py:146 mup2ly.py:160
-#: input.cc:93
-msgid "error: "
-msgstr "Erreur: "
+#: midi2ly.py:141 mup2ly.py:135
+msgid ""
+"\n"
+"Distributed under terms of the GNU General Public License. It comes with\n"
+"NO WARRANTY."
+msgstr ""
+"\n"
+"Distribué selon les termes de la GNU General Public License. Le logiciel est fourni sans GARANTIE."
-#: midi2ly.py:165 mup2ly.py:161
+#: midi2ly.py:166 mup2ly.py:162
msgid "Exiting ... "
msgstr "Fin d'exécution... "
-#: midi2ly.py:263 mup2ly.py:260
+#: midi2ly.py:264 mup2ly.py:261
#, python-format
msgid "command exited with value %d"
msgstr "fin de la commande avec l'état %d"
-#: midi2ly.py:1001
+#. ###############################################################
+#. END Library
+#. ###############################################################
+#. hmm
+#. major scale: do-do
+#. minor scale: la-la (= + 5) '''
+#. By tradition, all scales now consist of a sequence
+#. of 7 notes each with a distinct name, from amongst
+#. a b c d e f g. But, minor scales have a wide
+#. second interval at the top - the 'leading note' is
+#. sharped. (Why? it just works that way! Anything
+#. else doesn't sound as good and isn't as flexible at
+#. saying things. In medieval times, scales only had 6
+#. notes to avoid this problem - the hexachords.)
+#. So, the d minor scale is d e f g a b-flat c-sharp d
+#. - using d-flat for the leading note would skip the
+#. name c and duplicate the name d. Why isn't c-sharp
+#. put in the key signature? Tradition. (It's also
+#. supposedly based on the Pythagorean theory of the
+#. cycle of fifths, but that really only applies to
+#. major scales...) Anyway, g minor is g a b-flat c d
+#. e-flat f-sharp g, and all the other flat minor keys
+#. end up with a natural leading note. And there you
+#. have it.
+#. John Sankey <bf250@freenet.carleton.ca>
+#.
+#. Let's also do a-minor: a b c d e f gis a
+#.
+#. --jcn
+#. as -> gis
+#. des -> cis
+#. ges -> fis
+#. g -> fisis
+#. d -> cisis
+#. a -> gisis
+#. b -> ces
+#. e -> fes
+#. f -> eis
+#. c -> bis
+#. # FIXME: compile fix --jcn
+#. TODO: move space
+#. fis cis gis dis ais eis bis
+#. bes es as des ges ces fes
+#. urg, we should be sure that we're in a lyrics staff
+#. all include ALL_NOTES_OFF
+#. ugh, must set key while parsing
+#. because Note init uses key
+#. Better do Note.calc () at dump time?
+#. last_lyric.clocks = t - last_time
+#. hmm
+#. urg, this will barf at meter changes
+#. urg LilyPond doesn't start at c4, but
+#. remembers from previous tracks!
+#. reference_note = Note (clocks_per_4, 4*12, 0)
+#. must be in \notes mode for parsing \skip
+#: midi2ly.py:1002
#, python-format
msgid "%s output to `%s'..."
msgstr "%s produites dans « %s »..."
-#: midi2ly.py:1032
+#: midi2ly.py:1033
msgid "Example:"
msgstr "Exemple:"
-#: midi2ly.py:1082
+#: midi2ly.py:1083
msgid "no files specified on command line."
msgstr "aucun fichier spéficié sur la ligne de commande."
+#. !@PYTHON@
+#. mup2ly.py -- mup input converter
+#.
+#. source file of the GNU LilyPond music typesetter
+#.
+#. (c) 2001
+#. if set, LILYPONDPREFIX must take prevalence
+#. if datadir is not set, we're doing a build and LILYPONDPREFIX
#: mup2ly.py:70
msgid "Convert mup to LilyPond source."
msgstr "Convertir le source du format mup en format LilyPond"
msgid "only pre-process"
msgstr "pré-traitement seulement"
-#: mup2ly.py:1075
+#. Duh. Python style portable: cp *.EXT OUTDIR
+#. system ('cp *.%s %s' % (ext, outdir), 1)
+#. Python < 1.5.2 compatibility
+#.
+#. On most platforms, this is equivalent to
+#. `normpath(join(os.getcwd()), PATH)'. *Added in Python version 1.5.2*
+#. if set, LILYPONDPREFIX must take prevalence
+#. if datadir is not set, we're doing a build and LILYPONDPREFIX
+#. ###############################################################
+#. END Library
+#.
+#. PMX cut and paste
+#.
+#. if not self.entries:
+#. #return '\n'
+#. #ugh ugh
+#. return '\n%s = {}\n\n' % self.idstring ()
+#. ugh
+#. def set_clef (self, letter):
+#. clstr = clef_table[letter]
+#. self.voices[0].add_nonchord (Clef (clstr))
+#. urg
+#. maybe use import copy?
+#. for i in self.pitches:
+#. ch.pitches.append (i)
+#. for i in self.scripts:
+#. ch.scripts.append (i)
+#. http://www.arkkra.com/doc/uguide/contexts.html
+#. #self.current_staffs = []
+#. duh
+#. FIXME: 1?
+#. FIXME: does key play any role in this?
+#. ch = self.current_voices[0].last_chord ()
+#. ch.basic_duration = self.current_voices[0].last_chord ().basic_duration
+#. ugh
+#. ch = self.current_voices[0].last_chord ()
+#. `;' is not a separator, chords end with ';'
+#. mup resets default duration and pitch each bar
+#. ugh: these (and lots more) should also be parsed in
+#. context staff. we should have a class Staff_properties
+#. and parse/set all those.
+#. shortcut: set to official mup maximum (duh)
+#. self.set_staffs (40)
+#: mup2ly.py:1076
#, python-format
msgid "no such context: %s"
msgstr "pas de tel contexte: %s"
-#: mup2ly.py:1299
+#. hmm
+#. dig this: mup allows ifdefs inside macro bodies
+#. don't do nested multi-line defines
+#. duh: mup is strictly line-based, except for `define',
+#. which is `@' terminated and may span several lines
+#. don't define new macros in unactive areas
+#. To support nested multi-line define's
+#. process_function and macro_name, macro_body
+#. should become lists (stacks)
+#. The mup manual is undetermined on this
+#. and I haven't seen examples doing it.
+#.
+#. don't do nested multi-line define's
+#. writes to stdout for help2man
+#. don't call
+#. identify ()
+#. sys.stdout.flush ()
+#. handy emacs testing
+#. if not files:
+#. files = ['template.mup']
+#: mup2ly.py:1300
#, python-format
msgid "Processing `%s'..."
msgstr "Traitement de « %s »..."
-#: mup2ly.py:1318
+#: mup2ly.py:1319
#, python-format
msgid "Writing `%s'..."
msgstr "Écriture de « %s »..."
+#. duh
+#. !@PYTHON@
+#. musedata = musedata.stanford.edu
+#. musedata = COBOL for musicians.
+#. TODO
+#.
+#. * clefs,
+#. * keys,
+#. * staffs,
+#. * multiple voices (they use `Backspace' (shudder)
+#. * tuplets
+#.
+#.
+#. I completely forgot how this was supposed to work --hwn 5/2002
+#.
+#.
+#. uGUHGUHGHGUGH
+#. musedata license (argh)
+#. ignore sound & print
+#. !@PYTHON@
+#. vim: set noexpandtab:
+#. This is was the idea for handling of comments:
+#. Multiline comments, @ignore .. @end ignore is scanned for
+#. in read_doc_file, and the chunks are marked as 'ignore', so
+#. lilypond-book will not touch them any more. The content of the
+#. chunks are written to the output file. Also 'include' and 'input'
+#. regex has to check if they are commented out.
+#.
+#. Then it is scanned for 'lilypond', 'lilypond-file' and 'lilypond-block'.
+#. These three regex's has to check if they are on a commented line,
+#. % for latex, @c for texinfo.
+#.
+#. Then lines that are commented out with % (latex) and @c (Texinfo)
+#. are put into chunks marked 'ignore'. This cannot be done before
+#. searching for the lilypond-blocks because % is also the comment character
+#. for lilypond.
+#.
+#. The the rest of the rexeces are searched for. They don't have to test
+#. if they are on a commented out line.
+#. ###############################################################
+#. Users of python modules should include this snippet
+#. and customize variables below.
+#. We'll suffer this path init stuff as long as we don't install our
+#. python packages in <prefix>/lib/pythonx.y (and don't kludge around
+#. it as we do with teTeX on Red Hat Linux: set some environment var
+#. (PYTHONPATH) in profile)
+#. If set, LILYPONDPREFIX must take prevalence
+#. if datadir is not set, we're doing a build and LILYPONDPREFIX
+#. Customize these
+#. if __name__ == '__main__':
+#. lilylib globals
#. # FIXME
#. # do -P or -p by default?
#. #help_summary = _ ("Run LilyPond using LaTeX for titling")
#: old-lilypond-book.py:118
-msgid "Process LilyPond snippets in hybrid HTML, LaTeX or texinfo document"
-msgstr "Traiter les snippets LilyPond dans un document hybride en HTML, LaTeX ou texinfo"
+msgid "Process LilyPond snippets in hybrid html, LaTeX or texinfo document"
+msgstr "Traiter les fragments dans un document hybride en html, LaTeX ou texinfo"
#: old-lilypond-book.py:124 old-lilypond-book.py:125 old-lilypond-book.py:127
#: old-lilypond-book.py:128
msgid "where to place generated files"
msgstr "où seront placés les fichiers générés"
+#. format specific strings, ie. regex-es for input, and % strings for output
+#. global variables
+#. lilypond_binary = 'valgrind --suppressions=/home/hanwen/usr/src/guile-1.6.supp --num-callers=10 /home/hanwen/usr/src/lilypond/lily/out/lilypond'
+#. only use installed binary when we're installed too.
+#. only use installed binary when we're installed too.
+#. ###############################################################
+#. Dimension handling for LaTeX.
+#.
+#. Ugh. (La)TeX writes progress and error messages on stdout
+#. Redirect to stderr
#: old-lilypond-book.py:227
msgid "LaTeX failed."
msgstr "Échec de LaTeX"
msgid "invalid argument `%s' to option `%s'"
msgstr "argument invalide « %s » pour l'option « %s »"
-#: warn.cc:44
+#: warn.cc:25
+#, c-format
+msgid "warning: %s\n"
+msgstr "AVERTISSEMENT: %s\n"
+
+#: warn.cc:31
#, c-format
-msgid "programming error: %s"
-msgstr "erreur de programmation: %s"
+msgid "error: %s\n"
+msgstr "Erreur: %s\n"
-#: warn.cc:45
-msgid "Continuing; crossing fingers"
-msgstr "Poursuite; croisons les doigts"
+#: warn.cc:44
+#, c-format
+msgid "programming error: %s (Continuing; crossing fingers)\n"
+msgstr "Erreur de programmation: %s (Poursuite; croisons les doigts)\n"
#: accidental.cc:219 key-signature-interface.cc:139
#, c-format
#: accidental-engraver.cc:194
#, c-format
-msgid "ignoring unknown accidental: %s"
-msgstr "option inconnue et accidentelle: %s"
+msgid "unknown accidental typesetting: %s. Ignored"
+msgstr "mise en page accidentelle inconnue: %s. Ignorée"
#: accidental-engraver.cc:211
#, c-format
msgstr "ne concorde pas: « %s »"
#: all-font-metrics.cc:107
-msgid "Rebuild all .afm files, and remove all .pk and .tfm files."
-msgstr "Reconstruire tous les fichiers .afm et enlever tous les fichiers .pk et .tfm."
-
-#: all-font-metrics.cc:109
-msgid "Rerun with -V to show font paths."
-msgstr "Ré-exécuter avec l'option -V pour afficher les chemins vers les fontes."
+msgid ""
+" Rebuild all .afm files, and remove all .pk and .tfm files.\n"
+"Rerun with -V to show font paths.\n"
+msgstr ""
+" Reconstruire tous les fichiers .afm et enlever tous les fichiers .pk et .tfm.\n"
+"Ré-exécuter avec l'option -V pour afficher les chemins vers les fontes\n"
-#: all-font-metrics.cc:111
-msgid "A script for removing font-files is delivered with the source-code:"
-msgstr "Un script pour enlever les fichiers de fontes est livré avec le code source:"
+#: all-font-metrics.cc:108
+msgid ""
+"A script for removing font-files is delivered with the source-code,\n"
+"in buildscripts/clean-fonts.sh"
+msgstr ""
+"Un script pour enlever les fichiers de fontes est livré avec le code source,\n"
+"dans buildscripts/clean-fonts.sh"
-#: all-font-metrics.cc:192
+#: all-font-metrics.cc:188
#, c-format
msgid "can't find font: `%s'"
msgstr "ne peut repérer la fonte: « %s »"
-#: all-font-metrics.cc:193
+#: all-font-metrics.cc:189
msgid "Loading default font"
msgstr "Chargement de la fonte par défaut"
-#: all-font-metrics.cc:208
+#: all-font-metrics.cc:204
#, c-format
msgid "can't find default font: `%s'"
msgstr "ne peut reprérer la fonte par défaut: « %s »"
-#: all-font-metrics.cc:209 includable-lexer.cc:59 input-file-results.cc:218
+#: all-font-metrics.cc:205 includable-lexer.cc:59 input-file-results.cc:218
#, c-format
msgid "(search path: `%s')"
msgstr "(chemin de recherche: « %s »)"
-#: all-font-metrics.cc:210
+#: all-font-metrics.cc:206
msgid "Giving up"
msgstr "Abandon"
msgstr "faisceau a moins que deux queues visibles"
#: beam.cc:156
-msgid "removing beam with less than two stems"
-msgstr "retrait du faisceau ayant moins que deux tiges"
+msgid "Beam has less than two stems. Removing beam."
+msgstr "faisceau a moins de deux queues. Retrait du faisceau."
-#: beam.cc:1040
-msgid "no viable initial configuration found: may not find good beam slope"
-msgstr "pas de configuration initiale viable repérée: peut ne pas repérer une pente de faisceau"
+#: beam.cc:1041
+msgid "Not sure that we can find a nice beam slope (no viable initial configuration found)."
+msgstr "Pas certain que l'on puisse repérer un joli pente dans le faisceau (configuration initiale viable non repérée)"
#: beam-engraver.cc:139
msgid "already have a beam"
msgid "unterminated beam"
msgstr "faisceau non terminé"
-#: beam-engraver.cc:245 chord-tremolo-engraver.cc:179
+#: beam-engraver.cc:245 chord-tremolo-engraver.cc:191
msgid "stem must have Rhythmic structure"
msgstr "la queue doit avoir une structure rythmiique"
#.
#. last->translator_id_string_ = get_change ()->change_to_id_string_;
#.
-#: change-iterator.cc:87
+#: change-iterator.cc:80
msgid "I'm one myself"
msgstr "J'en suis un moi-même"
-#: change-iterator.cc:90
+#: change-iterator.cc:83
msgid "none of these in my family"
msgstr "aucun de ceux-ci dans ma famille"
msgid "Chord tremolo with %d elements. Must have two elements."
msgstr "Accord de tremolo avec %d éléments. Doit avoir 2 éléments."
-#: chord-tremolo-engraver.cc:141
+#: chord-tremolo-engraver.cc:153
msgid "unterminated chord tremolo"
msgstr "accord de tremolo non terminé"
msgid "Transposition by %s makes alteration larger than two"
msgstr "Transposition faite par %s crée des altérations plus grande que deux"
-#: event.cc:72
-#, c-format
-msgid "octave check failed; expected %s, found: %s"
-msgstr "vérification de l'octave a échoué; attendait %s, a obtenu: %s"
+#: event.cc:69 relative-octave-check.cc:25
+msgid "Failed octave check, got: "
+msgstr "échec de la vérification de l'octave, a obtenu: "
#: event-chord-iterator.cc:56 output-property-music-iterator.cc:29
#, c-format
msgid "Conflicting note group events."
msgstr "Événements de groupe de notes conflictuels."
-#: hyphen-engraver.cc:96
-msgid "removing unterminated hyphen"
-msgstr "retrait du trait d'union non terminé"
-
-#: hyphen-engraver.cc:110
+#: hyphen-engraver.cc:96 hyphen-engraver.cc:110
msgid "unterminated hyphen; removing"
-msgstr "retrait du trait d'union non terminé"
+msgstr "trait d'union non terminé; a été enlevé"
#: includable-lexer.cc:50
msgid "include files are not allowed"
msgid "FIXME: key change merge"
msgstr "FIXME: changement de fusion de clés"
-#: kpath.cc:75
+#: kpath.cc:76
#, c-format
-msgid "kpathsea can not find TFM file: `%s'"
+msgid "Kpathsea couldn't find TFM file `%s'"
msgstr "Kpathsea ne peut repérer le fichier TFM: « %s »"
#: ligature-engraver.cc:152
msgstr "ligature non terminée"
#: ligature-engraver.cc:279
-msgid "ignoring rest: ligature may not contain rest"
-msgstr "le reste est ignoré: la ligature ne peut contenir le reste"
+msgid "ligature may not contain rest; ignoring rest"
+msgstr "ligature ne peut contenir une pause; pause ignorée"
#: ligature-engraver.cc:280
msgid "ligature was started here"
msgstr "Usage: %s [OPTIONS]... FICHIER..."
#: main.cc:199
-#, c-format
+#, fuzzy
msgid "Typeset music and/or produce MIDI from FILE."
msgstr "Composer la musique et/ou jouer en format MIDI Ã partir du FICHIER"
#: main.cc:201
-#, c-format
msgid "LilyPond produces beautiful music notation."
msgstr "LilyPond produit une jolie notation musicale"
#: main.cc:203
#, c-format
-msgid "For more information, see %s"
+msgid "For more information, see %s,"
msgstr "Pour plus d'informations, voir %s"
#: main.cc:369
-#, c-format
msgid "This option is for developers only."
msgstr "Cette option n'est disponible que pour les développeurs seulement."
#: main.cc:370
-#, c-format
msgid "Read the sources for more information."
msgstr "Lire les fichiers source pour plus d'information."
#: midi-item.cc:273
#, c-format
msgid "Experimental: temporarily fine tuning (of %d cents) a channel."
-msgstr "Expérimental: mise au point fine temporaire (de %d cents) du canal."
+msgstr ""
#: midi-stream.cc:40
-#, c-format
-msgid "could not write file: `%s'"
-msgstr "ne peut écrire dans le fichier: « %s »"
+msgid "Could not write file. Disk full?"
+msgstr "Ne peut écrire dans le fichier. Disque plein?"
#: my-lily-lexer.cc:185
#, c-format
#: new-fingering-engraver.cc:235
msgid "Fingerings are also not down?! Putting them down anyway."
-msgstr "Les doigtés ne sont pas aussi abaissées?! On les abaisse de toutes manières."
+msgstr ""
#: new-lyric-combine-music-iterator.cc:172
-#, c-format
-msgid "cannot find Voice: %s"
-msgstr "ne peut repérer les Voix: %s"
+#, fuzzy, c-format
+msgid "cannot find Voice: %s\n"
+msgstr "ne peut repérer le fichier: « %s »"
#: note-collision.cc:384
msgid "Too many clashing notecolumns. Ignoring them."
#: piano-pedal-engraver.cc:238
msgid "Need 3 strings for piano pedals. No pedal made. "
-msgstr "Nécessite 3 cordes pour les pédales du piano. Aucune pédale n'a été créée."
+msgstr ""
#: piano-pedal-engraver.cc:253 piano-pedal-engraver.cc:268
#: piano-pedal-performer.cc:82
msgstr "ne peut repérer le début de la pédale de piano: « %s »"
#: piano-pedal-engraver.cc:321
-#, c-format
+#, fuzzy, c-format
msgid "can't find start of piano pedal bracket: `%s'"
-msgstr "ne peut repérer le début du crochet de la pédale de piano: « %s »"
+msgstr "ne peut repérer le début de la pédale de piano: « %s »"
#: property-iterator.cc:94
#, c-format
msgid "In quotation: junking event %s"
msgstr "Entre guillemets: événement rebut « %s »"
-#: relative-octave-check.cc:25
-msgid "Failed octave check, got: "
-msgstr "échec de la vérification de l'octave, a obtenu: "
-
-#: rest.cc:137
+#: rest.cc:140
#, c-format
-msgid "rest `%s' not found"
-msgstr "reste « %s » non repéré"
+msgid "rest `%s' not found, "
+msgstr "symbole `%s' non repéré, "
#: rest-collision.cc:145
msgid "rest direction not set. Cannot resolve collision."
-msgstr "le reste de la direction n'a pas été initialisé. Ne peut résoudre la collision."
+msgstr ""
#: rest-collision.cc:193
msgid "too many colliding rests"
msgstr "trop de pauses en collision"
#: scm-option.cc:52
-#, c-format
msgid "lilypond -e EXPR means:"
msgstr "lilypond -e EXPRESSION signifie:"
#: scm-option.cc:54
-#, c-format
msgid " Evalute the Scheme EXPR before parsing any .ly files."
msgstr "Evaluer l'EXPRESSION Scheme avant d'analyser les fichiers .ly"
#: scm-option.cc:56
-#, c-format
msgid " Multiple -e options may be given, they will be evaluated sequentially."
msgstr "Les options multiples -e peuvent être fournis, elles seront évaluées séquentiellement."
#: scm-option.cc:58
-#, c-format
msgid " The function ly-set-option allows for access to some internal variables."
msgstr "L'option de la fonction ly-set-option permet l'accès à quelques variables internes."
#: scm-option.cc:60
-#, c-format
-msgid "Usage: lilypond-bin -e \"(ly-set-option SYMBOL VAL)\""
-msgstr "Usage: lilypond-bin -e \"(ly-set-option SYMBOLE VALEUR)\""
+msgid "Usage: lilypond -e \"(ly-set-option SYMBOL VAL)\""
+msgstr "Usage: lilypond -e \"(ly-set-option SYMBOLE VALEUR)\""
#: scm-option.cc:62
-#, c-format
msgid "Where SYMBOL VAL pair is any of:"
msgstr "Où la paire SYMBOLE VALEUR peut prendre les options suivantes:"
msgid "Huh? Got %d, expected %d characters"
msgstr "Euh? Obtenu %d caractères, on s'attendait à %d"
-#: spacing-spanner.cc:385
+#: spacing-spanner.cc:386
#, c-format
-msgid "Global shortest duration is %s"
-msgstr "La plus courte durée globale est %s"
+msgid "Global shortest duration is %s\n"
+msgstr "La plus petite durée globale est %s\n"
#: spring-smob.cc:32
#, c-format
msgid "tremolo duration is too long"
msgstr "durée du tremolo est trop longue"
-#: stem-engraver.cc:128
+#: stem-engraver.cc:126
#, c-format
msgid "Adding note head to incompatible stem (type = %d)"
msgstr "Ajout d'une note de tête à une hampe incompatible (type = %d)"
-#: stem-engraver.cc:129
+#: stem-engraver.cc:127
msgid "Don't you want polyphonic voices instead?"
msgstr "Ne désirez-vous pas de voix polyphoniques à la place?"
#: system.cc:335
#, c-format
-msgid "Grob count %d"
-msgstr "Compteur grob %d"
+msgid "Grob count %d "
+msgstr "Éléments de type grob dénombrés %d."
#: system.cc:349
msgid "Calculating line breaks..."
#: tuplet-bracket.cc:448
msgid "Killing tuplet bracket across linebreak."
-msgstr "Abandon des accolades de tuples à travers le bris de ligne."
+msgstr ""
#: vaticana-ligature.cc:92
msgid "ascending vaticana style flexa"
msgid "More alternatives than repeats. Junking excess alternatives."
msgstr "Plus d'alternatives que de répétitions. Rebuts dépasse la limite des alternatives."
-#: parser.yy:857 parser.yy:864
+#: parser.yy:856 parser.yy:863
msgid "\\applycontext takes function argument"
msgstr "\\applycontext nécessite un argument de fonction"
-#: parser.yy:1014
+#: parser.yy:1013
msgid "\\apply takes function argument"
msgstr "\\apply nécessite un argument de fonction"
-#: parser.yy:1377
+#: parser.yy:1376
msgid "Can't find music"
msgstr "ne peut trouver la musique"
-#: parser.yy:1495
+#: parser.yy:1494
+#, fuzzy
msgid "Second argument must be pitch list."
-msgstr "Le second argument doit être une liste de tons."
+msgstr "Le second argument doit être un symbole"
-#: parser.yy:1532 parser.yy:1537 parser.yy:2070
+#: parser.yy:1531 parser.yy:1536 parser.yy:2069
msgid "Have to be in Lyric mode for lyrics"
msgstr "Doit être en mode Lyric pour les paroles"
-#: parser.yy:1622
+#: parser.yy:1621
msgid "Expecting string as script definition"
msgstr "Chaîne attendue comme définition de script"
-#: parser.yy:1829 parser.yy:1884
+#: parser.yy:1828 parser.yy:1883
#, c-format
msgid "not a duration: %d"
msgstr "n'est pas une durée: %d"
-#: parser.yy:1980
+#: parser.yy:1979
msgid "Have to be in Note mode for notes"
msgstr "Doit être en mode Note pour les notes"
-#: parser.yy:2085
+#: parser.yy:2084
msgid "Have to be in Chord mode for chords"
msgstr "Doit être en mode Chord pour les choeurs"
-#: parser.yy:2232
+#: parser.yy:2231
msgid "need integer number arg"
msgstr "A besoin d'un nombre entier pour l'argument"
-#: parser.yy:2383
+#: parser.yy:2382
msgid "Suspect duration found following this beam"
msgstr "Durée suspecte repéré après ce faisceau"
-#: lexer.ll:184
+#: lexer.ll:183
#, c-format
-msgid "input renamed to: `%s'"
-msgstr "l'entrée a été renommée à : « %s »"
+msgid ""
+"\n"
+"Renamed input to `%s'\n"
+msgstr ""
+"\n"
+"L'entrée a été renommé à « %s »\n"
-#: lexer.ll:210
+#: lexer.ll:208
msgid "EOF found inside a comment"
msgstr "Fin de fichier (EOF) à l'intérieur du commentaire"
-#: lexer.ll:225
+#: lexer.ll:223
msgid "\\maininput not allowed outside init files"
msgstr "\\maininput n,est pas permis en dehord des fichiers init"
-#: lexer.ll:249
+#: lexer.ll:247
#, c-format
msgid "wrong or undefined identifier: `%s'"
msgstr "identificateur erroné ou non défini: « %s »"
#. backup rule
-#: lexer.ll:258
+#: lexer.ll:256
msgid "Missing end quote"
msgstr "Caractère de fin de citation manquant"
-#: lexer.ll:400
+#: lexer.ll:398
msgid "Brace found at end of lyric. Did you forget a space?"
msgstr "Accolade repérée à la fin des paroles. Avez-vous oublié un espace?"
-#: lexer.ll:501
+#: lexer.ll:499
+#, fuzzy
msgid "Brace found at end of markup. Did you forget a space?"
-msgstr "Accolade repérée à la fin du marquage. Avez-vous oublié un espace?"
+msgstr "Accolade repérée à la fin des paroles. Avez-vous oublié un espace?"
-#: lexer.ll:584
+#: lexer.ll:582
#, c-format
msgid "invalid character: `%c'"
msgstr "caractère invalide: « %c »"
-#: lexer.ll:656 lexer.ll:657
+#: lexer.ll:654
#, c-format
msgid "unknown escaped string: `\\%s'"
msgstr "chaîne d'échappement inconnue: « \\%s »"
-#: lexer.ll:754 lexer.ll:755
+#: lexer.ll:752
#, c-format
msgid "Incorrect lilypond version: %s (%s, %s)"
msgstr "Version de lilypond incorrecte: %s (%s, %s)"
-#: lexer.ll:755 lexer.ll:756
+#: lexer.ll:753
msgid "Consider updating the input with the convert-ly script"
msgstr "Considérer la mise à jour de l'entrée à l'aide du script convert-ly"
-#~ msgid " 1998--2003"
-#~ msgstr " 1998--2003"
-
-#~ msgid " 2001--2004"
-#~ msgstr " 2001--2004"
-
-#~ msgid ""
-#~ "\n"
-#~ "Distributed under terms of the GNU General Public License. It comes with\n"
-#~ "NO WARRANTY."
-#~ msgstr ""
-#~ "\n"
-#~ "Distribué selon les termes de la GNU General Public License. Le logiciel est fourni sans GARANTIE."
-
-#~ msgid "unknown accidental typesetting: %s. Ignored"
-#~ msgstr "mise en page accidentelle inconnue: %s. Ignorée"
-
-#~ msgid "Beam has less than two stems. Removing beam."
-#~ msgstr "faisceau a moins de deux queues. Retrait du faisceau."
-
-#~ msgid "Not sure that we can find a nice beam slope (no viable initial configuration found)."
-#~ msgstr "Pas certain que l'on puisse repérer un joli pente dans le faisceau (configuration initiale viable non repérée)"
-
-#~ msgid ""
-#~ "\n"
-#~ "Renamed input to `%s'\n"
-#~ msgstr ""
-#~ "\n"
-#~ "L'entrée a été renommé à « %s »\n"
-
#~ msgid "verbose"
#~ msgstr "mode explicatif"
#~ msgid "staff symbol: indentation yields beyond end of line"
#~ msgstr "symbole staff: l'indentation a cédé avant la fin de la ligne"
+#~ msgid "can't create directory: `%s'"
+#~ msgstr "ne peut créer le répertoire: « %s »"
+
#~ msgid "No ties were created!"
#~ msgstr "Aucun lien n'a été créé!"
#~ msgid "<stdin>"
#~ msgstr "<stdin>"
+#~ msgid "programming error: "
+#~ msgstr "erreur de programmation: "
+
#~ msgid "can't find start of beam"
#~ msgstr "ne peut repérer le début du faisceau"
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2004-04-03 19:27+0200\n"
+"POT-Creation-Date: 2004-03-31 16:22+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
msgstr ""
#: lilylib.py:63 lilypond-book.py:84 lilypond.py:127 midi2ly.py:100
-#: mup2ly.py:75 old-lilypond-book.py:129 main.cc:139
+#: mup2ly.py:75 old-lilypond-book.py:129 main.cc:140
msgid "print this help"
msgstr ""
msgid "Usage: %s [OPTIONS]... FILE"
msgstr ""
-#: lilylib.py:194 midi2ly.py:227 mup2ly.py:223 main.cc:204
+#: lilylib.py:194 midi2ly.py:227 mup2ly.py:223 main.cc:205
#, c-format
msgid "Options:"
msgstr ""
-#: lilylib.py:198 midi2ly.py:231 mup2ly.py:227 main.cc:208
+#: lilylib.py:198 midi2ly.py:231 mup2ly.py:227 main.cc:209
#, c-format, python-format
msgid "Report bugs to %s."
msgstr ""
#. Bug in option parser: --output=foe is taken as an abbreviation
#. for --output-format.
-#: lilypond-book.py:82 old-lilypond-book.py:123 main.cc:138
+#: lilypond-book.py:82 old-lilypond-book.py:123 main.cc:139
msgid "EXT"
msgstr ""
msgstr ""
#: lilypond-book.py:85 lilypond-book.py:87 lilypond.py:131
-#: old-lilypond-book.py:130 main.cc:141 main.cc:146
+#: old-lilypond-book.py:130 main.cc:142 main.cc:147
msgid "DIR"
msgstr ""
msgstr ""
#: lilypond-book.py:88 lilypond.py:149 midi2ly.py:105 mup2ly.py:78
-#: old-lilypond-book.py:140 main.cc:149
+#: old-lilypond-book.py:140 main.cc:150
msgid "be verbose"
msgstr ""
msgstr ""
#: lilypond-book.py:90 lilypond.py:151 midi2ly.py:107 mup2ly.py:80
-#: old-lilypond-book.py:142 main.cc:150
+#: old-lilypond-book.py:142 main.cc:151
msgid "show warranty and copyright"
msgstr ""
msgstr ""
#: lilypond.py:129 lilypond.py:136 midi2ly.py:102 old-lilypond-book.py:136
-#: old-lilypond-book.py:137 main.cc:142 main.cc:145
+#: old-lilypond-book.py:137 main.cc:143 main.cc:146
msgid "FILE"
msgstr ""
msgid "don't run LilyPond"
msgstr ""
-#: lilypond.py:135 main.cc:144
+#: lilypond.py:135 main.cc:145
msgid "produce MIDI output only"
msgstr ""
-#: lilypond.py:136 midi2ly.py:102 mup2ly.py:76 main.cc:145
+#: lilypond.py:136 midi2ly.py:102 mup2ly.py:76 main.cc:146
msgid "write output to FILE"
msgstr ""
msgid "change global setting KEY to VAL"
msgstr ""
-#: lilypond.py:150 midi2ly.py:106 mup2ly.py:79 main.cc:148
+#: lilypond.py:150 midi2ly.py:106 mup2ly.py:79 main.cc:149
msgid "print version number"
msgstr ""
msgid "Accidental rule must be pair or context-name; Found %s"
msgstr ""
-#: afm.cc:154
+#: afm.cc:145
#, c-format
msgid "Error parsing AFM file: `%s'"
msgstr ""
#.
#. last->translator_id_string_ = get_change ()->change_to_id_string_;
#.
-#: change-iterator.cc:93
+#: change-iterator.cc:87
msgid "I'm one myself"
msgstr ""
-#: change-iterator.cc:96
+#: change-iterator.cc:90
msgid "none of these in my family"
msgstr ""
msgid "implied \\%s added"
msgstr ""
-#: grob-interface.cc:73
-#, c-format
-msgid "Unknown interface `%s'"
-msgstr ""
-
-#: grob-interface.cc:84
-#, c-format
-msgid "Grob `%s' has no interface for property `%s'"
-msgstr ""
-
#: hairpin.cc:98
msgid "decrescendo too small"
msgstr ""
msgid "round filled box vertical extent smaller than blot; decreasing blot"
msgstr ""
-#: main.cc:99
+#: main.cc:100
msgid ""
"This program is free software. It is covered by the GNU General Public\n"
"License and you are welcome to change it and/or distribute copies of it\n"
"information.\n"
msgstr ""
-#: main.cc:105
+#: main.cc:106
msgid ""
" This program is free software; you can redistribute it and/or\n"
"modify it under the terms of the GNU General Public License version 2\n"
"Boston, MA 02111-1307, USA.\n"
msgstr ""
-#: main.cc:134
+#: main.cc:135
msgid "EXPR"
msgstr ""
-#: main.cc:135
+#: main.cc:136
msgid "set options, use -e '(ly-option-usage)' for help"
msgstr ""
-#: main.cc:138
+#: main.cc:139
msgid "use output format EXT"
msgstr ""
-#: main.cc:140
+#: main.cc:141
msgid "FIELD"
msgstr ""
-#: main.cc:140
+#: main.cc:141
msgid "write header field to BASENAME.FIELD"
msgstr ""
-#: main.cc:141
+#: main.cc:142
msgid "add DIR to search path"
msgstr ""
-#: main.cc:142
+#: main.cc:143
msgid "use FILE as init file"
msgstr ""
-#: main.cc:143
+#: main.cc:144
msgid "write Makefile dependencies"
msgstr ""
-#: main.cc:146
+#: main.cc:147
msgid "prepend DIR to dependencies"
msgstr ""
-#: main.cc:147
+#: main.cc:148
msgid "run in safe mode"
msgstr ""
-#: main.cc:170
+#: main.cc:171
#, c-format
msgid ""
"Copyright (c) %s by\n"
msgstr ""
#. No version number or newline here. It confuses help2man.
-#: main.cc:196
+#: main.cc:197
#, c-format
msgid "Usage: %s [OPTIONS]... FILE..."
msgstr ""
-#: main.cc:198
+#: main.cc:199
#, c-format
msgid "Typeset music and/or produce MIDI from FILE."
msgstr ""
-#: main.cc:200
+#: main.cc:201
#, c-format
msgid "LilyPond produces beautiful music notation."
msgstr ""
-#: main.cc:202
+#: main.cc:203
#, c-format
msgid "For more information, see %s"
msgstr ""
-#: main.cc:368
+#: main.cc:369
#, c-format
msgid "This option is for developers only."
msgstr ""
-#: main.cc:369
+#: main.cc:370
#, c-format
msgid "Read the sources for more information."
msgstr ""
msgid "note head `%s' not found"
msgstr ""
-#: paper-def.cc:89
+#: paper-def.cc:73
#, c-format
msgid "paper output to `%s'..."
msgstr ""
msgid "Preprocessing graphical objects..."
msgstr ""
-#. prevent warning
-#: parse-scm.cc:82
+#: parse-scm.cc:81
msgid "GUILE signaled an error for the expression beginning here"
msgstr ""
msgid "Also have a stopped spanner. Giving up."
msgstr ""
-#: parser.yy:80
+#: parser.yy:114
msgid "Tag must be symbol or list of symbols."
msgstr ""
-#: parser.yy:510
+#: parser.yy:513
msgid "Identifier should have alphabetic characters only"
msgstr ""
-#: parser.yy:773
+#: parser.yy:776
msgid "More alternatives than repeats. Junking excess alternatives."
msgstr ""
-#: parser.yy:854 parser.yy:861
+#: parser.yy:857 parser.yy:864
msgid "\\applycontext takes function argument"
msgstr ""
-#: parser.yy:1011
+#: parser.yy:1014
msgid "\\apply takes function argument"
msgstr ""
-#: parser.yy:1374
+#: parser.yy:1377
msgid "Can't find music"
msgstr ""
-#: parser.yy:1497
+#: parser.yy:1495
msgid "Second argument must be pitch list."
msgstr ""
-#: parser.yy:1534 parser.yy:1539 parser.yy:2071
+#: parser.yy:1532 parser.yy:1537 parser.yy:2070
msgid "Have to be in Lyric mode for lyrics"
msgstr ""
-#: parser.yy:1624
+#: parser.yy:1622
msgid "Expecting string as script definition"
msgstr ""
-#: parser.yy:1831 parser.yy:1885
+#: parser.yy:1829 parser.yy:1884
#, c-format
msgid "not a duration: %d"
msgstr ""
-#: parser.yy:1981
+#: parser.yy:1980
msgid "Have to be in Note mode for notes"
msgstr ""
-#: parser.yy:2086
+#: parser.yy:2085
msgid "Have to be in Chord mode for chords"
msgstr ""
-#: parser.yy:2233
+#: parser.yy:2232
msgid "need integer number arg"
msgstr ""
-#: parser.yy:2384
+#: parser.yy:2383
msgid "Suspect duration found following this beam"
msgstr ""
#
msgid ""
msgstr ""
-"Project-Id-Version: lilypond 2.2.0\n"
+"Project-Id-Version: lilypond 2.1.36\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2004-03-31 16:22+0200\n"
-"PO-Revision-Date: 2004-04-11 11:01+0200\n"
+"PO-Revision-Date: 2004-03-31 16:21+0200\n"
"Last-Translator: Jan Nieuwenhuizen <janneke@gnu.org>\n"
-"Language-Team: Dutch <vertaling@nl.linux.org>\n"
+"Language-Team: Dutch <nl@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=ISO-8859-1\n"
"Content-Transfer-Encoding: 8bit\n"
"Date: 2001-05-09 23:29+0200\n"
"From: <janneke@gnu.org>\n"
-"Xgettext-Options: --c++ --default-domain=lilypond --join --output-dir=../po --add-comments --keyword=_\n"
+"Xgettext-Options: --c++ --default-domain=lilypond --join --output-dir=../po "
+"--add-comments --keyword=_\n"
"Files: bow.cc int.cc\n"
#: lilylib.py:60
"Verwerk LilyPond snippers in hybride HTML, LaTeX of texinfo dokument.\n"
"Gebruiksvoorbeeld:\n"
" lilypond-book --filter=\\\"tr '[a-z]' '[A-Z]'\\\" BOEK\\n\"\n"
-" lilypond-book --filter=\\\"convert-ly --no-version --from=2.0.0 -\\\" BOEK\\n\n"
+" lilypond-book --filter=\\\"convert-ly --no-version --from=2.0.0 -\\\" BOEK"
+"\\n\n"
" lilypond-book --process='lilypond-bin -I invoeging' BOEK\\n\"\n"
#. Bug in option parser: --output=foe is taken as an abbreviation
#: lilypond.py:880
msgid "Running LilyPond failed. Rerun with --verbose for a trace."
-msgstr "Draaien van LilyPond gefaald. Draai opnieuw met --verbose voor een foutpad."
+msgstr ""
+"Draaien van LilyPond gefaald. Draai opnieuw met --verbose voor een foutpad."
#: lilypond.py:921
msgid "Failed to make PS file. Rerun with --verbose for a trace."
-msgstr "Gefaald in het maken van een PS bestand. Draai opnieuw met --verbose voor een foutpad."
+msgstr ""
+"Gefaald in het maken van een PS bestand. Draai opnieuw met --verbose voor "
+"een foutpad."
#: lilypond.py:951
msgid "Running LaTeX failed. Rerun with --verbose for a trace."
-msgstr "Draaien van LaTeX gefaald. Draai opnieuw met --verbose voor een foutpad."
+msgstr ""
+"Draaien van LaTeX gefaald. Draai opnieuw met --verbose voor een foutpad."
#: lilypond.py:963 input-file-results.cc:74
#, c-format, python-format
#: all-font-metrics.cc:111
msgid "A script for removing font-files is delivered with the source-code:"
-msgstr "Een script ter verwijdering van fontbestanden is meegeleverd bij de bron-code:"
+msgstr ""
+"Een script ter verwijdering van fontbestanden is meegeleverd bij de bron-"
+"code:"
#: all-font-metrics.cc:192
#, c-format
#: all-font-metrics.cc:193
msgid "Loading default font"
-msgstr "Laden van standaardfont"
+msgstr "Laad verstek font"
#: all-font-metrics.cc:208
#, c-format
msgid "can't find default font: `%s'"
-msgstr "kan standaardfont niet vinden: `%s'"
+msgstr "kan verstekfont niet vinden: `%s'"
#: all-font-metrics.cc:209 includable-lexer.cc:59 input-file-results.cc:218
#, c-format
#: beam.cc:1040
msgid "no viable initial configuration found: may not find good beam slope"
-msgstr "geen werkbare initiële configuratie gevonden: kan wellicht geen goede waardestreephelling kunnen vinden"
+msgstr ""
+"geen werkbare initiële configuratie gevonden: kan wellicht geen goede "
+"waardestreephelling kunnen vinden"
#: beam-engraver.cc:139
msgid "already have a beam"
#: lookup.cc:169
msgid "round filled box horizontal extent smaller than blot; decreasing blot"
-msgstr "rond gevulde doos horizontale afmetingen kleiner dan blot; verkleinen van blot"
+msgstr ""
+"rond gevulde doos horizontale afmetingen kleiner dan blot; verkleinen van "
+"blot"
#: lookup.cc:174
msgid "round filled box vertical extent smaller than blot; decreasing blot"
-msgstr "rond gevulde doos vertikale afmetingen kleiner dan blot; verkleinen van blot"
+msgstr ""
+"rond gevulde doos vertikale afmetingen kleiner dan blot; verkleinen van blot"
#: main.cc:100
msgid ""
#: scm-option.cc:56
#, c-format
-msgid " Multiple -e options may be given, they will be evaluated sequentially."
-msgstr " Verscheidene -e opties mogen worden gegeven, deze zullen sequentieel worden geëvalueerd."
+msgid ""
+" Multiple -e options may be given, they will be evaluated sequentially."
+msgstr ""
+" Verscheidene -e opties mogen worden gegeven, deze zullen sequentieel "
+"worden geëvalueerd."
#: scm-option.cc:58
#, c-format
-msgid " The function ly-set-option allows for access to some internal variables."
-msgstr " De functie ly-set-option verschaft toegang tot bepaalde interne variabelen."
+msgid ""
+" The function ly-set-option allows for access to some internal variables."
+msgstr ""
+" De functie ly-set-option verschaft toegang tot bepaalde interne variabelen."
#: scm-option.cc:60
#, c-format
#: tfm-reader.cc:142
#, c-format
msgid "%s: TFM file has %u parameters, which is more than the %u I can handle"
-msgstr "%s: TFM bestand heeft %u parameters, wat meer is dan de %u die ik aan kan"
+msgstr ""
+"%s: TFM bestand heeft %u parameters, wat meer is dan de %u die ik aan kan"
#: tie-engraver.cc:164
msgid "lonely tie"
#: time-signature.cc:95
#, c-format
msgid "time signature symbol `%s' not found; reverting to numbered style"
-msgstr "maatsoortsymbool `%s' niet gevonden; val terug op numerieke stijl"
+msgstr "maatsoortsymbool `%s' niet gevondend; val terug op numerieke stijl"
#.
#. Todo: should make typecheck?
#: vaticana-ligature-engraver.cc:342
#, c-format
-msgid "ignored prefix (es) `%s' of this head according to restrictions of the selected ligature style"
+msgid ""
+"ignored prefix (es) `%s' of this head according to restrictions of the "
+"selected ligature style"
msgstr ""
-"negeren van voorvoegsel (es) `%s' van dit bolletje volgens restricties van de\n"
+"negeren van voorvoegsel (es) `%s' van dit bolletje volgens restricties van "
+"de\n"
"geselecteerde ligatuurstijl"
#: vaticana-ligature-engraver.cc:572
#, c-format
msgid "Vaticana_ligature_engraver: setting `spacing-increment = %f': ptr=%ul"
-msgstr "Vaticana_ligature_engraver: instelling `spacing-increment = %f': ptr=%ul"
+msgstr ""
+"Vaticana_ligature_engraver: instelling `spacing-increment = %f': ptr=%ul"
#: volta-engraver.cc:140
msgid "No volta spanner to end"
#: parser.yy:776
msgid "More alternatives than repeats. Junking excess alternatives."
-msgstr "Meer alternatieven dan herhalingen. Schroot overvloedige alternatieven."
+msgstr ""
+"Meer alternatieven dan herhalingen. Schroot overvloedige alternatieven."
#: parser.yy:857 parser.yy:864
msgid "\\applycontext takes function argument"
#: lexer.ll:755 lexer.ll:756
msgid "Consider updating the input with the convert-ly script"
msgstr "Overweeg het actualiseren van de invoer met het convert-ly script"
-
-#~ msgid "Unknown interface `%s'"
-#~ msgstr "onbekende interface `%s'"
-
-#~ msgid "Grob `%s' has no interface for property `%s'"
-#~ msgstr "Grob `%s' heeft geen interface voor eigenschap `%s'"
% To let gs load fonts from builddir, do:
% export GS_LIB=$(pwd)/mf/out:/usr/share/texmf/fonts/type1/bluesky/cm
+/staff-line-thickness lilypondpaperlinethickness def
+/staff-height lilypondpaperstaffheight def
+/line-width lilypondpaperlinewidth def
+
+/lily-output-units 2.83464 def %% milimeter
+% /lily-output-units 0.996264 def %% true points.
+
+/output-scale lilypondpaperoutputscale lily-output-units mul def
/set-ps-scale-to-lily-scale { output-scale output-scale scale } bind def
+/paper-size { lilypondpaperpapersize } bind def
/init-paper {
gsave
end
} bind def
+/start-page
+{
+} bind def
+
+/stop-page
+{
+ showpage
+} bind def
+
+/stop-last-page
+{
+} bind def
+
/start-system % x y
{
gsave
% Functions for direct and embedded PostScript
+/blot-diameter { lilypondpaperblotdiameter } bind def
+
/set_tex_dimen {
cvr def
} bind def
% Nice rectangle with rounded corners
/draw_box % breapth width depth height
{
-% currentdict /testing known {
+ currentdict /testing known {
%% real thin lines for testing
/blot 0.005 def
-% }{
-% /blot blot-diameter def
-% } ifelse
+ }{
+ /blot blot-diameter def
+ } ifelse
0 setlinecap
blot setlinewidth
0 360 arc closepath fill stroke
} bind def
-/draw_white_dot % x1 y2 R
-{
-% 0 360 arc fill stroke
- 0 360 arc closepath % fill stroke
-gsave
- 1 setgray fill
-grestore
-% 0 360 arc closepath % fill stroke
- 0.05 setlinewidth 0 setgray stroke
-} bind def
-
/draw_dashed_line % dash thickness dx dy
{
1 setlinecap
if __main__.verbose_p:
raise _ ('Exiting (%d)...') % i
else:
- print 'ex thoto' , i
- sys.exit (i)
+ sys.exit (1)
def getopt_args (opts):
'''Construct arguments (LONG, SHORT) for getopt from list of options.'''
if error_log_file:
os.unlink (error_log_file)
- exit (1)
+ exit (status)
if __main__.verbose_p:
progress ('\n')
sys.stderr.write (open (error_log_file).read ())
if error_log_file:
os.unlink (error_log_file)
- exit (1)
+ exit (status)
if error_log_file:
os.unlink (error_log_file)
for (k,v) in os.environ.items ():
sys.stderr.write ("%s=\"%s\"\n" % (k, v))
-BOUNDING_BOX_RE = '^%%BoundingBox: (-?[0-9]+) (-?[0-9]+) (-?[0-9]+) (-?[0-9]+)'
def get_bbox (filename):
bbox = filename + '.bbox'
## -sOutputFile does not work with bbox?
(filename, bbox)
system (cmd, progress_p = 1)
box = open (bbox).read ()
- m = re.match (BOUNDING_BOX_RE, box)
+ m = re.match ('^%%BoundingBox: ([0-9]+) ([0-9]+) ([0-9]+) ([0-9]+)',
+ box)
gr = []
if m:
gr = map (string.atoi, m.groups ())
base = re.sub (r'\.e?ps', '', ps_name)
header = open (ps_name).read (1024)
-
- match = re.match (BOUNDING_BOX_RE, header)
- bbox = []
- if match:
- bbox = map (string.atoi, match.groups ())
-
multi_page = re.search ('\n%%Pages: ', header)
cmd = ''
if multi_page == None:
-
- if bbox == []:
- bbox = get_bbox (ps_name)
-
+ bbox = get_bbox (ps_name)
trans_ps = ps_name + '.trans.ps'
output_file = re.sub (r'\.e?ps', '.png', ps_name)
+
+
# need to have margin, otherwise edges of letters will
# be cropped off.
os.unlink (png)
error (_ ("Removing output file"))
exit (1)
-
-
- cmd = r'''gs -s -sDEVICE=pnggray -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -q -sOutputFile=%s -dNOPAUSE -r%d %s -c quit''' % (output_file,
- resolution, ps_name)
-
*/
+#include "config.h"
#include <Python.h>
#if 0
(acc (ly:music-property fig-music 'alteration))
(acc-markup #f)
(fig-markup
- (if (markup? fig)
- fig
+ (if (string? fig)
+ (make-number-markup (make-simple-markup fig))
(if align-accs (make-simple-markup " ")
(if (not (eq? acc '()))
(make-simple-markup "")
called before line breaking, but after splitting breakable items at
potential line breaks.")
(between-cols ,pair? "Where to attach a loose column to")
+ (between-system-string ,string? "string
+ to dump between two systems. Useful for forcing page breaks.")
(bracket-thick ,number? "width of a system start bracket.")
(break-align-symbol ,symbol? "This key is used for aligning and
spacing breakable items.")
(stroke-style ,string? "set to \"grace\" to turn stroke through flag on.")
(flag-width-function ,procedure? "Procedure that computes the width of a half-beam (a non-connecting beam.).")
(font-family ,symbol? "The font family is the broadest category for selecting text fonts. Options include: @code{sans}, @code{roman} ")
- (font-encoding ,symbol? "The font encoding is the broadest
-category for selecting a font. Options include: @code{fetaMusic},
-@code{fetaNumber}, @code{TeX-text}, @code{TeX-math}, @code{fetaBraces},
-@code{fetaDynamic}")
+ (font-encoding ,symbol? "The font encoding is the broadest category for selecting a font. Options include: @code{music}, @code{number}, @code{text},
+@code{math}, @code{braces}, @code{dynamic}")
(font-name ,string? "Specifies a file name (without extension) of
the font to load. This setting override selection using
@code{font-family}, @code{font-series} and @code{font-shape}.")
(padding ,ly:dimension? "Add this much extra space between
objects that are next to each other.")
- (page-penalty ,number? "Penalty for page break at
-this column. 10000 or more means forbid linebreak, -10000 or less
-means force page break. Other values influence page breaking decisions
+ (penalty ,number? "Penalty for breaking at
+this column. 10000 or more means forbid linebreak, -10000 or less
+means force linebreak. Other values influence linebreaking decisions
as a real penalty.")
- (penalty ,number? "Penalty for line break at
-this column. 10000 or more means forbid line break, -10000 or less
-means force line break. Other values influence line breaking decisions
-as a real penalty.")
-
+
(pitch-max ,ly:pitch? "Top pitch for ambitus.")
(pitch-min ,ly:pitch? "Bottom pitch for ambitus.")
(print-function . ,Percent_repeat_item_interface::double_percent)
(breakable . #t)
(slope . 1.0)
- (font-encoding . fetaMusic)
+ (font-encoding . music)
(width . 2.0)
(thickness . 0.48)
(break-align-symbol . staff-bar)
(no-spacing-rods . #t)
(script-priority . 100)
(font-series . bold)
- (font-encoding . fetaDynamic)
+ (font-encoding . dynamic)
(font-shape . italic)
(self-alignment-Y . 0)
(meta . ((interfaces . (font-interface text-interface self-alignment-interface dynamic-interface script-interface item-interface))))
(self-alignment-X . 0)
(self-alignment-Y . 0)
(script-priority . 100)
- (font-encoding . fetaNumber)
+ (font-encoding . number)
(font-size . -5) ; don't overlap when next to heads.
(meta . ((interfaces . (finger-interface font-interface text-script-interface text-interface side-position-interface self-alignment-interface item-interface ))))
))
(thick-thickness . 6.6)
(hair-thickness . 2.0)
(padding . 1)
- (font-encoding . fetaMusic)
+ (font-encoding . music)
(meta . ((interfaces . (multi-measure-rest-interface multi-measure-interface rest-interface font-interface staff-symbol-referencer-interface))))
))
(direction . 1)
(padding . 1.3)
(staff-padding . 1.3)
- (font-encoding . fetaNumber)
+ (font-encoding . number)
(meta . ((interfaces . (side-position-interface multi-measure-interface self-alignment-interface font-interface spanner-interface text-interface))))
))
(MultiMeasureRestText
(print-function . ,Multi_measure_rest::percent)
(slope . 1.0)
(thickness . 0.48)
- (font-encoding . fetaMusic)
+ (font-encoding . music)
(meta . ((interfaces . (multi-measure-rest-interface spanner-interface font-interface percent-repeat-interface))))
))
;; (script-priority . 0) priorities for scripts, see script.scm
(X-offset-callbacks . (,Self_alignment_interface::centered_on_parent))
(before-line-breaking-callback . ,Script_interface::before_line_breaking)
- (font-encoding . fetaMusic)
+ (font-encoding . music)
(meta . ((interfaces . (script-interface side-position-interface font-interface item-interface ))))
))
(glyph . "brace")
(print-function . ,System_start_delimiter::print)
(collapse-height . 5.0)
- (font-encoding . fetaBraces)
+ (font-encoding . braces)
(Y-extent-callback . #f)
(meta . ((interfaces . (system-start-delimiter-interface font-interface))))
))
(print-function . ,Volta_bracket_interface::print)
(direction . 1)
(padding . 1)
- (font-encoding . fetaNumber)
+ (font-encoding . number)
(Y-offset-callbacks . (,Side_position_interface::aligned_side))
(thickness . 1.6) ; linethickness
(height . 2.0) ; staffspace;
;; syntax, description and example.
-(def-markup-command (stencil paper props stil) (ly:stencil?)
- "Stencil as markup"
- stil)
-
-
-(def-markup-command (score paper props score) (ly:score?)
- (let*
- ((systems (ly:score-embedded-format score paper))
- (1st (vector-ref systems 0))
- (stencil (ly:paper-system-stencil 1st)) )
-
- (ly:stencil-align-to! stencil Y CENTER)
- (display (ly:stencil-extent stencil X))
- (display (ly:stencil-extent stencil Y))
-; (set! stencil (ly:stencil-translate-axis stencil -20 X))
-; (set! stencil (ly:stencil-translate-axis stencil 20 Y))
- stencil))
-
+(def-markup-command (word paper props str) (string?)
+ "A single word."
+ (interpret-markup paper props str))
+
(def-markup-command (simple paper props str) (string?)
- "A simple text string; @code{\\markup @{ foo @}} is equivalent with
+ "A simple text-string; @code{\\markup @{ foo @}} is equivalent with
@code{\\markup @{ \\simple #\"foo\" @}}."
- (interpret-markup paper props str))
-
-(def-markup-command (encoded-simple paper props sym str) (symbol? string?)
- "A text string, encoded with encoding @var{sym}. "
- (Text_item::interpret_string paper
- props sym str))
+ (interpret-markup paper props
+ (make-word-markup str)))
-;; TODO: use font recoding.
-;; (make-line-markup
-;; (map make-word-markup (string-tokenize str)))))
+; todo: use font recoding.
+; (make-line-markup
+; (map make-word-markup (string-tokenize str)))))
(define-public empty-markup
(make-simple-markup ""))
(if (= word-count 1) 2 (- word-count 1)))))
(line-stencils (if (= word-count 1)
(map (lambda (x) (interpret-markup paper props x))
- (list (make-simple-markup "")
- (make-stencil-markup (car stencils))
- (make-simple-markup "")))
+ (list (make-word-markup "")
+ (car markups)
+ (make-word-markup "")))
stencils)))
(stack-stencil-line fill-space line-stencils)))
(def-markup-command (combine paper props m1 m2) (markup? markup?)
"Print two markups on top of each other."
- (let*
- ((s1 (interpret-markup paper props m1))
- (s2 (interpret-markup paper props m2)))
-
- (ly:stencil-add s1 s2)))
+ (ly:stencil-add
+ (interpret-markup paper props m1)
+ (interpret-markup paper props m2)))
(def-markup-command (finger paper props arg) (markup?)
"Set the argument as small numbers."
"Set font family to @code{number}, which yields the font used for
time signatures and fingerings. This font only contains numbers and
some punctuation. It doesn't have any letters. "
- (interpret-markup paper (prepend-alist-chain 'font-encoding 'fetaNumber props) arg))
+ (interpret-markup paper (prepend-alist-chain 'font-encoding 'number props) arg))
(def-markup-command (roman paper props arg) (markup?)
"Set font family to @code{roman}."
normal words (like ``pi@`{u}'') should be done in a different font. The
recommend font for this is bold and italic"
(interpret-markup
- paper (prepend-alist-chain 'font-encoding 'fetaDynamic props) arg))
+ paper (prepend-alist-chain 'font-encoding 'dynamic props) arg))
(def-markup-command (italic paper props arg) (markup?)
"Use italic @code{font-shape} for @var{arg}. "
See @usermanref{The Feta font} for a complete listing of the possible glyphs.
"
(ly:find-glyph-by-name
- (ly:paper-get-font paper (cons '((font-encoding . fetaMusic))
+ (ly:paper-get-font paper (cons '((font-encoding . music))
props))
glyph-name))
"Construct a note symbol, with stem. By using fractional values for
@var{dir}, you can obtain longer or shorter stems."
- (let* ((font (ly:paper-get-font paper (cons '((font-encoding . fetaMusic)) props)))
+ (let* ((font (ly:paper-get-font paper (cons '((font-encoding . music)) props)))
(stemlen (max 3 (- log 1)))
(headgl (ly:find-glyph-by-name
font
))
(set-object-property! symbol 'music-type? type?)
(set-object-property! symbol 'music-doc description)
- symbol)
+ symbol )
+
(define-public all-music-properties
(map
"This pitch was octavated by how many octaves?
For chord inversions, this is negative.")
(origin ,ly:input-location? "where was this piece of music defined?")
- (page-penalty ,number? "Penalty for page break hint.")
- (penalty ,number? "Penalty for line break hint.")
+ (penalty ,number? "Penalty for break hint.")
(pitch ,ly:pitch? "the pitch of this note")
(pitch-alist ,list? "list of pitches jointly forming the scale of a key signature")
(pop-first ,boolean? "Do a revert before we try to do a override on some grob property.")
"Change to what kind of state? Options are
solo1, solo2 and unisono")
- (figure ,markup? "a `figure' (which may be
+ (figure ,string? "a `figure' (which may be
a string) for figured bass")
(alteration ,number? "alteration for figured bass")
(bracket-start ,boolean? "start a bracket
))
(BreakEvent
. (
- (description . "Create a line break, Syntax: \\break or page break, Syntax: \\pagebreak.")
+ (description . "Creates a line break.
+
+Syntax: \\break.")
(internal-class-name . "Event")
(types . (general-music break-event event))
;;;; Jan Nieuwenhuizen <janneke@gnu.org>
(use-modules
- (ice-9 regex))
+ (ice-9 regex)
+ )
(define (dashify-underscores str)
(regexp-substitute/global #f "_" str 'pre "-" 'post))
(string-append
"@defun " (symbol->string name) " " (format-c-header c-header) "\n"
doc-string
- "\n@end defun\n\n"))
+ "\n@end defun\n\n")
+ )
(define all-scheme-functions
(hash-fold
(lambda (key val prior)
- (cons (cons key val) prior))
+ (cons (cons key val) prior)
+ )
'() (ly:get-all-function-documentation)))
(define (all-scheme-functions-doc)
(let*
- ((fdocs (map (lambda (x)
+ (
+
+ (fdocs (map (lambda (x)
(document-scheme-function (car x) (cadr x) (cddr x))
)
all-scheme-functions)
)
- (sfdocs (sort fdocs string<?)))
+ (sfdocs (sort fdocs string<?))
+ )
+
+
(make <texi-node>
#:name "Scheme functions"
#:desc "Primitive functions exported by LilyPond"
#:text
- (apply string-append sfdocs))
+ (apply string-append sfdocs)
+ )
))
(define (doc-markup-function func)
(let*
- ((doc-str (procedure-documentation func) )
+ (
+ (doc-str (procedure-documentation func) )
(f-name (symbol->string (procedure-name func)))
(c-name (regexp-substitute/global #f "-markup$" f-name 'pre "" 'post))
(sig (object-property func 'markup-signature))
(if in-which-contexts
(let*
- ((paper-alist (ly:output-description $defaultpaper))
+ ((paper-alist (My_lily_parser::paper_description))
(context-description-alist (map cdr paper-alist))
(contexts
(apply append
))
;; Second level, part of Context description
+
(define name->engraver-table (make-vector 61 '()))
(map
(lambda (x)
(define (all-contexts-doc)
(let* (
(paper-alist
- (sort (ly:output-description $defaultpaper)
+ (sort (My_lily_parser::paper_description)
(lambda (x y) (symbol<? (car x) (car y)))))
(names (sort (map symbol->string (map car paper-alist)) string<?))
(contexts (map cdr paper-alist))
(make <texi-node>
#:name "Engravers"
#:desc "All separate engravers"
- #:text "See @usermanref{Modifying context plug-ins}."
#:children
(map engraver-doc all-engravers-list)))
+++ /dev/null
-;;;; encoding.scm -- font encoding
-;;;;
-;;;; source file of the GNU LilyPond music typesetter
-;;;;
-;;;; (c) 2004 Jan Nieuwenhuizen <janneke@gnu.org>
-
-;; WIP
-;; encoding.ly:
-;; #(display (reencode-string "adobe" "latin1" "hellö fóebär"))
-;;
-
-
-(define-public (read-encoding-file filename)
- "Read .enc file, return (COMMAND-NAME . VECTOR-OF-SYMBOLS)."
- (let* ((raw (ly:kpathsea-gulp-file filename))
- (string (regexp-substitute/global #f "%[^\n]*" raw 'pre "" 'post))
- (command (match:substring
- (string-match "/([^ \t\n\r]*)[ \t\n\r]+[[]" string) 1))
- (encoding (match:substring (string-match "[[](.*)[]]" string) 1))
- (ps-lst (string-tokenize encoding))
- (lst (map (lambda (x) (string->symbol (substring x 1))) ps-lst))
- (vector (list->vector lst)))
- (cons command vector)))
-
-(define (make-encoding-table encoding-vector)
- "Return a hash table mapping names to chars. ENCODING-VECTOR is a
-vector of symbols."
-
- (let* ((h (make-hash-table 256)))
-
- (for-each
- (lambda (i)
- (hash-set! h (vector-ref encoding-vector i)
- (integer->char i)))
- (iota 256))
-
- h))
-
-(define-public (reencode-string mapping str)
- "Apply MAPPING, a vector of [0..256) -> char, to STR"
- (string-map (lambda (chr)
- (vector-ref mapping (char->integer chr)))
- str))
-
-(define-public (make-encoding-mapping input-encoding output-encoding)
- "Contruct a mapping by applying output-encoding after input-encoding "
- (list->vector
- (map
- (lambda (byte)
- (let ((new-char (hash-ref
- output-encoding (vector-ref input-encoding byte) #f)))
- ;;input-encoding (vector-ref output-encoding byte) #f)))
-
- ;; substitute space for unknown characters.
- (if (char? new-char)
- new-char
- #\ )))
- (iota 256))))
-
-
-(define (get-coding-from-file filename)
- "Read FILENAME, return a list containing encoding vector and table"
- (let* ((coding (read-encoding-file filename))
- (com (car coding))
- (vec (cdr coding))
- (tab (make-encoding-table vec)))
- (list com vec tab)))
-
-;; coding-alist maps NAME -> (list FILENAME COMMAND VECTOR TAB)
-(define coding-alist
-
- (map (lambda (x)
- (cons (car x)
- (cons (cdr x) (delay (get-coding-from-file (cdr x))))))
-
- '(
- ;; teTeX
- ("TeX-typewriter-text" . "09fbbfac.enc") ;; cmtt10
- ("TeX-math-symbols" . "10037936.enc") ;; cmbsy
- ("ASCII-caps-and-digits" . "1b6d048e.enc") ;; cminch
- ("TeX-math-italic" . "aae443f0.enc") ;; cmmi10
- ("TeX-extended-ASCII" . "d9b29452.enc")
- ("TeX-text" . "cmr.enc")
- ("TeX-text-without-f-ligatures" . "0ef0afca.enc")
- ("Extended-TeX-Font-Encoding---Latin" . "tex256.enc")
- ("AdobeStandardEncoding" . "8a.enc")
-
- ;; aliases
- ("T1" . "tex256.enc")
- ("adobe" . "8a.enc")
- ("latin1" . "cork.enc")
-
- ;; LilyPond.
- ("fetaBraces" . "feta-braces-a.enc")
- ("fetaNumber" . "feta-nummer10.enc")
- ("fetaMusic" . "feta20.enc")
- ("parmesanMusic" . "parmesan20.enc"))
- ))
-
-(define (get-coding coding-name)
- (let ((entry (assoc-get coding-name coding-alist)))
- (cons (car entry) (force (cdr entry)))))
-
-(define-public (get-coding-filename coding-name)
- (car (get-coding coding-name)))
-
-(define-public (get-coding-command coding-name)
- (cadr (get-coding coding-name)))
-
-(define-public (get-coding-vector coding-name)
- (caddr (get-coding coding-name)))
-
-(define-public (get-coding-table coding-name)
- (cadddr (get-coding coding-name)))
(display "} } \n"))
+
(define default-qualifier-order
'(font-encoding font-family font-shape font-series))
((qual (font-qualifier node))
(def (font-default node))
(val (chain-assoc-get qual alist-chain def))
- (desired-child (hashq-ref (font-children node) val)))
+ (desired-child (hashq-ref (font-children node) val))
+ )
(if desired-child
(g-lookup-font desired-child alist-chain)
(define (lookup-font node alist-chain)
(g-lookup-font node alist-chain))
-;
-; Each size family is a vector of fonts, loaded with a delay.
-; The vector should be sorted according to ascending design size.
-;
-
-(define-public (add-music-fonts node factor)
- (for-each
- (lambda (x)
- (add-font node
- (list (cons 'font-encoding (car x)))
- (cons (* factor (cadr x))
- (caddr x))))
- `((fetaNumber 10
- #(,(delay (ly:font-load "feta-nummer4"))
- ,(delay (ly:font-load "feta-nummer6"))
- ,(delay (ly:font-load "feta-nummer8"))
- ,(delay (ly:font-load "feta-nummer10"))
- ,(delay (ly:font-load "feta-nummer12"))
- ,(delay (ly:font-load "feta-nummer16"))))
- (fetaDynamic 14.0 #(,(delay (ly:font-load "feta-din6"))
- ,(delay (ly:font-load "feta-din8"))
- ,(delay (ly:font-load "feta-din10"))
- ,(delay (ly:font-load "feta-din12"))
- ,(delay (ly:font-load "feta-din14"))
- ,(delay (ly:font-load "feta-din17"))
- ))
- (fetaMusic 20.0
- #(,(delay (ly:make-virtual-font
- (ly:font-load "feta11")
- (ly:font-load "parmesan11")))
- ,(delay (ly:make-virtual-font
- (ly:font-load "feta13")
- (ly:font-load "parmesan13")))
- ,(delay (ly:make-virtual-font
- (ly:font-load "feta14")
- (ly:font-load "parmesan14")))
- ,(delay (ly:make-virtual-font
- (ly:font-load "feta16")
- (ly:font-load "parmesan16")))
- ,(delay (ly:make-virtual-font
- (ly:font-load "feta18")
- (ly:font-load "parmesan18")))
- ,(delay (ly:make-virtual-font
- (ly:font-load "feta20")
- (ly:font-load "parmesan20")))
- ,(delay (ly:make-virtual-font
- (ly:font-load "feta23")
- (ly:font-load "parmesan23")))
- ,(delay (ly:make-virtual-font
- (ly:font-load "feta26")
- (ly:font-load "parmesan26")))
- ))
-
- (fetaBraces 15 #(,(delay
- (ly:make-virtual-font
- (ly:font-load "feta-braces-a")
- (ly:font-load "feta-braces-b")
- (ly:font-load "feta-braces-c")
- (ly:font-load "feta-braces-d")
- (ly:font-load "feta-braces-e")
- (ly:font-load "feta-braces-f")
- (ly:font-load "feta-braces-g")
- (ly:font-load "feta-braces-h")
- (ly:font-load "feta-braces-i"))
- ))))))
-
-
-(define-public (add-cmr-fonts node factor)
- (add-font
- node
- '((font-encoding . TeX-math))
- `(,(* factor 10) . #(,(delay (ly:font-load "msam10")))))
-
- (for-each
- (lambda (x)
- (add-font
- node
- `((font-encoding . TeX-text)
- (font-series . ,(vector-ref (car x) 2))
- (font-shape . ,(vector-ref (car x) 1))
- (font-family . ,(vector-ref (car x) 0)))
- (cons (* factor (cadr x))
- (cddr x))
- ))
- `((#(roman upright medium) .
- (10.0 . #(,(delay (ly:font-load "cmr6"))
- ,(delay (ly:font-load "cmr8"))
- ,(delay (ly:font-load "cmr10"))
- ,(delay (ly:font-load "cmr17"))
- )))
-
- (#(roman upright bold) .
- (10.0 . #(,(delay (ly:font-load "cmbx6"))
- ,(delay (ly:font-load "cmbx8"))
- ,(delay (ly:font-load "cmbx10"))
- ,(delay (ly:font-load "cmbx12"))
- )))
-
- (#(roman italic medium) .
- (10.0 . #(,(delay (ly:font-load "cmti7"))
- ,(delay (ly:font-load "cmti10"))
- ,(delay (ly:font-load "cmti12"))
- )))
- (#(roman italic bold) .
- (10.0 . #(,(delay (ly:font-load "cmbxti8"))
- ,(delay (ly:font-load "cmbxti10"))
- ,(delay (ly:font-load "cmbxti14"))
- )))
-
- (#(roman caps medium) .
- (10.0 . #(,(delay (ly:font-load "cmcsc10")))))
-
- (#(roman upright bold-narrow ) .
- (10.0 . #(,(delay (ly:font-load "cmb10"))
- )))
-
- (#(sans upright medium) .
- (10.0 . #(,(delay (ly:font-load "cmss8"))
- ,(delay (ly:font-load "cmss10"))
- ,(delay (ly:font-load "cmss12"))
- ,(delay (ly:font-load "cmss17"))
- )))
- (#(typewriter upright medium) .
- (10.0 . #(,(delay (ly:font-load "cmtt8"))
- ,(delay (ly:font-load "cmtt10"))
- ,(delay (ly:font-load "cmtt12"))
- )))))
-
- ;; lmodern: super-cm using metapost
- ;; lm.map: Reencoding, at fontlevel for TeX ?:
- ;; cork-lmb10 LMRomanDemi10-Regular "enccorklm ReEncodeFont" <cork-lm.enc <lmb10.pf
-
- (for-each
- (lambda (x)
- (add-font
- node
- `((font-encoding . latin1)
- (font-series . ,(vector-ref (car x) 2))
- (font-shape . ,(vector-ref (car x) 1))
- (font-family . ,(vector-ref (car x) 0)))
- (cons (* factor (cadr x))
- (cddr x))
- ))
-
-;;; super-cm, aka lmodern (on Debian) seems rather broken:
-;;; * no usable TFM files (no lmr10.tfm, only cork-lmr10.tfm)
-;;; * broken AFM files:
-;;; - invalid keyword 'Generated'
-;;; - lists FontEncoding Fontspecific -- duh
-;;; revert to ec-fonts-mftraced for now
-;;; make this easily switchable?
-
-;;; `((#(roman upright medium) .
-;;; (10.0 . #(,(delay (ly:font-load "lmr6"))
-;;; ,(delay (ly:font-load "lmr8"))
-;;; ,(delay (ly:font-load "lmr10"))
-;;; ,(delay (ly:font-load "lmr17")))))
-
-;;; (#(roman upright bold) .
-;;; (10.0 . #(,(delay (ly:font-load "lmbx6"))
-;;; ,(delay (ly:font-load "lmbx8"))
-;;; ,(delay (ly:font-load "lmbx10"))
-;;; ,(delay (ly:font-load "lmbx12")))))
-
-;;; (#(roman italic medium) .
-;;; (10.0 . #(,(delay (ly:font-load "lmri7"))
-;;; ,(delay (ly:font-load "lmri10"))
-;;; ,(delay (ly:font-load "lmri12")))))
-;;; (#(roman italic bold) .
-;;; (10.0 . #(,(delay (ly:font-load "lmbi8"))
-;;; ,(delay (ly:font-load "lmbi10"))
-;;; ,(delay (ly:font-load "lmbi14")))))
-
-;;; (#(roman caps medium) .
-;;; (10.0 . #(,(delay (ly:font-load "lmcs10")))))
-
-;;; (#(roman upright bold-narrow ) .
-;;; (10.0 . #(,(delay (ly:font-load "lmb10")))))
-
-;;; (#(sans upright medium) .
-;;; (10.0 . #(,(delay (ly:font-load "lmss8"))
-;;; ,(delay (ly:font-load "lmss10"))
-;;; ,(delay (ly:font-load "lmss12"))
-;;; ,(delay (ly:font-load "lmss17")))))
-;;; (#(sans upright bold) .
-;;; (10.0 . #(,(delay (ly:font-load "lmssbx10")))))
-
-;;; (#(typewriter upright medium) .
-;;; (10.0 . #(,(delay (ly:font-load "lmtt8"))
-;;; ,(delay (ly:font-load "lmtt10"))
-;;; ,(delay (ly:font-load "lmtt12"))))))))
- `((#(roman upright medium) .
- (10.0 . #(,(delay (ly:font-load "ecrm6"))
- ,(delay (ly:font-load "ecrm8"))
- ,(delay (ly:font-load "ecrm10"))
- ,(delay (ly:font-load "ecrm17")))))
- (#(roman upright bold) .
- (10.0 . #(,(delay (ly:font-load "ecbx6"))
- ,(delay (ly:font-load "ecbx8"))
- ,(delay (ly:font-load "ecbx10"))
- ,(delay (ly:font-load "ecbx12")))))
- (#(roman italic medium) .
- (10.0 . #(,(delay (ly:font-load "ecti7"))
- ,(delay (ly:font-load "ecti10"))
- ,(delay (ly:font-load "ecti12")))))
- (#(roman italic bold) .
- (10.0 . #(,(delay (ly:font-load "ecbi8"))
- ,(delay (ly:font-load "ecbi10"))
- ,(delay (ly:font-load "ecbi14")))))
- ;; duplicate entry?
- ;;(#(roman caps medium) .
- ;; (10.0 . #(,(delay (ly:font-load "eccc10")))))
- (#(roman caps medium) .
- (10.0 . #(,(delay (ly:font-load "ecsc10")))))
- (#(roman upright bold-narrow ) .
- (10.0 . #(,(delay (ly:font-load "ecrb10")))))
- (#(sans upright medium) .
- (10.0 . #(,(delay (ly:font-load "ecss8"))
- ,(delay (ly:font-load "ecss10"))
- ,(delay (ly:font-load "ecss12"))
- ,(delay (ly:font-load "ecss17")))))
- (#(typewriter upright medium) .
- (10.0 . #(,(delay (ly:font-load "ectt8"))
- ,(delay (ly:font-load "ectt10"))
- ,(delay (ly:font-load "ectt12"))))))))
-
-
-
-
-;; (display (make-font-tree 1.0))
-
-;; Century Schoolbook fonts filenames on Debian/Sid
-(define-public (add-century-schoolbook-fonts node factor)
-
- (add-font node
- '((font-family . roman)
- (font-shape . upright)
- (font-series . medium)
- (font-encoding . latin1))
- `(10.0 . #(,(delay (ly:font-load "c059013l")))))
-
- (add-font node
- '((font-family . roman)
- (font-shape . italic)
- (font-series . medium)
- (font-encoding . latin1))
- `(10.0 . #(,(delay (ly:font-load "c059033l")))))
-
- (add-font node
- '((font-family . roman)
- (font-shape . upright)
- (font-series . bold)
- (font-encoding . latin1))
- `(10.0 . #(,(delay (ly:font-load "c059016l")))))
-
- (add-font node
- '((font-family . roman)
- (font-shape . italic)
- (font-series . bold)
- (font-encoding . latin1))
- `(10.0 . #(,(delay (ly:font-load "c059036l")))))
- )
-
-
-(define-public (make-cmr-tree factor)
-
- (let
- ((n (make-font-tree-node 'font-encoding 'fetaMusic)))
- (add-music-fonts n factor)
- (add-cmr-fonts n factor)
- n
- ))
-
-
-(define-public (make-century-schoolbook-tree factor)
-
- (let
- ((n (make-font-tree-node 'font-encoding 'fetaMusic)))
-
- (add-music-fonts n factor)
- (add-century-schoolbook-fonts n factor)
- n
- ))
+(define-public (make-font-tree factor)
+ (let*
+ ((n (make-font-tree-node 'font-encoding 'music))
+ )
+
+ (for-each
+ (lambda (x)
+ (add-font n
+ (list (cons 'font-encoding (car x)))
+ (cons (* factor (cadr x))
+ (caddr x))))
+ '((number 10
+ #((3.82 . "feta-nummer4")
+ (5.5 . "feta-nummer6")
+ (8.0 . "feta-nummer8")
+ (10.0 . "feta-nummer10")
+ (12.0 . "feta-nummer12")
+ (16.0 . "feta-nummer16")))
+ (dynamic 14.0 #((6.0 . "feta-din6")
+ (8.0 . "feta-din8")
+ (10.0 . "feta-din10")
+ (12.0 . "feta-din12")
+ (14.0 . "feta-din14")
+ (17.0 . "feta-din17")
+ ))
+ (math 10 #((10.0 . "msam10")))
+ (music 20.0
+ #((11.22 . ("feta11" "parmesan11"))
+ (12.60 . ("feta13" "parmesan13"))
+ (14.14 . ("feta14" "parmesan14"))
+ (15.87 . ("feta16" "parmesan16"))
+ (17.82 . ("feta18" "parmesan18"))
+ (20.0 . ("feta20" "parmesan20"))
+ (22.45 . ("feta23" "parmesan23"))
+ (25.20 . ("feta26" "parmesan26"))
+ ))
+ (braces 10 #((10.0 . ("feta-braces00"
+ "feta-braces10"
+ "feta-braces20"
+ "feta-braces30"
+ "feta-braces40"
+ "feta-braces50"
+ "feta-braces60"
+ "feta-braces70"
+ "feta-braces80"))
+ ))))
+
+ (for-each
+ (lambda (x)
+ (add-font
+ n
+ `((font-encoding . text)
+ (font-series . ,(vector-ref (car x) 2))
+ (font-shape . ,(vector-ref (car x) 1))
+ (font-family . ,(vector-ref (car x) 0)))
+ (cons (* factor (cadr x))
+ (cddr x))
+ ))
+ '((#(roman upright medium) .
+ (10.0 . #((6.0 . "cmr6")
+ (8.0 . "cmr8")
+ (10.0 . "cmr10")
+ (17.0 . "cmr17")
+ )))
+
+ (#(roman upright bold) .
+ (10.0 . #((6.0 . "cmbx6")
+ (8.0 . "cmbx8")
+ (10.0 . "cmbx10")
+ (12.0 . "cmbx12")
+ )))
+
+ (#(roman italic medium) .
+ (10.0 . #((7.0 . "cmti7")
+ (10.0 . "cmti10")
+ (12.0 . "cmti12")
+ )))
+ (#(roman italic bold) .
+ (10.0 . #((8.0 . "cmbxti8")
+ (10.0 . "cmbxti10")
+ (14.0 . "cmbxti14")
+ )))
+
+ (#(roman caps medium) .
+ (10.0 . #((10.0 . "cmcsc10"))))
+ (#(roman upright bold-narrow ) .
+ (10.0 . #((10.0 . "cmb10")
+ )))
+
+ (#(sans upright medium) .
+ (10.0 . #((8.0 . "cmss8")
+ (10.0 . "cmss10")
+ (12.0 . "cmss12")
+ (17.0 . "cmss17")
+ )))
+ (#(typewriter upright medium) .
+ (10.0 . #((8.0 . "cmtt8")
+ (10.0 . "cmtt10")
+ (12.0 . "cmtt12")
+ )))
+ ))
+ n))
+
+; (display (make-font-tree 1.0))
(define-public (magstep x)
(exp (* (/ x 6) (log 2))))
+++ /dev/null
-;;;; framework-gnome.scm --
-;;;;
-;;;; source file of the GNU LilyPond music typesetter
-;;;;
-;;;; (c) 2004 Jan Nieuwenhuizen <janneke@gnu.org>
-
-;;;; See output-gnome.scm for usage information.
-
-
-(define-module (scm framework-gnome))
-
-(use-modules (guile) (oop goops) (lily))
-
-(use-modules
- (ice-9 regex)
- (gnome gtk)
- (gnome gtk gdk-event))
-
-;; the name of the module will change to canvas rsn
-(if (resolve-module '(gnome gw canvas))
- (use-modules (gnome gw canvas))
- (use-modules (gnome gw libgnomecanvas)))
-
-(define-public (output-framework-gnome outputter book scopes fields basename)
- (newline (current-error-port))
-
-; ;; Hmm,
-; (let ((port (ly:outputter-get-output-port outputter)))
-; (remove port)
-; (close port))
-
- (gnome-main book))
-
-
-;; WTF? -- jcn
-;; Yay, I *finally* found it!
-(define-public output-framework output-framework-gnome)
-
-(define SCROLLBAR-SIZE 20)
-(define BUTTON-HEIGHT 25)
-(define PANELS-HEIGHT 80)
-
-(define PIXELS-PER-UNIT 2)
-(define OUTPUT-SCALE (* 2.5 PIXELS-PER-UNIT))
-(define-public output-scale OUTPUT-SCALE)
-
-(define (stderr string . rest)
- ;; debugging
- (if #f
- (begin
- (apply format (cons (current-error-port) (cons string rest)))
- (force-output (current-error-port)))))
-
-(define-class <gnome-outputter> ()
- (page-stencils ;;#:init-value '#()
- #:init-keyword #:page-stencils #:accessor page-stencils)
- (window #:init-value (make <gtk-window> #:type 'toplevel) #:accessor window)
- (scrolled #:init-value (make <gtk-scrolled-window>) #:accessor scrolled)
- (canvas #:init-value #f #:accessor canvas)
- (page-number #:init-value 0 #:accessor page-number)
- (pixels-per-unit #:init-value PIXELS-PER-UNIT #:accessor pixels-per-unit)
- (text-items #:init-value '() #:accessor text-items)
- (location #:init-value #f #:accessor location)
- (item-locations #:init-value (make-hash-table 31) #:accessor item-locations)
- (window-width #:init-keyword #:window-width #:accessor window-width)
- (window-height #:init-keyword #:window-height #:accessor window-height)
- (canvas-width #:init-keyword #:canvas-width #:accessor canvas-width)
- (canvas-height #:init-keyword #:canvas-height #:accessor canvas-height))
-
-(define-method (initialize (go <gnome-outputter>))
- (let* ((button (make <gtk-button> #:label "Exit"))
- (next (make <gtk-button> #:label "Next"))
- (prev (make <gtk-button> #:label "Previous"))
- (vbox (make <gtk-vbox> #:homogeneous #f))
- (hbox (make <gtk-hbox> #:homogeneous #f)))
-
- (set-size-request (window go) (window-width go) (window-height go))
-
- (set-size-request (scrolled go) (window-width go) (- (window-height go)
- BUTTON-HEIGHT
- SCROLLBAR-SIZE))
-
- (new-canvas go)
-
- (add (window go) vbox)
- (add vbox (scrolled go))
-
- (add (scrolled go) (canvas go))
-
- ;; buttons
- (add vbox hbox)
- (set-size-request hbox (window-width go) BUTTON-HEIGHT)
-
- ;; hmm? These are broken when using <gnome-outputter>.
- ;;(set-child-packing vbox hbox #f #f 0 'end)
- ;;(set-child-packing hbox button #f #f 0 'end)
-
- (set-size-request button (quotient (window-width go) 2) BUTTON-HEIGHT)
-
-
- (add hbox next)
- (add hbox prev)
- (add hbox button)
-
- ;; signals
- (gtype-instance-signal-connect
- button 'clicked (lambda (b) (gtk-main-quit)))
- (gtype-instance-signal-connect
- next 'clicked (lambda (b) (dump-page go (1+ (page-number go)))))
- (gtype-instance-signal-connect
- prev 'clicked (lambda (b) (dump-page go (1- (page-number go)))))
- (gtype-instance-signal-connect
- (window go) 'key-press-event key-press-event)
-
- (show-all (window go))))
-
-
-(define-public global-go #f)
-
-(define (gnome-main book)
- (let* ((book-paper (ly:paper-book-book-paper book))
- (hsize (ly:output-def-lookup book-paper 'hsize))
- (vsize (ly:output-def-lookup book-paper 'vsize))
- (page-width (inexact->exact (ceiling (* OUTPUT-SCALE hsize))))
- (page-height (inexact->exact (ceiling (* OUTPUT-SCALE vsize))))
- ;;(page-width (inexact->exact (ceiling hsize)))
- ;;(page-height (inexact->exact (ceiling vsize)))
-
- (screen-width (gdk-screen-width))
- (screen-height (gdk-screen-height))
- (desktop-height (- screen-height PANELS-HEIGHT))
-
- (go (make <gnome-outputter>
- #:page-stencils (list->vector (ly:paper-book-pages book))
- #:canvas-width page-width
- #:canvas-height page-height
- #:window-width
- ;; huh, *2 -- pixels-per-unit?
- (min (+ SCROLLBAR-SIZE (* page-width 2)) screen-width)
- #:window-height
- (min (+ BUTTON-HEIGHT SCROLLBAR-SIZE (* page-height 2))
- desktop-height))))
-
- ;; ugh. The GOOPS doc promises this is called automagically.
- (initialize go)
-
- (map ly:pango-add-afm-decoder
- '("lilypond-feta"
- "lilypond-braces"
- "lilypond-dyn"
- "lilypond-parmesan"))
-
- (dump-page go 0)
-
- ;; ugh
- (set! global-go go)
-
- (gtk-main)))
-
-(define (dump-page go number)
- (if (or (not (page-stencils go))
- (< number 0)
- (>= number (vector-length (page-stencils go))))
- (stderr "No such page: ~S\n" (1+ number))
-
- (let ((old-canvas (canvas go)))
- (new-canvas go)
- (set! (page-number go) number)
-
- ;; no destroy method for gnome-canvas-text?
- ;;(map destroy (gtk-container-get-children main-canvas))
- ;;(map destroy text-items)
-
- (set! (text-items go) '())
- (stderr "page-stencil ~S: ~S\n"
- (page-number go)
- (vector-ref (page-stencils go) (page-number go)))
-
- (ly:interpret-stencil-expression
- ;; ;;(vector-ref (page-stencils go) (page-number go))
- (ly:stencil-expr (vector-ref (page-stencils go) (page-number go)))
- gnome-output-expression go '(0 . 0))
-
- (if old-canvas (destroy old-canvas))
- (add (scrolled go) (canvas go))
- (show (canvas go)))))
-
-(define x-editor #f)
-(define (get-x-editor)
- (if (not x-editor)
- (set! x-editor (getenv "XEDITOR")))
- x-editor)
-
-(define ifs #f)
-(define (get-ifs)
- (if (not ifs)
- (set! ifs (getenv "IFS")))
- (if (not ifs)
- (set! ifs " "))
- ifs)
-
-(define (spawn-editor location)
- (let* ((line (car location))
- (column (cadr location))
- (file-name (caddr location))
- (template (substring (get-x-editor) 0))
-
- ;; Adhere to %l %c %f?
- (command
- (regexp-substitute/global
- #f "%l" (regexp-substitute/global
- #f "%c"
- (regexp-substitute/global
- #f "%f" template 'pre file-name 'post)
- 'pre (number->string column)
- 'post)
- 'pre (number->string line) 'post)))
-
- (stderr "spawning: ~s\n" command)
- (if (= (primitive-fork) 0)
- (let ((command-list (string-split command #\ )));; (get-ifs))))
- (apply execlp command-list)
- (primitive-exit)))))
-
-(define location-callback spawn-editor)
-
-;;(define (item-event item event . data)
-(define-public (item-event item event . data)
- (case (gdk-event:type event)
- ((enter-notify) (gobject-set-property item 'fill-color "red"))
- ((leave-notify) (gobject-set-property item 'fill-color "black"))
- ((button-press)
-
- ;;FIXME
- (let ((location (hashq-ref (item-locations global-go) item #f)))
-
- (if location
- (location-callback location)
- (stderr "no location\n"))))
- ((2button-press) (gobject-set-property item 'fill-color "red")))
- #t)
-
-(define (scale-canvas factor)
- (set! pixels-per-unit (* pixels-per-unit factor))
- (set-pixels-per-unit main-canvas pixels-per-unit)
- (for-each
- (lambda (x)
- (let ((scale (gobject-get-property x 'scale))
- (points (gobject-get-property x 'size-points)))
- ;;(gobject-set-property x 'scale pixels-per-unit)
- (gobject-set-property x 'size-points (* points factor))))
- text-items))
-
-(define (key-press-event item event . data)
- (let ((keyval (gdk-event-key:keyval event))
- (mods (gdk-event-key:modifiers event)))
- (cond ((and (or (eq? keyval gdk:q)
- (eq? keyval gdk:w))
- (equal? mods '(control-mask modifier-mask)))
- (gtk-main-quit))
- ((and #t ;;(null? mods)
- (eq? keyval gdk:plus))
- (scale-canvas 2))
- ((and #t ;; (null? mods)
- (eq? keyval gdk:minus))
- (scale-canvas 0.5))
- ((or (eq? keyval gdk:Page-Up)
- (eq? keyval gdk:BackSpace))
- ;;FIXME
- (dump-page global-go (1- (page-number global-go))))
- ((or (eq? keyval gdk:Page-Down)
- (eq? keyval gdk:space))
- ;;FIXME
- (dump-page global-go (1+ (page-number global-go)))))
- #f))
-
-(define (new-canvas go)
- (set! (canvas go) (make <gnome-canvas>))
- (set-size-request (canvas go) (window-width go) (window-height go))
- (set-scroll-region (canvas go) 0 0 (canvas-width go) (canvas-height go))
- (set-pixels-per-unit (canvas go) (pixels-per-unit go))
- (make <gnome-canvas-rect>
- #:parent (root (canvas go))
- #:x2 (canvas-width go) #:y2 (canvas-height go)
- #:fill-color "white"))
-
-(define output-gnome-module #f)
-(define (get-output-gnome-module go)
- (if (not output-gnome-module)
- (let ((m (resolve-module '(scm output-gnome))))
- (module-define! m 'canvas-root (lambda () (root (canvas go))))
- (module-define! m 'output-scale output-scale)
- (set! output-gnome-module m)))
- output-gnome-module)
-
-(define-public (gnome-output-expression go expr)
- (let* ((m (get-output-gnome-module go))
- (result (eval expr m)))
- (cond
- ((and (pair? result)
- (eq? (car result) 'location))
- (set! (location go) (cdr result)))
- ((is-a? result <gnome-canvas-item>)
- (gtype-instance-signal-connect result 'event item-event)
- (if (location go)
- (hashq-set! (item-locations go) result (location go)))))))
-
+++ /dev/null
-;;;; framework-ps.scm --
-;;;;
-;;;; source file of the GNU LilyPond music typesetter
-;;;;
-;;;; (c) 2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
-(define-module (scm framework-ps))
-
-(use-modules (ice-9 regex)
- (ice-9 string-fun)
- (ice-9 format)
- (guile)
- (srfi srfi-1)
- (srfi srfi-13)
- (lily))
-
-(define-public (ps-font-command font . override-coding)
- (let* ((name (ly:font-filename font))
- (magnify (ly:font-magnification font))
- (coding-alist (ly:font-encoding-alist font))
- (input-encoding (assoc-get 'input-name coding-alist))
- (font-encoding (assoc-get 'output-name coding-alist))
- (coding-command (if (null? override-coding)
- (if (equal? input-encoding font-encoding)
- #f font-encoding)
- (car override-coding))))
-
- ;; FIXME: now feta stuff has feta* input-encoding (again?)
- ;;(format (current-error-port) "FONT: ~S, ~S\n" name font-encoding)
- ;;(format (current-error-port) "INPUT: ~S\n" input-encoding)
- (if (and coding-command
- (or
- (equal? (substring coding-command 0 4) "feta")
- (equal? (substring coding-command 0 8) "parmesan")
-
- ))
- (set! coding-command #f))
-
- (string-append
- "magfont" (string-encode-integer (hashq name 1000000))
- "m" (string-encode-integer (inexact->exact (round (* 1000 magnify))))
- (if (not coding-command) "" (string-append "e" coding-command)))))
-
-(define (tex-font? fontname)
- (or
- (equal? (substring fontname 0 2) "cm")
- (equal? (substring fontname 0 2) "ec")))
-
-(define (load-fonts bookpaper)
- (let* ((fonts (ly:bookpaper-fonts bookpaper))
- (font-names (uniq-list (sort (map ly:font-filename fonts) string<?)))
- (pfas (map
- (lambda (x)
- (ly:kpathsea-gulp-file (string-append x ".pfa")))
- (filter string? font-names))))
- (string-join pfas "\n")))
-
-(define (define-fonts bookpaper)
-
- (define font-list (ly:bookpaper-fonts bookpaper))
- (define (define-font command fontname scaling)
- (string-append
- "/" command " { /" fontname " findfont "
- (ly:number->string scaling) " output-scale div scalefont } bind def\n"))
-
- (define (reencode-font plain encoding command)
- (let ((coding-vector (get-coding-command encoding)))
- (string-append
- plain " " coding-vector " /" command " reencode-font\n"
- "/" command "{ /" command " findfont 1 scalefont } bind def\n")))
-
- (define (guess-ps-fontname basename)
-
- "We do not have the FontName, try to guess is from basename."
- (cond
- (#t basename)
- ((tex-font? basename)
- ;; FIXME: we need proper Fontmap for the bluesky CM*, EC* fonts.
- ;; Only the fonts that we trace in mf/ are in our own FontMap.
- (string-append basename ".pfb"))
- (else (string-append basename ".pfa"))))
-
- (define (font-load-command font)
- (let* ((specced-font-name (ly:font-name font))
- (fontname (if specced-font-name
- specced-font-name
- (guess-ps-fontname (ly:font-filename font))))
-
- (coding-alist (ly:font-encoding-alist font))
- (input-encoding (assoc-get 'input-name coding-alist))
- (font-encoding (assoc-get 'output-name coding-alist))
- (command (ps-font-command font))
- ;; FIXME -- see (ps-font-command )
- (plain (ps-font-command font #f))
- (designsize (ly:font-design-size font))
- (magnification (* (ly:font-magnification font)))
- (ops (ly:output-def-lookup bookpaper 'outputscale))
- (scaling (* ops magnification designsize)))
-
- (string-append
- (define-font plain fontname scaling)
- (if (or (equal? input-encoding font-encoding)
- ;; guh
- (equal? font-encoding "fetaBraces")
- (equal? font-encoding "fetaNumber")
- (equal? font-encoding "fetaMusic")
- (equal? font-encoding "parmesanMusic"))
- ""
- (reencode-font plain input-encoding command)))))
-
- (define (font-load-encoding encoding)
- (let ((filename (get-coding-filename encoding)))
- (ly:kpathsea-gulp-file filename)))
-
- (let* ((encoding-list (map (lambda (x)
- (assoc-get 'input-name
- (ly:font-encoding-alist x)))
- font-list))
- (encodings (uniq-list (sort-list (filter string? encoding-list)
- string<?))))
-
- (string-append
- (apply string-append (map font-load-encoding encodings))
- (apply string-append
- (map (lambda (x) (font-load-command x)) font-list)))))
-
-;; FIXME: duplicated in other output backends
-;; FIXME: silly interface name
-(define (output-variables paper)
- ;; FIXME: duplicates output-paper's scope-entry->string, mostly
- (define (value->string val)
- (cond
- ((string? val) (string-append "(" val ")"))
- ((symbol? val) (symbol->string val))
- ((number? val) (number->string val))
- (else "")))
-
- (define (output-entry ps-key ly-key)
- (string-append
- "/" ps-key " "
- (value->string (ly:output-def-lookup paper ly-key)) " def \n"))
-
- (string-append
- "/lily-output-units 2.83464 def %% milimeter \n"
- "% /lily-output-units 0.996264 def %% true points.\n"
- (output-entry "staff-line-thickness" 'linethickness)
- (output-entry "line-width" 'linewidth)
- (output-entry "paper-size" 'papersize)
- (output-entry "staff-height" 'staffheight) ;junkme.
- "/output-scale "
- (number->string (ly:output-def-lookup paper 'outputscale))
- " lily-output-units mul def \n"))
-
-(define (header paper page-count classic?)
- (string-append
- "%!PS-Adobe-3.0\n"
- "%%Creator: creator time-stamp \n"))
-
-(define (dump-page outputter page page-number page-count)
- (ly:outputter-dump-string outputter
- (string-append
- "%%Page: "
- (number->string page-number) " " (number->string page-count) "\n"
- "0 0 start-system { "
- "set-ps-scale-to-lily-scale "
- "\n"))
- (ly:outputter-dump-stencil outputter page)
- (ly:outputter-dump-string outputter "} stop-system \nshowpage\n"))
-
-(define-public (output-framework outputter book scopes fields basename)
- (let* ((bookpaper (ly:paper-book-book-paper book))
- (pages (ly:paper-book-pages book))
- (page-number 0)
- (page-count (length pages)))
- (for-each
- (lambda (x)
- (ly:outputter-dump-string outputter x))
- (list
- (header bookpaper
- (length pages)
- #f)
-
- "%%Pages: " (number->string page-count) "\n"
- "%%PageOrder: Ascend\n"
- "%%DocumentPaperSizes: " (ly:output-def-lookup bookpaper 'papersize) "\n"
-
- (output-variables bookpaper)
- (ly:gulp-file "music-drawing-routines.ps")
- (ly:gulp-file "lilyponddefs.ps")
- (load-fonts bookpaper)
- (define-fonts bookpaper)))
-
- (for-each
- (lambda (page)
- (set! page-number (1+ page-number))
- (dump-page outputter page page-number page-count))
- pages)
- (ly:outputter-dump-string outputter "%%Trailer\n%%EOF\n")))
-
-(define-public (output-classic-framework outputter book scopes fields
- basename)
- (let* ((bookpaper (ly:paper-book-book-paper book))
- (lines (ly:paper-book-lines book))
- (y 0.0)
- ;; What the F*** is 2.83463?
- (scale (* 2.83464 (ly:output-def-lookup bookpaper 'outputscale)))
- (total-y
- (apply + (map (lambda (z) (ly:paper-system-extent z Y)) lines)))
- (x-ext '(-8 . 0))
- (lineno 0))
-
- (define (dump-line outputter system)
- (let ((stil (ly:paper-system-stencil system)))
-
- (ly:outputter-dump-string
- outputter
- (string-append
- " 0.0 "
- (ly:number->string y)
- " start-system {\n set-ps-scale-to-lily-scale\n"))
- (set! y (+ y (ly:paper-system-extent system Y)))
- (ly:outputter-dump-stencil outputter stil)
- (ly:outputter-dump-string
- outputter
- "} stop-system\n")))
-
- (define (to-pt x)
- (inexact->exact (round (* scale x))))
-
- (define (bbox llx lly urx ury)
- (string-append
- "%%BoundingBox: "
- (ly:number->string (to-pt llx)) " "
- (ly:number->string (to-pt lly)) " "
- (ly:number->string (to-pt urx)) " "
- (ly:number->string (to-pt ury)) "\n"))
-
- (for-each
- (lambda (ell)
- (set! x-ext (interval-union x-ext
- (cons 0.0 (ly:paper-system-extent ell X)))))
- lines)
-
- (for-each
- (lambda (x)
- (ly:outputter-dump-string outputter x))
- (list
- "%!PS-Adobe-2.0 EPSF-2.0\n"
- "%%Creator: LilyPond \n"
-
-;; (bbox (car x-ext) 0 (cdr x-ext) total-y) ; doesn't work well
-
- "%%EndComments\n"
- (output-variables bookpaper)
- (ly:gulp-file "music-drawing-routines.ps")
- (ly:gulp-file "lilyponddefs.ps")
- (load-fonts bookpaper)
- (define-fonts bookpaper)))
-
-;; ; page-number page-count))
- (for-each
- (lambda (line) (set! lineno (1+ lineno)) (dump-line outputter line))
- lines)
- (ly:outputter-dump-string outputter "\n")))
+++ /dev/null
-;;;; framework-tex.scm --
-;;;;
-;;;; source file of the GNU LilyPond music typesetter
-;;;;
-;;;; (c) 2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
-(define-module (scm framework-tex)
- #:export (output-framework-tex
- output-classic-framework-tex
-))
-
-(use-modules (ice-9 regex)
- (ice-9 string-fun)
- (ice-9 format)
- (guile)
- (srfi srfi-13)
- (lily))
-
-(define-public (sanitize-tex-string s) ;; todo: rename
- (if (ly:get-option 'safe)
- (regexp-substitute/global #f "\\\\"
- (regexp-substitute/global #f "([{}])" "bla{}" 'pre "\\" 1 'post )
- 'pre "$\\backslash$" 'post)
-
- s))
-
-(define (symbol->tex-key sym)
- (regexp-substitute/global
- #f "_" (sanitize-tex-string (symbol->string sym)) 'pre "X" 'post) )
-
-(define (tex-number-def prefix key number)
- (string-append
- "\\def\\" prefix (symbol->tex-key key) "{" number "}%\n"))
-
-(define-public (tex-font-command font)
- (string-append
- "magfont"
- (string-encode-integer
- (hashq (ly:font-filename font) 1000000))
- "m"
- (string-encode-integer
- (inexact->exact (round (* 1000 (ly:font-magnification font)))))))
-
-(define (font-load-command bookpaper font)
- (string-append
- "\\font\\" (tex-font-command font) "="
- (ly:font-filename font)
- " scaled "
- (ly:number->string (inexact->exact
- (round (* 1000
- (ly:font-magnification font)
- (ly:bookpaper-outputscale bookpaper)))))
- "\n"))
-
-
-(define (define-fonts bookpaper)
- (string-append
- "\\def\\lilypondpaperunit{mm}" ;; UGH. FIXME.
- (tex-number-def "lilypondpaper" 'outputscale
- (number->string (exact->inexact
- (ly:bookpaper-outputscale bookpaper))))
- (tex-string-def "lilypondpaper" 'papersize
- (eval 'papersize (ly:output-def-scope bookpaper)))
-
- (apply string-append
- (map (lambda (x) (font-load-command bookpaper x))
- (ly:bookpaper-fonts bookpaper)))))
-
-(define (header-to-file fn key val)
- (set! key (symbol->string key))
- (if (not (equal? "-" fn))
- (set! fn (string-append fn "." key)))
- (display
- (format "Writing header field `~a' to `~a'..."
- key
- (if (equal? "-" fn) "<stdout>" fn)
- )
- (current-error-port))
- (if (equal? fn "-")
- (display val)
- (display val (open-file fn "w")))
- (display "\n" (current-error-port))
- "")
-
-(define (output-scopes scopes fields basename)
- (define (output-scope scope)
- (apply
- string-append
- (module-map
- (lambda (sym var)
- (let ((val (if (variable-bound? var) (variable-ref var) ""))
- )
-
- (if (and (memq sym fields) (string? val))
- (header-to-file basename sym val))
- ""))
- scope)))
- (apply string-append (map output-scope scopes)))
-
-(define (tex-string-def prefix key str)
- (if (equal? "" (sans-surrounding-whitespace (sanitize-tex-string str)))
- (string-append "\\let\\" prefix (symbol->tex-key key) "\\undefined%\n")
- (string-append "\\def\\" prefix (symbol->tex-key key)
- "{" (sanitize-tex-string str) "}%\n")))
-
-(define (header creator time-stamp bookpaper page-count classic?)
- (let ((scale (ly:output-def-lookup bookpaper 'outputscale)))
-
- (string-append
- "% Generated by " creator "\n"
- "% at " time-stamp "\n"
- (if classic?
- (tex-string-def "lilypond" 'classic "1")
- "")
-
- (tex-string-def
- "lilypondpaper" 'linewidth
- (ly:number->string (* scale (ly:output-def-lookup bookpaper 'linewidth))))
-
- (tex-string-def
- "lilypondpaper" 'interscoreline
- (ly:number->string
- (* scale (ly:output-def-lookup bookpaper 'interscoreline)))))))
-
-(define (header-end)
- (string-append
- "\\def\\scaletounit{ "
- (number->string (cond
- ((equal? (ly:unit) "mm") (/ 72.0 25.4))
- ((equal? (ly:unit) "pt") (/ 72.0 72.27))
- (else (error "unknown unit" (ly:unit)))))
- " mul }%\n"
- "\\ifx\\lilypondstart\\undefined\n"
- " \\input lilyponddefs\n"
- "\\fi\n"
- "\\outputscale = \\lilypondpaperoutputscale\\lilypondpaperunit\n"
- "\\lilypondstart\n"
- "\\lilypondspecial\n"
- "\\lilypondpostscript\n"))
-
-(define (dump-page putter page last?)
- (ly:outputter-dump-string
- putter
- "\n\\vbox to 0pt{%\n\\leavevmode\n\\lybox{0}{0}{0}{0}{%\n")
- (ly:outputter-dump-stencil putter page)
- (ly:outputter-dump-string
- putter
- (if last?
- "}\\vss\n}\n\\vfill\n"
- "}\\vss\n}\n\\vfill\\lilypondpagebreak\n")))
-
-(define-public (output-framework outputter book scopes fields basename)
- (let* ((bookpaper (ly:paper-book-book-paper book))
- (pages (ly:paper-book-pages book))
- (last-page (car (last-pair pages)))
- )
- (for-each
- (lambda (x)
- (ly:outputter-dump-string outputter x))
- (list
- (header "creator" "timestamp" bookpaper (length pages) #f)
- (define-fonts bookpaper)
- (header-end)))
-
- (for-each
- (lambda (page) (dump-page outputter page (eq? last-page page)))
- pages)
- (ly:outputter-dump-string outputter "\\lilypondend\n")))
-
-(define (dump-line putter line last?)
- (ly:outputter-dump-string
- putter
- (string-append "\\leavevmode\n\\lybox{0}{0}{0}{"
- (ly:number->string (ly:paper-system-extent line Y))
- "}{"))
-
- (ly:outputter-dump-stencil putter (ly:paper-system-stencil line))
- (ly:outputter-dump-string
- putter
- (if last?
- "}%\n"
- "}\\interscoreline\n")))
-
-(define-public (output-classic-framework
- outputter book scopes fields basename)
- (let* ((bookpaper (ly:paper-book-book-paper book))
- (lines (ly:paper-book-lines book))
- (last-line (car (last-pair lines))))
- (for-each
- (lambda (x)
- (ly:outputter-dump-string outputter x))
- (list
- ;;FIXME
- (header "creator" "timestamp" bookpaper (length lines) #f)
- "\\def\\lilypondclassic{1}%\n"
- (output-scopes scopes fields basename)
- (define-fonts bookpaper)
- (header-end)))
-
- (for-each
- (lambda (line) (dump-line outputter line (eq? line last-line))) lines)
- (ly:outputter-dump-string outputter "\\lilypondend\n")))
-
-
-(define-public (output-preview-framework
- outputter book scopes fields basename)
- (let* ((bookpaper (ly:paper-book-book-paper book))
- (lines (ly:paper-book-lines book)))
- (for-each
- (lambda (x)
- (ly:outputter-dump-string outputter x))
- (list
- ;;FIXME
- (header "creator" "timestamp" bookpaper (length lines) #f)
- "\\def\\lilypondclassic{1}%\n"
- (output-scopes scopes fields basename)
- (define-fonts bookpaper)
- (header-end)))
-
- (dump-line outputter (car lines) #t)
- (ly:outputter-dump-string outputter "\\lilypondend\n")))
+++ /dev/null
-;;;; fret-diagrams.scm --
-;;;;
-;;;; source file of the GNU LilyPond music typesetter
-;;;;
-;;;; (c) 2004 Carl D. Sorensen <c_sorensen@byu.edu>
-
-(define ly:paper-lookup ly:output-def-lookup) ; compat for 2.3, remove when using 2.2
-(define fontify-text-white fontify-text) ; temporary until fontify-text-white works properly (see draw-dots for usage)
-
-;;TODO -- Change font interface from name, magnification to family, weight, size
-; Right now, using the desired interface gives an error, so we use name, magnification
-
-(define (fret-parse-marking-list marking-list fret-count)
- (let* ((fret-range (list 1 fret-count))
- (barre-list '())
- (dot-list '())
- (xo-list '())
- (output-alist '()))
- (let parse-item ((mylist marking-list))
- (if (not (null? mylist))
- (let* ((my-item (car mylist)) (my-code (car my-item)))
- (cond
- ((or (eq? my-code 'open)(eq? my-code 'mute))
- (set! xo-list (cons* my-item xo-list)))
- ((eq? my-code 'barre)
- (set! barre-list (cons* (cdr my-item) barre-list)))
- ((eq? my-code 'place-fret)
- (set! dot-list (cons* (cdr my-item) dot-list))))
- (parse-item (cdr mylist)))))
- ; calculate fret-range
- (let ((maxfret 0) (minfret 99))
- (let updatemax ((fret-list dot-list))
- (if (null? fret-list)
- '()
- (let ((fretval (second (car fret-list))))
- (if (> fretval maxfret) (set! maxfret fretval))
- (if (< fretval minfret) (set! minfret fretval))
- (updatemax (cdr fret-list)))))
- (if (> maxfret fret-count)
- (set! fret-range (list minfret
- (let ((upfret (- (+ minfret fret-count) 1)))
- (if (> maxfret upfret) maxfret upfret)))))
- ; subtract fret from dots
- (set! dot-list (subtract-base-fret (- (car fret-range) 1) dot-list)))
- (acons 'fret-range fret-range
- (acons 'barre-list barre-list
- (acons 'dot-list dot-list
- (acons 'xo-list xo-list '()))))))
-
-(define (subtract-base-fret base-fret dot-list)
-"Subtract @var{base-fret} from every fret in @var{dot-list}"
- (if (null? dot-list)
- '()
- (let ((this-list (car dot-list)))
- (cons* (list (car this-list) (- (second this-list) base-fret) (if (null? (cddr this-list))
- '()
- (third this-list)))
- (subtract-base-fret base-fret (cdr dot-list))))))
-
-(define (draw-strings string-count fret-range th size)
-"Draw the strings (vertical lines) for a fret diagram with @var{string-count} strings and frets as indicated
- in @var{fret-range}. Line thickness is given by @var{th}, fret & string spacing by @var{size}. "
- (let* ((fret-count (+ (- (cadr fret-range) (car fret-range)) 1))
- (sl (* (+ fret-count 1) size))
- (sth (* size th))
- (half-thickness (* sth 0.5))
- (gap (- size sth))
- (string-stencil (ly:make-stencil (list 'draw-line sth 0 0 0 sl)
- (cons (- half-thickness) half-thickness)
- (cons (- half-thickness) (+ sl half-thickness)))))
- (if (= string-count 1)
- string-stencil
- (ly:stencil-combine-at-edge
- (draw-strings (- string-count 1) fret-range th size) X RIGHT
- string-stencil
- gap 0))))
-
-(define (draw-fret-lines fret-count string-count th size)
- "Draw @var{fret-count} frets (horizontal lines) for a fret diagram with @var{string-count} strings.
- Line thickness is given by @var{th}, fret & string spacing by @var{size}. "
- (let* ((fret-length (* (- string-count 1) size))
- (sth (* size th))
- (half-thickness (* sth 0.5))
- (gap (- size sth))
- (fret-line (ly:make-stencil (list 'draw-line sth half-thickness size (- fret-length half-thickness) size)
- (cons 0 fret-length)
- (cons (- size half-thickness) (+ size half-thickness)))))
- (if (= fret-count 1)
- fret-line
- (ly:stencil-combine-at-edge fret-line Y UP
- (draw-fret-lines (- fret-count 1) string-count th size)
- gap 0))))
-
-(define (draw-thick-top-fret props string-count th size)
- "Draw a thick top fret for a fret diagram whose base fret is not 1."
- (let* ((sth (* th size))
- (top-fret-thick (* sth (chain-assoc-get 'top-fret-thickness props 3.0)))
- (top-half-thick (* top-fret-thick 0.5))
- (half-thick (* sth 0.5))
- (x1 half-thick)
- (x2 (+ half-thick (* size (- string-count 1))))
- (y1 0)
- (y2 top-fret-thick)
- (x-extent (cons (- x1) x2))
- (y-extent (cons 0 y2)))
- (ly:make-stencil (list 'round-filled-box x1 x2 y1 y2 th)
- x-extent y-extent)))
-
-
-(define (draw-frets paper props fret-range string-count th size)
- "Draw the frets (horizontal lines) for a fret diagram with @var{string-count} strings and frets as indicated
- in @var{fret-range}. Line thickness is given by @var{th}, fret & string spacing by @var{size}. "
- (let* ((top-fret-thick (* th (chain-assoc-get 'top-fret-thickness props 3.0)))
- (fret-count (+ (- (cadr fret-range) (car fret-range)) 1))
- (fret-length (* (- string-count 1) size))
- (half-thickness (* th 0.5))
- (base-fret (car fret-range)))
- (ly:stencil-combine-at-edge
- (draw-fret-lines fret-count string-count th size) Y UP
- (if (= base-fret 1)
- (draw-thick-top-fret props string-count th size)
- (draw-fret-lines 1 string-count th size))
- (- size th) 0)))
-
-
-(define (centered-text-stencil procedure font text)
-"Create a centered text stencil of @var{text} in font @var{font} using stencil creation procedure @var{procedure}"
-;UGH -- version check is necessary because 2.3 is not available on cygwin, so CDS development
-; needs 2.2 compatible ly:stencil-align-to!
-; Once 2.3 is built on cygwin, version check can go (fret-diagrams.scm is not part of dist for 2.2)
-(let* ((text-stencil (procedure font text)))
- (if (= (cadr (ly:version)) 3)
- (begin
- (ly:stencil-align-to! text-stencil Y 0)
- (ly:stencil-align-to! text-stencil X 0)
- text-stencil)
- (ly:stencil-align-to (ly:stencil-align-to text-stencil X 0) Y 0))))
-
-(define (draw-dots paper props string-count fret-range size finger-code dot-circle-font-mag dot-position dot-radius dot-list)
- "Make dots for fret diagram."
-;TODO -- move away from name,magnification font spec to family, size
-; Note -- family, size doesn't work with fontify-text procedure; need to fix that before we can make the switch
- (let* ((scale-dot-radius (* size dot-radius))
- (dot-color (chain-assoc-get 'dot-color props 'black))
- (finger-xoffset (chain-assoc-get 'finger-xoffset props -0.25))
- (finger-yoffset (chain-assoc-get 'finger-yoffset props (- size)))
-;part of deprecated font interface
- (label-font-name (chain-assoc-get 'label-font-name props "cmss8"))
- (white-dot-font-mag (* scale-dot-radius (chain-assoc-get 'white-dot-font-mag props 1.8)))
- (dot-label-font-mag (* scale-dot-radius (chain-assoc-get 'dot-label-font-mag props 1.2)))
- (string-label-font-mag (* size (chain-assoc-get 'string-label-font-mag props 0.6)))
- (fret-count (+ (- (cadr fret-range) (car fret-range) 1)))
- (mypair (car dot-list))
- (restlist (cdr dot-list))
- (xpos (* size (- string-count (car mypair))))
-;TODO -- figure out what 4 is and get rid of it
-;UGH -- 4?
- (ypos (* size (+ 4 (- fret-count (cadr mypair) dot-position ))))
- (extent (cons (- scale-dot-radius) scale-dot-radius))
- (finger (caddr mypair))
- (finger (if (number? finger) (number->string finger) finger))
-; desired font interface
- (string-label-font (ly:paper-get-font paper `(((font-family . sans)(font-encoding . latin1)(font-series . medium) (font-shape . upright)
- (font-size . ,(stepmag (* size string-label-font-mag)))))))
-; deprecated font interface
-; (string-label-font (ly:paper-get-font paper `(((font-magnification . ,string-label-font-mag)
-; (font-name . ,label-font-name)))))
-; desired font interface
- (dot-label-font (ly:paper-get-font paper `(((font-family . sans)(font-encoding . latin1)(font-series . medium) (font-shape . upright)
- (font-size . ,(stepmag (* size dot-label-font-mag)))))))
-; deprecated font interface
-; (dot-label-font (ly:paper-get-text-font paper `(((font-magnification . ,dot-label-font-mag)
-; (font-name . ,label-font-name)))))
-; desired font interface
- (dot-circle-font (ly:paper-get-font paper `(((font-family . sans)(font-encoding . latin1)(font-series . medium) (font-shape . upright)
- (font-size . ,(stepmag (* size dot-circle-font-mag)))))))
-; deprecated font interface
-; (dot-circle-font (ly:paper-get-font paper `(((font-magnification . ,dot-circle-font-mag)
-; (font-name . ,label-font-name)))))
-; deprecated font interface
- (white-dot-font (ly:paper-get-font paper `(((font-magnification . ,white-dot-font-mag)
- (font-name . ,label-font-name)))))
- (dotstencil (if (eq? dot-color 'white)
- (begin
- (ly:make-stencil (list 'white-dot 0 0 scale-dot-radius) extent extent))
- (ly:make-stencil (list 'dot 0 0 scale-dot-radius ) extent extent)))
- (positioned-dot (ly:stencil-translate-axis
- (ly:stencil-translate-axis dotstencil xpos X)
- ypos Y))
- (labeled-dot-stencil
- (if (or (eq? finger '())(eq? finger-code 'none))
- positioned-dot
- (if (eq? finger-code 'in-dot)
- (let* ((dot-proc (if (eq? dot-color 'white) 'white-dot 'dot))
- (text-proc (if (eq? dot-color 'white) fontify-text fontify-text-white)))
- (ly:stencil-add
- (ly:stencil-translate-axis
- (ly:stencil-translate-axis
- (centered-text-stencil text-proc dot-label-font finger) xpos X)
- ypos Y)
- (ly:stencil-translate-axis
- (ly:stencil-translate-axis
- (ly:make-stencil (list dot-proc 0 0 scale-dot-radius) extent extent)
- xpos X)
- ypos Y)))
- (if (eq? finger-code 'below-string)
- (ly:stencil-add
- positioned-dot
- (ly:stencil-translate-axis
- (ly:stencil-translate-axis
- (centered-text-stencil fontify-text string-label-font finger) xpos X)
- (* size finger-yoffset) Y))
- ;unknown finger-code
- positioned-dot)))))
- (if (null? restlist)
- labeled-dot-stencil
- (ly:stencil-add
- (draw-dots paper props string-count fret-range size finger-code dot-circle-font-mag
- dot-position dot-radius restlist)
- labeled-dot-stencil))))
-
-(define (draw-xo paper props string-count fret-range size xo-list)
-"Put open and mute string indications on diagram, as contained in @var{xo-list}."
-;TODO -- Move away from name,mag font spec to family, size
- (let* ((fret-count (+ (- (cadr fret-range) (car fret-range) 1)))
- (xo-font-mag (* size (chain-assoc-get 'xo-font-magnification props 0.5)))
- (xo-font-name (chain-assoc-get 'xo-font-name props "cmss8"))
- (xo-horizontal-offset (* size (chain-assoc-get 'xo-horizontal-offset props -0.35)))
-; desired font interface
-; (font (ly:paper-get-font paper `(((font-family . sans)(font-series . medium) (font-shape . upright)
-; (font-size . ,(stepmag (* size xo-font-mag)))))))
-; deprecated font interface
- (font (ly:paper-get-font paper `(((font-magnification . ,xo-font-mag)
- (font-name . ,xo-font-name)))))
- (mypair (car xo-list))
- (restlist (cdr xo-list))
- (glyph-string (if (eq? (car mypair) 'mute) "X" "O"))
- (xpos (+ (* (- string-count (cadr mypair)) size) xo-horizontal-offset ))
- (glyph-stencil (ly:stencil-translate-axis (fontify-text font glyph-string) xpos X)))
- (if (null? restlist)
- glyph-stencil
- (ly:stencil-add
- (draw-xo paper props string-count fret-range size restlist)
- glyph-stencil))))
-
-(define (make-bezier-sandwich-list left right bottom height thickness)
-" Make the argument list for a horizontal bezier sandwich from @var{left} to @var{right} with a bottom at @var{bottom},
- a height of @var{height}, and a thickness of @var{thickness}."
- (let* ((width (+ (- right left) 1))
- (x1 (+ (* width thickness) left))
- (x2 (- right (* width thickness)))
- (bottom-control-point-height (+ bottom (- height thickness)))
- (top-control-point-height (+ bottom height)))
- ; order of points is: left cp low, right cp low, right end low, left end low
- ; right cp high, left cp high, left end high, right end high.
- (list (cons x1 bottom-control-point-height) (cons x2 bottom-control-point-height) (cons right bottom) (cons left bottom)
- (cons x2 top-control-point-height) (cons x1 top-control-point-height) (cons left bottom) (cons right bottom))))
-
-(define (draw-barre paper props string-count fret-range size finger-code dot-circle-font-mag dot-position dot-radius barre-list)
- "Create barre indications for a fret diagram"
- (if (not (null? barre-list))
- (let* ((string1 (caar barre-list))
- (string2 (cadar barre-list))
- (fret (caddar barre-list))
- (barre-vertical-offset (chain-assoc-get 'barre-vertical-offset props 0.5))
- ; 2 is 1 for empty fret at bottom of figure + 1 for interval (top-fret - fret + 1) -- not an arbitrary constant
- (bottom (+ (* size (- (+ 2 (- (cadr fret-range) fret))dot-position) ) (* size barre-vertical-offset dot-radius)))
- (left (* size (- string-count string1)))
- (right (* size (- string-count string2)))
- (bezier-thick (chain-assoc-get 'bezier-thickness props 0.1))
- (bezier-height (chain-assoc-get 'bezier-height props 0.5))
- (bezier-list (make-bezier-sandwich-list left right bottom (* size bezier-height) (* size bezier-thick)))
- (sandwich-stencil (ly:make-stencil (list 'bezier-sandwich `(quote ,bezier-list) (* size bezier-thick) )
- (cons 0 right)
- (cons 0 (+ bottom (* size bezier-height))))))
- (if (not (null? (cdr barre-list)))
- (ly:stencil-add sandwich-stencil
- (draw-barre paper props string-count fret-range size finger-code dot-circle-font-mag
- dot-position dot-radius (cdr barre-list)))
- sandwich-stencil ))))
-
-
-(define (stepmag mag)
-"Calculate the font step necessary to get a desired magnification"
-(* 6 (/ (log mag) (log 2))))
-
-(define (label-fret paper props string-count fret-range size)
- "Label the base fret on a fret diagram"
-;TODO -- move away from name,magnification font spec to family, size
- (let* ((base-fret (car fret-range))
- (label-font-mag (chain-assoc-get 'fret-label-font-magnification props 0.7))
-; (label-horizontal-offset (chain-assoc-get 'fret-label-horizontal-offset props -0.5))
- (label-vertical-offset (chain-assoc-get 'fret-label-vertical-offset props -0.2))
- (fret-count (+ (- (cadr fret-range) (car fret-range)) 1))
-; desired font interface
-; (font (ly:paper-get-font paper `(((font-family . sans)(font-series . medium) (font-shape . upright)
-; (font-size . ,(stepmag (* size label-font-mag))))))))
-; deprecated font interface
- (font (ly:paper-get-font paper `(((font-magnification . ,label-font-mag)
- (font-name . "cmss8"))))))
- (ly:stencil-translate-axis (fontify-text font (format #f "~(~:@r~)" base-fret))
- (* size (+ fret-count label-vertical-offset)) Y)))
-
-(def-markup-command (fret-diagram-verbose paper props marking-list)
- (list?)
-;TODO -- put table in doc string
- "Make a fret diagram containing the symbols indicated in @var{marking-list}
-
- Syntax: \\fret-diagram marking-list
-
- For example,
-
- @verbatim
- \\markup \\fret-diagram #'((mute 6) (mute 5) (open 4) (place-fret 3 2) (place-fret 2 3) (place-fret 1 2))
- @end verbatim
-
- will produce a standard D chord diagram without fingering indications.
-
-Possible elements in @var{marking-list}:
-@table @asis
-@item (mute string-number)
-Place a small 'x' at the top of string @var{string-number}
-
-@item (open string-number)
-Place a small 'o' at the top of string @var{string-number}
-
-@item (barre start-string end-string fret-number)
-Place a barre indicator (much like a tie) from string @var{start-string}to string @var{end-string} at fret @var{fret-number}
-
-@item (place-fret string-number fret-number finger-value)
-Place a fret playing indication on string @var{string-number} at fret @var{fret-number} with an optional
-fingering label @var{finger-value}. By default, the fret playing indicator is a solid dot. This can be
-changed by setting the value of the variable @var{dot-color}. If the @var{finger}
-part of the place-fret element is present, @var{finger-value} will be displayed according to the setting of the variable
-@var{finger-code}. There is no limit to the number of fret indications per string.
-@end table
-"
- (make-fret-diagram paper props marking-list))
-
-(define (make-fret-diagram paper props marking-list)
-" Make a fret diagram markup"
- (let* (
- ; note: here we get items from props that are needed in this routine, or that are needed in more than one
- ; of the procedures called from this routine. If they're only used in one of the sub-procedure, they're
- ; obtained in that procedure
-
- (size (chain-assoc-get 'size props 1.0)) ; needed for everything
-;TODO -- get string-count directly from length of stringTunings; requires FretDiagram engraver, which is not yet available
-;TODO -- adjust padding for fret label? it appears to be too close to dots
- (string-count (chain-assoc-get 'string-count props 6)) ; needed for everything
- (fret-count (chain-assoc-get 'fret-count props 4)) ; needed for everything
- (dot-position (chain-assoc-get 'dot-position props 0.6)) ; needed for both draw-dots and draw-barre
- (dot-radius (chain-assoc-get 'dot-radius props 0.25)) ; needed for both draw-dots and draw-barre
- (finger-code (chain-assoc-get 'finger-code props 'none)) ; needed for both draw-dots and draw-barre
- (dot-circle-font-mag (* size (chain-assoc-get 'dot-circle-font-mag props .75))) ; needed for both draw-dots and draw-barre
- (th (* (ly:paper-lookup paper 'linethickness)
- (chain-assoc-get 'thickness props 0.5))) ; needed for both draw-frets and draw-strings
-
- (alignment (chain-assoc-get 'alignment props -0.4)) ; needed only here
- (xo-padding (* th (chain-assoc-get 'xo-padding props 2))) ; needed only here
-
- (parameters (fret-parse-marking-list marking-list fret-count))
- (dot-list (cdr (assoc 'dot-list parameters)))
- (xo-list (cdr (assoc 'xo-list parameters)))
- (fret-range (cdr (assoc 'fret-range parameters)))
- (barre-list (cdr (assoc 'barre-list parameters)))
- (fret-diagram-stencil (ly:stencil-add
- (draw-strings string-count fret-range th size)
- (draw-frets paper props fret-range string-count th size))))
- (if (not (null? barre-list))
- (set! fret-diagram-stencil (ly:stencil-add
- (draw-barre paper props string-count fret-range size finger-code dot-circle-font-mag
- dot-position dot-radius barre-list)
- fret-diagram-stencil)))
- (if (not (null? dot-list))
- (set! fret-diagram-stencil (ly:stencil-add
- (draw-dots paper props string-count fret-range size finger-code dot-circle-font-mag
- dot-position dot-radius dot-list)
- fret-diagram-stencil)))
- (if (not (null? xo-list))
- (set! fret-diagram-stencil (ly:stencil-combine-at-edge
- fret-diagram-stencil Y UP
- (draw-xo paper props string-count fret-range size xo-list) xo-padding 0)))
- (if (> (car fret-range) 1)
- (set! fret-diagram-stencil
- (ly:stencil-combine-at-edge fret-diagram-stencil X RIGHT
- (label-fret paper props string-count fret-range size) 0 0)))
- (ly:stencil-align-to! fret-diagram-stencil X alignment)
- fret-diagram-stencil))
-
-(def-markup-command (fret-diagram paper props definition-string)
- (string?)
-;TODO -- put table in doc string
- "Syntax: \\fret-diagram definition-string
-
-eg: \\markup \\fret-diagram #\"s:0.75;6-x;5-x;4-o;3-2;2-3;1-2;\"
-
-for fret spacing 3/4 of staff space, D chord diagram
-
-Syntax rules for @var{definition-string}:
-@itemize @minus
-
-@item
-Diagram items are separated by semicolons.
-
-@item
-Possible items:
-
-@itemize @bullet
-@item
-s:number -- set the fret spacing of the diagram (in staff spaces). Default 1
-
-@item
-t:number -- set the line thickness (in staff spaces). Default 0.05
-
-@item
-h:number -- set the height of the diagram in frets. Default 4
-
-@item
-w:number -- set the width of the diagram in strings. Default 6
-
-@item
-f:number -- set fingering label type (0 = none, 1 = in circle on string, 2 = below string) Default 0
-
-@item
-d:number -- set radius of dot, in terms of fret spacing. Default 0.25
-
-@item
-p:number -- set the position of the dot in the fret space. 0.5 is centered; 1 is on lower fret bar,
-0 is on upper fret bar. Default 0.6
-
-@item
-c:string1-string2-fret -- include a barre mark from string1 to string2 on fret
-
-@item
-string-fret -- place a dot on string at fret. If fret is o, string is identified
-as open. If fret is x, string is identified as muted.
-
-@item
-string-fret-fingering -- place a dot on string at fret, and label with fingering as
-defined by f: code.
-
-@end itemize
-
-@item
-Note: There is no limit to the number of fret indications per string.
-@end itemize
-
-"
-; (define new-props (acons 'size size '()))
-; (set! props (cons new-props props))
- (let ((definition-list (fret-parse-definition-string props definition-string)))
- (make-fret-diagram paper (car definition-list) (cdr definition-list))))
-
-(define (fret-parse-definition-string props definition-string)
- "parse a fret diagram string and return a pair containing:
- props, modified as necessary by the definition-string
- a fret-indication list with the appropriate values"
- (let* ((fret-count 4)
- (string-count 6)
- ; (thickness 0.05)
- ; (finger-code 0)
- ; (dot-size 0.25)
- ; (dot-position 0.6)
- (fret-range (list 1 fret-count))
- (barre-list '())
- (dot-list '())
- (xo-list '())
- (output-list '())
- (new-props '())
- (items (string-split definition-string #\;)))
- (let parse-item ((myitems items))
- (if (not (null? (cdr myitems)))
- (let ((test-string (car myitems)))
- (case (car (string->list (substring test-string 0 1)))
- ((#\s) (let ((size (get-numeric-from-key test-string)))
- (set! new-props (acons 'size size new-props))))
- ((#\f) (let* ((finger-code (get-numeric-from-key test-string))
- (finger-id (case finger-code
- ((0) 'none)
- ((1) 'in-dot)
- ((2) 'below-string))))
- (set! new-props
- (acons 'finger-code finger-id new-props))))
- ((#\c) (set! output-list (cons-fret (cons 'barre (numerify (string-split (substring test-string 2) #\-)))
- output-list)))
- ((#\h) (let ((fret-count (get-numeric-from-key test-string)))
- (set! new-props (acons 'fret-count fret-count new-props))))
- ((#\w) (let ((string-count (get-numeric-from-key test-string)))
- (set! new-props (acons 'string-count string-count new-props))))
- ((#\d) (let ((dot-size (get-numeric-from-key test-string)))
- (set! new-props (acons 'dot-radius dot-size new-props))))
- ((#\p) (let ((dot-position (get-numeric-from-key test-string)))
- (set! new-props (acons 'dot-position dot-position new-props))))
- (else
- (let ((this-list (string-split test-string #\-)))
- (if (string->number (cadr this-list))
- (set! output-list (cons-fret (cons 'place-fret (numerify this-list)) output-list))
- (if (equal? (cadr this-list) "x" )
- (set! output-list (cons-fret (list 'mute (string->number (car this-list))) output-list))
- (set! output-list (cons-fret (list 'open (string->number (car this-list))) output-list)))))))
- (parse-item (cdr myitems)))))
- (if (eq? new-props '())
- `(,props . ,output-list)
- `(,(cons new-props props) . ,output-list))))
-
-(define (cons-fret new-value old-list)
-" Put together a fret-list in the format desired by parse-string "
- (if (eq? old-list '())
- (list new-value)
- (cons* new-value old-list)))
-
-(define (get-numeric-from-key keystring)
- "Get the numeric value from a key of the form k:val"
- (string->number (substring keystring 2 (string-length keystring) )))
-
-(define (numerify mylist)
- "Convert string values to numeric or character"
- (if (null? mylist)
- '()
- (let ((numeric-value (string->number (car mylist))))
- (if numeric-value
- (cons* numeric-value (numerify (cdr mylist)))
- (cons* (car (string->list (car mylist))) (numerify (cdr mylist)))))))
-
-(def-markup-command (fret-diagram-terse paper props definition-string)
- (string?)
-;TODO -- put table in doc string
- "Make a fret diagram markup using terse string-based syntax.
-
-Syntax: \\fret-diagram-terse definition-string
-
-eg: \\markup \\fret-diagram #\"x;x;o;2;3;2;\" for a D chord diagram.
-
-Syntax rules for @var{definition-string}:
-@itemize @bullet
-
-@item
-Strings are terminated by semicolons; the number of semicolons
-is the number of strings in the diagram.
-
-@item
-Mute strings are indicated by \"x\".
-
-@item
-Open strings are indicated by \"o\".
-
-@item
-A number indicates a fret indication at that fret.
-
-@item
-If there are multiple fret indicators desired on a string, they
-should be separated by spaces.
-
-@item
-Fingerings are given by following the fret number with a \"-\",
-followed by the finger indicator, e.g. 3-2 for playing the third
-fret with the second finger.
-
-@item
-Where a barre indicator is desired, follow the fret (or fingering) symbol
-with \"-(\" to start a barre and \"-)\" to end the barre.
-@end itemize"
-;TODO -- change syntax to fret\string-finger
- (let ((definition-list (fret-parse-terse-definition-string props definition-string)))
- (make-fret-diagram paper (car definition-list) (cdr definition-list))))
-
-(define (fret-parse-terse-definition-string props definition-string)
- "parse a fret diagram string that uses terse syntax; return a pair containing:
- props, modified to include the string-count determined by the definition-string
- a fret-indication list with the appropriate values"
-;TODO -- change syntax to fret\string-finger
-;TODO -- fix bug that doesn't allow multiple indications per string
- (let* ((barre-start-list '())
- (output-list '())
- (new-props '())
- (items (string-split definition-string #\;))
- (string-count (- (length items) 1)))
- (let parse-item ((myitems items))
- (if (not (null? (cdr myitems)))
- (let* ((test-string (car myitems))
- (current-string (- (length myitems) 1))
- (indicators (string-split test-string #\ )))
- (let parse-indicators ((myindicators indicators))
- (if (not (eq? '() myindicators))
- (let* ((this-list (string-split (car myindicators) #\-))
- (max-element-index (- (length this-list) 1))
- (last-element (car (list-tail this-list max-element-index)))
- (fret (if (string->number (car this-list)) (string->number (car this-list)) (car this-list))))
- (if (equal? last-element "(") ; here I add ) to balance parentheses for my editor
- (begin
- (set! barre-start-list (cons-fret (list current-string fret) barre-start-list))
- (set! this-list (list-head this-list max-element-index))))
- (if (equal? last-element ")") ; here I add ( to balance parentheses for my editor
- (let* ((this-barre (get-sub-list fret barre-start-list))
- (insert-index (- (length this-barre) 1)))
- (set! output-list (cons-fret (cons* 'barre (car this-barre) current-string (cdr this-barre))
- output-list))
- (set! this-list (list-head this-list max-element-index))))
- (if (number? fret)
- (set! output-list (cons-fret (cons* 'place-fret current-string (drop-paren (numerify this-list))) output-list))
- (if (equal? (car this-list) "x" )
- (set! output-list (cons-fret (list 'mute current-string) output-list))
- (set! output-list (cons-fret (list 'open current-string) output-list))))
- (parse-indicators (cdr myindicators)))))
- (parse-item (cdr myitems)))))
- (set! new-props (acons 'string-count string-count new-props))
-
- `(,(cons new-props props) . ,output-list)))
-
-(define (drop-paren item-list)
-" drop a final parentheses from a fret indication list resulting from a terse string specification of barre."
- (if (> (length item-list) 0)
- (let* ((max-index (- (length item-list) 1))
- (last-element (car (list-tail item-list max-index))))
- (if (or (equal? last-element ")") (equal? last-element "("))
- (list-head item-list max-index)
- item-list))
- item-list))
-
-(define (get-sub-list value master-list)
-" Get a sub-list whose cadr is equal to @var{value} from @var{master-list}"
- (if (eq? master-list '())
- #f
- (let ((sublist (car master-list)))
- (if (equal? (cadr sublist) value)
- sublist
- (get-sub-list value (cdr master-list))))))
;;; Library functions
-
(if (defined? 'set-debug-cell-accesses!)
(set-debug-cell-accesses! #f))
(srfi srfi-1) ; lists
(srfi srfi-13)) ; strings
+(define-public safe-module (make-safe-module))
+
(define-public (myd k v) (display k) (display ": ") (display v) (display ", "))
;;; General settings
;;; debugging evaluator is slower. This should
;;; have a more sensible default.
+
(if (ly:get-option 'verbose)
(begin
(debug-enable 'debug)
(debug-enable 'backtrace)
- (read-enable 'positions)))
+ (read-enable 'positions) ))
+
(define-public (line-column-location line col file)
"Print an input location, including column number ."
(string-append (number->string line) ":"
- (number->string col) " " file))
+ (number->string col) " " file)
+ )
(define-public (line-location line col file)
"Print an input location, without column number ."
- (string-append (number->string line) " " file))
+ (string-append (number->string line) " " file)
+ )
(define-public point-and-click #f)
-(define-public parser #f)
-
(define-public (lilypond-version)
(string-join
(map (lambda (x) (if (symbol? x)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; lily specific variables.
-
(define-public default-script-alist '())
+(define-public safe-mode? #f)
-;; parser stuff.
-(define-public (print-music-as-book parser music)
- (let* ((score (ly:music-scorify music))
- (head (ly:parser-lookup parser '$globalheader))
- (book (ly:score-bookify score head)))
- (ly:parser-print-book parser book)))
-
-(define-public (print-score-as-book parser score)
- (let*
- ((head (ly:parser-lookup parser '$globalheader))
- (book (ly:score-bookify score head)))
-
- (ly:parser-print-book parser book)))
-
-(define-public (print-score parser score)
- (let* ((head (ly:parser-lookup parser '$globalheader))
- (book (ly:score-bookify score head)))
- (ly:parser-print-score parser book)))
-
-(define-public default-toplevel-music-handler print-music-as-book)
-(define-public default-toplevel-book-handler ly:parser-print-book)
-(define-public default-toplevel-score-handler print-score-as-book)
-
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; Unassorted utility functions.
;;;;;;;;;;;;;;;;
; alist
+(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-public (assoc-get key alist . default)
"Return value if KEY in ALIST, else DEFAULT (or #f if not specified)."
(let ((entry (assoc key alist)))
(if (pair? entry)
(cdr entry)
- (if (pair? default) (car default) #f))))
+ (if (pair? default) (car default) #f)
+ )))
-(define-public (uniqued-alist alist acc)
+(define-public (uniqued-alist alist acc)
(if (null? alist) acc
(if (assoc (caar alist) acc)
(uniqued-alist (cdr alist) acc)
(not (= l r)))
(define-public (ly:load x)
- (let* ((fn (%search-load-path x)))
+ (let* (
+ (fn (%search-load-path x))
+
+ )
(if (ly:get-option 'verbose)
(format (current-error-port) "[~A]" fn))
(primitive-load fn)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; output
+(use-modules
+ ;(scm output-sketch)
+ ;(scm output-sodipodi)
+ ;(scm output-pdftex)
+
+ )
-
-;;(define-public (output-framework) (write "hello\n"))
(define output-tex-module
(make-module 1021 (list (resolve-interface '(scm output-tex)))))
(define output-ps-module
(make-module 1021 (list (resolve-interface '(scm output-ps)))))
-
+(define-public (tex-output-expression expr port)
+ (display (eval expr output-tex-module) port))
(define-public (ps-output-expression expr port)
(display (eval expr output-ps-module) port))
-;; TODO: generate this list by registering the stencil expressions
-;; stencil expressions should have docstrings.
-(define-public (ly:all-stencil-expressions)
- "Return list of stencil expressions."
- '(
- beam
- bezier-sandwich
- blank
- bracket
- char
- dashed-line
- dashed-slur
- dot
- draw-line
- ez-ball
- filledbox
- horizontal-line
- polygon
- repeat-slash
- round-filled-box
- symmetric-x-triangle
- text
- tuplet
- white-dot
- zigzag-line
+(define output-alist
+ `(
+ ("tex" . ("TeX output. The default output form." ,tex-output-expression))
+ ("scm" . ("Scheme dump: debug scheme stencil expressions" ,write))
+; ("sketch" . ("Bare bones Sketch output." ,sketch-output-expression))
+; ("sodipodi" . ("Bare bones Sodipodi output." ,sodipodi-output-expression))
+; ("pdftex" . ("PDFTeX output. Was last seen nonfunctioning." ,pdftex-output-expression))
))
-;; TODO: generate this list by registering the output-backend-commands
-;; output-backend-commands should have docstrings.
-(define-public (ly:all-output-backend-commands)
- "Return list of output backend commands."
- '(
- comment
- define-origin
- no-origin
- placebox
- unknown
- ))
+
+(define (document-format-dumpers)
+ (map
+ (lambda (x)
+ (display (string-append (pad-string-to 5 (car x)) (cadr x) "\n"))
+ output-alist)
+ ))
+
+(define-public (find-dumper format)
+ (let ((d (assoc format output-alist)))
+ (if (pair? d)
+ (caddr d)
+ (scm-error "Could not find dumper for format ~s" format))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; other files.
"define-music-properties.scm"
"auto-beam.scm"
"chord-name.scm"
-
- "ly-from-scheme.scm"
"define-context-properties.scm"
"translation-functions.scm"
"script.scm"
"midi.scm"
+
"beam.scm"
"clef.scm"
"slur.scm"
"font.scm"
- "encoding.scm"
- "fret-diagrams.scm"
"define-markup-commands.scm"
"define-grob-properties.scm"
"define-grobs.scm"
"define-grob-interfaces.scm"
+
"page-layout.scm"
- "titling.scm"
-
"paper.scm"
-
- ; last:
- "safe-lily.scm"
))
" ")
"\n")))
protects))
- outfile)))
+ outfile)
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(define-public (lilypond-main files)
- "Entry point for LilyPond."
- (let* ((failed '())
- (handler (lambda (key arg) (set! failed (cons arg failed)))))
- (for-each
- (lambda (f) (catch 'ly-file-failed (lambda () (ly:parse-file f)) handler))
- files)
-
- (if (pair? failed)
- (begin
- (display
- (string-append "\n *** Failed files: " (string-join failed) "\n"))
- (exit 1))
- (exit 0))))
+ ))
+++ /dev/null
-;;;; ly-from-scheme.scm -- parsing LilyPond music expressions from scheme
-;;;;
-;;;; source file of the GNU LilyPond music typesetter
-;;;;
-;;;; (c) 2004 Nicolas Sceaux <nicolas.sceaux@free.fr>
-;;;; Jan Nieuwenhuizen <janneke@gnu.org>
-
-(define gen-lily-sym
- ;; Generate a lilyvartmpXX symbol, that may be (hopefully) unique.
- (let ((var-idx -1))
- (lambda ()
- (set! var-idx (1+ var-idx))
- (string->symbol (format #f "lilyvartmp~a"
- (list->string (map (lambda (chr)
- (integer->char (+ (char->integer #\a) (- (char->integer chr)
- (char->integer #\0)))))
- (string->list (number->string var-idx)))))))))
-
-(define-public (ly:parse-string-result str parser module)
- "Parse `str', which is supposed to contain a music expression."
- (let ((music-sym (gen-lily-sym)))
- (ly:parser-parse-string
- parser
- (format #f "
-~a = { ~a }
-#(ly:export '~a)
-#(module-define! (resolve-module '~a) '~a ~a)
-"
- music-sym str music-sym (module-name module) music-sym music-sym))
- (eval `,music-sym module)))
-
-(define-public (read-lily-expression chr port)
- "Read a #{ lily music expression #} from port and return
-the scheme music expression. The $ character may be used to introduce
-scheme forms, typically symbols. $$ may be used to simply write a `$'
-character."
- (let ((bindings '()))
- (define (create-binding! val)
- "Create a new symbol, bind it to `val' and return it."
- (let ((tmp-symbol (gen-lily-sym)))
- (set! bindings (cons (cons tmp-symbol val) bindings))
- tmp-symbol))
- (define (remove-dollars! form)
- "Generate a form where `$variable' and `$ value' mottos are replaced
- by new symbols, which are binded to the adequate values."
- (cond (;; $variable
- (and (symbol? form)
- (string=? (substring (symbol->string form) 0 1) "$")
- (not (string=? (substring (symbol->string form) 1 2) "$")))
- (create-binding! (string->symbol (substring (symbol->string form) 1))))
- (;; atom
- (not (pair? form)) form)
- (;; ($ value ...)
- (eqv? (car form) '$)
- (cons (create-binding! (cadr form)) (remove-dollars! (cddr form))))
- (else ;; (something ...)
- (cons (remove-dollars! (car form)) (remove-dollars! (cdr form))))))
- (let ((lily-string (call-with-output-string
- (lambda (out)
- (do ((c (read-char port) (read-char port)))
- ((and (char=? c #\#)
- (char=? (peek-char port) #\})) ;; we stop when #} is encoutered
- (read-char port))
- (cond
- ;; a $form expression
- ((and (char=? c #\$) (not (char=? (peek-char port) #\$)))
- (format out "\\~a" (create-binding! (read port))))
- ;; just a $ character
- ((and (char=? c #\$) (char=? (peek-char port) #\$))
- (display (read-char port) out)) ;; pop the second $
- ;; a #scheme expression
- ((char=? c #\#)
- (format out "#~a" (remove-dollars! (read port))))
- ;; other caracters
- (else
- (display c out))))))))
- `(let ((parser-clone (ly:clone-parser parser)))
- ,@(map (lambda (binding)
- `(ly:parser-define parser-clone ',(car binding) ,(cdr binding)))
- (reverse bindings))
- (ly:parse-string-result ,lily-string parser-clone (current-module))))))
-
-(read-hash-extend #\{ read-lily-expression)
-;;;; music-functions.scm --
+;;;; music-functions.scm -- implement Scheme output routines for PostScript
;;;;
;;;; source file of the GNU LilyPond music typesetter
;;;;
;;;; (c) 1998--2004 Jan Nieuwenhuizen <janneke@gnu.org>
-;;;; Han-Wen Nienhuys <hanwen@cs.uu.nl>
+;;;; Han-Wen Nienhuys <hanwen@cs.uu.nl>
-;; (use-modules (ice-9 optargs))
+(use-modules (ice-9 optargs))
;;; ly:music-property with setter
;;; (ly:music-property my-music 'elements)
(define-public (unfold-repeats music)
"
-This function replaces all repeats with unfold repeats. "
+This function replaces all repeats with unfold repeats. It was
+written by Rune Zedeler. "
(let ((es (ly:music-property music 'elements))
(e (ly:music-property music 'element))
(n (ly:music-name music)))
(if (equal? n "Repeated_music")
- (begin
+ (let*
+ ((seq-arg? (memq 'sequential-music
+ (ly:music-property e 'types))))
(if (equal? (ly:music-property music 'iterator-ctor)
Chord_tremolo_iterator::constructor)
- (let*
- ((seq-arg? (memq 'sequential-music
- (ly:music-property e 'types)))
- (count (ly:music-property music 'repeat-count))
- (dot-shift (if (= 0 (remainder count 3))
- -1 0))
- )
-
- (if (= 0 -1)
- (set! count (* 2 (quotient count 3))))
-
+ (begin
(shift-duration-log music (+ (if seq-arg? 1 0)
- (ly:intlog2 count)) dot-shift)
-
+ (ly:intlog2 (ly:music-property music 'repeat-count))) 0)
(if seq-arg?
(ly:music-compress e (ly:make-moment (length (ly:music-property e 'elements)) 1)))
))
(define-public (set-time-signature num den . rest)
(ly:export (apply make-time-signature-set `(,num ,den . ,rest))))
-(define-public (make-penalty-music pen page-pen)
+(define-public (make-penalty-music pen)
(make-music 'BreakEvent
- 'penalty pen
- 'page-penalty page-pen))
+ 'penalty pen))
(define-public (make-articulation name)
(make-music 'ArticulationEvent
(if (vector? props)
(vector-reverse-map execute-1 props))))
-
-
-(defmacro-public def-grace-function (start stop)
- `(def-music-function (location music) (ly:music?)
- (make-music 'GraceMusic
- 'origin location
- 'element (make-music 'SequentialMusic
- 'elements (list (ly:music-deep-copy ,start)
- music
- (ly:music-deep-copy ,stop))))))
-
-(defmacro-public def-music-function (args signature . body)
- "Helper macro for `ly:make-music-function'.
-Syntax:
- (def-music-function (location arg1 arg2 ...) (arg1-type? arg2-type? ...)
- ...function body...)
-"
- `(ly:make-music-function (list ,@signature)
- (lambda (,@args)
- ,@body)))
-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; switch it on here, so parsing and init isn't checked (too slow!)
;;
(else
(ly:warn (string-append "Unknown accidental style: " (symbol->string style)))
(make-sequential-music '()))))))
+
+
;; expr === ((#:COMMAND arg1 ...) ...)
(receive (m r) (compile-markup-expression (car expr))
(values m (cdr expr))))
- ((and (pair? expr)
- (string? (car expr))) ;; expr === ("string" ...)
- (values `(make-simple-markup ,(car expr)) (cdr expr)))
(else
- ;; expr === (symbol ...) or ((funcall ...) ...)
+ ;; expr === (symbol ...) or ("string" ...) or ((funcall ...) ...)
(values (car expr)
(cdr expr)))))
(define-public (stack-stencil-line space stencils)
- "DOCME"
(if (and (pair? stencils)
(ly:stencil? (car stencils)))
+++ /dev/null
-;;;; output-gnome.scm -- implement GNOME canvas output
-;;;;
-;;;; source file of the GNU LilyPond music typesetter
-;;;;
-;;;; (c) 2004 Jan Nieuwenhuizen <janneke@gnu.org>
-
-;;; TODO:
-;;;
-;;; * Figure out and fix font scaling and character placement
-;;; * EC font package: add missing X font directories and AFMs
-;;; * User-interface, keybindings
-;;; * Implement missing stencil functions
-;;; * Implement missing commands
-;;; * More information in stencils, e.g., location and grob tag.
-;;; * Embedded Lily:
-;;; - allow GnomeCanvas or `toplevel' GtkWindow to be created
-;;; outside of LilyPond
-;;; - lilylib.
-;;; * Release schedule and packaging of dependencies. This hack
-;;; depends on several CVS and TLA development sources.
-
-;;; You need:
-;;;
-;;; * guile-1.6.4 (NOT CVS -- we are working on this)
-;;; * Rotty's g-wrap--tng TLA, possibly Janneke's if you have libffi-3.4.
-;;; * guile-gnome TLA
-;;; * pango CVS (ie, > 2004-06-12)
-;;;
-;;; See also: guile-gtk-general@gnu.org
-
-;;; Try it
-;;;
-;;; * If you are using GUILE CVS, recompile LilyPond with GUILE 1.6.
-
-;;; [If for some unknown or funny reason you do not want to
-;;; overwrite your lilypond-bin with GUILE CVS, you can
-;;; reconfigure a new configuration, say g16:
-"
-PATH=/usr/bin/:$PATH ./configure --enable-config=g16 && make conf=g16
-"
-;;; ]
-;;;
-;;; * Install gnome/gtk development stuff
-;;;
-;;; * Install g-wrap and guile-gnome, see buildscripts/guile-gnome.sh
-;;;
-;;; * Setup environment
-"
-export GUILE_LOAD_PATH=$HOME/usr/pkg/g-wrap/share/guile/site:$HOME/usr/pkg/g-wrap/share/guile/site/g-wrap:$HOME/usr/pkg/guile-gnome/share/guile
-export LD_LIBRARY_PATH=$HOME/usr/pkg/g-wrap/lib:$HOME/usr/pkg/guile-gnome/lib
-export XEDITOR='/usr/bin/emacsclient --no-wait +%l:%c %f'
-"
-;;; * Also for GNOME point-and-click, you need to set XEDITOR and add
-"
-#(ly:set-point-and-click 'line-column)
-"
-;;; to your .ly; then click an object on the canvas.
-;;;
-;;; * Run lily:
-"
-lilypond-bin -fgnome input/simple-song.ly
-"
-
-
-(debug-enable 'backtrace)
-
-(define-module (scm output-gnome))
-(define this-module (current-module))
-
-(use-modules
- (guile)
- (srfi srfi-13)
- (lily)
- (gnome gtk))
-
-
-;; The name of the module will change to `canvas' rsn
-(if (resolve-module '(gnome gw canvas))
- (use-modules (gnome gw canvas))
- (use-modules (gnome gw libgnomecanvas)))
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; globals
-
-;; junkme
-(define system-origin '(0 . 0))
-
-;;; set by framework-gnome.scm
-(define canvas-root #f)
-(define output-scale #f)
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; helper functions
-
-(define (stderr string . rest)
- ;; debugging
- (if #f
- (begin
- (apply format (cons (current-error-port) (cons string rest)))
- (force-output (current-error-port)))))
-
-(define (utf8 i)
- (cond
- ((< i #x80) (make-string 1 (integer->char i)))
- ((< i #x800) (list->string
- (map integer->char
- (list (+ #xc0 (quotient i #x40))
- (+ #x80 (modulo i #x40))))))
- ((< i #x10000)
- (let ((x (quotient i #x1000))
- (y (modulo i #x1000)))
- (list->string
- (map integer->char
- (list (+ #xe0 x)
- (+ #x80 (quotient y #x40))
- (+ #x80 (modulo y #x40)))))))
- (else FIXME)))
-
-(define (custom-utf8 i)
- (if (< i 80)
- (utf8 i)
- (utf8 (+ #xee00 i))))
-
-(define (draw-rectangle x1 y1 x2 y2 color width-units)
- (make <gnome-canvas-rect>
- #:parent (canvas-root) #:x1 x1 #:y1 y1 #:x2 x2 #:y2 y2
- #:fill-color color #:width-units width-units))
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; stencil outputters
-;;;
-
-;;; catch-all for missing stuff
-;;; comment this out to see find out what functions you miss :-)
-(define (dummy . foo) #f)
-(map (lambda (x) (module-define! this-module x dummy))
- (append
- (ly:all-stencil-expressions)
- (ly:all-output-backend-commands)))
-
-
-
-(define (char font i)
- (text font (utf8 i)))
-
-(define (placebox x y expr)
- (stderr "item: ~S\n" expr)
- (let ((item expr))
- ;;(if item
- ;; FIXME ugly hack to skip #unspecified ...
- (if (and item (not (eq? item (if #f #f))))
- (begin
- (move item
- (* output-scale (+ (car system-origin) x))
- (* output-scale (- (car system-origin) y)))
- (affine-relative item output-scale 0 0 output-scale 0 0)
- item)
- #f)))
-
-(define (round-filled-box breapth width depth height blot-diameter)
- ;; FIXME: no rounded corners on rectangle...
- ;; FIXME: blot?
- (draw-rectangle (- breapth) depth width (- height) "black" blot-diameter))
-
-(define (pango-font-name font)
- (cond
- ((equal? (ly:font-name font) "GNU-LilyPond-feta-20")
- "lilypond-feta, regular 32")
- (else
- ;; FIXME
- "ecrm12")))
- ;;(ly:font-name font))))
- ;;(ly:font-filename font))))
-
-(define (pango-font-size font)
- (let* ((designsize (ly:font-design-size font))
- (magnification (* (ly:font-magnification font)))
-
- ;; experimental sizing:
- ;; where does factor come from?
- ;;
- ;; 0.435 * (12 / 20) = 0.261
- ;; 2.8346456692913/ 0.261 = 10.86071137659501915708
- ;;(ops (* 0.435 (/ 12 20) (* output-scale pixels-per-unit)))
- ;; for size-points
- (ops 2.61)
-
- (scaling (* ops magnification designsize)))
- (stderr "OPS:~S\n" ops)
- (stderr "scaling:~S\n" scaling)
- (stderr "magnification:~S\n" magnification)
- (stderr "design:~S\n" designsize)
-
- scaling))
-
-;;font-name: "GNU-LilyPond-feta-20"
-;;font-filename: "feta20"
-;;pango-font-name: "lilypond-feta, regular 32"
-;;OPS:2.61
-;;scaling:29.7046771653543
-;;magnification:0.569055118110236
-;;design:20.0
-
-(define (text font string)
- (stderr "font-name: ~S\n" (ly:font-name font))
- ;; TODO s/filename/file-name/
- (stderr "font-filename: ~S\n" (ly:font-filename font))
-
- (stderr "pango-font-name: ~S\n" (pango-font-name font))
- (stderr "pango-font-size: ~S\n" (pango-font-size font))
-
- (make <gnome-canvas-text>
- #:parent (canvas-root)
-
- ;; experimental text placement corrections.
- ;; UGHR? What happened to tex offsets? south-west?
- ;; is pango doing something 'smart' wrt baseline ?
- #:anchor 'south-west
- #:x 0.003 #:y 0.123
-
- ;;#:anchor 'west
- ;;#:x 0.015 #:y -3.71
-
- #:font (pango-font-name font)
-
- #:size-points (pango-font-size font)
- ;;#:size ...
- #:size-set #t
-
- ;;apparently no effect :-(
- ;;#:scale 1.0
- ;;#:scale-set #t
-
- #:fill-color "black"
- #:text string))
-
-(define (filledbox a b c d)
- (round-filled-box a b c d 0.001))
-
-;; WTF is this in every backend?
-(define (horizontal-line x1 x2 thickness)
- (filledbox (- x1) (- x2 x1) (* .5 thickness) (* .5 thickness)))
-
-(define (define-origin file line col)
- (if (procedure? point-and-click)
- (list 'location line col file)))
(list-ref tuning
(- string 1) ; remove 1 because list index starts at 0 and guitar string at 1.
)
- )))
+ ) ) )
(define-public (hammer-print-function grob)
(let* ((note-collums (ly:grob-property grob 'note-columns))
(paper (ly:grob-paper grob))
(text (interpret-markup
paper
- (ly:grob-alist-chain grob (ly:output-def-lookup paper 'text-font-defaults))
+ (ly:grob-alist-chain grob (ly:paper-lookup paper 'text-font-defaults))
letter)))
(let ((x (/ (- (cdr (ly:stencil-extent slur 0))
(define-public (make-stencil-boxer line-thick x-padding y-padding callback)
- "Makes a routine that adds a box around the grob parsed as argument"
+ "Makes a routine that adds a box around the grob parsed as argument"
(define (stencil-boxer grob)
- (let*
- (
- (mol (callback grob))
- (x-ext (interval-widen (ly:stencil-extent mol 0) x-padding))
- (y-ext (interval-widen (ly:stencil-extent mol 1) y-padding))
- (x-rule (make-filled-box-stencil (interval-widen x-ext line-thick)
- (cons 0 line-thick)))
- (y-rule (make-filled-box-stencil (cons 0 line-thick) y-ext))
- )
-
- (set! mol (ly:stencil-combine-at-edge mol 0 1 y-rule x-padding))
- (set! mol (ly:stencil-combine-at-edge mol 0 -1 y-rule x-padding))
- (set! mol (ly:stencil-combine-at-edge mol 1 1 x-rule 0))
- (set! mol (ly:stencil-combine-at-edge mol 1 -1 x-rule 0))
-
- mol))
- stencil-boxer)
+ (let*
+ (
+ (mol (callback grob))
+ (x-ext (interval-widen (ly:stencil-extent mol 0) x-padding))
+ (y-ext (interval-widen (ly:stencil-extent mol 1) y-padding))
+ (x-rule (make-filled-box-stencil (interval-widen x-ext line-thick)
+ (cons 0 line-thick)))
+ (y-rule (make-filled-box-stencil (cons 0 line-thick) y-ext))
+ )
+
+ (set! mol (ly:stencil-combine-at-edge mol 0 1 y-rule x-padding))
+ (set! mol (ly:stencil-combine-at-edge mol 0 -1 y-rule x-padding))
+ (set! mol (ly:stencil-combine-at-edge mol 1 1 x-rule 0))
+ (set! mol (ly:stencil-combine-at-edge mol 1 -1 x-rule 0))
+
+ mol
+ ))
+ stencil-boxer
+ )
(define-public (arg->string arg)
(cond ((number? arg) (ly:inexact->string arg 10))
;; (* (/ 72.27 25.40) x))
;; do nothing in .scm output
+(define-public (comment s) "")
(define-public (ly:numbers->string lst)
(string-join (map ly:number->string lst) " "))
(lineto 0 (/ thick 2))
(closefill))))
+(define (comment s)
+ (string-append "% " s "\n"))
+
(define (brack-traject pair ds alpha)
(let ((alpha-rad (* alpha (/ 3.141592654 180))))
(cons (+ (car pair) (* (cos alpha-rad) ds))
(rlineto (- xwid) 0)
(closefill))))
+(define (end-output) "")
(define (experimental-on) "")
(string-append "\\embeddedpdf{" (get-output-string os) "}")))
+(define (comment s)
+ (simple-format #f "% ~a\n" s))
+
+(define (end-output)
+ (begin
+ ; uncomment for some stats about lily memory
+ ; (display (gc-stats))
+ (string-append "%\n\\lilypondend\n"
+ ; Put GC stats here.
+ )))
(define (experimental-on)
"")
(define (repeat-slash w a t)
(embedded-pdf (list 'repeat-slash w a t)))
+(define (fontify name-mag-pair exp)
+ (string-append (select-font name-mag-pair)
+ exp))
(define (tex-encoded-fontswitch name-mag)
;; FIXME: explain ploblem: need to do something to make this really safe.
(define (output-tex-string s)
- (if (ly:get-option 'safe)
- (regexp-substitute/global #f "\\\\"
- (regexp-substitute/global #f "\\([{}]\\)" s 'pre "\\1" 'post)
- 'pre "$\\backslash$" 'post)
-
+ (if safe-mode?
+ (regexp-substitute/global #f "\\\\" s 'pre "$\\backslash$" 'post)
s))
(define (lily-def key val)
-;;;; output-ps.scm -- implement Scheme output interface for PostScript
+;;;; output-ps.scm -- implement Scheme output routines for PostScript
;;;;
;;;; source file of the GNU LilyPond music typesetter
;;;;
;;;; input/test/title-markup.ly
;;;;
;;;; TODO:
-;;;; * %% Papersize in (header ...)
+;;;; * papersize in header
+;;;; * special characters, encoding.
+;;;; + implement encoding switch (switches? input/output??),
+;;;; + move encoding definitions to ENCODING.ps files, or
+;;;; + find out which program's PS(?) encoding code we can use?
;;;; * text setting, kerning.
;;;; * document output-interface
(define-module (scm output-ps)
#:re-export (quote)
- #:export (unknown
+ #:export (define-fonts
+ unknown
+ output-paper-def
+ output-scopes
+ select-font
blank
dot
- white-dot
beam
bracket
dashed-slur
symmetric-x-triangle
ez-ball
comment
+ end-output
+ experimental-on
repeat-slash
+ header-end
+ header
placebox
bezier-sandwich
+ start-system
+ stop-system
+ stop-last-system
horizontal-line
filledbox
round-filled-box
tuplet
polygon
draw-line
+ between-system-string
define-origin
no-origin
- ))
-
-
+ start-page
+ stop-page
+ )
+)
(use-modules (guile)
(ice-9 regex)
- (srfi srfi-1)
(srfi srfi-13)
- (scm framework-ps)
(lily))
+;;; Global vars
+;; alist containing fontname -> fontcommand assoc (both strings)
+(define page-count 0)
+(define page-number 0)
+(define font-name-alist '())
-;;(map export
-;; (append (ly:all-stencil-expressions) (ly:all-output-backend-commands)))
-
-;; huh?
-;;(write (ly:all-output-backend-commands))
-;;(write (ly:all-stencil-expressions))
+;; /lilypondpaperoutputscale 1.75729901757299 def
+;;/lily-output-units 2.83464 def %% milimeter
+;;/output-scale lilypondpaperoutputscale lily-output-units mul def
+;;
+;; output-scale = 1.75729901757299 * 2.83464 = 4.9813100871731003736
+(define OUTPUT-SCALE 4.98)
+(define TOP-MARGIN 0)
;;; helper functions, not part of output interface
(define (escape-parentheses s)
(cons (+ (car a) (car b))
(+ (cdr a) (cdr b))))
+;; WIP
+(define font-encoding-alist
+ '(("ecrm12" . "ISOLatin1Encoding")
+ ("ecmb12" . "ISOLatin1Encoding")))
+
(define (ps-encoding text)
(escape-parentheses text))
;; FIXME: lily-def
-(define-public (ps-string-def prefix key val)
+(define (ps-string-def prefix key val)
(string-append "/" prefix (symbol->string key) " ("
(escape-parentheses val)
") def\n"))
(ly:number->string (exact->inexact val)))))
(string-append "/" prefix (symbol->string key) " " s " def\n")))
+(define (tex-font? fontname)
+ (equal? (substring fontname 0 2) "cm"))
+
;;;
;;; Lily output interface, PostScript implementation --- cleanup and docme
(list arch_angle arch_width arch_height height arch_thick thick))
" draw_bracket"))
-(define (char font i)
+(define (char i)
(string-append
- (ps-font-command font) " setfont "
"(\\" (ly:inexact->string i 8) ") show" ))
+(define (comment s)
+ (string-append "% " s "\n"))
+
(define (dashed-line thick on off dx dy)
(string-append
(ly:number->string dx) " "
(ly:number->string (* 10 thick))
" ] 0 draw_dashed_slur"))
-; todo: merge with tex-font-command?
+(define (define-fonts internal-external-name-mag-pairs)
+ (define (fontname->designsize fontname)
+ (let ((i (string-index fontname char-numeric?)))
+ (string->number (substring fontname i))))
+
+ (define (define-font command fontname scaling)
+ (string-append
+ "/" command " { /" fontname " findfont "
+ (ly:number->string scaling) " output-scale div scalefont } bind def\n"))
+ (define (reencode-font raw encoding command)
+ (string-append
+ raw " " encoding " /" command " reencode-font\n"
+ "/" command "{ /" command " findfont 1 scalefont } bind def\n"))
+
+ ;; frobnicate NAME to jibe with external definitions.
+ (define (possibly-mangle-fontname fontname)
+ (cond
+ ((tex-font? fontname)
+ ;; FIXME: we need proper Fontmap for CM fonts, like so:
+ ;; /CMR10 (cmr10.pfb);
+ ;; (string-upcase fontname)
+ (string-append fontname ".pfb"))
+ ((or (equal? (substring fontname 0 4) "feta")
+ (equal? (substring fontname 0 4) "parm"))
+ (regexp-substitute/global
+ #f "(feta|parmesan)([a-z-]*)([0-9]+)"
+ fontname 'pre "GNU-LilyPond-" 1 2 "-" 3 'post))
+ (else fontname)))
+
+ ;; (define (font-load-command name-mag command)
+ (define (font-load-command lst)
+ (let* ((key-name-size (car lst))
+ (value (cdr lst))
+ (value-name-size (car value))
+ (command (cdr value))
+ (fontname (car value-name-size))
+ (mangled (possibly-mangle-fontname fontname))
+ (encoding (assoc-get fontname font-encoding-alist))
+ (designsize (fontname->designsize fontname))
+ (fontsize (cdr value-name-size))
+ (scaling (* fontsize designsize)))
+
+ (if
+ #f
+ (begin
+ (newline)
+ (format (current-error-port) "key-name-size ~S\n" key-name-size)
+ (format (current-error-port) "value ~S\n" value)
+ (format (current-error-port) "value-name-size ~S\n" value-name-size)
+ (format (current-error-port) "command ~S\n" command)
+ (format (current-error-port) "designsize ~S\n" designsize)
+ (format (current-error-port) "fontname ~S\n" fontname)
+ (format (current-error-port) "mangled ~S\n" mangled)
+ (format (current-error-port) "fontsize ~S\n" fontsize)
+ (format (current-error-port) "scaling ~S\n" scaling)))
+
+ (if encoding
+ ;; FIXME: should rather tag encoded font
+ (let ((raw (string-append command "-raw")))
+ (string-append
+ (define-font raw mangled scaling)
+ (reencode-font raw encoding command)))
+ (define-font command mangled scaling))))
+
+ (define (ps-encoded-fontswitch name-mag-pair)
+ (let* ((key (car name-mag-pair))
+ (value (cdr name-mag-pair))
+ (fontname (car value))
+ (scaling (cdr value)))
+ (cons key (cons value
+ (string-append
+ "lilyfont" fontname "-" (ly:number->string scaling))))))
+
+ (set! font-name-alist
+ (map ps-encoded-fontswitch internal-external-name-mag-pairs))
+ (apply string-append (map font-load-command font-name-alist)))
(define (define-origin file line col) "")
(ly:numbers->string
(list x y radius)) " draw_dot"))
-(define (white-dot x y radius)
- (string-append
- " "
- (ly:numbers->string
- (list x y radius)) " draw_white_dot"))
-
(define (draw-line thick x1 y1 x2 y2)
(string-append
"1 setlinecap 1 setlinejoin "
(ly:number->string x2) " "
(ly:number->string y2) " lineto stroke"))
+(define (end-output)
+ "\nend-lilypond-output\n")
+
(define (ez-ball ch letter-col ball-col)
(string-append
" (" ch ") "
" /Helvetica-Bold " ;; ugh
" draw_ez_ball"))
-(define (filledbox breapth width depth height) ; FIXME : use draw_round_box
+(define (filledbox breapth width depth height)
(string-append (ly:numbers->string (list breapth width depth height))
" draw_box"))
-;; WTF is this in every backend?
+(define (fontify name-mag-pair exp)
+
+ (define (select-font name-mag-pair)
+ (let ((c (assoc name-mag-pair font-name-alist)))
+
+ (if c
+ (string-append (cddr c) " setfont ")
+ (begin
+ (ly:warn
+ (format "Programming error: No such font: ~S" name-mag-pair))
+ ""))))
+
+ (string-append (select-font name-mag-pair) exp))
+
+(define (header creator time-stamp page-count-)
+ (set! page-count page-count-)
+ (set! page-number 0)
+ (string-append
+ "%!PS-Adobe-3.0\n"
+ "%%Creator: " creator " " time-stamp "\n"
+ "%%Pages: " (number->string page-count) "\n"
+ "%%PageOrder: Ascend\n"
+ ;; FIXME: TODO get from paper
+ ;; "%%DocumentPaperSizes: a6\n"
+ ;;(string-append "GNU LilyPond (" (lilypond-version) "), ")
+ ;; (strftime "%c" (localtime (current-time))))
+ ;; FIXME: duplicated in every backend
+ (ps-string-def
+ "lilypond" 'tagline
+ (string-append "Engraved by LilyPond (version " (lilypond-version) ")"))))
+
+(define (header-end)
+ (string-append
+ (ly:gulp-file "lilyponddefs.ps")
+ (ly:gulp-file "music-drawing-routines.ps")))
+
(define (horizontal-line x1 x2 th)
- (draw-line th x1 0 x2 0))
+ (draw-line th x1 0 x2 0))
(define (lily-def key val)
(let ((prefix "lilypondpaper"))
(define (no-origin) "")
-
+;; FIXME: duplictates output-scopes, duplicated in other backends
+;; FIXME: silly interface name
+(define (output-paper-def pd)
+ (let ((prefix "lilypondpaper"))
+
+ (define (scope-entry->string key var)
+ (let ((val (variable-ref var)))
+ (cond
+ ((string? val) (ps-string-def prefix key val))
+ ((number? val) (ps-number-def prefix key val))
+ (else ""))))
+
+ (apply
+ string-append
+ (module-map scope-entry->string (ly:output-def-scope pd)))))
+
+;; FIXME: duplicated in other output backends
+;; FIXME: silly interface name
+(define (output-scopes paper scopes fields basename)
+ (let ((prefix "lilypond"))
+
+ ;; FIXME: duplicates output-paper's scope-entry->string, mostly
+ (define (scope-entry->string key var)
+ (if (variable-bound? var)
+ (let ((val (variable-ref var)))
+ (if (and (memq key fields) (string? val))
+ (header-to-file basename key val))
+ (cond
+ ((string? val) (ps-string-def prefix key val))
+ ((number? val) (ps-number-def prefix key val))
+ (else "")))
+ ""))
+
+ (define (output-scope scope)
+ (apply string-append (module-map scope-entry->string scope)))
+
+ (string-append (apply string-append (map output-scope scopes)))))
+
+;; hmm, looks like recursing call is always last statement, does guile
+;; think so too?
+(define (output-stencil port expr offset)
+ (if (pair? expr)
+ (let ((head (car expr)))
+ (cond
+ ((ly:input-location? head)
+ (display (apply define-origin (ly:input-location head)) port)
+ (output-stencil port (cadr expr) offset))
+ ((eq? head 'no-origin)
+ (display (expression->string head) port)
+ (output-stencil port (cadr expr) offset))
+ ((eq? head 'translate-stencil)
+ (output-stencil port (caddr expr) (offset-add offset (cadr expr))))
+ ((eq? head 'combine-stencil)
+ (output-stencil port (cadr expr) offset)
+ (output-stencil port (caddr expr) offset))
+ (else
+ (display (placebox (car offset) (cdr offset)
+ (expression->string expr)) port))))))
(define (placebox x y s)
(string-append
(ly:numbers->string
(list x y width height blotdiam)) " draw_round_box"))
+(define (new-start-system origin dim)
+ (string-append
+ "\n" (ly:number-pair->string origin) " start-system\n"
+ "{\n"
+ "set-ps-scale-to-lily-scale\n"))
-(define (stem breapth width depth height) ; FIXME: use draw_round_box.
+(define (stem breapth width depth height)
(string-append
(ly:numbers->string (list breapth width depth height))
" draw_box" ))
+(define (stop-system)
+ "} stop-system\n")
+
+(define stop-last-system stop-system)
+
(define (symmetric-x-triangle thick w h)
(string-append
(ly:numbers->string (list h w thick))
" draw_symmetric_x_triangle"))
-(define (text font s)
- (let*
-
- (
- ;; ugh, we should find a better way to
- ;; extract the hsbw for /space from the font.
-
- (space-length (cdar (ly:text-dimension font "t")))
- (commands '())
- (add-command (lambda (x) (set! commands (cons x commands)))) )
-
- (string-fold
- (lambda (chr word)
- "Translate space as into moveto, group the rest in words."
- (if (and (< 0 (string-length word))
- (equal? #\space chr))
- (add-command
- (string-append "(" (ps-encoding word) ") show\n")))
-
- (if (equal? #\space chr)
- (add-command (string-append (number->string space-length) " 0.0 rmoveto ")) )
-
- (if (equal? #\space chr)
- ""
- (string-append word (make-string 1 chr))))
- ""
- (string-append s " "))
+(define (text s)
+;; (string-append "(" (escape-parentheses s) ") show "))
+ (string-append "(" (ps-encoding s) ") show"))
- (string-append
- (ps-font-command font) " setfont "
- (string-join (reverse commands)))
- ))
-
(define (unknown)
"\n unknown\n")
(ly:number->string dx) " "
(ly:number->string dy)
" draw_zigzag_line"))
+
+(define (start-page)
+ (set! page-number (+ page-number 1))
+ (string-append
+ "%%Page: " (number->string page-number) " " (number->string page-count) "\n"
+ "start-page\n"))
+
+(define (stop-page last?)
+ (if last?
+ "\nstop-last-page\n"
+ "\nstop-page\n"))
; ((eq? keyword 'dashed-line thick on off dx dy)
; ((eq? keyword 'dashed-slur thick dash l)
; ((eq? keyword 'define-origin a b c ) "")
+; ((eq? keyword 'end-output)
; ((eq? keyword 'experimental-on) "")
; ((eq? keyword 'ez-ball ch letter-col ball-col)
; ((eq? keyword 'filledbox x y breapth width depth height)
(define font-count 0)
(define current-font "")
+(define (fontify x y name-mag-pair exp)
+ (string-append (select-font name-mag-pair)
+ (apply (eval (car exp) this-module)
+ (append (list x y) (cdr exp)))))
+;; (if (string? exp) exp "")))
+
(define (define-fonts x) "")
(define (font-def x)
;;; and should intercept:
;;;
+;;; fontify
;;; lily-def
;;; header-end
;;; define-fonts
;;; no-origin
;;; start-system
+;;; end-output
;;; header
;;; comment
;;; stop-last-system
(cond
((eq? keyword 'some-func) "")
;;((eq? keyword 'placebox) (dispatch (cadddr expr)))
+ ;;((eq? keyword 'fontify) (dispatch (caddr expr)))
(else
(if (module-defined? this-module keyword)
(apply (eval keyword this-module) (cdr expr))
;; Global vars
-;;; Global vars
-(define page-count 0)
-(define page-number 0)
-
-;;(define output-scale 2.83464566929134)
-(define output-scale (* 2 2.83464566929134))
+(define output-scale 1)
(define system-y 0)
;; huh?
(define urg-line-thickness 0)
((equal? (ly:unit) "pt") (/ 72.0 72.27))
(else (error "unknown unit" (ly:unit)))))
+;; alist containing fontname -> fontcommand assoc (both strings)
+;;(define font-name-alist '())
+
;; Helper functions
+
+
(define (tagify tag string . attribute-alist)
(string-append
"<" tag
`(d . ,(string-append (svg-bezier first #f)
(svg-bezier second first-c0))))))
-(define (char font i)
- (tagify "tspan"
- (dispatch `(fontify ,font ,(ascii->upm-string i)))))
+(define (char i)
+ (if #t
+ ;;(tagify "tspan" (format #f "à~2,'0x;" i))
+ (tagify "tspan" (ascii->upm-string i))
+ (begin
+ (format #t "can't display char: ~x\n" i)
+ " ")))
-(define (nchar font i)
- (format (current-error-port) "can't display char: ~x\n" i)
- " ")
(define (comment s)
(string-append "<!-- " s " -->\n"))
-(define (define-fonts paper font-list)
- (comment (format #f "Fonts used: ~S" font-list)))
+(define (define-fonts internal-external-name-mag-pairs)
+ (comment (format #f "Fonts used: ~S" internal-external-name-mag-pairs)))
+
+(define (end-output)
+ "</g></svg>")
+
+;;TODO
+;(define (horizontal-line x1 x2 th)
+; (draw-line th x1 0 x2 0))
(define (filledbox breapth width depth height)
(round-filled-box breapth width depth height line-thickness))
("cmr8" . ,(string-append
font-cruft
"font-family:cmr;font-style:normal;font-size:8;"))
- ("ecrm10" . ,(string-append
- font-cruft
- "font-family:ecmr;font-style:normal;font-size:10;"))
("feta13" . ,(string-append
font-cruft
"font-family:LilyPond-Feta;font-style:-Feta;font-size:13;"))
font-cruft
"font-family:LilyPond-Parmesan;font-style:-Parmesan;font-size:20;"))))
-(define (get-font font)
- (let* ((name (ly:font-filename font))
- (magnify (ly:font-magnification font)))
- ;; name-mag-pair: (quote ("feta20" . 0.569055118110236))"feta20"(quote ("feta20" . 0.569055118110236))
- (let ((font-string (assoc-get name font-alist)))
- (if (not font-string)
- (begin
- (format #t "font not found: ~S\n" font)
- (cdr (assoc "feta20" font-alist)))
- font-string))))
+(define (get-font name-mag-pair)
+ ;; name-mag-pair: (quote ("feta20" . 0.569055118110236))"feta20"(quote ("feta20" . 0.569055118110236))
+ (let ((f (assoc (caadr name-mag-pair) font-alist)))
+ (if (pair? f)
+ (cdr f)
+ (begin
+ (format #t "font not found: ~s\n" (caadr name-mag-pair))
+ (cdr (assoc "feta20" font-alist))))))
+
+(define (fontify name-mag-pair expr)
+ (string-append
+ (tagify "text" (dispatch expr) (cons 'style (get-font name-mag-pair)))))
(define (header-end)
(comment "header-end"))
-(define (header creator time-stamp paper page-count- classic?)
+(define (header creator generate)
(string-append
xml-header
(comment creator)
- (comment time-stamp)
+ (comment generate)
svg-header))
-;; FIXME: duplicated in other output backends
-;; FIXME: silly interface name
-(define (output-scopes paper scopes fields basename)
- (format (current-error-port) "TODO: FIX ps/tex/interface\n"))
-
-;; FIXME: duplictates output-scopes, duplicated in other backends
-;; FIXME: silly interface name
-(define (output-paper-def pd)
- (format (current-error-port) "TODO: FIX ps/tex/interface\n"))
(define (lily-def key val)
(cond
(define (placebox x y expr)
- (tagify "g"
- ;; FIXME -- JCN
- ;;(dispatch expr)
- expr
+ (tagify "g" (dispatch expr)
`(transform .
,(string-append
"translate("
;; TODO: use height, set scaling?
-(define (start-system origin dim)
-;;(define (start-system width height)
+(define (start-system width height)
(let ((y system-y))
- (set! system-y (+ system-y (cdr dim)))
+ ;;"<g transform='translate(50,-250)'>
+ (set! system-y (+ system-y height))
+ ;;(format #f "<g transform='translate(0,~1,'~f)'>" y)))
(string-append
"\n"
(comment "start-system")
(format #f "<g transform='translate(0.0,~f)'>\n" (* output-scale y)))))
-(define (stop-system last?)
+(define (stop-system)
(string-append
"\n"
(comment "stop-system")
"</g>\n"))
-(define (fontify font expr)
- (string-append
-;; (tagify "text" (dispatch expr) (cons 'style (get-font font)))))
- (tagify "text" expr (cons 'style (get-font font)))))
-
-(define (text font s)
- (tagify "tspan"
- (apply string-append
- (map (lambda (x) (ascii->upm-string (char->integer x)))
- (string->list s)))
- (cons 'style (get-font font))))
-
-(define (ntext font s)
- ;; (fontify font
- ;; to unicode or not?
- (tagify "tspan" (dispatch `(fontify ,font ,s))))
-
-(define (start-page)
- (set! page-number (+ page-number 1))
- (comment "start-page"))
-
-(define (stop-page last?)
- (comment "stop-page"))
-
-;; WTF is this in every backend?
-(define (horizontal-line x1 x2 th)
-;; (draw-line th x1 0 x2 0))
- (filledbox (- x1) (- x2 x1) (* .5 th) (* .5 th)))
+(define stop-last-system stop-system)
+(define (text s)
+ ;; to unicode or not?
+ (if #t
+ (tagify "tspan" s)
+ (tagify "tspan"
+ (apply string-appendb
+ (map (lambda (x) (ascii->upm-string (char->integer x)))
+ (string->list s))))))
;;;; source file of the GNU LilyPond music typesetter
;;;;
;;;; (c) 1998--2004 Jan Nieuwenhuizen <janneke@gnu.org>
-;;;; Han-Wen Nienhuys <hanwen@cs.uu.nl>
+;;;; Han-Wen Nienhuys <hanwen@cs.uu.nl>
;; (debug-enable 'backtrace)
-
-;; The public interface is tight.
-;; It has to be, because user-code is evalled with this module.
-
-;; ***It should also be clean, well defined, documented and reviewed***
-
-;; To be reasonably safe, you probably do not want to use the TeX
-;; backend anyway, but rather the PostScript backend. You may want
-;; to run gs in a uml sandbox too.
-
-
(define-module (scm output-tex)
#:re-export (quote)
- #:export (unknown
+ #:export (define-fonts
+ unknown
+ output-paper-def
+ output-scopes
+ select-font
blank
dot
- white-dot
beam
bracket
dashed-slur
symmetric-x-triangle
ez-ball
comment
+ end-output
+ experimental-on
repeat-slash
+ header-end
+ header
placebox
bezier-sandwich
+ start-system
+ stop-system
+ stop-last-system
horizontal-line
filledbox
round-filled-box
tuplet
polygon
draw-line
+ between-system-string
define-origin
no-origin
- ))
+ start-page
+ stop-page
+ )
+)
(use-modules (ice-9 regex)
(ice-9 string-fun)
(ice-9 format)
(guile)
(srfi srfi-13)
- (scm framework-tex)
(lily))
;;;;;;;;
;;;;;;;; DOCUMENT ME!
;;;;;;;;
-
-
-(define (unknown)
+(define font-name-alist '())
+
+(define (tex-encoded-fontswitch name-mag)
+ (let* ((iname-mag (car name-mag))
+ (ename-mag (cdr name-mag)))
+
+ (cons iname-mag
+ (cons ename-mag
+ (string-append "magfont"
+ (string-encode-integer
+ (hashq (car ename-mag) 1000000))
+ "m"
+ (string-encode-integer
+ (inexact->exact (round (* 1000 (cdr ename-mag))))))))))
+
+(define-public (define-fonts internal-external-name-mag-pairs)
+ (set! font-name-alist (map tex-encoded-fontswitch
+ internal-external-name-mag-pairs))
+ (apply string-append
+ (map (lambda (x)
+ (font-load-command (car x) (cdr x)))
+ (map cdr font-name-alist))))
+
+;;
+;; urg, how can exp be #unspecified? -- in sketch output
+;;
+;; set! returns #<unspecified> --hwn
+;;
+(define-public (fontify name-mag-pair exp)
+ (string-append (select-font name-mag-pair)
+ exp))
+
+
+(define-public (unknown)
"%\n\\unknown\n")
-
+(define (symbol->tex-key sym)
+ (regexp-substitute/global
+ #f "_" (output-tex-string (symbol->string sym)) 'pre "X" 'post) )
+
+(define (tex-string-def prefix key str)
+ (if (equal? "" (sans-surrounding-whitespace (output-tex-string str)))
+ (string-append "\\let\\" prefix (symbol->tex-key key) "\\undefined%\n")
+ (string-append "\\def\\" prefix (symbol->tex-key key) "{" (output-tex-string str) "}%\n")
+ ))
+
+(define (tex-number-def prefix key number)
+ (string-append "\\def\\" prefix (symbol->tex-key key) "{" number "}%\n"))
+
+(define (output-paper-def pd)
+ (apply
+ string-append
+ (module-map
+ (lambda (sym var)
+ (let ((val (variable-ref var))
+ (key (symbol->tex-key sym)))
+
+ (cond
+ ((string? val)
+ (tex-string-def "lilypondpaper" sym val))
+ ((number? val)
+ (tex-number-def "lilypondpaper" sym
+ (if (integer? val)
+ (number->string val)
+ (number->string (exact->inexact val)))))
+ (else ""))))
+
+ (ly:output-def-scope pd))))
+
+(define (output-scopes paper scopes fields basename)
+ (define (output-scope scope)
+ (apply
+ string-append
+ (module-map
+ (lambda (sym var)
+ (let ((val (variable-ref var))
+ ;;(val (if (variable-bound? var) (variable-ref var) '""))
+ (tex-key (symbol->string sym)))
+
+ (if (and (memq sym fields) (string? val))
+ (header-to-file basename sym val))
+
+ (cond
+ ((string? val)
+ (tex-string-def "lilypond" sym val))
+ ((number? val)
+ (tex-number-def "lilypond" sym
+ (if (integer? val)
+ (number->string val)
+ (number->string (exact->inexact val)))))
+ (else ""))))
+ scope)))
+
+ (apply string-append
+ (map output-scope scopes)))
+
+(define (select-font name-mag-pair)
+ (let ((c (assoc name-mag-pair font-name-alist)))
+ (if c
+ (string-append "\\" (cddr c))
+ (begin
+ (ly:warn
+ (format "Programming error: No such font: ~S" name-mag-pair))
+ ""))))
(define (blank)
"")
(define (dot x y radius)
(embedded-ps (list 'dot x y radius)))
-(define (white-dot x y radius)
- (embedded-ps (list 'white-dot x y radius)))
-
(define (beam width slope thick blot)
(embedded-ps (list 'beam width slope thick blot)))
(define (dashed-slur thick dash l)
(embedded-ps (list 'dashed-slur thick dash `(quote ,l))))
-(define (char font i)
- (string-append "\\" (tex-font-command font)
- "\\char" (ly:inexact->string i 10) " "))
+(define (char i)
+ (string-append "\\char" (ly:inexact->string i 10) " "))
(define (dashed-line thick on off dx dy)
(embedded-ps (list 'dashed-line thick on off dx dy)))
(define (symmetric-x-triangle t w h)
(embedded-ps (list 'symmetric-x-triangle t w h)))
+(define (font-load-command name-mag command)
+ (string-append
+ "\\font\\" command "="
+ (car name-mag)
+ " scaled "
+ (ly:number->string (inexact->exact (round (* 1000 (cdr name-mag)))))
+ "\n"))
(define (ez-ball c l b)
(embedded-ps (list 'ez-ball c l b)))
-
+(define (header-to-file fn key val)
+ (set! key (symbol->string key))
+ (if (not (equal? "-" fn))
+ (set! fn (string-append fn "." key))
+ )
+ (display
+ (format "writing header field `~a' to `~a'..."
+ key
+ (if (equal? "-" fn) "<stdout>" fn)
+ )
+ (current-error-port))
+ (if (equal? fn "-")
+ (display val)
+ (display val (open-file fn "w"))
+ )
+ (display "\n" (current-error-port))
+ ""
+ )
(define (embedded-ps expr)
(let ((ps-string
(lambda () (ps-output-expression expr (current-output-port))))))
(string-append "\\embeddedps{" ps-string "}")))
+(define (comment s)
+ (string-append "% " s "\n"))
+
+(define (end-output)
+ (begin
+ ;; uncomment for some stats about lily memory
+ ;; (display (gc-stats))
+ (string-append
+ "\\lilypondend\n"
+ ;; Put GC stats here.
+ )))
+
+(define (experimental-on)
+ "")
(define (repeat-slash w a t)
(embedded-ps (list 'repeat-slash w a t)))
-
+(define (header-end)
+ (string-append
+ "\\def\\scaletounit{ "
+ (number->string (cond
+ ((equal? (ly:unit) "mm") (/ 72.0 25.4))
+ ((equal? (ly:unit) "pt") (/ 72.0 72.27))
+ (else (error "unknown unit" (ly:unit)))
+ ))
+ " mul }%\n"
+ "\\ifx\\lilypondstart\\undefined\n"
+ " \\input lilyponddefs\n"
+ "\\fi\n"
+ "\\outputscale = \\lilypondpaperoutputscale\\lilypondpaperunit\n"
+ "\\lilypondstart\n"
+ "\\lilypondspecial\n"
+ "\\lilypondpostscript\n"))
+
+(define (header creator time-stamp page-count)
+ (string-append
+ "% Generated by " creator "\n"
+ "% at " time-stamp "\n"
+ ;; FIXME: duplicated in every backend
+ "\\def\\lilypondtagline{Engraved by LilyPond (version "
+ (lilypond-version)")}\n"))
+
+(define (invoke-char s i)
+ (string-append
+ "\n\\" s "{" (ly:inexact->string i 10) "}" ))
+
+;; FIXME: explain ploblem: need to do something to make this really safe.
+(define-public (output-tex-string s)
+ (if safe-mode?
+ (regexp-substitute/global #f "\\\\" s 'pre "$\\backslash$" 'post)
+ s))
+
+(define (lily-def key val)
+ (let ((tex-key
+ (regexp-substitute/global
+ #f "_" (output-tex-string key) 'pre "X" 'post))
+
+ (tex-val (output-tex-string val)))
+ (if (equal? (sans-surrounding-whitespace tex-val) "")
+ (string-append "\\let\\" tex-key "\\undefined\n")
+ (string-append "\\def\\" tex-key "{" tex-val "}%\n"))))
(define (number->dim x)
(string-append
(ly:number->string x) " \\outputscale "))
(define (placebox x y s)
- (string-append
- "\\lyitem{" (ly:number->string x) "}{" (ly:number->string y) "}{" s "}%\n"))
+ (string-append "\\lyitem{"
+ (ly:number->string y) "}{"
+ (ly:number->string x) "}{"
+ s "}%\n"))
(define (bezier-sandwich l thick)
(embedded-ps (list 'bezier-sandwich `(quote ,l) thick)))
-;; WTF is this in every backend?
+(define (start-system wd ht)
+ (string-append "\\leavevmode\n"
+ "\\scoreshift = " (number->dim (* ht 0.5)) "\n"
+ "\\lilypondifundefined{lilypondscoreshift}%\n"
+ " {}%\n"
+ " {\\advance\\scoreshift by -\\lilypondscoreshift}%\n"
+ "\\lybox{"
+ (ly:number->string wd) "}{"
+ (ly:number->string ht) "}{%\n"))
+
+(define (stop-system)
+ "}%\n%\n\\interscoreline\n%\n")
+(define (stop-last-system)
+ "}%\n")
+
(define (horizontal-line x1 x2 th)
- (filledbox (- x1) (- x2 x1) (* .5 th) (* .5 th)))
+ (filledbox (- x1) (- x2 x1) (* .5 th) (* .5 th )))
(define (filledbox breapth width depth height)
(if (and #f (defined? 'ps-testing))
(define (round-filled-box x y width height blotdiam)
(embedded-ps (list 'round-filled-box x y width height blotdiam)))
-(define (text font s)
- (let*
- ((mapping #f) ;; (assoc-get 'char-mapping (ly:font-encoding-alist font))))
-
-
- ;; TODO: we'd better do this for PS only
- ;; LaTeX gets in the way, and we need to remap
- ;; nonprintable chars.
-
- (input-enc-name #f) ;; (assoc-get 'input-name (ly:font-encoding-alist font) ))
- )
-
- (string-append "\\hbox{\\" (tex-font-command font)
- (if (string? input-enc-name)
- (string-append "\\inputencoding{" input-enc-name "}")
- "{}")
- (sanitize-tex-string
- (if (vector? mapping)
- (reencode-string mapping s)
- s))
- "}")))
-
+(define (text s)
+ (string-append "\\hbox{" (output-tex-string s) "}"))
(define (tuplet ht gapx dx dy thick dir)
(embedded-ps (list 'tuplet ht gapx dx dy thick dir)))
(define (draw-line thick fx fy tx ty)
(embedded-ps (list 'draw-line thick fx fy tx ty)))
+;; TODO: this should be a default, which is overriden in PS
+(define (between-system-string string)
+ string
+ )
(define (define-origin file line col)
(if (procedure? point-and-click)
(string-append "\\special{src:" ;;; \\string ?
(point-and-click line col file)
"}" )
- ""))
+ "")
+ )
;; no-origin not yet supported by Xdvi
(define (no-origin) "")
+
+(define (start-page)
+ "\n%\\vbox{\n")
+
+(define (stop-page last?)
+ (if last?
+ "\n%}\n"
+ "\n%}\n\\newpage\n"))
-;;; page-layout.scm -- page breaking and page layout
-;;;
-;;;; source file of the GNU LilyPond music typesetter
+;;;; page-layout.scm -- page layout functions
;;;;
+;;;; source file of the GNU LilyPond music typesetter
+;;;;
;;;; (c) 2004 Jan Nieuwenhuizen <janneke@gnu.org>
-;;;; Han-Wen Nienhuys <hanwen@cs.uu.nl>
-(use-modules (oop goops describe)
- (oop goops))
+(define (ly:modules-lookup modules sym)
+ (let ((v (module-variable (car modules) sym)))
+ (if (and v (variable-bound? v) (variable-ref v))
+ (variable-ref v)
+ (if (module? (cdr modules)) (ly:modules-lookup (cdr modules) sym)))))
+(define (page-properties paper)
+ (list (append `((linewidth . ,(ly:paper-get-number
+ paper 'linewidth)))
+ (ly:paper-lookup paper 'text-font-defaults))))
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(define-public (book-title paper scopes)
+ "Generate book title from header strings."
+
+ (define (get sym)
+ (let ((x (ly:modules-lookup scopes sym)))
+ (if (and x (not (unspecified? x))) x "")))
+
+ (let ((props (page-properties paper)))
+
+ (interpret-markup
+ paper props
+ (markup
+ #:column
+ (#:override '(baseline-skip . 4)
+ #:column
+ (#:fill-line
+ (#:normalsize (get 'dedication))
+ #:fill-line
+ (#:huge #:bigger #:bigger #:bigger #:bigger #:bold (get 'title))
+ #:override '(baseline-skip . 3)
+ #:column
+ (#:fill-line
+ (#:large #:bigger #:bigger #:bold (get 'subtitle))
+ #:fill-line (#:bigger #:bigger #:bold (get 'subsubtitle)))
+ #:override '(baseline-skip . 5)
+ #:column ("")
+ #:override '(baseline-skip . 2.5)
+ #:column
+ (#:fill-line
+ (#:bigger (get 'poet) #:large #:bigger #:caps (get 'composer))
+ #:fill-line (#:bigger (get 'texttranslator) #:bigger (get 'opus))
+ #:fill-line
+ (#:bigger (get 'meter) #:bigger (get 'arranger))
+ ""
+ #:fill-line (#:large #:bigger (get 'instrument))
+ " "
+ #:fill-line (#:large #:bigger #:caps (get 'piece) ""))))))))
+
+(define-public (user-title paper markup)
+ "Generate book title from header markup."
+ (if (markup? markup)
+ (let ((props (page-properties paper))
+ (baseline-skip (chain-assoc-get 'baseline-skip props 2)) )
+ (stack-lines DOWN 0 BASELINE-SKIP
+ (list (interpret-markup paper props markup))))))
+
+(define-public (score-title paper scopes)
+ "Generate score title from header strings."
+
+ (define (get sym)
+ (let ((x (ly:modules-lookup scopes sym)))
+ (if (and x (not (unspecified? x))) x "")))
+
+ (let ((props (page-properties paper)))
+
+ (interpret-markup
+ paper props
+ (markup
+ #:column
+ (#:override '(baseline-skip . 4)
+ #:column
+ (#:fill-line
+ ("" (get 'opus))
+ #:fill-line (#:large #:bigger #:caps (get 'piece) "")))))))
-(define-class <optimally-broken-page-node> ()
- (prev #:init-value '() #:accessor node-prev #:init-keyword #:prev)
- (page #:init-value 0 #:accessor node-page-number #:init-keyword #:pageno)
- (penalty #:init-value 0 #:accessor node-penalty #:init-keyword #:penalty)
- (lines #:init-value 0 #:accessor node-lines #:init-keyword #:lines))
+(define-public (make-header paper page-number)
+ (let ((props (page-properties paper) ))
+ (interpret-markup paper props
+ (markup #:fill-line
+ ("" #:bold (number->string page-number))))))
+
+(define-public (make-footer paper page-number)
+ (let ((props (page-properties paper)))
-(define-method (display (node <optimally-broken-page-node>) port)
- (map (lambda (x) (display x port))
- (list
- "Page " (node-page-number node)
- " Lines: " (node-lines node)
- " Penalty " (node-penalty node)
- "\n")))
+ (interpret-markup paper props
+ (markup #:fill-line ("" (number->string page-number))))))
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define TAGLINE
(string-append "Engraved by LilyPond (version " (lilypond-version) ")"))
-;; TODO: take <optimally-broken-page-node> iso. page-number
-;; for all of these functions ?
+(define-public (make-tagline paper scopes)
+ (let* ((props (page-properties paper))
+ (tagline-var (ly:modules-lookup scopes 'tagline))
+ (tagline (if (markup? tagline-var) tagline-var TAGLINE)))
-(define-public (plain-header paper scopes page-number last?)
- "Standard header for a part: page number --outside-- and instrument--centered."
+ (cond ((string? tagline)
+ (if (not (equal? tagline ""))
+ (interpret-markup paper props
+ (markup #:fill-line (tagline "")))))
+ ((markup? tagline) (interpret-markup paper props tagline)))))
- (let* ((props (page-properties paper) )
- (pnum (markup #:bold (number->string page-number)))
- (instr (ly:modules-lookup scopes 'instrument))
- (line (list "" (if (markup? instr) instr "") pnum)))
+(define-public (make-copyright paper scopes)
+ (let ((props (page-properties paper))
+ (copyright (ly:modules-lookup scopes 'copyright)))
+
+ (cond ((string? copyright)
+ (if (not (equal? copyright ""))
+ (interpret-markup paper props
+ (markup #:fill-line (copyright "")))))
+ ((markup? copyright) (interpret-markup paper props copyright)))))
- (if (even? page-number)
- (set! line (reverse line)))
- (if (< 1 page-number)
- (interpret-markup
- paper props (make-fill-line-markup line))
- '())
- ))
+;;; optimal page breaking
+;;; This is not optimal page breaking, this is optimal distribution of
+;;; lines over pages; line breaks are a given.
-;; TODO: add publisher ID on non-first page.
-(define-public (plain-footer paper scopes page-number last?)
- "Standard footer. Empty, save for first (copyright) and last (tagline) page."
-
- (let*
- ((props (page-properties paper))
- (copyright (ly:modules-lookup scopes 'copyright))
- (tagline-var (ly:modules-lookup scopes 'tagline))
- (tagline (if (markup? tagline-var) tagline-var TAGLINE))
- (stencil #f))
-
- (if last?
- (set! stencil
- (ly:stencil-combine-at-edge
- stencil Y DOWN (interpret-markup paper props tagline)
- 0.0
- )))
-
- (if (and (= 1 page-number)
- (markup? copyright))
-
- (set! stencil
- (ly:stencil-combine-at-edge
- stencil Y DOWN (interpret-markup paper props copyright)
- 0.0
- )))
-
- stencil))
+;;; TODO:
+;;; - user tweaking:
+;;; + \pagebreak, \nopagebreak
+;;; + #pages?
+;;; - short circut SCORE=-1 (dismiss path)
+;;; - density scoring
+
+
+(use-modules (oop goops describe))
+
+(define-class <break-node> ()
+ (prev #:init-value '() #:accessor node-prev #:init-keyword #:prev)
+ (line #:init-value 'barf #:accessor node-line #:init-keyword #:line)
+ (page #:init-value 0 #:accessor node-page #:init-keyword #:page)
+ (score #:init-value 0 #:accessor node-score #:init-keyword #:score)
+ (height #:init-value 0 #:accessor node-height #:init-keyword #:height))
+
+(define INFINITY 1e9)
+
+(define (robust-paper-line-number line)
+ (if (null? line) 0
+ (ly:paper-line-number line)))
-(define (page-headfoot paper scopes number sym sepsym dir last?)
- "Create a stencil including separating space."
- (let*
- ((header-proc (ly:output-def-lookup paper sym))
- (sep (ly:output-def-lookup paper sepsym))
- (stencil (ly:make-stencil "" '(0 . 0) '(0 . 0)))
- (head-stencil
- (if (procedure? header-proc)
- (header-proc paper scopes number last?)
- #f)))
-
- (if (and (number? sep) (ly:stencil? head-stencil))
- (set! head-stencil
- (ly:stencil-combine-at-edge
- stencil Y dir head-stencil
- sep 0.0)))
-
- head-stencil))
-
-(define-public (default-page-music-height paper scopes number last?)
- "Printable area for music and titles; matches default-page-make-stencil."
- (let*
- ((h (- (ly:output-def-lookup paper 'vsize)
- (ly:output-def-lookup paper 'top-margin)
- (ly:output-def-lookup paper 'bottom-margin)))
- (head (page-headfoot paper scopes number 'make-header 'head-sep UP last?))
- (foot (page-headfoot paper scopes number 'make-footer 'foot-sep DOWN last?)))
- (- h (if (ly:stencil? head)
- (interval-length (ly:stencil-extent head Y))
- 0)
- (if (ly:stencil? foot)
- (interval-length (ly:stencil-extent foot Y))
- 0))
- ))
-
-
-(define-public (default-page-make-stencil lines paper scopes number last? )
- "Construct a stencil representing the page from LINES. "
- (let*
- ((top-margin (ly:output-def-lookup paper 'top-margin))
-
- ;; TODO: naming vsize/hsize not analogous to TeX.
-
- (hsize (ly:output-def-lookup paper 'hsize))
- (left-margin (/ (- hsize
- (ly:output-def-lookup paper 'linewidth)) 2))
- (vsize (ly:output-def-lookup paper 'vsize))
- (bottom-edge (- vsize
- (ly:output-def-lookup paper 'bottom-margin)))
-
- (head (page-headfoot paper scopes number 'make-header 'head-sep UP last?))
- (foot (page-headfoot paper scopes number 'make-footer 'foot-sep DOWN last?))
- (line-stencils (map ly:paper-system-stencil lines))
- (height-proc (ly:output-def-lookup paper 'page-music-height))
- (music-height (height-proc paper scopes number last?))
- (ragged (ly:output-def-lookup paper 'raggedbottom))
- (ragged-last (ly:output-def-lookup paper 'raggedlastbottom))
- (ragged-bottom (or (eq? #t ragged)
- (and last? (eq? #t ragged-last))))
-
- (spc-left (- music-height
- (apply + (map (lambda (x)
- (interval-length (ly:stencil-extent x Y)))
- line-stencils))))
- (stretchable-lines (remove ly:paper-system-title? (cdr lines)))
- (stretch (if (or (null? stretchable-lines)
- (> spc-left (/ music-height 2))
- ragged-bottom)
- 0.0
- (/ spc-left (length stretchable-lines))))
-
- (page-stencil (ly:make-stencil '()
- (cons left-margin hsize)
- (cons (- top-margin) 0)))
- (was-title #t))
-
- (set! page-stencil (ly:stencil-combine-at-edge
- page-stencil Y DOWN head 0. 0.))
-
- (for-each
- (lambda (l)
- (set! page-stencil
- (ly:stencil-combine-at-edge
- page-stencil Y DOWN (ly:paper-system-stencil l)
- (if was-title
- 0.0
- stretch)
- ))
-
- (set! was-title (ly:paper-system-title? l)))
- lines)
-
- (if (ly:stencil? foot)
- (set! page-stencil
- (ly:stencil-add
- page-stencil
- (ly:stencil-translate
- foot
- (cons 0
- (+ (- bottom-edge) (- (car (ly:stencil-extent foot Y)))))
- ))))
-
- (ly:stencil-translate page-stencil (cons left-margin 0))
- ))
+(define (robust-line-height line)
+ (if (null? line) 0
+ (ly:paper-line-height line)))
+(define (robust-line-number node)
+ (if (null? node) 0
+ (robust-paper-line-number (node-line node))))
+(define (robust-break-score node)
+ (let ((line (node-line node)))
+ (if (null? line) 0
+ (ly:paper-line-break-score line))))
+(define (make-node prev line page score . height)
+ (make <break-node> #:prev prev #:line line #:page page #:score score
+ #:height (if (null? height) 0 (car height))))
-;;; optimal page breaking
+;; max density %
+(define MAX-CRAMP 0.05)
-;;; This is not optimal page breaking, this is optimal distribution of
-;;; lines over pages; line breaks are a given.
-
-; TODO:
-;
-; - density scoring
-; - separate function for word-wrap style breaking?
-; - raggedbottom? raggedlastbottom?
-
-(define-public (ly:optimal-page-breaks
- lines paper-book)
- "Return pages as a list starting with 1st page. Each page is a list
-of lines. "
-
- (define (make-node prev lines page-num penalty)
- (make <optimally-broken-page-node>
- #:prev prev
- #:lines lines
- #:pageno page-num
- #:penalty penalty))
-
- (define MAXPENALTY 1e9)
- (define bookpaper (ly:paper-book-book-paper paper-book))
- (define scopes (ly:paper-book-scopes paper-book))
- (define (line-height line)
- (ly:paper-system-extent line Y))
+(define-public (ly:optimal-page-breaks lines book-height text-height
+ first-diff last-diff)
;; FIXME: may need some tweaking: square, cubic
- (define (height-penalty available used)
- ;; FIXME, simplistic
- (let* ((left (- available used))
- ;; scale-independent
- (relative (abs (/ left available))))
- (if (negative? left)
-
- ;; too full, penalise more
- (* 10 (1+ relative) relative)
-
- ;; Convexity: two half-empty pages is better than 1 completely
- ;; empty page
- (* (1+ relative) relative))))
-
- (define (page-height page-number last?)
- (let
- ((p (ly:output-def-lookup bookpaper 'page-music-height)))
-
- (if (procedure? p)
- (p bookpaper scopes page-number last?)
- 10000)))
+ (define (height-score available used)
+ (let* ((empty (- available used))
+ (norm-empty (* empty (/ 100 available))))
+ (if (< norm-empty 0)
+ (if (> (* -1 (/ empty available)) MAX-CRAMP)
+ ;; cannot fill more than MAX-CRAMP
+ -1
+ ;; overfull page is still worse by a power
+ ;; -- which means it never happens
+ ;; let's try a factor 2
+ ;;(* -1 norm-empty norm-empty norm-empty))
+ (* 2 norm-empty norm-empty))
+ (* norm-empty norm-empty))))
+
+ (define (page-height page-number page-count)
+ (let ((h text-height))
+ (if (= page-number 1)
+ (set! h (+ h first-diff)))
+ (if (= page-number page-count)
+ ;;(> page-number (/ book-height text-height))
+ (set! h (+ h last-diff)))
+ h))
-
(define (cumulative-height lines)
- (apply + (map line-height lines)))
-
- (define (get-path node done)
- "Follow NODE.PREV, and return as an ascending list of pages. DONE
-is what have collected so far, and has ascending page numbers."
- (if (is-a? node <optimally-broken-page-node>)
- (get-path (node-prev node) (cons node done))
- done))
-
- (define (combine-penalties user page prev)
- (+ prev page user))
-
- (define (walk-paths done-lines best-paths current-lines last? current-best)
- "Return the best optimal-page-break-node that contains
-CURRENT-LINES. DONE-LINES.reversed ++ CURRENT-LINES is a consecutive
-ascending range of lines, and BEST-PATHS contains the optimal breaks
-corresponding to DONE-LINES.
-
-CURRENT-BEST is the best result sofar, or #f."
-
- (let* ((this-page-num (if (null? best-paths)
- 1
- (1+ (node-page-number (car best-paths)))))
- (prev-penalty (if (null? best-paths)
- 0.0
- (node-penalty (car best-paths))))
- (page-height (page-height this-page-num last?))
- (space-used (cumulative-height current-lines))
- (this-page-penalty (height-penalty page-height space-used))
- (user-penalty (ly:paper-system-break-penalty (car current-lines)))
- (total-penalty (combine-penalties
- user-penalty this-page-penalty prev-penalty))
- (better? (or
- (not current-best)
- (< total-penalty (node-penalty current-best))))
- (new-best (if better?
- (make-node (if (null? best-paths)
- #f
- (car best-paths))
- current-lines
- this-page-num total-penalty)
- current-best)))
-
- (if #f ;; debug
- (display
- (list
- "user pen " user-penalty " prev-penalty "
- prev-penalty "\n"
- "better? " better? " total-penalty " total-penalty "\n"
- "height " page-height " spc used: " space-used "\n"
- "pen " this-page-penalty " lines: " current-lines "\n")))
-
- (if (and (pair? done-lines)
- ;; if this page is too full, adding another line won't help
- (< this-page-penalty MAXPENALTY))
- (walk-paths (cdr done-lines) (cdr best-paths)
- (cons (car done-lines) current-lines)
- last? new-best)
- new-best)))
-
- (define (walk-lines done best-paths todo)
- "Return the best page breaking as a single
-<optimal-page-break-node> for optimally breaking TODO ++
-DONE.reversed. BEST-PATHS is a list of break nodes corresponding to
-DONE."
- (if (null? todo)
- (car best-paths)
- (let* ((this-line (car todo))
- (last? (null? (cdr todo)))
- (next (walk-paths done best-paths (list this-line) last? #f)))
-
- (walk-lines (cons this-line done)
- (cons next best-paths)
- (cdr todo)))))
-
- (define (line-number node)
- (ly:paper-system-number (car (node-lines node))))
-
- (let* ((best-break-node (walk-lines '() '() lines))
- (break-nodes (get-path best-break-node '()))
- )
-
- (if (ly:get-option 'verbose)
- (begin
- (format (current-error-port) "breaks: ~S\n" (map line-number break-nodes))
- (force-output (current-error-port))))
+ (apply + (map robust-line-height lines)))
-
- ; create stencils.
-
- (map (lambda (node)
- ((ly:output-def-lookup bookpaper 'page-make-stencil)
- (node-lines node)
- bookpaper
- scopes
- (node-page-number node)
- (eq? node best-break-node)))
- break-nodes)))
+ (define (get-path node)
+ (if (null? node) '() (cons node (get-path (node-prev node)))))
+ (define (add-scores . lst)
+ (if (null? (filter (lambda (x) (> 0 x)) lst)) (apply + lst) -1))
+ (define (density-variance nodes)
+ (define (sqr x) (* x x))
+ (define (density node)
+ (let ((p (page-height (node-page node) (node-page (car nodes))))
+ (h (node-height node)))
+ (if (and p h) (/ h p) 0)))
+
+ (let* ((height-nodes (reverse
+ ;; reverse makes for handier debugging
+ (filter (lambda (x) (> (node-height x) 0)) nodes)))
+ (densities (map density height-nodes))
+ (p-heights (map (lambda (x) (page-height (node-page x)
+ (node-page (car nodes))))
+ height-nodes))
+ (heights (map node-height height-nodes))
+ (mean (/ (apply + densities) (length densities)))
+ (diff (map (lambda (x) (- x mean)) densities))
+ (var (map sqr (map (lambda (x) (* (car p-heights) x)) diff))))
+ (apply + var)))
+
+ (define (walk-paths best node lines nodes paths)
+ (let* ((height (cumulative-height lines))
+ (next-page (+ (if (null? paths) 0 (node-page (car paths))) 1))
+ (page (page-height (node-page node) next-page))
+ (hh (make-node '() (node-line node) 0 0 height))
+ (break-score (robust-break-score node))
+ (density-score (if (null? paths) 0
+ ;; TODO: find out why we need density
+ ;; use other height-score parameters?
+ ;; See: input/test/page-breaks.ly
+ (* 1 (density-variance
+ (cons hh (get-path (car paths)))))))
+ (page-score (height-score page height))
+ (this-score (add-scores page-score break-score density-score))
+ (path-score (if (null? paths) 0 (node-score (car paths))))
+ (score (add-scores path-score this-score)))
+
+ (if (and (>= score 0)
+ (or (<= score (node-score best))
+ (= (node-score best) -1)))
+ (begin
+ (set! (node-score best) score)
+ (set! (node-page best) next-page)
+ (set! (node-height best) height)
+ (set! (node-prev best) (car paths))))
+
+ (if (or (null? nodes)
+ ;; short circuit
+ (and (= path-score -1)
+ (> (- (/ height page) 1) MAX-CRAMP)))
+ best
+ (walk-paths best (car nodes)
+ (cons (node-line (car paths)) lines)
+ (cdr nodes) (cdr paths)))))
+
+ (define (walk-lines lines nodes paths)
+ (if (null? (cdr lines))
+ paths
+ (let* ((prev (node-prev (car nodes)))
+ (this (make-node prev (car lines) 0 INFINITY))
+ (next (make-node this (cadr lines) 0 0))
+ (best (walk-paths this prev (list (node-line (car nodes)))
+ (cddr nodes) paths)))
+ (walk-lines (cdr lines) (cons next nodes) (cons best paths)))))
+
+ (let* ((dummy (make-node '() '() 0 0))
+ (this (make-node dummy (car lines) 0 0))
+ (result (walk-lines lines (list this dummy) (list dummy)))
+ (path (get-path (car result)))
+ ;; CDR: junk dummy node
+ (breaks (cdr (reverse (map robust-line-number path)))))
+
+ (format (current-error-port) "ESTIMATE: ~S\n"
+ (/ book-height text-height))
+ (format (current-error-port) "breaks: ~S\n" breaks)
+ ;; TODO: if solution is bad return no breaks and revert to
+ ;; ragged bottom
+ (force-output (current-error-port))
+ (list->vector breaks)))
(ss (/ sz 4))
(pt (eval 'pt m))
(mm (eval 'mm m)))
-
- (module-define! m 'outputscale ss)
- (module-define! m 'fonts (make-cmr-tree (/ sz (* 20 pt))))
+
+ (module-define! m 'fonts (make-font-tree (/ sz (* 20 pt))))
+
(module-define! m 'staffheight sz)
(module-define! m 'staff-space ss)
(module-define! m 'staffspace ss)
+
;; !! synchronize with feta-params.mf
(module-define! m 'linethickness (+ (* 0.3 pt) (* 0.04 ss)))
+ (module-define! m 'outputscale ss)
(module-define! m 'ledgerlinethickness (+ (* 0.5 pt) (/ ss 10)))
(module-define! m 'blotdiameter (* 0.35 pt))
- (module-define! m 'interscoreline (* 4 mm))
-
- (module-define! m 'dimension-variables
- '(pt mm cm in staffheight staff-space
- linewidth indent hsize vsize
- staffspace linethickness ledgerlinethickness
- blotdiameter interscoreline))
- ))
+ (module-define! m 'interscoreline (* 4 mm))))
(define-public (set-global-staff-size sz)
"Set the default staff size, where SZ is thought to be in PT."
(let* ((old-mod (current-module))
- (pap (eval '$defaultbookpaper old-mod))
- (in-paper? (or (module-defined? old-mod 'is-bookpaper)
- (module-defined? old-mod 'is-paper)))
+ (pap (eval '$defaultpaper old-mod))
+
- ; maybe not necessary.
- ; but let's be paranoid. Maybe someone still refers to the
- ; old one.
+ ;; Huh? Why is it necessary to clone object?
(new-paper (ly:output-def-clone pap))
-
(new-scope (ly:output-def-scope new-paper)))
- (if in-paper?
- (ly:warn "Not in toplevel scope"))
(set-current-module new-scope)
(paper-set-staff-size (* sz (eval 'pt new-scope)))
(set-current-module old-mod)
- (module-define! old-mod '$defaultbookpaper new-paper)))
+ (module-define! old-mod '$defaultpaper new-paper)))
(define paper-alist
'(("a6" . (cons (* 105 mm) (* 148.95 mm)))
(module-define! m 'head-sep (* 4 mm))
(module-define! m 'foot-sep (* 4 mm))))
+
+
(define (internal-set-paper-size module name)
(let* ((entry (assoc name paper-alist))
- (is-bookpaper? (module-defined? module 'is-bookpaper))
+ (is-paper? (module-defined? module '$is-paper))
(mm (eval 'mm module)))
(cond
- ((not is-bookpaper?)
+ ((not is-paper?)
(ly:warning "This is not a \\paper {} object:")
(display module))
((pair? entry)
))
(define-public (set-default-paper-size name)
- (internal-set-paper-size (ly:output-def-scope (eval '$defaultbookpaper (current-module)))
+ (internal-set-paper-size (ly:output-def-scope (eval '$defaultpaper (current-module)))
name))
(define-public (set-paper-size name)
- (if (module-defined? (current-module) 'is-paper)
+ (if (module-defined? (current-module) '$is-paper)
(internal-set-paper-size (current-module) name)
;;; TODO: should raise (generic) exception with throw, and catch
;;; that in parse-scm.cc
(ly:warn "Must use #(set-paper-size .. ) within \\paper { ... }")))
-
-(define-public (scale-paper pap scale)
- (let*
- ((new-pap (ly:output-def-clone pap))
- (dim-vars (ly:output-def-lookup pap 'dimension-variables))
- (scope (ly:output-def-scope new-pap)))
-
- (for-each
- (lambda (v)
- (define val (ly:output-def-lookup pap v))
- (if (number? val)
- (module-define! scope v
- (/ val scale))
-
- ;; spurious warnings, eg. for hsize, vsize.
-; (ly:warn (format "not a number, ~S = ~S " v val))
- ))
-
- dim-vars)
-
- new-pap
- ))
(cond ((not (equal? (configuration now-state) 'apart))
current-idx)
((> siln 0) start-idx)
- ((not solo-state)
- (put-range type start-idx current-idx)
- current-idx)
- ((and
- (null? (span-state solo-state)))
+ ((and (null? (span-state solo-state)))
;;
;; This includes rests. This isn't a problem: long rests
;; will be shared with the silent voice, and be marked
+++ /dev/null
-;;;; safe-lily.scm --
-;;;;
-;;;; source file of the GNU LilyPond music typesetter
-;;;;
-;;;; (c) 2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
-(define safe-objects
- (map
- (lambda (sym)
- (cons sym (primitive-eval sym)))
- '(ly:add-interface
- ly:add-moment
- ly:all-grob-interfaces
- ly:all-output-backend-commands
- ly:all-stencil-expressions
- ly:bracket
- ly:context-find
- ly:context-id
- ly:context-name
- ly:context-parent
- ly:context-property
- ly:context-property-where-defined
- ly:context-pushpop-property
- ly:context-set-property!
- ly:context-unset-property
- ly:context?
- ly:dimension?
- ly:dir?
- ly:div-moment
- ly:duration-dot-count
- ly:duration-factor
- ly:duration-log
- ly:duration<?
- ly:duration?
- ly:export
- ly:find-glyph-by-name
- ly:font-design-size
- ly:font-encoding-alist
- ly:font-filename
- ly:font-magnification
- ly:font-metric?
- ly:font-name
- ly:format-output
- ly:get-all-function-documentation
- ly:get-all-translators
- ly:get-default-font
- ly:get-glyph
- ly:get-option
- ly:grob-alist-chain
- ly:grob-extent
- ly:grob-original
- ly:grob-paper
- ly:grob-parent
- ly:grob-pq-less?
- ly:grob-property
- ly:grob-script-priority-less
- ly:grob-set-property!
- ly:grob-staff-position
- ly:grob-suicide
- ly:grob-system
- ly:grob-translate-axis!
- ly:grob?
- ly:input-location
- ly:input-location?
- ly:input-message
- ly:intlog2
- ly:item-break-dir
- ly:item?
- ly:iterator?
- ly:make-bare-music
- ly:make-duration
- ly:make-moment
- ly:make-music-function
- ly:make-pitch
- ly:make-stencil
- ly:moment<?
- ly:moment?
- ly:mul-moment
- ly:music-compress
- ly:music-deep-copy
- ly:music-duration-compress
- ly:music-duration-length
- ly:music-length
- ly:music-list?
- ly:music-mutable-properties
- ly:music-name
- ly:music-property
- ly:music-scorify
- ly:music-set-property!
- ly:music-transpose
- ly:music?
- ly:my-lily-parser?
- ly:number->string
- ly:option-usage
- ly:output-def-clone
- ly:output-def-scope
- ly:output-description
- ly:paper-book?
- ly:paper-def?
- ly:paper-get-font
- ly:paper-get-number
- ly:paper-system-break-penalty
- ly:paper-system-extent
- ly:paper-system-number
- ly:paper-system-stencil
- ly:paper-system?
- ly:output-def-lookup
- ly:parse-string
- ly:parser-parse-string
- ly:parser-print-book
- ly:parser-print-score
- ly:pitch-alteration
- ly:pitch-diff
- ly:pitch-notename
- ly:pitch-octave
- ly:pitch-quartertones
- ly:pitch-semitones
- ly:pitch-steps
- ly:pitch-transpose
- ly:pitch<?
- ly:pitch?
- ly:round-filled-box
- ly:run-translator
- ly:set-option
- ly:score-bookify
- ly:set-point-and-click
- ly:spanner-broken-into
- ly:spanner-get-bound
- ly:spanner?
- ly:stencil-add
- ly:stencil-align-to!
- ly:stencil-combine-at-edge
- ly:stencil-expr
- ly:stencil-extent
- ly:stencil-moved-to-edge
- ly:stencil-set-extent!
- ly:stencil-translate
- ly:stencil-translate-axis
- ly:stencil?
- ly:text-dimension
- ly:translator-description
- ly:translator-name
- ly:translator?
- ly:transpose-key-alist
- ly:unit
- ly:version
- ly:warn
-
- ;; need these for parsing init files:
- ;; todo: should have a macro define-safe-public
- DOUBLE-FLAT
- THREE-Q-FLAT
- FLAT
- SEMI-FLAT
- NATURAL
- SEMI-SHARP
- SHARP
- THREE-Q-SHARP
- DOUBLE-SHARP
- SEMI-TONE
- START
- STOP
- alist->hash-table
- default-chord-modifier-list
- sequential-music-to-chord-exceptions
- make-music
- make-articulation
- make-event-chord
- make-penalty-music
- make-span-event
- set-start-grace-properties
- set-stop-grace-properties
- set-default-paper-size
- set-part-combine-listener
- context-spec-music
- make-voice-props-revert
- make-voice-props-set
- chord-name->german-markup
- note-name->german-markup
- default-toplevel-music-handler
- default-toplevel-book-handler
- default-toplevel-score-handler
-
- Accidental_interface::after_line_breaking
- Accidental_interface::print
- Ambitus::print
- Arpeggio::print
- Arpeggio::brew_chord_bracket
- Arpeggio::width_callback
- Axis_group_interface::group_extent_callback
- Bar_line::before_line_breaking
- Bar_line::get_staff_bar_size
- Bar_line::print
- Beam::after_line_breaking
- Beam::before_line_breaking
- Beam::check_concave
- Beam::least_squares
- Beam::print
- Beam::quanting
- Beam::shift_region_to_valid
- Beam::slope_damping
- Beam::space_function
- Break_align_interface::alignment_callback
- Breathing_sign::offset_callback
- Chord_name::after_line_breaking
- Clef::before_line_breaking
- Clef::print
- Cluster::print
- Cluster_beacon::height
- Custos::print
- Dot_column::side_position
- Dots::print
- Hairpin::print
- Hara_kiri_group_spanner::force_hara_kiri_callback
- Hara_kiri_group_spanner::y_extent
- Horizontal_bracket::print
- Hyphen_spanner::print
- Hyphen_spanner::set_spacing_rods
- Key_signature_interface::print
- Line_spanner::after_line_breaking
- Line_spanner::print
- Lyric_extender::print
- Measure_grouping::print
- Mensural_ligature::brew_ligature_primitive
- Mensural_ligature::print
- Multi_measure_rest::percent
- Multi_measure_rest::print
- Multi_measure_rest::set_spacing_rods
- Note_head::extent
- Note_head::print
- Note_head::brew_ez_stencil
- Ottava_bracket::print
- Paper_column::before_line_breaking
- Paper_column::print
- Percent_repeat_item_interface::beat_slash
- Percent_repeat_item_interface::double_percent
- Piano_pedal_bracket::print
- Rest::after_line_breaking
- Rest::extent_callback
- Rest::polyphonic_offset_callback
- Rest::print
- Script_column::before_line_breaking
- Script_interface::before_line_breaking
- Script_interface::print
- Self_alignment_interface::aligned_on_parent
- Self_alignment_interface::aligned_on_self
- Self_alignment_interface::centered_on_other_axis_parent
- Self_alignment_interface::centered_on_parent
- Separating_group_spanner::set_spacing_rods
- Side_position_interface::aligned_on_support_refpoints
- Side_position_interface::aligned_side
- Slur::after_line_breaking
- Slur::height
- Slur::print
- Spacing_spanner::set_springs
- Span_bar::before_line_breaking
- Span_bar::get_bar_size
- Span_bar::print
- Span_bar::width_callback
- Spanner::set_spacing_rods
- Staff_symbol::print
- Staff_symbol_referencer::callback
- Stem::before_line_breaking
- Stem::dim_callback
- Stem::height
- Stem::off_callback
- Stem::print
- Stem_tremolo::height
- Stem_tremolo::print
- Sustain_pedal::print
- System_start_delimiter::after_line_breaking
- System_start_delimiter::print
- Text_item::print
- Text_spanner::print
- Tie::print
- Tie_column::after_line_breaking
- Time_signature::print
- Tuplet_bracket::after_line_breaking
- Tuplet_bracket::before_line_breaking
- Tuplet_bracket::print
- Vaticana_ligature::brew_ligature_primitive
- Vaticana_ligature::print
- Volta_bracket_interface::print
- )))
-
-(define-public (make-safe-lilypond-module)
- (let* ((m (make-safe-module)))
- (for-each (lambda (p) (module-define! m (car p) (cdr p))) safe-objects)
- m))
;;;; (c) 2003--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
(define-public (stack-stencils axis dir padding stils)
- "Stack stencils STILS in direction AXIS, DIR, using PADDING."
+ "Stack stencils STILS in direction AXIS,DIR, using PADDING."
(if (null? stils)
'()
(if (pair? stils)
(stack-lines dir padding baseline (cdr stils))
padding baseline))))
+(define-public (fontify-text font-metric text)
+ "Set TEXT with font FONT-METRIC, returning a stencil."
+ (let* ((b (ly:text-dimension font-metric text)))
+ (ly:make-stencil
+ (ly:fontify-atom font-metric `(text ,text)) (car b) (cdr b))))
+
(define-public (bracketify-stencil stil axis thick protusion padding)
"Add brackets around STIL, producing a new stencil."
(set! stil (ly:stencil-combine-at-edge stil Y -1 x-rule 0.0))
stil))
-
-(define-public (fontify-text font-metric text)
- "Set TEXT with font FONT-METRIC, returning a stencil."
- (let* ((b (ly:text-dimension font-metric text)))
- (ly:make-stencil
- `(text ,font-metric ,text) (car b) (cdr b))))
-
+++ /dev/null
-;;;; titling.scm -- titling functions
-;;;;
-;;;; source file of the GNU LilyPond music typesetter
-;;;;
-;;;; (c) 2004 Jan Nieuwenhuizen <janneke@gnu.org>
-;;;; Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
-(define-public (page-properties paper)
- (list (append `((linewidth . ,(ly:paper-get-number
- paper 'linewidth)))
- (ly:output-def-lookup paper 'text-font-defaults))))
-
-;;;;;;;;;;;;;;;;;;
- ; titling.
-(define-public (default-book-title paper scopes)
- "Generate book title from header strings."
-
-
- (define (get sym)
- (let ((x (ly:modules-lookup scopes sym)))
- (if (markup? x) x "")))
- (define (has sym)
- (markup? (ly:modules-lookup scopes sym)))
-
- (let ((props (page-properties paper)))
-
- (interpret-markup
- paper props
- (make-override-markup
- '(baseline-skip . 4)
- (make-column-markup
- (append
- (if (has 'dedication)
- (list (markup #:fill-line
- (#:normalsize (get 'dedication))))
- '())
- (if (has 'title)
- (list
- (markup (#:fill-line
- (#:huge #:bigger #:bigger #:bigger #:bigger #:bold
- (get 'title)))))
- '())
- (if (or (has 'subtitle) (has 'subsubtitle))
- (list
- (make-override-markup
- '(baseline-skip . 3)
- (make-column-markup
- (list
- (markup #:fill-line
- (#:large #:bigger #:bigger #:bold (get 'subtitle)))
- (markup #:fill-line (#:bigger #:bigger #:bold
- (get 'subsubtitle)))
- (markup #:override '(baseline-skip . 5)
- #:column ("")))
-
- ))
- )
- '())
-
- (list
- (make-override-markup
- '(baseline-skip . 2.5)
- (make-column-markup
- (append
- (if (or (has 'poet) (has 'composer))
- (list (markup #:fill-line
- (#:bigger (get 'poet)
- #:large #:bigger #:caps
- (get 'composer))))
- '())
- (if (or (has 'texttranslator) (has 'opus))
- (list
- (markup
- #:fill-line
- (#:bigger (get 'texttranslator) #:bigger (get 'opus))))
- '())
- (if (or (has 'meter) (has 'arranger))
- (list
- (markup #:fill-line
- (#:bigger (get 'meter) #:bigger (get 'arranger))))
- '())
- (if (has 'instrument)
- (list
- ""
- (markup #:fill-line (#:large #:bigger (get 'instrument))))
- '())
-;;; piece is done in the score-title
-;;; (if (has 'piece)
-;;; (list ""
-;;; (markup #:fill-line (#:large #:bigger #:caps (get 'piece) "")))
-;;; '())
- ))))))))))
-
-
-(define-public (default-user-title paper markup)
- "Generate book title from header markup."
- (if (markup? markup)
- (let ((props (page-properties paper))
- (baseline-skip (chain-assoc-get 'baseline-skip props 2)) )
- (stack-lines DOWN 0 BASELINE-SKIP
- (list (interpret-markup paper props markup))))))
-
-(define-public (default-score-title paper scopes)
- "Generate score title from header strings."
-
- (define (get sym)
- (let ((x (ly:modules-lookup scopes sym)))
- (if (markup? x) x "")))
-
- (define (has sym)
- (markup? (ly:modules-lookup scopes sym)))
-
- (let ((props (page-properties paper)))
- (interpret-markup
- paper props
- (make-override-markup
- '(baseline-skip . 4)
- (make-column-markup
- (append
- (if (has 'opus)
- ;; opus, again?
- (list (markup #:fill-line ("" (get 'opus))))
- '())
- (if (has 'piece)
- (list
- (markup #:fill-line (#:large #:bigger #:caps (get 'piece) "")))
- '())))))))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
# \breve and \longa supported.
# M:none doesn't crash lily.
-# Enhancements (Guy Gascoigne-Piggford)
-#
-# Add support for maintaining ABC's notion of beaming, this is selectable
-# from the command line with a -b or --beam option.
-# Fixd a problem where on cygwin empty lines weren't being correctly identifed
-# and so were complaining, but still generating the correct output.
-
# Limitations
#
# Multiple tunes in single file not supported
#TODO:
#
-# * lilylib
-# * GNU style messages: warning:FILE:LINE:
-# * l10n
-#
# Convert to new chord styles.
#
# UNDEF -> None
UNDEF = 255
state = UNDEF
strict = 0
-preserve_beams = 0
voice_idx_dict = {}
header = {}
header['footnotes'] = ''
def check_clef(s):
- if not s:
- return ''
- if re.match('-8va', s) or re.match('treble8', s):
- # treble8 is used by abctab2ps; -8va is used by barfly,
- # and by my patch to abc2ps. If there's ever a standard
- # about this we'll support that.
- s = s[4:]
- state.base_octave = -1
- voices_append("\\clef \"G_8\"\n")
- elif re.match('^treble', s):
- s = s[6:]
- if re.match ('^-8', s):
- s = s[2:]
- state.base_octave = -2
- voices_append("\\clef \"G_8\"\n")
- else:
- state.base_octave = 0
- voices_append("\\clef treble\n")
- elif re.match('^alto', s):
- s = s[4:]
- state.base_octave = -1
- voices_append ("\\clef alto\n" )
- elif re.match('^bass',s ):
- s = s[4:]
- state.base_octave = -2
- voices_append ("\\clef bass\n" )
- return s
+ if not s:
+ return ''
+ if re.match('-8va', s) or re.match('treble8', s):
+ # treble8 is used by abctab2ps; -8va is used by barfly,
+ # and by my patch to abc2ps. If there's ever a standard
+ # about this we'll support that.
+ s = s[4:]
+ state.base_octave = -1
+ voices_append("\\clef \"G_8\"\n")
+ elif re.match('^treble', s):
+ s = s[6:]
+ if re.match ('^-8', s):
+ s = s[2:]
+ state.base_octave = -2
+ voices_append("\\clef \"G_8\"\n")
+ else:
+ state.base_octave = 0
+ voices_append("\\clef treble\n")
+ elif re.match('^alto', s):
+ s = s[4:]
+ state.base_octave = -1
+ voices_append ("\\clef alto\n" )
+ elif re.match('^bass',s ):
+ s = s[4:]
+ state.base_octave = -2
+ voices_append ("\\clef bass\n" )
+ return s
def select_voice (name, rol):
if not voice_idx_dict.has_key (name):
- state_list.append(Parser_state())
- voices.append ('')
- slyrics.append ([])
- voice_idx_dict[name] = len (voices) -1
+ state_list.append(Parser_state())
+ voices.append ('')
+ slyrics.append ([])
+ voice_idx_dict[name] = len (voices) -1
__main__.current_voice_idx = voice_idx_dict[name]
__main__.state = state_list[current_voice_idx]
while rol != '':
- m = re.match ('^([^ \t=]*)=(.*)$', rol) # find keywork
- if m:
- keyword = m.group(1)
- rol = m.group (2)
- a = re.match ('^("[^"]*"|[^ \t]*) *(.*)$', rol)
- if a:
- value = a.group (1)
- rol = a.group ( 2)
- if keyword == 'clef':
- check_clef(value)
- elif keyword == "name":
- value = re.sub ('\\\\','\\\\\\\\', value)
- ## < 2.2
- ##voices_append ("\\property Staff.instrument = %s\n" % value )
- voices_append ("\\set Staff.instrument = %s\n" % value )
-
- __main__.part_names = 1
- elif keyword == "sname" or keyword == "snm":
- ##voices_append ("\\property Staff.instr = %s\n" % value )
- voices_append ("\\set Staff.instr = %s\n" % value )
- else:
- break
+ m = re.match ('^([^ \t=]*)=(.*)$', rol) # find keywork
+ if m:
+ keyword = m.group(1)
+ rol = m.group (2)
+ a = re.match ('^("[^"]*"|[^ \t]*) *(.*)$', rol)
+ if a:
+ value = a.group (1)
+ rol = a.group ( 2)
+ if keyword == 'clef':
+ check_clef(value)
+ elif keyword == "name":
+ value = re.sub ('\\\\','\\\\\\\\', value)
+ voices_append ("\\set Staff.instrument = %s\n" % value )
+ __main__.part_names = 1
+ elif keyword == "sname" or keyword == "snm":
+ voices_append ("\\set Staff.instr = %s\n" % value )
+
+ else:
+ break
+
+ return
+
def dump_header (outf,hdr):
outf.write ('\\header {\n')
"""
Nowadays abc2ly outputs explicits barlines (?)
"""
- ## < 2.2
- ##outf.write ("\n\\property Score.defaultBarType = \"empty\"\n")
- outf.write ("\n\\set Score.defaultBarType = \"empty\"\n")
+ outf.write ("\n\\set Score.defaultBarType=\"empty\"\n")
def dump_slyrics (outf):
\notes <<
""")
- ks = voice_idx_dict.keys ();
+ ks = voice_idx_dict.keys ();
ks.sort ()
for k in ks:
if re.match('[1-9]', k):
}
def lily_key (k):
- orig = "" + k
- # UGR
k = string.lower (k)
key = k[0]
- #UGH
k = k[1:]
if k and k[0] == '#':
key = key + 'is'
return '%s \\major' % key
type = k[0:3]
- if not key_lookup.has_key (type):
- #ugh, use lilylib, say WARNING:FILE:LINE:
- sys.stderr.write ("abc2ly:warning:")
- sys.stderr.write ("ignoring unknown key: `%s'" % orig)
- sys.stderr.write ('\n')
- return 0
- return ("%s \\%s" % ( key, key_lookup[type]))
-
-def shift_key (note, acc, shift):
- s = semitone_pitch((note, acc))
- s = (s + shift + 12) % 12
- if s <= 4:
- n = s / 2
- a = s % 2
- else:
- n = (s + 1) / 2
- a = (s + 1) % 2
- if a:
- n = n + 1
- a = -1
- return (n,a)
+ if key_lookup.has_key(type):
+ return("%s \\%s" % ( key, key_lookup[type]))
+ sys.stderr.write("Unknown key type `%s' ignored\n" % type)
+ return key
+
+def shift_key (note, acc , shift):
+ s = semitone_pitch((note, acc))
+ s = (s + shift + 12) % 12
+ if s <= 4:
+ n = s / 2
+ a = s % 2
+ else:
+ n = (s + 1) / 2
+ a = (s + 1) % 2
+ if a:
+ n = n + 1
+ a = -1
+ return (n,a)
key_shift = { # semitone shifts for key mode names
'm' : 3,
def try_parse_group_end (str, state):
if str and str[0] in HSPACE:
str = str[1:]
- close_beam_state(state)
return str
def header_append (key, a):
else:
stuff [idx] = wordwrap(a, stuff[idx])
-# ignore wordwrap since we are adding to the previous word
-def stuff_append_back(stuff, idx, a):
- if not stuff:
- stuff.append (a)
- else:
- point = len(stuff[idx])-1
- while stuff[idx][point] is ' ':
- point = point - 1
- point = point +1
- stuff[idx] = stuff[idx][:point] + a + stuff[idx][point:]
+
def voices_append(a):
if current_voice_idx < 0:
select_voice ('default', '')
stuff_append (voices, current_voice_idx, a)
-# word wrap really makes it hard to bind beams to the end of notes since it
-# pushes out whitespace on every call. The _back functions do an append
-# prior to the last space, effectively tagging whatever they are given
-# onto the last note
-def voices_append_back(a):
- if current_voice_idx < 0:
- select_voice ('default', '')
- stuff_append_back(voices, current_voice_idx, a)
-
def repeat_prepend():
global repeat_state
if current_voice_idx < 0:
if a == 'C':
if not state.common_time:
state.common_time = 1
- voices_append ("\\property Staff.TimeSignature \\override #\'style = #'C\n")
+ voices_append ("\\override Staff.TimeSignature #\'style = #'C\n")
a = '4/4'
if a == 'C|':
if not state.common_time:
state.common_time = 1
- voices_append ("\\property Staff.TimeSignature \\override #\'style = #'C\n")
+ voices_append ("\\override Staff.TimeSignature #\'style = #'C\n")
a = '2/2'
if not length_specified:
set_default_len_from_time_sig (a)
else:
key_info = m.group(1)
clef_info = m.group(2)
- __main__.global_key = compute_key (key_info)
- k = lily_key (key_info)
- if k:
- voices_append ('\\key %s' % k)
+ __main__.global_key = compute_key (key_info)# ugh.
+ voices_append ('\\key %s' % lily_key(key_info))
check_clef(clef_info)
else:
- __main__.global_key = compute_key (a)
- k = lily_key (a)
- if k:
- voices_append ('\\key %s \\major' % k)
+ __main__.global_key = compute_key (a)# ugh.
+ voices_append ('\\key %s \\major' % lily_key(a))
if g == 'N': # Notes
header ['footnotes'] = header['footnotes'] + '\\\\\\\\' + a
if g == 'O': # Origin
self.plus_chord = 0
self.base_octave = 0
self.common_time = 0
- self.parsing_beam = 0
del state.in_acc[k]
-# if we are parsing a beam, close it off
-def close_beam_state(state):
- if state.parsing_beam and preserve_beams:
- state.parsing_beam = 0
- voices_append_back( ']' )
-
# WAT IS ABC EEN ONTZETTENDE PROGRAMMEERPOEP !
def try_parse_note (str, parser_state):
if c == '_':
acc = -1
- octave = parser_state.base_octave
+ octave = parser_state.base_octave
if str[0] in "ABCDEFG":
str = string.lower (str[0]) + str[1:]
octave = octave - 1
if slur_end:
voices_append ('-)' *slur_end )
- if preserve_beams and \
- str[0] in '^=_ABCDEFGabcdefg' and \
- not parser_state.parsing_beam and \
- not parser_state.parsing_tuplet:
- parser_state.parsing_beam = 1
- voices_append_back( '[' )
-
+
+
return str
-def junk_space (str,state):
- while str and str[0] in '\t\n\r ':
+def junk_space (str):
+ while str and str[0] in '\t\n ':
str = str[1:]
- close_beam_state(state)
return str
if str:
str = str[1:]
gc = re.sub('#', '\\#', gc) # escape '#'s
- state.next_articulation = ("%c\"%s\"" % (position, gc)) \
- + state.next_articulation
+ state.next_articulation = ("%c\"%s\"" % (position ,gc)) + state.next_articulation
return str
def try_parse_escape (str):
state.next_bar = '|\n'
str = str[1:]
clear_bar_acc(state)
- close_beam_state(state)
if bs <> None or state.next_bar != '':
if state.parsing_tuplet:
if bs <> None:
clear_bar_acc(state)
- close_beam_state(state)
voices_append (bs)
if do_curly != '':
voices_append("} }")
#write other kinds of appending if we ever need them.
return str
-lineno = 0
happy_count = 100
def parse_file (fn):
f = open (fn)
ls = f.readlines ()
- ls = map (lambda x: re.sub ("\r$", '', x), ls)
select_voice('default', '')
- global lineno
lineno = 0
sys.stderr.write ("Line ... ")
sys.stderr.flush ()
ln = try_parse_tuplet_begin (ln, state)
ln = try_parse_group_end (ln, state)
ln = try_parse_grace_delims (ln, state)
- ln = junk_space (ln, state)
+ ln = junk_space (ln)
if ln:
error ("%s: %d: Huh? Don't understand\n" % (fn, lineno))
-o, --output=FILE set output filename to FILE
-v, --version show version information
-s, --strict be strict about succes
- -b, --beams preserve ABC's notion of beams
This program converts ABC music files (see
http://www.gre.ac.uk/~c.walshaw/abc2mtex/abc.txt) to LilyPond input.
-(options, files) = getopt.getopt (sys.argv[1:], 'vo:hsb', ['help','version', 'output=', 'strict', 'beams'])
+(options, files) = getopt.getopt (sys.argv[1:], 'vo:hs', ['help','version', 'output=', 'strict'])
out_filename = ''
for opt in options:
strict = 1
elif o == '--output' or o == '-o':
out_filename = a
- elif o == '--beams' or o == '-b':
- preserve_beams = 1
else:
print o
raise getopt.error
outf = open (out_filename, 'w')
# dump_global (outf)
- dump_header (outf, header)
+ dump_header (outf ,header)
dump_slyrics (outf)
dump_voices (outf)
dump_score (outf)
def func(match):
return "#'font-size = #%d" % (2*string.atoi (match.group (1)))
- str =re.sub (r"#'font-relative-size\s*=\s*#\+?([0-9-]+)", func, str)
+ str =re.sub (r"#'font-relative-size\s*=\s*#([0-9-]+)", func, str)
str =re.sub (r"#'font-family\s*=\s*#'ancient",
r"#'font-family = #'music", str)
elif o >= 0:
str += "'" * (o + 1)
- return '\\transposition %s ' % str
+ return '\\tuning %s ' % str
str = re.sub (r"\\set ([A-Za-z]+\s*\.\s*)?transposing\s*=\s*#([-0-9]+)",
conversions.append (((2,2, 0), conv,
'''clean up version. '''))
-def conv (str):
- return re.sub (r'\\apply\b', r'\\applymusic', str)
-
-conversions.append (((2, 3, 1), conv,
- '''\\apply -> \\applymusic'''))
-
-def conv (str):
- str = re.sub (r'\\OrchestralScoreContext', '\\Score', str)
- def func(m):
- if m.group(1) not in ['RemoveEmptyStaff',
- 'AncientRemoveEmptyStaffContext',
- 'EasyNotation']:
- return '\\' + m.group (1)
- else:
- return m.group (0)
-
-
- str = re.sub (r'\\([a-zA-Z]+)Context\b', func, str)
-
- str = re.sub ('ly:paper-lookup', 'ly:output-def-lookup', str)
- return str
-
-conversions.append (((2, 3, 2), conv,
- '''\\FooContext -> \\Foo'''))
-
-def conv (str):
- str = re.sub (r'\\notes\b', '', str)
-
- return str
-
-conversions.append (((2, 3, 4), conv,
- '''remove \\notes'''))
-
################################
# END OF CONVERSIONS
################################
#!@PYTHON@
'''
+TODO:
+ ly-options: intertext, quote ?
+ --linewidth?
+ eps in latex?
+ check latex parameters, twocolumn, multicolumn?
+
Example usage:
test:
classic lilypond-book:
lilypond-book --process="lilypond-bin" BOOK.tely
-TODO:
- * ly-options: intertext ?
- * --linewidth?
- * eps in latex / eps by lilypond-bin -fps ?
- * check latex parameters, twocolumn, multicolumn?
-
- * Converting from lilypond-book source, substitute:
- @mbinclude foo.itely -> @include foo.itely
- \mbinput -> \input
-
+ must substitute:
+ @mbinclude foo.itely -> @include foo.itely
+ \mbinput -> \input
+
'''
import __main__
use_hash_p = 1
format = 0
output_name = 0
-latex_filter_cmd = 'latex "\\nonstopmode \input /dev/stdin"'
+# Ugh, hard coded file name! Unfortunately tempfile.mktemp doesn't
+# give a useful file in Cygwin. Also, the original version,
+# 'latex "\\nonstopmode \input /dev/stdin"' doesn't work in Cygwin.
+latex_filter_cmd = 'cat > lily-tmp.tex; latex "\\nonstopmode \input lily-tmp.tex";rm lily-tmp.tex'
filter_cmd = 0
process_cmd = lilypond_binary
default_ly_options = {}
indent = 0.0\mm''',
NOTIME : r'''
\context {
- \Staff
+ \StaffContext
\remove Time_signature_engraver
}''',
QUOTE : r'''
},
}
-PREAMBLE_LY = r'''%%%% Generated by %(program_name)s
-%%%% Options: [%(option_string)s]
-#(define toplevel-score-handler ly:parser-print-score)
+PREAMBLE_LY = r'''%% Generated by %(program_name)s
+%% Options: [%(option_string)s]
%(preamble_string)s
\paper {%(paper_string)s
}
'''
-FRAGMENT_LY = r'''
- %(notes_string)s{
+FRAGMENT_LY = r'''\score{
+ \notes%(notes_string)s{
%(code)s }
-'''
+}'''
FULL_LY = '%(code)s'
texinfo_linewidths = {
m = re.match ('([0-9]+)pt', o)
if m:
return 'staffsize=%s' % m.group (1)
- m = re.match ('indent=([-.0-9]+)(cm|in|mm|pt|staffspace)', o)
+ m = re.match ('indent=([-.0-9]+)(cm|in|mm|pt)', o)
if m:
f = float (m.group (1))
return 'indent=%f\\%s' % (f, m.group (2))
- m = re.match ('linewidth=([-.0-9]+)(cm|in|mm|pt|staffspace)', o)
+ m = re.match ('linewidth=([-.0-9]+)(cm|in|mm|pt)', o)
if m:
f = float (m.group (1))
return 'linewidth=%f\\%s' % (f, m.group (2))
if QUOTE in options and LINEWIDTH in options:
options.remove (LINEWIDTH)
- m = re.search (r'''\\(header|score)''', code)
+ m = re.search (r'''\\score''', code)
if not m and (not options \
or not NOFRAGMENT in options or FRAGMENT in options):
if RAGGEDRIGHT not in options:
# Redirect to stderr
cmd = '(( %s >&2 ) >&- )' % cmd
ly.system (cmd)
- ly.system ('dvips -Ppdf -u+ec-mftrace.map -u+lilypond.map -E -o %s.eps %s' \
+ ly.system ('dvips -Ppdf -u+lilypond.map -E -o %s.eps %s' \
% (file, file))
if re.search ("^%%Pages: ", f.readline ()):
# make non EPS.
- ly.system ('dvips -Ppdf -u+ec-mftrace.map -u+lilypond.map -o %s.eps %s' \
+ ly.system ('dvips -Ppdf -u+lilypond.map -o %s.eps %s' \
% (file, file))
break
if format == HTML or format == TEXINFO:
for i in names:
- if not os.path.exists (i + '.eps') and os.path.exists (i + '.tex'):
+ if os.path.exists (i + '.tex'):
to_eps (i)
ly.make_ps_images (i + '.eps', resolution=110)
-# elif os.path.exists (i + '.ps'):
-# ly.make_ps_images (i + '.ps', resolution=110)
-
LATEX_DOCUMENT = r'''
%(preamble)s
#!@PYTHON@
-# lilypond.py -- frontend for lilypond-bin
#
+# lilypond.py -- Run LilyPond, add titles to bare score, generate printable
+# document
+# Invokes: lilypond-bin, latex (or pdflatex), dvips, ps2pdf, gs
+#
# source file of the GNU LilyPond music typesetter
#
# (c) 1998--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
# Jan Nieuwenhuizen <janneke@gnu.org>
-#
-# Run lilypond-bin, generate printable document
-# Invokes: lilypond-bin, latex (or pdflatex), dvips, ps2pdf, gs
-#
-# This is the third incarnation of ly2dvi, renamed to lilypond.
+# This is the third incarnation of ly2dvi, now renamed lilypond.
#
-# Earlier incarnations of ly2dvi were written by
-# Jeffrey B. Reed<daboys@austin.rr.com> (Python versioan)
+# Earlier incarnations of lilypond were written by
+# Jeffrey B. Reed<daboys@austin.rr.com> (Python version)
# Jan Arne Fagertun <Jan.A.Fagertun@@energy.sintef.no> (Bourne shell script)
#
'''
TODO:
- * cleanup
-
* figure out which set of command line options should make lilypond:
na: create tex only?
etc.
+ * move versatile taglines,
+
+ \header {
+ beginfooter=\mutopiaPD
+ endfooter=\tagline -> 'lily was here <version>'
+ }
+
+ lilytagline (->lily was here), usertagline, copyright, lily-version
+ etc.
+
+ * head/header tagline/endfooter
+
* dvi from lilypond .tex output? This is hairy, because we create dvi
from lilypond .tex *and* header output.
+ * multiple \score blocks?
+
+ * Introduce verbosity levels
+
+ 0 = QUIET: mute all command output, no lilypond progress
+ 1 = BRIEF: mute all command output, only lilypond progress
+ 2a = NORMAL: show only LilyPond command output, show lilypond progress
+ 2b = NORMAL: show command output, show lilypond progress
+ 3 = VERBOSE: show command output, run lilypond --verbose
+ 4 = DEBUGGING: show all command output, run lilypond --verbose, print
+ environment and all kinds of client side debugging stuff
+
+ Currently, we only have 1 and 4, but we kludge to have 2a and 4.
'''
import operator
# lilylib globals
program_name = 'lilypond'
program_version = '@TOPLEVEL_VERSION@'
-# input without \book, use classic latex definitions
-classic_p = 0
verbose_p = 0
pseudo_filter_p = 0
original_dir = os.getcwd ()
preview_resolution = 90
debug_p = 0
-TEX_PREAMBLE = '%%%% Generated by %(program_name)s (v%(program_version)s)' \
- % vars ()
-
## FIXME
## do -P or -p by default?
##help_summary = _ ("Run LilyPond using LaTeX for titling")
-help_summary = _ ("Run LilyPond, generate printable document.")
+help_summary = _ ("Run LilyPond, add titles, generate printable document.")
copyright = ('Han-Wen Nienhuys <hanwen@cs.uu.nl',
'Jan Nieuwenhuizen <janneke@gnu.org')
option_definitions = [
+ ('', 'd', 'dependencies',
+ _ ("write Makefile dependencies for every input file")),
('', 'h', 'help', _ ("print this help")),
('', '', 'debug', _ ("print even more output")),
(_ ("FILE"), 'f', 'find-pfa', _ ("find pfa fonts used in FILE")),
safe_mode_p = 0
preview_p = 0
page_images_p = 0
-
-# need global variable. sys.exit() raises an exception, which is handled
-# to do cleanups.
lilypond_error_p = 0
html_p = 0
lilypond_binary = 'lilypond-bin'
-## Init to empty; values here take precedence over values in the file
+layout_fields = ['dedication', 'title', 'subtitle', 'subsubtitle',
+ 'footer', 'head', 'composer', 'arranger', 'instrument',
+ 'opus', 'piece', 'metre', 'meter', 'poet', 'texttranslator']
+
+
+# init to empty; values here take precedence over values in the file
+
+## TODO: change name.
extra_init = {
+ 'fontencoding' : [],
+ 'inputencoding' : ['latin1'],
'language' : [],
'latexheaders' : [],
- 'latexoptions' : [],
- 'latexpackages' : [],
+ 'latexpackages' : ['geometry'],
+
+ # for geometry v3
+ 'latexoptions' : ['compat2'],
+
+ 'papersize' : [],
+ 'pagenumber' : [1],
+ 'textheight' : [],
'linewidth' : [],
'orientation' : [],
- 'papersize' : [],
'unit' : ['pt'],
}
-header_fields = extra_init.keys ()
+extra_fields = extra_init.keys ()
+fields = layout_fields + extra_fields
include_path = ['.']
lily_p = 1
# Output formats that lilypond should create
targets = ['DVI', 'LATEX', 'MIDI', 'TEX', 'PDF', 'PS']
+track_dependencies_p = 0
dependency_files = []
#what a name.
def escape_shell (x):
return re.sub ("(\s|[`'\"\\\\])", r'\\\1',x)
+
def run_lilypond (files, dep_prefix):
-
def make_include_option (x):
return '-I %s' % escape_shell (x)
-
- opts = ' ' + string.join (map (make_include_option, include_path))
-
- ## UGHr
+
+ opts = ''
+ opts = opts + ' ' + string.join (map (make_include_option, include_path))
if pseudo_filter_p:
- opts += ' --output=lelie'
+ opts = opts + ' --output=lelie'
if paper_p:
- opts += ' ' + string.join (map (lambda x : '--header=' + x,
- header_fields))
+ opts = opts + ' ' + string.join (map (lambda x : '-H ' + x,
+ fields))
else:
opts = opts + ' --no-paper'
+
if pdftex_p:
opts = opts + ' -f pdftex'
+
if safe_mode_p:
opts = opts + ' --safe-mode'
+ if track_dependencies_p:
+ opts = opts + " --dependencies"
+ if dep_prefix:
+ opts = opts + ' --dep-prefix=%s' % dep_prefix
+
fs = string.join (map (escape_shell, files))
global verbose_p
if len (files) == 1:
ly.error (_ ("LilyPond failed on input file %s (exit status %d)") % (files[0], exit_status))
lilypond_error_p = 1
- ly.exit (1)
+ ly.exit (status)
else:
ly.error (_ ("LilyPond failed on an input file (exit status %d)") % exit_status)
ly.error (_ ("Continuing..."))
# search only the first 10k
s = s[:10240]
- for x in header_fields:
- m = re.search (r'\\def\\lilypondpaper%s{([^}]*)}' % x, s)
+ for x in extra_fields:
+ m = re.search (r'\\def\\lilypondpaper%s{([^}]*)}'%x, s)
if m:
set_setting (extra, x, m.group (1))
-
- global classic_p
- if s.find ('\\def\\lilypondclassic{1}') >= 0:
- classic_p = 1
-
ly.progress ('\n')
def find_tex_files_for_base (base, extra):
+ '''
+ Find the \header fields dumped from BASE.
+ '''
+
+ headerfiles = {}
+ for f in layout_fields:
+ fn = base + '.' + f
+ if os.path.exists (fn):
+ headerfiles[f] = fn
if os.path.exists (base +'.dep'):
dependency_files.append (base + '.dep')
- for f in header_fields:
+ for f in extra_fields:
fn =base + '.' + f
if os.path.exists (fn):
extra[f].append (open (fn).read ())
- return (base + tex_extension, {})
+ return (base + tex_extension, headerfiles)
def find_tex_files (files, extra):
def one_latex_definition (defn, first):
s = '\n'
- for (k, v) in defn[1].items ():
+ for (k,v) in defn[1].items ():
val = open (v).read ()
if (string.strip (val)):
s += r'''\def\lilypond%s{%s}''' % (k, val)
s += r'''\let\lilypond%s\relax''' % k
s += '\n'
- if classic_p and not first:
- s += '\interscoreline'
-
- s += '%%PREVIEW%%\n'
- s += '\\input %s\n' % defn[0]
+ if first:
+ s += '\\def\\mustmakelilypondtitle{}\n'
+ else:
+ s += '\\def\\mustmakelilypondpiecetitle{}\n'
+
+ s += '\\input %s\n' % defn[0] # The final \n seems important here. It ensures that the footers and taglines end up on the right page.
return s
-
-## FIXME: copied from tex/lilyponddefs.tex
-LATEX_PREAMBLE = '''
-%% Nullify [La]TeX page layout settings, page layout by LilyPond.
-\\topmargin-1in
-\\headheight0pt\\headsep0pt
-\\oddsidemargin-1in
-\\evensidemargin\oddsidemargin
-\\parindent 0pt'''
-
-CLASSIC_LATEX_PREAMBLE = '''
-%% FIXME: cannot do this, dimens in header part of lilypond output
-%% Center staves horizontally on page
-\\ifdim\\lypylinewidth\\lypyunit > 0pt
-\\hsize\\lypylinewidth\\lypyunit
-\\newdimen\\lypytempdim
-\\lypytempdim\\paperwidth
-\\advance\\lypytempdim-\\the\\hsize
-\\lypytempdim0.5\\lypytempdim
-\\advance\\lypytempdim -1in
-\\oddsidemargin\\lypytempdim
-\\evensidemargin\\lypytempdim
-\\fi
-\\parindent 0pt'''
+ly_paper_to_latexpaper = {
+ 'letter' : 'letterpaper',
+ 'a3' : 'a3paper',
+ 'a4' : 'a4paper',
+ 'a5' : 'a5paper',
+ 'a6' : 'a6paper',
+ 'legal' : 'legalpaper',
+ 'tabloid' : 'papersize={11in,17in}',
+}
+
+#TODO: should set textheight (enlarge) depending on papersize.
def global_latex_preamble (extra):
'''construct preamble from EXTRA,'''
-
- s = TEX_PREAMBLE
- s += '\n'
+ s = ""
+ s += '% generation tag\n'
options = ''
if safe_mode_p:
s += '\\nofiles\n'
- if classic_p:
- if extra['linewidth']:
- s += '\\def\\lypylinewidth{%s}\n' \
- % extra['linewidth'][-1]
- else:
- s += '\\let\\lypylinewidth\\texwidth\n'
- s += '\\def\\lypyunit{%s}\n' % extra['unit'][-1]
+ s += '\\usepackage{%s}\n' % string.join (extra['latexpackages'], ',')
if extra['language']:
- s += '\\usepackage[%s]{babel}' % extra['language'][-1] + '\n'
+ s += r'\usepackage[%s]{babel}' % extra['language'][-1] + '\n'
+
+ if extra['fontencoding']:
+ s += '\\usepackage[%s]{fontenc}\n' % extra['fontencoding'][-1]
- s += '\\usepackage{%s}\n' \
- % string.join (extra['latexpackages'], ',')
+ if extra['inputencoding']:
+ s += '\\usepackage[%s]{inputenc}\n' % extra['inputencoding'][-1]
if extra['latexheaders']:
s += '\\include{%s}\n' \
unit = extra['unit'][-1]
- # FIXME, must (only) from lilypond-bin
+ papersize = ''
+ if extra['papersize']:
+ try:
+ papersize = ly_paper_to_latexpaper[extra['papersize'][0]] + ','
+ except KeyError:
+ ly.warning (_ ("invalid value: `%s'") % `extra['papersize'][0]`)
+ pass
+
+ textheight = ''
+ if extra['textheight']:
+ textheight = ',textheight=%f%s' % (extra['textheight'][0], unit)
+
+ orientation = 'portrait'
+ if extra['orientation']:
+ orientation = extra['orientation'][0]
+
+ # set sane geometry width (a4-width) for linewidth = -1.
+ maxlw = max (extra['linewidth'] + [-1])
+ if maxlw < 0:
+ # who the hell is 597 ?
+ linewidth = '597pt'
+ else:
+ linewidth = '%d%s' % (maxlw, unit)
+ s += '\geometry{%swidth=%s%s,bottom=11mm,headsep=2mm,top=12mm,headheight=2mm,footskip=5mm,%s}\n' % (papersize, linewidth, textheight, orientation)
+
+
+ if 'twoside' in extra['latexoptions'] :
+ s += '\geometry{twosideshift=4mm}\n'
+
s += r'''
-\usepackage{inputenc}
-\pagestyle{empty}
-%%PREVIEW%%'''
+\input{titledefs}
+'''
- if classic_p:
- s += CLASSIC_LATEX_PREAMBLE
+ if extra['pagenumber'] and extra['pagenumber'][-1] and extra['pagenumber'][-1] != 'no':
+ s += '\setcounter{page}{%d}\n' % (extra['pagenumber'][-1])
+ s += '\\pagestyle{plain}\n'
else:
- s += LATEX_PREAMBLE
+ s += '\\pagestyle{empty}\n'
+
+
return s
def global_latex_definition (tfiles, extra):
'''construct preamble from EXTRA, dump Latex stuff for each
lily output file in TFILES after that, and return the Latex file constructed. '''
+
+
s = global_latex_preamble (extra) + '\\begin{document}\n'
- s += '\\parindent 0pt'
+ s += '\\parindent 0pt\n'
+ s += '\\thispagestyle{firstpage}\n'
first = 1
for t in tfiles:
s += one_latex_definition (t, first)
first = 0
- s += '\\end{document}\n'
+
+
+ s += '\n\\thispagestyle{lastpage}\n'
+ s += '\\end{document}'
+
return s
def run_latex (files, outbase, extra):
+
'''Construct latex file, for FILES and EXTRA, dump it into
-OUTBASE.latex. Run LaTeX on it.
-'''
+OUTBASE.latex. Run LaTeX on it.
+
+RETURN VALUE
+
+None
+ '''
latex_fn = outbase + '.latex'
preview_base = ly.strip_extension (score[0], '.tex')
preview_fn = preview_base + '.preview.tex'
s = global_latex_definition ((score,), extra)
- s = re.sub ('%%PREVIEW%%',
- r'''\def\interscoreline{\endinput}''', s)
+ s = re.sub ('thispagestyle{firstpage}',
+ r'''thispagestyle{empty}%
+ \\def\\interscoreline{\\endinput}''', s)
+ s = re.sub ('thispagestyle{lastpage}',
+ r'''thispagestyle{empty}%
+ \\def\\interscoreline{\\endinput}''', s)
f = open (preview_fn, 'w')
f.write (s)
f.close ()
def run_dvips (outbase, extra):
+
+
'''Run dvips using the correct options taken from EXTRA,
leaving a PS file in OUTBASE.ps
+
+RETURN VALUE
+
+None.
'''
- #FIXME: papersize, orientation must come from lilypond-bin
opts = ''
if extra['papersize']:
- opts = ' -t%s' % extra['papersize'][0]
-
+ opts = opts + ' -t%s' % extra['papersize'][0]
+
if extra['orientation'] and extra['orientation'][0] == 'landscape':
opts = opts + ' -tlandscape'
+
if 'PDF' in targets:
where = ly.read_pipe ('kpsewhich feta20.pfa').strip()
pass
if pfa_file:
- #opts = opts + ' -Ppdf -G0 -u +lm.map -u +lilypond.map'
- opts = opts + ' -Ppdf -G0 -u +ec-mftrace.map -u +lilypond.map'
+ opts = opts + ' -Ppdf -G0 -u +lilypond.map'
else:
ly.warning (_ ('''Trying create PDF, but no PFA fonts found.
Using bitmap fonts instead. This will look bad.'''))
if preview_p:
for score in find_tex_files (files, extra):
preview_base = ly.strip_extension (score[0], '.tex')
- cmd = 'dvips -E -Ppdf -u+ec-mftrace.map -u+lilypond.map -o%s %s' \
+ cmd = 'dvips -E -Ppdf -u+lilypond.map -o%s %s' \
% (preview_base + '.preview.ps',
preview_base + '.preview.dvi')
ly.system (cmd)
if name in os.listdir (d):
return os.path.join (d, name)
+# Added as functionality to lilypond, because lilypond may well need to do this
+# in future too.
+PS = '%!PS-Adobe'
def find_pfa_fonts (name):
- PS = '%!PS-Adobe'
s = open (name).read ()
if s[:len (PS)] != PS:
# no ps header?
pages = filter (lambda x : re.search ('page[0-9]+.png', x),
files_found)
- rest = filter (lambda x : not re.search ('page[0-9]+.png', x),
+ rest = filter (lambda x : not re.search ('page[0-9]+.png', x),
files_found)
preview = filter (lambda x: re.search ('.png$', x), rest)
elif o == '--set' or o == '-S':
ss = string.split (a, '=')
set_setting (extra_init, ss[0], ss[1])
+ elif o == '--dependencies' or o == '-d':
+ track_dependencies_p = 1
elif o == '--verbose' or o == '-V':
verbose_p = 1
elif o == '--version' or o == '-v':
dep_prefix = 0
reldir = os.path.dirname (output_name)
- if outdir != '.' and targets:
+ if outdir != '.' and (track_dependencies_p or targets):
ly.mkdir_p (outdir, 0777)
tmpdir = ly.setup_temp ()
os.environ['openout_any'] = 'p'
# to be sure, add tmpdir *in front* of inclusion path.
- #os.environ['TEXINPUTS'] = tmpdir + ':' + os.environ['TEXINPUTS']
+ #os.environ['TEXINPUTS'] = tmpdir + ':' + os.environ['TEXINPUTS']
os.chdir (tmpdir)
# We catch all exceptions, because we need to do stuff at exit:
### this should only catch lilypond nonzero exit status
### --hwn
+
# TODO: friendly message about LilyPond setup/failing?
#
targets = []
resolution = preview_resolution
)
+ # add DEP to targets?
+ if track_dependencies_p:
+ depfile = os.path.join (outdir, outbase + '.dep')
+ generate_dependency_file (depfile, depfile)
+ if os.path.isfile (depfile):
+ ly.progress (_ ("dependencies output to `%s'...") %
+ depfile)
+ ly.progress ('\n')
+
if pseudo_filter_p:
main_target = 0
for i in 'PDF', 'PS', 'PNG', 'DVI', 'LATEX':
files = ['-']
for f in files:
- h = None
+
if f == '-':
h = sys.stdin
elif f and not os.path.isfile (f):
--- /dev/null
+#!@PYTHON@
+# vim: set noexpandtab:
+
+"""
+
+ TODO:
+ * junk --outdir for--output
+ * Figure out clean set of options.
+ *
+ * texinfo: add support for @pagesize
+
+ todo: dimension handling (all the x2y) is clumsy. (tca: Thats
+ because the values are taken directly from texinfo.tex,
+ geometry.sty and article.cls. Give me a hint, and I'll
+ fix it.)
+
+
+ TODO: magnification support should also work for texinfo -> html: eg. add as option to dvips.
+
+
+
+ This is a slightly hairy program. The general approach is as follows
+ The input string is chopped up in chunks, i.e. , a list of tuples
+
+ with the format (TAG_STR, MAIN_STR, OPTIONS, TODO, BASE)
+
+ This list is built step by step: first ignore and verbatim commands
+ are handled, delivering a list of chunks.
+
+ then all chunks containing lilypond commands are chopped up
+
+ when all chunks have their final form, all bodies from lilypond blocks are
+ extracted, and if applicable, written do disk and run through lilypond.
+
+
+tags supported
+
+ ignore
+ lilypond
+ input
+ verb
+ verbatim
+ multicols
+ numcols
+
+
+
+
+"""
+
+# This is was the idea for handling of comments:
+# Multiline comments, @ignore .. @end ignore is scanned for
+# in read_doc_file, and the chunks are marked as 'ignore', so
+# lilypond-book will not touch them any more. The content of the
+# chunks are written to the output file. Also 'include' and 'input'
+# regex has to check if they are commented out.
+#
+
+# Then it is scanned for 'lilypond', 'lilypond-file' and 'lilypond-block'.
+# These three regex's has to check if they are on a commented line,
+# % for latex, @c for texinfo.
+#
+# Then lines that are commented out with % (latex) and @c (Texinfo)
+# are put into chunks marked 'ignore'. This cannot be done before
+# searching for the lilypond-blocks because % is also the comment character
+# for lilypond.
+#
+# The the rest of the rexeces are searched for. They don't have to test
+# if they are on a commented out line.
+
+import glob
+import stat
+import string
+
+
+################################################################
+# Users of python modules should include this snippet
+# and customize variables below.
+
+# We'll suffer this path init stuff as long as we don't install our
+# python packages in <prefix>/lib/pythonx.y (and don't kludge around
+# it as we do with teTeX on Red Hat Linux: set some environment var
+# (PYTHONPATH) in profile)
+
+# If set, LILYPONDPREFIX must take prevalence
+# if datadir is not set, we're doing a build and LILYPONDPREFIX
+import getopt, os, sys
+datadir = '@local_lilypond_datadir@'
+if not os.path.isdir (datadir):
+ datadir = '@lilypond_datadir@'
+if os.environ.has_key ('LILYPONDPREFIX') :
+ datadir = os.environ['LILYPONDPREFIX']
+ while datadir[-1] == os.sep:
+ datadir= datadir[:-1]
+
+sys.path.insert (0, os.path.join (datadir, 'python'))
+
+# Customize these
+#if __name__ == '__main__':
+
+import lilylib as ly
+global _;_=ly._
+global re;re = ly.re
+
+# lilylib globals
+program_version = '@TOPLEVEL_VERSION@'
+program_name = 'lilypond-book'
+verbose_p = 0
+pseudo_filter_p = 0
+original_dir = os.getcwd ()
+
+
+preview_resolution = 90
+
+## FIXME
+## do -P or -p by default?
+##help_summary = _ ("Run LilyPond using LaTeX for titling")
+help_summary = _ ("Process LilyPond snippets in hybrid HTML, LaTeX or texinfo document")
+copyright = ('Tom Cato Amundsen <tca@gnu.org>',
+ 'Han-Wen Nienhuys <hanwen@cs.uu.nl>')
+
+option_definitions = [
+ (_ ("EXT"), 'f', 'format', _ ("use output format EXT (texi [default], texi-html, latex, html)")),
+ (_ ("DIM"), '', 'default-music-fontsize', _ ("default fontsize for music. DIM is assumed to be in points")),
+ (_ ("DIM"), '', 'default-lilypond-fontsize', _ ("deprecated, use --default-music-fontsize")),
+ (_ ("OPT"), '', 'extra-options', _ ("pass OPT quoted to the lilypond command line")),
+ (_ ("DIM"), '', 'force-music-fontsize', _ ("force fontsize for all inline lilypond. DIM is assumed to be in points")),
+ (_ ("DIM"), '', 'force-lilypond-fontsize', _ ("deprecated, use --force-music-fontsize")),
+ ('', 'h', 'help', _ ("print this help")),
+ (_ ("DIR"), 'I', 'include', _ ("include path")),
+ ('', 'M', 'dependencies', _ ("write dependencies")),
+ (_ ("PREF"), '', 'dep-prefix', _ ("prepend PREF before each -M dependency")),
+ ('', 'n', 'no-lily', _ ("don't run lilypond")),
+ ('', '', 'no-pictures', _ ("don't generate pictures")),
+ ('', '', 'no-music', _ ("strip all lilypond blocks from output")),
+ (_ ("FILE"), 'o', 'outname', _ ("filename main output file")),
+ (_ ("FILE"), '', 'outdir', _ ("where to place generated files")),
+ (_ ('RES'), '', 'preview-resolution',
+ _ ("set the resolution of the preview to RES")),
+ ('', 'V', 'verbose', _ ("be verbose")),
+ ('', 'v', 'version', _ ("print version information")),
+ ('', 'w', 'warranty', _ ("show warranty and copyright")),
+ ]
+
+# format specific strings, ie. regex-es for input, and % strings for output
+
+# global variables
+
+include_path = [os.getcwd ()]
+
+#lilypond_binary = 'valgrind --suppressions=/home/hanwen/usr/src/guile-1.6.supp --num-callers=10 /home/hanwen/usr/src/lilypond/lily/out/lilypond'
+
+lilypond_binary = os.path.join ('@bindir@', 'lilypond-bin')
+
+# only use installed binary when we're installed too.
+if '@bindir@' == ('@' + 'bindir@') or not os.path.exists (lilypond_binary):
+ lilypond_binary = 'lilypond-bin'
+
+
+
+ly2dvi_binary = os.path.join ('@bindir@', 'ly2dvi')
+
+# only use installed binary when we're installed too.
+if '@bindir@' == ('@' + 'bindir@') or not os.path.exists (lilypond_binary):
+ ly2dvi_binary = 'ly2dvi'
+
+
+
+g_extra_opts = ''
+g_here_dir = os.getcwd ()
+g_dep_prefix = ''
+g_outdir = ''
+g_force_music_fontsize = 0
+g_do_pictures = 1
+g_do_music = 1
+g_make_html = 0
+
+format = ''
+g_run_lilypond = 1
+no_match = 'a\ba'
+
+default_music_fontsize = 16
+default_text_fontsize = 12
+paperguru = None
+
+################################################################
+# Dimension handling for LaTeX.
+#
+class LatexPaper:
+ def __init__ (self):
+ self.m_document_preamble = []
+ self.m_num_cols = 1
+ self.m_multicols = 1
+
+ def find_latex_dims (self):
+ if g_outdir:
+ fname = os.path.join (g_outdir, "lily-tmp.tex")
+ else:
+ fname = "lily-tmp.tex"
+ try:
+ f = open (fname, "w")
+ except IOError:
+ error ("Error creating temporary file '%s'" % fname)
+
+ for s in self.m_document_preamble:
+ f.write (s)
+ f.write (r"""
+\begin{document}
+\typeout{---}
+\typeout{\columnsep \the\columnsep}
+\typeout{\textwidth \the\textwidth}
+\typeout{---}
+\end{document}
+ """)
+ f.close ()
+ re_dim = re.compile (r"\\(\w+)\s+(\d+\.\d+)")
+
+ cmd = "latex '\\nonstopmode \input %s'" % fname
+ # Ugh. (La)TeX writes progress and error messages on stdout
+ # Redirect to stderr
+ cmd = '(( %s >&2 ) >&- )' % cmd
+ status = ly.system (cmd, ignore_error = 1)
+ signal = 0xf & status
+ exit_status = status >> 8
+
+ if status:
+ ly.error (_ ("LaTeX failed."))
+ ly.error (_ ("The error log is as follows:"))
+
+ #URG see lilypond
+ try:
+ lns = open ('lily-tmp.log').readlines ()
+ except:
+ lns = ''
+ countdown = -3
+ for ln in lns:
+ sys.stderr.write (ln)
+ if re.match ('^!', ln):
+ countdown = 3
+
+ if countdown == 0:
+ break
+
+ if countdown > 0:
+ countdown = countdown -1
+
+ sys.stderr.write (" ... (further messages elided)...\n")
+ sys.exit (1)
+
+ lns = open ('lily-tmp.log').readlines ()
+ for ln in lns:
+ ln = string.strip (ln)
+ m = re_dim.match (ln)
+ if m:
+ if m.groups ()[0] in ('textwidth', 'columnsep'):
+ self.__dict__['m_%s' % m.groups ()[0]] = float (m.groups ()[1])
+
+ try:
+ os.remove (fname)
+ os.remove (os.path.splitext (fname)[0]+".aux")
+ os.remove (os.path.splitext (fname)[0]+".log")
+ except:
+ pass
+
+ if not self.__dict__.has_key ('m_textwidth'):
+ raise 'foo!'
+
+ def get_linewidth (self):
+ if self.m_num_cols == 1:
+ w = self.m_textwidth
+ else:
+ w = (self.m_textwidth - self.m_columnsep)/2
+ if self.m_multicols > 1:
+ return (w - self.m_columnsep* (self.m_multicols-1)) \
+ / self.m_multicols
+ return w
+
+
+class HtmlPaper:
+ def __init__ (self):
+ self.m_papersize = 'letterpaper'
+ self.m_fontsize = 12
+ def get_linewidth (self):
+ return html_linewidths[self.m_papersize][self.m_fontsize]
+
+class TexiPaper:
+ def __init__ (self):
+ self.m_papersize = 'letterpaper'
+ self.m_fontsize = 12
+ def get_linewidth (self):
+ return texi_linewidths[self.m_papersize][self.m_fontsize]
+
+def mm2pt (x):
+ return x * 2.8452756
+def in2pt (x):
+ return x * 72.26999
+def em2pt (x, fontsize = 10):
+ return {10: 10.00002, 11: 10.8448, 12: 11.74988}[fontsize] * x
+def ex2pt (x, fontsize = 10):
+ return {10: 4.30554, 11: 4.7146, 12: 5.16667}[fontsize] * x
+
+def pt2pt (x):
+ return x
+
+dimension_conversion_dict ={
+ 'mm': mm2pt,
+ 'cm': lambda x: mm2pt (10*x),
+ 'in': in2pt,
+ 'em': em2pt,
+ 'ex': ex2pt,
+ 'pt': pt2pt
+ }
+
+# Convert numeric values, with or without specific dimension, to floats.
+# Keep other strings
+def conv_dimen_to_float (value):
+ if type (value) == type (""):
+ m = re.match ("([0-9.]+)(cm|in|pt|mm|em|ex)",value)
+ if m:
+ unit = m.group (2)
+ num = string.atof (m.group (1))
+ conv = dimension_conversion_dict[m.group (2)]
+
+ value = conv (num)
+
+ elif re.match ("^[0-9.]+$",value):
+ value = float (value)
+
+ return value
+
+texi_linewidths = {
+ 'afourpaper': {12: mm2pt (160)},
+ 'afourwide': {12: in2pt (6.5)},
+ 'afourlatex': {12: mm2pt (150)},
+ 'smallbook': {12: in2pt (5)},
+ 'letterpaper': {12: in2pt (6)}}
+
+html_linewidths = {
+ 'afourpaper': {12: mm2pt (160)},
+ 'afourwide': {12: in2pt (6.5)},
+ 'afourlatex': {12: mm2pt (150)},
+ 'smallbook': {12: in2pt (5)},
+ 'letterpaper': {12: in2pt (6)}}
+
+
+################################################################
+# How to output various structures.
+output_dict= {
+
+
+ 'html' : {
+
+ 'output-filename' : r'''
+<!-- %s >
+<a href="%s">
+<pre>%s</pre></a>:''',
+ 'output-lilypond-fragment': '''<lilypond%s>
+\context Staff\context Voice{ %s }
+</lilypond>''',
+ 'output-noinline': r'''
+<!-- generated: %(fn)s.png !-->
+''',
+ ## maybe <hr> ?
+ 'pagebreak': None,
+ # Verbatim text is always finished with \n. FIXME: For HTML,
+ # this newline should be removed.
+ 'output-verbatim': r'''<pre>
+%s</pre>''',
+ # Verbatim text is always finished with \n. FIXME: For HTML,
+ # this newline should be removed.
+ 'output-small-verbatim': r'''<font size=-1><pre>
+%s</pre></font>''',
+ ## Ugh we need to differentiate on origin:
+ ## lilypond-block origin wants an extra <p>, but
+ ## inline music doesn't.
+ ## possibly other center options?
+ 'output-html': r'''
+%(htmlimages)s''',
+ },
+
+
+ 'latex': {
+
+ 'output-lilypond-fragment' : r'''\begin[singleline,%s]{lilypond}
+ \context Voice{
+ %s
+ }
+\end{lilypond}''',
+ 'output-filename' : r'''\verb+%s+:\\
+%% %s
+%% %s
+''',
+
+ # verbatim text is always finished with \n
+ 'output-verbatim': r'''\begin{verbatim}
+%s\end{verbatim}
+''',
+ # verbatim text is always finished with \n
+ 'output-small-verbatim': r'''{\small\begin{verbatim}
+%s\end{verbatim}}
+''',
+ 'output-default-post': "\\def\postLilyPondExample{}\n",
+ 'output-default-pre': "\\def\preLilyPondExample{}\n",
+ 'usepackage-graphics': '\\usepackage{graphics}\n',
+ 'output-eps': '\\noindent\includegraphics{%(fn)s}',
+ 'output-noinline': r'''
+%% generated: %(fn)s.eps
+''',
+ 'output-latex-quoted': r'''{\preLilyPondExample
+\def\lilypondbook{}
+\input %(fn)s.tex
+\postLilyPondExample}''',
+ 'output-latex-noquote': r'''{\parindent 0pt
+\preLilyPondExample
+\def\lilypondbook{}
+\input %(fn)s.tex
+\postLilyPondExample}''',
+ 'pagebreak': r'\pagebreak',
+ },
+
+
+ 'texi' : {
+
+
+ 'output-filename' : r'''
+@ifnothtml
+@file{%s}:@*
+@end ifnothtml
+@ifhtml
+@uref{%s,@file{%s}}
+@end ifhtml
+''',
+ 'output-lilypond-fragment': '''@lilypond[%s]
+\context Staff\context Voice{ %s }
+@end lilypond ''',
+ 'output-noinline': r'''
+@c generated: %(fn)s.png
+''',
+ 'pagebreak': None,
+ # verbatim text is always finished with \n
+ 'output-small-verbatim': r'''@smallexample
+%s@end smallexample
+''',
+ # verbatim text is always finished with \n
+ 'output-verbatim': r'''@example
+%s@end example
+''',
+ # do some tweaking: @ is needed in some ps stuff.
+ #
+ # ugh, the <p> below breaks inline images...
+ 'output-texi-noquote': r'''@tex
+\catcode`\@=12
+\parindent 0pt
+\def\lilypondbook{}
+\input %(fn)s.tex
+\catcode`\@=0
+@end tex
+@html
+<p>%(htmlimages)s
+<p>
+@end html
+''',
+ 'output-texi-quoted': r'''@quotation
+@tex
+\catcode`\@=12
+\def\lilypondbook{}
+\input %(fn)s.tex
+\catcode`\@=0
+@end tex
+@html
+<p>%(htmlimages)s
+<p>
+@end html
+@end quotation
+''',
+ }
+
+ }
+
+def output_verbatim (body, small):
+ global format
+ if format == 'html':
+ body = re.sub ('&', '&', body)
+ body = re.sub ('>', '>', body)
+ body = re.sub ('<', '<', body)
+ elif format == 'texi':
+ # clumsy workaround for python 2.2 pre bug.
+ body = re.sub ('@', '@@', body)
+ body = re.sub ('{', '@{', body)
+ body = re.sub ('}', '@}', body)
+
+ if small:
+ key = 'output-small-verbatim'
+ else:
+ key = 'output-verbatim'
+ return get_output (key) % body
+
+
+################################################################
+# Recognize special sequences in the input
+
+
+# Warning: This uses extended regular expressions. Tread with care.
+#
+# legenda
+#
+# (?P<name>regex) -- assign result of REGEX to NAME
+# *? -- match non-greedily.
+# (?m) -- multiline regex: make ^ and $ match at each line
+# (?s) -- make the dot match all characters including newline
+re_dict = {
+ 'html': {
+ 'include': no_match,
+ 'input': no_match,
+ 'header': no_match,
+ 'preamble-end': no_match,
+ 'landscape': no_match,
+ 'verbatim': r'''(?s)(?P<code><pre>\s.*?</pre>\s)''',
+ 'verb': r'''(?P<code><pre>.*?</pre>)''',
+ 'lilypond-file': r'(?m)(?P<match><lilypondfile(?P<options>[^>]+)?>\s*(?P<filename>[^<]+)\s*</lilypondfile>)',
+ 'lilypond' : '(?m)(?P<match><lilypond((?P<options>[^:]*):)(?P<code>.*?)/>)',
+ 'lilypond-block': r'''(?ms)(?P<match><lilypond(?P<options>[^>]+)?>(?P<code>.*?)</lilypond>)''',
+ 'option-sep' : '\s*',
+ 'intertext': r',?\s*intertext=\".*?\"',
+ 'multiline-comment': r"(?sm)\s*(?!@c\s+)(?P<code><!--\s.*?!-->)\s",
+ 'singleline-comment': no_match,
+ 'numcols': no_match,
+ 'multicols': no_match,
+ 'ly2dvi': r'(?m)(?P<match><ly2dvifile(?P<options>[^>]+)?>\s*(?P<filename>[^<]+)\s*</ly2dvifile>)',
+ },
+
+ 'latex': {
+ 'input': r'(?m)^[^%\n]*?(?P<match>\\mbinput{?([^}\t \n}]*))',
+ 'include': r'(?m)^[^%\n]*?(?P<match>\\mbinclude{(?P<filename>[^}]+)})',
+ 'option-sep' : ',\s*',
+ 'header': r"\n*\\documentclass\s*(\[.*?\])?",
+ 'preamble-end': r'(?P<code>\\begin\s*{document})',
+ 'verbatim': r"(?s)(?P<code>\\begin\s*{verbatim}.*?\\end{verbatim})",
+ 'verb': r"(?P<code>\\verb(?P<del>.).*?(?P=del))",
+ 'lilypond-file': r'(?m)^[^%\n]*?(?P<match>\\lilypondfile\s*(\[(?P<options>.*?)\])?\s*\{(?P<filename>.+)})',
+ 'lilypond' : r'(?m)^[^%\n]*?(?P<match>\\lilypond\s*(\[(?P<options>.*?)\])?\s*{(?P<code>.*?)})',
+ 'lilypond-block': r"(?sm)^[^%\n]*?(?P<match>\\begin\s*(\[(?P<options>.*?)\])?\s*{lilypond}(?P<code>.*?)\\end{lilypond})",
+ 'def-post-re': r"\\def\\postLilyPondExample",
+ 'def-pre-re': r"\\def\\preLilyPondExample",
+ 'usepackage-graphics': r"\usepackage\s*{graphics}",
+ 'intertext': r',?\s*intertext=\".*?\"',
+ 'multiline-comment': no_match,
+ 'singleline-comment': r"(?m)^.*?(?P<match>(?P<code>^%.*$\n+))",
+ 'numcols': r"(?P<code>\\(?P<num>one|two)column)",
+ 'multicols': r"(?P<code>\\(?P<be>begin|end)\s*{multicols}({(?P<num>\d+)?})?)",
+ 'ly2dvi': no_match,
+
+ },
+
+ # why do we have distinction between @mbinclude and @include?
+
+ 'texi': {
+ 'include': '(?m)^[^%\n]*?(?P<match>@mbinclude\s+(?P<filename>\S*))',
+ 'input': no_match,
+ 'header': no_match,
+ 'preamble-end': no_match,
+ 'landscape': no_match,
+ 'verbatim': r'''(?s)(?P<code>@example\s.*?@end example\s)''',
+ 'verb': r'''(?P<code>@code{.*?})''',
+ 'lilypond-file': '(?m)^(?P<match>@lilypondfile(\[(?P<options>[^]]*)\])?{(?P<filename>[^}]+)})',
+ 'lilypond' : '(?m)^(?P<match>@lilypond(\[(?P<options>[^]]*)\])?{(?P<code>.*?)})',
+ 'lilypond-block': r'''(?ms)^(?P<match>@lilypond(\[(?P<options>[^]]*)\])?\s(?P<code>.*?)@end lilypond)\s''',
+ 'option-sep' : ',\s*',
+ 'intertext': r',?\s*intertext=\".*?\"',
+ 'multiline-comment': r"(?sm)^\s*(?!@c\s+)(?P<code>@ignore\s.*?@end ignore)\s",
+ 'singleline-comment': r"(?m)^.*?(?P<match>(?P<code>@c.*$\n+))",
+ 'numcols': no_match,
+ 'multicols': no_match,
+ 'ly2dvi': no_match,
+ }
+ }
+
+
+for r in re_dict.keys ():
+ olddict = re_dict[r]
+ newdict = {}
+ for k in olddict.keys ():
+ try:
+ newdict[k] = re.compile (olddict[k])
+ except:
+ print 'invalid regexp: %s' % olddict[k]
+
+ ## we'd like to catch and reraise a more
+ ## detailed error, but alas, the exceptions
+ ## changed across the 1.5/2.1 boundary.
+
+ raise "Invalid re"
+ re_dict[r] = newdict
+
+
+def uniq (list):
+ list.sort ()
+ s = list
+ list = []
+ for x in s:
+ if x not in list:
+ list.append (x)
+ return list
+
+
+def get_output (name):
+ return output_dict[format][name]
+
+def get_re (name):
+ return re_dict[format][name]
+
+def bounding_box_dimensions (fname):
+ if g_outdir:
+ fname = os.path.join (g_outdir, fname)
+ try:
+ fd = open (fname)
+ except IOError:
+ error ("Error opening `%s'" % fname)
+ str = fd.read ()
+ s = re.search ('%%BoundingBox: ([0-9]+) ([0-9]+) ([0-9]+) ([0-9]+)', str)
+ if s:
+
+ gs = map (lambda x: string.atoi (x), s.groups ())
+ return (int (gs[2] - gs[0] + 0.5),
+ int (gs[3] - gs[1] + 0.5))
+ else:
+ return (0,0)
+
+def error (str):
+ sys.stderr.write ("\n\n" + str + "\nExiting ... \n\n")
+ raise 'Exiting.'
+
+
+def compose_full_body (body, opts):
+ '''Construct the lilypond code to send to LilyPond.
+ Add stuff to BODY using OPTS as options.'''
+ music_size = default_music_fontsize
+ if g_force_music_fontsize:
+ music_size = g_force_music_fontsize
+ indent = ''
+ linewidth = ''
+ notime = ''
+ for o in opts:
+ if not g_force_music_fontsize:
+ m = re.match ('([0-9]+)pt', o)
+ if m:
+ music_size = string.atoi (m.group (1))
+
+ m = re.match ('indent=([-.0-9]+)(cm|in|mm|pt)', o)
+ if m:
+ f = float (m.group (1))
+ indent = 'indent = %f\\%s' % (f, m.group (2))
+
+ m = re.match ('linewidth=([-.0-9]+)(cm|in|mm|pt)', o)
+ if m:
+ f = float (m.group (1))
+ linewidth = 'linewidth = %f\\%s' % (f, m.group (2))
+
+ if re.search ('\\\\score', body):
+ is_fragment = 0
+ else:
+ is_fragment = 1
+ if 'fragment' in opts:
+ is_fragment = 1
+ if 'nofragment' in opts:
+ is_fragment = 0
+
+ if is_fragment and not 'multiline' in opts:
+ opts.append ('singleline')
+
+ if 'raggedright' in opts or 'singleline' in opts:
+ if not linewidth:
+ linewidth = 'raggedright = ##t'
+ if not indent:
+ indent = 'indent = 0.0\mm'
+ elif not linewidth:
+ global paperguru
+ l = paperguru.get_linewidth ()
+ linewidth = 'linewidth = %f\pt' % l
+
+ if 'noindent' in opts:
+ indent = 'indent = 0.0\mm'
+
+ if 'notime' in opts:
+ notime = r'''
+\translator {
+ \StaffContext
+ \remove Time_signature_engraver
+}
+'''
+
+ orig_name = ''
+ for o in opts:
+ m= re.search ('relative(.*)', o)
+ v = 0
+ if m:
+ try:
+ v = string.atoi (m.group (1))
+ except ValueError:
+ pass
+
+ v = v + 1
+ pitch = 'c'
+ if v < 0:
+ pitch = pitch + '\,' * v
+ elif v > 0:
+ pitch = pitch + '\'' * v
+
+ body = '\\relative %s { %s }' % (pitch, body)
+ m =re.search ("filename=(.*)", o)
+ if m:
+ orig_name = m.group (1)
+
+ if is_fragment:
+ body = r'''
+\score {
+ \notes {
+%s
+ }
+}
+''' % body
+
+ opts = uniq (opts)
+ optstring = string.join (opts, ' ')
+ optstring = re.sub ('\n', ' ', optstring)
+ body = r'''
+%% Generated automatically by: lilypond-book.py
+%% options are %s
+#(set-global-staff-size %d)
+
+\paper {
+ %s
+ %s
+ %s
+}
+''' % (optstring, music_size, linewidth, indent, notime) + body
+
+ if orig_name:
+ body = '\\renameinput \"%s\"\n%s' % (orig_name, body)
+
+
+ # ughUGH not original options
+ return body
+
+def scan_html_preamble (chunks):
+ return
+
+def scan_latex_preamble (chunks):
+ # First we want to scan the \documentclass line
+ # it should be the first non-comment line.
+ # The only thing we really need to know about the \documentclass line
+ # is if there are one or two columns to begin with.
+ idx = 0
+ while 1:
+ if chunks[idx][0] == 'ignore':
+ idx = idx + 1
+ continue
+ m = get_re ('header').match (chunks[idx][1])
+ if not m:
+ error ("Latex documents must start with a \documentclass command")
+ if m.group (1):
+ options = re.split (r',\s*', m.group (1)[1:-1])
+ else:
+ options = []
+ if 'twocolumn' in options:
+ paperguru.m_num_cols = 2
+ break
+
+
+ # Then we add everything before \begin{document} to
+ # paperguru.m_document_preamble so that we can later write this header
+ # to a temporary file in find_latex_dims() to find textwidth.
+ while idx < len (chunks) and chunks[idx][0] != 'preamble-end':
+ if chunks[idx] == 'ignore':
+ idx = idx + 1
+ continue
+ paperguru.m_document_preamble.append (chunks[idx][1])
+ idx = idx + 1
+
+ if len (chunks) == idx:
+ error ("Didn't find end of preamble (\\begin{document})")
+
+ paperguru.find_latex_dims ()
+
+def scan_texi_preamble (chunks):
+ # this is not bulletproof..., it checks the first 10 chunks
+ for c in chunks[:10]:
+ if c[0] == 'input':
+ for s in ('afourpaper', 'afourwide', 'letterpaper',
+ 'afourlatex', 'smallbook'):
+ if string.find (c[1], "@%s" % s) != -1:
+ paperguru.m_papersize = s
+
+
+def scan_preamble (chunks):
+ global format
+ if format == 'html':
+ scan_html_preamble (chunks)
+ elif format == 'latex':
+ scan_latex_preamble (chunks)
+ elif format == 'texi':
+ scan_texi_preamble (chunks)
+
+
+def completize_preamble (chunks):
+ global format
+ if format != 'latex':
+ return chunks
+ pre_b = post_b = graphics_b = None
+ for chunk in chunks:
+ if chunk[0] == 'preamble-end':
+ break
+ if chunk[0] == 'input':
+ m = get_re ('def-pre-re').search (chunk[1])
+ if m:
+ pre_b = 1
+ if chunk[0] == 'input':
+ m = get_re ('def-post-re').search (chunk[1])
+ if m:
+ post_b = 1
+
+ if chunk[0] == 'input':
+ m = get_re ('usepackage-graphics').search (chunk[1])
+ if m:
+ graphics_b = 1
+ x = 0
+ while x < len (chunks) and chunks[x][0] != 'preamble-end':
+ x = x + 1
+
+ if x == len (chunks):
+ return chunks
+
+ if not pre_b:
+ chunks.insert (x, ('input', get_output ('output-default-pre')))
+ if not post_b:
+ chunks.insert (x, ('input', get_output ('output-default-post')))
+ if not graphics_b:
+ chunks.insert (x, ('input', get_output ('usepackage-graphics')))
+
+ return chunks
+
+
+read_files = []
+def find_file (name):
+ '''
+ Search the include path for NAME. If found, return the (CONTENTS, PATH) of the file.
+ '''
+
+ if name == '-':
+ return (sys.stdin.read (), '<stdin>')
+ f = None
+ nm = ''
+ for a in include_path:
+ try:
+ nm = os.path.join (a, name)
+ f = open (nm)
+ global read_files
+ read_files.append (nm)
+ break
+ except IOError:
+ pass
+ if f:
+ sys.stderr.write ("Reading `%s'\n" % nm)
+ return (f.read (), nm)
+ else:
+ error ("File not found `%s'\n" % name)
+ return ('', '')
+
+def do_ignore (match_object):
+ return [('ignore', match_object.group ('code'))]
+def do_preamble_end (match_object):
+ return [('preamble-end', match_object.group ('code'))]
+
+def make_verbatim (match_object):
+ return [('verbatim', match_object.group ('code'))]
+
+def make_verb (match_object):
+ return [('verb', match_object.group ('code'))]
+
+def do_include_file (m):
+ "m: MatchObject"
+ return [('input', get_output ('pagebreak'))] \
+ + read_doc_file (m.group ('filename')) \
+ + [('input', get_output ('pagebreak'))]
+
+def do_input_file (m):
+ return read_doc_file (m.group ('filename'))
+
+def make_lilypond (m):
+ if m.group ('options'):
+ options = m.group ('options')
+ else:
+ options = ''
+ return [('input', get_output ('output-lilypond-fragment') %
+ (options, m.group ('code')))]
+
+def make_lilypond_file (m):
+ '''
+
+ Find @lilypondfile{bla.ly} occurences and substitute bla.ly
+ into a @lilypond .. @end lilypond block.
+
+ '''
+
+ if m.group ('options'):
+ options = get_re ('option-sep').split (m.group ('options'))
+ else:
+ options = []
+ (content, nm) = find_file (m.group ('filename'))
+ options.append ("filename=%s" % nm)
+ (path, base) = os.path.split (nm)
+
+ if path not in include_path:
+ include_path.append (path)
+
+ return [('lilypond', content, options)]
+
+
+def make_ly2dvi_block (m):
+ '''
+
+ Find <ly2dvifile .. >
+ '''
+
+ return [('ly2dvi', m.group ('filename'), m.group ('options'))]
+
+
+def make_lilypond_block (m):
+ if not g_do_music:
+ return []
+
+ if m.group ('options'):
+ options = get_re ('option-sep').split (m.group ('options'))
+ else:
+ options = []
+ options = filter (lambda s: s != '', options)
+ return [('lilypond', m.group ('code'), options)]
+
+
+def do_columns (m):
+ global format
+ if format != 'latex':
+ return []
+ if m.group ('num') == 'one':
+ return [('numcols', m.group ('code'), 1)]
+ if m.group ('num') == 'two':
+ return [('numcols', m.group ('code'), 2)]
+
+def do_multicols (m):
+ global format
+ if format != 'latex':
+ return []
+ if m.group ('be') == 'begin':
+ return [('multicols', m.group ('code'), int (m.group ('num')))]
+ else:
+ return [('multicols', m.group ('code'), 1)]
+ return []
+
+def chop_chunks (chunks, re_name, func, use_match=0):
+ newchunks = []
+ for c in chunks:
+ if c[0] == 'input':
+ str = c[1]
+ while str:
+ m = get_re (re_name).search (str)
+ if m == None:
+ newchunks.append (('input', str))
+ str = ''
+ else:
+ if use_match:
+ newchunks.append (('input', str[:m.start ('match')]))
+ else:
+ newchunks.append (('input', str[:m.start (0)]))
+ #newchunks.extend (func (m))
+ # python 1.5 compatible:
+ newchunks = newchunks + func (m)
+ str = str [m.end (0):]
+ else:
+ newchunks.append (c)
+ return newchunks
+
+def determine_format (str):
+ """
+
+ SIDE EFFECT! This sets FORMAT and PAPERGURU
+
+ """
+
+ global format
+ if format == '':
+ html = re.search ('(?i)<[dh]tml', str[:200])
+ latex = re.search (r'''\\document''', str[:200])
+ texi = re.search ('@node|@setfilename', str[:200])
+
+ f = ''
+ g = None
+
+ if html and not latex and not texi:
+ f = 'html'
+ elif latex and not html and not texi:
+ f = 'latex'
+ elif texi and not html and not latex:
+ f = 'texi'
+ else:
+ error ("can't determine format, please specify")
+ format = f
+
+ global paperguru
+ if paperguru == None:
+ if format == 'html':
+ g = HtmlPaper ()
+ elif format == 'latex':
+ g = LatexPaper ()
+ elif format == 'texi':
+ g = TexiPaper ()
+
+ paperguru = g
+
+
+def read_doc_file (filename):
+ '''Read the input file, find verbatim chunks and do \input and \include
+ '''
+ (str, path) = find_file (filename)
+ determine_format (str)
+
+ chunks = [('input', str)]
+
+ # we have to check for verbatim before doing include,
+ # because we don't want to include files that are mentioned
+ # inside a verbatim environment
+ chunks = chop_chunks (chunks, 'verbatim', make_verbatim)
+
+ chunks = chop_chunks (chunks, 'verb', make_verb)
+ chunks = chop_chunks (chunks, 'multiline-comment', do_ignore)
+ #ugh fix input
+ chunks = chop_chunks (chunks, 'include', do_include_file, 1)
+ chunks = chop_chunks (chunks, 'input', do_input_file, 1)
+ return chunks
+
+
+taken_file_names = {}
+
+def unique_file_name (body):
+ return 'lily-' + `abs (hash (body))`
+
+def schedule_lilypond_block (chunk):
+ '''Take the body and options from CHUNK, figure out how the
+ real .ly should look. The .ly is written, and scheduled in
+ TODO.
+
+ Return: a single chunk.
+
+ The chunk pertaining to the lilypond output
+ has the format (TYPE_STR, MAIN_STR, OPTIONS, TODO, BASE),
+ where TODO has format [basename, extension, extension, ... ]
+ '''
+
+ (type, body, opts) = chunk
+ assert type == 'lilypond'
+ file_body = compose_full_body (body, opts)
+ ## Hmm, we should hash only lilypond source, and skip the
+ ## %options are ...
+ ## comment line
+ basename = unique_file_name (file_body)
+ for o in opts:
+ m = re.search ('filename="(.*?)"', o)
+ if m:
+ basename = m.group (1)
+ if not taken_file_names.has_key (basename):
+ taken_file_names[basename] = 0
+ else:
+ taken_file_names[basename] = taken_file_names[basename] + 1
+ basename = basename + "-t%i" % taken_file_names[basename]
+ update_file (file_body, os.path.join (g_outdir, basename) + '.ly')
+ needed_filetypes = ['tex']
+
+ if format == 'html' or g_make_html:
+ needed_filetypes.append ('eps')
+ needed_filetypes.append ('png')
+ if 'eps' in opts and not ('eps' in needed_filetypes):
+ needed_filetypes.append ('eps')
+
+ pathbase = os.path.join (g_outdir, basename)
+ def must_rebuild (base, ext1, ext2):
+
+ f2 = base + ext2
+ f1 = base + ext1
+ fp2 = base + '-page1' + ext2
+
+ isfile2 = os.path.isfile (f2)
+
+ if not isfile2 and os.path.isfile (fp2):
+ f2 = fp2
+ isfile2 = os.path.isfile (fp2)
+
+ if (os.path.isfile (f2) and isfile2 and
+ os.stat (f1)[stat.ST_MTIME] >
+ os.stat (f2)[stat.ST_MTIME]) or \
+ not isfile2:
+
+ return 1
+
+ todo = []
+ if 'tex' in needed_filetypes and must_rebuild (pathbase, '.ly', '.tex'):
+ todo.append ('tex')
+ if 'eps' in needed_filetypes and must_rebuild (pathbase, '.tex', '.eps'):
+ todo.append ('eps')
+ if 'png' in needed_filetypes and must_rebuild (pathbase, '.eps', '.png'):
+ todo.append ('png')
+
+ return ('lilypond', body, opts, todo, basename)
+
+def format_lilypond_block (chunk):
+ """
+
+ Figure out what should be left MAIN_STR (meant
+ for the main file) from a lilypond chunk: process
+ verbatim, and other options. Return: multiple chunks.
+
+
+ """
+
+
+ return_chunks = []
+
+ (type, body, opts, todo, basename) = chunk
+ assert type == 'lilypond'
+
+
+ newbody = ''
+ filename_chunk = None
+ if 'printfilename' in opts:
+ for o in opts:
+ m= re.match ("filename=(.*)", o)
+ if m:
+ template = get_output ("output-filename")
+ b = basename + '.ly'
+ human_base = os.path.basename (m.group (1))
+
+ ## todo: include path, but strip
+ ## first part of the path.
+ filename_chunk = ('input', template % (human_base, b,human_base))
+ break
+
+
+ if 'smallverbatim' in opts:
+ newbody += output_verbatim (body, 1)
+ elif 'verbatim' in opts:
+ newbody += output_verbatim (body, 0)
+
+ for o in opts:
+ m = re.search ('intertext="(.*?)"', o)
+ if m:
+ newbody = newbody + "\n"
+ if format == 'texi':
+ newbody = newbody + "@noindent\n"
+ elif format == 'latex':
+ newbody = newbody + "\\noindent\n"
+ newbody = newbody + m.group (1) + "\n"
+
+ if 'noinline' in opts:
+ s = 'output-noinline'
+ elif format == 'latex':
+ if 'quote' in opts:
+ s = 'output-latex-quoted'
+ elif 'eps' in opts:
+ s = 'output-eps'
+ else:
+ s = 'output-latex-noquote'
+ elif format == 'texi':
+ if 'quote' in opts:
+ s = 'output-texi-quoted'
+ else:
+ s = 'output-texi-noquote'
+ else: # format == 'html'
+ s = 'output-html'
+
+ def html_pages (basename):
+ pat = os.path.join (g_outdir, "%s-page*.png"% basename)
+
+ files = glob.glob (pat)
+
+
+ template = '''<img align="center" valign="center"
+ border="0" src="%s" alt="[picture of music]">'''
+
+ str = ''
+ if files == []:
+ files = [basename+'.png' ]
+ else:
+ files = map (os.path.basename, files)
+
+ for f in files:
+ str += template % f
+
+ str = '<a href="%s.ly">%s</a>' % (basename, str)
+
+ return str
+
+
+ newbody = newbody + get_output (s) % {'fn': basename,
+ 'htmlimages': html_pages(basename)
+ }
+
+ if filename_chunk:
+ return_chunks += [filename_chunk]
+
+ return_chunks += [('lilypond', newbody, opts, todo, basename)]
+
+ return return_chunks
+
+def format_lilypond_output_bodies (chunks):
+ newchunks = []
+ for c in chunks:
+
+ if c[0] == 'lilypond':
+ newchunks += format_lilypond_block (c)
+ else:
+ newchunks.append (c)
+
+ return newchunks
+
+
+
+def process_lilypond_blocks (chunks):#ugh rename
+ newchunks = []
+ # Count sections/chapters.
+ for c in chunks:
+ if c[0] == 'lilypond':
+ c = schedule_lilypond_block (c)
+ elif c[0] == 'numcols':
+ paperguru.m_num_cols = c[2]
+ elif c[0] == 'multicols':
+ paperguru.m_multicols = c[2]
+
+ newchunks.append (c)
+
+ return newchunks
+
+def process_ly2dvi_blocks (chunks):
+
+ def process_ly2dvi_block (chunk):
+ """
+
+Run ly2dvi script on filename specified in CHUNK.
+This is only supported for HTML output.
+
+In HTML output it will leave a download menu with ps/pdf/midi etc. in
+a separate HTML file, and a title + preview in the main html file,
+linking to the menu.
+
+ """
+ (tag, name, opts) = chunk
+ assert format == 'html'
+ (content, original_name) = find_file (name)
+
+ original_name = os.path.basename (original_name)
+
+ base = unique_file_name (content)
+ outname = base + '.ly'
+ changed = update_file (content, outname)
+
+ preview = base + ".preview.png"
+ preview_page = base + '-page1.png'
+
+ if changed or not (os.path.isfile (preview) or
+ os.path.isfile (preview_page)):
+
+ ly.system ('%s --preview --postscript --verbose %s ' % (ly2dvi_binary, base) )
+
+ ly.make_ps_images (base + '.ps')
+ ly.system ('gzip -9 - < %s.ps > %s.ps.gz' % (base, base))
+
+ def size_str (fn):
+ b = os.stat(fn)[stat.ST_SIZE]
+ if b < 1024:
+ return '%d bytes' % b
+ elif b < (2 << 20):
+ return '%d kb' % (b >> 10)
+ else:
+ return '%d mb' % (b >> 20)
+
+ exts = {
+ 'pdf' : "Print (PDF, %s)",
+ 'ps.gz' : "Print (gzipped PostScript, %s)",
+ 'png' : "View (PNG, %s)",
+ 'midi' : "Listen (MIDI, %s)",
+ 'ly' : "View source code (%s)",
+ }
+
+ menu = ''
+ page_files = glob.glob ('%s-page*.png' % base)
+
+ for p in page_files:
+ p = p.strip()
+ if os.path.isfile (p):
+ sz = size_str (p)
+ page = re.sub ('.*page([0-9])+.*', 'View page \\1 (PNG picture, %s)\n', p)
+ page = page % sz
+ menu += '<li><a href="%s">%s</a>' % (p, page)
+
+ ext_order = ['ly', 'pdf', 'ps.gz', 'midi']
+ for e in ext_order:
+ fn = base + '.' + e
+ print 'checking,' , fn
+ if not os.path.isfile (fn):
+ continue
+
+ entry = exts[e] % size_str (fn)
+
+ ## TODO: do something like
+ ## this for texinfo/latex as well ?
+
+ menu += '<li><a href="%s">%s</a>\n\n' % (fn, entry)
+
+
+ explanatory_para = """The pictures are 90dpi
+anti-aliased snapshots of the printed output, in PNG format. Both PDF and PS
+use scalable fonts and should look OK at any resolution."""
+
+ separate_menu =r'''
+<title>LilyPond example %s</title>
+
+<h1>%s</h1>
+<p><img src="%s">
+<p>%s
+<p>
+<ul>%s</ul>''' % (original_name,original_name, preview, explanatory_para, menu)
+
+ open (base + '.html','w'). write (separate_menu)
+
+ inline_menu = '<p/><a href="%s.html"><img alt="%s" src="%s"></a><p/>' % (base, original_name, preview)
+
+ return ('ly2dvi', inline_menu)
+
+ newchunks = []
+ for c in chunks:
+ if c[0] == 'ly2dvi':
+ c = process_ly2dvi_block (c)
+ newchunks.append (c)
+
+ return newchunks
+
+def compile_all_files (chunks):
+ global foutn
+ eps = []
+ tex = []
+ png = []
+
+ for c in chunks:
+ if c[0] != 'lilypond':
+ continue
+
+ base = c[4]
+ exts = c[3]
+ for e in exts:
+ if e == 'eps':
+ eps.append (base)
+ elif e == 'tex':
+ #ugh
+ if base + '.ly' not in tex:
+ tex.append (base + '.ly')
+ elif e == 'png' and g_do_pictures:
+ png.append (base)
+ d = os.getcwd ()
+ if g_outdir:
+ os.chdir (g_outdir)
+ if tex:
+ # fixme: be sys-independent.
+ def incl_opt (x):
+ if g_outdir and x[0] != '/' :
+ x = os.path.join (g_here_dir, x)
+ return ' -I %s' % x
+
+ incs = map (incl_opt, include_path)
+ lilyopts = string.join (incs)
+ if do_deps:
+ lilyopts += ' --dependencies'
+ if g_outdir:
+ lilyopts += ' --dep-prefix=' + g_outdir + '/'
+ lilyopts += ' --header=texidoc'
+ texfiles = string.join (tex)
+ cmd = string.join ((lilypond_binary, lilyopts, g_extra_opts,
+ texfiles))
+
+ ly.lilypond_version_check (lilypond_binary, '@TOPLEVEL_VERSION@')
+
+ ly.system (cmd, ignore_error = 0, progress_p = 1)
+
+ #
+ # Ugh, fixing up dependencies for .tex generation
+ #
+ if do_deps:
+ depfiles=map (lambda x: re.sub ('(.*)\.ly', '\\1.dep',
+ x), tex)
+
+ for i in depfiles:
+ f =open (i)
+ text=f.read ()
+ f.close ()
+ text=re.sub ('\n([^:\n]*):',
+ '\n' + foutn + ':', text)
+ f = open (i, 'w')
+ f.write (text)
+ f.close ()
+
+ def to_eps (file):
+ cmd = r"latex '\nonstopmode \input %s'" % file
+ # Ugh. (La)TeX writes progress and error messages on stdout
+ # Redirect to stderr
+ cmd = '(( %s >&2 ) >&- )' % cmd
+
+ ly.system (cmd)
+ ly.system ("dvips -Ppdf -u+lilypond.map -E -o %s.eps %s" % (file, file))
+ map (to_eps, eps)
+
+ for p in png:
+ ly.make_ps_images (p + '.eps', resolution=110)
+ os.chdir (d)
+
+
+def update_file (body, name):
+ '''
+ write the body if it has changed. Return whether BODY has changed.
+ '''
+ same = 0
+ try:
+ f = open (name)
+ fs = f.read (-1)
+ same = (fs == body)
+ except:
+ pass
+
+ if not same:
+ f = open (name , 'w')
+ f.write (body)
+ f.close ()
+
+ return not same
+
+
+def write_deps (fn, target, chunks):
+ global read_files
+ sys.stderr.write ('Writing `%s\'\n' % os.path.join (g_outdir, fn))
+ f = open (os.path.join (g_outdir, fn), 'w')
+ f.write ('%s%s: ' % (g_dep_prefix, target))
+ for d in read_files:
+ f.write ('%s ' % d)
+
+
+ ## There used to be code to write .tex dependencies, but
+ ## that is silly: lilypond-book has its own dependency scheme
+ ## to ensure that all lily-XXX.tex files are there
+
+
+ f.write ('\n')
+ f.close ()
+ read_files = []
+
+def check_texidoc (chunks):
+ ## TODO: put file name in front of texidoc.
+ ##
+ n = []
+ for c in chunks:
+ if c[0] == 'lilypond':
+ (type, body, opts, todo, basename) = c;
+ pathbase = os.path.join (g_outdir, basename)
+ if os.path.isfile (pathbase + '.texidoc') \
+ and 'notexidoc' not in opts:
+ n.append( ('input', '\n@include %s.texidoc\n\n' % basename))
+ n.append (c)
+ return n
+
+
+## what's this? Docme --hwn
+##
+def fix_epswidth (chunks):
+ newchunks = []
+ for c in chunks:
+ if c[0] != 'lilypond' or 'eps' not in c[2]:
+ newchunks.append (c)
+ continue
+
+ mag = 1.0
+ for o in c[2]:
+ m = re.match ('magnification=([0-9.]+)', o)
+ if m:
+ mag = string.atof (m.group (1))
+
+ def replace_eps_dim (match, lmag = mag):
+ filename = match.group (1)
+ dims = bounding_box_dimensions (filename)
+
+ return '%fpt' % (dims[0] *lmag)
+
+ body = re.sub (r'''\\lilypondepswidth{(.*?)}''', replace_eps_dim, c[1])
+ newchunks.append (('lilypond', body, c[2], c[3], c[4]))
+
+ return newchunks
+
+
+##docme: why global?
+foutn=""
+
+def do_file (input_filename):
+ chunks = read_doc_file (input_filename)
+ chunks = chop_chunks (chunks, 'ly2dvi', make_ly2dvi_block, 1)
+ chunks = chop_chunks (chunks, 'lilypond', make_lilypond, 1)
+ chunks = chop_chunks (chunks, 'lilypond-file', make_lilypond_file, 1)
+ chunks = chop_chunks (chunks, 'lilypond-block', make_lilypond_block, 1)
+ chunks = chop_chunks (chunks, 'singleline-comment', do_ignore, 1)
+ chunks = chop_chunks (chunks, 'preamble-end', do_preamble_end)
+ chunks = chop_chunks (chunks, 'numcols', do_columns)
+ chunks = chop_chunks (chunks, 'multicols', do_multicols)
+
+ scan_preamble (chunks)
+ chunks = process_lilypond_blocks (chunks)
+ chunks = process_ly2dvi_blocks (chunks)
+
+ # Do It.
+ global g_run_lilypond
+ if g_run_lilypond:
+ compile_all_files (chunks)
+ chunks = fix_epswidth (chunks)
+
+
+ chunks = format_lilypond_output_bodies (chunks)
+ global format
+ if format == 'texi':
+ chunks = check_texidoc (chunks)
+
+
+ x = 0
+ chunks = completize_preamble (chunks)
+
+ global foutn
+
+ if outname:
+ my_outname = outname
+ elif input_filename == '-' or input_filename == "/dev/stdin":
+ my_outname = '-'
+ else:
+ my_outname = os.path.basename (os.path.splitext (input_filename)[0]) + '.' + format
+ my_depname = my_outname + '.dep'
+
+ if my_outname == '-' or my_outname == '/dev/stdout':
+ fout = sys.stdout
+ foutn = "<stdout>"
+ global do_deps
+ do_deps = 0
+ else:
+ foutn = os.path.join (g_outdir, my_outname)
+ sys.stderr.write ("Writing `%s'\n" % foutn)
+ fout = open (foutn, 'w')
+ for c in chunks:
+ fout.write (c[1])
+ fout.close ()
+ # should chmod -w
+
+ if do_deps:
+ write_deps (my_depname, foutn, chunks)
+
+outname = ''
+try:
+ (sh, long) = ly.getopt_args (option_definitions)
+ (options, files) = getopt.getopt (sys.argv[1:], sh, long)
+
+except getopt.error, msg:
+ sys.stderr.write ('\n')
+ ly.error (_ ("getopt says: `%s\'" % s))
+ sys.stderr.write ('\n')
+ ly.help ()
+ ly.exit (2)
+
+do_deps = 0
+for opt in options:
+ o = opt[0]
+ a = opt[1]
+
+ if o == '--include' or o == '-I':
+ include_path.append (a)
+ elif o == '--version' or o == '-v':
+ ly.identify (sys.stdout)
+ sys.exit (0)
+ elif o == '--verbose' or o == '-V':
+ verbose_p = 1
+ elif o == '--format' or o == '-f':
+ format = a
+ if a == 'texi-html':
+ format = 'texi'
+ g_make_html = 1
+ elif o == '--outname' or o == '-o':
+ if len (files) > 1:
+ #HACK
+ sys.stderr.write ("lilypond-book is confused by --outname on multiple files")
+ sys.exit (1)
+ outname = a
+ elif o == '--help' or o == '-h':
+ ly.help ()
+ sys.exit (0)
+ elif o == '--no-lily' or o == '-n':
+ g_run_lilypond = 0
+ elif o == '--preview-resolution':
+ preview_resolution = string.atoi (a)
+ elif o == '--dependencies' or o == '-M':
+ do_deps = 1
+ elif o == '--default-music-fontsize':
+ default_music_fontsize = string.atoi (a)
+ elif o == '--default-lilypond-fontsize':
+ print "--default-lilypond-fontsize is deprecated, use --default-music-fontsize"
+ default_music_fontsize = string.atoi (a)
+ elif o == '--extra-options':
+ g_extra_opts = a
+ elif o == '--force-music-fontsize':
+ g_force_music_fontsize = string.atoi (a)
+ elif o == '--force-lilypond-fontsize':
+ print "--force-lilypond-fontsize is deprecated, use --default-lilypond-fontsize"
+ g_force_music_fontsize = string.atoi (a)
+ elif o == '--dep-prefix':
+ g_dep_prefix = a
+ elif o == '--no-pictures':
+ g_do_pictures = 0
+ elif o == '--no-music':
+ g_do_music = 0
+ elif o == '--outdir':
+ g_outdir = a
+ elif o == '--warranty' or o == '-w':
+ #status = os.system ('lilypond -w')
+ if 1 or status:
+ ly.warranty ()
+ sys.exit (0)
+
+ly.identify (sys.stderr)
+
+if g_outdir:
+ if os.path.isfile (g_outdir):
+ error ("outdir is a file: %s" % g_outdir)
+ if not os.path.exists (g_outdir):
+ os.mkdir (g_outdir)
+
+if not files:
+ ly.help ()
+ ly.error (_ ("no files specified on command line"))
+ ly.exit (2)
+
+ly.setup_environment ()
+
+
+for input_filename in files:
+ do_file (input_filename)
+
+
+#
+# Petr, ik zou willen dat ik iets zinvoller deed,
+# maar wat ik kan ik doen, het verandert toch niets?
+# --hwn 20/aug/99
])
-dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
-dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
-dnl also defines GSTUFF_PKG_ERRORS on error
-AC_DEFUN(PKG_CHECK_MODULES, [
- succeeded=no
-
- if test -z "$PKG_CONFIG"; then
- AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
- fi
-
- if test "$PKG_CONFIG" = "no" ; then
- echo "*** The pkg-config script could not be found. Make sure it is"
- echo "*** in your path, or set the PKG_CONFIG environment variable"
- echo "*** to the full path to pkg-config."
- echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
- else
- PKG_CONFIG_MIN_VERSION=0.9.0
- if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
- AC_MSG_CHECKING(for $2)
-
- if $PKG_CONFIG --exists "$2" ; then
- AC_MSG_RESULT(yes)
- succeeded=yes
-
- AC_MSG_CHECKING($1_CFLAGS)
- $1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
- AC_MSG_RESULT($$1_CFLAGS)
-
- AC_MSG_CHECKING($1_LIBS)
- $1_LIBS=`$PKG_CONFIG --libs "$2"`
- AC_MSG_RESULT($$1_LIBS)
- else
- $1_CFLAGS=""
- $1_LIBS=""
- ## If we have a custom action on failure, don't print errors, but
- ## do set a variable so people can do so.
- $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
- ifelse([$4], ,echo $$1_PKG_ERRORS,)
- fi
-
- AC_SUBST($1_CFLAGS)
- AC_SUBST($1_LIBS)
- else
- echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
- echo "*** See http://www.freedesktop.org/software/pkgconfig"
- fi
- fi
-
- if test $succeeded = yes; then
- ifelse([$3], , :, [$3])
- else
- ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])
- fi
-])
-
-
-AC_DEFUN(STEPMAKE_FREETYPE2, [
- PKG_CHECK_MODULES(FREETYPE2, freetype2 >= 0, have_freetype2=true, true)
- if $have_freetype2 ; then
- AC_DEFINE(HAVE_FREETYPE2)
- AC_SUBST(FREETYPE2_CFLAGS)
- AC_SUBST(FREETYPE2_LIBS)
- fi
-])
-
-AC_DEFUN(STEPMAKE_GTK2, [
- PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.4.0, have_gtk2=true, true)
- if $have_gtk2 ; then
- AC_DEFINE(HAVE_GTK2)
- AC_SUBST(GTK2_CFLAGS)
- AC_SUBST(GTK2_LIBS)
- fi
-])
-
-AC_DEFUN(STEPMAKE_PANGO, [
- PKG_CHECK_MODULES(PANGO, pango >= 1.5.0, have_pango_cvs=true, true)
- if $have_pango_cvs ; then
- AC_DEFINE(HAVE_PANGO_CVS)
- PANGO_CFLAGS="$PANGO_CFLAGS $GTK2_CFLAGS"
- PANGO_LIBS="$PANGO_LIBS $GTK2_LIBS"
- CPPFLAGS="$PANGO_CFLAGS $CPPFLAGS"
- LIBS="$PANGO_LIBS $LIBS"
- AC_CHECK_HEADERS([pango/pangofc-fontmap.h])
- AC_CHECK_FUNCS([pango_fc_font_map_add_decoder_find_func])
- AC_SUBST(PANGO_CFLAGS)
- AC_SUBST(PANGO_LIBS)
-fi
-])
srcdir=`dirname $0`
-case $1 in
- --noconf*) NOCONFIGURE=true;;
-esac
if [ ! -f aclocal.m4 -o stepmake/aclocal.m4 -nt aclocal.m4 ]; then
echo "stepmake/aclocal.m4 is newer. Copying file."
endif
-# no local settings in the build process.
-LANG=
-export LANG
# clean file lists:
#
\string"
lyscale\lilypondpaperoutputscale\lilypondspace ##1}
}
+
+ \lilypondifundefined{lilypondpaperblotdiameterps}
+ {\lilypondsetdimen{lilypondpaperblotdiameter}}
+ {}
}
\gdef\lilypondexperimentalfeatures{}
-%%% lilyponddefs.tex -- TeX macros for LilyPond output.
-%%%
-%%% source file of the GNU LilyPond music typesetter
-%%%
-%%% (c) 1998--2004 Jan Nieuwenhuizen <janneke@gnu.org>
-%%% Han-Wen Nienhuys <hanwen@cs.uu.nl>
-%%% Mats Bengtsson <mats.bengtsson@s3.kth.se>
-%%%
-%% Avoid \par while reading this file.
+% lilyponddefs.tex
+%
+% Include file for LilyPond.
+%
+% This file defines various macros to acommodate lilypond output.
+%
+% It should run with plain TeX, LaTeX, pdftex, and texinfo.
+%
+% To avoid interferences, lilyponddefs.tex should be loaded within a group.
+% To load it only once, most of the definitions must be global.
+%
+% The overall structure of a file created by LilyPond is as follows:
+%
+% <lilypond parameter definitions>
+% \ifx\lilypondstart \undefined
+% \input lilyponddefs
+% \fi
+% \lilypondstart
+% <font setup and note output>
+% \lilypondend
+%
+% No footers and headers are provided for the stand-alone run (i.e., for
+% directly saying `latex <LilyPond output>'.
+%
+%
+% Avoid \par while reading this file.
\edef\lilyponddefsELC{\the\endlinechar}%
\endlinechar -1\relax
-%% This runs with plain TeX, LaTeX, pdftex, and texinfo.
-%%
-%% To avoid interferences, lilyponddefs.tex must be loaded within a group.
-%% It is loaded only once, so the definitions must be global.
-%%
-%% The overall structure of a file created by LilyPond is as follows:
-%%
-%% <lilypond parameter definitions>
-%% \ifx\lilypondstart \undefined
-%% \input lilyponddefs
-%% \fi
-%% \lilypondstart
-%% <font setup and note output>
-%% \lilypondend
-
-\newdimen\lytempdim
-\newdimen\outputscale
-
-%% Handy macros from the LaTeX manual.
+% the next three macros are taken from LaTeX
\long\gdef\lilypondfirst#1#2{#1}
+
\long\gdef\lilypondsecond#1#2{#2}
+
\gdef\lilypondifundefined#1{
\expandafter\ifx\csname#1\endcsname\relax
\expandafter\lilypondfirst
\gdef\lilypondstart{
\begingroup
\catcode `\@=11\relax
- %% \@nodocument is defined as \relax after `\begin{document}'
+ % \@nodocument is defined as \relax after `\begin{document}'
\lilypondifundefined{@nodocument}
{
- %% either plain TeX or texinfo or not at the beginning of LaTeX input
- \def\x{\endgroup}}
+ % either plain TeX or texinfo or not at the beginning of LaTeX input
+ \def\x{\endgroup}
+ }
{
- %% FIXME: a4
- %% provide a proper LaTeX preamble (for A4 paper format)
+ % provide a proper LaTeX preamble (for A4 paper format)
\def\x{
\endgroup
\def\lilyponddocument{}
\documentclass[a4paper]{article}
- %% safe-mode
- \nofiles
- \usepackage{inputenc}
+ \nofiles
\pagestyle{empty}
- \lilypondifundefined{lilypondclassic}
- {
- %% Nullify [La]TeX page layout settings, page layout by LilyPond.
- \topmargin-1in
- \headheight0pt\headsep0pt
- \oddsidemargin-1in
- \evensidemargin\oddsidemargin
- }
- {
- %% Center staves horizontally on page
- \ifdim\lilypondpaperlinewidth\lilypondpaperunit > 0pt
+ % \begin is defined as \outer in texinfo, thus we use \csname
+ \csname begin\endcsname{document}
+ % center staves horizontally on page
+ \ifdim\lilypondpaperlinewidth\lilypondpaperunit > 0pt
\hsize\lilypondpaperlinewidth\lilypondpaperunit
- \lytempdim \paperwidth
- \advance\lytempdim -\the\hsize
- \lytempdim 0.5\lytempdim
- \advance\lytempdim -1in
- \oddsidemargin \lytempdim
- \evensidemargin \lytempdim
- \fi
- }
+ % we abuse \scoreshift temporarily
+ \scoreshift \paperwidth
+ \advance\scoreshift -\the\hsize
+ \scoreshift 0.5\scoreshift
+ \advance\scoreshift -1in
+ \oddsidemargin \scoreshift
+ \evensidemargin \scoreshift
+ \fi
\parindent 0pt
- %% TEXINFO workaround: \begin is defined as \outer, use \csname.
- \csname begin\endcsname{document}}}
- \x}
+ }
+ }
+
+ \x
+
+ \lilypondifundefined{mustmakelilypondtitle}
+ {}
+ {\makelilypondtitle}
+
+ \lilypondifundefined{mustmakelilypondpiecetitle}
+ {}
+ {\makelilypondpiecetitle}
+}
\gdef\lilypondend{
\lilypondifundefined{lilypondbook}
- {\lilypondifundefined{lilypondpaperlastpagefill}
- {\vskip 0pt plus\lilypondpaperinterscorelinefill00 fill}
- {}}
- {}
+ {\lilypondifundefined{lilypondpaperlastpagefill}
+ {\vskip 0pt plus \lilypondpaperinterscorelinefill00 fill}
+ {}
+ }
+ {}
+
\begingroup
\lilypondifundefined{lilyponddocument}
- {\def\x{\endgroup}}
- {\def\x{\endgroup\csname end\endcsname{document}}}
- \x}
+ {
+ \def\x{\endgroup}
+ }
+ {
+ \def\x{
+ \endgroup
+ \csname end\endcsname{document}
+ }
+ }
+
+ \x
+}
-%% Inversed \loop ... \repeat macro
+% this is an inversed \loop ... \repeat macro
\def\lilypondloop#1\lilypondrepeat{
\def\lilypondbody{#1}
\lilyponditerate
\lilypondnext
}
-%% Allow overriding of pagebreak
-\lilypondifundefined{lilypondpagebreak}
-{
- \lilypondifundefined{@nodocument}
- {\gdef\lilypondpagebreak{\eject}}
- {\gdef\lilypondpagebreak{\newpage}}
- }
- {}
-
-%% Include \special only once.
+% the following macro is executed only once
\gdef\lilypondspecial{
\special{header=music-drawing-routines.ps}
\gdef\lilypondspecial{}
}
-%% The feta characters.
+% the feta characters
\input feta20
\global\font\fetasixteen = feta16
\gdef\fetafont{\fetasixteen}
\gdef\fetachar#1{\hbox{\fetasixteen#1}}
-\gdef\topalign#1{\vbox to 0pt{\hbox{#1}\vss}}
-\gdef\leftalign#1{\hbox to 0pt{#1\hss}}
+\gdef\botalign#1{
+ \vbox to 0pt{\vss #1}
+}
+\gdef\leftalign#1{
+ \hbox to 0pt{#1\hss}
+}
\gdef\lyitem#1#2#3{
- \topalign{\raise#2\outputscale\leftalign{\kern#1\outputscale#3}}}
+ \botalign{
+ \hbox{\raise #1\outputscale
+ \leftalign{\kern #2\outputscale #3}}
+ }
+}
-\gdef\lybox#1#2#3#4#5{
- \lytempdim\baselineskip
- \advance\lytempdim-#4\outputscale
- \raise\lytempdim
- \vbox to#4\outputscale{
- \leftalign{\kern#1\outputscale\lower#2\outputscale\topalign{#5}}
- \vss}}
+\gdef\lybox#1#2#3{
+ \hbox to #1\outputscale {
+ \lower\scoreshift \vbox to #2\outputscale {
+ \hbox{#3}
+ \vss
+ }
+ \hss
+ }
+}
\gdef\lyvrule#1#2#3#4{
- \kern#1\outputscale
- \vrule width #2\outputscale depth #3\outputscale height #4\outputscale}
+ \kern #1\outputscale
+ \vrule width #2\outputscale depth #3\outputscale height #4\outputscale
+}
+
+% Attempt to keep lilypiecetitle together with the piece:
+%
+% TODO: figure this out.
+\gdef\myfilbreak{}%\par\vfil\penalty200\vfilneg}
-%% FIXME: 'interscoreline' and 'lilypondPAPERinterscoreline
\lilypondifundefined{lilypondpaperinterscorelinefill}
{\gdef\lilypondpaperinterscorelinefill{0}}
{\gdef\lilypondpaperinterscorelinefill{1}}
-%% Allow overriding of interscoreline, e.g. for lilypond.py's --preview
+%% Allow overriding of interscoreline, eg for lilypond --preview
\lilypondifundefined{interscoreline}
-{
- \lilypondifundefined{lilypondclassic}
- {\gdef\interscoreline{}}
- {\gdef\interscoreline{
- \vskip\lilypondpaperinterscoreline\lilypondpaperunit
- plus \lilypondpaperinterscorelinefill fill}}
-}
-{}
+{\gdef\interscoreline{
+ \vskip \lilypondpaperinterscoreline \lilypondpaperunit
+ plus \lilypondpaperinterscorelinefill fill
+}}{}
-%% Include postscript definitions unless using PDFTeX,
-%% in that case use pdf definitions.
-%% MiKTeX workaround: use \csname.
+% Are we using PDFTeX? If so, use pdf definitions.
+% MiKTeX checks \pdfoutput the wrong way, thus we use \csname.
\lilypondifundefined{lilypondpostscript}
-{\lilypondifundefined{pdfoutput}
- {\input lily-ps-defs }
- {\pdfoutput = 1
- \input lily-pdf-defs }}
-{}
+ {
+ \lilypondifundefined{pdfoutput}
+ {\input lily-ps-defs }
+ {
+ \pdfoutput = 1
+ \input lily-pdf-defs %
+ }
+ }
+ {}
+
+\newdimen\outputscale
+\newdimen\scoreshift
-%% Restore newline functionality (disabled to avoid \par).
+% Restore newline functionality (disabled to avoid \par).
\endlinechar \lilyponddefsELC
\endinput
-%% end lilyponddefs.tex
+% EOF