Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #69846, #69821, #63561 - multi-voice TAB's: stem and slur positions #2137

Merged
merged 2 commits into from
Aug 5, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions libmscore/chord.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -811,12 +811,13 @@ void Chord::computeUp()
// if no stems or stem beside staves
if (tab->slashStyle() || !tab->stemThrough()) {
// if measure has voices, set stem direction according to voice
// reverse the logic if stemsDown (#63561)
if (measure()->mstaff(staffIdx())->hasVoices)
_up = !tab->stemsDown() ? !(track() % 2) : (track() % 2);
_up = !(track() % 2);
else // if only voice 1,
_up = !tab->stemsDown();// unconditionally set _up according to TAB stem direction
return; // (if no stems, _up does not really matter!)
// uncondtionally set to down if not stems or according to TAB stem direction otherwise
// (even with no stems, stem direction controls position of slurs and ties)
_up = tab->slashStyle() ? false : !tab->stemsDown();
return;
}
// if TAB has stems through staves, chain into standard processing
}
Expand Down
10 changes: 8 additions & 2 deletions libmscore/measure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3544,10 +3544,16 @@ void Measure::layoutX(qreal stretch)
if (stt->slashStyle()) // if no stems
distAbove = stt->genDurations() ? -stt->durationBoxY() : 0.0;
else { // if stems
if (stt->stemsDown() && !mstaff(staffIdx)->hasVoices)
if (mstaff(staffIdx)->hasVoices) { // reserve space both above and below
distBelow = (STAFFTYPE_TAB_DEFAULTSTEMLEN_UP + STAFFTYPE_TAB_DEFAULTSTEMDIST_UP)*_spatium;
else
distAbove = (STAFFTYPE_TAB_DEFAULTSTEMLEN_DN + STAFFTYPE_TAB_DEFAULTSTEMDIST_DN)*_spatium;
}
else { // if no voices, reserve space on stem side
if (stt->stemsDown())
distBelow = (STAFFTYPE_TAB_DEFAULTSTEMLEN_UP + STAFFTYPE_TAB_DEFAULTSTEMDIST_UP)*_spatium;
else
distAbove = (STAFFTYPE_TAB_DEFAULTSTEMLEN_DN + STAFFTYPE_TAB_DEFAULTSTEMDIST_DN)*_spatium;
}
}
if (distAbove > staves[staffIdx]->distanceUp)
staves[staffIdx]->distanceUp = distAbove;
Expand Down
72 changes: 36 additions & 36 deletions mtest/guitarpro/volta.gp5-ref.mscx
Original file line number Diff line number Diff line change
Expand Up @@ -2638,8 +2638,8 @@
<accidental>0</accidental>
</KeySig>
<Beam id="37">
<l1>46</l1>
<l2>46</l2>
<l1>-16</l1>
<l2>-16</l2>
</Beam>
<Tuplet id="37">
<lid>10</lid>
Expand Down Expand Up @@ -2691,8 +2691,8 @@
</Note>
</Chord>
<Beam id="38">
<l1>46</l1>
<l2>46</l2>
<l1>-16</l1>
<l2>-16</l2>
</Beam>
<Tuplet id="38">
<lid>17</lid>
Expand Down Expand Up @@ -2744,8 +2744,8 @@
</Note>
</Chord>
<Beam id="39">
<l1>46</l1>
<l2>46</l2>
<l1>-16</l1>
<l2>-16</l2>
</Beam>
<Tuplet id="39">
<lid>24</lid>
Expand Down Expand Up @@ -2814,8 +2814,8 @@
</Measure>
<Measure number="2">
<Beam id="40">
<l1>46</l1>
<l2>46</l2>
<l1>-16</l1>
<l2>-16</l2>
</Beam>
<Tuplet id="40">
<lid>34</lid>
Expand Down Expand Up @@ -2867,8 +2867,8 @@
</Note>
</Chord>
<Beam id="41">
<l1>46</l1>
<l2>46</l2>
<l1>-16</l1>
<l2>-16</l2>
</Beam>
<Tuplet id="41">
<lid>41</lid>
Expand Down Expand Up @@ -2920,8 +2920,8 @@
</Note>
</Chord>
<Beam id="42">
<l1>46</l1>
<l2>46</l2>
<l1>-16</l1>
<l2>-16</l2>
</Beam>
<Tuplet id="42">
<lid>48</lid>
Expand Down Expand Up @@ -2990,8 +2990,8 @@
</Measure>
<Measure number="3">
<Beam id="43">
<l1>46</l1>
<l2>46</l2>
<l1>-16</l1>
<l2>-16</l2>
</Beam>
<Tuplet id="43">
<lid>58</lid>
Expand Down Expand Up @@ -3043,8 +3043,8 @@
</Note>
</Chord>
<Beam id="44">
<l1>46</l1>
<l2>46</l2>
<l1>-16</l1>
<l2>-16</l2>
</Beam>
<Tuplet id="44">
<lid>65</lid>
Expand Down Expand Up @@ -3096,8 +3096,8 @@
</Note>
</Chord>
<Beam id="45">
<l1>46</l1>
<l2>46</l2>
<l1>-16</l1>
<l2>-16</l2>
</Beam>
<Tuplet id="45">
<lid>72</lid>
Expand Down Expand Up @@ -3166,8 +3166,8 @@
</Measure>
<Measure number="4">
<Beam id="46">
<l1>46</l1>
<l2>46</l2>
<l1>-16</l1>
<l2>-16</l2>
</Beam>
<Tuplet id="46">
<lid>82</lid>
Expand Down Expand Up @@ -3219,8 +3219,8 @@
</Note>
</Chord>
<Beam id="47">
<l1>46</l1>
<l2>46</l2>
<l1>-16</l1>
<l2>-16</l2>
</Beam>
<Tuplet id="47">
<lid>89</lid>
Expand Down Expand Up @@ -3272,8 +3272,8 @@
</Note>
</Chord>
<Beam id="48">
<l1>46</l1>
<l2>46</l2>
<l1>-16</l1>
<l2>-16</l2>
</Beam>
<Tuplet id="48">
<lid>96</lid>
Expand Down Expand Up @@ -3342,8 +3342,8 @@
</Measure>
<Measure number="5">
<Beam id="49">
<l1>46</l1>
<l2>46</l2>
<l1>-16</l1>
<l2>-16</l2>
</Beam>
<Tuplet id="49">
<lid>106</lid>
Expand Down Expand Up @@ -3395,8 +3395,8 @@
</Note>
</Chord>
<Beam id="50">
<l1>46</l1>
<l2>46</l2>
<l1>-16</l1>
<l2>-16</l2>
</Beam>
<Tuplet id="50">
<lid>113</lid>
Expand Down Expand Up @@ -3448,8 +3448,8 @@
</Note>
</Chord>
<Beam id="51">
<l1>46</l1>
<l2>46</l2>
<l1>-16</l1>
<l2>-16</l2>
</Beam>
<Tuplet id="51">
<lid>120</lid>
Expand Down Expand Up @@ -3518,8 +3518,8 @@
</Measure>
<Measure number="6">
<Beam id="52">
<l1>46</l1>
<l2>46</l2>
<l1>-16</l1>
<l2>-16</l2>
</Beam>
<Tuplet id="52">
<lid>130</lid>
Expand Down Expand Up @@ -3571,8 +3571,8 @@
</Note>
</Chord>
<Beam id="53">
<l1>46</l1>
<l2>46</l2>
<l1>-16</l1>
<l2>-16</l2>
</Beam>
<Tuplet id="53">
<lid>137</lid>
Expand Down Expand Up @@ -3624,8 +3624,8 @@
</Note>
</Chord>
<Beam id="54">
<l1>46</l1>
<l2>46</l2>
<l1>-16</l1>
<l2>-16</l2>
</Beam>
<Tuplet id="54">
<lid>144</lid>
Expand Down