Skip to content

Support number notation jianpu - #31626

Open
songzhenke wants to merge 42 commits into
musescore:mainfrom
songzhenke:jianpu
Open

songzhenke wants to merge 42 commits into
musescore:mainfrom
songzhenke:jianpu

Conversation

@songzhenke

@songzhenke songzhenke commented Jan 1, 2026 •

Copy link
Copy Markdown

Resolves: #25919

This PR adds Jianpu support. A new Jianpu staff type can be selected to display number notation. No new failures are introduced in existing unit tests.

The implementation follows the guidance in this comment by not introducing new fonts and by reusing existing rendering for lines and dots.

Features added

  • New Jianpu staff type
  • Render Jianpu digits using a dedicated Jianpu font
  • Support chord notes with vertically stacked Jianpu digits
  • Render octave dots above/below digits
  • Render duration lines to the right of digits
  • Use beams for diminution lines
  • Adjust slur rendering for Jianpu
  • Show Jianpu digits above/below the shadow note during note entry
  • Configuration for Jianpu font
  • Configurable size and spacing for octave dots and duration lines
  • Configurable beam placement for Indonesian Not Angka which lines above shorten duration and slur below
  • Unit tests added

Notes

  • The visual test will be submitted in a separate PR 12 which still in forked branch, since upstream main cannot generate reference PNGs for Jianpu.

Snapshots

5-line staff with a linked Jianpu staff
Screenshot_20260101_224505

  • I signed the CLA
  • The title of the PR describes the problem it addresses
  • Each commit's message describes its purpose and effects, and references the issue it resolves
  • If changes are extensive, there is a sequence of easily reviewable commits
  • The code in the PR follows the coding rules
  • There are no unnecessary changes
  • The code compiles and runs on my machine, preferably after each commit individually
  • I created a unit test or vtest to verify the changes I made (if applicable)

@songzhenke
songzhenke force-pushed the jianpu branch 2 times, most recently from 5e4513c to 8c172ff Compare January 2, 2026 01:13
@songzhenke
songzhenke marked this pull request as draft January 2, 2026 01:27
@songzhenke
songzhenke force-pushed the jianpu branch 4 times, most recently from 132d688 to 6034690 Compare January 2, 2026 08:58
@songzhenke
songzhenke marked this pull request as ready for review January 2, 2026 10:20
@songzhenke
songzhenke force-pushed the jianpu branch 3 times, most recently from e4f52e9 to 28182e9 Compare January 4, 2026 02:04
@AndreaHu3299

Copy link
Copy Markdown

Love this work! Can't wait for it to be natively supported in MuseScore 4! Keep up the good work @songzhenke !

@songzhenke

Copy link
Copy Markdown
Author

Love this work! Can't wait for it to be natively supported in MuseScore 4! Keep up the good work @songzhenke !

Thanks @AndreaHu3299 . My pleasure. Once basic features are merged, i will gradually improve jianpu and fix bugs.

@songzhenke

Copy link
Copy Markdown
Author

This is opened for a while, could someone please review when you have time? @Tantacrul @cbjeukendrup

@cbjeukendrup

Copy link
Copy Markdown
Contributor

It has been added to our review queue, but the queue is a bit full at the moment, especially for larger pull requests. But we'll get to it!

@songzhenke
songzhenke force-pushed the jianpu branch 3 times, most recently from bf9cc8b to 8c848b8 Compare January 17, 2026 08:30
@leonchensax

Copy link
Copy Markdown

Hi @songzhenke , thank you so much for your hard work on this Jianpu support! As a saxophone player and blogger, I’ve been testing this PR and would like to share some feedback to help improve it.

First, I found that certain articulations like "Scoop" and "Slide in below" cannot be added or displayed in the Jianpu staff.

Second, it would be great to have options to customize the appearance, such as changing the font and size of the digits, as well as the scale of the octave dots for better readability.

Lastly, there is a critical issue with transposing instruments (e.g., Alto Saxophone, Trumpet): the Jianpu is not currently following the "Movable Do" system relative to the instrument's written key, resulting in incorrect pitch relationships.

I hope these suggestions are helpful for the next steps of development. Looking forward to this feature!

Best regards,
Leon.

@songzhenke

Copy link
Copy Markdown
Author

Thanks @leonchensax for testing.

This PR is just a beginning for Jianpu support, and I’m sure it still needs a lot of improvement. I’ll keep working on it if the current approach is on the right track.

