[JW Lua] Hairpins
Robert Patterson
robert at robertgpatterson.com
Thu Dec 24 17:02:22 CET 2020
For Fin14 or higher, I would only modify hairpins where hairpinMeasurePos =
measureDuration. However, for files created before Fin14 the 80 EDU fudge
factor makes sense.
If you really want to be complete, you could also check for hairpins that
span systems and adjust their left continuation points as well. (The "left
continuation point" is actually the *right* side of the left/first chunk of
a system-spanning smart shape. I haven't researched the nomenclature for
this in the PDK Framework, however. It may be different)
Another check I would consider for a general solution is only to do this if
there is actually a group barline. But that may be overkill for
your purposes.
On Thu, Dec 24, 2020 at 9:13 AM Martin Marris <mmarris at notecraft.com> wrote:
> So here is the slightly more sophisticated version, which only adjusts
> hairpin end-points if they come close to a barline. I think I am mixing a
> lot of apples with a lot of oranges, but it seems to work. The numbers are
> pretty arbitrary and would not work except in this tightly controlled
> project where I already know what the scores generally look like. So that’s
> it for now (crossing fingers!).
>
>
>
> musicregion = finale.FCMusicRegion()
>
> musicregion:SetFullDocument()
>
> local marks = finale.FCSmartShapeMeasureMarks()
>
> marks:LoadAllForRegion(musicregion, true)
>
> for mark in each(marks) do
>
> local smartshape = mark:CreateSmartShape()
>
> if smartshape:IsHairpin() then
>
> local segment = smartshape:GetTerminateSegmentRight()
>
> measureID = segment.Measure
>
> measure = finale.FCMeasure()
>
> measure:Load(measureID)
>
> measureDuration = measure:GetDuration()
>
> hairpinMeasurePos = segment.MeasurePos
>
> if measureDuration - hairpinMeasurePos < 80 then
> --test for hairpin ending close to barline
>
> segment.EndpointOffsetX = segment.EndpointOffsetX - 30
> --pull it back a bit
>
> smartshape:Save()
>
> end
>
> end
>
> end
>
>
>
> Martin
>
>
> _______________________________________________
> 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/20201224/d1385ed9/attachment.htm>
More information about the JWLua
mailing list