[JW Lua] Hairpins

Martin Marris mmarris at notecraft.com
Thu Dec 24 14:33:44 CET 2020


OK I have figured it out. The key clue came from Jan, who pointed out that this is set using FCSmartShapeSegment. Until now, I had ignored that class altogether because I assumed it was only relevant for SmartShapes that span multiples measures or systems. 

 

This code, on its own, may be enough. All it does is drag back the right-end of each hairpin by 60 units. Luckily, the source material I am working with is voluminous (600 conductor scores and probably more to come) but simple. I don’t think any hairpins span more than one bar, anywhere. I will try to make it more sophisticated so that it only adjusts hairpins that end at the end of a bar, but even that may be over-doing it.

 

For some reason I did not have to use the “SetCustom” stuff at all.

 

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()

        segment:SetEndpointOffsetX(-60)

        smartshape:Save()

    end

end

 

Something like this would help end the pain for the large number of Finale users (judging from a Google search) who seem to be frustrated by these collisions between hairpins and group barlines.

 

Martin

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20201224/c11f29dc/attachment.html>


More information about the JWLua mailing list