I plan to experiment with things like Scoop, Slide in below, and transposing instruments to see how they should be handled. The articulation code is quite hard to understand.

Custom configuration mainly needs some UI work, so I’ll spend time on that only after the basic features are working.

Anyway, still a long way to go.

@leonchensax

Copy link
Copy Markdown

Thanks @leonchensax for testing.

This PR is just a beginning for Jianpu support, and I’m sure it still needs a lot of improvement. I’ll keep working on it if the current approach is on the right track.

I plan to experiment with things like Scoop, Slide in below, and transposing instruments to see how they should be handled. The articulation code is quite hard to understand.

Custom configuration mainly needs some UI work, so I’ll spend time on that only after the basic features are working.

Anyway, still a long way to go.

Thanks for the amazing work! As a sheet music publisher and wind instrument player, I’m thrilled to see Jianpu support coming to life—it's a huge milestone for my workflow.

I’m fully committed to helping speed this up. Please let me know if there's any way I can support your development, whether through professional testing or by sponsoring your time to expedite the process.

Is there a way we could connect further? I'd love to discuss how we might collaborate more closely to make this a success. (Do you have a Buy Me a Coffee link or a preferred way to chat?)

Looking forward to it!

@songzhenke

Copy link
Copy Markdown
Author

Hi @leonchensax
The scoop and transposing instrument should be fixed in latest PR. Thanks for help from AI as i have 0 knowledge of those. I am not using Buy Me a Coffee link :( . The latest PR also supports multiple notes for jianpu in a chord. Unforturnately it breaks some unit tests. Hope you can play with it. I am going to fix unit test failures later when having time.

@songzhenke
songzhenke force-pushed the jianpu branch 4 times, most recently from 009b015 to 43cf484 Compare February 25, 2026 13:17
@songzhenke

songzhenke commented Feb 26, 2026 •

Copy link
Copy Markdown
Author

The unit test failures are fixed. My next goal:

  • Use existing beam for duration line
  • Add setting for jianpu
  • Add unit test for jianpu

@rchangl

rchangl commented Mar 6, 2026

Copy link
Copy Markdown

Looking forward to it!

@songzhenke

Copy link
Copy Markdown
Author

Incorrect beam display in Jianpu.

It is because you dragged the duration line (beam), then it has custom format. The jianpu layout will leave it as it is. You can reset it by this step:

  1. create a linked staff
  2. delete original staff
  3. save
  4. reopen
  5. the linked staff will show as nomal as the custom formats are dropped by step 2

Another easy option is to reset the beam height individually in the Properties panel

I added a change to prevent incorrect beam rendering. Dragging a duration line (beam) now preserves its Jianpu styling and keeps it horizontal unless you untick Force horizontal in the beam properties.

@songzhenke

Copy link
Copy Markdown
Author

Hi @miiizen @davidstephengrant,

Just wondering if there has been any progress on the code review for this PR.

I noticed that the linked issue #25919 was assigned to you a couple of months ago, but the PR itself hasn't been assigned yet, so I thought I'd check if there might be any updates.

I understand the team has a lot on its plate. I'd really appreciate any update when you have a chance.

Thanks for your time!

@bamb3r

bamb3r commented Oct 30, 2026

Copy link
Copy Markdown

Hello! Thank you so much for all your work on this, we are really excited about adding jianpu to MuseScore Studio 🔥

We discussed this as a team and we think the best approach is to review the PR over the next week or so, and then to merge this in but keep the functionality hidden behind dev tools until after 5.0. This means that it will be accessible through the dev tools menu, but we won't officially support scores containing jianpu for all users until a little later (most likely when we do the 5.1 release) as we need to make sure we test support thoroughly across all aspects of engraving. @miiizen and @mathesoncalum will follow up with their initial reviews shortly - thanks again, we believe this will be a great addition 😀

@Gravifer

Copy link
Copy Markdown
Contributor

Really glad to hear about that! Now there is a roadmap to look forward to :D

@songzhenke

Copy link
Copy Markdown
Author

Thanks @bamb3r. I'm really pleased to hear this, and I completely understand the approach of keeping Jianpu behind Dev Tools initially while allowing more time for thorough testing.

I really appreciate the team's support and look forward to receiving the initial reviews and working through any feedback.

Thanks again! 😀

@miiizen miiizen left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking good! Lots of comments (sorry) but I have no problems at all with the fundamentals of this.

Comment thread src/engraving/dom/octavedot.h Resolved
Comment thread src/engraving/dom/octavedot.h Resolved
Comment thread src/engraving/dom/durationline.h Resolved
Comment thread src/engraving/dom/durationline.cpp Resolved
Comment thread src/engraving/rw/write/twrite.cpp Resolved
}

