File: pitch-Cb-B%23.diff

package info (click to toggle)
musescore3 3.2.3%2Bdfsg2-16
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 214,188 kB
  • sloc: cpp: 291,198; xml: 200,238; sh: 3,779; ansic: 1,447; python: 393; makefile: 244; perl: 82; pascal: 79
file content (21 lines) | stat: -rw-r--r-- 1,022 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Origin: upstream, commit:58d603b499ba6d89455a98af382f4150fc4efd5b
Author: Matt McClinch <mattmcclinch@gmail.com>
Description: fix #290987: B# and Cb octave change
 Resolves: https://musescore.org/en/node/290987.
 .
 Make sure that B#, B##, Cb, and Cbb describe themselves as being in the
 correct octave. This is accomplished by calculating the octave based on
 what the pitch would be if there were no accidental. Thus, there is no
 need to special-case certain tpcs.

--- a/libmscore/note.cpp
+++ b/libmscore/note.cpp
@@ -760,7 +760,7 @@ int Note::tpc() const
 QString Note::tpcUserName(bool explicitAccidental) const
       {
       QString pitchName = tpc2name(tpc(), NoteSpellingType::STANDARD, NoteCaseType::AUTO, explicitAccidental);
-      QString octaveName = QString::number(((epitch() + ottaveCapoFret()) / 12) - 1);
+      QString octaveName = QString::number(((epitch() + ottaveCapoFret() - int(tpc2alter(tpc()))) / 12) - 1);
       return pitchName + (explicitAccidental ? " " : "") + octaveName;
       }