From c76d27c59244a331a2873a40e0d7e40ad378d4b8 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sun, 5 Sep 2004 11:19:14 +0000 Subject: [PATCH] * input/regression/key-signature-cancellation.ly (Module): new file. * lily/key-signature-interface.cc (print): take position difference into account when spacing naturals. * lily/key-engraver.cc (create_key): create KeyCancellation grob separately, so the cancellation can be put before the staff-bar * scm/define-grobs.scm (all-grob-descriptions): add a KeyCancellation grob. * lily/tuplet-engraver.cc (struct Tuplet_description): new struct. Use to clean-up Tuplet_engraver --- ChangeLog | 19 ++++ Documentation/topdocs/NEWS.texi | 4 + .../regression/key-signature-cancellation.ly | 18 ++++ lily/accidental-engraver.cc | 14 +-- lily/accidental.cc | 6 +- lily/align-interface.cc | 8 +- lily/bar-line.cc | 2 +- lily/bar-number-engraver.cc | 2 +- lily/beam-quanting.cc | 2 +- lily/beam.cc | 18 ++-- lily/break-align-engraver.cc | 2 +- lily/break-align-interface.cc | 6 +- lily/chord-name-engraver.cc | 2 +- lily/clef-engraver.cc | 4 +- lily/cluster-engraver.cc | 2 +- lily/cluster.cc | 2 +- lily/completion-note-heads-engraver.cc | 2 +- lily/context-def.cc | 4 +- lily/context-scheme.cc | 16 ++-- lily/context.cc | 2 +- lily/custos-engraver.cc | 2 +- lily/custos.cc | 2 +- lily/dots.cc | 2 +- lily/drum-note-engraver.cc | 2 +- lily/drum-note-performer.cc | 2 +- lily/duration.cc | 6 +- lily/dynamic-engraver.cc | 4 +- lily/dynamic-performer.cc | 6 +- lily/event.cc | 4 +- lily/fingering-engraver.cc | 2 +- lily/font-metric.cc | 2 +- lily/font-size-engraver.cc | 2 +- lily/gourlay-breaking.cc | 2 +- lily/grob-interface.cc | 2 +- lily/grob-scheme.cc | 6 +- lily/grob.cc | 2 +- lily/include/lily-guile.hh | 14 ++- lily/key-engraver.cc | 22 ++++- lily/key-signature-interface.cc | 23 ++--- lily/lexer.ll | 4 +- lily/lily-guile.cc | 18 ++-- lily/lily-lexer.cc | 2 +- lily/lily-parser.cc | 4 +- lily/line-interface.cc | 2 +- lily/line-spanner.cc | 4 +- lily/lookup.cc | 6 +- lily/mark-engraver.cc | 4 +- lily/modified-font-metric.cc | 4 +- lily/multi-measure-rest-engraver.cc | 2 +- lily/multi-measure-rest.cc | 4 +- lily/music.cc | 8 +- lily/note-collision.cc | 4 +- lily/note-column.cc | 6 +- lily/note-head.cc | 6 +- lily/note-heads-engraver.cc | 2 +- lily/output-def.cc | 2 +- lily/parser.yy | 14 +-- lily/part-combine-iterator.cc | 4 +- lily/pitch-squash-engraver.cc | 2 +- lily/property-iterator.cc | 2 +- lily/rest-engraver.cc | 2 +- lily/rest.cc | 6 +- lily/rhythmic-head.cc | 2 +- lily/scm-hash.cc | 2 +- lily/scm-option.cc | 2 +- lily/score-engraver.cc | 8 +- lily/script-column.cc | 2 +- lily/self-aligment-interface.cc | 4 +- lily/separation-item.cc | 2 +- lily/side-position-interface.cc | 4 +- lily/simple-spacer.cc | 2 +- lily/slur-scoring.cc | 2 +- lily/slur.cc | 2 +- lily/staff-symbol-referencer.cc | 2 +- lily/staff-symbol.cc | 4 +- lily/stem-engraver.cc | 6 +- lily/stem-tremolo.cc | 4 +- lily/stem.cc | 8 +- lily/stencil-scheme.cc | 12 +-- lily/tab-note-heads-engraver.cc | 2 +- lily/text-engraver.cc | 2 +- lily/text-item.cc | 6 +- lily/time-signature.cc | 2 +- lily/timing-translator.cc | 2 +- lily/translator-property.cc | 4 +- lily/tuplet-bracket.cc | 12 +-- lily/tuplet-engraver.cc | 92 +++++++++---------- lily/virtual-font-metric.cc | 2 +- lily/volta-engraver.cc | 2 +- scm/define-grobs.scm | 32 +++++-- 90 files changed, 326 insertions(+), 254 deletions(-) create mode 100644 input/regression/key-signature-cancellation.ly diff --git a/ChangeLog b/ChangeLog index c0b9e1376e..69102fd611 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,25 @@ +2004-09-05 Han-Wen Nienhuys + + * input/regression/key-signature-cancellation.ly (Module): new file. + + * lily/*.cc: more ly_scm2 -> scm_to converions. + + * lily/key-signature-interface.cc (print): take position + difference into account when spacing naturals. + + * lily/key-engraver.cc (create_key): create KeyCancellation grob + separately, so the cancellation can be put before the staff-bar + + * scm/define-grobs.scm (all-grob-descriptions): add a + KeyCancellation grob. + + * lily/tuplet-engraver.cc (struct Tuplet_description): new + struct. Use to clean-up Tuplet_engraver + 2004-09-04 Han-Wen Nienhuys * lily/*: ly_scm2int -> scm_to_int + ly_scm2double -> scm_to_double * lily/include/lily-guile.hh (scm_from_double): more compat glue. diff --git a/Documentation/topdocs/NEWS.texi b/Documentation/topdocs/NEWS.texi index 388f8d4389..133d2f6f59 100644 --- a/Documentation/topdocs/NEWS.texi +++ b/Documentation/topdocs/NEWS.texi @@ -8,6 +8,10 @@ @itemize @bullet +@item Key signature cancellations are now printed before the bar line, +and their appearance has been improved. + + @item The automatic staff changer, which is invoked with @code{\autochange}, now creates the @code{up} and @code{down} staff automatically, and uses bass clef for the bottom staff. diff --git a/input/regression/key-signature-cancellation.ly b/input/regression/key-signature-cancellation.ly new file mode 100644 index 0000000000..3bd0539541 --- /dev/null +++ b/input/regression/key-signature-cancellation.ly @@ -0,0 +1,18 @@ +\header { texidoc = "Cancellation are printed before the barline. The + spacing of the natural signs depends on their vertical + positions. The stems should not clash graphically." + + +} + +\paper { + raggedright = ##T +} + +{ + + \key a \major + g'1 + \key f \minor + g'1 +} diff --git a/lily/accidental-engraver.cc b/lily/accidental-engraver.cc index b54366a066..d74ac87635 100644 --- a/lily/accidental-engraver.cc +++ b/lily/accidental-engraver.cc @@ -151,7 +151,7 @@ number_accidentals_from_sig (bool *different, SCM sig, Pitch *pitch, if (ly_c_pair_p (prev_local)) { if (ly_c_pair_p (ly_cdr (prev_local)) - && ly_c_number_p (laziness)) + && scm_is_number (laziness)) { int barnum = scm_to_int (ly_cddr (prev_local)); @@ -168,10 +168,10 @@ number_accidentals_from_sig (bool *different, SCM sig, Pitch *pitch, prev_alt = (prev_alt == SCM_BOOL_F) ? scm_int2num (0) : ly_cdr (prev_alt); /* UGH. prev_acc can be #t in case of ties. What is this for? */ - int p = ly_c_number_p (prev_alt) ? scm_to_int (prev_alt) : 0; + int p = scm_is_number (prev_alt) ? scm_to_int (prev_alt) : 0; int num; - if (a == p && ly_c_number_p (prev_alt)) + if (a == p && scm_is_number (prev_alt)) num = 0; else if ( (abs (a)get_property ("localKeySignature"); bool same_octave_b = - ly_c_eq_p (ly_symbol2scm ("same-octave"), type); + scm_is_eq (ly_symbol2scm ("same-octave"), type); bool any_octave_b = - ly_c_eq_p (ly_symbol2scm ("any-octave"), type); + scm_is_eq (ly_symbol2scm ("any-octave"), type); if (same_octave_b || any_octave_b) { @@ -227,7 +227,7 @@ number_accidentals (bool *different, /* if symbol then it is a context name. Scan parent contexts to find it. */ - else if (ly_c_symbol_p (rule)) + else if (scm_is_symbol (rule)) { Context *dad = origin; while (dad && !dad->is_alias (rule)) diff --git a/lily/accidental.cc b/lily/accidental.cc index 79260eed7b..2844973503 100644 --- a/lily/accidental.cc +++ b/lily/accidental.cc @@ -48,7 +48,7 @@ Accidental_interface::after_line_breaking (SCM smob) } Array -Accidental_interface::accurate_boxes (Grob *a,Grob**common) +Accidental_interface::accurate_boxes (Grob *a, Grob**common) { Box b; b[X_AXIS] = a->extent (a, X_AXIS); @@ -65,7 +65,7 @@ Accidental_interface::accurate_boxes (Grob *a,Grob**common) SCM accs = a->get_property ("accidentals"); SCM scm_style = a->get_property ("style"); - if (!ly_c_symbol_p (scm_style) + if (!scm_is_symbol (scm_style) && !parens && scm_ilength (accs) == 1) { @@ -180,7 +180,7 @@ Accidental_interface::print (SCM smob) SCM scm_style = me->get_property ("style"); String style; - if (ly_c_symbol_p (scm_style)) + if (scm_is_symbol (scm_style)) { style = ly_symbol2string (scm_style); } diff --git a/lily/align-interface.cc b/lily/align-interface.cc index e11671ca51..7cfea27c2a 100644 --- a/lily/align-interface.cc +++ b/lily/align-interface.cc @@ -52,7 +52,7 @@ Align_interface::align_to_fixed_distance (Grob *me , Axis a) SCM d = me->get_property ("stacking-dir"); - Direction stacking_dir = ly_c_number_p (d) ? to_dir (d) : CENTER; + Direction stacking_dir = scm_is_number (d) ? to_dir (d) : CENTER; if (!stacking_dir) stacking_dir = DOWN; @@ -124,7 +124,7 @@ Align_interface::align_elements_to_extents (Grob * me, Axis a) SCM d = me->get_property ("stacking-dir"); - Direction stacking_dir = ly_c_number_p (d) ? to_dir (d) : CENTER; + Direction stacking_dir = scm_is_number (d) ? to_dir (d) : CENTER; if (!stacking_dir) stacking_dir = DOWN; @@ -217,7 +217,7 @@ Align_interface::align_elements_to_extents (Grob * me, Axis a) FIXME: uncommenting freaks out the Y-alignment of line-of-score. */ - if (ly_c_number_p (align)) + if (scm_is_number (align)) center_offset = total.linear_combination (scm_to_double (align)); for (int j = 0 ; j < all_grobs.size (); j++) @@ -254,7 +254,7 @@ find_fixed_alignment_parent (Grob *g) { while (g) { - if (ly_c_number_p (g->get_property ("forced-distance"))) + if (scm_is_number (g->get_property ("forced-distance"))) return g; g = g->get_parent (Y_AXIS); diff --git a/lily/bar-line.cc b/lily/bar-line.cc index 56609b231f..4a4a4513b5 100644 --- a/lily/bar-line.cc +++ b/lily/bar-line.cc @@ -195,7 +195,7 @@ Bar_line::get_staff_bar_size (SCM smob) Grob*me = unsmob_grob (smob); Real ss = Staff_symbol_referencer::staff_space (me); SCM size = me->get_property ("bar-size"); - if (ly_c_number_p (size)) + if (scm_is_number (size)) return scm_make_real (scm_to_double (size)*ss); else if (Staff_symbol_referencer::get_staff_symbol (me)) { diff --git a/lily/bar-number-engraver.cc b/lily/bar-number-engraver.cc index cadf996c9a..e0a6917648 100644 --- a/lily/bar-number-engraver.cc +++ b/lily/bar-number-engraver.cc @@ -54,7 +54,7 @@ Bar_number_engraver::process_music () { SCM bn = get_property ("currentBarNumber"); SCM proc = get_property ("barNumberVisibility"); - if (ly_c_number_p (bn) && ly_c_procedure_p (proc) + if (scm_is_number (bn) && ly_c_procedure_p (proc) && to_boolean (scm_call_1(proc, bn))) { create_items (); diff --git a/lily/beam-quanting.cc b/lily/beam-quanting.cc index c329bafcc5..5dd9da6e75 100644 --- a/lily/beam-quanting.cc +++ b/lily/beam-quanting.cc @@ -108,7 +108,7 @@ Beam::quanting (SCM smob) Real slt = Staff_symbol_referencer::line_thickness (me) / ss; SCM sdy = me->get_property ("least-squares-dy"); - Real dy_mus = ly_c_number_p (sdy) ? scm_to_double (sdy) : 0.0; + Real dy_mus = scm_is_number (sdy) ? scm_to_double (sdy) : 0.0; Real straddle = 0.0; Real sit = (thickness - slt) / 2; diff --git a/lily/beam.cc b/lily/beam.cc index 03f5206e04..65e1aafe38 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -419,7 +419,7 @@ Beam::print (SCM grob) Stencil gapped; int gap_count = 0; - if (ly_c_number_p (me->get_property ("gap-count"))) + if (scm_is_number (me->get_property ("gap-count"))) { gap_count = scm_to_int (me->get_property ("gap-count")); gapped = Lookup::beam (dydx, w - 2 * gap_length, thick, blot); @@ -568,7 +568,7 @@ Beam::get_default_dir (Grob *me) scm_cons (scm_int2num (total[UP]), scm_int2num (total[DOWN]))); - if (ly_c_number_p (s) && scm_to_int (s)) + if (scm_is_number (s) && scm_to_int (s)) return to_dir (s); /* If dir is not determined: get default */ @@ -664,7 +664,7 @@ void Beam::consider_auto_knees (Grob* me) { SCM scm = me->get_property ("auto-knee-gap"); - if (!ly_c_number_p (scm)) + if (!scm_is_number (scm)) return ; Real threshold = scm_to_double (scm); @@ -1099,7 +1099,7 @@ Beam::check_concave (SCM smob) */ bool is_concave1 = false; SCM gap = me->get_property ("concaveness-gap"); - if (ly_c_number_p (gap)) + if (scm_is_number (gap)) { Real r1 = scm_to_double (gap); Real dy = Stem::chord_start_y (stems.top ()) @@ -1136,7 +1136,7 @@ Beam::check_concave (SCM smob) Real concaveness2 = 0; SCM thresh = me->get_property ("concaveness-threshold"); Real r2 = infinity_f; - if (!is_concave1 && ly_c_number_p (thresh)) + if (!is_concave1 && scm_is_number (thresh)) { r2 = scm_to_double (thresh); @@ -1295,7 +1295,7 @@ Beam::set_stem_lengths (Grob *me) bool gap = false; Real thick =0.0; - if (ly_c_number_p (me->get_property ("gap-count")) + if (scm_is_number (me->get_property ("gap-count")) &&scm_to_int (me->get_property ("gap-count"))) { gap = true; @@ -1453,7 +1453,7 @@ Beam::rest_collision_callback (SCM element_smob, SCM axis) Grob *rest = unsmob_grob (element_smob); Axis a = (Axis) scm_to_int (axis); - if (ly_c_number_p (rest->get_property ("staff-position"))) + if (scm_is_number (rest->get_property ("staff-position"))) return scm_int2num (0); assert (a == Y_AXIS); @@ -1470,7 +1470,7 @@ Beam::rest_collision_callback (SCM element_smob, SCM axis) Drul_array pos (0, 0); SCM s = beam->get_property ("positions"); - if (ly_c_pair_p (s) && ly_c_number_p (ly_car (s))) + if (ly_c_pair_p (s) && scm_is_number (ly_car (s))) pos = ly_scm2interval (s); Real staff_space = Staff_symbol_referencer::staff_space (rest); @@ -1523,7 +1523,7 @@ bool Beam::is_knee (Grob* me) { SCM k = me->get_property ("knee"); - if (ly_c_boolean_p (k)) + if (scm_is_bool (k)) return ly_scm2bool (k); bool knee = false; diff --git a/lily/break-align-engraver.cc b/lily/break-align-engraver.cc index 9c830d3fce..da8a22e0af 100644 --- a/lily/break-align-engraver.cc +++ b/lily/break-align-engraver.cc @@ -85,7 +85,7 @@ Break_align_engraver::acknowledge_grob (Grob_info inf) return ; SCM align_name = item->get_property ("break-align-symbol"); - if (!ly_c_symbol_p (align_name)) + if (!scm_is_symbol (align_name)) return ; if (!align_) diff --git a/lily/break-align-interface.cc b/lily/break-align-interface.cc index c7ec2daabb..ae9b7779c5 100644 --- a/lily/break-align-interface.cc +++ b/lily/break-align-interface.cc @@ -186,7 +186,7 @@ Break_align_interface::do_alignment (Grob *grob) reason. */ for (SCM s = r ? r->get_property ("elements") : SCM_EOL; - !ly_c_symbol_p (rsym) && ly_c_pair_p (s); s = ly_cdr (s)) + !scm_is_symbol (rsym) && ly_c_pair_p (s); s = ly_cdr (s)) { Grob * elt =unsmob_grob (ly_car (s)); @@ -197,14 +197,14 @@ Break_align_interface::do_alignment (Grob *grob) edge_idx = next_idx; SCM entry = SCM_EOL; - if (ly_c_symbol_p (rsym)) + if (scm_is_symbol (rsym)) entry = scm_assq (rsym, alist); bool entry_found = ly_c_pair_p (entry); if (!entry_found) { String sym_string; - if (ly_c_symbol_p (rsym)) + if (scm_is_symbol (rsym)) sym_string = ly_symbol2string (rsym); String orig_string ; diff --git a/lily/chord-name-engraver.cc b/lily/chord-name-engraver.cc index ac5b14d4cb..a5603207c5 100644 --- a/lily/chord-name-engraver.cc +++ b/lily/chord-name-engraver.cc @@ -86,7 +86,7 @@ Chord_name_engraver::process_music () if (inversion_event) { SCM oct = inversion_event->get_property ("octavation"); - if (ly_c_number_p (oct)) + if (scm_is_number (oct)) { Pitch *p = unsmob_pitch (inversion_event->get_property ("pitch")); int octavation = scm_to_int (oct); diff --git a/lily/clef-engraver.cc b/lily/clef-engraver.cc index 176f036926..53074e6e27 100644 --- a/lily/clef-engraver.cc +++ b/lily/clef-engraver.cc @@ -92,11 +92,11 @@ Clef_engraver::create_clef () clef_ = c; SCM cpos = get_property ("clefPosition"); - if (ly_c_number_p (cpos)) + if (scm_is_number (cpos)) clef_->set_property ("staff-position", cpos); SCM oct = get_property ("clefOctavation"); - if (ly_c_number_p (oct) && scm_to_int (oct)) + if (scm_is_number (oct) && scm_to_int (oct)) { Item * g = make_item ("OctavateEight", SCM_EOL); diff --git a/lily/cluster-engraver.cc b/lily/cluster-engraver.cc index 9e10915541..0e99a2a8f2 100644 --- a/lily/cluster-engraver.cc +++ b/lily/cluster-engraver.cc @@ -73,7 +73,7 @@ Cluster_spanner_engraver::process_music () { SCM c0scm = get_property ("middleCPosition"); - int c0 = ly_c_number_p (c0scm) ? scm_to_int (c0scm) : 0; + int c0 = scm_is_number (c0scm) ? scm_to_int (c0scm) : 0; int pmax = INT_MIN; int pmin = INT_MAX; diff --git a/lily/cluster.cc b/lily/cluster.cc index 794c42640b..d585735ac7 100644 --- a/lily/cluster.cc +++ b/lily/cluster.cc @@ -41,7 +41,7 @@ brew_cluster_piece (Grob *me, Array bottom_points, Array top_poi SCM shape_scm = me->get_property ("style"); String shape; - if (ly_c_symbol_p (shape_scm)) + if (scm_is_symbol (shape_scm)) { shape = ly_symbol2string (shape_scm); } diff --git a/lily/completion-note-heads-engraver.cc b/lily/completion-note-heads-engraver.cc index cea76ecafa..71d2abdf4d 100644 --- a/lily/completion-note-heads-engraver.cc +++ b/lily/completion-note-heads-engraver.cc @@ -244,7 +244,7 @@ Completion_heads_engraver::process_music () int pos = pit->steps (); SCM c0 = get_property ("middleCPosition"); - if (ly_c_number_p (c0)) + if (scm_is_number (c0)) pos += scm_to_int (c0); note->set_property ("staff-position", scm_int2num (pos)); diff --git a/lily/context-def.cc b/lily/context-def.cc index 5ad0911229..a438341286 100644 --- a/lily/context-def.cc +++ b/lily/context-def.cc @@ -158,7 +158,7 @@ Context_def::get_accepted (SCM user_mod) const Link_array Context_def::path_to_acceptable_context (SCM type_sym, Output_def *odef) const { - assert (ly_c_symbol_p (type_sym)); + assert (scm_is_symbol (type_sym)); SCM accepted = get_accepted (SCM_EOL); @@ -364,7 +364,7 @@ Context_def::to_alist () const ell = scm_cons (scm_cons (ly_symbol2scm ("context-name"), context_name_), ell); - if (ly_c_symbol_p (translator_group_type_)) + if (scm_is_symbol (translator_group_type_)) ell = scm_cons (scm_cons (ly_symbol2scm ("group-type"), translator_group_type_), ell); return ell; diff --git a/lily/context-scheme.cc b/lily/context-scheme.cc index fb83375e06..594a7c19a1 100644 --- a/lily/context-scheme.cc +++ b/lily/context-scheme.cc @@ -40,7 +40,7 @@ LY_DEFINE (ly_context_grob_definition, "ly:context-grob-definition", { Context *tr = unsmob_context (context); SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "Context"); - SCM_ASSERT_TYPE (ly_c_symbol_p (name), name, SCM_ARG2, __FUNCTION__, "symbol"); + SCM_ASSERT_TYPE (scm_is_symbol (name), name, SCM_ARG2, __FUNCTION__, "symbol"); return updated_grob_properties (tr, name); @@ -56,8 +56,8 @@ LY_DEFINE (ly_context_pushpop_property, "ly:context-pushpop-property", { Context *tg = unsmob_context (context); SCM_ASSERT_TYPE (tg, context, SCM_ARG1, __FUNCTION__, "context"); - SCM_ASSERT_TYPE (ly_c_symbol_p (grob), grob, SCM_ARG2, __FUNCTION__, "symbol"); - SCM_ASSERT_TYPE (ly_c_symbol_p (eltprop), eltprop, SCM_ARG3, __FUNCTION__, "symbol"); + SCM_ASSERT_TYPE (scm_is_symbol (grob), grob, SCM_ARG2, __FUNCTION__, "symbol"); + SCM_ASSERT_TYPE (scm_is_symbol (eltprop), eltprop, SCM_ARG3, __FUNCTION__, "symbol"); execute_pushpop_property (tg, grob, eltprop, val); @@ -71,7 +71,7 @@ LY_DEFINE (ly_context_property, "ly:context-property", Context *t = unsmob_context (c); Context * tr= (t); SCM_ASSERT_TYPE (tr, c, SCM_ARG1, __FUNCTION__, "Translator group"); - SCM_ASSERT_TYPE (ly_c_symbol_p (name), name, SCM_ARG2, __FUNCTION__, "symbol"); + SCM_ASSERT_TYPE (scm_is_symbol (name), name, SCM_ARG2, __FUNCTION__, "symbol"); return tr->internal_get_property (name); } @@ -83,7 +83,7 @@ LY_DEFINE (ly_context_set_property, "ly:context-set-property!", { Context *tr = unsmob_context (context); SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "Context"); - SCM_ASSERT_TYPE (ly_c_symbol_p (name), name, SCM_ARG2, __FUNCTION__, "symbol"); + SCM_ASSERT_TYPE (scm_is_symbol (name), name, SCM_ARG2, __FUNCTION__, "symbol"); tr->internal_set_property (name, val); @@ -97,7 +97,7 @@ LY_DEFINE (ly_context_property_where_defined, "ly:context-property-where-defined { Context *tr = unsmob_context (context); SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "Context"); - SCM_ASSERT_TYPE (ly_c_symbol_p (name), name, SCM_ARG2, __FUNCTION__, "symbol"); + SCM_ASSERT_TYPE (scm_is_symbol (name), name, SCM_ARG2, __FUNCTION__, "symbol"); tr = tr->where_defined (name); if (tr) @@ -112,7 +112,7 @@ LY_DEFINE (ly_unset_context_property, "ly:context-unset-property", 2, 0, 0, { Context *tr = unsmob_context (context); SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "Context"); - SCM_ASSERT_TYPE (ly_c_symbol_p (name), name, SCM_ARG2, __FUNCTION__, "symbol"); + SCM_ASSERT_TYPE (scm_is_symbol (name), name, SCM_ARG2, __FUNCTION__, "symbol"); tr->unset_property (name); return SCM_UNSPECIFIED; @@ -140,7 +140,7 @@ LY_DEFINE (ly_context_find, "ly:context-find", { Context *tr = unsmob_context (context); SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "context"); - SCM_ASSERT_TYPE (ly_c_symbol_p (name), name, SCM_ARG2, __FUNCTION__, "symbol"); + SCM_ASSERT_TYPE (scm_is_symbol (name), name, SCM_ARG2, __FUNCTION__, "symbol"); while (tr) { diff --git a/lily/context.cc b/lily/context.cc index 3a4a875ec1..14abd62adf 100644 --- a/lily/context.cc +++ b/lily/context.cc @@ -184,7 +184,7 @@ Context::default_child_context_name () const bool Context::is_bottom_context () const { - return !ly_c_symbol_p (default_child_context_name ()); + return !scm_is_symbol (default_child_context_name ()); } Context* diff --git a/lily/custos-engraver.cc b/lily/custos-engraver.cc index 080121da8b..928fde107e 100644 --- a/lily/custos-engraver.cc +++ b/lily/custos-engraver.cc @@ -104,7 +104,7 @@ Custos_engraver::process_acknowledged_grobs () int p = pitches_[i].steps (); SCM c0 = get_property ("middleCPosition"); - if (ly_c_number_p (c0)) + if (scm_is_number (c0)) p += scm_to_int (c0); diff --git a/lily/custos.cc b/lily/custos.cc index 0fb9f115a2..9a41fb20c6 100644 --- a/lily/custos.cc +++ b/lily/custos.cc @@ -34,7 +34,7 @@ Custos::print (SCM smob) SCM scm_style = me->get_property ("style"); String style; - if (ly_c_symbol_p (scm_style)) + if (scm_is_symbol (scm_style)) { style = ly_symbol2string (scm_style); } diff --git a/lily/dots.cc b/lily/dots.cc index 6814800a37..ba33b5ff53 100644 --- a/lily/dots.cc +++ b/lily/dots.cc @@ -24,7 +24,7 @@ Dots::print (SCM d) SCM c = sc->get_property ("dot-count"); - if (ly_c_number_p (c)) + if (scm_is_number (c)) { Stencil d = Font_interface::get_default_font (sc)->find_by_name (String ("dots-dot")); Real dw = d.extent (X_AXIS).length (); diff --git a/lily/drum-note-engraver.cc b/lily/drum-note-engraver.cc index 884f6c4de6..d084944ef0 100644 --- a/lily/drum-note-engraver.cc +++ b/lily/drum-note-engraver.cc @@ -98,7 +98,7 @@ Drum_notes_engraver::process_music () if (scm_integer_p (pos) == SCM_BOOL_T) note->set_property ("staff-position", pos); - if (ly_c_symbol_p (style)) + if (scm_is_symbol (style)) note->set_property ("style", style); if (scm_is_string (script)) diff --git a/lily/drum-note-performer.cc b/lily/drum-note-performer.cc index 03ff0bf48d..e20d1da05d 100644 --- a/lily/drum-note-performer.cc +++ b/lily/drum-note-performer.cc @@ -39,7 +39,7 @@ Drum_note_performer::create_audio_elements () SCM sym = n->get_property ("drum-type"); SCM defn = SCM_EOL; - if (ly_c_symbol_p (sym) + if (scm_is_symbol (sym) && (scm_hash_table_p (tab) == SCM_BOOL_T)) defn = scm_hashq_ref (tab, sym, SCM_EOL); diff --git a/lily/duration.cc b/lily/duration.cc index ff0181140b..fc52de4481 100644 --- a/lily/duration.cc +++ b/lily/duration.cc @@ -172,7 +172,7 @@ LY_DEFINE (ly_make_duration, "ly:make-duration", bool compress = false; if (num != SCM_UNDEFINED) { - SCM_ASSERT_TYPE (ly_c_number_p (num), length, SCM_ARG3, __FUNCTION__, "integer"); + SCM_ASSERT_TYPE (scm_is_number (num), length, SCM_ARG3, __FUNCTION__, "integer"); compress = true; } else @@ -180,7 +180,7 @@ LY_DEFINE (ly_make_duration, "ly:make-duration", if (den != SCM_UNDEFINED) { - SCM_ASSERT_TYPE (ly_c_number_p (den), length, SCM_ARG4, __FUNCTION__, "integer"); + SCM_ASSERT_TYPE (scm_is_number (den), length, SCM_ARG4, __FUNCTION__, "integer"); compress = true; } else @@ -213,7 +213,7 @@ LY_DEFINE (ly_intlog2, "ly:intlog2", 1, 0, 0, (SCM d), "The 2-logarithm of 1/@var{d}.") { - SCM_ASSERT_TYPE (ly_c_number_p (d), d, SCM_ARG1, __FUNCTION__, "integer"); + SCM_ASSERT_TYPE (scm_is_number (d), d, SCM_ARG1, __FUNCTION__, "integer"); int log = intlog2 (scm_to_int (d)); return scm_int2num (log); } diff --git a/lily/dynamic-engraver.cc b/lily/dynamic-engraver.cc index 00439ca00e..7e0557a1e8 100644 --- a/lily/dynamic-engraver.cc +++ b/lily/dynamic-engraver.cc @@ -223,7 +223,7 @@ Dynamic_engraver::process_music () start_type = "crescendo"; SCM s = get_property ((start_type + "Spanner").to_str0 ()); - if (!ly_c_symbol_p (s) || s == ly_symbol2scm ("hairpin")) + if (!scm_is_symbol (s) || s == ly_symbol2scm ("hairpin")) { cresc_ = make_spanner ("Hairpin", accepted_spanreqs_drul_[START]->self_scm ()); cresc_->set_property ("grow-direction", @@ -396,7 +396,7 @@ Dynamic_engraver::acknowledge_grob (Grob_info info) DynamicText doesn't really have a script-priority field. */ - if (ly_c_number_p (p) + if (scm_is_number (p) && scm_to_int (p) < scm_to_int (script_->get_property ("script-priority"))) Side_position_interface::add_support (line_spanner_, info.grob_); diff --git a/lily/dynamic-performer.cc b/lily/dynamic-performer.cc index 7f6008cb79..cc6936a475 100644 --- a/lily/dynamic-performer.cc +++ b/lily/dynamic-performer.cc @@ -59,12 +59,12 @@ Dynamic_performer::create_audio_elements () */ SCM min = get_property ("midiMinimumVolume"); SCM max = get_property ("midiMaximumVolume"); - if (ly_c_number_p (min) || ly_c_number_p (max)) + if (scm_is_number (min) || scm_is_number (max)) { Interval iv (0, 1); - if (ly_c_number_p (min)) + if (scm_is_number (min)) iv[MIN] = scm_to_double (min); - if (ly_c_number_p (max)) + if (scm_is_number (max)) iv[MAX] = scm_to_double (max); volume = iv[MIN] + iv.length () * volume; } diff --git a/lily/event.cc b/lily/event.cc index 0c60b35f0f..69125b035d 100644 --- a/lily/event.cc +++ b/lily/event.cc @@ -63,7 +63,7 @@ Event::to_relative_octave (Pitch last) new_pit = new_pit.to_relative_octave (last); SCM check = get_property ("absolute-octave"); - if (ly_c_number_p (check) && + if (scm_is_number (check) && new_pit.get_octave () != scm_to_int (check)) { Pitch expected_pit (scm_to_int (check), @@ -160,7 +160,7 @@ LY_DEFINE (ly_transpose_key_alist, "ly:transpose-key-alist", newlist = scm_cons (scm_cons (key, scm_int2num (orig.get_alteration ())), newlist); } - else if (ly_c_number_p (key)) + else if (scm_is_number (key)) { Pitch orig (0, scm_to_int (key), scm_to_int (alter)); orig = orig.transposed (*p); diff --git a/lily/fingering-engraver.cc b/lily/fingering-engraver.cc index 0f5628e0f4..48776e2f64 100644 --- a/lily/fingering-engraver.cc +++ b/lily/fingering-engraver.cc @@ -105,7 +105,7 @@ Fingering_engraver::make_script (Direction d, Music *r, int i) // Hmm int priority = 200; SCM s = fingering->get_property ("script-priority"); - if (ly_c_number_p (s)) + if (scm_is_number (s)) priority = scm_to_int (s); /* See script-engraver.cc */ diff --git a/lily/font-metric.cc b/lily/font-metric.cc index cb90680601..3b7563af17 100644 --- a/lily/font-metric.cc +++ b/lily/font-metric.cc @@ -155,7 +155,7 @@ LY_DEFINE (ly_get_glyph, "ly:get-glyph", { Font_metric *fm = unsmob_metrics (font); SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "font-metric"); - SCM_ASSERT_TYPE (ly_c_number_p (index), index, SCM_ARG2, __FUNCTION__, "number"); + SCM_ASSERT_TYPE (scm_is_number (index), index, SCM_ARG2, __FUNCTION__, "number"); return fm->get_ascii_char_stencil (scm_to_int (index)).smobbed_copy (); } diff --git a/lily/font-size-engraver.cc b/lily/font-size-engraver.cc index edb728a5c5..3efa0fee37 100644 --- a/lily/font-size-engraver.cc +++ b/lily/font-size-engraver.cc @@ -36,7 +36,7 @@ Font_size_engraver::acknowledge_grob (Grob_info gi) if (gi.origin_trans_->context () != context ()) return ; - if (ly_c_number_p (sz) && scm_to_double (sz)) + if (scm_is_number (sz) && scm_to_double (sz)) { Real font_size = scm_to_double (sz); diff --git a/lily/gourlay-breaking.cc b/lily/gourlay-breaking.cc index 14b65f7fc9..cd971e6e5e 100644 --- a/lily/gourlay-breaking.cc +++ b/lily/gourlay-breaking.cc @@ -237,7 +237,7 @@ Gourlay_breaking::combine_demerits (Column_x_positions const &prev, if (pc->original_) { SCM pen = pc->get_property ("penalty"); - if (ly_c_number_p (pen) && fabs (scm_to_double (pen)) < 10000) + if (scm_is_number (pen) && fabs (scm_to_double (pen)) < 10000) { break_penalties += scm_to_double (pen); } diff --git a/lily/grob-interface.cc b/lily/grob-interface.cc index aaa22f5fb5..2da145220e 100644 --- a/lily/grob-interface.cc +++ b/lily/grob-interface.cc @@ -29,7 +29,7 @@ void add_interface (const char * symbol, LY_DEFINE (ly_add_interface, "ly:add-interface", 3,0,0, (SCM a, SCM b, SCM c), "Add an interface description.") { - SCM_ASSERT_TYPE (ly_c_symbol_p (a), a, SCM_ARG1, __FUNCTION__, "symbol"); + SCM_ASSERT_TYPE (scm_is_symbol (a), a, SCM_ARG1, __FUNCTION__, "symbol"); SCM_ASSERT_TYPE (scm_is_string (b), b, SCM_ARG2, __FUNCTION__, "string"); SCM_ASSERT_TYPE (ly_c_list_p (c), c, SCM_ARG3, __FUNCTION__, "list of syms"); if (!ly_c_vector_p (all_ifaces)) diff --git a/lily/grob-scheme.cc b/lily/grob-scheme.cc index d1fd9c38f1..75c9c7bc1e 100644 --- a/lily/grob-scheme.cc +++ b/lily/grob-scheme.cc @@ -21,7 +21,7 @@ LY_DEFINE (ly_grob_set_property_x, "ly:grob-set-property!", { Grob *sc = unsmob_grob (grob); SCM_ASSERT_TYPE (sc, grob, SCM_ARG1, __FUNCTION__, "grob"); - SCM_ASSERT_TYPE (ly_c_symbol_p (sym), sym, SCM_ARG2, __FUNCTION__, "symbol"); + SCM_ASSERT_TYPE (scm_is_symbol (sym), sym, SCM_ARG2, __FUNCTION__, "symbol"); if (!type_check_assignment (sym, val, ly_symbol2scm ("backend-type?"))) error ("typecheck failed"); @@ -40,7 +40,7 @@ LY_DEFINE (ly_grob_property, "ly:grob-property", { Grob *sc = unsmob_grob (grob); SCM_ASSERT_TYPE (sc, grob, SCM_ARG1, __FUNCTION__, "grob"); - SCM_ASSERT_TYPE (ly_c_symbol_p (sym), sym, SCM_ARG2, __FUNCTION__, "symbol"); + SCM_ASSERT_TYPE (scm_is_symbol (sym), sym, SCM_ARG2, __FUNCTION__, "symbol"); return sc->internal_get_property (sym); } @@ -187,7 +187,7 @@ LY_DEFINE (ly_grob_translate_axis_x, "ly:grob-translate-axis!", { Grob *me = unsmob_grob (g); SCM_ASSERT_TYPE (me, g, SCM_ARG1, __FUNCTION__, "grob"); - SCM_ASSERT_TYPE (ly_c_number_p (d), d, SCM_ARG2, __FUNCTION__, "dimension"); + SCM_ASSERT_TYPE (scm_is_number (d), d, SCM_ARG2, __FUNCTION__, "dimension"); SCM_ASSERT_TYPE (is_axis (a), a, SCM_ARG3, __FUNCTION__, "axis"); me->translate_axis (scm_to_double (d), Axis (scm_to_int (a))); diff --git a/lily/grob.cc b/lily/grob.cc index d66dccb960..0406636264 100644 --- a/lily/grob.cc +++ b/lily/grob.cc @@ -485,7 +485,7 @@ Grob::name () const SCM meta = get_property ("meta"); SCM nm = scm_assoc (ly_symbol2scm ("name"), meta); nm = (ly_c_pair_p (nm)) ? ly_cdr (nm) : SCM_EOL; - return ly_c_symbol_p (nm) ? ly_symbol2string (nm) : classname (this); + return scm_is_symbol (nm) ? ly_symbol2string (nm) : classname (this); } void diff --git a/lily/include/lily-guile.hh b/lily/include/lily-guile.hh index 5c3594aa6f..c8185778f7 100644 --- a/lily/include/lily-guile.hh +++ b/lily/include/lily-guile.hh @@ -26,13 +26,22 @@ #define scm_hash_table_p scm_vector_p #define scm_i_string_chars(x) SCM_STRING_CHARS(x) #define scm_i_string_length(x) SCM_STRING_LENGTH(x) +inline bool ly_c_number_p (SCM x) { return SCM_NUMBERP (x); } #define scm_is_number(x) (scm_number_p(x)==SCM_BOOL_T) inline int ly_scm2int (SCM x) { return scm_num2int (x, 0, "ly_scm2int"); } #define scm_to_int(x) (ly_scm2int(x)) +inline bool ly_c_symbol_p (SCM x) { return SCM_SYMBOLP (x); } +#define scm_is_symbol(x) ly_c_symbol_p(x) +inline bool ly_c_boolean_p (SCM x) { return SCM_BOOLP (x); } +#define scm_is_bool(x) ly_c_boolean_p( +inline bool ly_c_eq_p (SCM x, SCM y) { return SCM_EQ_P (x, y); } +#define scm_is_eq(x,y) (SCM_EQ_P (x, y)); inline double ly_scm2double (SCM x) { return scm_num2dbl (x, "ly_scm2double"); } #define scm_to_double(x) (ly_scm2double(x)) #define scm_from_double(x) (scm_make_real(x)) + + #endif /* SCM_MINOR_VERSION < 7 */ #ifndef SMOB_FREE_RETURN_VAL @@ -152,15 +161,10 @@ inline SCM ly_assoc_front_x(SCM alist, SCM key, SCM val) return scm_acons(key, val, scm_assoc_remove_x (alist, key)); } inline bool ly_c_pair_p (SCM x) { return SCM_NFALSEP (scm_pair_p (x)); } -inline bool ly_c_symbol_p (SCM x) { return SCM_SYMBOLP (x); } -inline bool ly_c_boolean_p (SCM x) { return SCM_BOOLP (x); } inline bool ly_c_char_p (SCM x) { return SCM_CHARP (x); } -inline bool ly_c_number_p (SCM x) { return SCM_NUMBERP (x); } -inline bool ly_c_string_p (SCM x) { return scm_is_string (x); } inline bool ly_c_vector_p (SCM x) { return SCM_VECTORP (x); } inline bool ly_c_list_p (SCM x) { return SCM_NFALSEP (scm_list_p (x)); } inline bool ly_c_procedure_p (SCM x) { return SCM_NFALSEP (scm_procedure_p (x)); } -inline bool ly_c_eq_p (SCM x, SCM y) { return SCM_EQ_P (x, y); } inline bool ly_c_equal_p (SCM x, SCM y) { return SCM_NFALSEP (scm_equal_p (x, y)); } diff --git a/lily/key-engraver.cc b/lily/key-engraver.cc index 2b1142fa9b..3c9283b887 100644 --- a/lily/key-engraver.cc +++ b/lily/key-engraver.cc @@ -29,9 +29,10 @@ class Key_engraver : public Engraver { void create_key (bool); void read_ev (Music const * r); - Music * key_ev_; - Item * item_; + Music *key_ev_; + Item *item_; + Item *cancellation_; public: TRANSLATOR_DECLARATIONS (Key_engraver); @@ -56,6 +57,7 @@ Key_engraver::Key_engraver () { key_ev_ = 0; item_ = 0; + cancellation_ = 0; } @@ -68,10 +70,19 @@ Key_engraver::create_key (bool def) item_->set_property ("c0-position", get_property ("middleCPosition")); + + SCM last = get_property ("lastKeySignature"); + SCM key = get_property ("keySignature"); + if (to_boolean (get_property ("printKeyCancellation")) + && !scm_is_eq (last, key)) + { + cancellation_ = make_item ("KeyCancellation", key_ev_ ? key_ev_->self_scm () : SCM_EOL); + cancellation_->set_property ("old-accidentals",last); + cancellation_->set_property ("c0-position", + get_property ("middleCPosition")); - if (to_boolean (get_property ("printKeyCancellation"))) - item_->set_property ("old-accidentals", get_property ("lastKeySignature")); - item_->set_property ("new-accidentals", get_property ("keySignature")); + } + item_->set_property ("new-accidentals", key); } if (!def) @@ -133,6 +144,7 @@ Key_engraver::stop_translation_timestep () { item_ = 0; context ()->set_property ("lastKeySignature", get_property ("keySignature")); + cancellation_ = 0; } diff --git a/lily/key-signature-interface.cc b/lily/key-signature-interface.cc index f69348d9a5..4bf6651dde 100644 --- a/lily/key-signature-interface.cc +++ b/lily/key-signature-interface.cc @@ -102,7 +102,7 @@ Key_signature_interface::print (SCM smob) SCM scm_style = me->get_property ("style"); String style; - if (ly_c_symbol_p (scm_style)) + if (scm_is_symbol (scm_style)) { style = ly_symbol2string (scm_style); } @@ -116,7 +116,7 @@ Key_signature_interface::print (SCM smob) SCM c0s = me->get_property ("c0-position"); int c0p = 0; - if (ly_c_number_p (c0s)) + if (scm_is_number (c0s)) c0p = scm_to_int (c0s); /* @@ -150,21 +150,13 @@ Key_signature_interface::print (SCM smob) { SCM old = me->get_property ("old-accidentals"); - /* - Add half a space between cancellation and key sig. - - As suggested by [Ross], p.148. - */ - Interval x (0, inter); - Interval y (0,0); - - mol.add_at_edge (X_AXIS, LEFT, Lookup::blank (Box (x,y)), 0, 0); - Stencil natural; if (ly_c_pair_p (old)) natural=Font_interface::get_default_font (me)-> find_by_name (String ("accidentals-") + style + String ("0")); + + int last_pos = -100; for (; ly_c_pair_p (old); old = ly_cdr (old)) { SCM found = scm_assoc (ly_caar (old), newas); @@ -183,8 +175,13 @@ Key_signature_interface::print (SCM smob) has vertical edges on both sides. A little padding is needed to prevent collisions. */ - Real padding = 0.1 ; + Real padding = 0.0; + if (last_pos < pos + 2 + && last_pos> pos - 6) + padding = 0.3; + mol.add_at_edge (X_AXIS, LEFT, m, padding, 0); + last_pos = pos; } } } diff --git a/lily/lexer.ll b/lily/lexer.ll index 43b10a51de..d79c0c9a69 100644 --- a/lily/lexer.ll +++ b/lily/lexer.ll @@ -499,7 +499,7 @@ HYPHEN -- String str (YYText () + 1); SCM s = lookup_markup_command (str); - if (ly_c_pair_p (s) && ly_c_symbol_p (ly_cdr (s)) ) { + if (ly_c_pair_p (s) && scm_is_symbol (ly_cdr (s)) ) { yylval.scm = ly_car(s); SCM tag = ly_cdr(s); if (tag == ly_symbol2scm("markup0")) @@ -734,7 +734,7 @@ Lily_lexer::scan_bare_word (String str) yylval.scm = ly_cdr (handle); if (unsmob_pitch (yylval.scm)) return (YYSTATE == notes) ? NOTENAME_PITCH : TONICNAME_PITCH; - else if (ly_c_symbol_p (yylval.scm)) + else if (scm_is_symbol (yylval.scm)) return DRUM_PITCH; } else if ((handle = scm_hashq_get_handle (chordmodifier_tab_, sym))!= SCM_BOOL_F) diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index 67ab65e028..2bc7c4e2e1 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -201,7 +201,7 @@ LY_DEFINE (ly_dir_p, "ly:dir?", "@code{1}, where @code{-1} represents " "left or down and @code{1} represents right or up.") { - if (ly_c_number_p (s)) + if (scm_is_number (s)) { int i = scm_to_int (s); return (i>= -1 && i <= 1) ? SCM_BOOL_T : SCM_BOOL_F; @@ -213,7 +213,7 @@ bool is_number_pair (SCM p) { return ly_c_pair_p (p) - && ly_c_number_p (ly_car (p)) && ly_c_number_p (ly_cdr (p)); + && scm_is_number (ly_car (p)) && scm_is_number (ly_cdr (p)); } typedef void (*Void_fptr) (); @@ -257,7 +257,7 @@ ly_scm_hash (SCM s) bool is_direction (SCM s) { - if (ly_c_number_p (s)) + if (scm_is_number (s)) { int i = scm_to_int (s); return i>= -1 && i <= 1; @@ -268,7 +268,7 @@ is_direction (SCM s) bool is_axis (SCM s) { - if (ly_c_number_p (s)) + if (scm_is_number (s)) { int i = scm_to_int (s); return i== 0 || i == 1; @@ -304,7 +304,7 @@ ly_interval2scm (Drul_array i) bool to_boolean (SCM s) { - return ly_c_boolean_p (s) && ly_scm2bool (s); + return scm_is_bool (s) && ly_scm2bool (s); } /* Appendable list L: the cdr contains the list, the car the last cons @@ -344,7 +344,7 @@ LY_DEFINE (ly_number2string, "ly:number->string", 1, 0, 0, (SCM s), "Convert @var{num} to a string without generating many decimals.") { - SCM_ASSERT_TYPE (ly_c_number_p (s), s, SCM_ARG1, __FUNCTION__, "number"); + SCM_ASSERT_TYPE (scm_is_number (s), s, SCM_ARG1, __FUNCTION__, "number"); char str[400]; // ugh. @@ -537,7 +537,7 @@ type_check_assignment (SCM sym, SCM val, SCM type_symbol) if (val == SCM_EOL || val == SCM_BOOL_F) return ok; - if (!ly_c_symbol_p (sym)) + if (!scm_is_symbol (sym)) #if 0 return false; #else @@ -709,7 +709,7 @@ int_list_to_slice (SCM l) Slice s; s.set_empty (); for (; ly_c_pair_p (l); l = ly_cdr (l)) - if (ly_c_number_p (ly_car (l))) + if (scm_is_number (ly_car (l))) s.add_point (scm_to_int (ly_car (l))); return s; } @@ -729,7 +729,7 @@ robust_list_ref (int i, SCM l) Real robust_scm2double (SCM k, double x) { - if (ly_c_number_p (k)) + if (scm_is_number (k)) x = scm_to_double (k); return x; } diff --git a/lily/lily-lexer.cc b/lily/lily-lexer.cc index 3bb157d5fd..07831cd264 100644 --- a/lily/lily-lexer.cc +++ b/lily/lily-lexer.cc @@ -212,7 +212,7 @@ Lily_lexer::set_identifier (SCM name, SCM s) if (scm_is_string (name)) sym = scm_string_to_symbol (name); - if (ly_c_symbol_p (sym)) + if (scm_is_symbol (sym)) { if (lookup_keyword (ly_symbol2string (sym)) >= 0) { diff --git a/lily/lily-parser.cc b/lily/lily-parser.cc index 3183421f39..9d46014696 100644 --- a/lily/lily-parser.cc +++ b/lily/lily-parser.cc @@ -356,7 +356,7 @@ LY_DEFINE (ly_parser_define, "ly:parser-define", "Bind SYMBOL to VAL in PARSER_SMOB's module.") { Lily_parser *parser = unsmob_my_lily_parser (parser_smob); - SCM_ASSERT_TYPE (ly_c_symbol_p (symbol), symbol, SCM_ARG2, __FUNCTION__, "symbol"); + SCM_ASSERT_TYPE (scm_is_symbol (symbol), symbol, SCM_ARG2, __FUNCTION__, "symbol"); SCM_ASSERT_TYPE (parser, parser_smob, SCM_ARG2, __FUNCTION__, "parser"); parser->lexer_->set_identifier (scm_symbol_to_string (symbol), val); @@ -370,7 +370,7 @@ LY_DEFINE (ly_parser_lookup, "ly:parser-lookup", { Lily_parser *parser = unsmob_my_lily_parser (parser_smob); - SCM_ASSERT_TYPE (ly_c_symbol_p (symbol), symbol, SCM_ARG2, __FUNCTION__, "symbol"); + SCM_ASSERT_TYPE (scm_is_symbol (symbol), symbol, SCM_ARG2, __FUNCTION__, "symbol"); SCM_ASSERT_TYPE (parser, parser_smob, SCM_ARG2, __FUNCTION__, "parser"); SCM val= parser->lexer_->lookup_identifier (ly_scm2string (scm_symbol_to_string (symbol))); diff --git a/lily/line-interface.cc b/lily/line-interface.cc index 33c0f38209..d57b5cac0c 100644 --- a/lily/line-interface.cc +++ b/lily/line-interface.cc @@ -73,7 +73,7 @@ Line_interface::line (Grob *me, Offset from, Offset to) SCM type = me->get_property ("style"); SCM dash_fraction = me->get_property ("dash-fraction"); - if (ly_c_number_p (dash_fraction) || type == ly_symbol2scm ("dotted-line")) + if (scm_is_number (dash_fraction) || type == ly_symbol2scm ("dotted-line")) { Real fraction diff --git a/lily/line-spanner.cc b/lily/line-spanner.cc index 80d47beb5f..36e35ef6eb 100644 --- a/lily/line-spanner.cc +++ b/lily/line-spanner.cc @@ -98,7 +98,7 @@ Line_spanner::line_stencil (Grob *me, { Offset dz = to -from ; SCM type = me->get_property ("style"); - if (ly_c_symbol_p (type) + if (scm_is_symbol (type) && (type == ly_symbol2scm ("line") || type == ly_symbol2scm ("dashed-line") || type == ly_symbol2scm ("dotted-line") @@ -109,7 +109,7 @@ Line_spanner::line_stencil (Grob *me, ? zigzag_stencil (me, from, to) : Line_interface::line (me, from, to); } - else if (ly_c_symbol_p (type) + else if (scm_is_symbol (type) && type == ly_symbol2scm ("trill")) { SCM alist_chain = Font_interface::text_font_alist_chain (me); diff --git a/lily/lookup.cc b/lily/lookup.cc index 8d5c22acff..242260d676 100644 --- a/lily/lookup.cc +++ b/lily/lookup.cc @@ -708,8 +708,8 @@ LY_DEFINE (ly_bracket ,"ly:bracket", { SCM_ASSERT_TYPE (is_axis (a), a, SCM_ARG1, __FUNCTION__, "axis") ; SCM_ASSERT_TYPE (is_number_pair (iv), iv, SCM_ARG2, __FUNCTION__, "number pair") ; - SCM_ASSERT_TYPE (ly_c_number_p (t), a, SCM_ARG3, __FUNCTION__, "number") ; - SCM_ASSERT_TYPE (ly_c_number_p (p), a, SCM_ARG4, __FUNCTION__, "number") ; + SCM_ASSERT_TYPE (scm_is_number (t), a, SCM_ARG3, __FUNCTION__, "number") ; + SCM_ASSERT_TYPE (scm_is_number (p), a, SCM_ARG4, __FUNCTION__, "number") ; return Lookup::bracket ((Axis)scm_to_int (a), ly_scm2interval (iv), @@ -730,7 +730,7 @@ LY_DEFINE (ly_filled_box ,"ly:round-filled-box", { SCM_ASSERT_TYPE (is_number_pair (xext), xext, SCM_ARG1, __FUNCTION__, "number pair") ; SCM_ASSERT_TYPE (is_number_pair (yext), yext, SCM_ARG2, __FUNCTION__, "number pair") ; - SCM_ASSERT_TYPE (ly_c_number_p (blot), blot, SCM_ARG3, __FUNCTION__, "number") ; + SCM_ASSERT_TYPE (scm_is_number (blot), blot, SCM_ARG3, __FUNCTION__, "number") ; return Lookup::round_filled_box (Box (ly_scm2interval (xext), ly_scm2interval (yext)), scm_to_double (blot)).smobbed_copy (); diff --git a/lily/mark-engraver.cc b/lily/mark-engraver.cc index 7adf61f5ea..b43212a08d 100644 --- a/lily/mark-engraver.cc +++ b/lily/mark-engraver.cc @@ -113,7 +113,7 @@ Mark_engraver::process_music () if (!Text_item::markup_p (m) && ly_c_procedure_p (proc)) { - if (!ly_c_number_p (m)) + if (!scm_is_number (m)) m = get_property ("rehearsalMark"); if (scm_integer_p (m) == SCM_BOOL_T @@ -125,7 +125,7 @@ Mark_engraver::process_music () scm_int2num (mark_count)); } - if (ly_c_number_p (m)) + if (scm_is_number (m)) m = scm_call_2 (proc, m, context ()->self_scm ()); else warning ("rehearsalMark does not have integer value."); diff --git a/lily/modified-font-metric.cc b/lily/modified-font-metric.cc index a28c1bd372..b3e56980a7 100644 --- a/lily/modified-font-metric.cc +++ b/lily/modified-font-metric.cc @@ -110,7 +110,7 @@ Modified_font_metric::make_scaled_font_metric (SCM coding, /* UGH. */ - if (ly_c_symbol_p (coding)) + if (scm_is_symbol (coding)) coding = scm_symbol_to_string (coding); String scheme = scm_is_string (coding) ? ly_scm2string (coding) : ""; @@ -277,7 +277,7 @@ Modified_font_metric::text_dimension (String text) Box char_box; - if (!ly_c_symbol_p (sym)) + if (!scm_is_symbol (sym)) continue; char const * chars = scm_i_string_chars (scm_symbol_to_string(sym)); diff --git a/lily/multi-measure-rest-engraver.cc b/lily/multi-measure-rest-engraver.cc index 7a3d1b06ae..d19f922997 100644 --- a/lily/multi-measure-rest-engraver.cc +++ b/lily/multi-measure-rest-engraver.cc @@ -233,7 +233,7 @@ Multi_measure_rest_engraver::start_translation_timestep () { SCM thres = get_property ("restNumberThreshold"); int t = 1; - if (ly_c_number_p (thres)) + if (scm_is_number (thres)) t = scm_to_int (thres); if (num <= t) diff --git a/lily/multi-measure-rest.cc b/lily/multi-measure-rest.cc index 3de81b361e..61974f9deb 100644 --- a/lily/multi-measure-rest.cc +++ b/lily/multi-measure-rest.cc @@ -102,7 +102,7 @@ Multi_measure_rest::print (SCM smob) int measures = 0; SCM m (me->get_property ("measure-count")); - if (ly_c_number_p (m)) + if (scm_is_number (m)) { measures = scm_to_int (m); } @@ -118,7 +118,7 @@ Multi_measure_rest::symbol_stencil (Grob *me, Real space) { int measures = 0; SCM m (me->get_property ("measure-count")); - if (ly_c_number_p (m)) + if (scm_is_number (m)) { measures = scm_to_int (m); } diff --git a/lily/music.cc b/lily/music.cc index ea81bb0df6..7ed8aacc90 100644 --- a/lily/music.cc +++ b/lily/music.cc @@ -28,7 +28,7 @@ String Music::name () const { SCM nm = get_property ("name"); - if (ly_c_symbol_p (nm)) + if (scm_is_symbol (nm)) { return ly_symbol2string (nm); } @@ -130,7 +130,7 @@ Music::print_smob (SCM s, SCM p, scm_print_state*) Music* m = unsmob_music (s); SCM nm = m->get_property ("name"); - if (ly_c_symbol_p (nm) || scm_is_string (nm)) + if (scm_is_symbol (nm) || scm_is_string (nm)) scm_display (nm, p); else scm_puts (classname (m),p); @@ -250,7 +250,7 @@ LY_DEFINE (ly_music_property, { Music * sc = unsmob_music (mus); SCM_ASSERT_TYPE (sc, mus, SCM_ARG1, __FUNCTION__, "music"); - SCM_ASSERT_TYPE (ly_c_symbol_p (sym), sym, SCM_ARG2, __FUNCTION__, "symbol"); + SCM_ASSERT_TYPE (scm_is_symbol (sym), sym, SCM_ARG2, __FUNCTION__, "symbol"); return sc->internal_get_property (sym); } @@ -261,7 +261,7 @@ LY_DEFINE (ly_music_set_property, "ly:music-set-property!", { Music * sc = unsmob_music (mus); SCM_ASSERT_TYPE (sc, mus, SCM_ARG1, __FUNCTION__, "music"); - SCM_ASSERT_TYPE (ly_c_symbol_p (sym), sym, SCM_ARG2, __FUNCTION__, "symbol"); + SCM_ASSERT_TYPE (scm_is_symbol (sym), sym, SCM_ARG2, __FUNCTION__, "symbol"); bool ok = type_check_assignment (sym, val, ly_symbol2scm ("music-type?")); if (ok) diff --git a/lily/note-collision.cc b/lily/note-collision.cc index ae6f74cd9c..c633aafdd2 100644 --- a/lily/note-collision.cc +++ b/lily/note-collision.cc @@ -400,7 +400,7 @@ Note_collision_interface::automatic_shift (Grob *me, SCM sh = clashes[i]->get_property ("horizontal-shift"); - if (ly_c_number_p (sh)) + if (scm_is_number (sh)) shift.push (scm_to_int (sh)); else shift.push (0); @@ -486,7 +486,7 @@ Note_collision_interface::forced_shift (Grob *me) Grob * se = unsmob_grob (ly_car (s)); SCM force = se->get_property ("force-hshift"); - if (ly_c_number_p (force)) + if (scm_is_number (force)) { tups = scm_cons (scm_cons (se->self_scm (), force), tups); diff --git a/lily/note-column.cc b/lily/note-column.cc index a6b95da47c..230bf38000 100644 --- a/lily/note-column.cc +++ b/lily/note-column.cc @@ -35,8 +35,8 @@ Note_column::shift_compare (Grob *const &p1, Grob *const&p2) SCM s1 = p1->get_property ("horizontal-shift"); SCM s2 = p2->get_property ("horizontal-shift"); - int h1 = (ly_c_number_p (s1))? scm_to_int (s1) :0; - int h2 = (ly_c_number_p (s2)) ? scm_to_int (s2):0; + int h1 = (scm_is_number (s1))? scm_to_int (s1) :0; + int h2 = (scm_is_number (s2)) ? scm_to_int (s2):0; return h1 - h2; } @@ -126,7 +126,7 @@ void Note_column::translate_rests (Grob*me, int dy) { Grob * r = unsmob_grob (me->get_property ("rest")); - if (r && !ly_c_number_p (r->get_property ("staff-position"))) + if (r && !scm_is_number (r->get_property ("staff-position"))) { r->translate_axis (dy * Staff_symbol_referencer::staff_space (r)/2.0, Y_AXIS); } diff --git a/lily/note-head.cc b/lily/note-head.cc index ad57f9f1d8..74ee76e732 100644 --- a/lily/note-head.cc +++ b/lily/note-head.cc @@ -28,7 +28,7 @@ static Stencil internal_print (Grob *me) { SCM style = me->get_property ("style"); - if (!ly_c_symbol_p (style)) + if (!scm_is_symbol (style)) { return Stencil (); } @@ -147,7 +147,7 @@ Note_head::stem_attachment_coordinate (Grob *me, Axis a) if (brewer == Note_head::print_proc) { SCM style = me->get_property ("style"); - if (!ly_c_symbol_p (style)) + if (!scm_is_symbol (style)) { return 0.0; } @@ -189,7 +189,7 @@ int Note_head::get_balltype (Grob*me) { SCM s = me->get_property ("duration-log"); - return ly_c_number_p (s) ? scm_to_int (s) steps () : 0; SCM c0 = get_property ("middleCPosition"); - if (ly_c_number_p (c0)) + if (scm_is_number (c0)) pos += scm_to_int (c0); note->set_property ("staff-position", scm_int2num (pos)); diff --git a/lily/output-def.cc b/lily/output-def.cc index 2bf1ea1d2b..4a1e496363 100644 --- a/lily/output-def.cc +++ b/lily/output-def.cc @@ -138,7 +138,7 @@ LY_DEFINE (ly_paper_lookup, "ly:output-def-lookup", { Output_def *op = unsmob_output_def (pap); SCM_ASSERT_TYPE (op, pap, SCM_ARG1, __FUNCTION__, "Output_def"); - SCM_ASSERT_TYPE (ly_c_symbol_p (sym), sym, SCM_ARG2, __FUNCTION__, "symbol"); + SCM_ASSERT_TYPE (scm_is_symbol (sym), sym, SCM_ARG2, __FUNCTION__, "symbol"); return op->lookup_variable (sym); } diff --git a/lily/parser.yy b/lily/parser.yy index 7d2db41605..2dedb25e29 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -71,7 +71,7 @@ void tag_music (Music *m, SCM tag, Input ip) { SCM tags = m->get_property ("tags"); - if (ly_c_symbol_p (tag)) + if (scm_is_symbol (tag)) tags = scm_cons (tag, tags); else if (ly_c_list_p (tag)) tags = ly_append2 (tag, tags); @@ -104,7 +104,7 @@ SCM make_simple_markup (SCM encoding, SCM a) { SCM simple = ly_scheme_function ("simple-markup"); - if (ly_c_symbol_p (encoding)) + if (scm_is_symbol (encoding)) return scm_list_3 (ly_scheme_function ("encoded-simple-markup"), encoding, a); return scm_list_2 (simple, a); @@ -1479,7 +1479,7 @@ chord_body_element: SCM arts = scm_reverse_x (post, SCM_EOL); n->set_property ("articulations", arts); } - if (ly_c_number_p (check)) + if (scm_is_number (check)) { int q = scm_to_int (check); n->set_property ("absolute-octave", scm_int2num (q-1)); @@ -2090,7 +2090,7 @@ bass_figure: Music *m = unsmob_music ($1); if ($2) { SCM salter = m->get_property ("alteration"); - int alter = ly_c_number_p (salter) ? scm_to_int (salter) : 0; + int alter = scm_is_number (salter) ? scm_to_int (salter) : 0; m->set_property ("alteration", scm_int2num (alter + $2)); } else { @@ -2153,7 +2153,7 @@ simple_element: n->set_property ("pitch", $1); n->set_property ("duration", $5); - if (ly_c_number_p ($4)) + if (scm_is_number ($4)) { int q = scm_to_int ($4); n->set_property ("absolute-octave", scm_int2num (q-1)); @@ -2562,7 +2562,7 @@ Lily_lexer::try_special_identifiers (SCM *destination, SCM sid) if (scm_is_string (sid)) { *destination = sid; return STRING_IDENTIFIER; - } else if (ly_c_number_p (sid)) { + } else if (scm_is_number (sid)) { *destination = sid; return NUMBER_IDENTIFIER; } else if (unsmob_context_def (sid)) { @@ -2662,7 +2662,7 @@ context_spec_music (SCM type, SCM id, Music *m, SCM ops) scm_gc_unprotect_object (m->self_scm ()); csm->set_property ("context-type", - ly_c_symbol_p (type) ? type : scm_string_to_symbol (type)); + scm_is_symbol (type) ? type : scm_string_to_symbol (type)); csm->set_property ("property-operations", ops); if (scm_is_string (id)) diff --git a/lily/part-combine-iterator.cc b/lily/part-combine-iterator.cc index 0afb18d819..59475df5cd 100644 --- a/lily/part-combine-iterator.cc +++ b/lily/part-combine-iterator.cc @@ -392,10 +392,10 @@ Part_combine_iterator::process (Moment m) solo1 (); else if (tag == ly_symbol2scm ("solo2")) solo2 (); - else if (ly_c_symbol_p (tag)) + else if (scm_is_symbol (tag)) { String s = "Unknown split directive: " - + (ly_c_symbol_p (tag) ? ly_symbol2string (tag) : String ("not a symbol")); + + (scm_is_symbol (tag) ? ly_symbol2string (tag) : String ("not a symbol")); programming_error (s); } } diff --git a/lily/pitch-squash-engraver.cc b/lily/pitch-squash-engraver.cc index 3acff5c995..73211dfd98 100644 --- a/lily/pitch-squash-engraver.cc +++ b/lily/pitch-squash-engraver.cc @@ -22,7 +22,7 @@ void Pitch_squash_engraver::acknowledge_grob (Grob_info i) { SCM newpos = get_property ("squashedPosition"); - if (ly_c_number_p (newpos) + if (scm_is_number (newpos) && Note_head::has_interface (i.grob_)) { i.grob_->set_property ("staff-position", newpos); diff --git a/lily/property-iterator.cc b/lily/property-iterator.cc index 20f9dc68e8..78c2b3ec71 100644 --- a/lily/property-iterator.cc +++ b/lily/property-iterator.cc @@ -21,7 +21,7 @@ void Property_iterator::process (Moment m) { SCM sym = get_music ()->get_property ("symbol"); - if (ly_c_symbol_p (sym)) + if (scm_is_symbol (sym)) { SCM val = get_music ()->get_property ("value"); bool ok= true; diff --git a/lily/rest-engraver.cc b/lily/rest-engraver.cc index 72e5020bbe..4d9809b8f8 100644 --- a/lily/rest-engraver.cc +++ b/lily/rest-engraver.cc @@ -86,7 +86,7 @@ Rest_engraver::process_music () { int pos= p->steps (); SCM c0 = get_property ("middleCPosition"); - if (ly_c_number_p (c0)) + if (scm_is_number (c0)) pos += scm_to_int (c0); rest_->set_property ("staff-position", scm_int2num (pos)); diff --git a/lily/rest.cc b/lily/rest.cc index e1e7313dab..b41babd365 100644 --- a/lily/rest.cc +++ b/lily/rest.cc @@ -119,14 +119,14 @@ Rest::brew_internal_stencil (SCM smob, bool ledgered) Grob* me = unsmob_grob (smob); SCM balltype_scm = me->get_property ("duration-log"); - if (!ly_c_number_p (balltype_scm)) + if (!scm_is_number (balltype_scm)) return Stencil ().smobbed_copy (); int balltype = scm_to_int (balltype_scm); String style; SCM style_scm = me->get_property ("style"); - if (ly_c_symbol_p (style_scm)) + if (scm_is_symbol (style_scm)) style = ly_scm2string (scm_symbol_to_string (style_scm)); Font_metric *fm = Font_interface::get_default_font (me); @@ -169,7 +169,7 @@ SCM Rest::polyphonic_offset_callback (SCM smob, SCM) { Grob* me = unsmob_grob (smob); - if (ly_c_number_p (me->get_property ("staff-position"))) + if (scm_is_number (me->get_property ("staff-position"))) return scm_make_real (0); Direction d = get_grob_direction (me); diff --git a/lily/rhythmic-head.cc b/lily/rhythmic-head.cc index 9fbe521e3b..40983ead13 100644 --- a/lily/rhythmic-head.cc +++ b/lily/rhythmic-head.cc @@ -45,7 +45,7 @@ int Rhythmic_head::duration_log (Grob*me) { SCM s = me->get_property ("duration-log"); - return ly_c_number_p (s) ? scm_to_int (s) : 0; + return scm_is_number (s) ? scm_to_int (s) : 0; } ADD_INTERFACE (Rhythmic_head,"rhythmic-head-interface", diff --git a/lily/scm-hash.cc b/lily/scm-hash.cc index dd3873d3b0..a0f66d0d7d 100644 --- a/lily/scm-hash.cc +++ b/lily/scm-hash.cc @@ -101,7 +101,7 @@ Scheme_hash_table::contains (SCM k) const void Scheme_hash_table::set (SCM k, SCM v) { - assert (ly_c_symbol_p (k)); + assert (scm_is_symbol (k)); SCM handle = scm_hashq_create_handle_x (hash_tab_, k, SCM_UNDEFINED); if (ly_cdr (handle) == SCM_UNDEFINED) { diff --git a/lily/scm-option.cc b/lily/scm-option.cc index fe9653ef1b..5da31ef240 100644 --- a/lily/scm-option.cc +++ b/lily/scm-option.cc @@ -126,7 +126,7 @@ LY_DEFINE (ly_set_option, "ly:set-option", 1, 1, 0, (SCM var, SCM val), lily_1_8_relative = false; else { - if (ly_c_symbol_p (var)) + if (scm_is_symbol (var)) var = scm_symbol_to_string (var); warning (_f ("No such internal option: %s", ly_scm2string (var))); diff --git a/lily/score-engraver.cc b/lily/score-engraver.cc index 2227ee00ac..a1b1a75576 100644 --- a/lily/score-engraver.cc +++ b/lily/score-engraver.cc @@ -245,10 +245,10 @@ Score_engraver::try_music (Music *m) if (m->is_mus_type ("break-event")) { SCM pen = command_column_->get_property ("penalty"); - Real total_penalty = ly_c_number_p (pen) ? scm_to_double (pen) : 0.0; + Real total_penalty = scm_is_number (pen) ? scm_to_double (pen) : 0.0; SCM mpen = m->get_property ("penalty"); - if (ly_c_number_p (mpen)) + if (scm_is_number (mpen)) total_penalty += scm_to_double (mpen); command_column_->set_property ("penalty", scm_make_real (total_penalty)); @@ -258,9 +258,9 @@ Score_engraver::try_music (Music *m) forbid_breaks (); SCM page_pen = command_column_->get_property ("page-penalty"); - Real total_pp = ly_c_number_p (page_pen) ? scm_to_double (page_pen) : 0.0; + Real total_pp = scm_is_number (page_pen) ? scm_to_double (page_pen) : 0.0; SCM mpage_pen = m->get_property ("page-penalty"); - if (ly_c_number_p (mpage_pen)) + if (scm_is_number (mpage_pen)) total_pp += scm_to_double (mpage_pen); command_column_->set_property ("page-penalty", scm_make_real (total_pp)); diff --git a/lily/script-column.cc b/lily/script-column.cc index bc30636663..697cf5ac7d 100644 --- a/lily/script-column.cc +++ b/lily/script-column.cc @@ -15,7 +15,7 @@ void Script_column::add_staff_sided (Grob *me, Item *i) { SCM p = i->get_property ("script-priority"); - if (!ly_c_number_p (p)) + if (!scm_is_number (p)) return; Pointer_group_interface::add_grob (me, ly_symbol2scm ("scripts"),i); diff --git a/lily/self-aligment-interface.cc b/lily/self-aligment-interface.cc index 17e53b9b63..e1db1ded12 100644 --- a/lily/self-aligment-interface.cc +++ b/lily/self-aligment-interface.cc @@ -35,7 +35,7 @@ Self_alignment_interface::aligned_on_parent (SCM element_smob, SCM axis) : ly_symbol2scm ("self-alignment-Y"); SCM align_prop (me->internal_get_property (sym)); - if (!ly_c_number_p (align_prop)) + if (!scm_is_number (align_prop)) return scm_int2num (0); Real x = 0.0; @@ -80,7 +80,7 @@ Self_alignment_interface::aligned_on_self (SCM element_smob, SCM axis) : ly_symbol2scm ("self-alignment-Y"); SCM align (me->internal_get_property (sym)); - if (ly_c_number_p (align)) + if (scm_is_number (align)) { Interval ext (me->extent (me, a)); if (ext.is_empty ()) diff --git a/lily/separation-item.cc b/lily/separation-item.cc index 4a308146e1..b528ae7c51 100644 --- a/lily/separation-item.cc +++ b/lily/separation-item.cc @@ -144,7 +144,7 @@ Separation_item::extremal_break_aligned_grob (Grob *separation_item, Direction d { Grob * break_item = unsmob_grob (ly_car (s)); - if (!ly_c_symbol_p (break_item->get_property ("break-align-symbol"))) + if (!scm_is_symbol (break_item->get_property ("break-align-symbol"))) continue; Interval ext = break_item->extent (col, X_AXIS); diff --git a/lily/side-position-interface.cc b/lily/side-position-interface.cc index a65d8f25fa..54ff667d6e 100644 --- a/lily/side-position-interface.cc +++ b/lily/side-position-interface.cc @@ -73,7 +73,7 @@ Side_position_interface::general_side_position (Grob * me, Axis a, bool use_exte Grob * st = Staff_symbol_referencer::get_staff_symbol (me); bool include_staff = (st && a == Y_AXIS - && ly_c_number_p (me->get_property ("staff-padding"))); + && scm_is_number (me->get_property ("staff-padding"))); Interval dim; if (include_staff) @@ -222,7 +222,7 @@ Side_position_interface::aligned_side (SCM element_smob, SCM axis) */ Grob * st = Staff_symbol_referencer::get_staff_symbol (me); if (st && a == Y_AXIS - && ly_c_number_p (me->get_property ("staff-padding"))) + && scm_is_number (me->get_property ("staff-padding"))) { Real padding= Staff_symbol_referencer::staff_space (me) diff --git a/lily/simple-spacer.cc b/lily/simple-spacer.cc index 8261f702fa..2915219c8f 100644 --- a/lily/simple-spacer.cc +++ b/lily/simple-spacer.cc @@ -412,7 +412,7 @@ Simple_spacer_wrapper::solve (Column_x_positions *positions, bool ragged) for (int i = sz; i--; ) { SCM p = positions->cols_[i]->get_property ( "penalty"); - if (ly_c_number_p (p)) + if (scm_is_number (p)) { if (scm_to_double (p) < -9999) break_satisfy = break_satisfy && (i == 0 || i == sz -1); diff --git a/lily/slur-scoring.cc b/lily/slur-scoring.cc index 0db9b834a3..0d7852950f 100644 --- a/lily/slur-scoring.cc +++ b/lily/slur-scoring.cc @@ -952,7 +952,7 @@ score_extra_encompass (Grob *me, Grob *common[], SCM accs = g->get_property ("accidentals"); SCM scm_style = g->get_property ("style"); - if (!ly_c_symbol_p (scm_style) + if (!scm_is_symbol (scm_style) && !parens && scm_ilength (accs) == 1) { diff --git a/lily/slur.cc b/lily/slur.cc index af479083e9..d8bb8401bf 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -71,7 +71,7 @@ Slur::print (SCM smob) TODO: replace dashed with generic property. */ SCM d = me->get_property ("dashed"); - if (ly_c_number_p (d)) + if (scm_is_number (d)) a = Lookup::dashed_slur (one, thick, thick * robust_scm2double (d, 0)); else a = Lookup::slur (one, get_grob_direction (me) * base_thick * ss / 10.0, diff --git a/lily/staff-symbol-referencer.cc b/lily/staff-symbol-referencer.cc index b7a42e1aae..cb53c0af52 100644 --- a/lily/staff-symbol-referencer.cc +++ b/lily/staff-symbol-referencer.cc @@ -118,7 +118,7 @@ Staff_symbol_referencer::callback (SCM element_smob, SCM) SCM pos = me->get_property ("staff-position"); Real off = 0.0; - if (ly_c_number_p (pos)) + if (scm_is_number (pos)) { Real space = Staff_symbol_referencer::staff_space (me); off = scm_to_double (pos) * space / 2.0; diff --git a/lily/staff-symbol.cc b/lily/staff-symbol.cc index 9526e36dd8..9a5db7c46b 100644 --- a/lily/staff-symbol.cc +++ b/lily/staff-symbol.cc @@ -45,7 +45,7 @@ Staff_symbol::print (SCM smob) do { SCM width_scm = me->get_property ("width"); - if (d == RIGHT && ly_c_number_p (width_scm)) + if (d == RIGHT && scm_is_number (width_scm)) { /* don't multiply by Staff_symbol_referencer::staff_space (me), @@ -97,7 +97,7 @@ int Staff_symbol::line_count (Grob*me) { SCM c = me->get_property ("line-count"); - if (ly_c_number_p (c)) + if (scm_is_number (c)) return scm_to_int (c); else return 0; diff --git a/lily/stem-engraver.cc b/lily/stem-engraver.cc index a8d7773f11..710d993f96 100644 --- a/lily/stem-engraver.cc +++ b/lily/stem-engraver.cc @@ -73,7 +73,7 @@ Stem_engraver::make_stem (Grob_info gi) SCM f = get_property ("tremoloFlags"); if (!requested_type) { - if (ly_c_number_p (f)) + if (scm_is_number (f)) requested_type = scm_to_int (f); else requested_type = 8; @@ -139,13 +139,13 @@ Stem_engraver::stop_translation_timestep () { /* FIXME: junk these properties. */ SCM prop = get_property ("stemLeftBeamCount"); - if (ly_c_number_p (prop)) + if (scm_is_number (prop)) { Stem::set_beaming (stem_,scm_to_int (prop),LEFT); context ()->unset_property (ly_symbol2scm ("stemLeftBeamCount")); } prop = get_property ("stemRightBeamCount"); - if (ly_c_number_p (prop)) + if (scm_is_number (prop)) { Stem::set_beaming (stem_,scm_to_int (prop), RIGHT); context ()->unset_property (ly_symbol2scm ("stemRightBeamCount")); diff --git a/lily/stem-tremolo.cc b/lily/stem-tremolo.cc index 508a37f8f5..b4bb45f694 100644 --- a/lily/stem-tremolo.cc +++ b/lily/stem-tremolo.cc @@ -82,7 +82,7 @@ Stem_tremolo::raw_stencil (Grob *me) int tremolo_flags = 0; SCM s = me->get_property ("flag-count"); - if (ly_c_number_p (s)) + if (scm_is_number (s)) tremolo_flags = scm_to_int (s); if (!tremolo_flags) @@ -137,7 +137,7 @@ Stem_tremolo::print (SCM grob) Real beamthickness = 0.0; SCM sbt = (beam) ? beam->get_property ("thickness") : SCM_EOL ; - if (ly_c_number_p (sbt)) + if (scm_is_number (sbt)) beamthickness = scm_to_double (sbt) * ss; Real end_y diff --git a/lily/stem.cc b/lily/stem.cc index c83c7a7b37..4f364607ca 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -91,7 +91,7 @@ Stem::stem_end_position (Grob *me) { SCM p = me->get_property ("stem-end-position"); Real pos; - if (!ly_c_number_p (p)) + if (!scm_is_number (p)) { pos = get_default_stem_end_position (me); me->set_property ("stem-end-position", scm_make_real (pos)); @@ -271,7 +271,7 @@ Stem::get_default_stem_end_position (Grob *me) /* WARNING: IN HALF SPACES */ Real length = 7; SCM scm_len = me->get_property ("length"); - if (ly_c_number_p (scm_len)) + if (scm_is_number (scm_len)) length = scm_to_double (scm_len); else { @@ -380,7 +380,7 @@ int Stem::duration_log (Grob *me) { SCM s = me->get_property ("duration-log"); - return (ly_c_number_p (s)) ? scm_to_int (s) : 2; + return (scm_is_number (s)) ? scm_to_int (s) : 2; } void @@ -532,7 +532,7 @@ Stem::flag (Grob *me) String flag_style; SCM flag_style_scm = me->get_property ("flag-style"); - if (ly_c_symbol_p (flag_style_scm)) + if (scm_is_symbol (flag_style_scm)) flag_style = ly_symbol2string (flag_style_scm); if (flag_style == "no-flag") diff --git a/lily/stencil-scheme.cc b/lily/stencil-scheme.cc index 09f317fd08..1577f52758 100644 --- a/lily/stencil-scheme.cc +++ b/lily/stencil-scheme.cc @@ -39,7 +39,7 @@ LY_DEFINE (ly_translate_stencil_axis, "ly:stencil-translate-axis", { Stencil *s = unsmob_stencil (stil); SCM_ASSERT_TYPE (s, stil, SCM_ARG1, __FUNCTION__, "stencil"); - SCM_ASSERT_TYPE (ly_c_number_p (amount), amount, SCM_ARG2, __FUNCTION__, "number pair"); + SCM_ASSERT_TYPE (scm_is_number (amount), amount, SCM_ARG2, __FUNCTION__, "number pair"); SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG3, __FUNCTION__, "axis"); SCM new_s = s->smobbed_copy (); @@ -105,13 +105,13 @@ LY_DEFINE (ly_stencil_moved_to_edge, "ly:stencil-moved-to-edge", Real p = 0.0; if (padding != SCM_UNDEFINED) { - SCM_ASSERT_TYPE (ly_c_number_p (padding), padding, SCM_ARG5, __FUNCTION__, "number"); + SCM_ASSERT_TYPE (scm_is_number (padding), padding, SCM_ARG5, __FUNCTION__, "number"); p = scm_to_double (padding); } Real m = 0.0; if (minimum != SCM_UNDEFINED) { - SCM_ASSERT_TYPE (ly_c_number_p (minimum), minimum, SCM_ARG6, __FUNCTION__, "number"); + SCM_ASSERT_TYPE (scm_is_number (minimum), minimum, SCM_ARG6, __FUNCTION__, "number"); m = scm_to_double (minimum); } @@ -155,13 +155,13 @@ LY_DEFINE (ly_stencil_combine_at_edge, "ly:stencil-combine-at-edge", Real p = 0.0; if (padding != SCM_UNDEFINED) { - SCM_ASSERT_TYPE (ly_c_number_p (padding), padding, SCM_ARG5, __FUNCTION__, "number"); + SCM_ASSERT_TYPE (scm_is_number (padding), padding, SCM_ARG5, __FUNCTION__, "number"); p = scm_to_double (padding); } Real m = 0.0; if (minimum != SCM_UNDEFINED) { - SCM_ASSERT_TYPE (ly_c_number_p (minimum), minimum, SCM_ARG6, __FUNCTION__, "number"); + SCM_ASSERT_TYPE (scm_is_number (minimum), minimum, SCM_ARG6, __FUNCTION__, "number"); m = scm_to_double (minimum); } @@ -224,7 +224,7 @@ LY_DEFINE (ly_stencil_align_to_x, "ly:stencil-align-to!", { SCM_ASSERT_TYPE (unsmob_stencil (stil), stil, SCM_ARG1, __FUNCTION__, "stencil"); SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG2, __FUNCTION__, "axis"); - SCM_ASSERT_TYPE (ly_c_number_p (dir), dir, SCM_ARG3, __FUNCTION__, "number"); + SCM_ASSERT_TYPE (scm_is_number (dir), dir, SCM_ARG3, __FUNCTION__, "number"); unsmob_stencil (stil)->align_to ((Axis)scm_to_int (axis), scm_to_double (dir)); diff --git a/lily/tab-note-heads-engraver.cc b/lily/tab-note-heads-engraver.cc index 3ca9559618..883108f8c8 100644 --- a/lily/tab-note-heads-engraver.cc +++ b/lily/tab-note-heads-engraver.cc @@ -131,7 +131,7 @@ Tab_note_heads_engraver::process_music () SCM scm_pitch = event->get_property ("pitch"); SCM proc = get_property ("tablatureFormat"); SCM min_fret_scm = get_property ("minimumFret"); - int min_fret = ly_c_number_p (min_fret_scm) ? scm_to_int (min_fret_scm) : 0; + int min_fret = scm_is_number (min_fret_scm) ? scm_to_int (min_fret_scm) : 0; while (!string_found) { diff --git a/lily/text-engraver.cc b/lily/text-engraver.cc index 05c8c0ff24..0030340172 100644 --- a/lily/text-engraver.cc +++ b/lily/text-engraver.cc @@ -93,7 +93,7 @@ Text_engraver::process_acknowledged_grobs () // Hmm int priority = 200; SCM s = text->get_property ("script-priority"); - if (ly_c_number_p (s)) + if (scm_is_number (s)) priority = scm_to_int (s); /* see script-engraver.cc */ diff --git a/lily/text-item.cc b/lily/text-item.cc index 66c1b6d83a..b3c14fd3e4 100644 --- a/lily/text-item.cc +++ b/lily/text-item.cc @@ -29,16 +29,16 @@ Text_item::interpret_string (SCM paper_smob, __FUNCTION__, "Paper definition"); SCM_ASSERT_TYPE (scm_is_string (markup), markup, SCM_ARG3, __FUNCTION__, "string"); - SCM_ASSERT_TYPE (input_encoding == SCM_EOL || ly_c_symbol_p (input_encoding), + SCM_ASSERT_TYPE (input_encoding == SCM_EOL || scm_is_symbol (input_encoding), input_encoding, SCM_ARG2, __FUNCTION__, "symbol"); String str = ly_scm2string (markup); - if (!ly_c_symbol_p (input_encoding)) + if (!scm_is_symbol (input_encoding)) { SCM enc = paper->lookup_variable (ly_symbol2scm ("inputencoding")); if (scm_is_string (enc)) input_encoding = scm_string_to_symbol (enc); - else if (ly_c_symbol_p (enc)) + else if (scm_is_symbol (enc)) input_encoding = enc; } diff --git a/lily/time-signature.cc b/lily/time-signature.cc index f4324653fe..ea1993a155 100644 --- a/lily/time-signature.cc +++ b/lily/time-signature.cc @@ -45,7 +45,7 @@ Time_signature::print (SCM smob) { m = numbered_time_signature (me, n, 0); } - else if (ly_c_symbol_p (st)) + else if (scm_is_symbol (st)) { m = special_time_signature (me, st, n, d); } diff --git a/lily/timing-translator.cc b/lily/timing-translator.cc index 965885bd25..69257cffb9 100644 --- a/lily/timing-translator.cc +++ b/lily/timing-translator.cc @@ -133,7 +133,7 @@ Timing_translator::start_translation_timestep () SCM barn = get_property ("currentBarNumber"); int b = 0; - if (ly_c_number_p (barn)) + if (scm_is_number (barn)) { b = scm_to_int (barn); } diff --git a/lily/translator-property.cc b/lily/translator-property.cc index 2c433a0086..735c22b2ab 100644 --- a/lily/translator-property.cc +++ b/lily/translator-property.cc @@ -33,7 +33,7 @@ void execute_pushpop_property (Context * trg, SCM prop, SCM eltprop, SCM val) { - if (ly_c_symbol_p (prop) && ly_c_symbol_p (eltprop)) + if (scm_is_symbol (prop) && scm_is_symbol (eltprop)) { if (val != SCM_UNDEFINED) { @@ -152,7 +152,7 @@ apply_property_operations (Context *tg, SCM pre_init_ops) SCM updated_grob_properties (Context * tg, SCM sym) { - assert (ly_c_symbol_p (sym)); + assert (scm_is_symbol (sym)); tg = tg->where_defined (sym); if (!tg) diff --git a/lily/tuplet-bracket.cc b/lily/tuplet-bracket.cc index ecf3c72598..f96551bc6f 100644 --- a/lily/tuplet-bracket.cc +++ b/lily/tuplet-bracket.cc @@ -114,7 +114,7 @@ Tuplet_bracket::print (SCM smob) SCM lp = me->get_property ("left-position"); SCM rp = me->get_property ("right-position"); - if (!ly_c_number_p (rp) || !ly_c_number_p (lp)) + if (!scm_is_number (rp) || !scm_is_number (lp)) after_line_breaking (smob); } @@ -133,7 +133,7 @@ Tuplet_bracket::print (SCM smob) Fixme: the type of this prop is sucky. */ SCM bracket = me->get_property ("bracket-visibility"); - if (ly_c_boolean_p (bracket)) + if (scm_is_bool (bracket)) { bracket_visibility = ly_scm2bool (bracket); } @@ -141,7 +141,7 @@ Tuplet_bracket::print (SCM smob) bracket_visibility = !par_beam; SCM numb = me->get_property ("number-visibility"); - if (ly_c_boolean_p (numb)) + if (scm_is_bool (numb)) { number_visibility = ly_scm2bool (numb); } @@ -487,15 +487,15 @@ Tuplet_bracket::after_line_breaking (SCM smob) SCM lp = me->get_property ("left-position"); SCM rp = me->get_property ("right-position"); - if (ly_c_number_p (lp) && !ly_c_number_p (rp)) + if (scm_is_number (lp) && !scm_is_number (rp)) { rp = scm_make_real (scm_to_double (lp) + dy); } - else if (ly_c_number_p (rp) && !ly_c_number_p (lp)) + else if (scm_is_number (rp) && !scm_is_number (lp)) { lp = scm_make_real (scm_to_double (rp) - dy); } - else if (!ly_c_number_p (rp) && !ly_c_number_p (lp)) + else if (!scm_is_number (rp) && !scm_is_number (lp)) { lp = scm_make_real (offset); rp = scm_make_real (offset +dy); diff --git a/lily/tuplet-engraver.cc b/lily/tuplet-engraver.cc index 70378670eb..54c3eb1863 100644 --- a/lily/tuplet-engraver.cc +++ b/lily/tuplet-engraver.cc @@ -1,5 +1,5 @@ /* - plet-engraver.cc -- implement Tuplet_engraver + tuplet-engraver.cc -- implement Tuplet_engraver source file of the GNU LilyPond music typesetter @@ -7,8 +7,6 @@ */ - - #include "tuplet-bracket.hh" #include "note-column.hh" #include "time-scaled-music.hh" @@ -17,44 +15,51 @@ #include "engraver.hh" #include "spanner.hh" +struct Tuplet_description +{ + Music *music_; + Rational stop_; + Rational span_stop_; + Spanner *spanner_; + Tuplet_description() + { + music_ = 0; + spanner_ = 0; + } +}; + class Tuplet_engraver : public Engraver { public: TRANSLATOR_DECLARATIONS (Tuplet_engraver); protected: - Link_array time_scaled_musics_; - /// when does the scaled music stop? Array order is synced with time_scaled_musics_ - Array stop_moments_; - /// when does the current spanner stop? Array order is synced with time_scaled_musics_ - Array span_stop_moments_; - - /// The spanners. Array order is synced with time_scaled_musics_ - Link_array started_spanners_; + Array tuplets_; virtual void acknowledge_grob (Grob_info); virtual bool try_music (Music*r); virtual void start_translation_timestep (); - virtual void process_acknowledged_grobs (); + virtual void process_music (); }; bool -Tuplet_engraver::try_music (Music *c) +Tuplet_engraver::try_music (Music *music) { - if (c->is_mus_type ("time-scaled-music")) + if (music->is_mus_type ("time-scaled-music")) { - Music *el = unsmob_music (c->get_property ("element")); + Music *el = unsmob_music (music->get_property ("element")); if (el && !el->is_mus_type ("event-chord")) { - time_scaled_musics_.push (c); - Rational m = now_mom ().main_part_ + c->get_length ().main_part_; - stop_moments_.push (m); - + Tuplet_description d; + d.music_ = music; + d.stop_ = now_mom ().main_part_ + music->get_length ().main_part_; + d.span_stop_ = d.stop_; + SCM s = get_property ("tupletSpannerDuration"); if (unsmob_moment (s)) - m = m self_scm ()); - - if (i >= started_spanners_.size ()) - started_spanners_.push (glep); - else - started_spanners_[i] = glep; - + Spanner* spanner = make_spanner ("TupletBracket", + tuplets_[i].music_->self_scm ()); + tuplets_[i].spanner_ = spanner; SCM proc = get_property ("tupletNumberFormatFunction"); if (ly_c_procedure_p (proc)) { - SCM t = scm_apply_0 (proc, scm_list_n (time_scaled_musics_[i]->self_scm (), SCM_UNDEFINED)); - glep->set_property ("text", t); + SCM t = scm_apply_0 (proc, scm_list_1 (tuplets_[i].music_->self_scm ())); + spanner->set_property ("text", t); } - } } @@ -92,9 +92,10 @@ Tuplet_engraver::acknowledge_grob (Grob_info i) { if (Note_column::has_interface (i.grob_)) { - for (int j =0; j < started_spanners_.size (); j++) - if (started_spanners_[j]) - Tuplet_bracket::add_column (started_spanners_[j], dynamic_cast (i.grob_)); + for (int j =0; j < tuplets_.size (); j++) + if (tuplets_[j].spanner_) + Tuplet_bracket::add_column (tuplets_[j].spanner_, + dynamic_cast (i.grob_)); } } @@ -108,28 +109,25 @@ Tuplet_engraver::start_translation_timestep () if (unsmob_moment (s)) tsd = unsmob_moment (s)->main_part_; - for (int i= started_spanners_.size (); i--;) + for (int i = tuplets_.size (); i--;) { - if (now.main_part_ >= span_stop_moments_[i]) + if (now.main_part_ >= tuplets_[i].span_stop_) { - if (Spanner *sp = started_spanners_[i]) + if (Spanner *sp = tuplets_[i].spanner_) { if (!sp->get_bound (RIGHT)) sp->set_bound (RIGHT, sp->get_bound (LEFT)); - started_spanners_[i] =0; + tuplets_[i].spanner_ = 0; } if (tsd.to_bool ()) - span_stop_moments_[i] += tsd.main_part_; + tuplets_[i].span_stop_ += tsd.main_part_; } - if (now.main_part_ >= stop_moments_[i]) + if (now.main_part_ >= tuplets_[i].span_stop_) { - started_spanners_.del (i); - stop_moments_.del (i); - span_stop_moments_.del (i); - time_scaled_musics_.del (i); + tuplets_.del (i); } } } diff --git a/lily/virtual-font-metric.cc b/lily/virtual-font-metric.cc index d63d8b74a0..ab8015b7c7 100644 --- a/lily/virtual-font-metric.cc +++ b/lily/virtual-font-metric.cc @@ -33,7 +33,7 @@ Virtual_font_metric::Virtual_font_metric (SCM font_list) *tail = scm_cons (ly_car (s),SCM_EOL); tail = SCM_CDRLOC (*tail); - if (!ly_c_number_p (mag)) + if (!scm_is_number (mag)) /* Ugh. */ mag = ly_cdr (fm->description_); diff --git a/lily/volta-engraver.cc b/lily/volta-engraver.cc index f9443a2fb7..5f6dcf1b6f 100644 --- a/lily/volta-engraver.cc +++ b/lily/volta-engraver.cc @@ -61,7 +61,7 @@ bool Volta_engraver::staff_eligible () { SCM doit =get_property ("voltaOnThisStaff"); - if (ly_c_boolean_p (doit)) + if (scm_is_bool (doit)) { return to_boolean (doit); } diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index 8c6e8d1a12..c976dbcf46 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -220,18 +220,19 @@ (breakable . #t) (stacking-dir . 1) (break-align-orders . #(; end-of-line: - (instrument-name left-edge ambitus breathing-sign - clef staff-bar key-signature - time-signature custos) + (instrument-name + left-edge ambitus breathing-sign + clef key-cancellation staff-bar key-signature + time-signature custos) ; unbroken (instrument-name left-edge ambitus breathing-sign - clef staff-bar key-signature + clef key-cancellation staff-bar key-signature staff time-signature custos) ; begin of line (instrument-name left-edge ambitus breathing-sign - clef key-signature staff-bar + clef key-cancellation key-signature staff-bar time-signature custos) )) @@ -278,6 +279,7 @@ (break-visibility . ,begin-of-line-visible) (space-alist . ((ambitus . (extra-space . 2.0)) (staff-bar . (extra-space . 0.7)) + (key-cancellation . (minimum-space . 4.0)) (key-signature . (minimum-space . 4.0)) (time-signature . (minimum-space . 4.2)) (first-note . (minimum-fixed-space . 5.0)) @@ -427,6 +429,8 @@ (first-note . (fixed-space . 1.0)) (right-edge . (extra-space . 0.0)) (key-signature . (extra-space . 0.0)) + (key-cancellation . (extra-space . 0.0)) + )) (meta . ((interfaces . (break-aligned-interface item-interface )))) )) @@ -525,7 +529,23 @@ side-position-interface text-interface break-aligned-interface item-interface )))) )) - + (KeyCancellation + . ( + (print-function . ,Key_signature_interface::print) + (space-alist . ( + (time-signature . (extra-space . 1.25)) + (staff-bar . (extra-space . 0.6)) + (right-edge . (extra-space . 0.5)) + (first-note . (fixed-space . 2.5)) + )) + (Y-offset-callbacks . (,Staff_symbol_referencer::callback)) + (break-align-symbol . key-cancellation) + (break-visibility . ,begin-of-line-invisible) + (breakable . #t) + + (meta . ((interfaces . (key-signature-interface font-interface + break-aligned-interface item-interface )))) + )) (KeySignature . ( (print-function . ,Key_signature_interface::print) -- 2.39.2