[JW Lua] Convert FCExpression::GetHorizontalPos() to staff spaces

Robert Patterson robert at robertgpatterson.com
Tue Sep 28 15:48:33 CEST 2021


Not to get all Douglas Adamsy on you, the literal answer to your question
in the subject of this thread is 24. That is, a staff space is 24 evpus.
But it seems your question is really about how to scale evpu relative to
staff percentages.

This depends on what you are trying to do. If I recall correctly,
expression position scales with system percent but perhaps not with staff
percent. You will have to scale your evpu to the correct frame for your
project. This can be a tedious and backwards kind of process. You will need
to use FCCellMetrics::StaffScaling to do this, and these will of course be
different in each score or part.

There are a number of scripts at Nick Mazuk's repo that have figured this
kind of thing out. You could look at dynamics_move_above_staff.lua,
articulation.lua, or note_entry.lua. Note that staff-level scaling affects
vertical scaling and horizontal scaling in different ways.

Good luck,
Robert


On Tue, Sep 28, 2021 at 1:22 AM Thomas Weber <thomas.weber at notengrafik.com>
wrote:

> Same question could be asked as "How to retrieve the staff size".
>
> As HorizontalPos is in EVPUs that are not relative to the staff size (i.e.
> absolute offset "in inches" remains the same, no matter what the staff size
> is), I would have to find out the staff size in terms of EVPUs.
> __FCStaffBase::GetLineSpacing() is not what I'm looking for as it just
> "spreads out" or compresses the staff lines, not changing the "font size".
>
>
> --
>
> Notengrafik Berlin GmbH
> HRB 150007
>
> UstID: DE 289234097
> Geschäftsführer:
> Thomas Weber und Werner J. Wolff
>
> fon: +49 30 25359505
> Friedrichstraße 23a
> 10969 Berlin
>
> notengrafik.com
>
>
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20210928/f3c7f01b/attachment.html>


More information about the JWLua mailing list