Problems with vertical positions

47 views
Skip to first unread message

Hanns Holger Rutz

unread,
Aug 12, 2013, 7:39:12 AM8/12/13
to ab...@googlegroups.com
The rendering has problems with the vertical note head positions, it seems. For example look at this image:

Screen shot 2013-08-12 at 13.35.07.png

Hanns Holger Rutz

unread,
Aug 12, 2013, 8:37:41 AM8/12/13
to ab...@googlegroups.com
ok, so at least with my build from the last abc4j revision, the spacing is definitely wrong. I compared this with Five Line Skink, which as I understand is based on abc4j:

The source (example from Skink):

X:1
T:Fugue in Cm
C:J.S.Bach
V:1 %program 1 19
V:2 %program 1 19
V:3 bass %program 1 19
M:4/4
Q:100
K:Cm
[V:1] z8 | z8 | zg/^f/g ce g/f/g=a |
[V:2] z c/=B/c GA c/B/cd | G c/=B/c dF/G/A2G/F/ | E/c/=B/=A/G/F/ E/D/ Cedc |
[V:3] z8 | z8 | z8 |

Rendered in Skink:

sink.png
abc4j.png

Hanns Holger Rutz

unread,
Aug 12, 2013, 11:09:38 AM8/12/13
to ab...@googlegroups.com
i am also wondering, looking at the example images:

https://code.google.com/p/abc4j/wiki/ScoreRenditionExamples

if i render the same code, e.g. last example, there are quite a few differences apart from note heads and stems being bad positioned, e.g. there are some extra slurs in my build that don't show up in the web page image (for the tuplets).

in general the web site images are much prettier. is that because something has been fiddled around since 2010 that broke rendering code, or a platform issue (i'm using java 6 on os x, but with standard sun renderer)?

( if no one has a suggestion, i guess i'll try to branch from a commit back in 2010 and see if that renders differently. )

best, .h.h.
> Rendered with abc4j:
>
> <sink.png><abc4j.png>
> Skink seems to use a different font (although I like abc4j's better I must say). But more importantly, it properly aligns the three voices and prints the correct bass clef. abc4j on the other hand draws the higher pitched notes way to far towards the upper part of the screen (see the F# in the third bar of first voice).....
>
> Any clues why that is the case?
>
> Best, .h.h.
>
>
> On 12 Aug 2013, at 13:39, Hanns Holger Rutz wrote:
>
>> The rendering has problems with the vertical note head positions, it seems. For example look at this image:
>>
>>
>>
>> While some heads seem in good position, many are two way down. Especially in the second bar it appears that the higher the pitch, the more "off" the positions? Besides, why are the upper extended lines starting much farther from the core five lines than the lower extended lines?
>>
>> I had a look at the rendering good, but it is pretty much impenetrable... Problems could be line drawing, string drawing, or font information. I tried multiple rendering hints (e.g. stroke-pure, fractional-metrics), they don't have any effect.
>>
>> Thanks for hints, .h.h.
>>
>> <Screen shot 2013-08-12 at 13.35.07.png>--
>> You received this message because you are subscribed to the Google Groups "abc4j" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to abc4j+un...@googlegroups.com.
>> To post to this group, send email to ab...@googlegroups.com.
>> Visit this group at http://groups.google.com/group/abc4j.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>
>
> --
> You received this message because you are subscribed to the Google Groups "abc4j" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to abc4j+un...@googlegroups.com.
> To post to this group, send email to ab...@googlegroups.com.
> Visit this group at http://groups.google.com/group/abc4j.
> For more options, visit https://groups.google.com/groups/opt_out.

---
Ich wähle am 22.09. Merkel, Friedrich und Rösler ab. #Supergrundrecht



Hanns Holger Rutz

unread,
Aug 12, 2013, 1:52:47 PM8/12/13
to ab...@googlegroups.com

supersolver

unread,
Jan 1, 2015, 12:36:58 AM1/1/15
to ab...@googlegroups.com
Another reason the spacing is wrong is due to rounding errors. If the height between lines is supposed to be 5.75 pixels for example, it will be rounded to 5, and for a note that is 10 notes above the bottom line on the cleff, it could be as much as 7.5 pixels off.

The problem with the dimension class is that it stores the result as an integer. But you can get around this if you create a custom Dimension class and then use it instead. If you like this class can also extend Dimension2D as well, since the function definitions allow you to return double for getWidth and getHeight.

iubito

unread,
Jan 6, 2015, 5:36:31 PM1/6/15
to ab...@googlegroups.com
Hi!
Are you using the downloadable version or the svn version?

Hanns Holger Rutz

unread,
Jan 6, 2015, 5:37:33 PM1/6/15
to ab...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

hi,

nevermind, i forked the project and corrected the display for my
needs. It was for a particular research project that is completed now,
so I haven't touched it since a while.

best, .h.h.
> -- You received this message because you are subscribed to the
> Google Groups "abc4j" group. To unsubscribe from this group and
> stop receiving emails from it, send an email to
> abc4j+un...@googlegroups.com
> <mailto:abc4j+un...@googlegroups.com>. To post to this group,
> send email to ab...@googlegroups.com
> <mailto:ab...@googlegroups.com>. Visit this group at
> http://groups.google.com/group/abc4j. For more options, visit
> https://groups.google.com/d/optout.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBAgAGBQJUrGOrAAoJEKZFmaPaYk6Q5NgP/ixIh638Y+Ko2PwmS+b88pMo
P1qO4OM373BZt1L1LWql4QtgbwIPw97qsMlKDjfFvzDm2EEO79W9daMTix0zlk0x
6WQfeb3EC08BoYtiO/YI6lnpmsC7reKinoxPNcy+73mcmmTNjaPoQE3SorQeDA47
PLuiHoQFKMhOD/i877h5jjoIQrosrqNzzSP+I3VdvIkOKkEuNQPCf3PgG5gOG8yK
iSyjEPYkfLZPc1giBRaFB6YvOWmXSI7SVjJClkfVjTdJS8XMmo0M/BDID2P1HYAc
wKZb6/pjacK5odMFoXbZvvhsjwn1zuf/PqYg7CxPn3eVUqaaqH/8z+LDAYEpApGb
5tlAQSSUJxXDvw90OCfMbty82sbOFRjFlVGQxhLgMuaaYB2+XQOUc5rg5Vg9Fpbm
NkrbOeR/nJDa9srHCzc8+p4HeQtBWaQgey5absPgj55VKhjzDJE1gtsjPeLg7xyF
zSlGYx43CdtegMqgp4hJ2/HJdXalWofa2YYuwDgVBLOIyScVmDyy8nrOi1b1EYF8
UiDSKiNF2VDDX3jEcdfga7hhuG/zJIixmVBuoSsTN0N5/eC+6PJmCSnNEISTS6eL
yqSxFI1eqYGakSYSYQD9mOR020/95V0rrB6YrD9uSj7YJvyFEDW1Os92aioCeaGG
JBpkk/jYwlcUvT2Ix0F5
=0uvt
-----END PGP SIGNATURE-----

supersolver

unread,
Jan 6, 2015, 5:55:13 PM1/6/15
to ab...@googlegroups.com
I'm using the svn version from the abc4j website. I switched the width and height (following Hanns advice), and then created a simple Dimensions class that uses double variables instead of integers. Both helped a lot.
Reply all
Reply to author
Forward
0 new messages