[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: misplaced-note-head bug (issue 5303)
From: |
Lukas-Fabian Moser |
Subject: |
Re: misplaced-note-head bug (issue 5303) |
Date: |
Sat, 29 Jun 2019 23:09:26 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.1 |
Hi David,
Aah, I'm sorry - I was not aware that casting to int works by
/truncating/. Then it's quite obvious what's happening here.
Which code do you think has a problem related to your example?
Compile
\version "2.19" \score { { <d' f' a'>4 \clef bass <f, a, c> }
\layout { #(layout-set-staff-size 19) % different magic number
with layout-set-absolute-staff-size: %
#(layout-set-absolute-staff-size 6.011034) } }
with a LilyPond patched with
diff --git a/lily/stem.cc b/lily/stem.cc index 37aa40c250..57995d8af7
100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -627,6 +627,7 @@
Stem::calc_positioning_done (SCM smob) parity = true;
lastpos = int (p); + message (_f ("In Stem::calc_positioning_done:
lastpos = int (p) truncates %f to %f", p, lastpos)); } return
SCM_BOOL_T;
against current master (or in fact any LilyPond version starting from
your commit cb6024decee0aafd84baafe34115fc1b2d179df6 implementing
changing the staff line spacing in the \layout block). This exhibits
issue 5303 (see attached image) and shows where the int () cast causes
the problem:
Processing `/home/lukas/Musik/lp/Misplaced_note_head_MWE.ly'
Parsing...
Interpreting music...
Preprocessing graphical objects...
In Stem::calc_positioning_done: lastpos = int (p) truncates -3.000000 to
-2.000000
In Stem::calc_positioning_done: lastpos = int (p) truncates -1.000000 to
-1.000000
In Stem::calc_positioning_done: lastpos = int (p) truncates -3.000000 to
-2.000000
In Stem::calc_positioning_done: lastpos = int (p) truncates -1.000000 to
-1.000000
Finding the ideal number of pages...
Fitting music on 1 page...
Drawing systems...
Layout output to `/tmp/lilypond-lXcH6C'...
Converting to `Misplaced_note_head_MWE.pdf'...
Deleting `/tmp/lilypond-lXcH6C'...
Success: compilation successfully completed
I'm not sure why the reduction to an integer is done in the first place.
For the MWE, both keeping it as a float
lastpos = p;
and explicitly rounding 'correctly' to an integer
lastpos = int (round (p) );
solve the problem. I expect one should run both versions through a
comparison of regression tests, but I never did this before, so I'd
better leave this for tomorrow. :-)
Best Lukas
image.png
Description: PNG image
- Strange space between beam and slur, Lukas-Fabian Moser, 2019/06/22
- Re: Strange space between beam and slur, Carl Sorensen, 2019/06/22
- Re: Strange space between beam and slur, James, 2019/06/23
- Message not available
- Message not available
- Message not available
- Message not available
- Message not available
- Message not available
- Re: Strange space between beam and slur, Lukas-Fabian Moser, 2019/06/25
- Re: Strange space between beam and slur, David Kastrup, 2019/06/25
- Re: Strange space between beam and slur, Lukas-Fabian Moser, 2019/06/25
- misplaced-note-head bug (issue 5303), Lukas-Fabian Moser, 2019/06/29
- Re: misplaced-note-head bug (issue 5303), Lukas-Fabian Moser, 2019/06/29
- Re: misplaced-note-head bug (issue 5303), David Kastrup, 2019/06/29
- Re: misplaced-note-head bug (issue 5303),
Lukas-Fabian Moser <=