Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #3325: layout of multi-voice seconds and unisons #742

Closed
wants to merge 12 commits into from

Conversation

MarcSabatella
Copy link
Contributor

Do not merge yet, but I am submitting the PR so we can see how the tests (and benchmark) go.

@Jojo-Schmitz
Copy link
Contributor

Failure in
328632/33 Test #32: tst_mxml_io ......................***Exception: Other 12.24 sec

7604QDEBUG : TestMxmlIO::voiceMapper3() importMusicXml(0x35d2430, /home/travis/build/musescore/MuseScore/mtest/musicxml/io/testVoiceMapper3.xml)
7605QDEBUG : TestMxmlIO::voiceMapper3() Validation time elapsed: 168 ms
7606QDEBUG : TestMxmlIO::voiceMapper3() importMusicXml() file '/home/travis/build/musescore/MuseScore/mtest/musicxml/io/testVoiceMapper3.xml' is a valid MusicXML file
7607QDEBUG : TestMxmlIO::voiceMapper3() MxmlReaderFirstPass::MxmlReaderFirstPass()
7608QDEBUG : TestMxmlIO::voiceMapper3() MxmlReaderFirstPass::parseFile() begin
7609QDEBUG : TestMxmlIO::voiceMapper3() part list
7610QDEBUG : TestMxmlIO::voiceMapper3() part 1 id 'P1'
7611QDEBUG : TestMxmlIO::voiceMapper3() Parsing time elapsed: 1 ms
7612QDEBUG : TestMxmlIO::voiceMapper3() MxmlReaderFirstPass::parseFile() end
7613QDEBUG : TestMxmlIO::voiceMapper3() MusicXml::xmlScorePart: instruments part P1
7614QDEBUG : TestMxmlIO::voiceMapper3() MusicXml::xmlScorePart: instrument id P1-I3 name Piano
7615QDEBUG : TestMxmlIO::voiceMapper3() Measure::insertStaff: 1
7616QDEBUG : TestMxmlIO::voiceMapper3() </home/travis/build/musescore/MuseScore/mtest/musicxml/io/testVoiceMapper3.xml>:
7617QDEBUG : TestMxmlIO::voiceMapper3() key:attributes:measure:part:score-partwise:: Node not implemented: , type 1
7618QDEBUG : TestMxmlIO::voiceMapper3() ImportMusicXml: too many voices (staff 1, relStaff 0, voice 3 at line 107 col 12)
7619QDEBUG : TestMxmlIO::voiceMapper3() ImportMusicXml: too many voices (staff 1, relStaff 1, voice 4 at line 235 col 12)
7620QDEBUG : TestMxmlIO::voiceMapper3() Parsing time elapsed: 2 ms
7621QDEBUG : TestMxmlIO::voiceMapper3() importMusicXml() return 0
7622QFATAL : TestMxmlIO::voiceMapper3() Received signal 11
7623FAIL! : TestMxmlIO::voiceMapper3() Received a fatal error.
7624 Loc: [Unknown file(0)]

Related to your changes?

@MarcSabatella
Copy link
Contributor Author

This test crashes for me locally too, so I will be able to investigate.

@MarcSabatella
Copy link
Contributor Author

I still figure it's a fluke, but I did make another optimization with that last commit, and now:

16/33 Test #16: tst_benchmark .................... Passed 9.87 sec

@lasconic
Copy link
Contributor

lasconic commented Mar 7, 2014

A fluke or not? you have been lucky twice then. Here are the result of tst_benchmark for the last 20 builds on Travis (just wrote an ugly python script). Yours is exceptionally low.. but ok other are quite high with no reason...

673c2dfd0d
Merge pull request #722 from Gai-Luron/aperture-grip  Add grip to modify hairpin
16/33 Test #16: tst_benchmark ....................   Passed   11.97 sec
5e2f88ace3
Merge pull request #744 from Jojo-Schmitz/orig-texts  Some more fixes for transl
16/33 Test #16: tst_benchmark ....................   Passed   11.24 sec
5eba25e580
fix warning due to duplicate name
16/33 Test #16: tst_benchmark ....................   Passed   11.67 sec
2a2790b70e
fixes, tweaks, and optimizations
16/33 Test #16: tst_benchmark ....................   Passed    9.87 sec
ac940eecb4
Add proportional grip aperture positionning whane hairpin is small
16/33 Test #16: tst_benchmark ....................   Passed   12.78 sec
7a6b318fd8
fix #23038: reduce height of dialogs to 560 pixels  so they easily fit a 1024x60
16/33 Test #16: tst_benchmark ....................   Passed   18.59 sec
86a56b2fa6
fix warning due to duplicate name
16/33 Test #16: tst_benchmark ....................   Passed   16.19 sec
3a637c99e5
untranslate yet another string from debugger
16/33 Test #16: tst_benchmark ....................   Passed   11.27 sec
d162a9ee91
simplify TextLine, use only text and drop symbols
16/33 Test #16: tst_benchmark ....................   Passed   10.08 sec
eda573648d
adding Chinese (Honkong)  as it has been requested on Transifex. Taking the ts f
71c94f4d73
adding/removing colons in some dialogs  and making insert measure dialog similar
16/33 Test #16: tst_benchmark ....................   Passed   14.62 sec
f173ccdbbb
fix #3325: layout of multi-voice seconds and unisons
16/33 Test #16: tst_benchmark ....................   Passed   10.68 sec
520491f470
'untranslate' some strings from the debugger
16/33 Test #16: tst_benchmark ....................   Passed   11.64 sec
4af604cb58
Merge pull request #740 from AntonioBL/beam_direction_paste  fix #7805 : copy an
16/33 Test #16: tst_benchmark ....................   Passed   12.16 sec
8200c846a1
update Gonville
16/33 Test #16: tst_benchmark ....................   Passed   11.65 sec
dc4299ada0
add vtest for ottava
16/33 Test #16: tst_benchmark ....................   Passed   11.82 sec
cff4e87b8f
change semantic of tick2 for line spanners
16/33 Test #16: tst_benchmark ....................   Passed   12.90 sec
a2818ac628
fix #7805 : copy and paste does not preserve stem direction for beamed notes
16/33 Test #16: tst_benchmark ....................   Passed   10.62 sec
437c84da32
 - changed sizen flagsFixes:
