[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: \context + \set ineffective
From: |
Dan Eble |
Subject: |
Re: \context + \set ineffective |
Date: |
Mon, 16 Apr 2018 10:04:03 -0400 |
I’ve convinced myself that this is a bug, so I will spend some time trying to
change it and see what happens. I will probably use something like the
following as regression tests.
Regards,
—
Dan
\version "2.19.80"
\layout {
indent = 0
line-width = 2 \cm
}
%% Find the nearest enclosing context of some type.
\score {
\new StaffGroup = "A" <<
\new StaffGroup = "B" \with { shortInstrumentName = "FAIL" } {
e'1
\context StaffGroup {
%% This is expected to replace FAIL.
\set StaffGroup.shortInstrumentName = "PASS"
}
\break
e'1
}
>>
}
%% Find the nearest enclosing context by type and ID.
\score {
\new StaffGroup = "A" <<
\new StaffGroup = "B" \with { shortInstrumentName = "FAIL" } {
e'1
\context StaffGroup = "B" {
%% This is expected to replace FAIL.
\set StaffGroup.shortInstrumentName = "PASS"
}
\break
e'1
}
>>
}
% Create a new context by type and ID even though both match the
% enclosing context.
\score {
\new StaffGroup = "A" <<
\new StaffGroup = "B" \with { shortInstrumentName = "PASS" } {
g'1
\new StaffGroup = "B" {
%% This does not replace PASS because it is a new context, and
%% it is not engraved because this context contains no music.
\set StaffGroup.shortInstrumentName = "FAIL"
}
\break
g'1
}
>>
}
% Find an enclosing context by type and ID when there is another
% context of the same type in between.
\score {
\new StaffGroup = "A" \with { shortInstrumentName = "FAIL" } <<
\new StaffGroup = "B" {
b'1
\context StaffGroup = "A" {
%% This is expected to replace FAIL.
\set StaffGroup.shortInstrumentName = "PASS"
}
\break
b'1
}
>>
}