From: fred Date: Tue, 26 Mar 2002 22:46:52 +0000 (+0000) Subject: lilypond-1.3.33 X-Git-Tag: release/1.5.59~1833 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=43d68e396736c94bf64f71017d31da36af158897;p=lilypond.git lilypond-1.3.33 --- diff --git a/Documentation/programmer/regression-test.tely b/Documentation/programmer/regression-test.tely index 149ea061bb..082a1205ad 100644 --- a/Documentation/programmer/regression-test.tely +++ b/Documentation/programmer/regression-test.tely @@ -65,12 +65,12 @@ natural sign. @section Stems -Stem tremolos (official naming?) or rolls are tremolo signs that look -like beam segments crossing stems. If the stem is in a beam, the -tremolo must be parallel to the beam. If the stem is invisible -(eg. on a whole note), the tremolo must be centered on the note. +Stem tremolos or rolls are tremolo signs that look like beam segments +crossing stems. If the stem is in a beam, the tremolo must be parallel +to the beam. If the stem is invisible (eg. on a whole note), the +tremolo must be centered on the note. -@c @mu delafile{stem-tremolo.ly} +@mudelafile{stem-tremolo.ly} Chord tremolos look like beams, but are a kind of repeat symbol. To avoid confusion, chord tremolo beams do not reach the stems, but @@ -78,7 +78,7 @@ leave a gap. Chord tremolo beams on half notes are not ambiguous, as half notes cannot appear in a regular beam, and should reach the stems. -@c miudelafile{chord-tremolo.sly} +@mudelafile{chord-tremolo.sly} Beams, stems and noteheads often have communication troubles, since the two systems for y dimensions (1 unit = staffspace, 1 unit = 1 diff --git a/Documentation/user/refman.itely b/Documentation/user/refman.itely index 1d222f5953..3862e3ad4d 100644 --- a/Documentation/user/refman.itely +++ b/Documentation/user/refman.itely @@ -1282,13 +1282,13 @@ The slur syntax with parentheses is a shorthand for this. @cindex tremolo marks -@node tremolo, , , Reference Manual +@node stem tremolo, , , Reference Manual Tremolo marks can be printed on a single note by adding `@code{:}[@var{length}]' after the note. The length must be at least 8. A @var{length} value of 8 gives one line across the note stem. If the length is omitted, then the last value is -used, or the value of the @code{abbrev}@indexcode{abbrev} property if there was +used, or the value of the @code{tremoloFlags}@indexcode{tremoloFlags} property if there was no last value. @mudela[verbatim,fragment,center] diff --git a/input/bugs/staff-margin.ly b/input/bugs/staff-margin.ly new file mode 100644 index 0000000000..1275f6926a --- /dev/null +++ b/input/bugs/staff-margin.ly @@ -0,0 +1,38 @@ +voice = \notes\relative c'{ + \property Staff.instrument = "Voice" + \property Staff.instr = "V." + + % Staff_margin_engraver kan be `fixed' by doing a silly request: + %\bar ".|"; + + c1\break c \bar "|."; +} + +soprano = \notes\relative c'{ + \property Staff.instrument = "Soprano" + \property Staff.instr = "S." + c1 c \bar "|."; +} + +tenor = \notes \relative c'{ + \property Staff.instrument = "Tenor" + \property Staff.instr = "T." + c1 c +} + +\score +{ + \context StaffGroup< + \context Staff = "voice" \voice + \context GrandStaff< + \context Staff = "soprano" \soprano + \context Staff = "tenor" \tenor + > + > + + \paper { + indent = 50.0\mm; + linewidth = 100.0\mm; + \translator { \StaffContext \consists Staff_margin_engraver; } + } +} diff --git a/input/test/bar-lines.ly b/input/test/bar-lines.ly new file mode 100644 index 0000000000..d9e99a30bc --- /dev/null +++ b/input/test/bar-lines.ly @@ -0,0 +1,14 @@ + +\score +{ +\notes \relative c'' { +c4 +\bar "|."; c +\bar "|:";c +\bar "||";c +\bar ":|" ; c +\bar ".|"; c +\bar ".|."; c +\bar "|"; c +} +} diff --git a/input/test/repeat-volta.ly b/input/test/repeat-volta.ly index 46cea92205..b64a981a03 100644 --- a/input/test/repeat-volta.ly +++ b/input/test/repeat-volta.ly @@ -2,7 +2,9 @@ % no alts. \score { \notes \relative c'' { -\repeat volta 3 { c^"3$\\times$ 0alt" d } +% repeat non aligning with barlines. +e +\repeat volta 3 { c^"3$\\times$ 0alt" d e } % less alts than body \repeat volta 4 { c^"4$\\times$ 2alt" d } \alternative { e f } diff --git a/input/test/stem-tremolo.ly b/input/test/stem-tremolo.ly index bc962393de..022a9ae644 100644 --- a/input/test/stem-tremolo.ly +++ b/input/test/stem-tremolo.ly @@ -1,23 +1,23 @@ \version "1.3.5"; \score{ - \notes \transpose c'''{ + \context Voice\notes \relative c''{ + %%? + \property Voice.textVerticalDirection = #1 + %% burp, is this in staff or half spaces, or what? + \property Voice.textScriptPadding = #15 + a1:4^":4" a:8^":8" c:16^":16" a:32^":32" a^"x" a:^":" + a4:4 c:8 a:16 c:32 a a: a2: + \break \stemup -% \stemdown - % default abbreviations - c4 c4: c4:32 c4: c4 c2. - a,1 - a,1:32 - c,4:8 c': c,4:16 c': - [ c,8:16 c, c, c, ] - [ a a a a ] - [ c, f, b, e ] - [ c,16:32 c, c, c, ] [ a16:32 a a a ] -% % there's still some hairy beam bugfixing todo - [ c'8:16 g d a, ] - [ c,8:32 f, b, e ] - [ c'16:32 g d a, ] - - + a4:32 a'4:64 + \stemdown + c,4:32 c,4:64 + \stemboth + c'8:16 c c c + a': a a: a + c,16:32 c: c c a16:32 a: a a + c8:16 g: d: a: + c8:32 f: b: e: } } diff --git a/lily/all-font-metrics.cc b/lily/all-font-metrics.cc index 81a4133430..0d61907069 100644 --- a/lily/all-font-metrics.cc +++ b/lily/all-font-metrics.cc @@ -147,3 +147,9 @@ All_font_metrics::font_descriptions () const } + +Font_metric* +find_font (String name) +{ + return all_fonts_global_p->find_font (name); +} diff --git a/lily/include/all-font-metrics.hh b/lily/include/all-font-metrics.hh index fa6eb9097c..02d59dae09 100644 --- a/lily/include/all-font-metrics.hh +++ b/lily/include/all-font-metrics.hh @@ -38,5 +38,7 @@ public: SCM font_descriptions () const; }; +Font_metric * find_font (String name); + #endif /* ALL_FONTS_HH */ diff --git a/lily/include/lily-proto.hh b/lily/include/lily-proto.hh index 3a6f324771..d5f93d6a06 100644 --- a/lily/include/lily-proto.hh +++ b/lily/include/lily-proto.hh @@ -64,7 +64,6 @@ struct Change_translator; struct Chord; struct Chord_name; struct Chord_name_engraver; -struct Chord_tremolo; struct Chord_tremolo_engraver; struct Chord_tremolo_req; struct Clef_change_req; diff --git a/lily/include/lookup.hh b/lily/include/lookup.hh index 2a227470fe..4563501ecc 100644 --- a/lily/include/lookup.hh +++ b/lily/include/lookup.hh @@ -30,20 +30,16 @@ public: Lookup (); Lookup (Lookup const&); - Molecule simple_bar (String s, Real w, Paper_def*) const; Molecule afm_find (String, bool warn=true) const; - Molecule bar (String, Real height, Paper_def*) const; Molecule accordion (SCM arg, Real interline_f) const; static Molecule frame (Box b, Real thick); static Molecule slur (Bezier controls, Real cthick, Real thick) ; static Molecule beam (Real, Real, Real) ; static Molecule dashed_slur (Bezier, Real thick, Real dash) ; - static Molecule fill (Box b) ; + static Molecule blank (Box b) ; static Molecule filledbox (Box b) ; static Molecule text (String style, String text, Paper_def*) ; - static Molecule staff_brace (Real dy, int) ; - static Molecule staff_bracket (Real height, Paper_def* paper_l) ; }; #endif // LOOKUP_HH diff --git a/lily/include/molecule.hh b/lily/include/molecule.hh index 6992a2fa42..ec5ed0e409 100644 --- a/lily/include/molecule.hh +++ b/lily/include/molecule.hh @@ -73,9 +73,14 @@ public: Box extent() const; Interval extent (Axis) const; bool empty_b() const; - void print ()const; + + + /*******/ }; SCM fontify_atom (Font_metric*, SCM atom); + + + #endif diff --git a/lily/include/musical-request.hh b/lily/include/musical-request.hh index dbabc86edd..9fbbd284cd 100644 --- a/lily/include/musical-request.hh +++ b/lily/include/musical-request.hh @@ -177,7 +177,7 @@ public: VIRTUAL_COPY_CONS(Music); }; /** - Start / stop an abbreviation beam. */ + Start / stop a tremolo beam. */ class Chord_tremolo_req : public Span_req { public: diff --git a/lily/include/my-lily-parser.hh b/lily/include/my-lily-parser.hh index 4231886b7e..907aa962b4 100644 --- a/lily/include/my-lily-parser.hh +++ b/lily/include/my-lily-parser.hh @@ -39,7 +39,7 @@ public: Duration default_duration_; Musical_pitch default_pitch_; Scope *default_header_p_; - int abbrev_beam_type_i_; + int chord_tremolo_type_i_; bool first_b_; int fatal_error_i_; Sources * source_l_; @@ -71,7 +71,7 @@ private: Simultaneous_music* get_rest_element (String, Duration *); Simultaneous_music* get_word_element (String, Duration*); String notename_str (Melodic_req* melodic); - void set_abbrev_beam (int type_i); + void set_chord_tremolo (int type_i); void set_last_duration (Duration const *); void set_last_pitch (Musical_pitch const *); friend int yyparse (void*); diff --git a/lily/key-item.cc b/lily/key-item.cc index 55c594c01c..52d76b5769 100644 --- a/lily/key-item.cc +++ b/lily/key-item.cc @@ -130,7 +130,7 @@ Key_item::do_brew_molecule() const Interval x(0, inter); Interval y(0,0); - mol.add_at_edge (X_AXIS, RIGHT, lookup_l()->fill (Box(x,y)),0); + mol.add_at_edge (X_AXIS, RIGHT, lookup_l()->blank (Box(x,y)),0); } for (int i =0; i < pitch_arr_.size(); i++) diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index 09eca147be..dd14be84fe 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -11,6 +11,7 @@ #include #include +#include // isinf #include "libc-extension.hh" #include "lily-guile.hh" @@ -217,16 +218,6 @@ ly_isdir_p (SCM s) } -static void -init_functions () -{ - scm_make_gsubr ("ly-warn", 1, 0, 0, (SCM(*)(...))ly_warning); - scm_make_gsubr ("ly-gulp-file", 1,0, 0, (SCM(*)(...))ly_gulp_file); - scm_make_gsubr ("dir?", 1,0, 0, (SCM(*)(...))ly_isdir_p); -} - -ADD_SCM_INIT_FUNC(funcs, init_functions); - typedef void (*Void_fptr)(); Array *scm_init_funcs_; @@ -367,3 +358,47 @@ ly_type (SCM exp) return ly_str02scm (cp); } + +/* + convert without too many decimals, and leave a space at the end. + */ + + +SCM +ly_number2string (SCM s) +{ + assert (gh_number_p (s)); + + char str[100]; // ugh. + + if (scm_integer_p (s)) + { + Real r (gh_scm2double (s)); + + if (isinf (r) || isnan (r)) + { + programming_error ("Infinity or NaN encountered while converting Real number; setting to zero."); + r = 0.0; + } + + sprintf (str, "%8.4f ", r); + } + else + { + sprintf (str, "%d ", gh_scm2int (s)); + } + + return gh_str02scm (str); +} + + +static void +init_functions () +{ + scm_make_gsubr ("ly-warn", 1, 0, 0, (SCM(*)(...))ly_warning); + scm_make_gsubr ("ly-gulp-file", 1,0, 0, (SCM(*)(...))ly_gulp_file); + scm_make_gsubr ("dir?", 1,0, 0, (SCM(*)(...))ly_isdir_p); + scm_make_gsubr ("ly-number->string", 1, 0,0, (SCM(*)(...)) ly_number2string); +} + +ADD_SCM_INIT_FUNC(funcs, init_functions); diff --git a/lily/molecule.cc b/lily/molecule.cc index 5620a92d18..ac70426542 100644 --- a/lily/molecule.cc +++ b/lily/molecule.cc @@ -104,13 +104,6 @@ Molecule::set_empty (bool e) } } -void -Molecule::print () const -{ -#ifndef NPRINT - gh_display (expr_); -#endif -} void Molecule::align_to (Axis a, Direction d) diff --git a/lily/my-lily-parser.cc b/lily/my-lily-parser.cc index 854f846c1b..b081bcf6eb 100644 --- a/lily/my-lily-parser.cc +++ b/lily/my-lily-parser.cc @@ -28,7 +28,7 @@ My_lily_parser::My_lily_parser (Sources * source_l) first_b_ = true; source_l_ = source_l; lexer_p_ = 0; - abbrev_beam_type_i_ = 0; + chord_tremolo_type_i_ = 0; default_duration_.durlog_i_ = 2; error_level_i_ = 0; @@ -102,9 +102,9 @@ My_lily_parser::set_last_duration (Duration const *d) } void -My_lily_parser::set_abbrev_beam (int type_i) +My_lily_parser::set_chord_tremolo (int type_i) { - abbrev_beam_type_i_ = type_i; + chord_tremolo_type_i_ = type_i; } diff --git a/lily/parser.yy b/lily/parser.yy index c16f39fd6d..db172c5e26 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -225,7 +225,7 @@ yylex (YYSTYPE *s, void * v_l) %type sub_quotes sup_quotes %type simple_element request_chord command_element Simple_music Composite_music %type Alternative_music Repeated_music -%type abbrev_type +%type tremolo_type %type int unsigned %type script_dir %type optional_modality @@ -252,7 +252,7 @@ yylex (YYSTYPE *s, void * v_l) %type Music_list %type paper_block paper_def_body %type real real_with_dimension -%type abbrev_command_req +%type shorthand_command_req %type post_request %type command_req verbose_command_req %type extender_req @@ -926,11 +926,11 @@ command_element: ; command_req: - abbrev_command_req + shorthand_command_req | verbose_command_req semicolon { $$ = $1; } ; -abbrev_command_req: +shorthand_command_req: extender_req { $$ = $1; } @@ -952,18 +952,19 @@ abbrev_command_req: | '[' ':' unsigned { if (!is_duration_b ($3)) THIS->parser_error (_f ("not a duration: %d", $3)); - else if ($3 < 8) - THIS->parser_error (_ ("Can't abbreviate")); else - THIS->set_abbrev_beam ($3); + THIS->set_chord_tremolo ($3); Chord_tremolo_req* a = new Chord_tremolo_req; a->span_dir_ = START; - a->type_i_ = THIS->abbrev_beam_type_i_; + // urg + a->type_i_ = THIS->chord_tremolo_type_i_; $$=a; } | ']' { - if (!THIS->abbrev_beam_type_i_) + /* URG + */ + if (!THIS->chord_tremolo_type_i_) { Span_req*b= new Span_req; b->span_dir_ = STOP; @@ -974,8 +975,8 @@ abbrev_command_req: { Chord_tremolo_req* a = new Chord_tremolo_req; a->span_dir_ = STOP; - a->type_i_ = THIS->abbrev_beam_type_i_; - THIS->set_abbrev_beam (0); + a->type_i_ = THIS->chord_tremolo_type_i_; + THIS->set_chord_tremolo (0); $$ = a; } } @@ -1114,7 +1115,7 @@ verbose_request: sp_p->set_spot (THIS->here_input ()); $$ = sp_p; } - | abbrev_type { + | tremolo_type { Tremolo_req* a = new Tremolo_req; a->set_spot (THIS->here_input ()); a->type_i_ = $1; @@ -1384,15 +1385,13 @@ steno_duration: ; -abbrev_type: +tremolo_type: ':' { $$ =0; } | ':' unsigned { if (!is_duration_b ($2)) THIS->parser_error (_f ("not a duration: %d", $2)); - else if ($2 < 8) - THIS->parser_error (_ ("Can't abbreviate")); $$ = $2; } ; @@ -1408,10 +1407,14 @@ simple_element: n->pitch_ = *$1; n->duration_ = *$4; - if (THIS->abbrev_beam_type_i_) + /* + URG + */ + if (THIS->chord_tremolo_type_i_) { if (n->duration_.plet_b ()) - THIS->parser_error (_ ("Can't abbreviate tuplet")); + // urg, burp. what nonsense / silly implementation + THIS->parser_error (_ ("can't put stem tremolo on tuplet")); else n->duration_.set_plet (1, 2); } diff --git a/lily/stem-engraver.cc b/lily/stem-engraver.cc index a1f467e1f6..2af08ac71b 100644 --- a/lily/stem-engraver.cc +++ b/lily/stem-engraver.cc @@ -7,7 +7,6 @@ */ #include "staff-symbol-referencer.hh" -#include "stem-engraver.hh" #include "note-head.hh" #include "stem.hh" #include "musical-request.hh" @@ -15,23 +14,53 @@ #include "stem-tremolo.hh" #include "staff-info.hh" #include "translator-group.hh" +#include "engraver.hh" -Stem_engraver::Stem_engraver() +/** + Make stems upon receiving noteheads. + */ +class Stem_engraver : public Engraver { - abbrev_req_l_ = 0; + +public: + VIRTUAL_COPY_CONS (Translator); + Stem_engraver(); + +protected: + virtual void do_creation_processing (); + virtual void acknowledge_element (Score_element_info); + virtual void do_pre_move_processing (); + virtual bool do_try_music (Music*); + +private: + int default_tremolo_type_i_; + Stem *stem_p_; + Stem_tremolo *tremolo_p_; + Rhythmic_req *rhythmic_req_l_; + Tremolo_req* tremolo_req_l_; +}; + +ADD_THIS_TRANSLATOR (Stem_engraver); + +Stem_engraver::Stem_engraver () +{ + tremolo_req_l_ = 0; stem_p_ = 0; - abbrev_p_ = 0; - default_abbrev_i_ = 16; + tremolo_p_ = 0; + default_tremolo_type_i_ = 16; rhythmic_req_l_ =0; } void Stem_engraver::do_creation_processing () { - SCM prop = get_property ("abbrev"); + /* + huh, why only at creation time? + */ + SCM prop = get_property ("tremoloFlags"); if (gh_number_p(prop)) { - default_abbrev_i_ = gh_scm2int (prop); + default_tremolo_type_i_ = gh_scm2int (prop); } } @@ -53,28 +82,40 @@ Stem_engraver::acknowledge_element(Score_element_info i) stem_p_->set_elt_property ("duration-log", gh_int2scm (duration_log)); - if (abbrev_req_l_) + if (tremolo_req_l_) { /* - suggests typing of: - c8:16 c: c: c: - hmm, which isn't so bad? - */ - int t = abbrev_req_l_->type_i_; - if (!t) - t = default_abbrev_i_; + Stem tremolo is never applied to a note by default, + is must me requested. But there is a default for the + tremolo value: + + c4:8 c c: + + the first and last (quarter) note bothe get one tremolo flag. + */ + int requested_type = tremolo_req_l_->type_i_; + if (!requested_type) + requested_type = default_tremolo_type_i_; else - default_abbrev_i_ = t; + default_tremolo_type_i_ = requested_type; - if (t) + if (requested_type) { - abbrev_p_ = new Stem_tremolo; - announce_element (Score_element_info (abbrev_p_, abbrev_req_l_)); - abbrev_p_->set_elt_property ("tremolo-flags", gh_int2scm (intlog2 (t) - (duration_log>? 2))); + tremolo_p_ = new Stem_tremolo; + announce_element (Score_element_info (tremolo_p_, tremolo_req_l_)); + /* + The number of tremolo flags is the number of flags of + the tremolo-type minus the number of flags of the note + itself. + */ + int tremolo_flags = intlog2 (requested_type) - 2 + - (duration_log > 2 ? duration_log - 2 : 0); + if (tremolo_flags < 0) + tremolo_flags = 0; + tremolo_p_->set_elt_property ("tremolo-flags", + gh_int2scm (tremolo_flags)); } } - - // must give the request, to preserve the rhythmic info. announce_element (Score_element_info (stem_p_, r)); } @@ -90,11 +131,11 @@ Stem_engraver::acknowledge_element(Score_element_info i) void Stem_engraver::do_pre_move_processing() { - if (abbrev_p_) + if (tremolo_p_) { - abbrev_p_->set_stem (stem_p_); - typeset_element (abbrev_p_); - abbrev_p_ = 0; + tremolo_p_->set_stem (stem_p_); + typeset_element (tremolo_p_); + tremolo_p_ = 0; } if (stem_p_) @@ -112,18 +153,25 @@ Stem_engraver::do_pre_move_processing() daddy_trans_l_->set_property ("stemRightBeamCount", SCM_UNDEFINED); } + // UGH. Should mark non-forced instead. + + /* + aargh: I don't get it. direction is being set (and then set + to forced), if we have a Chord_tremolo. + */ SCM dir = stem_p_->get_elt_property ("direction"); if (gh_number_p (dir) && to_dir(dir)) { stem_p_->set_elt_property ("dir-forced", SCM_BOOL_T); } - typeset_element(stem_p_); stem_p_ = 0; } - abbrev_req_l_ = 0; + + + tremolo_req_l_ = 0; } bool @@ -131,12 +179,9 @@ Stem_engraver::do_try_music (Music* r) { if (Tremolo_req* a = dynamic_cast (r)) { - abbrev_req_l_ = a; + tremolo_req_l_ = a; return true; } return false; } - -ADD_THIS_TRANSLATOR(Stem_engraver); - diff --git a/lily/stem-tremolo.cc b/lily/stem-tremolo.cc index d6b2fcfa4c..d945dc2463 100644 --- a/lily/stem-tremolo.cc +++ b/lily/stem-tremolo.cc @@ -1,5 +1,5 @@ /* - abbrev.cc -- implement Stem_tremolo + stem-tremolo.cc -- implement Stem_tremolo source file of the GNU LilyPond music typesetter @@ -18,6 +18,11 @@ #include "staff-symbol-referencer.hh" #include "directional-element-interface.hh" +/* + TODO: + lengthen stem if necessary + */ + Stem_tremolo::Stem_tremolo () { set_elt_property ("stem", SCM_EOL); @@ -45,86 +50,79 @@ Stem_tremolo::dim_callback (Dimension_cache const *c) Molecule Stem_tremolo::do_brew_molecule () const { - Stem * st = stem_l (); - int mult =0; - if (Beam * b = st->beam_l ()) - { - mult = b->get_multiplicity (); - } + Stem * stem = stem_l (); + Beam * beam = stem->beam_l (); - Real interbeam_f = paper_l ()->interbeam_f (mult); - Real w = gh_scm2double (get_elt_property ("beam-width")); - Real space = Staff_symbol_referencer_interface (st).staff_space (); - Real half_staff_space = space / 2; - Real beam_f = gh_scm2double (get_elt_property ("beam-thickness")); - - int beams_i = 0; - Real dydx = 0.25; - - if (st && st->beam_l ()) + Real dydx; + if (beam) { Real dy = 0; - SCM s = st->beam_l ()->get_elt_property ("height"); + SCM s = beam->get_elt_property ("height"); if (gh_number_p (s)) dy = gh_scm2double (s); - Real dx = st->beam_l ()->last_visible_stem ()->hpos_f () - - st->beam_l ()->first_visible_stem ()->hpos_f (); - dydx = dy/dx; - - // ugh, rather calc from Stem_tremolo_req - beams_i = st->beam_count(RIGHT) >? st->beam_count (LEFT); - } - - Molecule a (lookup_l ()->beam (dydx, w, beam_f)); - a.translate (Offset (-w/2, w / 2 * dydx)); + Real dx = beam->last_visible_stem ()->hpos_f () + - beam->first_visible_stem ()->hpos_f (); + dydx = dx ? dy/dx : 0; + } + else + // urg + dydx = 0.25; + + Real thick = gh_scm2double (get_elt_property ("beam-thickness")); + Real width = gh_scm2double (get_elt_property ("beam-width")); + Molecule a (lookup_l ()->beam (dydx, width, thick)); + a.translate (Offset (-width/2, width / 2 * dydx)); - int abbrev_flags = 1; - { - SCM a = get_elt_property ("abbrev-flags"); - if (gh_number_p (a)) - abbrev_flags = gh_scm2int (a); - } - + int tremolo_flags; + SCM s = get_elt_property ("tremolo-flags"); + if (gh_number_p (s)) + tremolo_flags = gh_scm2int (s); + else + // huh? + tremolo_flags = 1; + + int mult = beam ? beam->get_multiplicity () : 0; + Real interbeam_f = paper_l ()->interbeam_f (mult); Molecule mol; - for (int i = 0; i < abbrev_flags; i++) + for (int i = 0; i < tremolo_flags; i++) { Molecule b (a); b.translate_axis (interbeam_f * i, Y_AXIS); mol.add_molecule (b); } - mol.translate_axis (-mol.extent ()[Y_AXIS].center (), Y_AXIS); - - if (st) - { - if (st->beam_l ()) - { - mol.translate (Offset(st->hpos_f () - hpos_f (), - st->stem_end_position () * half_staff_space - - directional_element (st->beam_l ()).get () * beams_i * interbeam_f)); - } - else - { - /* - Beams should intersect one beamthickness below staff end - */ - Real dy = - mol.extent ()[Y_AXIS].length () / 2 * st->get_direction (); - - /* - uhg. Should use relative coords and placement - */ - Real whole_note_correction = (st && st->invisible_b( )) - ? 0.0 // -st->get_direction () * st->note_delta_f ()/2 - : 0.0; - - dy += st->stem_end_position (); - mol.translate (Offset(st->hpos_f () - hpos_f ()+ - whole_note_correction, dy)); - } + if (tremolo_flags) + mol.translate_axis (-mol.extent ()[Y_AXIS].center (), Y_AXIS); + + Real half_space = Staff_symbol_referencer_interface (stem).staff_space () + / 2; + if (beam) + { + // ugh, rather calc from Stem_tremolo_req + int beams_i = stem->beam_count(RIGHT) >? stem->beam_count (LEFT); + mol.translate (Offset(stem->hpos_f () - hpos_f (), + stem->stem_end_position () * half_space - + directional_element (beam).get () * beams_i * interbeam_f)); + } + else + { + /* + Beams should intersect one beamthickness below stem end + */ + Real dy = stem->stem_end_position () * half_space; + dy -= mol.extent ()[Y_AXIS].length () / 2 * stem->get_direction (); /* - there used to be half a page of code that was long commented out. - Removed in 1.1.35 - */ + uhg. Should use relative coords and placement + */ + Real whole_note_correction; + if (stem->invisible_b ()) + whole_note_correction = -stem->get_direction () + * stem->support_head ()->extent (X_AXIS).length () / 2; + else + whole_note_correction = 0; + + mol.translate (Offset (stem->hpos_f () - hpos_f () + + whole_note_correction, dy)); } return mol; diff --git a/ly/engraver.ly b/ly/engraver.ly index 4eb5788468..93ca721d07 100644 --- a/ly/engraver.ly +++ b/ly/engraver.ly @@ -255,20 +255,22 @@ LyricsContext = \translator { }; \translator { \LyricsContext } -\translator{ +ChordNameVoiceContext = \translator { \type "Engraver_group_engraver"; - \consists "Output_property_engraver"; + \name ChordNameVoice ; + \consists "Output_property_engraver"; \consistsend "Axis_group_engraver"; - \name ChordNameVoice ; \consists "Separating_line_group_engraver"; \consists "Chord_name_engraver"; -} - +}; +\translator {\ChordNameVoiceContext} ChordNameContext = \translator { \type "Engraver_group_engraver"; \name ChordNames; + + \consists "Output_property_engraver"; \accepts "ChordNameVoice"; \consistsend "Axis_group_engraver"; }; @@ -303,6 +305,12 @@ HaraKiriStaffContext = \translator { \consists "Staff_margin_engraver"; \accepts "Voice"; }; +%{ + The HaraKiriStaffContexts doesn't override \name, + so it is still named `Staff'. + + %\translator { \HaraKiriStaffContext } +%} OrchestralPartStaffContext = \translator { \StaffContext diff --git a/mutopia/Coriolan/coriolan-paper.ly b/mutopia/Coriolan/coriolan-paper.ly index e75dd8e970..9c059b4e02 100644 --- a/mutopia/Coriolan/coriolan-paper.ly +++ b/mutopia/Coriolan/coriolan-paper.ly @@ -1,9 +1,17 @@ \paper{ \paper_sixteen + + %% + \translator { \VoiceContext \remove "Dynamic_engraver"; } + \translator { \VoiceContext \name "VoiceOne"; - \consists "Line_number_engraver"; + + %% + \remove "Dynamic_engraver"; + + %%\consists "Line_number_engraver"; verticalDirection = #1 stemVerticalDirection = #1 dynamicDirection = #-1 @@ -11,7 +19,7 @@ \translator { \VoiceContext \name "VoiceTwo"; - \consists "Line_number_engraver"; + %%\consists "Line_number_engraver"; verticalDirection = #-1 stemVerticalDirection = #-1 \remove "Dynamic_engraver"; diff --git a/mutopia/Coriolan/global.ly b/mutopia/Coriolan/global.ly index 335a15a56c..7bc4c0f93d 100644 --- a/mutopia/Coriolan/global.ly +++ b/mutopia/Coriolan/global.ly @@ -14,6 +14,6 @@ copyright = "public domain"; global = \notes { \time 4/4; \key es; - \skip 1*314; + \skip 1*314; \bar "|."; } diff --git a/stepmake/stepmake/c++-vars.make b/stepmake/stepmake/c++-vars.make index 3862835b3e..e273cc7a48 100644 --- a/stepmake/stepmake/c++-vars.make +++ b/stepmake/stepmake/c++-vars.make @@ -25,5 +25,5 @@ ALL_CC_SOURCES += $(HH_FILES) $(INL_FILES) $(CC_FILES) $(YY_FILES) $(LL_FILES) O_FILES+=$(addprefix $(outdir)/, $(CC_FILES:.cc=.o) $(LL_FILES:.ll=.o) $(YY_FILES:.yy=.o)) -TAGS_FILES += $(TCC_FILES) $(HH_FILES) $(INL_FILES) $(CC_FILES) +TAGS_FILES += $(TCC_FILES) $(HH_FILES) $(INL_FILES) $(CC_FILES) $(YY_FILES) $(LL_FILES)