From aab300b4e582627497ab12f8ea8609f03a3c8d84 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sat, 17 May 2003 21:49:19 +0000 Subject: [PATCH] * scm/define-grobs.scm: uniform naming for definitions and output routine files. * ly/engraver-init.ly (ChoirStaffContext): add \description from scm/context-description.scm * lily/parser.yy (translator_spec_body): add \description to the \translator{} body syntax. * lily/ottava-engraver.cc: new file. * input/mutopia/R.Schumann/romanze-op28-2.ly: syntax updates. * Documentation/user/refman.itely (Metronome marks): update doco. --- ChangeLog | 11 + Documentation/user/refman.itely | 26 +- input/mutopia/R.Schumann/romanze-op28-2.ly | 21 +- input/test/chord-names-american.ly | 62 -- input/test/ottava.ly | 2 +- lily/include/translator-def.hh | 2 + lily/my-lily-lexer.cc | 1 + lily/ottava-engraver.cc | 123 +++ lily/parser.yy | 4 + lily/text-spanner-engraver.cc | 14 +- lily/text-spanner.cc | 16 +- lily/translator-def.cc | 17 +- ly/engraver-init.ly | 84 ++- ly/spanners-init.ly | 4 +- scm/basic-properties.scm | 2 - scm/context-description.scm | 88 --- ...ription.scm => define-grob-interfaces.scm} | 0 scm/define-grob-properties.scm | 554 ++++++++++++++ ...{grob-description.scm => define-grobs.scm} | 13 + ...iption.scm => define-music-properties.scm} | 0 scm/define-music-types.scm | 702 ++++++++++++++++++ ...n.scm => define-translator-properties.scm} | 2 + scm/describe-context.scm | 37 + scm/document-translation.scm | 5 +- scm/lily.scm | 26 +- ...cii-script.scm => output-ascii-script.scm} | 2 +- scm/{pdf.scm => output-pdf.scm} | 3 +- scm/{pdftex.scm => output-pdftex.scm} | 4 +- scm/{ps.scm => output-ps.scm} | 2 +- scm/{pysk.scm => output-pysk.scm} | 4 +- scm/{sketch.scm => output-sketch.scm} | 2 +- scm/{sodipodi.scm => output-sodipodi.scm} | 2 +- scm/{tex.scm => output-tex.scm} | 4 +- scripts/convert-ly.py | 17 + 34 files changed, 1621 insertions(+), 235 deletions(-) delete mode 100644 input/test/chord-names-american.ly create mode 100644 lily/ottava-engraver.cc delete mode 100644 scm/basic-properties.scm delete mode 100644 scm/context-description.scm rename scm/{interface-description.scm => define-grob-interfaces.scm} (100%) create mode 100644 scm/define-grob-properties.scm rename scm/{grob-description.scm => define-grobs.scm} (99%) rename scm/{music-property-description.scm => define-music-properties.scm} (100%) create mode 100644 scm/define-music-types.scm rename scm/{translator-property-description.scm => define-translator-properties.scm} (99%) create mode 100644 scm/describe-context.scm rename scm/{ascii-script.scm => output-ascii-script.scm} (99%) rename scm/{pdf.scm => output-pdf.scm} (99%) rename scm/{pdftex.scm => output-pdftex.scm} (99%) rename scm/{ps.scm => output-ps.scm} (99%) rename scm/{pysk.scm => output-pysk.scm} (96%) rename scm/{sketch.scm => output-sketch.scm} (99%) rename scm/{sodipodi.scm => output-sodipodi.scm} (99%) rename scm/{tex.scm => output-tex.scm} (99%) diff --git a/ChangeLog b/ChangeLog index 3186731352..acb5e7cffe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2003-05-17 Han-Wen Nienhuys + * scm/define-grobs.scm: uniform naming for definitions and output + routine files. + + * ly/engraver-init.ly (ChoirStaffContext): add \description from + scm/context-description.scm + + * lily/parser.yy (translator_spec_body): add \description to the + \translator{} body syntax. + + * lily/ottava-engraver.cc: new file. + * scm/chord-name.scm (natural-chord-alteration): replace old chord stuff. diff --git a/Documentation/user/refman.itely b/Documentation/user/refman.itely index 520a7cf3df..34f0e6141f 100644 --- a/Documentation/user/refman.itely +++ b/Documentation/user/refman.itely @@ -1646,17 +1646,17 @@ paper output, a metronome marking is printed @subsection Text spanners @cindex Text spanners -Some textual indications, e.g. @i{rallentando} or @i{accelerando}, are -often extended over many measures. This is indicated by following the -text with a dotted line. You can create such texts using text -spanners. The syntax is as follows: -@example - \startTextSpan - \stopTextSpan -@end example +Some performance indications, e.g. @i{rallentando} or @i{accelerando}, +are written as texts, and extended over many measures with dotted +lines. You can create such texts using text spanners: attach +@code{\startTextSpan} and @code{\stopTextSpan} to the +start and ending note of the spanner. + The string to be printed, as well as the style, is set through object properties. +[TODO: 8va engraver.] + An application is to fake octavation indications. @lilypond[fragment,relative,verbatim] @@ -1686,14 +1686,14 @@ Brackets are used in musical analysis to indicate structure in musical pieces. LilyPond supports a simple form of nested horizontal brackets. To use this, add the @internalsref{Horizontal_bracket_engraver} to @internalsref{Staff} context. A bracket is started with -@code{\groupOpen} and closed with @code{\groupClose}. +@code{\startGroup} and closed with @code{\stopGroup}. @lilypond[singleline,verbatim] \score { \notes \relative c'' { - c4-\groupOpen-\groupOpen - c4-\groupClose - c4-\groupOpen - c4-\groupClose-\groupClose + c4-\startGroup-\startGroup + c4-\stopGroup + c4-\startGroup + c4-\stopGroup-\stopGroup } \paper { \translator { \StaffContext \consists "Horizontal_bracket_engraver" diff --git a/input/mutopia/R.Schumann/romanze-op28-2.ly b/input/mutopia/R.Schumann/romanze-op28-2.ly index 4fa2104d6d..0db6693127 100644 --- a/input/mutopia/R.Schumann/romanze-op28-2.ly +++ b/input/mutopia/R.Schumann/romanze-op28-2.ly @@ -11,7 +11,6 @@ title = "Romanzen" opus = "op. 28/2" composer = "R. Schumann (1810-1856)" - % latexpackages="rotating" enteredby="Rune Zedeler" maintainer="rune@zedeler.dk" mutopiatitle = "Romanzen - op. 28/2" @@ -62,7 +61,7 @@ righta = \notes \transpose c cis' { e4^4( g8^5~<> f^3 as-) | g4^4 b8^5~b a c'^5~ | c' b^4 ges^5 des^3 b,^5 \d ges,16-[^4 f,] | - e,^2^#'(large "ritard...") cis,^1 \u r8 r r4 r16 \d gis,^2^"R.H."-] | + e,^2^\markup { \large "ritard..." } cis,^1 \u r8 r r4 r16 \d gis,^2^"R.H."-] | \forcedBreak @@ -73,16 +72,16 @@ righta = \notes \transpose c cis' { \m a,-[( \u d^2 a d-] \m c-[ \u d c' d-] \m b,-[ \u d-)^3] r8 | \m c16-[( \u f c' f-] \m es-[ \u f es' f-] \m d-[ \u f-)^3-] \m f-[( \u as^2-] | f'-[ as-)-] \m f-[( \u as f' as-)] r8^\fermata r16 e'^2( f' g' | \stemBoth \tieBoth - as' des'^1 c'8^#'(finger "2-3") h~h c'16-) \clef F e,16-[(^2 f, g,] | + as' des'^1 c'8^\markup { \finger "2-3" } h~h c'16-) \clef F e,16-[(^2 f, g,] | \forcedBreak as,-[^5 h,,^2-)-] \clef G <>8-[-( <>16 c'] <>4.~ <>8-) s4 s8 r16 h^2( c' d' | - es' ges-1 f-2 a-1 c'-2 f'-4 \stemUp \tieUp e'-5 d' c' b-4 a^\prall^#'(finger "2-4-3") g | + es' ges-1 f-2 a-1 c'-2 f'-4 \stemUp \tieUp e'-5 d' c' b-4 a^\prall^\markup { \finger "2-4-3" } g | f-) f'-5( e'-5 d'-4 c'-3 f'-)-5 <>4-( <>8 | <>4 <>8 f16^4 d'^5~ d'8.-[ c'16^4] | \forcedBreak - < f8-)^3 \context Voice = another { \m a,16-[^\pp \u c8 c16] } > \m g,-[ \u c_3-] \m b,-[^#'(finger "2-1") \u c8 c16-] \m a,-[ \u c]~ | \stemBoth + < f8-)^3 \context Voice = another { \m a,16-[^\pp \u c8 c16] } > \m g,-[ \u c_3-] \m b,-[^\markup { \finger "2-1" } \u c8 c16-] \m a,-[ \u c]~ | \stemBoth c16 c8_4 c c16~c c8_2 c c16~ | c16 c8 c c16~c c8 c c16~ | c16 c8 c c16 r4^\fermata r8 | \bar "|." @@ -165,8 +164,8 @@ lefta = \notes \transpose c cis { es' des'4^1~ \stemDown des'8.-[ c'16] } } \transpose c' c, { - g4(-4 a8-3~a f-5 g-4 | a4-3 g8-#'(finger "4-3") ~g f-4 e-5 | - d4-)-#'(finger "4-5")( g8-3~g es f-4 | g4-3 f8-4~f es d-4 | + g4(-4 a8-3~a f-5 g-4 | a4-3 g8-\markup { \finger "4-3" } ~g f-4 e-5 | + d4-)-\markup { \finger "4-5" }( g8-3~g es f-4 | g4-3 f8-4~f es d-4 | c4-) r8 f4-4( as8-5~ | as g-4 b-)-5 as4-5( ces'8-4~ | ces' b des'-4 c'4-)-5( <>8 | \stemDown \tieDown des'4.-)_5~des'~ | @@ -220,7 +219,7 @@ leftb = \notes \transpose c cis { \voiceTwo es as,_3 g,8 fis,~fis, g,_4-\arpeggio gis,_5~ | gis, <>16 r16 r8 r4 cis8( | - d-) e( f16_4 d_5 c4.-)_ #'(finger "4-3")~ | + d-) e( f16_4 d_5 c4.-)_ \markup { \finger "4-3" }~ | \oneVoice c16( h,_4 c_3 cis_1 d_2 b,_3 a,_4 as,_1 g,8 c,8-) | \translator Staff = down \stemDown \tieDown @@ -244,11 +243,12 @@ leftb = \notes \transpose c cis { \property PianoStaff.instrument="2. " \context Staff = up { \property Staff.DynamicLineSpanner \override #'direction = #-1 - \clef G <\global \context Voice=upv \righta> + \clef G <\global \context Voice=upv \righta > } \context Staff = mid { % \property Staff.instrument="\\begin{turn}{-90}{Rechte Hand}\\end{turn}" - \property Staff.instrument=#'(rows ((raise . -7.5) "") ((raise . 7.5) (lines "Rechte " "Hand."))) + \property Staff.instrument= \markup { + \column << Rechte Hand >> } \clef F <\global \context Voice=midv \rightb> } \context Staff = down { @@ -277,4 +277,5 @@ leftb = \notes \transpose c cis { } \midi { \tempo 8=100 } } + %% new-chords-done %% diff --git a/input/test/chord-names-american.ly b/input/test/chord-names-american.ly deleted file mode 100644 index 96bb4eaad6..0000000000 --- a/input/test/chord-names-american.ly +++ /dev/null @@ -1,62 +0,0 @@ -\version "1.7.16" -\header { - texidoc = "Chord names in american styles, according to one of our users. - - -FIXME - -" -} - -\include "english.ly" - - -%%FIXME: - -% DON'T do this in the test file, it messes up all other files in the directory. - -% #(set! chord::names-alist-american -% (append -% '( -% ;; any changes here, see scm/chord-name.scm -% ) -% chord::names-alist-american)) - -scheme = \chords { - c % Major triad - cs:m % Minor triad - df:m5- % Diminished triad - c:5^3 % Root-fifth chord - c:4^3 % Suspended fourth triad - c:5+ % Augmented triad - c:2^3 % "2" chord - c:m5-.7- % Diminished seventh - c:7+ % Major seventh - c:7.4^3 % Dominant seventh suspended fourth - c:5+.7 % Augmented dominant seventh - c:m5-.7 % "Half" diminished seventh - c:5-.7 % Dominant seventh flat fifth - c:5-.7+ % Major seventh flat fifth - c:m7+ % Minor-major seventh - c:m7 % Minor seventh - c:7 % Dominant seventh - c:6 % Major sixth - c:m6 % Minor sixth - c:9^7 % Major triad w/added ninth - c:6.9^7 % Six/Nine chord - c:9 % Dominant ninth - c:7+.9 % Major ninth - c:m7.9 % Minor ninth -} - -\score { - \notes < - \context ChordNames { - #(set-chord-name-style 'american) - \scheme - } - \context Staff \transpose c c' \scheme - > -} - -%% new-chords-done %% diff --git a/input/test/ottava.ly b/input/test/ottava.ly index c348d12b6e..87579eb59f 100644 --- a/input/test/ottava.ly +++ b/input/test/ottava.ly @@ -7,7 +7,7 @@ fragment = \notes { \property Voice.TextSpanner \set #'edge-height = #'(0 . 1.5) \property Voice.TextSpanner \set #'edge-text = #'("8va " . "") \property Staff.centralCPosition = #-13 - a#(ly:export (make-span-event 'TextSpanEvent START)) b c a #(ly:export (make-span-event 'TextSpanEvent STOP)) + a-\startTextSpan b c a-\stopTextSpan } \paper { raggedright = ##t} diff --git a/lily/include/translator-def.hh b/lily/include/translator-def.hh index d8a249ca2a..8e755dda48 100644 --- a/lily/include/translator-def.hh +++ b/lily/include/translator-def.hh @@ -29,7 +29,9 @@ private: SCM end_consists_name_list_; SCM accepts_name_list_; SCM property_ops_; + public: + SCM description_; SCM type_name_; SCM type_aliases_; SCM translator_group_type_; diff --git a/lily/my-lily-lexer.cc b/lily/my-lily-lexer.cc index 684cacc8d8..c24a153de1 100644 --- a/lily/my-lily-lexer.cc +++ b/lily/my-lily-lexer.cc @@ -46,6 +46,7 @@ static Keyword_ent the_key_tab[]={ {"context", CONTEXT}, {"default", DEFAULT}, {"denies", DENIES}, + {"description", DESCRIPTION}, {"duration", DURATION}, {"grobdescriptions", GROBDESCRIPTIONS}, {"figures",FIGURES}, diff --git a/lily/ottava-engraver.cc b/lily/ottava-engraver.cc new file mode 100644 index 0000000000..e849a1d3f0 --- /dev/null +++ b/lily/ottava-engraver.cc @@ -0,0 +1,123 @@ +/* + text-spanner-engraver.cc -- implement Ottava_spanner_engraver + + source file of the GNU LilyPond music typesetter + + (c) 2000--2003 Han-Wen Nienhuys + Jan Nieuwenhuizen +*/ + +#include "protected-scm.hh" +#include "note-column.hh" +#include "item.hh" +#include "side-position-interface.hh" +#include "engraver.hh" + +class Ottava_spanner_engraver : public Engraver +{ +public: + TRANSLATOR_DECLARATIONS(Ottava_spanner_engraver); +protected: + virtual void finalize (); + virtual void acknowledge_grob (Grob_info); + virtual void process_music (); + virtual void stop_translation_timestep (); +private: + Spanner *span_; + Spanner *finished_; + + Protected_scm last_ottavation_; + + void typeset_all (); +}; + + +Ottava_spanner_engraver::Ottava_spanner_engraver () +{ + finished_ = 0; + span_ =0; +} + +void +Ottava_spanner_engraver::process_music () +{ + SCM ott = get_property ("ottavation"); + if (ott != last_ottavation_) + { + finished_= span_; + span_ = 0; + if (gh_string_p (ott)) + { + span_ = new Spanner (get_property ("OttavaSpanner")); + span_->set_grob_property ("edge-text", gh_cons (ott, SCM_EOL)); + announce_grob (span_, SCM_EOL); + } + } + + last_ottavation_ = ott; +} + +void +Ottava_spanner_engraver::acknowledge_grob (Grob_info info) +{ + Item *it = dynamic_cast (info.grob_); + if (span_ && it && Note_column::has_interface (info.grob_)) + { + Side_position_interface::add_support (span_, it); + if (!span_->get_bound (LEFT)) + span_->set_bound (LEFT, it); + span_->set_bound (RIGHT, it); + } +} + +void +Ottava_spanner_engraver::typeset_all () +{ + if (finished_) + { + Side_position_interface::add_staff_support (finished_); + + Direction d = LEFT; + do + { + if (!finished_->get_bound (RIGHT)) + { + Grob* e = unsmob_grob (get_property ("currentMusicalColumn")); + finished_->set_bound (d, e); + } + } + while (flip (&d) != LEFT); + + typeset_grob (finished_); + finished_ = 0; + } +} + +void +Ottava_spanner_engraver::stop_translation_timestep () +{ + if (span_ && !span_->get_bound (LEFT)) + { + Grob* e = unsmob_grob (get_property ("currentMusicalColumn")); + span_->set_bound (LEFT, e); + } + + typeset_all (); +} + +void +Ottava_spanner_engraver::finalize () +{ + typeset_all (); + if (span_) + finished_ = span_; + typeset_all(); +} + +ENTER_DESCRIPTION(Ottava_spanner_engraver, +/* descr */ "Create a text spanner when the ottavation property changes..", +/* creats*/ "OttavaSpanner", +/* accepts */ "", +/* acks */ "note-column-interface", +/* reads */ "ottavation", +/* write */ ""); diff --git a/lily/parser.yy b/lily/parser.yy index 09ace3518a..f4eeeca5b3 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -221,6 +221,7 @@ yylex (YYSTYPE *s, void * v) %token SIMULTANEOUS %token CONSISTSEND %token DENIES +%token DESCRIPTION %token EXTENDER %token FIGURES FIGURE_OPEN FIGURE_CLOSE %token FIGURE_BRACKET_CLOSE FIGURE_BRACKET_OPEN @@ -540,6 +541,9 @@ translator_spec_body: td->translator_group_type_ = $2; td->set_spot (THIS->here_input ()); } + | translator_spec_body DESCRIPTION string { + unsmob_translator_def ($$)->description_ = $3; + } | translator_spec_body STRING '=' embedded_scm { unsmob_translator_def ($$)->add_property_assign ($2, $4); } diff --git a/lily/text-spanner-engraver.cc b/lily/text-spanner-engraver.cc index 52f03da940..7fd070d831 100644 --- a/lily/text-spanner-engraver.cc +++ b/lily/text-spanner-engraver.cc @@ -6,18 +6,10 @@ (c) 2000--2003 Jan Nieuwenhuizen */ -#include "dimensions.hh" -#include "event.hh" -#include "paper-column.hh" #include "note-column.hh" #include "item.hh" #include "side-position-interface.hh" #include "engraver.hh" -#include "group-interface.hh" -#include "directional-element-interface.hh" -#include "translator-group.hh" -#include "axis-group-interface.hh" - class Text_spanner_engraver : public Engraver { @@ -107,11 +99,13 @@ Text_spanner_engraver::process_music () current_req_ = req_drul_[START]; span_ = new Spanner (get_property ("TextSpanner")); +#if 0 /* Ugh. Reset (de)cresc. specific properties */ - span_->set_grob_property ("outer", SCM_BOOL_T); + span_->set_grob_property ("enclose-bounds", SCM_BOOL_T); span_->set_grob_property ("if-text-padding", gh_double2scm (0)); span_->set_grob_property ("width-correct", gh_double2scm (0)); - +#endif + Side_position_interface::set_axis (span_, Y_AXIS); announce_grob (span_, req_drul_[START]->self_scm()); req_drul_[START] = 0; diff --git a/lily/text-spanner.cc b/lily/text-spanner.cc index d143013ed3..0864d55a3d 100644 --- a/lily/text-spanner.cc +++ b/lily/text-spanner.cc @@ -1,10 +1,10 @@ /* -text-spanner.cc -- implement Text_spanner + text-spanner.cc -- implement Text_spanner -source file of the GNU LilyPond music typesetter + source file of the GNU LilyPond music typesetter -(c) 2000--2003 Jan Nieuwenhuizen + (c) 2000--2003 Jan Nieuwenhuizen */ #include "molecule.hh" @@ -46,7 +46,11 @@ Text_spanner::brew_molecule (SCM smob) } /* Ugh, must be same as Hairpin::brew_molecule. */ - Real padding = gh_scm2double (me->get_grob_property ("if-text-padding")); + Real padding = 0.0; + SCM itp= me->get_grob_property ("if-text-padding"); + if (gh_number_p (itp)) + padding = gh_scm2double (itp); + Real broken_left = spanner->get_broken_left_end_align (); Real width = spanner->spanner_length (); width -= broken_left; @@ -70,7 +74,7 @@ Text_spanner::brew_molecule (SCM smob) /* Text spanners such as ottava, should span from outer limits of noteheads, iso (de)cresc. spanners that span the inner space */ - if (me->get_grob_property ("outer") != SCM_EOL) + if (me->get_grob_property ("enclose-bounds") != SCM_EOL) { width -= d * r; } @@ -293,5 +297,5 @@ ADD_INTERFACE (Pianopedal,"piano-pedal-interface", ADD_INTERFACE (Text_spanner,"text-spanner-interface", "generic text spanner", - "dash-period if-text-padding dash-length edge-height edge-widen edge-text shorten-pair type thickness outer width-correct"); + "dash-period if-text-padding dash-length edge-height edge-widen edge-text shorten-pair type thickness enclose-bounds width-correct"); diff --git a/lily/translator-def.cc b/lily/translator-def.cc index 8c8c459bc5..551c0b59d5 100644 --- a/lily/translator-def.cc +++ b/lily/translator-def.cc @@ -31,6 +31,7 @@ Translator_def::mark_smob (SCM smob) { Translator_def* me = (Translator_def*) SCM_CELL_WORD_1 (smob); + scm_gc_mark (me->description_); scm_gc_mark (me->type_aliases_); scm_gc_mark (me->consists_name_list_); scm_gc_mark (me->accepts_name_list_); @@ -50,6 +51,7 @@ Translator_def::Translator_def () end_consists_name_list_ = SCM_EOL; property_ops_ = SCM_EOL; type_name_ = SCM_EOL; + description_ = SCM_EOL; smobify_self(); @@ -69,9 +71,11 @@ Translator_def::Translator_def (Translator_def const & s) end_consists_name_list_ = SCM_EOL; property_ops_ = SCM_EOL; type_name_ = SCM_EOL; - + description_ = SCM_EOL; smobify_self(); + description_ = s.description_; + consists_name_list_ = scm_list_copy (s.consists_name_list_); end_consists_name_list_ = scm_list_copy (s.end_consists_name_list_); accepts_name_list_ = scm_list_copy (s.accepts_name_list_); @@ -327,10 +331,17 @@ Translator_def::to_alist () const SCM l = SCM_EOL; l = gh_cons (gh_cons (ly_symbol2scm ("consists"), consists_name_list_), l); - l = gh_cons (gh_cons (ly_symbol2scm ("end-consists"), end_consists_name_list_), l); + l = gh_cons (gh_cons (ly_symbol2scm ("description"), description_), l); + l = gh_cons (gh_cons (ly_symbol2scm ("end-consists"), + end_consists_name_list_), l); l = gh_cons (gh_cons (ly_symbol2scm ("accepts"), accepts_name_list_), l); l = gh_cons (gh_cons (ly_symbol2scm ("property-ops"), property_ops_), l); - l = gh_cons (gh_cons (ly_symbol2scm ("type-name"), type_name_), l); // junkme. + + /* + junkme: + */ + l = gh_cons (gh_cons (ly_symbol2scm ("type-name"), type_name_), l); + l = gh_cons (gh_cons (ly_symbol2scm ("group-type"), translator_group_type_), l); return l; diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly index 7151edd13e..da047f5658 100644 --- a/ly/engraver-init.ly +++ b/ly/engraver-init.ly @@ -6,7 +6,12 @@ StaffContext=\translator { \type "Engraver_group_engraver" - \name Staff + \name Staff + + \description "Handles clefs, bar lines, keys, accidentals. It can contain +@code{Voice} contexts." + + \consists "Output_property_engraver" \consists "Bar_engraver" @@ -21,6 +26,8 @@ StaffContext=\translator { = #Separating_group_spanner::set_spacing_rods_and_seqs \consists "Dot_column_engraver" + % perhaps move to Voice context? + \consists "Ottava_spanner_engraver" \consists "Clef_engraver" \consists "Key_engraver" \consists "Time_signature_engraver" @@ -80,6 +87,10 @@ InnerChoirStaffContext = \translator { ChoirStaffContext = \translator { \InnerChoirStaffContext \name ChoirStaff + + \description "Identical to @code{StaffGroup} except that the + contained staves are not connected vertically." + \accepts "InnerChoirStaff" \accepts "InnerStaffGroup" } @@ -90,7 +101,11 @@ RhythmicStaffContext=\translator{ \consists "Output_property_engraver" - +\description " + A context like @code{Staff} but for printing rhythms. Pitches are + ignored; the notes are printed on one line. It can contain + @code{Voice} contexts. +" minimumVerticalExtent = ##f extraVerticalExtent = ##f verticalExtent = ##f @@ -123,7 +138,13 @@ RhythmicStaffContext=\translator{ VoiceContext = \translator { \type "Engraver_group_engraver" \name Voice +\description " + Corresponds to a voice on a staff. This context handles the + conversion of dynamic signs, stems, beams, super- and subscripts, + slurs, ties, and rests. + You have to instantiate this explicitly if you want to have + multiple voices on the same staff." localKeySignature = #'() \consists "Font_size_engraver" @@ -175,7 +196,11 @@ ThreadContext = \translator{ \type Engraver_group_engraver \name Thread localKeySignature = #'() - +\description " + Handles note heads, and is contained in the Voice context. You + have to instantiate this explicitly if you want to adjust the + style of individual note heads. +" \consists "Font_size_engraver" \consists "Thread_devnull_engraver" \consists "Note_heads_engraver" @@ -193,6 +218,12 @@ GrandStaffContext=\translator{ \type "Engraver_group_engraver" \name GrandStaff localKeySignature = #'() + \description " + Contains @code{Staff} or @code{RhythmicStaff} contexts. It adds a + brace on the left side, grouping the staves together. The bar + lines of the contained staves are connected vertically. It can + contain @code{Staff} contexts." + \consists "Span_bar_engraver" \consists "Span_arpeggio_engraver" \consists "System_start_delimiter_engraver" @@ -205,7 +236,10 @@ PianoStaffContext = \translator{ \GrandStaffContext \name "PianoStaff" \alias "GrandStaff" - +\description " + Just like @code{GrandStaff} but with @code{minVerticalAlign} set + equal to @code{maxVerticalAlign} so that interstaff beaming and + slurring can be used." verticalAlignmentChildCallback = #Align_interface::fixed_distance_alignment_callback VerticalAlignment \override #'forced-distance = #12 VerticalAlignment \override #'self-alignment-Y = #0 @@ -242,6 +276,14 @@ InnerStaffGroupContext= \translator { StaffGroupContext = \translator { \InnerStaffGroupContext \name StaffGroup + \description " + Contains @code{Staff} or @code{RhythmicStaff} contexts. Adds a + bracket on the left side, grouping the staves together. The bar + lines of the contained staves are connected vertically. It can + contain @code{Staff}, @code{RhythmicStaff}, @code{GrandStaff}, or + @code{Lyrics} contexts. +" + \accepts "InnerChoirStaff" \accepts "ChoirStaff" \accepts "InnerStaffGroup" @@ -255,7 +297,13 @@ LyricsVoiceContext= \translator{ \consistsend "Hara_kiri_engraver" minimumVerticalExtent = #'(-1.2 . 1.2) extraVerticalExtent = ##f - verticalExtent = ##f + verticalExtent = ##f + + \description " + Corresponds to a voice with lyrics. Handles the printing of a + single line of lyrics. +" + \name LyricsVoice \consists "Separating_line_group_engraver" \consists "Lyric_engraver" @@ -283,7 +331,7 @@ NoteNamesContext = \translator { LyricsContext = \translator { \type "Engraver_group_engraver" \name Lyrics - + \description "Typesets lyrics." %% To get folded repeats right. \consists Vertical_align_engraver @@ -299,7 +347,8 @@ LyricsContext = \translator { ChordNamesContext = \translator { \type "Engraver_group_engraver" \name ChordNames - +\description " Typesets chord names." + \consists "Rest_swallow_translator" \consists "Output_property_engraver" \consists "Separating_line_group_engraver" @@ -337,6 +386,19 @@ ScoreContext = \translator { \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 + handles the administration of time signatures. It also makes sure + that items such as clefs, time signatures, and key-signatures are + aligned across staves. It can contain @code{Lyrics}, + @code{Staff}, @code{RhythmicStaff}, @code{GrandStaff}, + @code{StaffGroup}, and @code{ChoirStaff} contexts. + + You cannot explicitly instantiate a Score context (since it is + not contained in any other context). It is instantiated + automatically when an output definition (a @code{\score} or + @code{\paper} block) is processed." \consists "Repeat_acknowledge_engraver" \consists "Staff_collecting_engraver" @@ -467,10 +529,7 @@ EasyNotation = \translator { NoteHead \override #'molecule-callback = #Note_head::brew_ez_molecule } -% retain for compatibility reasons (FIXME: convert-ly) -GraceContext = \translator { - \type "Engraver_group_engraver" -} + FiguredBassContext = \translator { \type "Engraver_group_engraver" @@ -507,6 +566,9 @@ TabStaffContext = \translator { \alias "Staff" \name "TabStaff" \denies "Voice" + + \description "Context for generating tablature. [DOCME]" + \accepts "TabVoice" % 6 strings diff --git a/ly/spanners-init.ly b/ly/spanners-init.ly index 6bbdcf93cc..f4d704fbed 100644 --- a/ly/spanners-init.ly +++ b/ly/spanners-init.ly @@ -4,8 +4,8 @@ startCluster = #(make-span-event 'ClusterEvent START) stopCluster = #(make-span-event 'ClusterEvent STOP) -groupOpen = #(make-span-event 'NoteGroupingEvent START) -groupClose = #(make-span-event 'NoteGroupingEvent STOP) +startGroup = #(make-span-event 'NoteGroupingEvent START) +stopGroup = #(make-span-event 'NoteGroupingEvent STOP) cr = #(make-span-event 'CrescendoEvent START) diff --git a/scm/basic-properties.scm b/scm/basic-properties.scm deleted file mode 100644 index 85eb346bf4..0000000000 --- a/scm/basic-properties.scm +++ /dev/null @@ -1,2 +0,0 @@ -; Definition of backend properties (aka. element properties). - diff --git a/scm/context-description.scm b/scm/context-description.scm deleted file mode 100644 index 649a600e04..0000000000 --- a/scm/context-description.scm +++ /dev/null @@ -1,88 +0,0 @@ - -;; todo: move this to engraver-init.ly - -(define-public context-description-alist - '( - (Grace . " - DEPRECATED; this is a 1.4 construct. -") - (LyricsVoice . " - Corresponds to a voice with lyrics. Handles the printing of a - single line of lyrics. -") - (Thread . " - Handles note heads, and is contained in the Voice context. You - have to instantiate this explicitly if you want to adjust the - style of individual note heads. -") - (Voice . " - Corresponds to a voice on a staff. This context handles the - conversion of dynamic signs, stems, beams, super- and subscripts, - slurs, ties, and rests. - - You have to instantiate this explicitly if you want to have - multiple voices on the same staff.") - - (ChordNamesVoice . " - A voice with chord names. Handles printing of a line of chord - names.") - - (ChordNames . " - Typesets chord names. Can contain @code{ChordNamesVoice} - contexts.") - - (Lyrics . " - Typesets lyrics. It can contain @code{LyricsVoice} contexts. -") - (Staff . " - Handles clefs, bar lines, keys, accidentals. It can contain - @code{Voice} contexts. -") - (RhythmicStaff . " - A context like @code{Staff} but for printing rhythms. Pitches are - ignored; the notes are printed on one line. It can contain - @code{Voice} contexts. -") - (GrandStaff . " - Contains @code{Staff} or @code{RhythmicStaff} contexts. It adds a - brace on the left side, grouping the staves together. The bar - lines of the contained staves are connected vertically. It can - contain @code{Staff} contexts.") - - (PianoStaff . " - Just like @code{GrandStaff} but with @code{minVerticalAlign} set - equal to @code{maxVerticalAlign} so that interstaff beaming and - slurring can be used.") - - (StaffGroup . " - Contains @code{Staff} or @code{RhythmicStaff} contexts. Adds a - bracket on the left side, grouping the staves together. The bar - lines of the contained staves are connected vertically. It can - contain @code{Staff}, @code{RhythmicStaff}, @code{GrandStaff}, or - @code{Lyrics} contexts. -") - (ChoirStaff . " - Identical to @code{StaffGroup} except that the contained staves - are not connected vertically. -") - (Score . " - This is the top level notation context. No other context can - contain a @code{Score} context. This context handles the - administration of time signatures. It also makes sure that items - such as clefs, time signatures, and key-signatures are aligned - across staves. It can contain @code{Lyrics}, @code{Staff}, - @code{RhythmicStaff}, @code{GrandStaff}, @code{StaffGroup}, and - @code{ChoirStaff} contexts. - - You cannot explicitly instantiate a Score context (since it is - not contained in any other context). It is instantiated - automatically when an output definition (a @code{\score} or - @code{\paper} block) is processed. -") - - (TabStaff . "Context for generating tablature. [DOCME]") - ) - ) - -(set! context-description-alist - (sort context-description-alist alist +;;;; Jan Nieuwenhuizen + + + +(define-public all-backend-properties '()) + +(define (grob-property-description symbol type? description) + (if (not (equal? (object-property symbol 'backend-doc) #f)) + (begin + (ly:warn (string-append "Redefining " (symbol->string symbol) "\n")) + (exit 2) + )) + + (set-object-property! symbol 'backend-type? type?) + (set-object-property! symbol 'backend-doc description) + (set! all-backend-properties (cons symbol all-backend-properties)) + ) + +;; put this in an alist? + +(grob-property-description 'X-extent-callback procedure? "procedure taking an grob and axis argument, returning a number-pair. The return value is the extent of the grob. + +The size of a grob are determined through callbacks, settable with +grob properties @code{X-extent-callback} and @code{Y-extent-callback}. +There can be only one extent-callback for each axis. No callback +(Scheme value @code{#f}) means: `empty in this direction'. If you fill +in a pair of numbers, that pair hard-codes the extent in that +coordinate. +") +(grob-property-description 'X-offset-callbacks list? "list of functions, each taking an grob and axis argument. The function determine the position relative to this grob's parent. The last one in the list is called first. + +Offsets of grobs are relative to a parent reference point. Most +positions are not known when an object is created, so these are +calculated as needed. This is done by adding a callback for a specific +direction. + +Offset callbacks can be stacked, i.e. + +@example + \property .... \override #'Y-offset-callbacks = #(list + callback1 callback2 callback3) + +@end example + +The callbacks will be executed in the order @code{callback3 callback2 +callback1}. This is used for quantized positioning: the staccato dot is +above or below a note head, and it must not be on a staff-line. To +achieve this, the staccato dot has two callbacks: one that positions the +grob above or below the note head, and one that rounds the Y-position of +the grob to the nearest open space. + + +") +(grob-property-description 'Y-extent-callback procedure? "see @code{X-extent-callback}.") +(grob-property-description 'Y-offset-callbacks list? "see @code{X-offset-callbacks}.") + +(grob-property-description 'accidental-grobs list? "Alis with (NOTENAME . GROBLIST) entries") +(grob-property-description 'accidentals list? "List of alteration numbers.") +(grob-property-description 'add-stem boolean? "does this flexa shape require an additional stem on the left side?.") +(grob-property-description 'adjust-if-on-staffline boolean? "If this grob is on a staff line, adjust its appearance, so that it better fits into the staff. E.g., if set true on stem grobs, flares of mensural flags will always be aligned with the staff lines, regardless if the associated note head is printed on a staff line or inbetween.") +(grob-property-description 'after-line-breaking-callback procedure? "Procedure taking a grob as argument. +This procedure is called (using dependency resolution) after line breaking. Return value is ignored.") +(grob-property-description 'align-dir ly:dir? "Which side to align? -1: left side, 0: around center of width, 1: right side.") +(grob-property-description 'alignment-done boolean? "boolean to administrate whether we've done the alignment already (to ensure that the process is done only once).") +(grob-property-description 'all-elements grob-list? "list of all grobs in this line. Needed for protecting grobs from GC.") +(grob-property-description 'arch-angle number? "turning angle of the hook of a system brace" ) +(grob-property-description 'arch-height ly:dimension? "height of the hook of a system brace.") +(grob-property-description 'arch-thick number? "thickness of the hook of system brace.") +(grob-property-description 'arch-width ly:dimension? "width of the hook of a system brace.") +(grob-property-description 'arpeggio ly:grob? "pointer to arpeggio object.") +(grob-property-description 'arpeggio-direction ly:dir? "If set, put an +arrow on the arpeggio squiggly line.") +(grob-property-description 'ascendens boolean? "is this neume of an ascending?.") +(grob-property-description 'attachment pair? "cons of symbols +indicating how a slur should be attached at the ends. The format is +'(LEFT-TYPE . RIGHT-TYPE), where both TYPEs are symbols. The values of +these symbols may be alongside-stem, stem, head or loose-end.") +(grob-property-description 'attachment-offset pair? "cons of offsets, +'(LEFT-offset . RIGHT-offset). This offset is added to the +attachments to prevent ugly slurs. [fixme: we need more documentation here]. +.") +(grob-property-description 'auctum boolean? "is this neume augmented?.") +(grob-property-description 'auto-knee-gap ly:dimension? "If a gap is found between noteheads +where a horizontal beam fits that is larger than this number, make a kneed beam.") +(grob-property-description 'axes list? "list of axis numbers. +In the case of alignment grobs, this should contain only one number.") +(grob-property-description 'bar-size ly:dimension? "size of a bar line.") +(grob-property-description 'bars grob-list? "list of barline pointers.") +(grob-property-description 'bar-size-procedure procedure? "Procedure that computes the size of a bar line.") +(grob-property-description 'base-shortest-duration ly:moment? + "Spacing is based on the shortest notes in a piece. Normally, pieces are spaced as if notes at least as short as this are present.") +(grob-property-description 'baseline-skip ly:dimension? "Baseline skip to use for multiple lines of text.") +(grob-property-description 'bass list? " musical-pitch, optional.") +(grob-property-description 'beam ly:grob? "pointer to the beam, if applicable.") +(grob-property-description 'beam-thickness ly:dimension? "thickness, measured in staffspace.") +(grob-property-description 'beam-width ly:dimension? "width of the tremolo sign.") +(grob-property-description 'beamed-lengths list? "list of stem lengths given beam multiplicity .") +(grob-property-description 'beamed-minimum-free-lengths list? "list of normal minimum free stem lengths (chord to beams) given beam multiplicity.") +(grob-property-description 'beamed-extreme-minimum-free-lengths list? "list of extreme minimum free stem lengths (chord to beams) given beam multiplicity.") +(grob-property-description 'beamed-stem-shorten list? "shorten beamed stems in forced direction.") +(grob-property-description 'beaming pair? + "Pair of number lists. Each number list +specifies which beams to make. 0 is the central beam, 1 is the next +beam toward the note etc. This information is used to determine how to +connect the beaming patterns from stem to stem inside a beam.") + + +(grob-property-description 'beautiful number? "number that dictates when a slur should be de-uglyfied. It correlates with the enclosed area between noteheads and slurs. A value of 0.1 yields only undisturbed slurs, a value of 5 will tolerate quite high blown slurs.") +(grob-property-description 'before-line-breaking-callback procedure? "Procedure taking grob as argument. +This procedure is called (using dependency resolution) before line breaking, but after generating discretionary items. Return value is ignored.") +(grob-property-description 'between-cols pair? "Where to attach a loose column to") +(grob-property-description 'between-system-string string? "string + to dump between two systems. Useful for forcing pagebreaks.") +(grob-property-description 'bounded-by-me grob-list? "list of spanners that have this +column as start/begin point. Only columns that have grobs or act as bounds are spaced.") +(grob-property-description 'bracket-thick number? "width of a system start bracket. .") +(grob-property-description 'break-align-symbol symbol? "the index in the spacing table (symbol) of the to be aligned item.") +(grob-property-description 'break-glyph-function procedure? "function taking glyph and break-direction, returning the glyph at a line break.") +(grob-property-description 'breakable boolean? "boolean indicating if this is a breakable item (clef, barline, key sig, etc.).") +(grob-property-description 'c0-position integer? "integer indicating the position of central C.") +(grob-property-description 'cautionary-style symbol? "style of cautionary accidentals. Choices are 'smaller (one size smaller) or 'parentheses.") +(grob-property-description 'cautionary boolean? "is this a cautionary accidentals.?") + +(grob-property-description 'center-element ly:grob? "grob which will +be at the center of the group after aligning (when using +Align_interface::center_on_element). .") +(grob-property-description 'concaveness-gap ly:dimension? "A beam is +considered to be concave if the distance of an inner notehead to the +line between two outer noteheads is bigger than this gap.") +(grob-property-description 'concaveness-threshold number? "A beam is +considered to be concave is concaveness is bigger than this threshold. +Concaveness is calculated as the sum of the vertical distances of +inner noteheads that fall outside the interval of the two outer +noteheads, to the vertically nearest outer notehead, divided by the +square of the inner notes involved.") +(grob-property-description 'collapse-height ly:dimension? "Minimum height of system start delimiter. If equal or smaller, the bracket is removed.") + +(grob-property-description 'columns grob-list? "list of grobs, typically containing paper-columns.") +(grob-property-description 'conditional-elements grob-list? "Internal use only") +(grob-property-description 'context-info integer? "DOCME") + +(grob-property-description 'control-points list? "List of 4 offsets (number-pairs) that form control points for the tie/slur shape.") +(grob-property-description 'damping integer? "amount of beam slope damping should beam slope be damped? 0: no, 1: yes, 100000: horizontal beams .") +(grob-property-description 'dash-length number? "the length of a dash.") +(grob-property-description 'dash-period number? "the length of one dash + white space.") +(grob-property-description 'dashed number? "[FIXME: use dash-period/dash length; see text-spanner] number representing the length of the dashes.") +(grob-property-description 'descendens boolean? "is this neume of a descendent type?.") +(grob-property-description 'de-uglify-parameters list? "list of 3 real constants. They define the valid areas for the middle control points. Used in de_uglyfy. They are a bit empirical.") + +(grob-property-description 'neutral-direction ly:dir? "Where to go if we're on the neutral position of the staff (by default, the middle of the staff; see also grob-property neutral-position). [Ross] has the following to say about this: Some engravers consider the middle line neutral, and take the option of using either up- or down-stems for notes that fall on it. However, more up-to-date engraving no longer permits an option; now a down-stem is always appropriate.") +(grob-property-description 'neutral-position number? "Position (in half staff spaces) where to flip the direction of stems: by default, custodes above this position get their stems downwards; custodes below this position get their stems upwards. A value of 0 designates the center of the staff. Use property neutral-direction to control the behaviour of stems on the neutral position itself. (Note: currently, neutral-position is supported only for custodes; for stems of note heads, neutral-position is currently fixed to 0, i.e. the middle of the staff.)") +(grob-property-description 'deminutum boolean? "is this neume deminished?.") +(grob-property-description 'dependencies grob-list? "list of score-grob pointers that indicate who to compute first for certain global passes.") +(grob-property-description 'details list? "alist of parameters for detailed grob behavior.") +(grob-property-description 'dir-function procedure? "function of type (count total)->direction. Default value: beam-dir-majority, also available: beam-dir-mean, beam-dir-median. + +The ways to calculate the direction of a beam work as follows: +@table @code +@item majority +number count of up or down notes +@item mean +mean center distance of all notes +@item median +mean centre distance weighted per note +@end table + +") +(grob-property-description 'direction ly:dir? "up or down, left or right?.") +(grob-property-description 'direction-source ly:grob? "in case side-relative-direction is set, which grob to get the direction from .") +(grob-property-description 'dot ly:grob? "reference to Dots object.") +(grob-property-description 'dot-count integer? "number of dots.") +(grob-property-description 'duration-log integer? "2-log of the notehead duration, i.e. 0=whole note, 1 = half note, etc.") +(grob-property-description 'edge-height pair? "a cons that specifies the heights of the vertical edges '(LEFT-height . RIGHT-height).") +(grob-property-description 'edge-widen pair? "a cons that specifies the widths of the slanted edges '(LEFT-width . RIGHT-width).") +(grob-property-description 'edge-text pair? "a cons that specifies the texts to be set at the edges '(LEFT-text . RIGHT-text).") +(grob-property-description 'elements grob-list? "list of grobs, type depending on the Grob where this is set in.") +(grob-property-description 'expand-limit integer? "maximum number of measures expanded in church rests.") +(grob-property-description 'extra-X-extent number-pair? "enlarge in X dimension by this much, measured in staff space.") +(grob-property-description 'extra-Y-extent number-pair? "see @code{extra-Y-extent}.") +(grob-property-description 'X-extent number-pair? "Store extent. internal use only. ") +(grob-property-description 'Y-extent number-pair? "Store extent. internal use only. ") +(grob-property-description 'extra-offset number-pair? "pair of reals +(a cons) forcing an extra offset before outputting. +@code{extra-offset} is added just before `printing' the grob, so the +typesetting engine is completely oblivious to it. +") +(grob-property-description 'extremity-offset-alist list? "an alist (attachment stem-dir*dir slur-dir*dir) -> offset. The offset adds to the centre of the notehead, or stem.") + +(grob-property-description 'extremity-rules list? "an alist (procedure +slur dir) -> attachment to determine the attachment (see above). If +procedure returns #t, attachment is used. Otherwise, the next +procedure is tried.") +(grob-property-description + 'flag-style symbol? + "a string determining what style of glyph is typeset on a Stem. Valid +options include undefined and mensural. + Additionally, @code{no-flag} switches off the flag.") +(grob-property-description 'stroke-style string? "set to \"grace\" to turn stroke through flag on.") +(grob-property-description 'flag-width-function procedure? "Procedure that computes the width of a half-beam (a non-connecting beam.).") +(grob-property-description 'flexa-height ly:dimension? "height of a flexa shape in a ligature grob in staff_space.") +(grob-property-description 'flexa-width ly:dimension? "width of a flexa shape in a ligature grob in staff_space.") +(grob-property-description 'font-family symbol? "partial font +definition: music roman braces dynamic math ...") +(grob-property-description 'font-name string? "file name for the font to load. +Overrides all other font-X qualifiers.") +(grob-property-description 'font-design-size number? "partial font definition: exact font size in points FIXME: should override font-relative-size.") +(grob-property-description 'font-magnification number? "Magnification + of the font. If undefined, the default is @code{1.0}.") + +(grob-property-description 'font-relative-size number? "partial font +definition: the relative size compared the `normal' size. 0 is +style-sheet's normal size, -1 is smaller, +1 is bigger.") + +(grob-property-description 'font-series symbol? "partial font definition: medium, bold.") +(grob-property-description 'font-shape symbol? "partial font definition: upright or italic.") + +(grob-property-description 'font-style symbol? "a precooked set of font +definitions, eg. finger volta timesig mark script large Large +dynamic.") + +(grob-property-description 'force-hshift number? "amount of +collision_note_width that overides automatic collision settings. This +is used by @ref{note-collision-interface}.") + +(grob-property-description 'fraction number-pair? "fraction of a time signature.") +(grob-property-description 'french-beaming boolean? "Use French +beaming style: stems stop at innermost beams.") +(grob-property-description 'full-size-change boolean? "if set, don't make a change clef smaller.") + +(grob-property-description 'glyph string? "a string determining what (style) of glyph is typeset. Valid choices depend on the function that is reading this property. .") +(grob-property-description 'glyph-name string? "a name of character within font.") +(grob-property-description 'glyph-name-procedure procedure? "Return +name of character within font.") + +(grob-property-description 'gap ly:dimension? "Size of a gap in a variable symbol.") + +(grob-property-description 'grow-direction ly:dir? "crescendo or decrescendo?.") +(grob-property-description 'hair-thickness number? "thickness, measured in stafflinethickness.") +(grob-property-description 'heads pair? "Pair of grob pointers, pointing to the two heads of the tie.") +(grob-property-description 'height ly:dimension? "in staffspace.") +(grob-property-description 'height-limit ly:dimension? "Maximum slur height, + long slurs approach this height. + + For small width w, the height should be proportional to w, for w -> + infinity, the height should rise to limit h_infinity asymptotically. + + Hence we take F (x) such that +@quotation +@example + F (0) = 0 , F' (0) = 1, and F (infinity) = 1 +@end example +@end quotation + where +@quotation +@example + h = height-limit * F (x * ratio / height-limit) +@end example +@end quotation + Currently, for F we use +@quotation +@example + F (x) = 2/pi * atan (pi * x/2) +@end example +@end quotation +") +(grob-property-description 'horizontal-shift integer? "integer that identifies ranking of note-column for horizontal shifting. This is used by @ref{note-collision-interface}.") +(grob-property-description 'ideal-distances list? "(OBJ . (DIST . STRENGTH)) pairs.") +(grob-property-description 'inclinatum boolean? "is this neume an inclinatum?.") +(grob-property-description 'interfaces list? "list of symbols indicating the interfaces supported by this object. Is initialized from the @code{meta} field.") +(grob-property-description 'inversion list? " musical-pitch, optional.") +(grob-property-description 'items-worth-living grob-list? "list of interesting items. If empty in a particular system, clear that system.") +(grob-property-description 'join-heads boolean? "Whether to join the noteheads of an ambitus grob with a vertical line.") +(grob-property-description 'kern ly:dimension? "amount of extra white +space to add. For barline, space after a thick line.") +(grob-property-description 'knee boolean? "Is this beam a knee?") +(grob-property-description 'knee-spacing-correction number? "optical correction amount for knees. 0: no correction; 1: full correction.") +(grob-property-description 'layer number? "The output layer [0..2]. The default is 1.") + +(grob-property-description 'left-position number? "position of left part of spanner.") +(grob-property-description 'right-position number? "position of right part of spanner.") +(grob-property-description 'left-padding ly:dimension? "space left of accs.") + +(grob-property-description 'left-widen boolean? "Whether the left edge of a piano pedal bracket should be widened by the first element of edge-widen.") + +(grob-property-description 'length ly:dimension? "Stem length for unbeamed stems, only for user override.") +(grob-property-description 'lengths list? "Stem length given +multiplicity of flag. The Nth element of the list gives the stem +length of a note with N flags. +") +(grob-property-description 'line-count integer? "Number of staff +lines. If you want to override this for staffs individually, you must +use @code{\outputproperty}. @code{\property .. \override} will not +work: @code{\override} is processed after the StaffSymbol is created, +and will have no effect. +") +(grob-property-description 'maximum-length ly:dimension? "don't make Grob longer than this") +(grob-property-description 'maximum-rest-count integer? "kill off rests so we don't more than this number left.") +(grob-property-description 'measure-length ly:moment? "Length of a +measure. Used in some spacing situations.") +(grob-property-description 'measure-count integer? "number of measures for a multimeasure rest.") + +(grob-property-description 'merge-differently-headed boolean? "Merge +noteheads in collisions, even if they have different note heads. The +smaller of the two heads will be rendered invisible. This used +polyphonic guitar notation. The value of this setting is used by +@ref{note-collision-interface} .") + +(grob-property-description 'merge-differently-dotted boolean? " Merge +noteheads in collisions, even if they have a different number of +dots. This normal notation for some types of polyphonic music. The +value of this setting is used by @ref{note-collision-interface} .") + +(grob-property-description 'meta list? "Alist of meta information of this grob. + +The alist contains the following entries: name, interfaces. + + + +") +(grob-property-description 'minimum-distance ly:dimension? "minimum distance between notes and rests.") +(grob-property-description 'minimum-distances list? "list of rods (ie. (OBJ . DIST) pairs).") + +(grob-property-description 'minimum-X-extent number-pair? "minimum size in X dimension, measured in staff space.") +(grob-property-description 'minimum-Y-extent number-pair? "see @code{minimum-Y-extent}.") +(grob-property-description 'minimum-length ly:dimension? "try to make the +Grob at least this long. + +Also works as a scaling parameter for the length of hyphen. .") + +(grob-property-description 'minimum-space ly:dimension? "minimum distance that the victim should move (after padding).") + +(grob-property-description 'molecule-callback procedure? "Function +taking grob as argument, returning a smobbed Molecule. + +All visible, i.e. non-transparent, grobs have a callback to create a +Molecule. The callback should be a Scheme function taking one argument +(the grob) and returning a Molecule. Most molecule callbacks are +written in C++, but you can also write them in Scheme. An example is +provided in @code{input/regression/molecule-hacking.ly}. +") + +(grob-property-description 'molecule ly:molecule? "Cached output of the molecule-callback.") + +(grob-property-description 'new-accidentals list? "list of (pitch, accidental) pairs.") +(grob-property-description 'no-spacing-rods boolean? "read from grobs: boolean that makes Separation_item ignore this item (MOVE ME TO ITEM).") +(grob-property-description 'no-stem-extend boolean? "should stem not be extended to middle staff line?.") +(grob-property-description 'non-default boolean? "not set because of existence of a bar?.") +(grob-property-description 'note-head-style string? "name of the font character to be used as note heads in the ambitus grob.") +(grob-property-description 'note-heads grob-list? "List of note head grobs") +(grob-property-description 'old-accidentals list? "list of (pitch, accidental) pairs.") +(grob-property-description 'oriscus boolean? "is this neume an oriscus?.") +(grob-property-description 'enclose-bounds boolean? "whether a text spanner should extend to the outer edge of the spanned notes") +(grob-property-description 'padding ly:dimension? "add this much extra space between objects that are next to each other.") +(grob-property-description 'pedal-type symbol? "Style of piano pedal: text, bracket or mixed.") +(grob-property-description 'pedal-text ly:grob? "Pointer to the text of a mixed-style piano pedal.") +(grob-property-description '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.") + +(grob-property-description 'pes-or-flexa boolean? "shall this neume be joined with the previous head?.") +(grob-property-description 'pitch-max ly:pitch? "FIXME, JUNKME") +(grob-property-description 'pitch-min ly:pitch? "FIXME, JUNKME") + + +(grob-property-description 'pitches list? "list of musical-pitch.") +(grob-property-description 'quilisma boolean? "is this neume a quilisma?.") +(grob-property-description 'positions pair? "cons of staff positions (LEFT . RIGHT") +(grob-property-description 'prefix-set number? "DOCME") +(grob-property-description 'ratio number? "Slur parameter. See height-limit.") +(grob-property-description 'right-padding ly:dimension? "space right of accs.") +(grob-property-description 'right-trim-amount ly:dimension? "shortening of the lyric extender on the right.") +(grob-property-description 'right-widen boolean? "Whether the right edge of a piano pedal bracket should be widened by the second element of edge-widen") +(grob-property-description 'script-priority number? "A sorting key that determines in what order a script is within a stack of scripts.") +(grob-property-description 'self-alignment-X number-or-grob? "real number: -1 = +left aligned, 0 = center, 1 right-aligned in X direction. + + Set to an grob pointer, if you want that grob to be the center. +In this case, the center grob should have this object as a +reference point. + +TODO: revise typing.") +(grob-property-description 'self-alignment-Y number? "like self-alignment-X but for Y axis.") +(grob-property-description 'semivocalis boolean? "is this neume a lisquescending one?.") +(grob-property-description 'shorten ly:dimension? "the amount of space that a stem should be shortened (DOCME!)") +(grob-property-description 'shorten-pair number-pair? "the length on each side to shorten a text-spanner, for example a pedal bracket") +(grob-property-description 'common-shortest-duration ly:moment? + "The most common shortest note length. +This is used in spacing. Making this larger will make the score tighter.") +(grob-property-description 'shortest-duration-space ly:dimension? "Start +with this much space for the shortest duration. This is explessed in @code{spacing-increment} as unit. See also +@ref{spacing-spanner-interface}.") +(grob-property-description 'shortest-playing-duration ly:moment? "duration of the shortest playing in that column.") +(grob-property-description 'shortest-starter-duration ly:moment? "duration of the shortest notes that starts exactly in this column.") +(grob-property-description 'side-relative-direction ly:dir? "if set: get the direction from a different object, and multiply by this.") +(grob-property-description 'side-support-elements grob-list? "the support, a list of grobs.") +(grob-property-description 'slope number? "some kind of slope") +(grob-property-description 'slope-limit number? "set slope to zero if slope is running away steeper than this.") + +(grob-property-description 'space-alist list? "Alist of break align +spacing tuples: format = (SYMBOL . (TYPE . DISTANCE)), where TYPE can be +minimum-space or extra-space.") +(grob-property-description 'space-function procedure? "return interbeam space given Beam grob and multiplicity.") +(grob-property-description 'spacing-increment number? "Add this much space for a doubled duration. Typically, the width of a note head. See also @ref{spacing-spanner-interface}.") + +(grob-property-description 'spacing-wishes grob-list? "List of note spacing or staff spacing objects.") +(grob-property-description 'spacing-procedure procedure? "procedure +taking grob as argument. This is called after +before-line-breaking-callback, but before the actual line breaking +itself. Return value is ignored.") +(grob-property-description 'stacking-dir ly:dir? "stack contents of grobs in which direction ?.") +(grob-property-description 'staff-space ly:dimension? "Amount of line leading relative to global staffspace.") +(grob-property-description 'staff-position number? "vertical position in staff spaces, counted from the middle line.") + +(grob-property-description 'staffline-clearance ly:dimension? "don't get closer than this to stafflines.") +(grob-property-description 'stem ly:grob? "pointer to Stem object.") +(grob-property-description 'stem-attachment-function procedure? "Where +does the stem attach to the notehead? Function takes a symbol argument +being the style. It returns a (X . Y) pair, specifying location in +terms of note head bounding box.") +(grob-property-description 'stem-end-position number? "Where does the stem end (the end is opposite to the support-head.") + +(grob-property-description 'stem-shorten list? "shorten stems in forced directions given flag multiplicity: +the Nth element of the list gives the amount stem shortening of a note with N flags. +") +(grob-property-description 'stem-spacing-correction number? "optical correction amount. [TODO: doco] ") +(grob-property-description 'stems grob-list? "list of stem objects, corresponding to the notes that the arpeggio has to be before.") +(grob-property-description 'stropha boolean? "is this neume a stropha?.") +(grob-property-description 'style symbol? "a string determining what style of glyph is typeset. Valid choices depend on the function that is reading this property. .") +(grob-property-description 'support-head ly:grob? "the note head at +one end of the stem.") +(grob-property-description 'text markup? "Text markup. See reference manual for more information.") +(grob-property-description 'text-start boolean? "Indicator for whether a piano pedal bracket has leading text, such as Ped.") +(grob-property-description 'thick-thickness number? "thickness, measured in stafflinethickness.") +(grob-property-description 'thickness number? "thickness, measured in stafflinethickness.") +(grob-property-description 'thin-kern number? "space after a hair-line.") +(grob-property-description 'forced-distance ly:dimension? "forced distance for an alignment.") + +(grob-property-description 'threshold number-pair? "(cons MIN MAX), where MIN and MAX are dimensions in staffspace.") +(grob-property-description 'transparent boolean? "This is almost the +same as setting molecule-callback to #f, but this retains the +dimensions of this grob, which means that you can erase grobs +individually. .") +(grob-property-description 'bracket-visibility boolean-or-symbol? " +This controls the visibility of the tuplet bracket. +Setting it to false will prevent printing of the +bracket. Setting the property to #'if-no-beam will make it +print only if there is no beam associated with this tuplet bracket.") +(grob-property-description 'number-visibility boolean-or-symbol? " +Like @code{bracket-visibility}, but for the number.") +(grob-property-description 'tie ly:grob? "") +(grob-property-description 'type symbol? " + +") + +(grob-property-description 'break-visibility procedure? "a function +that takes the break direction and returns a cons of booleans +containing (TRANSPARENT . EMPTY). +") + +(grob-property-description 'virga boolean? "is this neume a virga?.") +(grob-property-description 'when ly:moment? "when does this column happen?.") +(grob-property-description 'word-space ly:dimension? "elongate left (?) by this much (FIXME: cumbersome semantics).") + +(grob-property-description 'alignment number? "alignment of lyrics on notehead, -1 is LEFT, 0 is CENTRE, 1 is RIGHT .") +(grob-property-description 'ignore-length-mismatch boolean? "if #t, stanzas with shorter lyrics can be moved away from their respective note-head by the lyric alignment code.") +(grob-property-description 'begin-alignment number? "proportion of lyric length from beginning to align with note-head for left-aligned lyrics.") +(grob-property-description 'end-alignment number? "proportion of lyric length from end to align with note-head for right-aligned lyrics.") +(grob-property-description 'width ly:dimension? "width of a grob measured in staff space.") +(grob-property-description 'width-correct ly:dimension? "width correction for (de)cresc. text spanners.") +(grob-property-description 'x-gap ly:dimension? "horizontal gap between notehead and tie.") +(grob-property-description 'x-offset ly:dimension? "extra horizontal offset for ligature heads.") +(grob-property-description 'y-free ly:dimension? "minimal vertical gap between slur and noteheads or stems.") +(grob-property-description 'y-offset ly:dimension? "extra vertical offset +for ties away from the center line.") +(grob-property-description 'zigzag-length ly:dimension? "The length of the +lines of a zigzag - relative to zigzag-width. a value of 1 +gives 60-degree zigzags.") +(grob-property-description 'zigzag-width ly:dimension? "the width of one +zigzag-squiggle, measured in staff space. The width will be adjusted +so that the line can be constructed from a whole number of squiggles.") + + +;;; INTERNAL + +(grob-property-description 'left-neighbors grob-list? " List of +spacing-wish grobs that are close to the current column. + +The closest spacing-wishes determine the actual distances between the +columns. +") +(grob-property-description 'right-neighbors grob-list? "see left-neighbors") +(grob-property-description 'left-items grob-list? "") +(grob-property-description 'right-items grob-list? "") +(grob-property-description 'cause scheme? "Any kind of causation objects (i.e. music, or perhaps translator) that was the cause for this grob. ") +(grob-property-description 'font ly:font-metric? "Cached font metric object") +(grob-property-description 'break-alignment-done boolean? "mark flag to signal we've done alignment already.") +(grob-property-description + 'staff-padding ly:dimension? + "Maintain this much space to the staff. It's effect is similar to +the padding mechanism, but this will keep objects above and below the +staff in a row more often, when the heights of the notes vary. +") + +(grob-property-description 'staff-symbol ly:grob? "the staff symbol grob that we're in.") +(grob-property-description 'collision-done boolean? "") +(grob-property-description 'rest ly:grob? "the staff symbol grob that we're in.") +(grob-property-description 'rest-collision ly:grob? "rest collision that a rest is in.") +(grob-property-description 'rest-collision-done boolean? "Is this rest collision processed yet?") + +(grob-property-description 'script-molecule pair? "Index code for script -- internal, see script.cc.") + +(grob-property-description 'accidental-grob ly:grob? "Accidental for this note.") + +(grob-property-description 'causes list? "list of cause objects; these can be music objects or grobs.") +(grob-property-description 'flag-count number? "") +(grob-property-description 'chord-tremolo boolean? "if set, this beam is a tremolo. TODO: use interface for this!") +(grob-property-description 'chord pair? "?") +(grob-property-description 'begin-of-line-visible boolean? "?") + +(grob-property-description 'quant-score number? "Beam quanting score +-- can be stored for debugging") +(grob-property-description 'least-squares-dy number? + "ideal beam slope, without damping.") +(grob-property-description 'ligature-primitive-callback procedure? "callback that brews ligature head.") +(grob-property-description 'stem-info pair? "caching of stem parameters") +(grob-property-description 'note-columns pair? "list of NoteColumn grobs.") + +(grob-property-description 'if-text-padding number? "padding in case texts are there.") +(grob-property-description 'grace-space-factor number? "space grace at this fraction of the increment.") +(grob-property-description 'position-callbacks list? "list of +functions set spanner positions.") +(grob-property-description 'join-left number? "in ligature such as pes and flexa, the length of the vertical joining beam attached to the left side of the head") +(grob-property-description 'delta-pitch number? "DOCME") +(grob-property-description 'head-width ly:dimension? "width of this ligature head") +(grob-property-description 'primitive number? "DOCME") +(grob-property-description 'minimum-beam-collision-distance ly:dimension? +"Minimum distance to beam for a rest collision.") + +(grob-property-description 'avoid-note-head boolean? "if set, the stem of a chord does not pass through all note head, but start at the last note head. Used by tablature.") + +(grob-property-description 'up-to-staff boolean? "if set, stems' lengths are set so as stems end out of the staff. Used by tablature.") + +(grob-property-description 'use-breve-rest boolean? "boolean that +tells multi-measure-rest to use a breve rest to represent the duration +of 1 measure instead of whole rest. It defaults to false. It is set +to true when the duration of a measure is a breve or longer.") + +; (display (length all-backend-properties)) diff --git a/scm/grob-description.scm b/scm/define-grobs.scm similarity index 99% rename from scm/grob-description.scm rename to scm/define-grobs.scm index 18a53ca200..de352b2d25 100644 --- a/scm/grob-description.scm +++ b/scm/define-grobs.scm @@ -1067,6 +1067,19 @@ (meta . ((interfaces . (text-spanner-interface side-position-interface font-interface spanner-interface)))) )) + (OttavaSpanner + . ( + (Y-offset-callbacks . (,Side_position_interface::aligned_side)) + (molecule-callback . ,Text_spanner::brew_molecule) + (font-family . roman) + (outer . #t) + (width-correct . 0.0) + (type . dotted-line) + (edge-height . (0 . 1.5)) + (direction . 1) + (meta . ((interfaces . (text-spanner-interface side-position-interface font-interface spanner-interface)))) + )) + (TabNoteHead . ( (font-family . roman) diff --git a/scm/music-property-description.scm b/scm/define-music-properties.scm similarity index 100% rename from scm/music-property-description.scm rename to scm/define-music-properties.scm diff --git a/scm/define-music-types.scm b/scm/define-music-types.scm new file mode 100644 index 0000000000..e44981c176 --- /dev/null +++ b/scm/define-music-types.scm @@ -0,0 +1,702 @@ + +(define-public music-descriptions + `( + (AbortEvent + . ( + (description . "End the currently running spanners.") + (internal-class-name . "Event") + (span-type . "abort") + (types . (general-music event abort-event)) + )) + (AbsoluteDynamicEvent + . ( + (description . "Creates a dynamic mark. Syntax: @var{note}@code{\\x}, +where x is one of \@\{\\ppp, \\pp, \\p, \\mp, \\mf, \\f, \\ff, \\fff.\@\}") + (internal-class-name . "Event") + (types . (general-music event dynamic-event absolute-dynamic-event)) + )) + (ApplyContext + . ( + (description . "Call the argument with the current context during interpreting phase") + (internal-class-name . "Music") + (types . (general-music apply-context)) + (iterator-ctor . ,Apply_context_iterator::constructor) + )) + (ApplyOutputEvent + . ( + (description . " +Call the argument with all current grobs during interpreting phase. + +SYNTAX + +\applyoutput FUNC + +arguments to func are 1. the grob, 2. the originating context, +3. context where FUNC is called. + +") + (internal-class-name . "Event") + (iterator-ctor . ,Output_property_music_iterator::constructor) + (types . (general-music layout-instruction)) + )) + (ArpeggioEvent + . ( + (description . "Make an arpeggio on this note. Syntax: +@var{note}-@code{\\arpeggio}") + (internal-class-name . "Event") + (types . (general-music arpeggio-event event)) + )) + + ;; todo: use articulation-event for slur as well. + ;; separate non articulation scripts + (ArticulationEvent + . ( + (description . "Adds an articulation marking to a note. Syntax: +@var{note}@code{X}@code{Y}, where X is a direction (up @code{^}, down +@code{_}, or Lilypond's choice (no direction specified)), and where Y +is an articulation (such as @code{-.}, @code{->}, @code{\\tenuto}, +@code{\\downbow}). See the user manual for details.") + + (internal-class-name . "Event") + (types . (general-music event articulation-event script-event)) + )) + (AutoChangeMusic + . ( + (description . "Used for making voices that switch between piano staves automatically.") + + (internal-class-name . "Music_wrapper") + (iterator-ctor . ,Auto_change_iterator::constructor) + (types . (general-music music-wrapper-music auto-change-instruction)) + )) + (BarCheck + . ( + (description . + "Check whether this music coincides with the start of the measure.") + (internal-class-name . "Music") + (types . (general-music bar-check)) + (iterator-ctor . ,Bar_check_iterator::constructor) + )) + (BassFigureEvent + . ( + (description . "Print a bass-figure text") + + (internal-class-name . "Event") + (types . (general-music event rhythmic-event bass-figure-event)) + )) + (BeamEvent + . ( + (description . "Starts or stops a beam. Syntax for manual control: +c8-[ c c-] c8") + + (internal-class-name . "Event") + (types . (general-music event beam-event span-event)) + )) + (NewBeamEvent + . ( + (description . "Starts or stops a beam. Syntax for manual control: +c8-[ c c-] c8") + (internal-class-name . "Event") + (types . (general-music event new-beam-event span-event)) + )) + (BreakEvent + . ( + (description . "Creates a line break. Syntax: \\break.") + + (internal-class-name . "Event") + (types . (general-music break-event event)) + )) + (BreathingSignEvent + . ( + (description . "Creates a `breath mark' or `comma'. Syntax: +@var{note}\\breathe.") + + (internal-class-name . "Event") + (types . (general-music event breathing-event)) + )) + (BusyPlayingEvent + . ( + (description . "Used internally to signal beginning and ending of notes.") + + (internal-class-name . "Event") + (types . (general-music event busy-playing-event)) + )) + (ClusterEvent + . ( + (description . "Begins or ends a cluster.") + (internal-class-name . "Event") + (types . (general-music cluster-event span-event event)) + )) + (ContextSpeccedMusic + . ( + (description . "Interpret the argument music within a specific context.") + (iterator-ctor . ,Context_specced_music_iterator::constructor) + (internal-class-name . "Music_wrapper") + (types . (context-specification general-music music-wrapper-music)) + )) + (CrescendoEvent + . ( + (description . "Begins or ends a crescendo. Syntax: @var{note}\\cr +... @var{note}\\rc (you can also use \\<, \\!, \\cresc, and +\\endcresc. See the user manual for details.).") + + (internal-class-name . "Event") + (types . (general-music dynamic-event crescendo-event event)) + )) + (DecrescendoEvent + . ( + (description . "See @ref{CrescendoEvent}.") + + (internal-class-name . "Event") + (types . (general-music dynamic-event decrescendo-event event)) + )) + + (ExtenderEvent + . ( + (description . "Extend lyrics.") + + (internal-class-name . "Event") + (types . (general-music extender-event event)) + )) + (FingerEvent + . ( + (description . "Specify what finger to use for this note.") + (internal-class-name . "Event") + (types . (general-music fingering-event event)) + )) + (GlissandoEvent + . ( + (description . "Start a glissando on this note.") + (internal-class-name . "Event") + (types . (general-music glissando-event event)) + )) + + (GraceMusic + . ( + (description . "Interpret the argument as grace notes. ") + + (internal-class-name . "Grace_music") + (iterator-ctor . ,Grace_iterator::constructor) + (types . (grace-music music-wrapper-music general-music)) + )) + (NoteGroupingEvent + . ( + (description . "Start or stop grouping brackets.") + (internal-class-name . "Event") + (types . (general-music event note-grouping-event)) + )) + (HyphenEvent + . ( + (description . "A hyphen between lyric syllables.") + + (internal-class-name . "Event") + (types . (general-music hyphen-event event)) + )) + + (KeyChangeEvent + . ( + (description . "Change the key signature. Syntax: @code{\\key } @var{name} @var{scale}.") + + (internal-class-name . "Key_change_ev") + (types . (general-music key-change-event event)) + )) + + (LigatureEvent + . ( + (description . "(docme).") + + (internal-class-name . "Event") + (span-type . ligature) + (types . (general-music span-event ligature-event event)) + )) + + (LyricCombineMusic + . ( + (description . "Align lyrics to the start of notes. +Syntax @var{\\addlyrics }@var{music} @var{lyrics}.") + + (internal-class-name . "Lyric_combine_music") + (types . (general-music lyric-combine-music)) + (iterator-ctor . ,Lyric_combine_music_iterator::constructor) + )) + + (LyricEvent + . ( + (description . "A lyric syllable. Must be entered in lyrics mode, i.e. +@code{\\lyrics @{ twinkle4 twinkle4 @} } .") + + (internal-class-name . "Event") + (types . (general-music rhythmic-event lyric-event event)) + )) + (MarkEvent + . ( + (description . "Insert a rehearsal mark. Syntax: @code{\mark} @var{marker}, +e.g. @code{\\mark \"A\"}.") + + (internal-class-name . "Event") + (types . (general-music mark-event event)) + )) + (MelismaPlayingEvent + . ( + (description . "Used internally to signal melismas") + (internal-class-name . "Event") + (types . (general-music melisma-playing-event event)) + )) + + (MultiMeasureRestEvent + . ( + (description . "Rests that may be compressed into Multi rests. Syntax +@code{R2.*4} for 4 measures in 3/4 time. Note the capital R.") + (internal-class-name . "Event") + (types . (general-music event span-event multi-measure-rest-event)) + )) + + (MultiMeasureTextEvent + . ( + (description . "Texts on mm rests. Syntax +@code{R-\\markup @{ \\roman \"bla\" @}}. Note the explicit font switch.") + (internal-class-name . "Event") + (types . (general-music event multi-measure-text-event)) + )) + + (Music + . ( + (description . "Generic type for music expressions.") + + (internal-class-name . "Music") + (types . (general-music)) + )) + (NoteEvent + . ( + (description . "A note.") + + (internal-class-name . "Event") + (types . (general-music event note-event rhythmic-event melodic-event)) + )) + + (OverrideProperty + . ( + (description . "Extend the definition of a graphical object. + +SYNTAX + +@code{\\propery Foo.Bar \\override} @var{SYMBOL} = @var{VALUE} + +") + + (internal-class-name . "Music") + (types . (general-music layout-instruction)) + (iterator-ctor . , Push_property_iterator::constructor) + )) + + (PartCombineMusic + . ( + (description . "Combine two parts on a staff, either merged or +as separate voices.") + + (internal-class-name . "Simultaneous_music") + (types . (general-music part-combine-music)) + (iterator-ctor . ,Part_combine_music_iterator::constructor) + )) + + (PhrasingSlurEvent + . ( + (description . "Start or end phrasing slur. Syntax NOTE \\( and \\) NOTE") + (internal-class-name . "Event") + (types . (general-music span-event phrasing-slur-event)) + )) + + (PropertySet + . ( + (description . "Set a context property. + +Syntax: @code{\property @var{context}.@var{prop} = @var{scheme-val}}.") + (internal-class-name . "Music") + (types . (layout-instruction general-music)) + (iterator-ctor . ,Property_iterator::constructor) + ) + ) + + (PropertyUnset + . ( + (description . "Remove the definition of a context @code{\property}.") + + (internal-class-name . "Music") + (types . (layout-instruction general-music)) + (iterator-ctor . ,Property_unset_iterator::constructor) + ) + ) + + (PesOrFlexaEvent + . ( + (description . "Within a ligature, mark the previous and the +following note to form a pes (if melody goes up) or a flexa (if melody +goes down).") + + (internal-class-name . "Event") + (types . (general-music pes-or-flexa-event event)) + )) + + (RepeatedMusic + . ( + (description . "Repeat music in different ways") + + (type . repeated-music) + (types . (general-music repeated-music)) + )) + + (Event + . ( + (description . "Atomic music event.") + + (internal-class-name . "Event") + (types . (general-music event)) + )) + + (RestEvent + . ( + (description . "A Rest. Syntax @code{r4} for a quarter rest. ") + + (internal-class-name . "Event") + (types . (general-music event rhythmic-event rest-event)) + )) + (SequentialMusic + . ( + (description . "Music expressions concatenated. Syntax \\sequential @{..@} or simply @{..@} .") + + (internal-class-name . "Sequential_music") + (iterator-ctor . ,Sequential_music_iterator::constructor) + (types . (general-music sequential-music)) + )) + + (MultiMeasureRestMusicGroup + . ( + (description . "Like sequential-music, but specifically intended +to group start-mmrest, skip, stop-mmrest sequence. Syntax @code{R2.*5} for 5 measures in 3/4 time.") + (internal-class-name . "Sequential_music") + (iterator-ctor . ,Sequential_music_iterator::constructor) + (types . (general-music sequential-music)) + )) + + (SimultaneousMusic + . ( + (description . "Music playing together. + +SYNTAX + +@code{ \\simultaneous @{ .. @}} or < .. >.") + + (internal-class-name . "Simultaneous_music") + (iterator-ctor . ,Simultaneous_music_iterator::constructor) + + (types . (general-music simultaneous-music)) + )) + (SlurEvent + . ( + (description . "Start or end slur. Syntax NOTE( and )NOTE") + (internal-class-name . "Event") + (types . (general-music span-event slur-event)) + )) + + (RevertProperty + . ( + (description . "The opposite of @ref{OverrideProperty}: remove a +previously added property from a graphical object definition + ") + + (internal-class-name . "Music") + (types . (general-music layout-instruction)) + (iterator-ctor . , Pop_property_iterator::constructor) + )) + + (OutputPropertySetMusic + . ( + (description . "Set grob properties in objects +individually. Syntax @code{\\outputproperty @var{predicate} @var{prop} += @var{val}}.") + + (internal-class-name . "Music") + (iterator-ctor . ,Output_property_music_iterator::constructor) + (types . (general-music layout-instruction)) + )) + + (TextSpanEvent + . ( + (description . "Start a text spanner like 8va.....|") + (internal-class-name . "Event") + (types . (general-music span-event text-span-event)) + )) + + (TranslatorChange + . ( + (description . "Change staffs in Piano staff. Syntax @code{\\translator Staff = @var{new-id}}.") + (internal-class-name . "Music") + (iterator-ctor . , Change_iterator::constructor) + (types . (general-music translator-change-instruction)) + )) + + (TimeScaledMusic + . ( + (description . "Multiply durations, as in tuplets. Syntax @code{\\times @var{fraction} @var{music}}, e.g. +@code{\\times 2/3 @{ ... @}} for triplets. + ") + (internal-class-name . "Time_scaled_music") + (iterator-ctor . ,Time_scaled_music_iterator::constructor) + (types . (time-scaled-music music-wrapper-music general-music)) + )) + + (TransposedMusic + . ( + (description . "Music that has been transposed.") + (internal-class-name . "Transposed_music") + (types . (music-wrapper-music general-music transposed-music)) + )) + + (UntransposableMusic + . ( + (description . "Music that can not be transposed.") + + (internal-class-name . "Untransposable_music") + (types . (music-wrapper-music general-music untransposable-music)) + )) + + (UnrelativableMusic + . ( + (description . "Music that can not be converted from relative to absolute notation. +For example, transposed music.") + (internal-class-name . "Un_relativable_music") + (types . (music-wrapper-music general-music unrelativable-music)) + )) + + (RelativeOctaveMusic + . ( + (description . "Music that was entered in relative octave notation.") + + (internal-class-name . "Relative_octave_music") + (types . (music-wrapper-music general-music relative-octave-music)) + )) + + (EventChord + . ( + (description . "Internally used to group a set of events.") + + (internal-class-name . "Simultaneous_music") + (iterator-ctor . ,Event_chord_iterator::constructor) + (types . (general-music event-chord simultaneous-music)) + ) + ) + + (ScriptEvent + . ( + (description . "Add an articulation mark to a note. ") + + (internal-class-name . "Event") + (types . (general-music event)) + )) + + (SkipEvent + . ( + (description . "Filler that takes up duration, but does not print anything.") + + (internal-class-name . "Event") + (types . (general-music event rhythmic-event skip-event)) + )) + + (SpanEvent + . ( + (description . "Event for anything that is started at a different time than stopped.") + + (internal-class-name . "Event") + (types . (general-music event)) + )) + + (SustainEvent + . ( + (description . "Depress or release sustain pedal. ") + (internal-class-name . "Event") + (types . (general-music pedal-event sustain-pedal-event)) + )) + + (SostenutoEvent + . ( + (description . "Depress or release sostenuto pedal. ") + (internal-class-name . "Event") + (types . (general-music pedal-event sostenuto-pedal-event)) + )) + + (UnaCordaEvent + . ( + (description . "Depress or release una-corda pedal.") + (internal-class-name . "Event") + (types . (general-music pedal-event una-corda-pedal-event)) + )) + + (StringNumberEvent + . ( + (description . "Specify on which string to play this note. Syntax: @code{\\@var{number}}.") + + (internal-class-name . "Event") + (types . (general-music string-number-event event)) + )) + + (MetronomeChangeEvent + . ( + (description . "Change tempo setting (in beats per minute).") + (internal-class-name . "Event") + (types . (general-music metronome-change-event tempo-event event)) + )) + + (TextScriptEvent + . ( + (description . "") + (internal-class-name . "Event") + (types . (general-music script-event text-script-event event)) + )) + (TieEvent + . ( + (description . "A tie. Entered as @code{~}.") + (internal-class-name . "Event") + (types . (general-music tie-event event)) + )) + (NewTieEvent + . ( + (description . "A tie. Entered as @var{note}-~.") + (internal-class-name . "Event") + (types . (general-music new-tie-event event)) + )) + (TremoloEvent + . ( + (description . "Un measured tremolo.") + (internal-class-name . "Event") + (types . (general-music event tremolo-event)) + )) + + (VoiceSeparator + . ( + (description . "Separate polyphonic voices in simultaneous music. Syntax: @code{\\\\}") + + (internal-class-name . "Music") + (types . (separator general-music)) + )) + + (VoltaRepeatedMusic + . ( + (iterator-ctor . ,Volta_repeat_iterator::constructor) + (internal-class-name . "Repeated_music") + (description . "") + (start-moment-function . ,Repeated_music::first_start) + (length . ,Repeated_music::volta_music_length) + (types . (general-music repeated-music volta-repeated-music)) + )) + + (UnfoldedRepeatedMusic + . ( + (iterator-ctor . ,Unfolded_repeat_iterator::constructor) + (description . "") + (start-moment-function . ,Repeated_music::first_start) + (internal-class-name . "Repeated_music") + (types . (general-music repeated-music unfolded-repeated-music)) + (length . ,Repeated_music::unfolded_music_length) + )) + (PercentRepeatedMusic + . ( + (internal-class-name . "Repeated_music") + (description . "Repeats encoded by percents.") + (iterator-ctor . ,Percent_repeat_iterator::constructor) + (start-moment-function . ,Repeated_music::first_start) + (length . ,Repeated_music::unfolded_music_length) + (types . (general-music repeated-music percent-repeated-music)) + )) + + (TremoloRepeteadMusic + . ( + (iterator-ctor . ,Chord_tremolo_iterator::constructor) + (description . "Repeated notes denoted by tremolo beams.") + (internal-class-name . "Repeated_music") + (start-moment-function . ,Repeated_music::first_start) + + ;; the length of the repeat is handled by shifting the note logs + (length . ,Repeated_music::folded_music_length) + (types . (general-music repeated-music tremolo-repeated-music)) + + )) + + (FoldedRepeatedMusic + . ( + (internal-class-name . "Repeated_music") + (description . "Repeats with alternatives placed in parallel. ") + (iterator-ctor . ,Folded_repeat_iterator::constructor) + (start-moment-function . ,Repeated_music::minimum_start) + (length . ,Repeated_music::folded_music_length) + (types . (general-music repeated-music folded-repeated-music)) + )) + )) + +(set! music-descriptions + (sort music-descriptions alistsymbol name) context-description-alist)) - (desc (if (pair? desc-handle) (cdr desc-handle) "")) + (desc-handle (assoc 'description context-desc)) + (desc (if (and (pair? desc-handle) (string? (cdr desc-handle))) + (cdr desc-handle) "(not documented)")) (accepts (cdr (assoc 'accepts context-desc))) (consists (append diff --git a/scm/lily.scm b/scm/lily.scm index 0c5cda7036..4add9c25c4 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -337,13 +337,13 @@ is the first to satisfy CRIT ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; output -(use-modules (scm tex) - (scm ps) - (scm pysk) - (scm ascii-script) - (scm sketch) - (scm sodipodi) - (scm pdftex) +(use-modules (scm output-tex) + (scm output-ps) + (scm output-pysk) + (scm output-ascii-script) + (scm output-sketch) + (scm output-sodipodi) + (scm output-pdftex) ) (define output-alist @@ -389,11 +389,10 @@ is the first to satisfy CRIT "new-markup.scm" "bass-figure.scm" "music-functions.scm" - "music-property-description.scm" + "define-music-properties.scm" "auto-beam.scm" - "basic-properties.scm" "chord-name.scm" - "translator-property-description.scm" + "define-translator-properties.scm" "script.scm" "drums.scm" "midi.scm" @@ -403,10 +402,9 @@ is the first to satisfy CRIT "slur.scm" "font.scm" - "grob-property-description.scm" - "grob-description.scm" - "context-description.scm" - "interface-description.scm" + "define-grob-properties.scm" + "define-grobs.scm" + "define-grob-interfaces.scm" )) diff --git a/scm/ascii-script.scm b/scm/output-ascii-script.scm similarity index 99% rename from scm/ascii-script.scm rename to scm/output-ascii-script.scm index d53cfb366f..d938458813 100644 --- a/scm/ascii-script.scm +++ b/scm/output-ascii-script.scm @@ -1,4 +1,4 @@ -(define-module (scm ascii-script) +(define-module (scm output-ascii-script) ) (define this-module (current-module)) diff --git a/scm/pdf.scm b/scm/output-pdf.scm similarity index 99% rename from scm/pdf.scm rename to scm/output-pdf.scm index 1788c9425d..898c996b2c 100644 --- a/scm/pdf.scm +++ b/scm/output-pdf.scm @@ -7,7 +7,8 @@ ;currently no font commands; this is a helper for pdftex.scm. -(define-module (scm pdf)) +(define-module (scm output-pdf)) + (define this-module (current-module)) diff --git a/scm/pdftex.scm b/scm/output-pdftex.scm similarity index 99% rename from scm/pdftex.scm rename to scm/output-pdftex.scm index 126614d76d..ceb35e65d6 100644 --- a/scm/pdftex.scm +++ b/scm/output-pdftex.scm @@ -10,9 +10,9 @@ ;; TODO: port this to the new module framework. -(define-module (scm pdftex)) +(define-module (scm output-pdftex)) -(use-modules (scm pdf) +(use-modules (scm output-pdf) (guile) (ice-9 regex) (ice-9 string-fun) diff --git a/scm/ps.scm b/scm/output-ps.scm similarity index 99% rename from scm/ps.scm rename to scm/output-ps.scm index 3699894142..baac7b457c 100644 --- a/scm/ps.scm +++ b/scm/output-ps.scm @@ -9,7 +9,7 @@ (debug-enable 'backtrace) -(define-module (scm ps)) +(define-module (scm output-ps)) (define this-module (current-module)) (use-modules diff --git a/scm/pysk.scm b/scm/output-pysk.scm similarity index 96% rename from scm/pysk.scm rename to scm/output-pysk.scm index 956fdf5b59..0edc678cf5 100644 --- a/scm/pysk.scm +++ b/scm/output-pysk.scm @@ -7,10 +7,10 @@ -(define-module (scm pysk) +(define-module (scm output-pysk) ) -(use-modules (scm ps) +(use-modules (scm output-ps) (ice-9 regex) (ice-9 string-fun) (guile) diff --git a/scm/sketch.scm b/scm/output-sketch.scm similarity index 99% rename from scm/sketch.scm rename to scm/output-sketch.scm index 5c839401d2..ad914a92e4 100644 --- a/scm/sketch.scm +++ b/scm/output-sketch.scm @@ -26,7 +26,7 @@ ;; NAME X Y ARGUMENTS-PASSED-BY-LILYPOND ;; -(define-module (scm sketch)) +(define-module (scm output-sketch)) (debug-enable 'backtrace) (define this-module (current-module)) diff --git a/scm/sodipodi.scm b/scm/output-sodipodi.scm similarity index 99% rename from scm/sodipodi.scm rename to scm/output-sodipodi.scm index 3d5297fd4b..52efd40e57 100644 --- a/scm/sodipodi.scm +++ b/scm/output-sodipodi.scm @@ -20,7 +20,7 @@ (debug-enable 'backtrace) -(define-module (scm sodipodi)) +(define-module (scm output-sodipodi)) (define this-module (current-module)) (use-modules diff --git a/scm/tex.scm b/scm/output-tex.scm similarity index 99% rename from scm/tex.scm rename to scm/output-tex.scm index 5b4245a479..afd15e374f 100644 --- a/scm/tex.scm +++ b/scm/output-tex.scm @@ -7,9 +7,9 @@ ;;; Han-Wen Nienhuys -(define-module (scm tex) ) +(define-module (scm output-tex) ) (debug-enable 'backtrace) -(use-modules (scm ps) +(use-modules (scm output-ps) (ice-9 regex) (ice-9 string-fun) (ice-9 format) diff --git a/scripts/convert-ly.py b/scripts/convert-ly.py index 9c56ae5716..056decf8ce 100644 --- a/scripts/convert-ly.py +++ b/scripts/convert-ly.py @@ -1170,6 +1170,23 @@ if 1: conversions.append (((1,7,17), conv, "Skip_req -> Skip_event")) +if 1: + def conv(str): + str = re.sub ("groupOpen", + "startGroup", str) + str = re.sub ("groupClose", + "stopGroup", str) + str = re.sub ("#'outer", + "#'enclose-bounds", str) + + return str + + conversions.append (((1,7,18), conv, + """"groupOpen/Close -> start/stopGroup, + #'outer -> #'enclose-bounds + """)) + + ################################ # END OF CONVERSIONS -- 2.39.5