From: fred Date: Tue, 26 Mar 2002 22:42:59 +0000 (+0000) Subject: lilypond-1.3.2 X-Git-Tag: release/1.5.59~2012 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=f6d980f65fb861afb1832b8c234c931ae50872ac;p=lilypond.git lilypond-1.3.2 --- diff --git a/Documentation/programmer/regression-test.tely b/Documentation/programmer/regression-test.tely index fe5ee1dbfd..f878b78586 100644 --- a/Documentation/programmer/regression-test.tely +++ b/Documentation/programmer/regression-test.tely @@ -41,7 +41,7 @@ The dots go along as rests are shifted to avoid collisions. @mudelafile{dots.fly} Multiple measure rests do not collide with barlines and clefs. They -are not expanded when you set @code{Score.SkipBars}. Although the +are not expanded when you set @code{Score.skipBars}. Although the multi-measure-rest is a Spanner, minimum distances are set to keep it colliding from barlines. @@ -129,6 +129,15 @@ The horizontal middle should not overlap with a staffline. @mudelafile{tie.ly} +When tieing notes with accidentals across a bar boundary, the +accidental must not be drawn on the note in the new bar. +Instead, the next note of the same pitch in this bar should always show the +accidental (even if it's natural). +Well, and slurring a accidentaled note to a natural one across bar +boundaries should be explicit... + +@mudelafile{tie-accidental.ly} + Beams can be typeset over fixed distance aligned staffs, beam beautification doesn't really work, but knees do. Beams should be behave well, wherever the switching point is. diff --git a/input/test/key-clefs.ly b/input/test/key-clefs.ly new file mode 100644 index 0000000000..4eb5b6725a --- /dev/null +++ b/input/test/key-clefs.ly @@ -0,0 +1,25 @@ +\include "paper16.ly" + +\score { \notes + \relative cis' { + +% \clef french; % same as octaviated bass +\clef violin; +\key cis \major; cis1 \key ces \major; ces +\clef soprano; +\key cis \major; cis \key ces \major; ces +\clef mezzosoprano; +\key cis \major; cis \key ces \major; ces +\clef alto; +\key cis \major; cis \key ces \major; ces +\clef tenor; +\key cis \major; cis \key ces \major; ces +\clef baritone; +\key cis \major; cis \key ces \major; ces +\clef bass; +\key cis \major; cis \key ces \major; ces +} + + \paper{\paper_sixteen} + +} diff --git a/input/test/tie-accidental.ly b/input/test/tie-accidental.ly new file mode 100644 index 0000000000..572fb97d7e --- /dev/null +++ b/input/test/tie-accidental.ly @@ -0,0 +1,12 @@ + +\score { \notes + \relative cis' { + +\time 4/4; +gis'2 gis ~ | +gis gis4 gis | +g2 gis ~ | +gis g4 gis | +g2 gis( | +)g gis4 gis | +} diff --git a/lily/break-align-item.cc b/lily/break-align-item.cc index 32e573a68c..2718fdcd94 100644 --- a/lily/break-align-item.cc +++ b/lily/break-align-item.cc @@ -32,7 +32,7 @@ Break_align_item::do_pre_processing() flip (&align_dir_); sort_elements (); - Real interline= paper_l ()->get_realvar (interline_scm_sym); + Real interline= paper_l ()->get_var ("interline"); Link_array elems; for (int i=0; i < elem_l_arr_.size(); i++) @@ -47,7 +47,7 @@ Break_align_item::do_pre_processing() SCM symbol_list = SCM_EOL; Array dists; - SCM current_origin = ly_ch_C_to_scm (""); + SCM current_origin = ly_str02scm (""); for (int i=0; i <= elems.size (); i++) { Score_element *next_elt = i < elems.size () @@ -58,14 +58,14 @@ Break_align_item::do_pre_processing() if (next_elt) { - next_origin = next_elt->get_elt_property (origin_scm_sym); + next_origin = next_elt->get_elt_property ("origin"); next_origin = - (next_origin == SCM_BOOL_F) - ? ly_ch_C_to_scm ("") - : SCM_CDR (next_origin); + (next_origin == SCM_UNDEFINED) + ? ly_str02scm ("") + : next_origin; } else - next_origin = ly_ch_C_to_scm ("begin-of-note"); + next_origin = ly_str02scm ("begin-of-note"); SCM extra_space = scm_eval (scm_listify (ly_symbol ("break-align-spacer"), @@ -84,7 +84,8 @@ Break_align_item::do_pre_processing() symbol_list = SCM_CDR (scm_reverse (symbol_list)); for (int i=0; i set_elt_property (SCM_CAR (symbol_list), + String sym_str = ly_scm2string (SCM_CAR (symbol_list)); + elems[i]->set_elt_property (sym_str, scm_cons (gh_double2scm (0), gh_double2scm (dists[i+1]))); @@ -93,14 +94,14 @@ Break_align_item::do_pre_processing() // urg - SCM first_pair = elems[0]->get_elt_property (minimum_space_scm_sym); - if (first_pair == SCM_BOOL_F) + SCM first_pair = elems[0]->get_elt_property ("minimum-space"); + if (first_pair == SCM_UNDEFINED) first_pair = gh_cons (gh_double2scm (0.0), gh_double2scm (0.0)); else - first_pair = SCM_CDR (first_pair); + first_pair = first_pair; scm_set_car_x (first_pair, gh_double2scm (-dists[0])); - elems[0]->set_elt_property (minimum_space_scm_sym, first_pair); + elems[0]->set_elt_property ("minimum-space", first_pair); Axis_align_item::do_pre_processing(); @@ -112,12 +113,12 @@ Break_align_item::do_pre_processing() Real stretch_distance =0.; - if (SCM_CAR (symbol_list) == extra_space_scm_sym) + if (SCM_CAR (symbol_list) == gh_symbol2scm ("extra-space")) { spring_len += dists.top (); stretch_distance = dists.top (); } - else if (SCM_CAR (symbol_list) == minimum_space_scm_sym) + else if (SCM_CAR (symbol_list) == gh_symbol2scm ("minimum-space")) { spring_len = spring_len >? dists.top (); stretch_distance = spring_len; @@ -129,11 +130,11 @@ Break_align_item::do_pre_processing() The pairs are in the format of an interval (ie. CAR < CDR). */ - column_l ()->set_elt_property (extra_space_scm_sym, + column_l ()->set_elt_property ("extra-space", scm_cons (gh_double2scm (pre_space), gh_double2scm (spring_len))); - column_l ()->set_elt_property (stretch_distance_scm_sym, + column_l ()->set_elt_property ("stretch-distance", gh_cons (gh_double2scm (-dists[0]), gh_double2scm (stretch_distance))); @@ -148,12 +149,12 @@ Break_align_item::Break_align_item () void Break_align_item::add_breakable_item (Item *it) { - SCM pr = it->remove_elt_property (break_priority_scm_sym); + SCM pr = it->remove_elt_property ("break-priority"); - if (pr == SCM_BOOL_F) + if (pr == SCM_UNDEFINED) return; - int priority = gh_scm2int (SCM_CDR (pr)); + int priority = gh_scm2int (pr); Score_element * column_l = get_elt_by_priority (priority); Axis_group_item * hg=0; @@ -171,7 +172,7 @@ Break_align_item::add_breakable_item (Item *it) warning bells about missing Y refpoints go off later on. */ hg->set_parent (this, Y_AXIS); - hg->set_elt_property (ly_symbol ("origin"), ly_ch_C_to_scm (it->name ())); + hg->set_elt_property ("origin", ly_str02scm (it->name ())); pscore_l_->typeset_element (hg); add_element_priority (hg, priority); @@ -182,3 +183,4 @@ Break_align_item::add_breakable_item (Item *it) hg->add_element (it); } + diff --git a/lily/include/lily-guile.hh b/lily/include/lily-guile.hh index 994489c411..dfdf39ffbf 100644 --- a/lily/include/lily-guile.hh +++ b/lily/include/lily-guile.hh @@ -15,7 +15,7 @@ #include #include "direction.hh" -SCM ly_ch_C_to_scm (char const*c); +SCM ly_str02scm (char const*c); SCM ly_ch_C_eval_scm (char const*c); SCM ly_symbol (String name); String symbol_to_string (SCM); @@ -36,7 +36,7 @@ SCM array_to_list (SCM *a , int l); void read_lily_scm_file (String); void init_lily_guile (); -#include "ly-symbols.hh" + void init_ly_protection (); unsigned int ly_scm_hash (SCM s); diff --git a/lily/key-item.cc b/lily/key-item.cc index d11424b41e..f85303ff71 100644 --- a/lily/key-item.cc +++ b/lily/key-item.cc @@ -22,7 +22,7 @@ const int SHARP_TOP_PITCH=4; /* ais and bis typeset in lower octave */ Key_item::Key_item () { multi_octave_b_ = false; - set_elt_property (breakable_scm_sym, SCM_BOOL_T); + set_elt_property ("breakable", SCM_BOOL_T); set_c_position (0); } @@ -73,6 +73,17 @@ Key_item::calculate_position(int p, int a) const { p -= 7; /* Typeset below c_position */ } + /* Provide for the four cases in which there's a glitch */ + /* it's a hack, but probably not worth */ + /* the effort of finding a nicer solution. dl. */ + if (get_c_position ()==2 && a>0 && p==3) + p -= 7; + if (get_c_position ()==-3 && a>0 && p==-1) + p += 7; + if (get_c_position ()==-4 && a<0 && p==-1) + p += 7; + if (get_c_position ()==-2 && a<0 && p==-3) + p += 7; return p + get_c_position (); } } @@ -131,3 +142,4 @@ Key_item::do_brew_molecule_p() const + diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index b42b34592e..7fd60380af 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -20,7 +20,7 @@ #include "debug.hh" SCM -ly_ch_C_to_scm (char const*c) +ly_str02scm (char const*c) { // this all really sucks, guile should take char const* arguments! return gh_str02scm ((char*)c); @@ -168,7 +168,7 @@ ly_gulp_file (SCM name) Simple_file_storage f(s); - return ly_ch_C_to_scm (f.ch_C()); + return ly_str02scm (f.ch_C()); } void diff --git a/lily/local-key-engraver.cc b/lily/local-key-engraver.cc index 8e773bf05a..85c857f369 100644 --- a/lily/local-key-engraver.cc +++ b/lily/local-key-engraver.cc @@ -65,14 +65,9 @@ Local_key_engraver::process_acknowledged () Item * support_l = support_l_arr_[i]; Note_req * note_l = mel_l_arr_[i]; - if (tied_l_arr_.find_l (support_l) && - !note_l->forceacc_b_) - { - if (!forget) - local_key_.set (note_l->pitch_); - continue; - } - + if (tied_l_arr_.find_l (support_l) && !forget) + local_key_.set (note_l->pitch_); + if (!note_l->forceacc_b_ && local_key_.different_acc (note_l->pitch_)) continue; @@ -82,9 +77,8 @@ Local_key_engraver::process_acknowledged () announce_element (Score_element_info (key_item_p_, 0)); } - key_item_p_->add_pitch (note_l->pitch_, - note_l->cautionary_b_); + note_l->cautionary_b_); key_item_p_->add_support (support_l); if (!forget) @@ -130,7 +124,7 @@ Local_key_engraver::acknowledge_element (Score_element_info info) SCM wg= get_property ("weAreGraceContext", 0); bool selfgr = gh_boolean_p (wg) &&gh_scm2bool (wg); - bool he_gr = info.elem_l_->get_elt_property (grace_scm_sym) != SCM_BOOL_F; + bool he_gr = info.elem_l_->get_elt_property ("grace") != SCM_UNDEFINED; Grace_align_item * gai = dynamic_cast (info.elem_l_); if (he_gr && !selfgr && gai) @@ -176,3 +170,4 @@ Local_key_engraver::do_process_requests() ADD_THIS_TRANSLATOR(Local_key_engraver); + diff --git a/lily/mark-engraver.cc b/lily/mark-engraver.cc index 444bd2ffeb..17da3985e1 100644 --- a/lily/mark-engraver.cc +++ b/lily/mark-engraver.cc @@ -46,8 +46,9 @@ Mark_engraver::do_process_requests () { create_items (mark_req_l_); text_p_->text_str_ = mark_req_l_->str_; - SCM st = gh_str02scm ((text_p_->text_str_.index_any_i ("0123456789") >= 0 ) + SCM st = ly_str02scm ((text_p_->text_str_.index_any_i ("0123456789") >= 0 ) ? "mark" : "large"); - text_p_->set_elt_property (style_scm_sym, st); + text_p_->set_elt_property ("style", st); } } + diff --git a/lily/multi-measure-rest-engraver.cc b/lily/multi-measure-rest-engraver.cc index 51ff446542..e4e115b4dc 100644 --- a/lily/multi-measure-rest-engraver.cc +++ b/lily/multi-measure-rest-engraver.cc @@ -74,8 +74,8 @@ Multi_measure_rest_engraver::do_process_requests () Time_description const *time = get_staff_info().time_C_; mmrest_p_ = new Multi_measure_rest; if(dynamic_cast (multi_measure_req_l_)) - mmrest_p_->set_elt_property (alt_symbol_scm_sym, - ly_ch_C_to_scm ("scripts-repeatsign")); + mmrest_p_->set_elt_property ("alt-symbol", + ly_str02scm ("scripts-repeatsign")); announce_element (Score_element_info (mmrest_p_, multi_measure_req_l_)); start_measure_i_ = time->bars_i_; } @@ -122,3 +122,4 @@ Multi_measure_rest_engraver::do_post_move_processing () } } + diff --git a/lily/paper-outputter.cc b/lily/paper-outputter.cc index b58ba0eeaf..9dd7d28729 100644 --- a/lily/paper-outputter.cc +++ b/lily/paper-outputter.cc @@ -80,8 +80,8 @@ Paper_outputter::output_header () } SCM args_scm = - gh_list (ly_ch_C_to_scm (creator.ch_l ()), - ly_ch_C_to_scm (generate.ch_l ()), SCM_UNDEFINED); + gh_list (ly_str02scm (creator.ch_l ()), + ly_str02scm (generate.ch_l ()), SCM_UNDEFINED); #ifndef NPRINT DEBUG_OUT << "output_header\n"; @@ -91,7 +91,7 @@ Paper_outputter::output_header () } #endif - SCM scm = gh_cons (header_scm_sym, args_scm); + SCM scm = gh_cons (gh_symbol2scm ("header"), args_scm); output_scheme (scm); } @@ -140,13 +140,13 @@ Paper_outputter::output_molecule (Molecule const*m, Offset o, char const *nm) if (i->font_) { output_scheme (gh_list (ly_symbol ("select-font"), - ly_ch_C_to_scm (symbol_to_string (i->font_).ch_C()), + ly_str02scm (symbol_to_string (i->font_).ch_C()), SCM (i->magn_), SCM_UNDEFINED)); } SCM box_scm - = gh_list (placebox_scm_sym, + = gh_list (gh_symbol2scm ("placebox"), gh_double2scm (a_off.x ()), gh_double2scm (a_off.y ()), SCM(i->func_), @@ -241,7 +241,7 @@ Paper_outputter::output_font_def (int i, String str) { SCM scm = gh_list (ly_symbol ("font-def"), gh_int2scm (i), - ly_ch_C_to_scm (str.ch_l ()), + ly_str02scm (str.ch_l ()), SCM_UNDEFINED); output_scheme (scm); @@ -252,8 +252,8 @@ Paper_outputter::output_Real_def (String k, Real v) { SCM scm = gh_list (ly_symbol ("lily-def"), - ly_ch_C_to_scm (k.ch_l ()), - ly_ch_C_to_scm (to_str(v).ch_l ()), + ly_str02scm (k.ch_l ()), + ly_str02scm (to_str(v).ch_l ()), SCM_UNDEFINED); output_scheme (scm); @@ -265,20 +265,20 @@ Paper_outputter::output_String_def (String k, String v) { SCM scm = gh_list (ly_symbol ("lily-def"), - ly_ch_C_to_scm (k.ch_l ()), - ly_ch_C_to_scm (v.ch_l ()), + ly_str02scm (k.ch_l ()), + ly_str02scm (v.ch_l ()), SCM_UNDEFINED); output_scheme (scm); - gh_define (k.ch_l (), ly_ch_C_to_scm (v.ch_l ())); + gh_define (k.ch_l (), ly_str02scm (v.ch_l ())); } void Paper_outputter::output_int_def (String k, int v) { SCM scm = gh_list (ly_symbol ("lily-def"), - ly_ch_C_to_scm (k.ch_l ()), - ly_ch_C_to_scm (to_str (v).ch_l ()), + ly_str02scm (k.ch_l ()), + ly_str02scm (to_str (v).ch_l ()), SCM_UNDEFINED); output_scheme (scm); @@ -300,3 +300,4 @@ Paper_outputter::stop_last_line () SCM scm = gh_list (ly_symbol ("stop-last-line"), SCM_UNDEFINED); output_scheme (scm); } + diff --git a/lily/text-engraver.cc b/lily/text-engraver.cc index a2bd014612..cf8c0ea0f6 100644 --- a/lily/text-engraver.cc +++ b/lily/text-engraver.cc @@ -91,7 +91,7 @@ Text_engraver::do_process_requests () } ss->set_victim (text); - ss->set_elt_property (script_priority_scm_sym, + ss->set_elt_property ("script-priority", gh_int2scm (200)); ss->dir_ = r->dir_; @@ -99,7 +99,7 @@ Text_engraver::do_process_requests () text->text_str_ = r->text_str_; if (r->style_str_.length_i ()) - text->set_elt_property (style_scm_sym, ly_ch_C_to_scm (r->style_str_.ch_C())); + text->set_elt_property ("style", ly_str02scm (r->style_str_.ch_C())); SCM empty = get_property ("textEmptyDimension", 0); if (gh_boolean_p (empty) && gh_scm2bool (empty)) @@ -134,3 +134,4 @@ Text_engraver::do_post_move_processing () } ADD_THIS_TRANSLATOR(Text_engraver); +