musescore / musescore/MuseScore

Hidden 'stray' TAB clef in a piano score's treble clef staff

Open
#31,464 0 comments 0 reactions 1 assignee View on GitHub

@ajuncosa is already working on this.

Since Jul 31, 2026.

engraving needs review
Dominant language
C++
Stars
15.1k
Forks
3.3k
Avg merge
2d 2h
Merged PRs (30d)
91

Description

Issue type

Other type of issue

Description with steps to reproduce
  1. Take the score from https://github.com/Jojo-Schmitz/MuseScore/issues/1104 (also linked to here)

  2. Open in in MuseScore 4.6 or later (the score stems from 4.6.4)

  3. Looks like this (all OK, apparently):

Image
  1. Look at it's mscx file and notice at measure 5 on top staff:
          <Clef>
            <concertClefType>TAB</concertClefType>
            <transposingClefType>TAB</transposingClefType>
            <eid>Wnv6r3m51yJ_TYBJGc6/gJI</eid>
            </Clef>
  1. Modify the source and rebuild
diff --git a/src/engraving/rendering/score/tlayout.cpp b/src/engraving/rendering/score/tlayout.cpp
index 6caf269145..ad4eb89c22 100644
--- a/src/engraving/rendering/score/tlayout.cpp
+++ b/src/engraving/rendering/score/tlayout.cpp
@@ -1680,7 +1680,7 @@ void TLayout::layoutClef(const Clef* item, Clef::LayoutData* ldata, const Layout
             ldata->symId = SymId::noSym;
             LOGD("invisible clef at tick %d(%d) staff %zu",
                  item->segment()->tick().ticks(), item->segment()->tick().ticks() / 1920, item->staffIdx());
-            return;
+            //return;
         }
         lines      = st->lines();             // init values from staff type
         lineDist   = st->lineDistance().val();
  1. Open the score with thatImage

  2. See that stray TAB clef

Supporting files, videos and screenshots

No idea how that stray TAB clef got into that score, maybe @vanferry does?

In which versions of MuseScore Studio is this issue present?

Pretty much all versions

Regression

No.

Operating system

Windows 11 and other OSes

Additional context

Not sure whether this is a bug or something to fix at all, but I don't see anything wrong in showing that bogus stray TAB clef, so you can remove it.

Checklist
  • This report follows the guidelines for reporting bugs and issues
  • I have verified that this issue has not been logged before, by searching the issue tracker for similar issues
  • I have attached all requested files and information to this report
  • I have attempted to identify the root problem as concisely as possible, and have used minimal reproducible examples where possible

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.