diff --git a/src/engraving/data/harmony_to_diagram.xml b/src/engraving/data/harmony_to_diagram.xml index fb084a2d8e42a..16a23f58593e6 100644 --- a/src/engraving/data/harmony_to_diagram.xml +++ b/src/engraving/data/harmony_to_diagram.xml @@ -480,34 +480,6 @@ g# - - - - - cross - - - circle - - - normal - - - normal - - - normal - - - circle - - - - XO[2-O][2-O][2-O]O - - a - - @@ -2444,35 +2416,6 @@ a7(#9#5) - - - 3 - - - cross - - - normal - - - normal - - - normal - - - normal - - - cross - - - - X[4-O][5-O][6-O][6-O]X - - a7#5/c# - - @@ -2554,30 +2497,6 @@ a7(b13#9) - - - 4 - - - cross - - - circle - - - normal - - - normal - - 2 - - - XO[5-O]--[8-O];B6[3-4] - - a7(#9#5) - - 10 @@ -3907,27 +3826,6 @@ adim/eb - - - 3 - - - normal - - - normal - - - normal - - 1 - - - -[6-O][6-O][5-O]--;B4[0-5] - - ab - - @@ -6636,35 +6534,6 @@ abmaj13 - - - 2 - - - cross - - - normal - - - normal - - - normal - - - normal - - - cross - - - - X[6-O][5-O][5-O][3-O]X - - abm7(add4)/eb - - @@ -8075,30 +7944,6 @@ absus2/cb - - - 2 - - - cross - - - normal - - - normal - - - cross - - 1 - - - X-[6-O]-[4-O]X;B3[1-3] - - absus2/c - - @@ -10805,34 +10650,6 @@ am(#5) - - - - - cross - - - circle - - - normal - - - normal - - - normal - - - circle - - - - XO[2-O][1-O][1-O]O - - am(#7) - - @@ -11307,29 +11124,6 @@ a+/g - - - - - cross - - - normal - - - normal - - - normal - - 1 - - - X-[3-O][3-O][3-O]-;B1[1-5] - - a# - - 1 @@ -12598,29 +12392,6 @@ asus/g - - - - - cross - - - normal - - - normal - - - normal - - 2 - - - X-[4-O][4-O][4-O]-;B2[1-5] - - b - - @@ -14116,27 +13887,6 @@ b7(b9sus4) - - - 1 - - - cross - - - normal - - - normal - - 1 - - - X-[4-O]-[5-O]-;B2[1-5] - - b7sus4 - - @@ -15077,29 +14827,6 @@ bdim/f - - - - - cross - - - normal - - - normal - - - normal - - 1 - - - X-[3-O][3-O][3-O]-;B1[1-5] - - bb - - @@ -15805,34 +15532,6 @@ bb6/c - - - - - cross - - - normal - - - circle - - - circle - - - normal - - - cross - - - - X[1-O]OO[3-O]X - - bb6(no3) - - @@ -16241,29 +15940,6 @@ bb7(no3) - - - - - cross - - - normal - - - cross - - - cross - - 1 - - - X-[3-O]-XX;B1[1-3] - - bb7(no3) - - @@ -18889,34 +18565,6 @@ bbmaj7(no3) - - - - - cross - - - normal - - - normal - - - normal - - - cross - - - cross - - - - X[1-O][3-O][2-O]XX - - bbmaj7(no3) - - @@ -19506,27 +19154,6 @@ bbm(#7)/f - - - 5 - - - normal - - - normal - - - normal - - 1 - - - -[8-O][7-O]--[8-O];B6[0-4] - - bbm(add9) - - @@ -19555,24 +19182,6 @@ bbm/d - - - 5 - - - cross - - - cross - - 1 - - - XX----;B6[2-5] - - bbm/ab - - @@ -19601,34 +19210,6 @@ bbm/c - - - - - cross - - - normal - - - normal - - - normal - - - normal - - - cross - - - - X[4-O][3-O][3-O][2-O]X - - bbm/db - - @@ -21679,34 +21260,6 @@ bm9/e - - - - - cross - - - circle - - - circle - - - normal - - - normal - - - cross - - - - XOO[4-O][2-O]X - - bm(add2)/a - - @@ -22265,27 +21818,6 @@ bm(#7) - - - 6 - - - normal - - - normal - - - normal - - 1 - - - -[9-O][8-O]--[9-O];B7[0-4] - - bm(add9) - - 5 @@ -23083,26 +22615,6 @@ bsus - - - - - cross - - - normal - - - normal - - 2 - - - X-[4-O][4-O]--;B2[1-5] - - bsus2 - - 5 @@ -23359,34 +22871,6 @@ bsus/e - - - - - cross - - - normal - - - normal - - - circle - - - normal - - - circle - - - - X[3-O][2-O]O[1-O]O - - c - - @@ -25285,29 +24769,6 @@ c7#5/e - - - - - cross - - - normal - - - normal - - - normal - - 2 - - - X[3-O]-[3-O]-[4-O];B2[2-4] - - c7(b9#5) - - 2 @@ -25711,34 +25172,6 @@ c7sus2 - - - - - cross - - - normal - - - normal - - - circle - - - normal - - - normal - - - - X[3-O][3-O]O[2-O][1-O] - - c7b9sus4 - - @@ -26086,34 +25519,6 @@ c9sus4/f - - - - - cross - - - normal - - - circle - - - circle - - - normal - - - circle - - - - X[3-O]OO[1-O]O - - cadd2 - - 2 @@ -26171,35 +25576,6 @@ cadd2/bb - - - 2 - - - cross - - - normal - - - normal - - - normal - - - normal - - - circle - - - - X[5-O][5-O][5-O][3-O]O - - cadd2/d - - @@ -26696,34 +26072,6 @@ c(#9) - - - - - cross - - - normal - - - normal - - - circle - - - normal - - - circle - - - - X[3-O][2-O]O[4-O]O - - c(#9) - - 2 @@ -26983,29 +26331,6 @@ cdim/g - - - - - cross - - - normal - - - normal - - - normal - - 2 - - - X-[4-O][4-O][4-O]-;B2[1-5] - - cb - - @@ -29095,34 +28420,6 @@ cm(add9)/g - - - - - normal - - - normal - - - normal - - - circle - - - normal - - - cross - - - - [3-O][3-O][1-O]O[3-O]X - - cm(add2)/g - - 2 @@ -29283,29 +28580,6 @@ cmaj13 - - - - - cross - - - normal - - - normal - - - normal - - 2 - - - X[3-O]--[3-O][3-O];B2[2-3] - - c69 - - 2 @@ -29682,35 +28956,6 @@ cmaj7/g - - - 2 - - - cross - - - normal - - - cross - - - normal - - - normal - - - normal - - - - X[3-O]X[4-O][5-O][5-O] - - cmaj7(add13) - - 2 @@ -30163,34 +29408,6 @@ cm(#7)/g - - - - - cross - - - normal - - - normal - - - circle - - - normal - - - cross - - - - X[3-O][1-O]O[3-O]X - - cm(add9) - - 3 @@ -30982,27 +30199,6 @@ c+/g# - - - 3 - - - cross - - - normal - - - cross - - 3 - - - X[4-O]---X;B6[2-4] - - c# - - 3 @@ -31071,35 +30267,6 @@ c#13b9 - - - 3 - - - cross - - - normal - - - normal - - - normal - - - normal - - - cross - - - - X[4-O][5-O][6-O][6-O]X - - c(#4) - - 3 @@ -31643,35 +30810,6 @@ c#7#11/g# - - - 2 - - - cross - - - normal - - - normal - - - normal - - - cross - - - normal - - - - X[4-O][3-O][4-O]X[5-O] - - c#7#5 - - 2 @@ -33412,30 +32550,6 @@ c#m(#7) - - - 8 - - - cross - - - cross - - - normal - - - normal - - 1 - - - XX[11-O]--[11-O];B9[3-4] - - c#m(add9) - - @@ -33698,35 +32812,6 @@ c#m(#5) - - - 3 - - - cross - - - normal - - - normal - - - normal - - - cross - - - cross - - - - X[4-O][6-O][6-O]XX - - c#5 - - @@ -34624,34 +33709,6 @@ csus/g - - - - - cross - - - cross - - - circle - - - normal - - - normal - - - normal - - - - XXO[2-O][3-O][2-O] - - d - - 4 @@ -36009,34 +35066,6 @@ d7(no3) - - - - - cross - - - cross - - - circle - - - normal - - - normal - - - cross - - - - XXO[2-O][1-O]X - - d7(no3) - - @@ -36708,139 +35737,115 @@ - 3 cross + cross + + + circle + + normal + + normal + + + normal + + + + XXO[2-O][1-O][3-O] + + d7sus4 + + + + + 2 + + + cross + + + cross + + + circle + + + normal + + + normal + + + normal + + + + XXO[5-O][5-O][3-O] + + d7(add2sus4) + + + + + + + cross + + + cross + + circle + + + circle + + normal + + circle + + + + XXOO[1-O]O + + d7sus(add9) + + + + + + + normal + + + cross + + + circle + normal - 3 + + normal + + + normal + - X[5-O][4-O][5-O]--;B6[4-5] + [3-O]XO[2-O][1-O][3-O] - d7(#9#5) - - - - - - - cross - - - cross - - - circle - - - normal - - - normal - - - normal - - - - XXO[2-O][1-O][3-O] - - d7sus4 - - - - - 2 - - - cross - - - cross - - - circle - - - normal - - - normal - - - normal - - - - XXO[5-O][5-O][3-O] - - d7(add2sus4) - - - - - - - cross - - - cross - - - circle - - - circle - - - normal - - - circle - - - - XXOO[1-O]O - - d7sus(add9) - - - - - - - normal - - - cross - - - circle - - - normal - - - normal - - - normal - - - - [3-O]XO[2-O][1-O][3-O] - - d7sus4/g + d7sus4/g @@ -36899,34 +35904,6 @@ d7sus4/f# - - - - - normal - - - circle - - - circle - - - circle - - - normal - - - normal - - - - [2-O]OOO[1-O][2-O] - - d7sus4/f# - - @@ -37253,35 +36230,6 @@ d9/e - - - 4 - - - cross - - - normal - - - normal - - - normal - - - normal - - - circle - - - - X[5-O][7-O][7-O][7-O]O - - dadd2 - - @@ -37396,34 +36344,6 @@ d(#9) - - - - - cross - - - cross - - - normal - - - normal - - - normal - - - normal - - - - XX[4-O][2-O][3-O][1-O] - - d(#9) - - 3 @@ -37706,34 +36626,6 @@ dadd2/e - - - - - normal - - - cross - - - circle - - - normal - - - normal - - - circle - - - - [2-O]XO[2-O][3-O]O - - dadd2/f# - - @@ -37819,63 +36711,6 @@ dadd4/a - - - - - cross - - - normal - - - circle - - - circle - - - normal - - - normal - - - - X[3-O]OO[3-O][2-O] - - dadd4/c - - - - - 1 - - - normal - - - cross - - - circle - - - circle - - - normal - - - normal - - - - [2-O]XOO[3-O][5-O] - - dadd4/f# - - 4 @@ -38192,27 +37027,6 @@ ddim7/eb - - - 3 - - - cross - - - normal - - - cross - - 3 - - - X[4-O]---X;B6[2-4] - - db - - 2 @@ -38663,19 +37477,6 @@ db7 - - - 3 - - 1 - 3 - - - ------;B4[0-1];B6[2-5] - - db6/ab - - 7 @@ -39176,26 +37977,6 @@ db7sus4/ab - - - - - cross - - - normal - - - normal - - 4 - - - X[4-O][3-O]---;B4[3-5] - - db9 - - 2 @@ -39243,29 +38024,6 @@ db9b5 - - - - - cross - - - normal - - - normal - - - normal - - 3 - - - X[4-O]--[4-O][4-O];B3[2-3] - - db69() - - @@ -40988,27 +39746,6 @@ db/f - - - 3 - - - cross - - - normal - - - cross - - 3 - - - X[4-O]---X;B6[2-4] - - db - - @@ -42088,34 +40825,6 @@ dm7b5 - - - - - cross - - - cross - - - circle - - - normal - - - normal - - - normal - - - - XXO[2-O][1-O][3-O] - - dm7sus4 - - 2 @@ -42312,34 +41021,6 @@ dm7#9 - - - - - cross - - - cross - - - circle - - - normal - - - normal - - - normal - - - - XXO[3-O][1-O][1-O] - - dm7#9 - - @@ -43567,35 +42248,6 @@ dm(#7)/g - - - 4 - - - cross - - - normal - - - normal - - - normal - - - normal - - - circle - - - - X[5-O][7-O][7-O][6-O]O - - dm(add9) - - @@ -44012,35 +42664,6 @@ dm(sus)(add2) - - - 4 - - - cross - - - normal - - - normal - - - normal - - - cross - - - cross - - - - X[5-O][7-O][7-O]XX - - d5 - - @@ -44438,27 +43061,6 @@ d+/f# - - - 5 - - - cross - - - normal - - - cross - - 3 - - - X[6-O]---X;B8[2-4] - - d# - - @@ -46205,24 +44807,6 @@ d(add2sus4) - - - 4 - - - cross - - - normal - - 1 - - - X-[7-O]---;B5[1-5] - - d(add2sus4) - - @@ -46404,34 +44988,6 @@ dsus/g - - - - - circle - - - normal - - - normal - - - normal - - - circle - - - circle - - - - O[2-O][2-O][1-O]OO - - e - - @@ -47424,34 +45980,6 @@ e7add13 - - - - - circle - - - circle - - - normal - - - normal - - - normal - - - circle - - - - OO[2-O][1-O][3-O]O - - e7(add4) - - @@ -47758,34 +46286,6 @@ e7(no3) - - - - - circle - - - normal - - - circle - - - normal - - - circle - - - circle - - - - O[2-O]O[4-O]OO - - e7(no3) - - @@ -48151,30 +46651,6 @@ e7#5 - - - 5 - - - circle - - - normal - - - normal - - - normal - - 1 - - - O[7-O]-[7-O]-[8-O];B6[2-4] - - e7(b9#5) - - @@ -49660,27 +48136,6 @@ edim/bb - - - 5 - - - cross - - - normal - - - cross - - 3 - - - X[6-O]---X;B8[2-4] - - eb - - 5 @@ -50710,34 +49165,6 @@ eb7(no3) - - - - - cross - - - cross - - - normal - - - normal - - - normal - - - cross - - - - XX[1-O][3-O][2-O]X - - eb7(no3) - - 4 @@ -50997,30 +49424,6 @@ eb7#5 - - - 4 - - - cross - - - normal - - - normal - - - normal - - 1 - - - X[6-O]-[6-O]-[7-O];B5[2-4] - - eb7(b9#5) - - 1 @@ -51803,29 +50206,6 @@ eb(#9) - - - - - cross - - - cross - - - normal - - - normal - - 3 - - - XX[4-O]-[4-O]-;B3[3-5] - - eb(#9) - - @@ -51971,29 +50351,6 @@ ebadd9 - - - - - normal - - - cross - - - normal - - - cross - - 3 - - - [3-O]X--[4-O]X;B3[2-3] - - ebadd9/g - - 5 @@ -53133,30 +51490,6 @@ ebmaj13#11 - - - 4 - - - cross - - - normal - - - normal - - - normal - - 1 - - - X[6-O]--[6-O][6-O];B5[2-3] - - eb69 - - 5 @@ -53478,34 +51811,6 @@ ebmaj7#5/g - - - - - cross - - - cross - - - normal - - - normal - - - normal - - - cross - - - - XX[1-O][3-O][3-O]X - - ebmaj7(no3) - - 5 @@ -53673,30 +51978,6 @@ ebmaj9/bb - - - 5 - - - cross - - - normal - - - normal - - - normal - - 1 - - - X-[8-O][7-O][7-O]-;B6[1-5] - - ebm(#7) - - @@ -53720,34 +52001,6 @@ ebmaj9/g - - - - - cross - - - cross - - - normal - - - normal - - - normal - - - normal - - - - XX[4-O][3-O][4-O][1-O] - - ebm(add9) - - 5 @@ -54180,27 +52433,6 @@ eb/c - - - 5 - - - cross - - - normal - - - cross - - 3 - - - X[6-O]---X;B8[2-4] - - eb - - @@ -54579,24 +52811,6 @@ ebsus2 - - - 5 - - - normal - - - normal - - 1 - - - --[8-O][8-O]--;B6[0-5] - - ebadd2/bb - - 5 @@ -54895,30 +53109,6 @@ ebsus/c - - - 5 - - - cross - - - normal - - - normal - - - cross - - 3 - - - X[6-O]--[9-O]X;B8[2-3] - - ebsus - - @@ -55343,34 +53533,6 @@ em7 - - - - - circle - - - normal - - - circle - - - circle - - - normal - - - circle - - - - O[3-O]OO[1-O]O - - em7 - - 4 @@ -56839,34 +55001,6 @@ em(#7)/d# - - - - - circle - - - normal - - - normal - - - circle - - - circle - - - circle - - - - O[2-O][4-O]OOO - - em(add9) - - @@ -57329,34 +55463,6 @@ emsus2 - - - - - circle - - - normal - - - normal - - - cross - - - cross - - - cross - - - - O[2-O][2-O]XXX - - e5 - - @@ -57637,62 +55743,6 @@ e/bb - - - - - cross - - - cross - - - normal - - - normal - - - normal - - - circle - - - - XX[2-O][1-O][1-O]O - - e+ - - - - - - - cross - - - cross - - - circle - - - normal - - - normal - - - circle - - - - XXO[1-O][1-O]O - - e+7 - - @@ -57744,29 +55794,6 @@ e+/g - - - - - normal - - - cross - - - normal - - - cross - - 1 - - - [4-O]X[2-O]--X;B1[3-4] - - e+/g# - - 7 @@ -58440,26 +56467,6 @@ esus/g# - - - - - normal - - - normal - - - normal - - 1 - - - -[3-O][3-O][2-O]--;B1[0-5] - - f - - 2 @@ -59672,34 +57679,6 @@ f7(b9b5) - - - - - normal - - - cross - - - normal - - - normal - - - circle - - - cross - - - - [1-O]X[1-O][2-O]OX - - f7b5 - - 2 @@ -60300,30 +58279,6 @@ f7#9/a - - - 6 - - - cross - - - normal - - - normal - - - normal - - 3 - - - X[8-O][7-O][8-O]--;B9[4-5] - - f7(#9#5) - - @@ -60676,30 +58631,6 @@ f9#11 - - - 6 - - - cross - - - normal - - - normal - - - normal - - 1 - - - X[8-O]-[8-O][8-O]-;B7[2-5] - - f9b5 - - 6 @@ -61563,34 +59494,6 @@ fdim/d - - - - - circle - - - normal - - - normal - - - normal - - - circle - - - circle - - - - O[2-O][2-O][1-O]OO - - fb - - @@ -61759,34 +59662,6 @@ fb7 - - - - - circle - - - normal - - - normal - - - normal - - - normal - - - circle - - - - O[2-O][2-O][1-O][2-O]O - - fb6 - - @@ -61919,34 +59794,6 @@ fb/gb - - - - - circle - - - normal - - - normal - - - normal - - - circle - - - circle - - - - O[2-O][2-O][1-O]OO - - fb - - @@ -62449,26 +60296,6 @@ fm7b5/c - - - - - cross - - - cross - - - normal - - 4 - - - XX[3-O]---;B4[3-5] - - fm7b5 - - 3 @@ -62649,23 +60476,6 @@ fm7sus4 - - - - - cross - - - normal - - 1 - - - X-[3-O]---;B1[1-5] - - f7sus4/bb - - @@ -62949,34 +60759,6 @@ fm(add4) - - - - - cross - - - cross - - - normal - - - normal - - - normal - - - normal - - - - XX[3-O][2-O][3-O][3-O] - - f69 - - @@ -63618,29 +61400,6 @@ fm(#7)/ab - - - - - cross - - - cross - - - normal - - - normal - - 1 - - - XX[3-O]--[3-O];B1[3-4] - - fm(add9) - - @@ -63898,62 +61657,6 @@ fm(#5) - - - - - normal - - - normal - - - normal - - - cross - - - cross - - - cross - - - - [1-O][3-O][3-O]XXX - - f5 - - - - - - - cross - - - cross - - - normal - - - cross - - - normal - - - normal - - - - XX[1-O]X[1-O][1-O] - - f5/eb - - @@ -64418,26 +62121,6 @@ f+/g - - - - - normal - - - normal - - - normal - - 2 - - - -[4-O][4-O][3-O]--;B2[0-5] - - f# - - 8 @@ -64813,35 +62496,6 @@ f#5/d - - - 3 - - - circle - - - normal - - - normal - - - cross - - - cross - - - cross - - - - O[4-O][4-O]XXX - - f#5/e - - @@ -65611,27 +63265,6 @@ f#7#5/e - - - 1 - - - cross - - - cross - - - normal - - 2 - - - XX[2-O]---;B3[3-5] - - f#7(b9#5) - - 7 @@ -67238,34 +64871,6 @@ f#m7/a - - - - - cross - - - cross - - - normal - - - normal - - - normal - - - circle - - - - XX[4-O][4-O][2-O]O - - f#7sus4 - - @@ -67747,26 +65352,6 @@ f#m(#7) - - - - - normal - - - normal - - - normal - - 2 - - - -[4-O][4-O]--[4-O];B2[0-4] - - f#m(add9) - - @@ -68048,75 +65633,6 @@ f#m(sus2) - - - - - normal - - - normal - - - normal - - - cross - - - cross - - - cross - - - - [2-O][4-O][4-O]XXX - - f#5 - - - - - - - cross - - - normal - - - cross - - 2 - - - X-[4-O]X--;B2[1-5] - - f#5/b - - - - - 3 - - - cross - - - cross - - - cross - - 1 - - - ---XXX;B4[0-2] - - f#5/g# - - 3 @@ -69216,34 +66732,6 @@ fsus2no2add9/a - - - - - normal - - - normal - - - circle - - - circle - - - circle - - - normal - - - - [3-O][2-O]OOO[3-O] - - g - - @@ -71085,26 +68573,6 @@ g7#5 - - - - - cross - - - cross - - - normal - - 4 - - - XX[3-O]---;B4[3-5] - - g7(b9#5) - - @@ -71263,29 +68731,6 @@ g7#5/c - - - - - normal - - - cross - - - normal - - - normal - - 4 - - - [3-O]X[3-O][4-O]--;B4[4-5] - - g7(#9#5) - - 3 @@ -71372,26 +68817,6 @@ g7sus2 - - - - - normal - - - cross - - - circle - - 1 - - - [3-O]XO---;B1[3-5] - - g7b9sus4 - - @@ -71868,34 +69293,6 @@ g9sus4 - - - - - normal - - - cross - - - circle - - - normal - - - circle - - - normal - - - - [3-O]XO[2-O]O[3-O] - - gadd2 - - @@ -72008,34 +69405,6 @@ g(adda) - - - - - cross - - - cross - - - circle - - - normal - - - circle - - - normal - - - - XXO[2-O]O[3-O] - - gadd2/d - - @@ -72503,34 +69872,6 @@ gadd9/c - - - - - normal - - - cross - - - circle - - - normal - - - circle - - - normal - - - - [3-O]XO[3-O]O[3-O] - - g(#9) - - @@ -73008,26 +70349,6 @@ gdim/f - - - - - normal - - - normal - - - normal - - 2 - - - -[4-O][4-O][3-O]--;B2[0-5] - - gb - - @@ -74944,26 +72265,6 @@ gb/c - - - - - normal - - - normal - - - normal - - 2 - - - -[4-O][4-O][3-O]--;B2[0-5] - - gb - - @@ -77617,27 +74918,6 @@ gm(#7)/f# - - - 2 - - - normal - - - normal - - - normal - - 1 - - - -[5-O][5-O]--[5-O];B3[0-4] - - gm(add9) - - @@ -77886,34 +75166,6 @@ gm/gb - - - - - cross - - - cross - - - circle - - - normal - - - normal - - - normal - - - - XXO[3-O][4-O][3-O] - - gm(#5) - - @@ -77999,63 +75251,6 @@ gm(sus2) - - - 1 - - - cross - - - normal - - - normal - - - cross - - - cross - - - cross - - - - X[2-O][5-O]XXX - - g5/b - - - - - - - cross - - - normal - - - circle - - - circle - - - normal - - - normal - - - - X[3-O]OO[3-O][3-O] - - g5/c - - @@ -78625,27 +75820,6 @@ g+/d - - - 3 - - - normal - - - normal - - - normal - - 1 - - - -[6-O][6-O][5-O]--;B4[0-5] - - g# - - @@ -79117,27 +76291,6 @@ g#7#5/b# - - - 3 - - - normal - - - cross - - - normal - - 2 - - - [4-O]X[4-O]---;B5[3-5] - - g#7(b9#5) - - 9 diff --git a/src/engraving/dom/fret.cpp b/src/engraving/dom/fret.cpp index fc74f6b2d85dd..29ac318fdd6e2 100644 --- a/src/engraving/dom/fret.cpp +++ b/src/engraving/dom/fret.cpp @@ -96,12 +96,6 @@ struct HarmonyMapKey } }; -struct DiagramInfo { - String harmonyName; - String diagramXml; - String diagramPattern; -}; - static std::map > s_harmonyToDiagramMap; static std::unordered_map > s_diagramPatternToHarmoniesMap; @@ -244,16 +238,7 @@ Segment* FretDiagram::segment() const void FretDiagram::updateDiagram(const String& harmonyName) { - if (s_harmonyToDiagramMap.empty()) { - readHarmonyToDiagramFile(HARMONY_TO_DIAGRAM_FILE_PATH); - } - - String _harmonyName = harmonyName; - - NoteSpellingType spellingType = style().styleV(Sid::chordSymbolSpelling).value(); - HarmonyMapKey key = createHarmonyMapKey(_harmonyName, spellingType, score()->chordList()); - - std::vector availableDiagrams = muse::value(s_harmonyToDiagramMap, key); + std::vector availableDiagrams = patternsFromHarmony(harmonyName); if (availableDiagrams.empty()) { return; } @@ -272,6 +257,7 @@ void FretDiagram::updateDiagram(const String& harmonyName) read460::TRead::read(this, reader, ctx); triggerLayout(); + return; } //--------------------------------------------------------- @@ -761,21 +747,21 @@ void FretDiagram::applyDiagramPattern(FretDiagram* diagram, const String& patter } } -String FretDiagram::patternFromDiagram(const FretDiagram* diagram) +String FretDiagram::patternFromDiagram() const { - const int strings = diagram->strings(); - const int offset = diagram->fretOffset(); + const int diagramStrings = strings(); + const int offset = fretOffset(); StringList patternParts; - const DotMap& dotsMap = diagram->dots(); + const DotMap& dotsMap = dots(); - for (int i = 0; i < strings; ++i) { - const FretItem::Marker marker = diagram->marker(i); + for (int i = 0; i < diagramStrings; ++i) { + const FretItem::Marker fretMarker = marker(i); - if (marker.mtype == FretMarkerType::CROSS) { + if (fretMarker.mtype == FretMarkerType::CROSS) { patternParts.push_back(u"X"); continue; - } else if (marker.mtype == FretMarkerType::CIRCLE) { + } else if (fretMarker.mtype == FretMarkerType::CIRCLE) { patternParts.push_back(u"O"); continue; } @@ -825,16 +811,16 @@ String FretDiagram::patternFromDiagram(const FretDiagram* diagram) String pattern = patternParts.join(u""); - const BarreMap& barres = diagram->barres(); + const BarreMap& _barres = barres(); StringList barreParts; - for (const auto& [fret, b] : barres) { + for (const auto& [fret, b] : _barres) { if (!b.exists()) { continue; } int adjustedFret = fret + offset; int start = b.startString; - int end = (b.endString != -1) ? b.endString : strings - 1; + int end = (b.endString != -1) ? b.endString : diagramStrings - 1; barreParts.push_back(u'B' + String::number(adjustedFret) + u'[' + String::number(start) @@ -848,11 +834,28 @@ String FretDiagram::patternFromDiagram(const FretDiagram* diagram) return pattern; } -std::vector FretDiagram::patternHarmonies(const String& pattern) +std::vector FretDiagram::harmoniesFromPattern(const String& pattern) const { + if (s_diagramPatternToHarmoniesMap.empty()) { + readHarmonyToDiagramFile(HARMONY_TO_DIAGRAM_FILE_PATH); + } return muse::value(s_diagramPatternToHarmoniesMap, pattern); } +std::vector FretDiagram::patternsFromHarmony(const String& harmonyName) +{ + if (s_harmonyToDiagramMap.empty()) { + readHarmonyToDiagramFile(HARMONY_TO_DIAGRAM_FILE_PATH); + } + + String _harmonyName = harmonyName; + + NoteSpellingType spellingType = style().styleV(Sid::chordSymbolSpelling).value(); + HarmonyMapKey key = createHarmonyMapKey(_harmonyName, spellingType, score()->chordList()); + + return muse::value(s_harmonyToDiagramMap, key); +} + //--------------------------------------------------------- // clear //--------------------------------------------------------- @@ -1002,7 +1005,7 @@ void FretDiagram::add(EngravingItem* e) readHarmonyToDiagramFile(HARMONY_TO_DIAGRAM_FILE_PATH); } - String pattern = patternFromDiagram(this); + String pattern = patternFromDiagram(); if (!pattern.empty()) { std::vector matchedHarmonies = muse::value(s_diagramPatternToHarmoniesMap, pattern); if (!matchedHarmonies.empty()) { @@ -1415,7 +1418,7 @@ bool FretDiagram::isCustom(const String& harmonyNameForCompare) const return true; } - String currentPattern = patternFromDiagram(this); + String currentPattern = patternFromDiagram(); for (const DiagramInfo& diagram : availableDiagrams) { if (diagram.diagramPattern == currentPattern) { diff --git a/src/engraving/dom/fret.h b/src/engraving/dom/fret.h index 540592cae8bb7..4d97b2f778a9e 100644 --- a/src/engraving/dom/fret.h +++ b/src/engraving/dom/fret.h @@ -111,6 +111,12 @@ typedef std::map BarreMap; typedef std::map MarkerMap; typedef std::map > DotMap; +struct DiagramInfo { + String harmonyName; + String diagramXml; + String diagramPattern; +}; + //--------------------------------------------------------- // @@ FretDiagram /// Fretboard diagram @@ -137,8 +143,9 @@ class FretDiagram final : public EngravingItem Segment* segment() const; - static String patternFromDiagram(const FretDiagram* diagram); - static std::vector patternHarmonies(const String& pattern); + String patternFromDiagram() const; + std::vector harmoniesFromPattern(const String& pattern) const; + std::vector patternsFromHarmony(const String& harmonyName); void updateDiagram(const String& harmonyName); diff --git a/src/engraving/dom/mscore.cpp b/src/engraving/dom/mscore.cpp index 9eda218dfb2bd..85ea6db9c8e09 100644 --- a/src/engraving/dom/mscore.cpp +++ b/src/engraving/dom/mscore.cpp @@ -63,6 +63,7 @@ bool MScore::svgPrinting = false; extern void initDrumset(); MsError MScore::_error { MsError::MS_NO_ERROR }; +bool MScore::_errorIsWarning = false; void MScore::registerUiTypes() { @@ -118,6 +119,7 @@ std::string MScore::errorToString(MsError err) case MsError::CANNOT_REMOVE_KEY_SIG: return "CANNOT_REMOVE_KEY_SIG"; case MsError::CANNOT_JOIN_MEASURE_STAFFTYPE_CHANGE: return "CANNOT_JOIN_MEASURE_STAFFTYPE_CHANGE"; case MsError::CANNOT_REPEAT_SELECTION: return "CANNOT_REPEAT_SELECTION"; + case MsError::TRANSPOSE_NO_FRET_DIAGRAM: return "TRANSPOSE_NO_FRET_DIAGRAM"; } return {}; diff --git a/src/engraving/dom/mscore.h b/src/engraving/dom/mscore.h index 06b5ba6c152f9..2e5af59c24347 100644 --- a/src/engraving/dom/mscore.h +++ b/src/engraving/dom/mscore.h @@ -165,6 +165,7 @@ enum class MsError : unsigned char { CANNOT_REMOVE_KEY_SIG, CANNOT_JOIN_MEASURE_STAFFTYPE_CHANGE, CANNOT_REPEAT_SELECTION, + TRANSPOSE_NO_FRET_DIAGRAM, }; /// \cond PLUGIN_API \private \endcond @@ -187,6 +188,7 @@ class MScore public: static MsError _error; + static bool _errorIsWarning; static void registerUiTypes(); @@ -230,7 +232,7 @@ class MScore static double horizontalPageGapEven; static double horizontalPageGapOdd; - static void setError(MsError e) { _error = e; } + static void setError(MsError e, bool warning = false) { _error = e; _errorIsWarning = warning; } static std::string errorToString(MsError err); }; diff --git a/src/engraving/dom/pitchspelling.cpp b/src/engraving/dom/pitchspelling.cpp index ea01930566779..850ca2a11ebbc 100644 --- a/src/engraving/dom/pitchspelling.cpp +++ b/src/engraving/dom/pitchspelling.cpp @@ -1168,4 +1168,36 @@ Key clampKey(Key key, PreferSharpFlat prefer) return key; } + +int bestEnharmonicFit(const std::vector tpcs, Key key) +{ + int keyIndex = int(key) - int(Key::MIN); + if (keyIndex < 0 || keyIndex >= int(Key::NUM_OF)) { + return tpcs.front(); + } + + // Highest penalty in enharmonicSpelling available (100) + 1 + int bestPenalty = 101; + int closestTpc = Tpc::TPC_INVALID; + + for (int tpc : tpcs) { + if (tpc == Tpc::TPC_INVALID) { + continue; + } + + int lof = tpc - Tpc::TPC_MIN; + if (lof < 0 || lof >= 34) { + continue; + } + + int penalty = enharmonicSpelling[keyIndex][lof]; + + if (penalty < bestPenalty) { + bestPenalty = penalty; + closestTpc = tpc; + } + } + + return closestTpc; +} } diff --git a/src/engraving/dom/pitchspelling.h b/src/engraving/dom/pitchspelling.h index 94c888775282e..70c2993034929 100644 --- a/src/engraving/dom/pitchspelling.h +++ b/src/engraving/dom/pitchspelling.h @@ -104,6 +104,7 @@ extern int convertNote(const String& s, NoteSpellingType noteSpelling, NoteCaseT extern int clampEnharmonic(int tpc, bool useDoubleSharpsFlats = true); extern int clampPitch(int pitch, bool octaved = false); extern Key clampKey(Key key, PreferSharpFlat prefer = PreferSharpFlat::NONE); +extern int bestEnharmonicFit(const std::vector tpcs, Key key); //--------------------------------------------------------- // tpc2alter diff --git a/src/engraving/editing/cmd.cpp b/src/engraving/editing/cmd.cpp index b48d3f88ee94a..3aa4dfe734618 100644 --- a/src/engraving/editing/cmd.cpp +++ b/src/engraving/editing/cmd.cpp @@ -414,7 +414,7 @@ void Score::endCmd(bool rollback, bool layoutAllParts) return; } - if (readOnly() || MScore::_error != MsError::MS_NO_ERROR) { + if (readOnly() || (MScore::_error != MsError::MS_NO_ERROR && !MScore::_errorIsWarning)) { rollback = true; } diff --git a/src/engraving/editing/transpose.cpp b/src/engraving/editing/transpose.cpp index 88234becbae0f..cf709c06a0877 100644 --- a/src/engraving/editing/transpose.cpp +++ b/src/engraving/editing/transpose.cpp @@ -32,12 +32,14 @@ #include "../dom/keysig.h" #include "../dom/linkedobjects.h" #include "../dom/utils.h" +#include "../dom/fret.h" +#include "editing/editfretboarddiagram.h" #include "editing/editkeysig.h" using namespace mu::engraving; -bool Transpose::transpose(Score* score, TransposeMode mode, TransposeDirection direction, Key trKey, int transposeInterval, bool trKeys, - bool transposeChordNames, bool useDoubleSharpsFlats) +bool Transpose::transpose(Score* score, TransposeMode mode, TransposeDirection direction, Key trKey, int transposeInterval, + bool trKeys, bool transposeChordNames, bool useDoubleSharpsFlats) { const Selection& selection = score->selection(); bool result = true; @@ -101,7 +103,8 @@ bool Transpose::transpose(Score* score, TransposeMode mode, TransposeDirection d } if (selection.isList()) { - for (EngravingItem* e : selection.uniqueElements()) { + const std::list& selectionList = selection.uniqueElements(); + for (EngravingItem* e : selectionList) { if (!e->staff() || e->staff()->staffType(e->tick())->group() == StaffGroup::PERCUSSION) { continue; } @@ -114,7 +117,19 @@ bool Transpose::transpose(Score* score, TransposeMode mode, TransposeDirection d result = false; } } else if (e->isHarmony() && transposeChordNames) { - transposeHarmony(toHarmony(e), score, interval, mode, transposeInterval, trKeys, useDoubleSharpsFlats); + EngravingObject* parent = e->parent(); + if (parent && parent->isFretDiagram()) { + if (std::find(selectionList.begin(), selectionList.end(), parent) != selectionList.end()) { + continue; + } + + FretDiagram* fd = toFretDiagram(parent); + transposeFretDiagram(toFretDiagram(fd), score, interval, mode, transposeInterval, trKeys, useDoubleSharpsFlats); + } else { + transposeHarmony(toHarmony(e), score, interval, mode, transposeInterval, trKeys, useDoubleSharpsFlats); + } + } else if (e->isFretDiagram() && transposeChordNames) { + transposeFretDiagram(toFretDiagram(e), score, interval, mode, transposeInterval, trKeys, useDoubleSharpsFlats); } else if (e->isKeySig() && mode != TransposeMode::DIATONICALLY && trKeys) { // TODO: this currently is disabled in dialog // if we enabled it, then it will need work @@ -237,12 +252,21 @@ bool Transpose::transpose(Score* score, TransposeMode mode, TransposeDirection d } } } - if (transposeChordNames && score->selectionFilter().isFiltered(ElementsSelectionFilterTypes::CHORD_SYMBOL)) { + if (transposeChordNames + && (score->selectionFilter().isFiltered(ElementsSelectionFilterTypes::CHORD_SYMBOL) + || score->selectionFilter().isFiltered(ElementsSelectionFilterTypes::FRET_DIAGRAM))) { for (EngravingItem* e : segment->annotations()) { - if (!e->isHarmony() || (!muse::contains(tracks, e->track()))) { + if ((!e->isHarmony() && !e->isFretDiagram()) || (!muse::contains(tracks, e->track()))) { continue; } - transposeHarmony(toHarmony(e), score, interval, mode, transposeInterval, trKeys, useDoubleSharpsFlats); + + if (e->isHarmony()) { + transposeHarmony(toHarmony(e), score, interval, mode, transposeInterval, trKeys, useDoubleSharpsFlats); + } + + if (e->isFretDiagram()) { + transposeFretDiagram(toFretDiagram(e), score, interval, mode, transposeInterval, trKeys, useDoubleSharpsFlats); + } } } } @@ -354,7 +378,6 @@ void Transpose::transposeSemitone(Score* score, int step) if (!transpose(score, TransposeMode::BY_INTERVAL, dir, Key::C, 1, true, true, false)) { LOGD("Score::transposeSemitone: failed"); - // TODO: set error message } else { score->setSelectionChanged(true); } @@ -544,6 +567,105 @@ void Transpose::transposeHarmony(Harmony* harmony, Score* score, Interval interv undoTransposeHarmony(score, h, hInterval, useDoubleSharpsFlats); } } + score->rebuildFretBox(); +} + +void Transpose::transposeFretDiagram(FretDiagram* diagram, Score* score, Interval interval, TransposeMode mode, + int transposeInterval, bool trKeys, bool useDoubleSharpsFlats) +{ + Harmony* harmony = diagram->harmony(); + + if (harmony) { + transposeHarmony(harmony, score, interval, mode, transposeInterval, trKeys, useDoubleSharpsFlats); + + std::vector availableDiagrams = diagram->patternsFromHarmony(harmony->plainText()); + if (availableDiagrams.empty()) { + diagram->undoFretClear(); + MScore::setError(MsError::TRANSPOSE_NO_FRET_DIAGRAM, true); + return; + } + score->undo(new FretDataChange(diagram, harmony->plainText())); + + score->rebuildFretBox(); + return; + } + + // No chord symbol attached. Create harmony from diagram, transpose it, then use the new harmony to update the fret diagram + String pattern = diagram->patternFromDiagram(); + std::vector names = diagram->harmoniesFromPattern(pattern); + if (names.empty()) { + diagram->undoFretClear(); + MScore::setError(MsError::TRANSPOSE_NO_FRET_DIAGRAM, true); + return; + } + + Fraction tick = Fraction(0, 1); + Segment* seg = diagram->segment(); + if (seg) { + tick = seg->tick(); + } + Key key = !diagram->staff() ? Key::C : diagram->staff()->key(tick); + + String name = findBestEnharmonicFit(names, key, score->style()); + + diagram->setHarmony(name); + harmony = diagram->harmony(); + IF_ASSERT_FAILED(harmony) { + return; + } + + // Transpose harmony without undo + Interval kv = harmony->staff()->transpose(harmony->tick()); + Interval iv = harmony->part()->instrument(harmony->tick())->transpose(); + Interval hInterval((interval.diatonic - kv.diatonic + iv.diatonic), (interval.chromatic - kv.chromatic + iv.chromatic)); + + for (HarmonyInfo* info : harmony->chords()) { + if (mode == TransposeMode::DIATONICALLY) { + info->setRootTpc(Transpose::transposeTpcDiatonicByKey(info->rootTpc(), transposeInterval, key, trKeys, useDoubleSharpsFlats)); + info->setBassTpc(Transpose::transposeTpcDiatonicByKey(info->bassTpc(), transposeInterval, key, trKeys, useDoubleSharpsFlats)); + } else { + info->setRootTpc(Transpose::transposeTpc(info->rootTpc(), hInterval, useDoubleSharpsFlats)); + info->setBassTpc(Transpose::transposeTpc(info->bassTpc(), hInterval, useDoubleSharpsFlats)); + } + } + harmony->setXmlText(harmony->harmonyName()); + + std::vector availableDiagrams = diagram->patternsFromHarmony(harmony->plainText()); + if (availableDiagrams.empty()) { + diagram->undoFretClear(); + MScore::setError(MsError::TRANSPOSE_NO_FRET_DIAGRAM, true); + return; + } + score->undo(new FretDataChange(diagram, harmony->plainText())); + + diagram->remove(harmony); + delete harmony; + + score->rebuildFretBox(); + + return; +} + +String Transpose::findBestEnharmonicFit(const std::vector& notes, Key key, const MStyle& style) +{ + std::vector tpcs; + NoteSpellingType harmonySpelling = style.styleV(Sid::chordSymbolSpelling).value(); + NoteCaseType harmonyCase = NoteCaseType::AUTO; + size_t idx = 0; + for (const String& note : notes) { + int tpc = convertNote(note, harmonySpelling, harmonyCase, idx); + tpcs.push_back(tpc); + } + + int tpc = bestEnharmonicFit(tpcs, key); + + if (tpc == Tpc::TPC_INVALID) { + return notes.front(); + } + + String note = tpc2name(tpc, harmonySpelling, harmonyCase); + + return note; } //--------------------------------------------------------- @@ -661,7 +783,7 @@ void TransposeHarmonyDiatonic::flip(EditData*) m_harmony->realizedHarmony().setDirty(true); // harmony should be re-realized after transposition Fraction tick = Fraction(0, 1); - Segment* seg = toSegment(m_harmony->findAncestor(ElementType::SEGMENT)); + Segment* seg = m_harmony->getParentSeg(); if (seg) { tick = seg->tick(); } diff --git a/src/engraving/editing/transpose.h b/src/engraving/editing/transpose.h index 1bbdf7ce6fc29..b50bf03c685b0 100644 --- a/src/engraving/editing/transpose.h +++ b/src/engraving/editing/transpose.h @@ -55,6 +55,10 @@ class Transpose Interval interval); static void transposeHarmony(Harmony* harmony, Score* score, Interval interval, TransposeMode mode, int transposeInterval, bool trKeys, bool useDoubleSharpsFlats); + static void transposeFretDiagram(FretDiagram* diagram, Score* score, Interval interval, TransposeMode mode, int transposeInterval, + bool trKeys, bool useDoubleSharpsFlats); + + static String findBestEnharmonicFit(const std::vector& notes, Key key, const MStyle& style); }; class TransposeHarmony : public UndoCommand @@ -94,4 +98,11 @@ class TransposeHarmonyDiatonic : public UndoCommand UNDO_NAME("TransposeHarmonyDiatonic") UNDO_CHANGED_OBJECTS({ m_harmony }) }; + +// class TransposeFretDiagram : public UndoCommand +// { +// OBJECT_ALLOCATOR(engraving, TransposeFretDiagram) + +// FretDiagram* m_fretDiagram = nullptr; +// }; } diff --git a/src/engraving/rw/read460/tread.cpp b/src/engraving/rw/read460/tread.cpp index 19e54e070d902..45d2af0b89c85 100644 --- a/src/engraving/rw/read460/tread.cpp +++ b/src/engraving/rw/read460/tread.cpp @@ -798,20 +798,10 @@ void TRead::read(Expression* expr, XmlReader& xml, ReadContext& ctx) void TRead::read(FretDiagram* d, XmlReader& e, ReadContext& ctx) { - // Read the old format first - bool hasBarre = false; - bool haveReadNew = false; - while (e.readNextStartElement()) { const AsciiStringView tag(e.name()); - // Check for new format fret diagram - if (haveReadNew) { - e.skipCurrentElement(); - continue; - } if (tag == "fretDiagram") { - // Read new while (e.readNextStartElement()) { const AsciiStringView tag2(e.name()); @@ -843,38 +833,16 @@ void TRead::read(FretDiagram* d, XmlReader& e, ReadContext& ctx) e.unknown(); } } - haveReadNew = true; - } - // Check for new properties - else if (tag == "showNut") { + } else if (tag == "showNut") { TRead::readProperty(d, e, ctx, Pid::FRET_NUT); } else if (tag == "orientation") { TRead::readProperty(d, e, ctx, Pid::ORIENTATION); - } - // Then read the rest if there is no new format diagram (compatibility read) - else if (tag == "strings") { + } else if (tag == "strings") { TRead::readProperty(d, e, ctx, Pid::FRET_STRINGS); } else if (tag == "frets") { TRead::readProperty(d, e, ctx, Pid::FRET_FRETS); } else if (tag == "fretOffset") { TRead::readProperty(d, e, ctx, Pid::FRET_OFFSET); - } else if (tag == "string") { - int no = e.intAttribute("no"); - while (e.readNextStartElement()) { - const AsciiStringView t(e.name()); - if (t == "dot") { - d->setDot(no, e.readInt()); - } else if (t == "marker") { - d->setMarker(no, Char(e.readInt()) == u'X' ? FretMarkerType::CROSS : FretMarkerType::CIRCLE); - } - /*else if (t == "fingering") - setFingering(no, e.readInt());*/ - else { - e.unknown(); - } - } - } else if (tag == "barre") { - hasBarre = e.readBool(); } else if (tag == "mag") { TRead::readProperty(d, e, ctx, Pid::MAG); } else if (tag == "Harmony") { @@ -888,18 +856,6 @@ void TRead::read(FretDiagram* d, XmlReader& e, ReadContext& ctx) e.unknown(); } } - - // Old handling of barres - if (hasBarre) { - for (int s = 0; s < d->strings(); ++s) { - for (auto& dot : d->dot(s)) { - if (dot.exists()) { - d->setBarre(s, -1, dot.fret); - return; - } - } - } - } } void TRead::read(TremoloBar* b, XmlReader& e, ReadContext& ctx) diff --git a/src/engraving/rw/write/twrite.cpp b/src/engraving/rw/write/twrite.cpp index b1594a4eeb4c2..d819707291012 100644 --- a/src/engraving/rw/write/twrite.cpp +++ b/src/engraving/rw/write/twrite.cpp @@ -1420,14 +1420,8 @@ void TWrite::write(const FretDiagram* item, XmlWriter& xml, WriteContext& ctx) write(item->harmony(), xml, ctx); } - // Lowercase f indicates new writing format - // TODO: in the next score format version (4) use only write new + props and discard - // the compatibility writing. xml.startElement("fretDiagram"); - // writeNew (if want to make changes, do it here rather than in writeOld) { - // This is the important one for 3.1+ - //--------------------------------------------------------- for (int i = 0; i < item->strings(); ++i) { FretItem::Marker m = item->marker(i); std::vector allDots = item->dot(i); @@ -1474,97 +1468,6 @@ void TWrite::write(const FretDiagram* item, XmlWriter& xml, WriteContext& ctx) } } xml.endElement(); - - // writeOld (for compatibility only) - { - int lowestDotFret = -1; - int furthestLeftLowestDot = -1; - - // Do some checks for details needed for checking whether to add barres - for (int i = 0; i < item->strings(); ++i) { - std::vector allDots = item->dot(i); - - bool dotExists = false; - for (auto const& d : allDots) { - if (d.exists()) { - dotExists = true; - break; - } - } - - if (!dotExists) { - continue; - } - - for (auto const& d : allDots) { - if (d.exists()) { - if (d.fret < lowestDotFret || lowestDotFret == -1) { - lowestDotFret = d.fret; - furthestLeftLowestDot = i; - } else if (d.fret == lowestDotFret && (i < furthestLeftLowestDot || furthestLeftLowestDot == -1)) { - furthestLeftLowestDot = i; - } - } - } - } - - // The old system writes a barre as a bool, which causes no problems in any way, not at all. - // So, only write that if the barre is on the lowest fret with a dot, - // and there are no other dots on its fret, and it goes all the way to the right. - int barreStartString = -1; - int barreFret = -1; - for (auto const& i : item->barres()) { - FretItem::Barre b = i.second; - if (b.exists()) { - int fret = i.first; - if (fret <= lowestDotFret && b.endString == -1 && !(fret == lowestDotFret && b.startString > furthestLeftLowestDot)) { - barreStartString = b.startString; - barreFret = fret; - break; - } - } - } - - for (int i = 0; i < item->strings(); ++i) { - FretItem::Marker m = item->marker(i); - std::vector allDots = item->dot(i); - - bool dotExists = false; - for (auto const& d : allDots) { - if (d.exists()) { - dotExists = true; - break; - } - } - - if (!dotExists && !m.exists() && i != barreStartString) { - continue; - } - - xml.startElement("string", { { "no", i } }); - - if (m.exists()) { - xml.tag("marker", FretItem::markerToChar(m.mtype).unicode()); - } - - for (auto const& d : allDots) { - if (d.exists() && !(i == barreStartString && d.fret == barreFret)) { - xml.tag("dot", d.fret); - } - } - - // Add dot so barre will display in pre-3.1 - if (barreStartString == i) { - xml.tag("dot", barreFret); - } - - xml.endElement(); - } - - if (barreFret > 0) { - xml.tag("barre", 1); - } - } xml.endElement(); } diff --git a/src/engraving/tests/fretdiagram_tests.cpp b/src/engraving/tests/fretdiagram_tests.cpp index ede9c4506e77e..9850458d1741c 100644 --- a/src/engraving/tests/fretdiagram_tests.cpp +++ b/src/engraving/tests/fretdiagram_tests.cpp @@ -55,7 +55,7 @@ void Engraving_FretDiagramTests::testChordSymToFretDiagram(MasterScore* score) FretDiagram* diagram = Factory::createFretDiagram(score->dummy()->segment()); EXPECT_TRUE(diagram); diagram->updateDiagram(harmony->harmonyName()); - String pattern = FretDiagram::patternFromDiagram(diagram); + String pattern = diagram->patternFromDiagram(); EXPECT_EQ(pattern, FRET_PATTERN_REF); measure = measure->nextMeasure(); delete diagram; diff --git a/src/engraving/tests/selectionfilter_data/selectionfilter11-base-ref.xml b/src/engraving/tests/selectionfilter_data/selectionfilter11-base-ref.xml index efdc1069880e3..1c9f83f5fe633 100644 --- a/src/engraving/tests/selectionfilter_data/selectionfilter11-base-ref.xml +++ b/src/engraving/tests/selectionfilter_data/selectionfilter11-base-ref.xml @@ -25,24 +25,6 @@ normal - - 88 - - - 3 - - - 2 - - - 79 - - - 79 - - - 1 - quarter diff --git a/src/engraving/tests/transpose_data/undoDiatonicTransposeFretDiagrams.mscx b/src/engraving/tests/transpose_data/undoDiatonicTransposeFretDiagrams.mscx new file mode 100755 index 0000000000000..75fceb6592c88 --- /dev/null +++ b/src/engraving/tests/transpose_data/undoDiatonicTransposeFretDiagrams.mscx @@ -0,0 +1,457 @@ + + + 4.7.0 + + + 2kOmbTnFT2K_1Ffu11EvJBD + 480 + 1 + 1 + 1 + 0 + 1 + + + Composer / arranger + + 2025-03-10 + + + + Apple Macintosh + + + Subtitle + + + Untitled score + + Orchestra + + Flutes + +
+ flutes + oboes + clarinets + saxophones + bassoons + +
+
+ horns + trumpets + cornets + flugelhorns + trombones + tubas + +
+
+ timpani +
+
+ keyboard-percussion + + drums + unpitched-metal-percussion + unpitched-wooden-percussion + other-percussion + +
+ keyboards + harps + organs + synths + + +
+ voices + voice-groups +
+
+ orchestral-strings +
+
+ + + xVSmWcXHRCO_x7nzdLq+W7E + + stdNormal + + + Flute + + Flute + Fl. + Flute + 59 + 98 + 60 + 93 + wind.flutes.flute + + + Fluid + + + + + + IbIByf9V45G_n1FatmQDVWL + + + EXMLx/3R3qJ_c7cWKj13N+H + 0 + + + J0Rmy10EtIN_1Pc/Cz+r81 + 4 + 4 + + + R0u21zOyPpB_0EP+/0xPk1G + + + cross + + + normal + + + normal + + + circle + + + normal + + + circle + + + + 88 + + + 3 + + + 2 + + + 79 + + + 1 + + + 79 + + + + HzvSPszx2NI_lxchTRPN6iO + half + + 9v0GXubQFuD_28VjANAW6QP + 67 + 15 + + + + -1/4 + + + OFE3RL+QFb_JM52a+emRcF + + + cross + + + cross + + + circle + + + normal + + + normal + + + normal + + + + 88 + + + 88 + + + 79 + + + 2 + + + 3 + + + 2 + + + + 1/4 + + + Dy2Y5gbCKWJ_WaQEnsLiXGC + + + circle + + + normal + + + normal + + + normal + + + circle + + + circle + + + + 79 + + + 2 + + + 2 + + + 1 + + + 79 + + + 79 + + + + lNT7H0p9/lF_SLiwqKlD1UD + half + + 9i1YoWhQ61M_QDmwLNAB6eJ + 67 + 15 + + + + -1/4 + + + RUhArZbVQ2I_EBobFVVqu7K + + + normal + + + normal + + + normal + + 1 + + + 3 + + + 3 + + + 2 + + + + + + ZuKAVzo7TK_s158BJvRsNN + + + kzgHUWGvXwC_+rObEvI4GlP + + + cross + + + normal + + + normal + + + circle + + + normal + + + circle + + + + 88 + + + 3 + + + 2 + + + 79 + + + 1 + + + 79 + + + + /Sa4VlGGHaH_eEnHBeShepD + half + + 3Hmm8a/YfmO_gfnHMV576XE + 67 + 15 + + + + -1/4 + + + TpkrtNUCNJG_Q9OsSNc1HbI + + + cross + + + cross + + + circle + + + normal + + + normal + + + normal + + + + 88 + + + 88 + + + 79 + + + 2 + + + 3 + + + 2 + + + + 1/4 + + + 3 + VHDCXjTjSiH_r25IkqW4hWO + + + normal + + + normal + + + normal + + 1 + + + 1 + + + 3 + + + 3 + + + 2 + + 1 + + + weLPdp/TOPE_HveOwApPWWC + half + + fHTzGDb6kWP_AT+2b8DnxsG + 67 + 15 + + + + -1/4 + + + CokpN1M4pqC_loY45KU7o8E + + + normal + + + normal + + + normal + + 2 + + + 4 + + + 4 + + + 3 + + + + + +
+
diff --git a/src/engraving/tests/transpose_data/undoDiatonicTransposeFretDiagrams01-ref.mscx b/src/engraving/tests/transpose_data/undoDiatonicTransposeFretDiagrams01-ref.mscx new file mode 100644 index 0000000000000..f21b2a158164f --- /dev/null +++ b/src/engraving/tests/transpose_data/undoDiatonicTransposeFretDiagrams01-ref.mscx @@ -0,0 +1,337 @@ + + + + 2kOmbTnFT2K_1Ffu11EvJBD + 480 + + 1 + 1 + 1 + 0 + 1 + + + Composer / arranger + + + + + + + Subtitle + + + Untitled score + + Orchestra + + Flutes + +
+ flutes + oboes + clarinets + saxophones + bassoons + +
+
+ horns + trumpets + cornets + flugelhorns + trombones + tubas + +
+
+ timpani +
+
+ keyboard-percussion + + drums + unpitched-metal-percussion + unpitched-wooden-percussion + other-percussion + +
+ keyboards + harps + organs + synths + + +
+ voices + voice-groups +
+
+ orchestral-strings +
+
+ + + xVSmWcXHRCO_x7nzdLq+W7E + + stdNormal + + + Flute + + Flute + Fl. + Flute + 59 + 98 + 60 + 93 + wind.flutes.flute + + + + + + + + IbIByf9V45G_n1FatmQDVWL + + + EXMLx/3R3qJ_c7cWKj13N+H + 2 + + + J0Rmy10EtIN_1Pc/Cz+r81 + 4 + 4 + + + R0u21zOyPpB_0EP+/0xPk1G + + + cross + + + cross + + + circle + + + normal + + + normal + + + normal + + + + + HzvSPszx2NI_lxchTRPN6iO + half + + 9v0GXubQFuD_28VjANAW6QP + 69 + 17 + + + + -1/4 + + + OFE3RL+QFb_JM52a+emRcF + + + circle + + + normal + + + normal + + + normal + + + circle + + + circle + + + + + 1/4 + + + Dy2Y5gbCKWJ_WaQEnsLiXGC + + + normal + + + normal + + + normal + + 2 + + + + lNT7H0p9/lF_SLiwqKlD1UD + half + + 9i1YoWhQ61M_QDmwLNAB6eJ + 69 + 17 + + + + -1/4 + + + RUhArZbVQ2I_EBobFVVqu7K + + + normal + + + normal + + + circle + + + circle + + + circle + + + normal + + + + + + + ZuKAVzo7TK_s158BJvRsNN + + + kzgHUWGvXwC_+rObEvI4GlP + + + cross + + + cross + + + circle + + + normal + + + normal + + + normal + + + + + /Sa4VlGGHaH_eEnHBeShepD + half + + 3Hmm8a/YfmO_gfnHMV576XE + 69 + 17 + + + + -1/4 + + + TpkrtNUCNJG_Q9OsSNc1HbI + + + circle + + + normal + + + normal + + + normal + + + circle + + + circle + + + + + 1/4 + + + VHDCXjTjSiH_r25IkqW4hWO + + + cross + + + normal + + + normal + + + normal + + 1 + + + + weLPdp/TOPE_HveOwApPWWC + half + + fHTzGDb6kWP_AT+2b8DnxsG + 69 + 17 + + + + -1/4 + + + 3 + CokpN1M4pqC_loY45KU7o8E + + + normal + + + normal + + + normal + + 1 + + + + + +
+
diff --git a/src/engraving/tests/transpose_data/undoDiatonicTransposeFretDiagrams02-ref.mscx b/src/engraving/tests/transpose_data/undoDiatonicTransposeFretDiagrams02-ref.mscx new file mode 100644 index 0000000000000..1de05c02c68a3 --- /dev/null +++ b/src/engraving/tests/transpose_data/undoDiatonicTransposeFretDiagrams02-ref.mscx @@ -0,0 +1,334 @@ + + + + 2kOmbTnFT2K_1Ffu11EvJBD + 480 + + 1 + 1 + 1 + 0 + 1 + + + Composer / arranger + + + + + + + Subtitle + + + Untitled score + + Orchestra + + Flutes + +
+ flutes + oboes + clarinets + saxophones + bassoons + +
+
+ horns + trumpets + cornets + flugelhorns + trombones + tubas + +
+
+ timpani +
+
+ keyboard-percussion + + drums + unpitched-metal-percussion + unpitched-wooden-percussion + other-percussion + +
+ keyboards + harps + organs + synths + + +
+ voices + voice-groups +
+
+ orchestral-strings +
+
+ + + xVSmWcXHRCO_x7nzdLq+W7E + + stdNormal + + + Flute + + Flute + Fl. + Flute + 59 + 98 + 60 + 93 + wind.flutes.flute + + + + + + + + IbIByf9V45G_n1FatmQDVWL + + + EXMLx/3R3qJ_c7cWKj13N+H + 0 + + + J0Rmy10EtIN_1Pc/Cz+r81 + 4 + 4 + + + R0u21zOyPpB_0EP+/0xPk1G + + + cross + + + normal + + + normal + + + circle + + + normal + + + circle + + + + + HzvSPszx2NI_lxchTRPN6iO + half + + 9v0GXubQFuD_28VjANAW6QP + 67 + 15 + + + + -1/4 + + + OFE3RL+QFb_JM52a+emRcF + + + cross + + + cross + + + circle + + + normal + + + normal + + + normal + + + + + 1/4 + + + Dy2Y5gbCKWJ_WaQEnsLiXGC + + + circle + + + normal + + + normal + + + normal + + + circle + + + circle + + + + + lNT7H0p9/lF_SLiwqKlD1UD + half + + 9i1YoWhQ61M_QDmwLNAB6eJ + 67 + 15 + + + + -1/4 + + + RUhArZbVQ2I_EBobFVVqu7K + + + normal + + + normal + + + normal + + 1 + + + + + + ZuKAVzo7TK_s158BJvRsNN + + + kzgHUWGvXwC_+rObEvI4GlP + + + cross + + + normal + + + normal + + + circle + + + normal + + + circle + + + + + /Sa4VlGGHaH_eEnHBeShepD + half + + 3Hmm8a/YfmO_gfnHMV576XE + 67 + 15 + + + + -1/4 + + + TpkrtNUCNJG_Q9OsSNc1HbI + + + cross + + + cross + + + circle + + + normal + + + normal + + + normal + + + + + 1/4 + + + 3 + VHDCXjTjSiH_r25IkqW4hWO + + + normal + + + normal + + + normal + + 1 + + + + weLPdp/TOPE_HveOwApPWWC + half + + fHTzGDb6kWP_AT+2b8DnxsG + 67 + 15 + + + + -1/4 + + + CokpN1M4pqC_loY45KU7o8E + + + normal + + + normal + + + normal + + 2 + + + + + +
+
diff --git a/src/engraving/tests/transpose_data/undoDiatonicTransposeFretDiagramsChordSymbols.mscx b/src/engraving/tests/transpose_data/undoDiatonicTransposeFretDiagramsChordSymbols.mscx new file mode 100755 index 0000000000000..a8e7c7346e5ac --- /dev/null +++ b/src/engraving/tests/transpose_data/undoDiatonicTransposeFretDiagramsChordSymbols.mscx @@ -0,0 +1,509 @@ + + + 4.7.0 + + + 2kOmbTnFT2K_1Ffu11EvJBD + 480 + 1 + 1 + 1 + 0 + 1 + + + Composer / arranger + + 2025-03-10 + + + + Apple Macintosh + + + Subtitle + + + Untitled score + + Orchestra + + Flutes + +
+ flutes + oboes + clarinets + saxophones + bassoons + +
+
+ horns + trumpets + cornets + flugelhorns + trombones + tubas + +
+
+ timpani +
+
+ keyboard-percussion + + drums + unpitched-metal-percussion + unpitched-wooden-percussion + other-percussion + +
+ keyboards + harps + organs + synths + + +
+ voices + voice-groups +
+
+ orchestral-strings +
+
+ + + xVSmWcXHRCO_x7nzdLq+W7E + + stdNormal + + + Flute + + Flute + Fl. + Flute + 59 + 98 + 60 + 93 + wind.flutes.flute + + + Fluid + + + + Fluid + + + + + + IbIByf9V45G_n1FatmQDVWL + + + EXMLx/3R3qJ_c7cWKj13N+H + 0 + + + J0Rmy10EtIN_1Pc/Cz+r81 + 4 + 4 + + + R0u21zOyPpB_0EP+/0xPk1G + + + 14 + + i6JddkooT+K_VCqDglUeMRM + + + + cross + + + normal + + + normal + + + circle + + + normal + + + circle + + + + 88 + + + 3 + + + 2 + + + 79 + + + 1 + + + 79 + + + + HzvSPszx2NI_lxchTRPN6iO + half + + 9v0GXubQFuD_28VjANAW6QP + 67 + 15 + + + + -1/4 + + + OFE3RL+QFb_JM52a+emRcF + + + 16 + + SYmKSDioSgJ_3nRLTs3666 + + + + cross + + + cross + + + circle + + + normal + + + normal + + + normal + + + + 88 + + + 88 + + + 79 + + + 2 + + + 3 + + + 2 + + + + 1/4 + + + Dy2Y5gbCKWJ_WaQEnsLiXGC + + + 18 + + mPZO1MniRBK_DR0+zmVAE6N + + + + circle + + + normal + + + normal + + + normal + + + circle + + + circle + + + + 79 + + + 2 + + + 2 + + + 1 + + + 79 + + + 79 + + + + lNT7H0p9/lF_SLiwqKlD1UD + half + + 9i1YoWhQ61M_QDmwLNAB6eJ + 67 + 15 + + + + -1/4 + + + RUhArZbVQ2I_EBobFVVqu7K + + + 13 + + saAjlrm1EO_FhNXvmfkddI + + + + normal + + + normal + + + normal + + 1 + + + 3 + + + 3 + + + 2 + + + + + + ZuKAVzo7TK_s158BJvRsNN + + + kzgHUWGvXwC_+rObEvI4GlP + + + 14 + + dvEMaLQcibK_SEWH/F36llB + + + + cross + + + normal + + + normal + + + circle + + + normal + + + circle + + + + 88 + + + 3 + + + 2 + + + 79 + + + 1 + + + 79 + + + + /Sa4VlGGHaH_eEnHBeShepD + half + + 3Hmm8a/YfmO_gfnHMV576XE + 67 + 15 + + + + -1/4 + + + TpkrtNUCNJG_Q9OsSNc1HbI + + + 16 + + Ok0ECFxRvuI_2P4foxuqZq + + + + cross + + + cross + + + circle + + + normal + + + normal + + + normal + + + + 88 + + + 88 + + + 79 + + + 2 + + + 3 + + + 2 + + + + 1/4 + + + 3 + VHDCXjTjSiH_r25IkqW4hWO + + + 10 + + wLPL51aE/ZK_WYJ1s3hVxsG + + + + normal + + + normal + + + normal + + 1 + + + 1 + + + 3 + + + 3 + + + 2 + + 1 + + + weLPdp/TOPE_HveOwApPWWC + half + + fHTzGDb6kWP_AT+2b8DnxsG + 67 + 15 + + + + -1/4 + + + CokpN1M4pqC_loY45KU7o8E + + + 20 + + DUSTglH1glB_HnfKXBpuT4K + + + + normal + + + normal + + + normal + + 2 + + + 4 + + + 4 + + + 3 + + + + + +
+
diff --git a/src/engraving/tests/transpose_data/undoDiatonicTransposeFretDiagramsChordSymbols01-ref.mscx b/src/engraving/tests/transpose_data/undoDiatonicTransposeFretDiagramsChordSymbols01-ref.mscx new file mode 100644 index 0000000000000..cb8b79b85550f --- /dev/null +++ b/src/engraving/tests/transpose_data/undoDiatonicTransposeFretDiagramsChordSymbols01-ref.mscx @@ -0,0 +1,388 @@ + + + + 2kOmbTnFT2K_1Ffu11EvJBD + 480 + + 1 + 1 + 1 + 0 + 1 + + + Composer / arranger + + + + + + + Subtitle + + + Untitled score + + Orchestra + + Flutes + +
+ flutes + oboes + clarinets + saxophones + bassoons + +
+
+ horns + trumpets + cornets + flugelhorns + trombones + tubas + +
+
+ timpani +
+
+ keyboard-percussion + + drums + unpitched-metal-percussion + unpitched-wooden-percussion + other-percussion + +
+ keyboards + harps + organs + synths + + +
+ voices + voice-groups +
+
+ orchestral-strings +
+
+ + + xVSmWcXHRCO_x7nzdLq+W7E + + stdNormal + + + Flute + + Flute + Fl. + Flute + 59 + 98 + 60 + 93 + wind.flutes.flute + + + + + + + + + + + IbIByf9V45G_n1FatmQDVWL + + + EXMLx/3R3qJ_c7cWKj13N+H + 2 + + + J0Rmy10EtIN_1Pc/Cz+r81 + 4 + 4 + + + R0u21zOyPpB_0EP+/0xPk1G + + + 16 + + i6JddkooT+K_VCqDglUeMRM + + + + cross + + + cross + + + circle + + + normal + + + normal + + + normal + + + + + HzvSPszx2NI_lxchTRPN6iO + half + + 9v0GXubQFuD_28VjANAW6QP + 69 + 17 + + + + -1/4 + + + OFE3RL+QFb_JM52a+emRcF + + + 18 + + SYmKSDioSgJ_3nRLTs3666 + + + + circle + + + normal + + + normal + + + normal + + + circle + + + circle + + + + + 1/4 + + + Dy2Y5gbCKWJ_WaQEnsLiXGC + + + 20 + + mPZO1MniRBK_DR0+zmVAE6N + + + + normal + + + normal + + + normal + + 2 + + + + lNT7H0p9/lF_SLiwqKlD1UD + half + + 9i1YoWhQ61M_QDmwLNAB6eJ + 69 + 17 + + + + -1/4 + + + RUhArZbVQ2I_EBobFVVqu7K + + + 15 + + saAjlrm1EO_FhNXvmfkddI + + + + normal + + + normal + + + circle + + + circle + + + circle + + + normal + + + + + + + ZuKAVzo7TK_s158BJvRsNN + + + kzgHUWGvXwC_+rObEvI4GlP + + + 16 + + dvEMaLQcibK_SEWH/F36llB + + + + cross + + + cross + + + circle + + + normal + + + normal + + + normal + + + + + /Sa4VlGGHaH_eEnHBeShepD + half + + 3Hmm8a/YfmO_gfnHMV576XE + 69 + 17 + + + + -1/4 + + + TpkrtNUCNJG_Q9OsSNc1HbI + + + 18 + + Ok0ECFxRvuI_2P4foxuqZq + + + + circle + + + normal + + + normal + + + normal + + + circle + + + circle + + + + + 1/4 + + + VHDCXjTjSiH_r25IkqW4hWO + + + 12 + + wLPL51aE/ZK_WYJ1s3hVxsG + + + + cross + + + normal + + + normal + + + normal + + 1 + + + + weLPdp/TOPE_HveOwApPWWC + half + + fHTzGDb6kWP_AT+2b8DnxsG + 69 + 17 + + + + -1/4 + + + 3 + CokpN1M4pqC_loY45KU7o8E + + + 22 + + DUSTglH1glB_HnfKXBpuT4K + + + + normal + + + normal + + + normal + + 1 + + + + + +
+
diff --git a/src/engraving/tests/transpose_data/undoDiatonicTransposeFretDiagramsChordSymbols02-ref.mscx b/src/engraving/tests/transpose_data/undoDiatonicTransposeFretDiagramsChordSymbols02-ref.mscx new file mode 100644 index 0000000000000..352ac617db1e0 --- /dev/null +++ b/src/engraving/tests/transpose_data/undoDiatonicTransposeFretDiagramsChordSymbols02-ref.mscx @@ -0,0 +1,385 @@ + + + + 2kOmbTnFT2K_1Ffu11EvJBD + 480 + + 1 + 1 + 1 + 0 + 1 + + + Composer / arranger + + + + + + + Subtitle + + + Untitled score + + Orchestra + + Flutes + +
+ flutes + oboes + clarinets + saxophones + bassoons + +
+
+ horns + trumpets + cornets + flugelhorns + trombones + tubas + +
+
+ timpani +
+
+ keyboard-percussion + + drums + unpitched-metal-percussion + unpitched-wooden-percussion + other-percussion + +
+ keyboards + harps + organs + synths + + +
+ voices + voice-groups +
+
+ orchestral-strings +
+
+ + + xVSmWcXHRCO_x7nzdLq+W7E + + stdNormal + + + Flute + + Flute + Fl. + Flute + 59 + 98 + 60 + 93 + wind.flutes.flute + + + + + + + + + + + IbIByf9V45G_n1FatmQDVWL + + + EXMLx/3R3qJ_c7cWKj13N+H + 0 + + + J0Rmy10EtIN_1Pc/Cz+r81 + 4 + 4 + + + R0u21zOyPpB_0EP+/0xPk1G + + + 14 + + i6JddkooT+K_VCqDglUeMRM + + + + cross + + + normal + + + normal + + + circle + + + normal + + + circle + + + + + HzvSPszx2NI_lxchTRPN6iO + half + + 9v0GXubQFuD_28VjANAW6QP + 67 + 15 + + + + -1/4 + + + OFE3RL+QFb_JM52a+emRcF + + + 16 + + SYmKSDioSgJ_3nRLTs3666 + + + + cross + + + cross + + + circle + + + normal + + + normal + + + normal + + + + + 1/4 + + + Dy2Y5gbCKWJ_WaQEnsLiXGC + + + 18 + + mPZO1MniRBK_DR0+zmVAE6N + + + + circle + + + normal + + + normal + + + normal + + + circle + + + circle + + + + + lNT7H0p9/lF_SLiwqKlD1UD + half + + 9i1YoWhQ61M_QDmwLNAB6eJ + 67 + 15 + + + + -1/4 + + + RUhArZbVQ2I_EBobFVVqu7K + + + 13 + + saAjlrm1EO_FhNXvmfkddI + + + + normal + + + normal + + + normal + + 1 + + + + + + ZuKAVzo7TK_s158BJvRsNN + + + kzgHUWGvXwC_+rObEvI4GlP + + + 14 + + dvEMaLQcibK_SEWH/F36llB + + + + cross + + + normal + + + normal + + + circle + + + normal + + + circle + + + + + /Sa4VlGGHaH_eEnHBeShepD + half + + 3Hmm8a/YfmO_gfnHMV576XE + 67 + 15 + + + + -1/4 + + + TpkrtNUCNJG_Q9OsSNc1HbI + + + 16 + + Ok0ECFxRvuI_2P4foxuqZq + + + + cross + + + cross + + + circle + + + normal + + + normal + + + normal + + + + + 1/4 + + + 3 + VHDCXjTjSiH_r25IkqW4hWO + + + 10 + + wLPL51aE/ZK_WYJ1s3hVxsG + + + + normal + + + normal + + + normal + + 1 + + + + weLPdp/TOPE_HveOwApPWWC + half + + fHTzGDb6kWP_AT+2b8DnxsG + 67 + 15 + + + + -1/4 + + + CokpN1M4pqC_loY45KU7o8E + + + 20 + + DUSTglH1glB_HnfKXBpuT4K + + + + normal + + + normal + + + normal + + 2 + + + + + +
+
diff --git a/src/engraving/tests/transpose_data/undoTransposeFretDiagrams.mscx b/src/engraving/tests/transpose_data/undoTransposeFretDiagrams.mscx new file mode 100755 index 0000000000000..75fceb6592c88 --- /dev/null +++ b/src/engraving/tests/transpose_data/undoTransposeFretDiagrams.mscx @@ -0,0 +1,457 @@ + + + 4.7.0 + + + 2kOmbTnFT2K_1Ffu11EvJBD + 480 + 1 + 1 + 1 + 0 + 1 + + + Composer / arranger + + 2025-03-10 + + + + Apple Macintosh + + + Subtitle + + + Untitled score + + Orchestra + + Flutes + +
+ flutes + oboes + clarinets + saxophones + bassoons + +
+
+ horns + trumpets + cornets + flugelhorns + trombones + tubas + +
+
+ timpani +
+
+ keyboard-percussion + + drums + unpitched-metal-percussion + unpitched-wooden-percussion + other-percussion + +
+ keyboards + harps + organs + synths + + +
+ voices + voice-groups +
+
+ orchestral-strings +
+
+ + + xVSmWcXHRCO_x7nzdLq+W7E + + stdNormal + + + Flute + + Flute + Fl. + Flute + 59 + 98 + 60 + 93 + wind.flutes.flute + + + Fluid + + + + + + IbIByf9V45G_n1FatmQDVWL + + + EXMLx/3R3qJ_c7cWKj13N+H + 0 + + + J0Rmy10EtIN_1Pc/Cz+r81 + 4 + 4 + + + R0u21zOyPpB_0EP+/0xPk1G + + + cross + + + normal + + + normal + + + circle + + + normal + + + circle + + + + 88 + + + 3 + + + 2 + + + 79 + + + 1 + + + 79 + + + + HzvSPszx2NI_lxchTRPN6iO + half + + 9v0GXubQFuD_28VjANAW6QP + 67 + 15 + + + + -1/4 + + + OFE3RL+QFb_JM52a+emRcF + + + cross + + + cross + + + circle + + + normal + + + normal + + + normal + + + + 88 + + + 88 + + + 79 + + + 2 + + + 3 + + + 2 + + + + 1/4 + + + Dy2Y5gbCKWJ_WaQEnsLiXGC + + + circle + + + normal + + + normal + + + normal + + + circle + + + circle + + + + 79 + + + 2 + + + 2 + + + 1 + + + 79 + + + 79 + + + + lNT7H0p9/lF_SLiwqKlD1UD + half + + 9i1YoWhQ61M_QDmwLNAB6eJ + 67 + 15 + + + + -1/4 + + + RUhArZbVQ2I_EBobFVVqu7K + + + normal + + + normal + + + normal + + 1 + + + 3 + + + 3 + + + 2 + + + + + + ZuKAVzo7TK_s158BJvRsNN + + + kzgHUWGvXwC_+rObEvI4GlP + + + cross + + + normal + + + normal + + + circle + + + normal + + + circle + + + + 88 + + + 3 + + + 2 + + + 79 + + + 1 + + + 79 + + + + /Sa4VlGGHaH_eEnHBeShepD + half + + 3Hmm8a/YfmO_gfnHMV576XE + 67 + 15 + + + + -1/4 + + + TpkrtNUCNJG_Q9OsSNc1HbI + + + cross + + + cross + + + circle + + + normal + + + normal + + + normal + + + + 88 + + + 88 + + + 79 + + + 2 + + + 3 + + + 2 + + + + 1/4 + + + 3 + VHDCXjTjSiH_r25IkqW4hWO + + + normal + + + normal + + + normal + + 1 + + + 1 + + + 3 + + + 3 + + + 2 + + 1 + + + weLPdp/TOPE_HveOwApPWWC + half + + fHTzGDb6kWP_AT+2b8DnxsG + 67 + 15 + + + + -1/4 + + + CokpN1M4pqC_loY45KU7o8E + + + normal + + + normal + + + normal + + 2 + + + 4 + + + 4 + + + 3 + + + + + +
+
diff --git a/src/engraving/tests/transpose_data/undoTransposeFretDiagrams01-ref.mscx b/src/engraving/tests/transpose_data/undoTransposeFretDiagrams01-ref.mscx new file mode 100644 index 0000000000000..f21b2a158164f --- /dev/null +++ b/src/engraving/tests/transpose_data/undoTransposeFretDiagrams01-ref.mscx @@ -0,0 +1,337 @@ + + + + 2kOmbTnFT2K_1Ffu11EvJBD + 480 + + 1 + 1 + 1 + 0 + 1 + + + Composer / arranger + + + + + + + Subtitle + + + Untitled score + + Orchestra + + Flutes + +
+ flutes + oboes + clarinets + saxophones + bassoons + +
+
+ horns + trumpets + cornets + flugelhorns + trombones + tubas + +
+
+ timpani +
+
+ keyboard-percussion + + drums + unpitched-metal-percussion + unpitched-wooden-percussion + other-percussion + +
+ keyboards + harps + organs + synths + + +
+ voices + voice-groups +
+
+ orchestral-strings +
+
+ + + xVSmWcXHRCO_x7nzdLq+W7E + + stdNormal + + + Flute + + Flute + Fl. + Flute + 59 + 98 + 60 + 93 + wind.flutes.flute + + + + + + + + IbIByf9V45G_n1FatmQDVWL + + + EXMLx/3R3qJ_c7cWKj13N+H + 2 + + + J0Rmy10EtIN_1Pc/Cz+r81 + 4 + 4 + + + R0u21zOyPpB_0EP+/0xPk1G + + + cross + + + cross + + + circle + + + normal + + + normal + + + normal + + + + + HzvSPszx2NI_lxchTRPN6iO + half + + 9v0GXubQFuD_28VjANAW6QP + 69 + 17 + + + + -1/4 + + + OFE3RL+QFb_JM52a+emRcF + + + circle + + + normal + + + normal + + + normal + + + circle + + + circle + + + + + 1/4 + + + Dy2Y5gbCKWJ_WaQEnsLiXGC + + + normal + + + normal + + + normal + + 2 + + + + lNT7H0p9/lF_SLiwqKlD1UD + half + + 9i1YoWhQ61M_QDmwLNAB6eJ + 69 + 17 + + + + -1/4 + + + RUhArZbVQ2I_EBobFVVqu7K + + + normal + + + normal + + + circle + + + circle + + + circle + + + normal + + + + + + + ZuKAVzo7TK_s158BJvRsNN + + + kzgHUWGvXwC_+rObEvI4GlP + + + cross + + + cross + + + circle + + + normal + + + normal + + + normal + + + + + /Sa4VlGGHaH_eEnHBeShepD + half + + 3Hmm8a/YfmO_gfnHMV576XE + 69 + 17 + + + + -1/4 + + + TpkrtNUCNJG_Q9OsSNc1HbI + + + circle + + + normal + + + normal + + + normal + + + circle + + + circle + + + + + 1/4 + + + VHDCXjTjSiH_r25IkqW4hWO + + + cross + + + normal + + + normal + + + normal + + 1 + + + + weLPdp/TOPE_HveOwApPWWC + half + + fHTzGDb6kWP_AT+2b8DnxsG + 69 + 17 + + + + -1/4 + + + 3 + CokpN1M4pqC_loY45KU7o8E + + + normal + + + normal + + + normal + + 1 + + + + + +
+
diff --git a/src/engraving/tests/transpose_data/undoTransposeFretDiagrams02-ref.mscx b/src/engraving/tests/transpose_data/undoTransposeFretDiagrams02-ref.mscx new file mode 100644 index 0000000000000..1de05c02c68a3 --- /dev/null +++ b/src/engraving/tests/transpose_data/undoTransposeFretDiagrams02-ref.mscx @@ -0,0 +1,334 @@ + + + + 2kOmbTnFT2K_1Ffu11EvJBD + 480 + + 1 + 1 + 1 + 0 + 1 + + + Composer / arranger + + + + + + + Subtitle + + + Untitled score + + Orchestra + + Flutes + +
+ flutes + oboes + clarinets + saxophones + bassoons + +
+
+ horns + trumpets + cornets + flugelhorns + trombones + tubas + +
+
+ timpani +
+
+ keyboard-percussion + + drums + unpitched-metal-percussion + unpitched-wooden-percussion + other-percussion + +
+ keyboards + harps + organs + synths + + +
+ voices + voice-groups +
+
+ orchestral-strings +
+
+ + + xVSmWcXHRCO_x7nzdLq+W7E + + stdNormal + + + Flute + + Flute + Fl. + Flute + 59 + 98 + 60 + 93 + wind.flutes.flute + + + + + + + + IbIByf9V45G_n1FatmQDVWL + + + EXMLx/3R3qJ_c7cWKj13N+H + 0 + + + J0Rmy10EtIN_1Pc/Cz+r81 + 4 + 4 + + + R0u21zOyPpB_0EP+/0xPk1G + + + cross + + + normal + + + normal + + + circle + + + normal + + + circle + + + + + HzvSPszx2NI_lxchTRPN6iO + half + + 9v0GXubQFuD_28VjANAW6QP + 67 + 15 + + + + -1/4 + + + OFE3RL+QFb_JM52a+emRcF + + + cross + + + cross + + + circle + + + normal + + + normal + + + normal + + + + + 1/4 + + + Dy2Y5gbCKWJ_WaQEnsLiXGC + + + circle + + + normal + + + normal + + + normal + + + circle + + + circle + + + + + lNT7H0p9/lF_SLiwqKlD1UD + half + + 9i1YoWhQ61M_QDmwLNAB6eJ + 67 + 15 + + + + -1/4 + + + RUhArZbVQ2I_EBobFVVqu7K + + + normal + + + normal + + + normal + + 1 + + + + + + ZuKAVzo7TK_s158BJvRsNN + + + kzgHUWGvXwC_+rObEvI4GlP + + + cross + + + normal + + + normal + + + circle + + + normal + + + circle + + + + + /Sa4VlGGHaH_eEnHBeShepD + half + + 3Hmm8a/YfmO_gfnHMV576XE + 67 + 15 + + + + -1/4 + + + TpkrtNUCNJG_Q9OsSNc1HbI + + + cross + + + cross + + + circle + + + normal + + + normal + + + normal + + + + + 1/4 + + + 3 + VHDCXjTjSiH_r25IkqW4hWO + + + normal + + + normal + + + normal + + 1 + + + + weLPdp/TOPE_HveOwApPWWC + half + + fHTzGDb6kWP_AT+2b8DnxsG + 67 + 15 + + + + -1/4 + + + CokpN1M4pqC_loY45KU7o8E + + + normal + + + normal + + + normal + + 2 + + + + + +
+
diff --git a/src/engraving/tests/transpose_data/undoTransposeFretDiagramsChordSymbols.mscx b/src/engraving/tests/transpose_data/undoTransposeFretDiagramsChordSymbols.mscx new file mode 100755 index 0000000000000..a8e7c7346e5ac --- /dev/null +++ b/src/engraving/tests/transpose_data/undoTransposeFretDiagramsChordSymbols.mscx @@ -0,0 +1,509 @@ + + + 4.7.0 + + + 2kOmbTnFT2K_1Ffu11EvJBD + 480 + 1 + 1 + 1 + 0 + 1 + + + Composer / arranger + + 2025-03-10 + + + + Apple Macintosh + + + Subtitle + + + Untitled score + + Orchestra + + Flutes + +
+ flutes + oboes + clarinets + saxophones + bassoons + +
+
+ horns + trumpets + cornets + flugelhorns + trombones + tubas + +
+
+ timpani +
+
+ keyboard-percussion + + drums + unpitched-metal-percussion + unpitched-wooden-percussion + other-percussion + +
+ keyboards + harps + organs + synths + + +
+ voices + voice-groups +
+
+ orchestral-strings +
+
+ + + xVSmWcXHRCO_x7nzdLq+W7E + + stdNormal + + + Flute + + Flute + Fl. + Flute + 59 + 98 + 60 + 93 + wind.flutes.flute + + + Fluid + + + + Fluid + + + + + + IbIByf9V45G_n1FatmQDVWL + + + EXMLx/3R3qJ_c7cWKj13N+H + 0 + + + J0Rmy10EtIN_1Pc/Cz+r81 + 4 + 4 + + + R0u21zOyPpB_0EP+/0xPk1G + + + 14 + + i6JddkooT+K_VCqDglUeMRM + + + + cross + + + normal + + + normal + + + circle + + + normal + + + circle + + + + 88 + + + 3 + + + 2 + + + 79 + + + 1 + + + 79 + + + + HzvSPszx2NI_lxchTRPN6iO + half + + 9v0GXubQFuD_28VjANAW6QP + 67 + 15 + + + + -1/4 + + + OFE3RL+QFb_JM52a+emRcF + + + 16 + + SYmKSDioSgJ_3nRLTs3666 + + + + cross + + + cross + + + circle + + + normal + + + normal + + + normal + + + + 88 + + + 88 + + + 79 + + + 2 + + + 3 + + + 2 + + + + 1/4 + + + Dy2Y5gbCKWJ_WaQEnsLiXGC + + + 18 + + mPZO1MniRBK_DR0+zmVAE6N + + + + circle + + + normal + + + normal + + + normal + + + circle + + + circle + + + + 79 + + + 2 + + + 2 + + + 1 + + + 79 + + + 79 + + + + lNT7H0p9/lF_SLiwqKlD1UD + half + + 9i1YoWhQ61M_QDmwLNAB6eJ + 67 + 15 + + + + -1/4 + + + RUhArZbVQ2I_EBobFVVqu7K + + + 13 + + saAjlrm1EO_FhNXvmfkddI + + + + normal + + + normal + + + normal + + 1 + + + 3 + + + 3 + + + 2 + + + + + + ZuKAVzo7TK_s158BJvRsNN + + + kzgHUWGvXwC_+rObEvI4GlP + + + 14 + + dvEMaLQcibK_SEWH/F36llB + + + + cross + + + normal + + + normal + + + circle + + + normal + + + circle + + + + 88 + + + 3 + + + 2 + + + 79 + + + 1 + + + 79 + + + + /Sa4VlGGHaH_eEnHBeShepD + half + + 3Hmm8a/YfmO_gfnHMV576XE + 67 + 15 + + + + -1/4 + + + TpkrtNUCNJG_Q9OsSNc1HbI + + + 16 + + Ok0ECFxRvuI_2P4foxuqZq + + + + cross + + + cross + + + circle + + + normal + + + normal + + + normal + + + + 88 + + + 88 + + + 79 + + + 2 + + + 3 + + + 2 + + + + 1/4 + + + 3 + VHDCXjTjSiH_r25IkqW4hWO + + + 10 + + wLPL51aE/ZK_WYJ1s3hVxsG + + + + normal + + + normal + + + normal + + 1 + + + 1 + + + 3 + + + 3 + + + 2 + + 1 + + + weLPdp/TOPE_HveOwApPWWC + half + + fHTzGDb6kWP_AT+2b8DnxsG + 67 + 15 + + + + -1/4 + + + CokpN1M4pqC_loY45KU7o8E + + + 20 + + DUSTglH1glB_HnfKXBpuT4K + + + + normal + + + normal + + + normal + + 2 + + + 4 + + + 4 + + + 3 + + + + + +
+
diff --git a/src/engraving/tests/transpose_data/undoTransposeFretDiagramsChordSymbols01-ref.mscx b/src/engraving/tests/transpose_data/undoTransposeFretDiagramsChordSymbols01-ref.mscx new file mode 100644 index 0000000000000..cb8b79b85550f --- /dev/null +++ b/src/engraving/tests/transpose_data/undoTransposeFretDiagramsChordSymbols01-ref.mscx @@ -0,0 +1,388 @@ + + + + 2kOmbTnFT2K_1Ffu11EvJBD + 480 + + 1 + 1 + 1 + 0 + 1 + + + Composer / arranger + + + + + + + Subtitle + + + Untitled score + + Orchestra + + Flutes + +
+ flutes + oboes + clarinets + saxophones + bassoons + +
+
+ horns + trumpets + cornets + flugelhorns + trombones + tubas + +
+
+ timpani +
+
+ keyboard-percussion + + drums + unpitched-metal-percussion + unpitched-wooden-percussion + other-percussion + +
+ keyboards + harps + organs + synths + + +
+ voices + voice-groups +
+
+ orchestral-strings +
+
+ + + xVSmWcXHRCO_x7nzdLq+W7E + + stdNormal + + + Flute + + Flute + Fl. + Flute + 59 + 98 + 60 + 93 + wind.flutes.flute + + + + + + + + + + + IbIByf9V45G_n1FatmQDVWL + + + EXMLx/3R3qJ_c7cWKj13N+H + 2 + + + J0Rmy10EtIN_1Pc/Cz+r81 + 4 + 4 + + + R0u21zOyPpB_0EP+/0xPk1G + + + 16 + + i6JddkooT+K_VCqDglUeMRM + + + + cross + + + cross + + + circle + + + normal + + + normal + + + normal + + + + + HzvSPszx2NI_lxchTRPN6iO + half + + 9v0GXubQFuD_28VjANAW6QP + 69 + 17 + + + + -1/4 + + + OFE3RL+QFb_JM52a+emRcF + + + 18 + + SYmKSDioSgJ_3nRLTs3666 + + + + circle + + + normal + + + normal + + + normal + + + circle + + + circle + + + + + 1/4 + + + Dy2Y5gbCKWJ_WaQEnsLiXGC + + + 20 + + mPZO1MniRBK_DR0+zmVAE6N + + + + normal + + + normal + + + normal + + 2 + + + + lNT7H0p9/lF_SLiwqKlD1UD + half + + 9i1YoWhQ61M_QDmwLNAB6eJ + 69 + 17 + + + + -1/4 + + + RUhArZbVQ2I_EBobFVVqu7K + + + 15 + + saAjlrm1EO_FhNXvmfkddI + + + + normal + + + normal + + + circle + + + circle + + + circle + + + normal + + + + + + + ZuKAVzo7TK_s158BJvRsNN + + + kzgHUWGvXwC_+rObEvI4GlP + + + 16 + + dvEMaLQcibK_SEWH/F36llB + + + + cross + + + cross + + + circle + + + normal + + + normal + + + normal + + + + + /Sa4VlGGHaH_eEnHBeShepD + half + + 3Hmm8a/YfmO_gfnHMV576XE + 69 + 17 + + + + -1/4 + + + TpkrtNUCNJG_Q9OsSNc1HbI + + + 18 + + Ok0ECFxRvuI_2P4foxuqZq + + + + circle + + + normal + + + normal + + + normal + + + circle + + + circle + + + + + 1/4 + + + VHDCXjTjSiH_r25IkqW4hWO + + + 12 + + wLPL51aE/ZK_WYJ1s3hVxsG + + + + cross + + + normal + + + normal + + + normal + + 1 + + + + weLPdp/TOPE_HveOwApPWWC + half + + fHTzGDb6kWP_AT+2b8DnxsG + 69 + 17 + + + + -1/4 + + + 3 + CokpN1M4pqC_loY45KU7o8E + + + 22 + + DUSTglH1glB_HnfKXBpuT4K + + + + normal + + + normal + + + normal + + 1 + + + + + +
+
diff --git a/src/engraving/tests/transpose_data/undoTransposeFretDiagramsChordSymbols02-ref.mscx b/src/engraving/tests/transpose_data/undoTransposeFretDiagramsChordSymbols02-ref.mscx new file mode 100644 index 0000000000000..352ac617db1e0 --- /dev/null +++ b/src/engraving/tests/transpose_data/undoTransposeFretDiagramsChordSymbols02-ref.mscx @@ -0,0 +1,385 @@ + + + + 2kOmbTnFT2K_1Ffu11EvJBD + 480 + + 1 + 1 + 1 + 0 + 1 + + + Composer / arranger + + + + + + + Subtitle + + + Untitled score + + Orchestra + + Flutes + +
+ flutes + oboes + clarinets + saxophones + bassoons + +
+
+ horns + trumpets + cornets + flugelhorns + trombones + tubas + +
+
+ timpani +
+
+ keyboard-percussion + + drums + unpitched-metal-percussion + unpitched-wooden-percussion + other-percussion + +
+ keyboards + harps + organs + synths + + +
+ voices + voice-groups +
+
+ orchestral-strings +
+
+ + + xVSmWcXHRCO_x7nzdLq+W7E + + stdNormal + + + Flute + + Flute + Fl. + Flute + 59 + 98 + 60 + 93 + wind.flutes.flute + + + + + + + + + + + IbIByf9V45G_n1FatmQDVWL + + + EXMLx/3R3qJ_c7cWKj13N+H + 0 + + + J0Rmy10EtIN_1Pc/Cz+r81 + 4 + 4 + + + R0u21zOyPpB_0EP+/0xPk1G + + + 14 + + i6JddkooT+K_VCqDglUeMRM + + + + cross + + + normal + + + normal + + + circle + + + normal + + + circle + + + + + HzvSPszx2NI_lxchTRPN6iO + half + + 9v0GXubQFuD_28VjANAW6QP + 67 + 15 + + + + -1/4 + + + OFE3RL+QFb_JM52a+emRcF + + + 16 + + SYmKSDioSgJ_3nRLTs3666 + + + + cross + + + cross + + + circle + + + normal + + + normal + + + normal + + + + + 1/4 + + + Dy2Y5gbCKWJ_WaQEnsLiXGC + + + 18 + + mPZO1MniRBK_DR0+zmVAE6N + + + + circle + + + normal + + + normal + + + normal + + + circle + + + circle + + + + + lNT7H0p9/lF_SLiwqKlD1UD + half + + 9i1YoWhQ61M_QDmwLNAB6eJ + 67 + 15 + + + + -1/4 + + + RUhArZbVQ2I_EBobFVVqu7K + + + 13 + + saAjlrm1EO_FhNXvmfkddI + + + + normal + + + normal + + + normal + + 1 + + + + + + ZuKAVzo7TK_s158BJvRsNN + + + kzgHUWGvXwC_+rObEvI4GlP + + + 14 + + dvEMaLQcibK_SEWH/F36llB + + + + cross + + + normal + + + normal + + + circle + + + normal + + + circle + + + + + /Sa4VlGGHaH_eEnHBeShepD + half + + 3Hmm8a/YfmO_gfnHMV576XE + 67 + 15 + + + + -1/4 + + + TpkrtNUCNJG_Q9OsSNc1HbI + + + 16 + + Ok0ECFxRvuI_2P4foxuqZq + + + + cross + + + cross + + + circle + + + normal + + + normal + + + normal + + + + + 1/4 + + + 3 + VHDCXjTjSiH_r25IkqW4hWO + + + 10 + + wLPL51aE/ZK_WYJ1s3hVxsG + + + + normal + + + normal + + + normal + + 1 + + + + weLPdp/TOPE_HveOwApPWWC + half + + fHTzGDb6kWP_AT+2b8DnxsG + 67 + 15 + + + + -1/4 + + + CokpN1M4pqC_loY45KU7o8E + + + 20 + + DUSTglH1glB_HnfKXBpuT4K + + + + normal + + + normal + + + normal + + 2 + + + + + +
+
diff --git a/src/engraving/tests/transpose_tests.cpp b/src/engraving/tests/transpose_tests.cpp index 2f2b5bca1301a..527764fb25f39 100644 --- a/src/engraving/tests/transpose_tests.cpp +++ b/src/engraving/tests/transpose_tests.cpp @@ -104,11 +104,31 @@ TEST_F(Engraving_TransposeTests, undoTransposeChordSymbols) undoTransposeTest(u"undoTransposeChordSymbols"); } +TEST_F(Engraving_TransposeTests, undoTransposeFretDiagramsChordSymbols) +{ + undoTransposeTest(u"undoTransposeFretDiagramsChordSymbols"); +} + +TEST_F(Engraving_TransposeTests, undoTransposeFretDiagrams) +{ + undoTransposeTest(u"undoTransposeFretDiagrams"); +} + TEST_F(Engraving_TransposeTests, undoDiatonicTransposeChordSymbols) { undoDiatonicTransposeTest(u"undoDiatonicTransposeChordSymbols"); } +TEST_F(Engraving_TransposeTests, undoDiatonicTransposeFretDiagramsChordSymbols) +{ + undoTransposeTest(u"undoDiatonicTransposeFretDiagramsChordSymbols"); +} + +TEST_F(Engraving_TransposeTests, undoDiatonicTransposeFretDiagrams) +{ + undoTransposeTest(u"undoDiatonicTransposeFretDiagrams"); +} + TEST_F(Engraving_TransposeTests, undoDiatonicTranspose) { undoDiatonicTransposeTest(u"undoDiatonicTranspose"); diff --git a/src/importexport/musicxml/tests/data/testChordSymbols2_ref.mscx b/src/importexport/musicxml/tests/data/testChordSymbols2_ref.mscx index 6006c7f6b6f57..b8e9fd67572be 100644 --- a/src/importexport/musicxml/tests/data/testChordSymbols2_ref.mscx +++ b/src/importexport/musicxml/tests/data/testChordSymbols2_ref.mscx @@ -164,24 +164,6 @@ normal - - 88 - - - 79 - - - 3 - - - 2 - - - 1 - - - 3 - @@ -223,18 +205,6 @@ 1 - - 88 - - - 3 - - - 3 - - - 3 - diff --git a/src/notation/internal/mscoreerrorscontroller.cpp b/src/notation/internal/mscoreerrorscontroller.cpp index acd27cd6b7110..ca945b9f2d060 100644 --- a/src/notation/internal/mscoreerrorscontroller.cpp +++ b/src/notation/internal/mscoreerrorscontroller.cpp @@ -166,6 +166,11 @@ void MScoreErrorsController::checkAndShowMScoreError() title = muse::trc("notation", "Can’t repeat this selection"); message = muse::trc("notation", "Make a list selection of notes or rests on the same beat or any range selection and retry."); break; + case MsError::TRANSPOSE_NO_FRET_DIAGRAM: + title = muse::trc("notation", "Some fretboard diagrams could not be transposed"); + message = muse::trc("notation", + "Fretboard diagrams that could not be transposed have been left blank. You can undo this action if required."); + break; } interactive()->info(title, message, {}, 0, diff --git a/src/notation/view/widgets/transposedialog.cpp b/src/notation/view/widgets/transposedialog.cpp index dd0a9ce93cd84..b5108abf68fb5 100644 --- a/src/notation/view/widgets/transposedialog.cpp +++ b/src/notation/view/widgets/transposedialog.cpp @@ -22,6 +22,7 @@ #include "transposedialog.h" +#include "internal/mscoreerrorscontroller.h" #include "ui/view/widgetstatestore.h" using namespace mu::notation; @@ -55,7 +56,7 @@ TransposeDialog::TransposeDialog(QWidget* parent) const std::vector& elements = selection()->elements(); bool hasChordNames = std::any_of(elements.cbegin(), elements.cend(), [](const EngravingItem* item) { - return item->isHarmony(); + return item->isHarmony() || item->isFretDiagram(); }); setEnableTransposeChordNames(hasChordNames); @@ -218,6 +219,8 @@ void TransposeDialog::apply() interaction()->transpose(options); + MScoreErrorsController(iocContext()).checkAndShowMScoreError(); + if (m_allSelected) { interaction()->clearSelection(); } diff --git a/src/notation/view/widgets/transposedialog.ui b/src/notation/view/widgets/transposedialog.ui index 3dc57efaf52ba..5f6585e5c2caa 100644 --- a/src/notation/view/widgets/transposedialog.ui +++ b/src/notation/view/widgets/transposedialog.ui @@ -128,7 +128,7 @@ - Qt::Vertical + Qt::Orientation::Vertical @@ -337,7 +337,7 @@ - Qt::Vertical + Qt::Orientation::Vertical @@ -446,7 +446,7 @@ - Qt::Vertical + Qt::Orientation::Vertical @@ -510,7 +510,7 @@ - Transpose chord symbols + Transpose chord symbols and fretboard diagrams true @@ -550,10 +550,10 @@ - Qt::Horizontal + Qt::Orientation::Horizontal - QDialogButtonBox::Cancel|QDialogButtonBox::Ok + QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok diff --git a/src/palette/internal/palettecompat.cpp b/src/palette/internal/palettecompat.cpp index 989dffb03f8b9..faad40d7e99b8 100644 --- a/src/palette/internal/palettecompat.cpp +++ b/src/palette/internal/palettecompat.cpp @@ -164,8 +164,8 @@ void PaletteCompat::migrateOldPaletteCellIfNeeded(PaletteCell* cell, Score* pale if (item->isFretDiagram()) { FretDiagram* oldFretDiagram = toFretDiagram(item); - String oldFretDiagramPattern = FretDiagram::patternFromDiagram(oldFretDiagram); - std::vector oldFretDiagramPatternHarmonies = FretDiagram::patternHarmonies(oldFretDiagramPattern); + String oldFretDiagramPattern = oldFretDiagram->patternFromDiagram(); + std::vector oldFretDiagramPatternHarmonies = oldFretDiagram->harmoniesFromPattern(oldFretDiagramPattern); String harmonyName = muse::value(FRET_DIAGRAMS_MIGRATION_MAP, oldFretDiagramPattern); if (harmonyName.empty() || muse::contains(oldFretDiagramPatternHarmonies, harmonyName)) {