if (item->isJianpuStaff() && item->isStyled(Pid::BEAM_NO_SLOPE)) {
item->setNoSlope(true);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this necessary? The slope is set to 0 later on in layout2 anyway.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still necessary. It keeps beam horizontal when user drags it.

  • Line 202: Sets the noSlope flag. If the beam was user-modified, that also flattens its saved endpoints.
  • Line 384: Sets the beam’s calculated slope to zero, so it lays out horizontally.

@mathesoncalum
mathesoncalum self-requested a review November 2, 2026 08:20
@songzhenke songzhenke mentioned this pull request Nov 2, 2026
9 tasks done
* Code review - update copyright

* Code review - position instead of duration

* Code review - rename to onJianpuStaff and createBeamIfNeed and const

* code review - move len and above to layoutdata

* code review - revert notes in chord instead of sort

* code review - add jianpu group

* code review - rename staff type name from stdJianpu to jianpu

* code review - check if the first chord is jianpu

* code review - add P_TYPE to avoid converting from/to int
@songzhenke

Copy link
Copy Markdown
Author

Hi @miiizen,

Thanks for the thorough review and all the helpful suggestions! I've addressed all your comments based on your suggestions, except for the last one 🙂

@songzhenke

Copy link
Copy Markdown
Author

Note: Backward compatibility break affecting only Jianpu scores created with previous builds

The commit e898861 changes the XML tags used for Jianpu. As a result, the new build of PR 31626 is not backward-compatible with Jianpu scores saved by previous builds.

To update your existing scores, please use the build from the forked PR 14 to open and save your old MuseScore files. This will automatically convert them to the new XML tags.

CC @FreeCodeCampXYG @King-of-Infinite-Space @Gravifer. I know you have saved scores :)

@songzhenke

Copy link
Copy Markdown
Author

New DevTools setting hides jianpu by default

Added a notation/enableJianpu setting, disabled by default, to keep Jianpu options behind DevTools. When disabled, Jianpu staff types are hidden in staff settings and the Edit Staff Type dialog, and the Jianpu page and text style are hidden in Edit Style.

To enable Jianpu, set DevTools → Settings → notation/enableJianpu to true.

@mathesoncalum mathesoncalum left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brilliant @songzhenke! I've left some comments - mostly minor tweaks.

Once that's done, the final thing we should do before merging is clean up the commit history. What we want is a series of coherent commits with clear messages detailing what was changed - ideally we don't want any "address review comments" or merge commits in the PR history.

I appreciate that could be a bit of a headache in this case - so if you want to squash everything into a single commit that's fine by me.

^Edit: Don't worry about this - as @cbjeukendrup mentions here we can do it at the point of merging.

Comment thread src/engraving/dom/durationline.h Resolved
Comment thread src/engraving/dom/durationline.cpp Resolved
Comment thread src/engraving/dom/durationline.cpp Resolved
Comment thread src/engraving/dom/durationline.h Resolved
Comment thread src/engraving/dom/durationtype.h Resolved
Comment thread src/engraving/dom/octavedot.cpp Resolved
Comment thread src/engraving/dom/note.h Resolved
Comment on lines -267 to -269
if (generated()) {
return false;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, will this change (and the change to KeySignatureSettingsModel::loadProperties) enable the mode dropdown on generated key signatures at the start of each system though? I think this is disabled by design.

Comment thread src/engraving/dom/stafftype.cpp Resolved
Comment thread src/engraving/dom/stafftype.cpp Resolved
@cbjeukendrup

Copy link
Copy Markdown
Contributor

(@mathesoncalum sorry to weigh in, but perhaps instead of squashing everything here and thus losing the history, it might be nicer to leave the history intact in the PR, and squash during merging using GitHub's option for that)

@mathesoncalum

Copy link
Copy Markdown
Contributor

@cbjeukendrup oh cool, I didn't know GH had that option. Updated my comment - cheers!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for numbered musical notation (Jianpu)