[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
a couple textspanner problems
From: |
scott snyder |
Subject: |
a couple textspanner problems |
Date: |
Mon, 08 Jan 2001 23:56:06 CST |
hi -
I had a few problems trying to set ottavas with recent lilypond versions.
I'm using a linux/i86 system.
I started out using lily 1.3.119, compiled with gcc 2.95.2.
Here's the test case i used:
--------------------------------------------------------------------------
\score{
\notes\relative c'''{
\property Voice.TextSpanner \override #'type = #'dashed-line
\property Voice.TextSpanner \override #'edge-height = #'(0 . 1.5)
\property Voice.TextSpanner \override #'edge-text = #'("8va " . "")
\property Staff.centralCPosition = #-13
a16\spanrequest \start "text" b c a a b c a a b c a a b c a\spanrequest
\stop "text"
a b c a a b c a a b c a a b c a
}
}
--------------------------------------------------------------------------
What i was seeing was that the entire ottava bar was shifted to the right
of where it should be, by about the space of 3-4 note heads.
After upgrading to lily 1.3.121 and the redhat gcc 2.96, though,
the symptoms went away. However, i had already tracked down the problem,
and the underlying cause is still there --- it was a read of an
uninitialized variable in text-spanner.cc. Here's a patch to fix it:
--- text-spanner.cc-orig Mon Jan 8 01:03:05 2001
+++ text-spanner.cc Sat Jan 6 02:36:49 2001
@@ -49,6 +49,7 @@
{
Item *b = spanner->get_bound (d);
broken[d] = b->break_status_dir () != CENTER;
+ extra_off[d] = 0;
if (!broken [d])
{
Second, when i run this testcase, i get the annoying warnings
(this is reproducable with lily 1.3.121):
Interpreting music...
ottava.ly:8:37: warning: already have a text spanner:
a16\spanrequest \start "text"
b c a a b c a a b c a a b c a\spanrequest
\stop "text"
ottava.ly:8:37: warning: already have a text spanner:
a16\spanrequest \start "text"
b c a a b c a a b c a a b c a\spanrequest
\stop "text"
ottava.ly:8:92: warning: can't find start of text spanner:
a16\spanrequest \start "text" b c a a b c a a b c a a b c a\spanrequest
\stop "text"
ottava.ly:8:92: warning: can't find start of text spanner:
a16\spanrequest \start "text" b c a a b c a a b c a a b c a\spanrequest
\stop "text"
It looked to me like the problem was that Text_spanner_engraver::create_grobs
wasn't clearing req_drul_ after processing it. The following change
seems to fix the problem:
--- text-spanner-engraver.cc-orig Mon Jan 8 01:55:33 2001
+++ text-spanner-engraver.cc Sat Jan 6 02:39:16 2001
@@ -103,6 +103,7 @@
finished_ = span_;
span_ = 0;
current_req_ = 0;
+ req_drul_[STOP] = 0;
}
}
@@ -127,6 +128,7 @@
Grob *e = unsmob_grob (get_property ("currentMusicalColumn"));
span_->set_bound (LEFT, e);
announce_grob (span_, req_drul_[START]);
+ req_drul_[START] = 0;
}
}
}
Also, while playing around with this, i found what looks like a typo in
translator-group.cc:
--- translator-group.cc-orig Fri Jan 5 01:05:33 2001
+++ translator-group.cc Fri Jan 5 01:05:55 2001
@@ -459,7 +459,7 @@
add_trans_scm_funcs ()
{
scm_make_gsubr ("ly-get-trans-property", 2, 0, 0,
(Scheme_function_unknown)ly_get_trans_property);
- scm_make_gsubr ("ly-get-trans-property", 3, 0, 0,
(Scheme_function_unknown)ly_get_trans_property);
+ scm_make_gsubr ("ly-set-trans-property", 3, 0, 0,
(Scheme_function_unknown)ly_set_trans_property);
}
ADD_SCM_INIT_FUNC(trans_scm, add_trans_scm_funcs);
Finally, a question: how does one retrieve the value of a property
like Staff.centralCPosition from scheme? I set up abbreviations like
startottava = \notes {
\property Voice.TextSpanner \set #'type = #'dashed-line
\property Voice.TextSpanner \set #'edge-height = #'(0 . 1.5)
\property Voice.TextSpanner \set #'edge-text = #'("8va " . "")
\property Staff.centralCPosition = #-13
}
endottava = \notes {
\property Staff.centralCPosition = #-6
}
but i wanted to make them work correctly regardless of what the current
clef is. (I tried to put the spanrequests inside these constructions too,
but doing that i wasn't able to get the range of spanned notes consistent
with the range where the staff C position had been changed.)
thanks,
sss
- a couple textspanner problems,
scott snyder <=