diff --git a/libmscore/beam.cpp b/libmscore/beam.cpp index 0b107e642ffb..a0b61918fc9b 100644 --- a/libmscore/beam.cpp +++ b/libmscore/beam.cpp @@ -675,8 +675,8 @@ static void initBeamMetrics() B(0, 3, 4, 13, 1); B(0, 3, 5, 13, 2); B(0, 3, 6, 14, 4); - B(0, 3, 7, 13, 4); - B(0, 3, 8, 13, 6); + B(0, 3, 7, 14, 4); + B(0, 3, 8, 14, 6); B(0, 3, 2, 11, -1); B(0, 3, 1, 11, -2); @@ -716,17 +716,17 @@ static void initBeamMetrics() B(0, -5,-4, 16, 2); B(0, -5,-3, 16, 2); - B(0, -5,-2, 16, 2); - B(0, -5,-1, 16, 2); - B(0, -5, 0, 16, 4); - B(0, -5, 1, 16, 5); - B(0, -5, 2, 16, 5); + B(0, -5,-2, 17, 2); + B(0, -5,-1, 17, 2); + B(0, -5, 0, 18, 4); + B(0, -5, 1, 18, 5); + B(0, -5, 2, 21, 5); B(0, 2, 3, 12, 1); B(0, 2, 4, 12, 4); B(0, 2, 5, 13, 4); // F B(0, 2, 6, 15, 5); - B(0, 2, 7, 13, 6); + B(0, 2, 7, 15, 6); B(0, 2, 8, 16, 8); B(0, 2, 9, 16, 8); @@ -741,7 +741,7 @@ static void initBeamMetrics() // =================================== E B(1, 8, 8, -12, 0); B(0, 1, 1, 13, 0); - B(1, 1, 1, -9, 0); + B(1, 1, 1, -12, 0); B(1, 8, 7, -12, -1); B(1, 8, 6, -12, -4); @@ -753,8 +753,8 @@ static void initBeamMetrics() B(1, 15, 11, -21, -1); B(1, 15, 10, -21, -1); - B(1, 15, 9, -21, -1); - B(1, 15, 8, -21, -1); + B(1, 15, 9, -21, -4); + B(1, 15, 8, -21, -5); B(1, 1, 8, -11, 6); B(1, 1, 7, -11, 6); @@ -766,7 +766,7 @@ static void initBeamMetrics() B(1, 8, 12, -12, 5); B(1, 8, 13, -12, 4); B(1, 8, 14, -12, 5); - B(1, 8, 15, -12, 1); + B(1, 8, 15, -12, 5); B(0, 1, 0, 11, -1); B(0, 1, -1, 11, -2); @@ -796,7 +796,7 @@ static void initBeamMetrics() // =================================== F B(1, 7, 7,-13, 0); //F B(0, 0, 0, 12, 0); - B(0, 7, 7, 10, 0); + B(0, 7, 7, 12, 0); B(1, 7, 6, -13, -1); B(1, 7, 5, -13, -2); @@ -908,8 +908,8 @@ static void initBeamMetrics() B(1, 5, 4, -13, -1); B(1, 5, 3, -13, -2); B(1, 5, 2, -14, -4); - B(1, 5, 1, -14, -4); - B(1, 5, 0, -13, -6); + B(1, 5, 1, -15, -4); + B(1, 5, 0, -15, -6); B(1, 12, 11, -15, -1); B(1, 12, 10, -15, -2); @@ -1164,6 +1164,28 @@ void Beam::computeStemLen(const QList& cl, qreal& py1, int beamLevel if (hasNoSlope()) bm.s = 0.0; + // special case for two beamed notes: flatten to max of 1sp + static int maxShortSlant = 4; + if (bm.l && elements().size() == 2) { + //qDebug("computeStemLen: l = %d, s = %d", (int)bm.l, (int)bm.s); + if (bm.s > maxShortSlant) { + // slant downward + // lengthen first stem if down + if (bm.l > 0) + bm.l += bm.s - maxShortSlant; + // flatten beam + bm.s = maxShortSlant; + } + else if (bm.s < -maxShortSlant) { + // slant upward + // lengthen first stem if up + if (bm.l < 0) + bm.l -= -maxShortSlant - bm.s; + // flatten beam + bm.s = -maxShortSlant; + } + } + if (bm.l) { if (bm.l > 0) bm.l -= graceStemLengthCorrection; @@ -1264,6 +1286,10 @@ void Beam::computeStemLen(const QList& cl, qreal& py1, int beamLevel uint interval = qAbs((l2 - l1) / 2); minS = minSlant(interval); maxS = maxSlant(interval); + if (elements().size() == 2) { + minS = qMin(minS, 2); + maxS = qMin(maxS, 4); + } } int ll1; if (_up) { diff --git a/mtest/libmscore/beam/Beam-A.mscx b/mtest/libmscore/beam/Beam-A.mscx index d156fa6f4fbb..befc90af70c8 100644 --- a/mtest/libmscore/beam/Beam-A.mscx +++ b/mtest/libmscore/beam/Beam-A.mscx @@ -260,8 +260,8 @@ up - -4 - -8 + -5 + -9 begin @@ -288,8 +288,8 @@ up - -3 - -9 + -7 + -11 begin @@ -420,7 +420,7 @@ - 9 + 8 4 @@ -444,7 +444,7 @@ up - 8 + 7 3 @@ -487,7 +487,7 @@ up - 4 + 3 -1 @@ -567,7 +567,7 @@ up -1 - 4 + 3 eighth @@ -588,7 +588,7 @@ up -1 - 4 + 3 begin @@ -616,7 +616,7 @@ up -1 - 4 + 3 eighth @@ -636,7 +636,7 @@ -1 - 4 + 3 begin @@ -657,7 +657,7 @@ -1 - 4 + 3 eighth @@ -723,7 +723,7 @@ - 8 + 9 13 @@ -743,7 +743,7 @@ - 11 + 12 16 @@ -770,7 +770,7 @@ 3 - 12 + 13 17 @@ -811,7 +811,7 @@ - 16 + 17 21 @@ -1064,7 +1064,7 @@ 21 - 16 + 17 begin @@ -1092,7 +1092,7 @@ down 21 - 16 + 17 eighth @@ -1113,7 +1113,7 @@ down 21 - 16 + 17 begin @@ -1135,7 +1135,7 @@ down 21 - 16 + 17 eighth diff --git a/mtest/libmscore/beam/Beam-B.mscx b/mtest/libmscore/beam/Beam-B.mscx index 408a5eb46fe9..bd04f946d15c 100644 --- a/mtest/libmscore/beam/Beam-B.mscx +++ b/mtest/libmscore/beam/Beam-B.mscx @@ -255,7 +255,7 @@ - 9 + 8 4 @@ -276,7 +276,7 @@ - 8 + 7 3 @@ -326,7 +326,7 @@ up - 4 + 3 -1 @@ -348,7 +348,7 @@ up - 1 + 0 -4 @@ -626,7 +626,7 @@ up -4 - 1 + 0 eighth @@ -647,7 +647,7 @@ up -4 - 1 + 0 begin @@ -675,7 +675,7 @@ up -5 - 1 + -1 eighth @@ -716,7 +716,7 @@ -4 - 1 + 0 eighth @@ -783,7 +783,7 @@ 20 - 15 + 16 eighth @@ -803,7 +803,7 @@ 20 - 15 + 16 begin @@ -830,7 +830,7 @@ 21 - 15 + 17 eighth @@ -871,7 +871,7 @@ 20 - 15 + 16 eighth @@ -1142,7 +1142,7 @@ - 7 + 8 12 @@ -1162,7 +1162,7 @@ - 8 + 9 13 @@ -1211,7 +1211,7 @@ down - 12 + 13 17 @@ -1233,7 +1233,7 @@ down - 15 + 16 20 diff --git a/mtest/libmscore/beam/Beam-C.mscx b/mtest/libmscore/beam/Beam-C.mscx index 4ace955ec9a7..5ea0ff481a82 100644 --- a/mtest/libmscore/beam/Beam-C.mscx +++ b/mtest/libmscore/beam/Beam-C.mscx @@ -233,7 +233,7 @@ - 8 + 7 3 @@ -254,7 +254,7 @@ - 5 + 4 0 @@ -281,7 +281,7 @@ 3 - 4 + 3 -1 @@ -323,7 +323,7 @@ - 0 + -1 -5 @@ -533,7 +533,7 @@ -5 - 0 + -1 begin @@ -560,7 +560,7 @@ -5 - 0 + -1 eighth @@ -580,7 +580,7 @@ -5 - 0 + -1 begin @@ -601,7 +601,7 @@ -5 - 0 + -1 eighth @@ -686,7 +686,7 @@ - 7 + 8 12 @@ -713,7 +713,7 @@ 3 - 8 + 9 13 @@ -754,7 +754,7 @@ - 12 + 13 17 @@ -841,7 +841,7 @@ -5 - 0 + -1 begin @@ -864,7 +864,7 @@ -5 - 0 + -1 eighth @@ -943,7 +943,7 @@ 17 - 12 + 13 eighth @@ -963,7 +963,7 @@ 17 - 12 + 13 begin @@ -990,7 +990,7 @@ 17 - 12 + 13 eighth @@ -1010,7 +1010,7 @@ 17 - 12 + 13 begin @@ -1031,7 +1031,7 @@ 17 - 12 + 13 eighth diff --git a/mtest/libmscore/beam/Beam-D.mscx b/mtest/libmscore/beam/Beam-D.mscx index 49ab30cd7ed2..b5cc5f1bcdec 100644 --- a/mtest/libmscore/beam/Beam-D.mscx +++ b/mtest/libmscore/beam/Beam-D.mscx @@ -237,7 +237,7 @@ - 5 + 4 0 @@ -258,7 +258,7 @@ - 4 + 3 -1 @@ -286,7 +286,7 @@ up - 2 + 0 -4 @@ -308,7 +308,7 @@ up - 1 + 0 -4 @@ -330,7 +330,7 @@ up - 1 + -3 -7 @@ -563,7 +563,7 @@ up -8 - -3 + -4 begin @@ -591,7 +591,7 @@ up -7 - -2 + -3 eighth @@ -611,7 +611,7 @@ -8 - -3 + -4 begin @@ -632,7 +632,7 @@ -8 - 0 + -4 eighth @@ -698,8 +698,8 @@ - 6 - 8 + 7 + 9 eighth @@ -718,8 +718,8 @@ - 6 - 8 + 7 + 9 begin @@ -745,8 +745,8 @@ 3 - 6 - 10 + 8 + 12 eighth @@ -765,8 +765,8 @@ - 6 - 11 + 9 + 13 begin @@ -786,8 +786,8 @@ - 6 - 11 + 12 + 16 eighth @@ -874,7 +874,7 @@ down - 19 + 20 24 @@ -898,8 +898,8 @@ down - 17 - 23 + 21 + 25 eighth @@ -978,7 +978,7 @@ 16 - 11 + 12 eighth @@ -998,7 +998,7 @@ 16 - 11 + 12 begin @@ -1066,7 +1066,7 @@ 16 - 11 + 12 eighth diff --git a/mtest/libmscore/beam/Beam-E.mscx b/mtest/libmscore/beam/Beam-E.mscx index d98f2e895207..fa78fc3bb059 100644 --- a/mtest/libmscore/beam/Beam-E.mscx +++ b/mtest/libmscore/beam/Beam-E.mscx @@ -159,8 +159,8 @@ up - -7 - -7 + -10 + -10 eighth @@ -237,7 +237,7 @@ - 4 + 3 -1 @@ -258,7 +258,7 @@ - 1 + 0 -4 @@ -286,7 +286,7 @@ up - 0 + -1 -5 @@ -308,7 +308,7 @@ up - -1 + -3 -7 @@ -330,7 +330,7 @@ up - -3 + -5 -9 @@ -399,7 +399,7 @@ 9 - 8 + 5 eighth @@ -418,8 +418,8 @@ - 9 - 8 + 8 + 4 begin @@ -442,7 +442,7 @@ -9 - -3 + -5 eighth @@ -463,7 +463,7 @@ up -9 - -3 + -5 begin @@ -485,7 +485,7 @@ up -10 - -4 + -6 eighth @@ -564,7 +564,7 @@ up 4 - 9 + 8 eighth @@ -585,7 +585,7 @@ up 4 - 9 + 8 begin @@ -633,7 +633,7 @@ 4 - 9 + 8 begin @@ -654,7 +654,7 @@ 4 - 5 + 8 eighth @@ -721,7 +721,7 @@ 13 - 8 + 9 eighth @@ -741,7 +741,7 @@ 13 - 8 + 9 begin @@ -768,7 +768,7 @@ 13 - 8 + 9 eighth @@ -788,7 +788,7 @@ 13 - 8 + 9 begin @@ -809,7 +809,7 @@ 13 - 8 + 9 eighth @@ -875,7 +875,7 @@ down - 15 + 16 20 @@ -896,7 +896,7 @@ down - 16 + 17 21 @@ -920,7 +920,7 @@ down - 17 + 18 22 @@ -940,7 +940,7 @@ - 19 + 20 24 @@ -962,7 +962,7 @@ down - 19 + 23 27 @@ -1058,7 +1058,7 @@ - 8 + 9 13 @@ -1087,7 +1087,7 @@ down 25 - 19 + 21 eighth @@ -1108,7 +1108,7 @@ down 28 - 20 + 24 begin @@ -1130,7 +1130,7 @@ down 28 - 20 + 24 eighth diff --git a/mtest/libmscore/beam/Beam-F.mscx b/mtest/libmscore/beam/Beam-F.mscx index 8d6fde05e47e..4391f8ac90b1 100644 --- a/mtest/libmscore/beam/Beam-F.mscx +++ b/mtest/libmscore/beam/Beam-F.mscx @@ -159,8 +159,8 @@ down - 24 - 24 + 26 + 26 eighth @@ -237,7 +237,7 @@ - 1 + 0 -4 @@ -258,7 +258,7 @@ - 0 + -1 -5 @@ -286,7 +286,7 @@ up - -1 + -3 -7 @@ -308,7 +308,7 @@ up - -3 + -5 -9 @@ -330,7 +330,7 @@ up - -4 + -8 -12 @@ -418,7 +418,7 @@ - 8 + 7 3 @@ -443,7 +443,7 @@ up -12 - -4 + -8 eighth @@ -464,7 +464,7 @@ up -12 - -4 + -8 begin @@ -486,7 +486,7 @@ up -9 - -3 + -5 eighth @@ -565,7 +565,7 @@ up 3 - 8 + 7 eighth @@ -586,7 +586,7 @@ up 3 - 8 + 7 begin @@ -614,7 +614,7 @@ up 3 - 8 + 7 eighth @@ -634,7 +634,7 @@ 3 - 8 + 7 begin @@ -655,7 +655,7 @@ 3 - 8 + 7 eighth @@ -722,7 +722,7 @@ 12 - 7 + 8 eighth @@ -742,7 +742,7 @@ 12 - 7 + 8 begin @@ -876,7 +876,7 @@ down - 12 + 13 17 @@ -897,7 +897,7 @@ down - 15 + 16 20 @@ -921,7 +921,7 @@ down - 16 + 17 21 @@ -941,7 +941,7 @@ - 17 + 18 22 @@ -963,7 +963,7 @@ down - 19 + 21 25 @@ -1088,7 +1088,7 @@ down 26 - 20 + 22 eighth @@ -1109,7 +1109,7 @@ down 25 - 19 + 21 begin @@ -1131,7 +1131,7 @@ down 25 - 19 + 21 eighth diff --git a/mtest/libmscore/beam/Beam-G.mscx b/mtest/libmscore/beam/Beam-G.mscx index d3a254e14daf..7c602419c87e 100644 --- a/mtest/libmscore/beam/Beam-G.mscx +++ b/mtest/libmscore/beam/Beam-G.mscx @@ -258,7 +258,7 @@ - -3 + -4 -8 @@ -286,7 +286,7 @@ up - -1 + -4 -8 @@ -308,7 +308,7 @@ up - -4 + -8 -12 @@ -330,7 +330,7 @@ up - -4 + -8 -12 @@ -418,7 +418,7 @@ - 8 + 7 3 @@ -442,7 +442,7 @@ up - 5 + 4 0 @@ -464,7 +464,7 @@ up -12 - -4 + -8 begin @@ -547,7 +547,7 @@ up 0 - 5 + 4 eighth @@ -568,7 +568,7 @@ up 0 - 5 + 4 begin @@ -616,7 +616,7 @@ 0 - 5 + 4 begin @@ -637,7 +637,7 @@ 0 - 5 + 4 eighth @@ -844,7 +844,7 @@ down - 11 + 12 16 @@ -865,7 +865,7 @@ down - 12 + 13 17 @@ -889,7 +889,7 @@ down - 15 + 17 21 @@ -909,7 +909,7 @@ - 16 + 17 21 @@ -931,7 +931,7 @@ down - 16 + 20 24 @@ -1032,7 +1032,7 @@ down 24 - 18 + 20 begin @@ -1060,7 +1060,7 @@ down 23 - 17 + 19 eighth @@ -1081,7 +1081,7 @@ down 24 - 17 + 20 begin @@ -1103,7 +1103,7 @@ down 24 - 16 + 20 eighth diff --git a/vtest/beams-16-ref.png b/vtest/beams-16-ref.png new file mode 100644 index 000000000000..7015a238d8d3 Binary files /dev/null and b/vtest/beams-16-ref.png differ diff --git a/vtest/beams-16.mscz b/vtest/beams-16.mscz new file mode 100644 index 000000000000..3d2bbcda04e8 Binary files /dev/null and b/vtest/beams-16.mscz differ diff --git a/vtest/gen b/vtest/gen index 44dee6f5ec04..306ef267112e 100755 --- a/vtest/gen +++ b/vtest/gen @@ -47,7 +47,7 @@ else tie-1 tie-2 tie-3 grace-1 grace-2 grace-3 grace-4 tuplets-1 breath-1\ harmony-1 harmony-2 harmony-3 harmony-4 harmony-5 harmony-6 harmony-7 harmony-8 harmony-9 harmony-10 harmony-11\ beams-1 beams-2 beams-3 beams-4 beams-5 beams-6 beams-7 beams-8 beams-9 beams-10\ - beams-11 beams-12 beams-13 beams-14 beams-15\ + beams-11 beams-12 beams-13 beams-14 beams-15 beams-16\ user-offset-1 user-offset-2 chord-space-1 chord-space-2 tablature-1 image-1\ lyrics-1 lyrics-2 lyrics-3 lyrics-4 voice-1 voice-2 slash-1 slash-2 system-1 system-2 system-3" fi diff --git a/vtest/gen.bat b/vtest/gen.bat index df94840aaf3f..95608cb33c6c 100644 --- a/vtest/gen.bat +++ b/vtest/gen.bat @@ -22,7 +22,7 @@ set SRC=mmrest-1,bravura-mmrest,gonville-mmrest,mmrest-2,mmrest-4,mmrest-5,mmres tie-1,tie-2,tie-3,grace-1,grace-2,grace-3,grace-4,tuplets-1,breath-1, ^ harmony-1,harmony-2,harmony-3,harmony-4,harmony-5,harmony-6,harmony-7,harmony-8,harmony-9,harmony-10,harmony-11, ^ beams-1,beams-2,beams-3,beams-4,beams-5,beams-6,beams-7,beams-8,beams-9,beams-10, ^ - beams-11,beams-12,beams-13,beams-14,beams-15, ^ + beams-11,beams-12,beams-13,beams-14,beams-15,beams-16, ^ user-offset-1,user-offset-2,chord-space-1,chord-space-2,tablature-1,image-1, ^ lyrics-1,lyrics-2,lyrics-3,lyrics-4,voice-1,voice-2,slash-1,slash-2,system-1,system-2,system-3