Repository navigation
Support number notation jianpu - #31626
songzhenke wants to merge 34 commits into
Conversation
5e4513c to
8c172ff
Compare
132d688 to
6034690
Compare
e4f52e9 to
28182e9
Compare
|
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. |
|
This is opened for a while, could someone please review when you have time? @Tantacrul @cbjeukendrup |
|
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! |
bf9cc8b to
8c848b8
Compare
|
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, |
|
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! |
|
Hi @leonchensax |
009b015 to
43cf484
Compare
|
The unit test failures are fixed. My next goal:
|
|
Looking forward to it! |
|
The current feedback is already keeping me busy enough :). I’m working on the multi-voice layout issue now, which isn’t easy. I still need to address the beam and grace note issues reported above, as well as the octave dot issue in la-based minor reported in fork PR #11. I’ll need some time to work through these, as I’m also busy with my day job ;) |
|
Hope you find some subproblem that's worth delegating :D |
|
The issue "3. Octave Dot Spacing" is fixed by PR 11. |
|
I changed default gap a little bit smaller and added a new setting in For font, you can change jianpu font in |
* add tonic for jianpu * replace hardcode octave based note C3 by score key * add jianpu tonic setting to key signature properties instead of score wide style * show jianpu label 1=C to replace sharp and flat * default to major when staff mode is unknown or none * display jianpu accidetal instead of standard note accidental * fix coding format * rename setting name in properties * fix jianpu vertical display for multi voice * fix jianpu vertical display for muti voice - handle dot and beam * fix jianpu vertical display for muti voice - use up note * fix jianpu vertical display for muti voice - handle slur * fix jianpu octave dot for custom tonic * add new setting for voice vertical distance * qml use defined jianpu tonic mode in engraving
|
My forked PR #11 has been merged into this branch. It mainly adds custom tonic settings and multi-voice layout support, and fixes several bugs, including accidentals. Remaining issues:
|
That's a pity! Independent tonic settings for linked Jianpu staves would be extremely useful for polytonal or modulating passages. Is this something that might be considered for a future update?
I'm not entirely sure which snapshot corresponds to the "fourth" one mentioned, so I've attached both score files just to be safe. Hopefully one of them can help reproduce the beam display issue. Please let me know if you need anything else!
I suspect this might be a cross-platform font rendering difference. You mentioned your snapshot is from Linux with FreeSans, but I'm on Windows and cannot see the exact same rendering on my end. Maybe is a bug, but it's not Jianpu's bug ! I'm windows 11 Arm |
yes. I will look to see if possible.
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:
|
It is supported now. There is one special aspect of the UI to be aware of. When you select a key signature, the Properties panel shows the Jianpu settings for all staves. To change the settings for a single staff, click an empty area to deselect everything, then Ctrl+click the key signature on the desired Jianpu staff and adjust its Jianpu numbering settings. |
It is fixed. PR is updated. |
Changed further to apply the same fix to standard jianpu notation. When a custom beam break is applied, the duration line underneath a jianpu number may be missing. |
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. |
|
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! |
|
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 😀 |
|
Really glad to hear about that! Now there is a roadmap to look forward to :D |
|
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! 😀 |
| * MuseScore Studio | ||
| * Music Composition & Notation | ||
| * | ||
| * Copyright (C) 2021 MuseScore Limited |
There was a problem hiding this comment.
| * Copyright (C) 2021 MuseScore Limited | |
| * Copyright (C) 2026 MuseScore Limited and others |
Likewise for all new files please
|
|
||
| Note* note() const; | ||
|
|
||
| double len() const { return m_len; } |
There was a problem hiding this comment.
len and above are only ever set during layout and cannot be edited by the user, so these values should go in LayoutData. Then, we can also remove spatiumChanged
| ChordRest* chordRest() const; | ||
| double mag() const; | ||
|
|
||
| double len() const { return m_len; } |
There was a problem hiding this comment.
This can be moved to LayoutData and spatiumChanged removed.
|
|
||
| void DurationLine::spatiumChanged(double oldValue, double newValue) | ||
| { | ||
| if (oldValue != 0.0) { |
There was a problem hiding this comment.
We can remove this whole function, but for future reference use muse::RealIsNull to check doubles are 0.
| } | ||
|
|
||
| if (item->jianpuNumbering() != JianpuTonicMode::FOLLOW_SCORE_KEY) { | ||
| xml.tag("jianpuNumbering", int(item->jianpuNumbering())); |
There was a problem hiding this comment.
We want to avoid serialising enums as ints - please add the necessary functions to TConv so we can read and write in the same way as jianpuTonicMode
|
|
||
| auto notes = item->notes(); | ||
| if (isJianpuStaff) { | ||
| std::sort(notes.begin(), notes.end(), [](const Note* n1, const Note* n2) { |
There was a problem hiding this comment.
Can we just reverse the vector here? They should already be sorted lowest to highest.
| TLayout::layoutNote(note, ldata); | ||
|
|
||
| if (isJianpuStaff) { | ||
| std::vector<OctaveDot*> dots = note->octaveDots(); |
There was a problem hiding this comment.
| std::vector<OctaveDot*> dots = note->octaveDots(); | |
| const std::vector<OctaveDot*>& dots = note->octaveDots(); |
| jianpuKeyMapping(ks, mode, tonicTpc); | ||
|
|
||
| for (Note* note : item->notes()) { | ||
| int dots = 0; |
There was a problem hiding this comment.
We can move this to below octave and do:
| int dots = 0; | |
| int dots = std::abs(octave); |
| if (!measure) { | ||
| return; | ||
| } | ||
| Fraction tick = measure->ticks(); |
There was a problem hiding this comment.
| Fraction tick = measure->ticks(); | |
| Fraction tick = measure->tick(); |
We want position not duration here
| } | ||
|
|
||
| if (item->isJianpuStaff() && item->isStyled(Pid::BEAM_NO_SLOPE)) { | ||
| item->setNoSlope(true); |
There was a problem hiding this comment.
Is this necessary? The slope is set to 0 later on in layout2 anyway.




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
Notes
Snapshots
5-line staff with a linked Jianpu staff