63de5a3711
option to disable loading of parts and images
16/33 Test #16: tst_benchmark ....................   Passed   16.08 sec
af0bcb5dbe
Merge pull request #738 from Jojo-Schmitz/nogui  break in gui and no-gui case
16/33 Test #16: tst_benchmark ....................   Passed   13.07 sec
5244d20881
break in gui and no-gui case
3310bf2221
Merge pull request #737 from Jojo-Schmitz/14764-qDebug+abort-to-qFatal  fix #147
16/33 Test #16: tst_benchmark ....................   Passed   11.21 sec
4646890346
changing all assert() to Q_ASSERT()  except for thirdparty/portmidi/
16/33 Test #16: tst_benchmark ....................   Passed   10.80 sec
65bba694c3
fix #14764  convert qDebug();abort() to qFatal() and if(cond) abort() to Q_ASSER
16/33 Test #16: tst_benchmark ....................   Passed   11.13 sec

@MarcSabatella
Copy link
Contributor Author

If nothing else, I think we don't have to worry I made things worse.

So, I want to look at dot position relative to the offset notes. Right now, if the notes on the left are dotted, the dotted appear after the notes on the right. This unfortunately not right - see BB p. 56-8. With any luck, it will be easy to adjust the code to offset the notes further to make room for dots for the simple cases at least, and I'd like to give it a shot before we merge this, since I'll have to alter some of my code to handle the dots.

The remaining issues with accidentals (like the one you showed me) are less likely to require any changes to my code, so I think I'll look at those separately later.

@MarcSabatella
Copy link
Contributor Author

My luck ran out on the benchmark, but dots work well.
image

@lasconic
Copy link
Contributor

lasconic commented Mar 8, 2014

Not sure you want to discuss this here or expose it on the issue tracker to get more feedback.

  • The first chord seems wrong. The dot is too close. (it's weird because the double dot is fine in the last measure)
  • first measure, second line looks wrong. Not sure where the dots come from.

@MarcSabatella
Copy link
Contributor Author

You're right about the inconsistent dot spacing, and that I should post to issue tracker for further feedback. I'll do that after fix this. Actually, in hindsight, I know exactly why it's too close for the single dot; I just don't understand why it's different for the double dot.

Regarding measure 41, that's deliberate. It's not obvious, but these are four voices, one note per voice. I was trying to make sure I got the position right in a case where some upstem notes have dots but others don't. There are compromises to make; I'll discuss those in the thread too.

@MarcSabatella
Copy link
Contributor Author

I've looked at the failed test and understand why it fails, but I'm not sure what to do and could use help.

The accidental position fix I made in that last commit is basically correct - the calculation of the accidental position needs to take the chord offset into account, not just the note offset. That code basically works. The test that is failing is the minWidth test in libmscore/measure. This test loads a score, does a layout, notes the minWidth of a couple of measures, then does a layout again to see if anything changed. Well, things do sometimes change on the first layout after load if the score contains manual adjustments. Not sure why, but I know this was true before my changes too. My change just made this a little worse.

I'm about to commit another change with some optimizations and also some instrumentation I added while investigating, in case anyone else finds it useful. The output shows information used to calculate the position of accidentals attached to offset chords. Start up MuseScore with Promenade, look at stdout, then do a Select All to force another layout, then look at stdout again. You'll see the chord offsets change from the initial load to the Select All. This changes the accidental position, and I'm pretty sure that is what causes measure minWidth to change.

@MarcSabatella
Copy link
Contributor Author

I've figured this out. As mentioned, some amount of this same effect - some chords moving slightly on first layout after load of score - happens with or without my changes. I don't know all the causes, but I've found the cause in my particular case. I was using stem()->width() rather than stem->lineWidth() in my chord offset calculations, and the former is apparently not yet meaningful (I guess stems have not been laid out yet). Changing my calls to use lineWidth() instead fixes this, and the test now passes for me.

So my next commit should result in passing tests and bring us closer to where I want to be. There is one last thing I'll still want to add to this PR before calling it ready to merge, and that's another fix to accidental placement. Accidentals can be placed too far from a chord if seconds exist on a downstem (true in 1.3 also). When I have that fixed, I'll post again to issue thread for comments, and then I'll consider basic chord (note/dot/accidental) layout as good as it needs to be (although there is still the stem attachment issue I mentioned in the issue thread; I guess I'll submit that separately if it doesn't already exist).

@MarcSabatella
Copy link
Contributor Author

Closing this to re-open a new one after rebasing (haven't figured out a way around that).

@MarcSabatella MarcSabatella deleted the 3325-seconds branch March 14, 2014 22:02
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.

3 participants